20 Commits

Author SHA1 Message Date
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
Daniel Agar
016ee6ea59
battery: fix duplicate uORB publish and minor cleanup
- run battery_status module on adc_report publications rather than a fixed schedule
2020-10-05 11:01:58 -04:00
Matthias Grob
d06425d131 analog_battery: fix missing stdio include
This was not a problem before because battery.h
included the adc driver and implicitly snprintf
was defined through there.
2020-09-01 10:25:03 +02:00
Oleg
172a4e3557 batterry_status: fix checking default v_div 2020-08-30 11:09:59 -04:00
Oleg
a18f22bd91
batterry_status: fix checking default a_per_v 2020-08-27 21:47:27 -04:00
Daniel Agar
942eb83184 sensors: keep legacy params active (BAT_V_DIV/BAT_A_PER_V) for QGC SITL
- fixes https://github.com/PX4/Firmware/issues/15505
2020-08-12 11:57:34 -04:00
Matthias Grob
88c21337fa Make all battery sensor drivers report their sample interval
To make use of the time abstraction in the leaky integrator.
2020-05-25 11:04:24 +02:00
Julian Oes
f650b91718 battery: check source param inside battery lib
This moves the handling of the BAT%d_SOURCE param inside of the battery
library. Users of the library now pass the source instead of the flag
whether to publish. The battery library then checks if the source is
selected using the param and publishes accordingly.

Since we removed the strange system_source flag, we now need to look at
all batteries in commander.
For current estimation - I think - it makes sense to sum them up.
2020-04-06 15:56:54 +02:00
SalimTerryLi
dc8e775d8f
ADC: replace ioctl with uorb message (#14087) 2020-03-20 11:23:32 +01:00
Timothy Scott
4c1adc088f Removed all swapping of uORB instances 2020-02-21 22:38:26 -08:00
Daniel Agar
21a8d7db7f WorkItem modules: Run() shouldn't be public 2020-01-22 12:03:03 -05:00
Daniel Agar
d19f18d40b linux boards (ocpoc, bbblue, navio2) replace custom adc drivers with simple px4_arch implementation 2020-01-07 14:04:13 -05:00
Daniel Agar
de9e4dda4c battery: delete unused armed 2019-12-12 09:48:45 -05:00
Timothy Scott
11bbc8ae34 Code cleanup 2019-12-12 04:39:53 -08:00
Timothy Scott
993fa5bd37 Refactored to work with new battery_status module 2019-12-05 16:38:04 +01:00
Beat Küng
1371887578 board config: add define for adc voltage scaling 2019-11-21 08:19:59 +01:00
Beat Küng
4b290c4903 voltage & current scaling: use px4_arch_adc_dn_fullcount() instead of 4096
Fixes the scaling on h7 boards (the ADC has 16 bits resolution).
2019-11-21 08:19:59 +01:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Daniel Agar
94de12ef19
sensors: own BAT_V_DIV and BAT_A_PER_V params (#13299)
- this is currently necessary for the QGC power setup gui, but should be reverted in the future
 - fixes #13292
2019-10-28 16:03:05 -04:00
Daniel Agar
6a0f5249f8
sensors: split out analog battery handling to new standalone battery_status module 2019-10-21 13:40:23 -04:00