diff --git a/firmware/l0dable/EXPORTS b/firmware/l0dable/EXPORTS index c25d631..e77c938 100644 --- a/firmware/l0dable/EXPORTS +++ b/firmware/l0dable/EXPORTS @@ -65,3 +65,5 @@ meshGetMessage nickname uint32touint8p uint8ptouint32 +memset +nrf_config_set diff --git a/firmware/l0dable/recvcard.c b/firmware/l0dable/recvcard.c index d19da8d..3ef7bfb 100644 --- a/firmware/l0dable/recvcard.c +++ b/firmware/l0dable/recvcard.c @@ -24,9 +24,20 @@ uint8_t mac[5] = {1,2,3,2,1}; + struct NRF_CFG config = { + .channel= 81, + .txmac= "\x1\x2\x3\x2\x1", + .nrmacs=1, + .mac0= "\x1\x2\x3\x2\x1", + .maclen ="\x20", + }; void ram(void) { + memset(0,0,0); + nrf_config_set(&config); + + if( sendKeys() ) return; diff --git a/firmware/l0dable/sendcard.c b/firmware/l0dable/sendcard.c index 8bcf110..cf2a3d7 100644 --- a/firmware/l0dable/sendcard.c +++ b/firmware/l0dable/sendcard.c @@ -30,12 +30,23 @@ //#include "lcd/print.h" - +void sendFile(char *filename); uint8_t mac[5] = {1,2,3,2,1}; + struct NRF_CFG config = { + .channel= 81, + .txmac= "\x1\x2\x3\x2\x1", + .nrmacs=1, + .mac0= "\x1\x2\x3\x2\x1", + .maclen ="\x20", + }; void ram(void) { + + nrf_config_set(&config); + + char file[13]; selectFile(file,"TXT"); sendFile(file); @@ -43,7 +54,8 @@ void ram(void) void sendR(uint8_t *rx, uint8_t *ry) { - uint8_t exp[2 + 4*NUMWORDS + 2]; + //uint8_t exp[2 + 4*NUMWORDS + 2]; + uint8_t exp[32]; exp[0] = 'R'; for(int i=0; i<4*NUMWORDS; i++) exp[2+i] = rx[i]; @@ -54,6 +66,7 @@ void sendR(uint8_t *rx, uint8_t *ry) for(int i=0; i<4*NUMWORDS; i++) exp[2+i] = ry[i]; nrf_snd_pkt_crc(32, exp); + delayms(10); } diff --git a/firmware/l0dable/system-include-hack.h b/firmware/l0dable/system-include-hack.h index 4f8f217..f1f77e5 100644 --- a/firmware/l0dable/system-include-hack.h +++ b/firmware/l0dable/system-include-hack.h @@ -1,3 +1,4 @@ size_t strlen(const char *s); -char * strcpy(char * restrict dst, const char * restrict src); -void * memcpy(void *dst, const void *src, size_t len); +char strcpy(char * restrict dst, const char * restrict src); +void memcpy(void *dst, const void *src, size_t len); +void memset(void *s, int c, size_t n);