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)];
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);
}
}