Skip to content
Snippets Groups Projects
Commit aa2eb431 authored by Edward Longman's avatar Edward Longman
Browse files

Remove all UART Comms for now and correct source of hal_spi_xxx file

parent 67041a25
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Modified from hals_spi_rf_exp5594.h by Edward Longman * Modified from hals_spi_rf_exp5529.h by Edward Longman
* *
*******************************************************************************/ *******************************************************************************/
......
...@@ -89,6 +89,13 @@ unsigned char chan_hop_seq[MAX_HOP_CHANNELS]; // channels hopping sequence ...@@ -89,6 +89,13 @@ unsigned char chan_hop_seq[MAX_HOP_CHANNELS]; // channels hopping sequence
extern char user_button_pushed; // user button has been pressed extern char user_button_pushed; // user button has been pressed
extern const unsigned char rand_data[]; // pointer to predefined payload extern const unsigned char rand_data[]; // pointer to predefined payload
/* Temp define ee_printf **************************8888
*/
int ee_printf(const char *fmt, ...){
return 1;
}
/****************************************************************************** /******************************************************************************
* @fn parse_ui_cmd * @fn parse_ui_cmd
* *
...@@ -273,9 +280,10 @@ void unmodulated_tx(trx_cfg_struct *trx_cfg) ...@@ -273,9 +280,10 @@ void unmodulated_tx(trx_cfg_struct *trx_cfg)
/* start the TX chain */ /* start the TX chain */
radio_transmit(); radio_transmit();
#if 0
uartSendString("\n\r"); uartSendString("\n\r");
uartSendString("Started unmodulated TX, Press RETURN key twice to stop\n\r"); uartSendString("Started unmodulated TX, Press RETURN key twice to stop\n\r");
#endif
return; return;
} }
...@@ -314,10 +322,11 @@ void modulated_tx_no_mcu(trx_cfg_struct *trx_cfg) ...@@ -314,10 +322,11 @@ void modulated_tx_no_mcu(trx_cfg_struct *trx_cfg)
radio_prepare(&payload, 1); radio_prepare(&payload, 1);
radio_transmit(); radio_transmit();
#if 0
uartSendString("\n\r"); uartSendString("\n\r");
uartSendString("Started modulated TX using PN9 inside CC device\n\r"); uartSendString("Started modulated TX using PN9 inside CC device\n\r");
uartSendString("Press RETURN key twice to stop\n\r"); uartSendString("Press RETURN key twice to stop\n\r");
#endif
return; return;
} }
...@@ -366,7 +375,7 @@ void rx_static(trx_cfg_struct *trx_cfg) ...@@ -366,7 +375,7 @@ void rx_static(trx_cfg_struct *trx_cfg)
void main_menu(trx_cfg_struct *trx_cfg) void main_menu(trx_cfg_struct *trx_cfg)
{ {
unsigned int freq_mhz, freq_khz; unsigned int freq_mhz, freq_khz;
#if 0
uartSendString("\n\r"); uartSendString("\n\r");
uartSendString("Long Range Sub1Ghz demonstration\n\r"); uartSendString("Long Range Sub1Ghz demonstration\n\r");
uartSendString("Select from items below:\n\r"); uartSendString("Select from items below:\n\r");
...@@ -441,6 +450,7 @@ void main_menu(trx_cfg_struct *trx_cfg) ...@@ -441,6 +450,7 @@ void main_menu(trx_cfg_struct *trx_cfg)
uartSendString("*************************************************************\n\r"); uartSendString("*************************************************************\n\r");
uartSendString("CMD >\n\r"); uartSendString("CMD >\n\r");
#endif
return; return;
} }
...@@ -526,7 +536,7 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -526,7 +536,7 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
signed int rssi_forward, rssi_reverse, freq_error; signed int rssi_forward, rssi_reverse, freq_error;
unsigned int status, total_pkt_count; unsigned int status, total_pkt_count;
unsigned long error_forward, error_reverse; unsigned long error_forward, error_reverse;
#if 0
uartSendString("\n\r"); uartSendString("\n\r");
uartSendString("Perform RF burst transmit function with frequency hopping\n\r"); uartSendString("Perform RF burst transmit function with frequency hopping\n\r");
...@@ -535,7 +545,7 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -535,7 +545,7 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
data_to_uart(chan_hop_seq, MAX_HOP_CHANNELS); data_to_uart(chan_hop_seq, MAX_HOP_CHANNELS);
uartSendString("\n\r"); uartSendString("\n\r");
#endif
// Set the packet length to a fixed packet size // Set the packet length to a fixed packet size
set_rf_packet_length(trx_cfg->b_length); set_rf_packet_length(trx_cfg->b_length);
...@@ -549,9 +559,9 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -549,9 +559,9 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
// start the timer // start the timer
hal_timer_init(trx_cfg->packet_timer); hal_timer_init(trx_cfg->packet_timer);
// start transmitting burst, one on each of the MAX_HOP_CHANNELS channels in the PN sequence // start transmitting burst, one on each of the MAX_HOP_CHANNELS channels in the PN sequence
#if 0
ee_printf("PKT CHAN FW-RSSI/ERR RW-RSSI/ERR\n\r"); ee_printf("PKT CHAN FW-RSSI/ERR RW-RSSI/ERR\n\r");
#endif
bb = 0; bb = 0;
for(cc=0; cc<trx_cfg->no_burst; cc++) for(cc=0; cc<trx_cfg->no_burst; cc++)
{ {
...@@ -642,12 +652,12 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -642,12 +652,12 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
hal_timer_stop(); hal_timer_stop();
radio_mode = RADIO_IDLE; radio_mode = RADIO_IDLE;
#if 0
ee_printf("Total packets Sent : %5d\n\r", trx_cfg->no_burst); ee_printf("Total packets Sent : %5d\n\r", trx_cfg->no_burst);
ee_printf("Total packets Received : %5d\n\r", total_pkt_count); ee_printf("Total packets Received : %5d\n\r", total_pkt_count);
ee_printf("Forward Error count : %7ld\n\r", error_forward); ee_printf("Forward Error count : %7ld\n\r", error_forward);
ee_printf("Reverse Error count : %7ld\n\r", error_reverse); ee_printf("Reverse Error count : %7ld\n\r", error_reverse);
#endif
return; return;
} }
...@@ -888,10 +898,10 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -888,10 +898,10 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
signed int rssi_forward, rssi_reverse, freq_error; signed int rssi_forward, rssi_reverse, freq_error;
unsigned int status, total_pkt_count; unsigned int status, total_pkt_count;
unsigned long error_forward, error_reverse; unsigned long error_forward, error_reverse;
#if 0
uartSendString("\n\r"); uartSendString("\n\r");
uartSendString("Perform RF burst transmit function with fixed channel\n\r"); uartSendString("Perform RF burst transmit function with fixed channel\n\r");
#endif
// Set the packet length to a fixed packet size // Set the packet length to a fixed packet size
set_rf_packet_length(trx_cfg->b_length); set_rf_packet_length(trx_cfg->b_length);
...@@ -907,10 +917,10 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -907,10 +917,10 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
// start the timer // start the timer
hal_timer_init(trx_cfg->packet_timer); hal_timer_init(trx_cfg->packet_timer);
#if 0
// start transmitting burst // start transmitting burst
ee_printf(" PKT FW-RSSI/ERR RW-RSSI/ERR FREQ_ERR\n\r"); ee_printf(" PKT FW-RSSI/ERR RW-RSSI/ERR FREQ_ERR\n\r");
#endif
for(cc=0; cc<trx_cfg->no_burst; cc++) for(cc=0; cc<trx_cfg->no_burst; cc++)
{ {
...@@ -997,12 +1007,12 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -997,12 +1007,12 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
hal_timer_stop(); hal_timer_stop();
radio_mode = RADIO_IDLE; radio_mode = RADIO_IDLE;
#if 0
ee_printf("Total packets Sent : %5d\n\r", trx_cfg->no_burst); ee_printf("Total packets Sent : %5d\n\r", trx_cfg->no_burst);
ee_printf("Total packets Received : %5d\n\r", total_pkt_count); ee_printf("Total packets Received : %5d\n\r", total_pkt_count);
ee_printf("Forward Error count : %7ld\n\r", error_forward); ee_printf("Forward Error count : %7ld\n\r", error_forward);
ee_printf("Reverse Error count : %7ld\n\r", error_reverse); ee_printf("Reverse Error count : %7ld\n\r", error_reverse);
#endif
return; return;
} }
...@@ -1058,10 +1068,10 @@ void rx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -1058,10 +1068,10 @@ void rx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
/* Initialize the RX chain, receive packet */ /* Initialize the RX chain, receive packet */
radio_receive_on(); radio_receive_on();
#if 0
// start transmitting burst // start transmitting burst
ee_printf(" PKT FW-RSSI/ERR FREQ_ERR\n\r"); ee_printf(" PKT FW-RSSI/ERR FREQ_ERR\n\r");
#endif
while (done == FALSE) while (done == FALSE)
{ {
...@@ -1147,10 +1157,10 @@ void rx_sniff(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -1147,10 +1157,10 @@ void rx_sniff(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
unsigned short rx_length; unsigned short rx_length;
unsigned long sec, ms; unsigned long sec, ms;
int cc_status; int cc_status;
#if 0
uartSendString("\n\r"); uartSendString("\n\r");
uartSendString("Started RX sniff analyzer:\n\r"); uartSendString("Started RX sniff analyzer:\n\r");
#endif
done = FALSE; done = FALSE;
/* if the packet length is 0, then configure variable packet length mode */ /* if the packet length is 0, then configure variable packet length mode */
...@@ -1230,6 +1240,7 @@ void rx_sniff(unsigned char *txBuffer, trx_cfg_struct *trx_cfg) ...@@ -1230,6 +1240,7 @@ void rx_sniff(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
*/ */
void uartSendString(char *str) void uartSendString(char *str)
{ {
#if 0
unsigned char ii; unsigned char ii;
for(ii=0;ii<UART_BUFF_SIZE;ii++) for(ii=0;ii<UART_BUFF_SIZE;ii++)
...@@ -1240,7 +1251,7 @@ void uartSendString(char *str) ...@@ -1240,7 +1251,7 @@ void uartSendString(char *str)
ii = UART_BUFF_SIZE; ii = UART_BUFF_SIZE;
} }
} }
#endif
return; return;
} }
...@@ -1263,6 +1274,7 @@ void uartSendString(char *str) ...@@ -1263,6 +1274,7 @@ void uartSendString(char *str)
*/ */
unsigned char data_to_uart(unsigned char *data, unsigned char length) unsigned char data_to_uart(unsigned char *data, unsigned char length)
{ {
#if 0
unsigned char dd; unsigned char dd;
char str[3]; char str[3];
...@@ -1275,6 +1287,7 @@ unsigned char data_to_uart(unsigned char *data, unsigned char length) ...@@ -1275,6 +1287,7 @@ unsigned char data_to_uart(unsigned char *data, unsigned char length)
uart_put_char(' '); uart_put_char(' ');
} }
return dd; return dd;
#endif
} }
/****************************************************************************** /******************************************************************************
......
...@@ -172,6 +172,7 @@ void main (void) ...@@ -172,6 +172,7 @@ void main (void)
* Check to see if the UART driver has detected an end-of-line from the user * Check to see if the UART driver has detected an end-of-line from the user
* if we have an end-of-line event decode the command and take action * if we have an end-of-line event decode the command and take action
*/ */
#if 0
if (uart_get_rx_end_of_str() == END_OF_LINE_DETECTED ) if (uart_get_rx_end_of_str() == END_OF_LINE_DETECTED )
{ {
uart_reset_rx_end_of_str(); uart_reset_rx_end_of_str();
...@@ -183,7 +184,7 @@ void main (void) ...@@ -183,7 +184,7 @@ void main (void)
trx_cfg.trx_mode = MENU_IDLE; trx_cfg.trx_mode = MENU_IDLE;
} }
} }
#endif
/* /*
* Main loop of state machine * Main loop of state machine
*/ */
...@@ -191,13 +192,23 @@ void main (void) ...@@ -191,13 +192,23 @@ void main (void)
{ {
/* print the main menu to the UART buffer */ /* print the main menu to the UART buffer */
case MENU_RESTART: case MENU_RESTART:
#if 0
main_menu(&trx_cfg); main_menu(&trx_cfg);
#endif
trx_cfg.trx_mode = MENU_IDLE; trx_cfg.trx_mode = MENU_IDLE;
break; break;
/* command string has been found on UART, parse it */ /* command string has been found on UART, parse it */
case MENU_SETUP: case MENU_SETUP:
#if 0
u_str_length = uart_get_rx_str_length(); // get the number of bytes in fifo u_str_length = uart_get_rx_str_length(); // get the number of bytes in fifo
uart_get_str(u_str, u_str_length); // retrieve all data uart_get_str(u_str, u_str_length); // retrieve all data
#else
u_str[0]='2';
u_str[1]=' ';
u_str[2]='1';
u_str[3]=0;
u_str_length =3;
#endif
parse_ui_cmd(&trx_cfg, u_str, u_str_length); parse_ui_cmd(&trx_cfg, u_str, u_str_length);
break; break;
/* blink led to indicate alive but idle state */ /* blink led to indicate alive but idle state */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment