#ifndef EGGMOTE_H #define EGGMOTE_H //////////////////////////////////////////////////// // something to tweak // //////////////////////////////////////////////////// // funny blinking at every sample, undefine! #define CHECK_SAMPLING // show when flash is full, undefine! #define SHOW_FULL_FLASH // ALWAYS_ERASE_FLASH // if TRUE always delete flash before starting // if FALSE flash is erased only after radio command #define ALWAYS_ERASE_FLASH FALSE // quantum is [ (1 second)/1024 ] enum { T_C = 5L, SETUP_TIME = 10*1024L, SYNC_TIME = 10*1024L, SYNC_TIMEOUT = 1*1024L, ERASE_TIME = 20*1024L, }; //////////////////////////////////////////////////// // no more to tweak, do not touch below // //////////////////////////////////////////////////// enum { AM_DATAMSG, AM_CMDMSG, AM_RADIOMSG }; enum { CMD_ERASE, CMD_ERASE_ACK, CMD_ERASE_DONE, CMD_READ, CMD_READ_ACK, CMD_READ_DONE, CMD_SYNC, CMD_SYNC_ACK, CMD_SYNC_DONE, CMD_STOP, CMD_STOP_ACK, CMD_STOP_DONE, CMD_START, CMD_START_ACK, CMD_START_DONE, CMD_FREEZE, CMD_FREEZE_ACK, CMD_FREEZE_DONE, }; enum { STATUS_SETUP, STATUS_SYNC, STATUS_LOG, }; enum { LOG_SIZE = 65535L, SENSOR_ERROR = 65535L, CMD_BUFFER_SIZE = 16 }; typedef nx_struct CmdMsg { nx_uint8_t cmd; } CmdMsg_t; typedef nx_struct DataMsg{ nx_uint16_t temp; nx_uint16_t hum; nx_uint16_t tsr; nx_uint16_t ar; nx_uint16_t volt; nx_uint16_t id; } DataMsg_t; #endif