Merge pull request #1900 from OlegHahm/config_radio_address_t

config: use radio_address_t in config_t
dev/timer
Thomas Eichinger 9 years ago
commit 5965220efe

@ -39,10 +39,6 @@
#include <auto_init.h>
#endif
#ifdef MODULE_CONFIG
#include "config.h"
#endif
volatile int lpm_prevent_sleep = 0;
extern int main(void);
@ -97,11 +93,6 @@ void kernel_init(void)
printf("kernel_init(): error creating main task.\n");
}
#ifdef MODULE_CONFIG
DEBUG("kernel_init(): loading config\n");
config_load();
#endif
printf("kernel_init(): jumping into first task...\n");
cpu_switch_context_exit();

@ -19,6 +19,10 @@
#include "auto_init.h"
#ifdef MODULE_CONFIG
#include "config.h"
#endif
#ifdef MODULE_SHT11
#include "sht11.h"
#endif
@ -187,6 +191,11 @@ void auto_init_net_if(void)
void auto_init(void)
{
#ifdef MODULE_CONFIG
DEBUG("Auto init loading config\n");
config_load();
#endif
#ifdef MODULE_VTIMER
DEBUG("Auto init vtimer module.\n");
vtimer_init();

@ -19,8 +19,10 @@
#include <config.h>
config_t sysconfig = {
0, ///< default ID
0, ///< default radio address
0, ///< default radio channel
"foobar", ///< default name
0, /**< default ID */
#ifdef HAS_RADIO
0, /**< default radio address */
0, /**< default radio channel */
#endif
"foobar", /**< default name */
};

@ -20,6 +20,9 @@
#define CONFIG_H
#include <stdint.h>
#ifdef HAS_RADIO
#include "radio/types.h"
#endif
#ifdef __cplusplus
extern "C" {
@ -37,16 +40,21 @@ extern char configmem[];
* @brief Stores configuration data of the node.
*/
typedef struct {
uint16_t id; /**< unique node identifier */
uint8_t radio_address; /**< address for radio communication */
uint8_t radio_channel; /**< current frequency */
char name[CONFIG_NAME_LEN]; /**< name of the node */
/* cppcheck-suppress unusedStructMember : is used in sys/shell/commands/sc_id.c */
uint16_t id; /**< unique node identifier */
#ifdef HAS_RADIO
radio_address_t radio_address; /**< address for radio communication */
uint8_t radio_channel; /**< current frequency */
#endif
/* cppcheck-suppress unusedStructMember : useful for debug purposes */
char name[CONFIG_NAME_LEN]; /**< name of the node */
} config_t;
/**
* @brief Element to store in flashrom.
*/
typedef struct {
/* cppcheck-suppress unusedStructMember : magic_key is only read directly from ROM */
uint16_t magic_key; /**< validity check */
config_t config; /**< the node's configuration */
} configmem_t;
Loading…
Cancel
Save