drv_battery: Fix for incorrect log messages#1918
drv_battery: Fix for incorrect log messages#1918protectivedad wants to merge 7 commits intoopenshwprojects:mainfrom
Conversation
Removed unused reading of ADC which caused incorrect log messages saying device wasn't on battery.
dcfeca4 to
dd8fd3f
Compare
|
The documentation says setting |
36719fa to
aae31c4
Compare
Battery_Cycle 0 - caused polling every second. Now it will poll one last time and then stop polling. This ensures at least one poll on the device boot though without waiting the first reading might be invalid.
aae31c4 to
1fbd629
Compare
|
I experimented with increasing the timing of the first reading, because with my device the reading is only valid after the device finishes the boot. It didn't really make a difference unless I increased it above 5 cycles, so I left it the way it was 1 cycle. At one cycle the web page gets the first value (maybe invalid), but it never gets published. If anyone has a suggestion on how to ensure the first reading is good (in the driver) let me know. I use |
Readings below half of the minimum expected voltage are invalid and ignored. Only after a valid reading is the battery cycle set to a new battery cycle reference. This will ensure at least one good reading before turning off or changing the reading cycle.
|
Made the battery driver more resilient. Invalid readings (anything less than half the expected voltage) are ignored. Effectively this means the command |
Current driver does not use any channels. Changed code to reflect this.
|
should this be merged? seems sad not to make use of your work |
|
Has there been any other changes to the drv_battery anyone working on it? If not then I think it should be merged. |
Removed unused reading of ADC which caused incorrect log messages saying device wasn't on battery.
Changed "DEBUG" message after correct ADC reading to "INFO" so the battery information is still in the log.