-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firmware: devices: radio: Updating returned values from functions #78
- Loading branch information
1 parent
9ebb69a
commit 05058cf
Showing
2 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
* \brief Radio device implementation. | ||
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* \author Miguel Boing <[email protected]> | ||
* | ||
* \version 0.1.23 | ||
* | ||
|
@@ -47,25 +48,36 @@ int radio_init(void) | |
sys_log_print_event_from_module(SYS_LOG_INFO, RADIO_MODULE_NAME, "Initializing radio device..."); | ||
sys_log_new_line(); | ||
|
||
int err = si446x_init(); | ||
|
||
si446x_rx_init(); | ||
int err = -1; | ||
if (si446x_init()) | ||
{ | ||
if (si446x_rx_init()) | ||
{ | ||
err = 0; | ||
} | ||
} | ||
|
||
return err; | ||
} | ||
|
||
int radio_send(uint8_t *data, uint16_t len) | ||
{ | ||
sys_log_print_event_from_module(SYS_LOG_INFO, RADIO_MODULE_NAME, "Transmmiting "); | ||
sys_log_print_event_from_module(SYS_LOG_INFO, RADIO_MODULE_NAME, "Transmitting "); | ||
sys_log_print_uint(len); | ||
sys_log_print_msg(" byte(s)..."); | ||
sys_log_new_line(); | ||
|
||
int err = 0; | ||
int err = -1; | ||
|
||
if(si446x_tx_long_packet(data, len)) | ||
{ | ||
if(si446x_rx_init()) | ||
{ | ||
err = 0; | ||
} | ||
} | ||
|
||
si446x_tx_long_packet(data, len); | ||
|
||
si446x_rx_init(); | ||
|
||
return err; | ||
} | ||
|
@@ -97,6 +109,7 @@ int radio_recv(uint8_t *data, uint16_t len, uint32_t timeout_ms) | |
|
||
int radio_available(void) | ||
{ | ||
/*TODO */ | ||
return -1; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters