removed refence to struct, using globals instead.

This commit is contained in:
jakeg00dwin 2024-10-04 16:26:43 -07:00
parent dd35358e67
commit 6c0e016c20
1 changed files with 6 additions and 5 deletions

View File

@ -50,7 +50,8 @@ uint8_t db; //Used to hold the current setting for the TX power.
uint8_t buffer[sizeof(MSG)]; uint8_t buffer[sizeof(MSG)];
MSG msg_out; 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) { 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. //The algo below allows us to minimize the needed TX power.
void Radio_Main(MSG *msg_out, MSG *msg_in) { void Radio_Main(MSG *msg_out, MSG *msg_in) {
for(db = RF9X_MIN_DB; db <= RF9X_MAX_DB; db++) { for(db = RF9X_MIN_DB; db <= RF9X_MAX_DB; db++) {
Radio_SendMsg(&msg_out); Radio_SendMsg(msg_out);
if(Radio_CheckForMsg(&msg_in) == Ok) { if(Radio_CheckForMsg(msg_in) == Ok) {
break; break;
} }
else{ 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. //We "delay" for 1 seconds by calling the radio check twice.
if(Radio_CheckForMsg(&msg_in) == Ok) { if(Radio_CheckForMsg(msg_in) == Ok) {
Radio_SendMsg(&msg_out); Radio_SendMsg(msg_out);
} }
} }