update slot type that radio isr refers to.
@@ -128,6 +128,8 @@ typedef struct{
app_vars_t app_vars;
debug_vars_t debug_vars;
+const uint8_t debuginfo[] = "ack sent";
+
//=========================== prototypes ======================================
void cb_startFrame(PORT_TIMER_WIDTH timestamp);
@@ -380,7 +382,6 @@ void cb_startFrame(PORT_TIMER_WIDTH timestamp) {
switch(app_vars.state){
case S_LISTENING:
app_vars.state = S_RECEIVING;
-
break;
default:
// wrong state
@@ -424,6 +425,8 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {
radio_rxEnable();
radio_rxNow();
+ app_vars.type = T_RX;
+
app_vars.state = S_LISTENING;
break;
@@ -468,8 +471,6 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {
if (app_vars.rxpk_crc && app_vars.packet_len == TARGET_PKT_LEN){
- leds_debug_toggle();
-
pkt_channel = SYNC_CHANNEL+((app_vars.packet[0] & 0xf0)>>4);
pkt_seqNum = ((uint16_t)(app_vars.packet[0] & 0x0f))<<8 |
(uint16_t)(app_vars.packet[1]);
@@ -514,6 +515,7 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) {
radio_txEnable();
radio_txNow();
+ app_vars.type = T_TX;
app_vars.state = S_ACK_SEND;
}
} else {
