From 6c0e016c20d828cef56e83b16dfbf26346da0956 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Fri, 4 Oct 2024 16:26:43 -0700 Subject: [PATCH] removed refence to struct, using globals instead. --- src/multi-tracker.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/multi-tracker.cpp b/src/multi-tracker.cpp index ce149d2..7639720 100644 --- a/src/multi-tracker.cpp +++ b/src/multi-tracker.cpp @@ -50,7 +50,8 @@ uint8_t db; //Used to hold the current setting for the TX power. uint8_t buffer[sizeof(MSG)]; MSG msg_out; -msg_out.id = 0; //Put the system ID here +MSG msg_in; +//msg_out.id = 0; //Put the system ID here void MSG_Print(MSG *msg) { @@ -150,8 +151,8 @@ uint8_t Radio_CheckForMsg(MSG *msg) { //The algo below allows us to minimize the needed TX power. void Radio_Main(MSG *msg_out, MSG *msg_in) { for(db = RF9X_MIN_DB; db <= RF9X_MAX_DB; db++) { - Radio_SendMsg(&msg_out); - if(Radio_CheckForMsg(&msg_in) == Ok) { + Radio_SendMsg(msg_out); + if(Radio_CheckForMsg(msg_in) == Ok) { break; } else{ @@ -161,8 +162,8 @@ void Radio_Main(MSG *msg_out, MSG *msg_in) { } //We "delay" for 1 seconds by calling the radio check twice. - if(Radio_CheckForMsg(&msg_in) == Ok) { - Radio_SendMsg(&msg_out); + if(Radio_CheckForMsg(msg_in) == Ok) { + Radio_SendMsg(msg_out); } }