remove stale code, parse_packet wasn't used (or useful?)
This commit is contained in:
parent
721deec13e
commit
d436955132
3 changed files with 0 additions and 42 deletions
|
@ -44,8 +44,6 @@ Returns 1 on success.
|
|||
### `uint8_t lora32_data_available(lora32_cfg_t *lora)`
|
||||
Indicates if data is presently available.
|
||||
|
||||
### `uint8_t lora32_parse_packet(lora32_cfg_t *lora, uint8_t size)`
|
||||
|
||||
### `void lora32_send(lora32_cfg_t *config, uint8_t *data, uint8_t len)`
|
||||
Transmits data over the LoRa radio.
|
||||
|
||||
|
|
|
@ -108,7 +108,6 @@ typedef struct lora32_cfg_t {
|
|||
lora32_cfg_t lora32_create();
|
||||
uint8_t lora32_init(lora32_cfg_t *config);
|
||||
uint8_t lora32_data_available(lora32_cfg_t *lora);
|
||||
uint8_t lora32_parse_packet(lora32_cfg_t *lora, uint8_t size);
|
||||
void lora32_send(lora32_cfg_t *config, uint8_t *data, uint8_t len);
|
||||
void lora32_set_spreadfactor(lora32_cfg_t *lora, uint8_t factor);
|
||||
void lora32_dump_regs(lora32_cfg_t *lora);
|
||||
|
|
|
@ -188,45 +188,6 @@ void lora32_set_tx_power(lora32_cfg_t *lora, uint8_t level, uint8_t output) {
|
|||
ESP_LOGD(TAG, "REG_PA_CONFIG: 0x%2X", lora32_read_reg(lora, REG_PA_CONFIG));
|
||||
}
|
||||
|
||||
uint8_t lora32_parse_packet(lora32_cfg_t *lora, uint8_t size) {
|
||||
uint8_t length = 0;
|
||||
uint8_t irqs = lora32_read_reg(lora, REG_IRQ_FLAGS);
|
||||
|
||||
if(size > 0) {
|
||||
lora23_set_implicit_header(lora);
|
||||
|
||||
lora32_write_reg(lora, REG_PAYLOAD_LENGTH, size & 0xFF);
|
||||
} else {
|
||||
lora23_set_explicit_header(lora);
|
||||
}
|
||||
|
||||
lora32_write_reg(lora, REG_IRQ_FLAGS, irqs);
|
||||
|
||||
//ESP_LOGI(TAG, "irqs: 0x%2X", irqs);
|
||||
//ESP_LOGI(TAG, "irqs: 0x%2X", lora32_read_reg(spi, REG_IRQ_FLAGS));
|
||||
|
||||
if ((irqs & IRQ_RX_DONE_MASK) && (irqs & IRQ_PAYLOAD_CRC_ERROR_MASK) == 0) {
|
||||
lora->fifoIdx = 0;
|
||||
|
||||
if(lora->implicitHeader) {
|
||||
length = lora32_read_reg(lora, REG_PAYLOAD_LENGTH);
|
||||
} else {
|
||||
length = lora32_read_reg(lora, REG_RX_NB_BYTES);
|
||||
}
|
||||
|
||||
lora32_write_reg(lora, REG_FIFO_ADDR_PTR, lora32_read_reg(lora, REG_FIFO_RX_CURRENT_ADDR));
|
||||
|
||||
lora32_idle(lora);
|
||||
} else if(lora32_read_reg(lora, REG_OP_MODE) != (MODE_LONG_RANGE_MODE | MODE_RX_SINGLE)) {
|
||||
lora32_write_reg(lora, REG_FIFO_ADDR_PTR, 0);
|
||||
//lora32_write_reg(lora, REG_OP_MODE, MODE_LONG_RANGE_MODE | MODE_RX_SINGLE);
|
||||
} else {
|
||||
//ESP_LOGI(TAG, "no irqs?");
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
uint8_t lora32_data_available(lora32_cfg_t *lora) {
|
||||
return lora32_read_reg(lora, REG_RX_NB_BYTES) - lora->fifoIdx;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue