You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/01/12 11:12:41 UTC

[GitHub] rymanluk commented on a change in pull request #718: MYNEWT-881 SensorAPI: LIS2DH12 set thresh cb fix

rymanluk commented on a change in pull request #718: MYNEWT-881 SensorAPI: LIS2DH12 set thresh cb fix
URL: https://github.com/apache/mynewt-core/pull/718#discussion_r161185606
 
 

 ##########
 File path: hw/drivers/sensors/lis2dh12/src/lis2dh12.c
 ##########
 @@ -1364,12 +1363,10 @@ lis2dh12_sensor_set_trigger_thresh(struct sensor *sensor,
 
         os_time_delay((OS_TICKS_PER_SEC * 100)/1000 + 1);
 
-        srec = malloc(sizeof(struct sensor_read_ev_ctx));
-        srec->srec_sensor = sensor;
-        srec->srec_type = type;
+        hal_gpio_irq_release(itf->si_low_pin);
 
 Review comment:
   I would consider to create sensor_unset_trigger_thresh_t  callback type for sensor_driver and create lis2dh12_sensor_unset_trigger_thresh which would basically do IRQ release.
   Having it, user would be able to stop listening for such events and also this function could be called from here, before setting new threshold is set

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services