diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-04-07 12:50:46 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-04-07 13:03:44 +0800 |
| commit | 2a5eaad1bcac0f0ff61bd82b6427932cb4d03872 (patch) | |
| tree | ccf47e934cf154603a7f7f6319ddebe440124570 /lock/frnt.c | |
| parent | 77c3f8741ff2a8876a3107a68d42397034e6f08a (diff) | |
| download | smart-home-2a5eaad1bcac0f0ff61bd82b6427932cb4d03872.tar.gz | |
Copy working NRFM code.
Diffstat (limited to 'lock/frnt.c')
| -rw-r--r-- | lock/frnt.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lock/frnt.c b/lock/frnt.c new file mode 100644 index 0000000..d0cfe74 --- /dev/null +++ b/lock/frnt.c @@ -0,0 +1,28 @@ +#include <stdint.h> +#include <string.h> +#include <util/delay.h> + +#include "nrfm.h" +#include "uart.h" + +int main(void) +{ + const char *s = "hello world!"; + //const char *s = "hello how are you doing? This is supposed to be a very long message!"; + uint8_t slen = strlen(s); + + uint8_t rxaddr[ADDRLEN] = { 194, 178, 82 }; + uint8_t txaddr[ADDRLEN] = { 194, 178, 83 }; + + uart_init(); + radio_init(rxaddr); + radio_print_config(); + + for (;;) { + radio_sendto(txaddr, s, slen); + _delay_ms(2000); + } + + + return 0; +} |
