config: make members feature specific

Channel and address are only sensible for boards that actually have a
transceiver.
This commit is contained in:
Oleg Hahm 2014-10-30 17:50:07 +01:00
parent 6b39ce9650
commit 576e76db51
2 changed files with 14 additions and 8 deletions

View File

@ -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 */
};

View File

@ -20,7 +20,9 @@
#define CONFIG_H
#include <stdint.h>
#include "board.h"
#ifdef HAS_RADIO
#include "radio/types.h"
#endif
#ifdef __cplusplus
extern "C" {
@ -38,10 +40,12 @@ extern char configmem[];
* @brief Stores configuration data of the node.
*/
typedef struct {
uint16_t id; /**< unique node identifier */
uint16_t id; /**< unique node identifier */
#ifdef HAS_RADIO
radio_address_t radio_address; /**< address for radio communication */
uint8_t radio_channel; /**< current frequency */
char name[CONFIG_NAME_LEN]; /**< name of the node */
uint8_t radio_channel; /**< current frequency */
#endif
char name[CONFIG_NAME_LEN]; /**< name of the node */
} config_t;
/**