diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-03-16 15:22:14 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-03-16 15:22:14 +0800 |
| commit | 05a9278caf38f5461f3aefccc1f871ae5d54d9ae (patch) | |
| tree | 9bbdbe9827629ab670f866620ada2f66484996fb | |
| parent | bdf02b8eb5aecf11343a1fcffab5b783ff01f8a7 (diff) | |
| download | avr-nrf24l01-driver-05a9278caf38f5461f3aefccc1f871ae5d54d9ae.tar.gz | |
Improv prinf_config().
| -rw-r--r-- | main.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -101,12 +101,17 @@ static inline void print_config(void) char s[22]; uint8_t i, rv; + uint8_t regs[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 + }; + uint8_t reglen = sizeof(regs) / sizeof(regs[0]); + uart_write_line("NRF24L01 configuration:"); - for (i = 0x00; i <= 0x17; i++) { + for (i = 0; i < reglen; i++) { rv = read_reg(i); snprintf(s, (sizeof(s) / sizeof(s[0])), - "\t0x%02X: 0x%02X %s%s", i, rv, + "\t0x%02X: 0x%02X %s%s", regs[i], rv, bittab[rv >> 4], bittab[rv & 0x0F]); uart_write_line(s); } |
