Skip to content

Commit 54d3071

Browse files
committed
hybrid working reliably in both directions
1 parent 83abd6a commit 54d3071

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

software/module/firmware/app_standard_resp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ void resp_txcallback (const dwt_cb_data_t *txd) {
251251
// Packet was sent successfully
252252
//debug_msg("ANCHOR transmitted a packet\n");
253253

254+
// As we sent our single packet, we switch back to INIT mode to catch the rest of the packets
255+
if (standard_is_init_enabled()) {
256+
standard_set_resp_active(FALSE);
257+
standard_set_init_active(TRUE);
258+
}
259+
254260
} else {
255261
// Some error occurred, don't just keep trying to send packets.
256262
debug_msg("ERROR: Failed in sending packet!\n");

software/module/firmware/glossy.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,6 @@ static void glossy_lwb_round_task() {
411411
_cur_glossy_depth = 0; // seqNum in packet
412412
_glossy_currently_flooding = TRUE;
413413

414-
standard_set_init_active(TRUE);
415-
standard_set_resp_active(FALSE);
416-
417414
dwt_forcetrxoff();
418415

419416
uint16_t frame_len = sizeof(struct pp_signal_flood);
@@ -582,9 +579,9 @@ bool glossy_process_txcallback(){
582579

583580
if (_cur_glossy_depth < GLOSSY_MAX_DEPTH) {
584581

585-
debug_msg("Sending flooding message with depth ");
582+
/*debug_msg("Sending flooding message with depth ");
586583
debug_msg_uint(_cur_glossy_depth);
587-
debug_msg("\n");
584+
debug_msg("\n");*/
588585

589586
// We're flooding, keep doing it until the max depth!
590587
uint32_t delay_time = _last_delay_time + (DW_DELAY_FROM_US(GLOSSY_FLOOD_TIMESLOT_US) & 0xFFFFFFFE);
@@ -746,9 +743,9 @@ void glossy_process_rxcallback(uint64_t dw_timestamp, uint8_t *buf){
746743

747744
if (_cur_glossy_depth < GLOSSY_MAX_DEPTH) {
748745

749-
debug_msg("Sending flooding message with depth ");
746+
/*debug_msg("Sending flooding message with depth ");
750747
debug_msg_uint(_cur_glossy_depth);
751-
debug_msg("\n");
748+
debug_msg("\n");*/
752749

753750
_glossy_currently_flooding = TRUE;
754751

@@ -862,9 +859,9 @@ void glossy_process_rxcallback(uint64_t dw_timestamp, uint8_t *buf){
862859

863860
if (_cur_glossy_depth < GLOSSY_MAX_DEPTH) {
864861

865-
debug_msg("Sending flooding message with depth ");
862+
/*debug_msg("Sending flooding message with depth ");
866863
debug_msg_uint(_cur_glossy_depth);
867-
debug_msg("\n");
864+
debug_msg("\n");*/
868865

869866
_glossy_currently_flooding = TRUE;
870867

0 commit comments

Comments
 (0)