Commit graph

87 commits

Author SHA1 Message Date
Robert Quattlebaum ed2dd29eda core/lib/settings: Added SETTINGS_CONF_SKIP_CONVENIENCE_FUNCS.
Unfortunately, some platforms don't properly drop unreferenced functions,
so on these broken platforms we can save a significant amount
of space by skipping the definition of the convenience functions.
2013-03-20 11:57:13 -07:00
Robert Quattlebaum 28a1e40ebd core/lib/settings: Generalized Settings Manager to work on any platform
This commit moves the Settings Manager from the AVR codebase
into the Contiki core library. Any platform that implements
the Contiki EEPROM API can now use the Settings Manager's
key-value store for storing their persistent configuration info.

The Settings Manager is a EEPROM-based key-value store. Keys
are 16-bit integers and values may be up to 16,383 bytes long.
It is intended to be used to store configuration-related information,
like network settings, radio channels, etc.

 * Robust data format which requires no initialization.
 * Supports multiple values with the same key.
 * Data can be appended without erasing EEPROM.
 * Max size of settings data can be easily increased in the future,
   as long as it doesn't overlap with application data.

The format was inspired by the [OLPC manufacturing data format][].

Since the beginning of EEPROM often contains application-specific
information, the best place to store settings is at the end of EEPROM
(the "top"). Because we are starting at the end of EEPROM, it makes
sense to grow the list of key-value pairs downward, toward the start of
EEPROM.

Each key-value pair is stored in memory in the following format:

Order    | Size     | Name         | Description
--------:|---------:|--------------|-------------------------------
       0 |        2 | `key`        | 16-bit key
      -2 |        1 | `size_check` | One's-complement of next byte
      -3 |   1 or 2 | `size`       | The size of `value`, in bytes
-4 or -5 | variable | `value`      | Value associated with `key`

The end of the key-value pairs is denoted by the first invalid entry.
An invalid entry has any of the following attributes:

 * The `size_check` byte doesn't match the one's compliment of the
   `size` byte (or `size_low` byte).
 * The key has a value of 0x0000.

