diff options
Diffstat (limited to 'rf_test')
| -rw-r--r-- | rf_test/send.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/rf_test/send.c b/rf_test/send.c index 462f6e8..e8535e3 100644 --- a/rf_test/send.c +++ b/rf_test/send.c @@ -37,23 +37,17 @@ static inline uint8_t read_reg(uint8_t reg) static inline void write_reg(uint8_t reg, uint8_t val) { - serial_write_line("writing register"); - - while (read_reg(reg) != val) { - SPI_PORT &= ~(1 << SPI_SS); - - SPDR = reg | 0x80; - while (!(SPSR & (1 << SPIF))) - ; + SPI_PORT &= ~(1 << SPI_SS); - SPDR = val; - while (!(SPSR & (1 << SPIF))) - ; + SPDR = reg | 0x80; + while (!(SPSR & (1 << SPIF))) + ; - SPI_PORT |= (1 << SPI_SS); - } + SPDR = val; + while (!(SPSR & (1 << SPIF))) + ; - serial_write_line("writing register done"); + SPI_PORT |= (1 << SPI_SS); } static inline void set_mode(uint8_t mode) |
