11 Commits

Author SHA1 Message Date
Beat Küng
a5cdff06d5 param: implement rate-limited autosave
- add a saving delay of 300ms
- save at most once every 2 seconds
2017-04-06 11:49:03 +02:00
Beat Küng
b4290b6b52 params: make param_t uint16_t on NuttX
param_t is only used as an offset and we have <1000 params, so an uint16_t
is enough.
This saves roughly 1KB of RAM. We only do that on NuttX because normal
integers have better performance in general.
Previously on amd64, this was even 64bits because it was an uintptr_t.
2017-03-14 21:30:53 +01:00
José Roberto de Souza
75e7cfcbe8 modules: flashparams: Change size to uint32_t
So flash sector of 64Kbyes and 128Kbytes can also be used.
2017-03-10 11:31:07 +01:00
Beat Küng
fa3a6b890c param & flashparam param_export: use value directly instead of calling param_get
This call is not needed, and will avoid deadlocks when locking is enabled.
2017-02-17 11:27:08 +01:00
Beat Küng
42967df63f param command: use param_* calls even if flash-based params are enabled
This will ensure proper locking.
2017-02-17 11:27:08 +01:00
Beat Küng
68bee1b847 flashparams: remove the locking stubs
locking will be done in the params module
2017-02-17 11:27:08 +01:00
Daniel Agar
0bc3c8dfc4 astyle src/modules/systemlib 2017-01-29 01:18:32 +01:00
David Sidrane
dc8c6ea5e5 White space fixes 2016-12-21 08:34:21 +01:00
Beat Küng
b020be13f6 flashparams: fix memory leak when saving parameters
A large buffer on the heap was not deallocated when parameters were saved,
but there were no changes to the parameters. In that case
parameter_flashfs_write() was not called, which was previously responsible
for freeing the buffer.

This patch moves the responsibility of freeing the buffer to the calling
side, which already explicitly allocates the buffer.
2016-11-29 10:38:11 +01:00
David Sidrane
8a2df2a458 Avoid unnecessary Write Cycle 2016-07-13 20:42:05 +02:00
David Sidrane
5e8d6375c9 Back Port nuttx_v3 FLASH based parameter hooks 2016-07-13 20:42:05 +02:00