mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rymanluk commented on a change in pull request #718: MYNEWT-881 SensorAPI: LIS2DH12 set thresh cb fix
Date Thu, 01 Jan 1970 00:00:00 GMT
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_r161186499
 
 

 ##########
 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);
 
-        hal_gpio_irq_init(itf->si_low_pin, lis2dh12_low_int1_irq_handler, srec,
-                          HAL_GPIO_TRIG_FALLING, HAL_GPIO_PULL_NONE);
+        rc = hal_gpio_irq_init(itf->si_low_pin, lis2dh12_low_int1_irq_handler, stt,
 
 Review comment:
   Maybe not related to this patch, but it seems only one handler for low and hiqh IRQ would
be sufficient If I understand it correctly. It looks like once interrupt happens sensor reads
sensor states so it knows what happened. Anyway, lis2dh12_low_int1_irq_handler and lis2dh12_high_int2_irq_handler
does exactly the same so we could have common lis2dh12_irq_handler. 
   
   

----------------------------------------------------------------
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

Mime
View raw message