mlaz commented on a change in pull request #836: [WIP] PWM add cycle interrupt 
handling to pwm_nrf52 driver
URL: https://github.com/apache/mynewt-core/pull/836#discussion_r170148793
 
 

 ##########
 File path: hw/drivers/pwm/pwm_nrf52/src/pwm_nrf52.c
 ##########
 @@ -177,9 +249,10 @@ nrf52_pwm_close(struct os_dev *odev)
 
     dev = (struct pwm_dev *) odev;
     inst_id = dev->pwm_instance_id;
+    assert(instances[inst_id].in_use);
 
 Review comment:
   > I think probably all these asserts needs to be just return codes.
   
   Agreed, on this case it makes perfect sense to have error codes. 
   
   IMHO, I'd say use error codes on recoverable situations, use asserts on 
unrecoverable situations (i.e. checking NULL pointers, array lengths, etc). 
I've seen here code produced under this practice, I think if everyone agrees, 
it would be 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to