fix bsp_radio project.
@@ -43,8 +43,6 @@ typedef enum {
} app_state_t;
typedef struct {
- uint8_t num_radioTimerOverflows;
- uint8_t num_radioTimerCompare;
uint8_t num_startFrame;
uint8_t num_endFrame;
uint8_t num_timer;
@@ -66,8 +64,6 @@ app_vars_t app_vars;
//=========================== prototypes ======================================
-void cb_radioTimerOverflows(void);
-void cb_radioTimerCompare(void);
void cb_startFrame(PORT_TIMER_WIDTH timestamp);
void cb_endFrame(PORT_TIMER_WIDTH timestamp);
void cb_timer(void);
@@ -87,7 +83,6 @@ int mote_main(void) {
board_init();
// add callback functions radio
- sctimer_set_callback(cb_radioTimerOverflows);
radio_setStartFrameCb(cb_startFrame);
radio_setEndFrameCb(cb_endFrame);
@@ -99,7 +94,7 @@ int mote_main(void) {
// start bsp timer
sctimer_set_callback(cb_timer);
- sctimer_setCompare(TIMER_PERIOD);
+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);
sctimer_enable();
// prepare radio
@@ -222,16 +217,6 @@ int mote_main(void) {
//=========================== callbacks =======================================
-void cb_radioTimerOverflows(void) {
- // update debug stats
- app_dbg.num_radioTimerOverflows++;
-}
-
-void cb_radioTimerCompare(void) {
- // update debug stats
- app_dbg.num_radioTimerCompare++;
-}
-
void cb_startFrame(PORT_TIMER_WIDTH timestamp) {
// set flag
app_vars.flags |= APP_FLAG_START_FRAME;
@@ -254,4 +239,6 @@ void cb_timer(void) {
// update debug stats
app_dbg.num_timer++;
+
+ sctimer_setCompare(sctimer_readCounter()+TIMER_PERIOD);
}
