Skip to content

Commit

Permalink
drivers: Implemented missing function in cc110x
Browse files Browse the repository at this point in the history
Function cc110x_state_to_text is defined and (with ENABLE_DEBUG) referenced,
but implemented. This commit adds the missing implementation.
  • Loading branch information
maribu committed May 24, 2018
1 parent b4f70be commit cbff3e6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions drivers/cc110x/cc110x-rxtx.c
Expand Up @@ -43,6 +43,25 @@
#define ENABLE_DEBUG (0)
#include "debug.h"

const char *cc110x_state_to_text(uint8_t state)
{
switch (state){
case RADIO_IDLE:
return "idle";
case RADIO_TX_BUSY:
return "tx busy";
case RADIO_RX:
return "rx";
case RADIO_RX_BUSY:
return "rx busy";
case RADIO_PWD:
return "pwd";
case RADIO_UNKNOWN:
return "unknown";
}
return "invalid";
}

static void _rx_abort(cc110x_t *dev)
{
gpio_irq_disable(dev->params.gdo2);
Expand Down
2 changes: 1 addition & 1 deletion drivers/cc110x/include/cc110x-interface.h
Expand Up @@ -35,7 +35,7 @@ extern "C" {
* @{
*/
char *cc110x_get_marc_state(cc110x_t *dev);
char *cc110x_state_to_text(uint8_t state);
const char *cc110x_state_to_text(uint8_t state);
int cc110x_rd_set_mode(cc110x_t *dev, int mode);
uint8_t cc110x_get_buffer_pos(cc110x_t *dev);
void cc110x_isr_handler(cc110x_t *dev, void(*callback)(void*), void*arg);
Expand Down

0 comments on commit cbff3e6

Please sign in to comment.