summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-03-16 11:58:41 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-03-16 11:58:41 +0800
commit6df60e963f8b8abffdeaf26c0b5cfc64331657fb (patch)
tree36d8766852b0ce5cd9ef27079ad6cb825e402c13
parentac5d7ff0c3e017d58110c1c8426eb18762139568 (diff)
downloadavr-nrf24l01-driver-6df60e963f8b8abffdeaf26c0b5cfc64331657fb.tar.gz
Fix snprintf() buflen and enable ack on all pipes.
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 28f87fc..0d4dd8d 100644
--- a/main.c
+++ b/main.c
@@ -52,7 +52,7 @@ static inline void write_reg(uint8_t reg, uint8_t val)
static inline void print_config(void)
{
- char s[21];
+ char s[22];
uint8_t i, rv;
uart_write_line("NRF24L01 configuration:");
@@ -79,7 +79,7 @@ void radio_init(void)
_delay_ms(100); /* power on reset delay */
write_reg(0x00, 0b00001100); /* use 2-byte CRC */
- write_reg(0x01, 0b00000000); /* disable auto ack on all pipes */
+ write_reg(0x01, 0b00111111); /* enable auto ack on all pipes */
write_reg(0x02, 0b00000001); /* enable rx address on pipe 0 */
write_reg(0x03, 0b00000001); /* set address width to 3 bytes */
write_reg(0x04, 0b00000000); /* disable auto retransmission */