[OLPC manufacturing data format]: http://wiki.laptop.org/go/Manufacturing_data
2013-03-20 11:57:13 -07:00
Adam Dunkels ef25cc6c58 Rimestats bugfix: only compile the rimestats printout if rimestats are enabled 2013-03-18 11:22:00 +01:00
Adam Dunkels 944537fccf Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
Niclas Finne a56793f401 Fixed compiler warnings 2012-01-09 14:54:50 +01:00
Niclas Finne 6d3571ed59 Updated to use clock_seconds() on all platforms 2011-09-19 17:42:19 +02:00
David Kopf d4eeeeb8c9 Remove inclusion of preprocessor directive in macro expansion. Some gcc's do not like that. 2011-08-17 13:13:55 -04:00
David Kopf b55dddcd38 Free rtimer for contikimac, add print-stats option 2011-08-15 14:55:18 -04:00
Joakim Eriksson d8e54ca585 fixed for compilation with IAR compiler 2011-04-06 20:14:30 +02:00
nifi f3d22e6287 dos2unix conversion 2011-01-07 11:55:36 +00:00
dak664 9c66df6de1 Fix ancient RAND_MAX compiler warning 2010-12-13 16:52:02 +00:00
adamdunkels fd4c0e64aa Removed old unused files rand.[ch]. By default, Contiki uses the libc implementations of the rand() and srand() functions. 2010-10-24 21:02:23 +00:00
adamdunkels 3ae774c91a Added a way to for specifying lists as parts of structs. These lists
must be initialized with a special LIST_STRUCT_INIT() call before
using.
2010-09-13 13:31:00 +00:00
adamdunkels a84cc7c8a0 Added a function for obtaining the next item on the list. This makes list iterations nicer, as the ->next pointer now is hidden within the list abstraction. 2010-06-15 18:54:27 +00:00
nifi 46f9f7e6c0 corrected include path 2010-06-15 13:31:22 +00:00
adamdunkels a1f69138d1 Avoid adding elements twice 2010-04-30 07:18:24 +00:00
fros4943 3394a3ef23 make sure not to add an already existing list element, as it breaks the list iteration functions 2010-03-22 11:29:58 +00:00
nvt-se bf2e85a57f supply an argument of the same type as the print format 2010-03-09 14:14:36 +00:00
adamdunkels 47578806b5 Removed semicolon from #define to allow the semicolon to be placed naturally after the macro is used 2010-02-23 18:27:04 +00:00
oliverschmidt 3f142f0718 Convert '@' correctly from PETSCII to ASCII - by leaving it alone. 2010-01-31 23:46:19 +00:00
adamdunkels f6715890de Made SENSORS_ACTIVATE() and SENSORS_DEACTIVATE() use non-pointers, for concistency 2010-01-14 20:13:34 +00:00
nifi 079db2af55 fixed sensors_find API 2010-01-14 20:04:38 +00:00
joxe dd6922906c replace void pointer types with int 2010-01-14 15:33:27 +00:00
nifi 480f72c95c changed argument for SENSORS_ACTIVATE/DEACTIVATE to be a pointer to the sensor structure 2010-01-14 14:17:08 +00:00
nifi 1d592b5680 removed obsolete structure 2010-01-14 13:55:21 +00:00
joxe 84d969ce85 simplified the sensors API - will break some platforms... 2010-01-14 13:29:56 +00:00
nvt-se b0a8154e96 make it possible to accumulate CRC values through crc16_data. 2009-05-14 12:05:04 +00:00
adamdunkels c330b23c57 Minor documentation addition 2009-05-06 15:07:35 +00:00
adamdunkels d298fcbbd0 Changed name of the internal struct memb_blocks to struct memb for consistency 2009-04-06 21:18:03 +00:00
adamdunkels b8860727ac A ring buffer library. The ring buffer library is useful in device drivers, where bytes can be safely written to the buffer from an interrupt handler, and read from non-interrupt code. 2009-03-01 20:23:56 +00:00
adamdunkels 0ded8897e6 Added a dummy function instead of a NULL callback in the textentry widget because sdcc does not like NULL function pointers 2009-02-24 21:30:02 +00:00
adamdunkels 13a3029435 Rewrote the random_rand() pseudo random number generator to use the libc rand() function instead 2009-02-11 11:09:59 +00:00
fros4943 bf39076206 added experimental checkpointing functionality:
currently only implemented on the sky platform
2009-02-04 17:49:15 +00:00
joxe d2dc732435 changed list_pop to return removed element 2008-12-16 09:59:42 +00:00
nvt-se 0a6ae9b7aa fixed documentation typos 2008-10-15 14:17:28 +00:00
adamdunkels 45e2f10989 Constness 2008-08-26 21:46:06 +00:00
adamdunkels a6148ac3d0 Moved unused code to backyard 2008-08-15 19:57:13 +00:00
adamdunkels 2f81a0463a Moved unused malloc code to backyard directory 2008-08-15 19:05:16 +00:00
adamdunkels 35261f5208 Added a function for computing the CRC16 over a portion of data 2008-07-07 23:24:36 +00:00
adamdunkels 985fb009bf Rename static function log2 to ilog2 to avoid clashes (and compiler warnings) with built-in function called log2 2008-07-03 23:40:12 +00:00
adamdunkels 1f005b6299 Moved energest.{c,h} from core/lib to core/sys: power profiling is a system mechanism, not a library 2008-07-03 23:36:30 +00:00
nifi d76474bc13 Changed energest_type_time() to first update the total time, if the device
is currently active, before returning the total time.

Added energest_flush() that updates the total time for all currently
active devices. It should be called periodically to avoid the time to
overflow for devices that are active for long periods of time.
2008-06-02 13:12:07 +00:00
joxe 7722a73abf modified API for fft 2008-04-25 22:12:25 +00:00
joxe 918616a1bf initial/alpha version of integer fft 2008-03-27 12:12:24 +00:00
oliverschmidt c49fdee653 Avoided compiler warning. 2008-02-10 12:30:57 +00:00
adamdunkels d9b52d1585 Added ENEGEST_SECOND 2008-01-21 12:36:17 +00:00
thiemovoigt 304898cd79 added support for devices with power levels (e.g. TX radio) 2008-01-14 16:18:39 +00:00
adamdunkels 28eaf5ee40 Moved C preprocessor concatenation macro to sys/cc.h 2008-01-14 09:22:50 +00:00
oliverschmidt d474777ff8 Moved textedit widget into backyard as it was never platform independent anyway (but relied on the C64 hibit cursor). 2007-11-20 20:41:11 +00:00
oliverschmidt 552969ed24 Adjusted include path. 2007-11-17 21:24:50 +00:00