get LQI of received packets
This commit is contained in:
parent
de64b18aca
commit
36d0b2708d
|
@ -52,6 +52,8 @@ void check_maca(void);
|
||||||
void set_power(uint8_t power);
|
void set_power(uint8_t power);
|
||||||
void set_channel(uint8_t chan);
|
void set_channel(uint8_t chan);
|
||||||
|
|
||||||
|
extern uint8_t (*get_lqi)(void);
|
||||||
|
|
||||||
#define DEMOD_DCD 1 /* -96dBm, 22.2mA */
|
#define DEMOD_DCD 1 /* -96dBm, 22.2mA */
|
||||||
#define DEMOD_NCD 0 /* -100dBm, 24.2mA */
|
#define DEMOD_NCD 0 /* -100dBm, 24.2mA */
|
||||||
void set_demodulator_type(uint8_t demod);
|
void set_demodulator_type(uint8_t demod);
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct packet {
|
||||||
/* On TX this should be 0 */
|
/* On TX this should be 0 */
|
||||||
/* On RX this should be 1 since the maca puts the length as the first byte*/
|
/* On RX this should be 1 since the maca puts the length as the first byte*/
|
||||||
uint8_t offset;
|
uint8_t offset;
|
||||||
|
uint8_t lqi;
|
||||||
#if PACKET_STATS
|
#if PACKET_STATS
|
||||||
uint8_t seen;
|
uint8_t seen;
|
||||||
uint8_t post_tx;
|
uint8_t post_tx;
|
||||||
|
|
|
@ -609,6 +609,7 @@ void maca_isr(void) {
|
||||||
if (data_indication_irq()) {
|
if (data_indication_irq()) {
|
||||||
*MACA_CLRIRQ = (1 << maca_irq_di);
|
*MACA_CLRIRQ = (1 << maca_irq_di);
|
||||||
dma_rx->length = *MACA_GETRXLVL - 2; /* packet length does not include FCS */
|
dma_rx->length = *MACA_GETRXLVL - 2; /* packet length does not include FCS */
|
||||||
|
dma_rx->lqi = get_lqi();
|
||||||
// PRINTF("maca data ind %x %d\n\r", dma_rx, dma_rx->length);
|
// PRINTF("maca data ind %x %d\n\r", dma_rx, dma_rx->length);
|
||||||
if(maca_rx_callback != 0) { maca_rx_callback(dma_rx); }
|
if(maca_rx_callback != 0) { maca_rx_callback(dma_rx); }
|
||||||
add_to_rx(dma_rx);
|
add_to_rx(dma_rx);
|
||||||
|
@ -1078,6 +1079,8 @@ void set_channel(uint8_t chan) {
|
||||||
if(bit_is_set(*NIPEND, INT_NUM_MACA)) { *INTFRC = (1 << INT_NUM_MACA); }
|
if(bit_is_set(*NIPEND, INT_NUM_MACA)) { *INTFRC = (1 << INT_NUM_MACA); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t (*get_lqi)(void) = (void *) 0x0000e04d;
|
||||||
|
|
||||||
#define ROM_END 0x0013ffff
|
#define ROM_END 0x0013ffff
|
||||||
#define ENTRY_EOF 0x00000e0f
|
#define ENTRY_EOF 0x00000e0f
|
||||||
/* processes up to 4 words of initialization entries */
|
/* processes up to 4 words of initialization entries */
|
||||||
|
|
|
@ -48,7 +48,7 @@ void print_packet(volatile packet_t *p) {
|
||||||
volatile uint8_t i,j,k;
|
volatile uint8_t i,j,k;
|
||||||
#define PER_ROW 16
|
#define PER_ROW 16
|
||||||
if(p) {
|
if(p) {
|
||||||
printf("len 0x%02x",p->length);
|
printf("len 0x%02x lqi 0x%02x", p->length, p->lqi);
|
||||||
for(j=0, k=0; j <= ((p->length)%PER_ROW); j++) {
|
for(j=0, k=0; j <= ((p->length)%PER_ROW); j++) {
|
||||||
printf("\n\r");
|
printf("\n\r");
|
||||||
for(i=0; i < PER_ROW; i++, k++) {
|
for(i=0; i < PER_ROW; i++, k++) {
|
||||||
|
|
Loading…
Reference in a new issue