this moves both the storage scan and the save code out of the main
thread and into the IO thread. It means that if we have more than 30
parameters saves in very rapid succession while armed that we can lose
parameter changes, but that is extremely unlikely.
This fixes an issue where parameter saves in flight can cause
considerable scheduling problems, sometimes several milliseconds
Setting a dataflash-file buffer size of less than or equal to 2kiB would
cause the startup-messagewriter to never push any messages other than
FMT out to the logs.
This is a combination of the return values of
critical_message_reserved_space and
non_messagewriter_message_reserved_space
This patch forces the startup messages out to the logs by ignoring the
space constraints every 100ms
../../libraries/AP_HAL_ChibiOS/UARTDriver.cpp:118:12: warning: 'int hal_console_vprintf(const char*, va_list)' defined but not used [-Wunused-function]
static int hal_console_vprintf(const char *fmt, va_list arg)
^
../../libraries/AP_HAL_Linux/Scheduler.cpp: In member function ‘void Linux::Scheduler::_debug_stack()’:
../../libraries/AP_HAL_Linux/Scheduler.cpp:127:47: warning: format ‘%zu’ expects a matching ‘size_t’ argument [-Wformat=]
_uart_thread.get_stack_usage());
^
../../libraries/AP_BattMonitor/AP_BattMonitor_UAVCAN.cpp: In member function ‘virtual void AP_BattMonitor_UAVCAN::init()’:
../../libraries/AP_BattMonitor/AP_BattMonitor_UAVCAN.cpp:15:123: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘AP_Int32 {aka AP_ParamT<int, (ap_var_type)3u>}’ [-Wformat=]
#define debug_bm_uavcan(level, fmt, args...) do { if ((level) <= AP_BoardConfig_CAN::get_can_debug()) { printf(fmt, ##args); }} while (0)
^
../../libraries/AP_BattMonitor/AP_BattMonitor_UAVCAN.cpp:36:33: note: in expansion of macro ‘debug_bm_uavcan’
debug_bm_uavcan(2, "UAVCAN BattMonitor BatteryInfo registered id: %d\n\r", _params._serial_number);