diff --git a/Documentation/pycardium/light-sensor.rst b/Documentation/pycardium/light-sensor.rst index 353f6cf5a6a65a00061f14339010500958ddc228..199bb68e52bf60df110a008766b2f83cdbdc174c 100644 --- a/Documentation/pycardium/light-sensor.rst +++ b/Documentation/pycardium/light-sensor.rst @@ -8,8 +8,8 @@ be fairly stable. .. py:function:: light_sensor.start() - Turn on the ADC and start reading brightness values. This function must be - called before any measurements can be taken. + Turn on the ADC and start reading brightness values. (In past this function must be + called before any measurements can be taken.) .. py:function:: light_sensor.get_reading() diff --git a/epicardium/ble/card10.c b/epicardium/ble/card10.c index 6c82d1a8da35576348fa99aa2ffde3a109392630..9adfd649af549a740333694bbaad5e657a0e4353 100644 --- a/epicardium/ble/card10.c +++ b/epicardium/ble/card10.c @@ -233,9 +233,7 @@ static uint8_t readCard10CB( switch (handle) { case CARD10_LIGHT_SENSOR_VAL_HDL: - epic_light_sensor_run(); epic_light_sensor_get(&ui16); - // epic_light_sensor_stop(); stop it everywhere, also in py *pAttr->pValue = ui16; APP_TRACE_INFO1("ble-card10: read lightsensor: %d\n", ui16); return ATT_SUCCESS; diff --git a/epicardium/main.c b/epicardium/main.c index f97d8f3d4b5cc045ff46e2163c2c291fc1f7d55e..56f532a675960a4f86c375356ab795603a8f5c7b 100644 --- a/epicardium/main.c +++ b/epicardium/main.c @@ -126,6 +126,10 @@ int main(void) LOG_INFO("startup", "Initializing dispatcher ..."); api_dispatcher_init(); + /* light sensor */ + LOG_INFO("startup", "starting light sensor ..."); + epic_light_sensor_run(); + /* * See if there's a l0dable.elf to run. If not, run pycardium. * This is temporary until epicardium gets a l0dable API from pycardium.