48 #define PAYLOAD_LEN 16
51 void fill_packet(
volatile packet_t *p) {
52 static volatile uint8_t count=0;
77 void maca_tx_callback(
volatile packet_t *p) {
83 printf(
"CRC ERR\n\r");
89 printf(
"unknown status: %d\n", (
int)p->status);
102 uart_init(INC, MOD, SAMP);
114 GPIO->FUNC_SEL_44 = 1;
115 GPIO->PAD_DIR_SET_44 = 1;
117 GPIO->FUNC_SEL_45 = 2;
118 GPIO->PAD_DIR_SET_45 = 1;
120 *MACA_RXACKDELAY = r;
122 printf(
"rx warmup: %d\n\r", (
int)(*MACA_WARMUP & 0xfff));
126 printf(
"rx end: %d\n\r", (
int)(*MACA_RXEND & 0xfff));
128 set_prm_mode(AUTOACK);
130 print_welcome(
"rftest-tx");
138 while((p = rx_packet())) {
146 if(uart1_can_get()) {
152 if(r > 4095) { r = 0; }
153 *MACA_RXACKDELAY = r;
154 printf(
"rx ack delay: %d\n\r", r);
157 if(r == 0) { r = 4095; }
else { r--; }
158 *MACA_RXACKDELAY = r;
159 printf(
"rx ack delay: %d\n\r", r);
163 if(r > 4095) { r = 0; }
165 printf(
"rx end: %d\n\r", end);
169 if(r == 0) { r = 4095; }
else { r--; }
171 printf(
"rx end: %d\n\r", end);
174 p = get_free_packet();
178 printf(
"autoack-tx --- ");