INSAT Mini Project
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_6180XA1 by
Diff: Components/VL6180X/vl6180x_class.cpp
- Revision:
- 23:dfb5ccc7b780
- Parent:
- 20:dd8390d615bf
- Child:
- 24:025afc3fe30f
--- a/Components/VL6180X/vl6180x_class.cpp Wed Oct 28 14:56:22 2015 +0000 +++ b/Components/VL6180X/vl6180x_class.cpp Fri Oct 30 11:35:36 2015 +0100 @@ -725,12 +725,13 @@ -int VL6180X::VL6180x_AlsSetThresholds(VL6180xDev_t dev, uint8_t low, uint8_t high) { +int VL6180X::VL6180x_AlsSetThresholds(VL6180xDev_t dev, uint8_t low, uint8_t high) { int status; LOG_FUNCTION_START("%d %d", (int )low, (int)high); - - status = VL6180x_WrByte(dev, SYSALS_THRESH_LOW, low); //FIXME i valori passati devono essere uint16_t (vedi registri), inoltre i valori delle soglie NON sono in lux! bisogna invertire il calcolo fatto nella VL6180x_AlsGetLux() + /*FIXME arguments have to be uint16_t (see SYSALS_THRESH_LOW and SYSALS_THRESH_HIGH registers) + Furthermore threshold values are not lux! You need to invert the computation made in VL6180x_AlsGetLux() */ + status = VL6180x_WrByte(dev, SYSALS_THRESH_LOW, low); if(!status ){ status = VL6180x_WrByte(dev, SYSALS_THRESH_HIGH, high); } @@ -2686,7 +2687,7 @@ VL6180x_On(); status=VL6180x_WaitDeviceBooted(Device); if(status) - printf("WaitDeviceBooted fail\n\r"); + VL6180x_ErrLog("WaitDeviceBooted fail\n\r"); status=IsPresent(); if(!status) {