summaryrefslogtreecommitdiffstats
path: root/rf_test
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2024-11-30 21:20:30 +0800
committerSadeep Madurange <sadeep@asciimx.com>2024-11-30 21:20:30 +0800
commit9957c93c2c4ac19eaaa539fc0855d3f21769d1f7 (patch)
tree3f9ea62b4cb90043dc9c1a30e224244585368b8f /rf_test
parent8f2c8f85dac54c1c84724d83f514bf1acdd391ce (diff)
downloadsmart-home-9957c93c2c4ac19eaaa539fc0855d3f21769d1f7.tar.gz
Remove read_reg() from write_reg().
Diffstat (limited to 'rf_test')
-rw-r--r--rf_test/send.c22
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)