From aa2eb4312b72918db7d430810438e4e7b2f2dbe0 Mon Sep 17 00:00:00 2001
From: Edward Longman <el7g15@soton.ac.uk>
Date: Thu, 16 May 2019 17:44:20 +0100
Subject: [PATCH] Remove all UART Comms for now and correct source of
 hal_spi_xxx file

---
 .../lib/radio_drv/hal_spi_rf_exp430fr5994.h   |  2 +-
 source/test/LaunchPad_trx_demo.c              | 53 ++++++++++++-------
 source/test/LaunchPad_trx_main.c              | 13 ++++-
 3 files changed, 46 insertions(+), 22 deletions(-)

diff --git a/source/lib/radio_drv/hal_spi_rf_exp430fr5994.h b/source/lib/radio_drv/hal_spi_rf_exp430fr5994.h
index 47b20b6..3ce24eb 100644
--- a/source/lib/radio_drv/hal_spi_rf_exp430fr5994.h
+++ b/source/lib/radio_drv/hal_spi_rf_exp430fr5994.h
@@ -34,7 +34,7 @@
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  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
 *
 *******************************************************************************/
 
diff --git a/source/test/LaunchPad_trx_demo.c b/source/test/LaunchPad_trx_demo.c
index 009f99e..06b5816 100644
--- a/source/test/LaunchPad_trx_demo.c
+++ b/source/test/LaunchPad_trx_demo.c
@@ -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 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
  *
@@ -273,9 +280,10 @@ void unmodulated_tx(trx_cfg_struct *trx_cfg)
 
 	/* start the TX chain */
 	radio_transmit();
-
+#if 0
 	uartSendString("\n\r");
 	uartSendString("Started unmodulated TX, Press RETURN key twice to stop\n\r");
+#endif
 	return;
 }
 
@@ -314,10 +322,11 @@ void modulated_tx_no_mcu(trx_cfg_struct *trx_cfg)
 	radio_prepare(&payload, 1);
 
 	radio_transmit();
-
+#if 0
 	uartSendString("\n\r");
 	uartSendString("Started modulated TX using PN9 inside CC device\n\r");
 	uartSendString("Press RETURN key twice to stop\n\r");
+#endif
 	return;
 }
 
@@ -366,7 +375,7 @@ void rx_static(trx_cfg_struct *trx_cfg)
 void main_menu(trx_cfg_struct *trx_cfg)
 {
 	unsigned int freq_mhz, freq_khz;
-
+#if 0
 	uartSendString("\n\r");
 	uartSendString("Long Range Sub1Ghz demonstration\n\r");
 	uartSendString("Select from items below:\n\r");
@@ -441,6 +450,7 @@ void main_menu(trx_cfg_struct *trx_cfg)
 
 	uartSendString("*************************************************************\n\r");
 	uartSendString("CMD >\n\r");
+#endif
 	return;
 }
 
@@ -526,7 +536,7 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
 	signed int rssi_forward, rssi_reverse, freq_error;
 	unsigned int status, total_pkt_count;
 	unsigned long error_forward, error_reverse;
-
+#if 0
 	uartSendString("\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)
 
 	data_to_uart(chan_hop_seq, MAX_HOP_CHANNELS);
 	uartSendString("\n\r");
-
+#endif
 	// Set the packet length to a fixed packet size
 	set_rf_packet_length(trx_cfg->b_length);
 
@@ -549,9 +559,9 @@ void tx_ber_fhss(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
 	// start the timer
 	hal_timer_init(trx_cfg->packet_timer);
 	// 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");
-
+#endif
 	bb = 0;
 	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)
 	hal_timer_stop();
 
 	radio_mode = RADIO_IDLE;
-
+#if 0
 	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("Forward Error count    : %7ld\n\r", error_forward);
 	ee_printf("Reverse Error count    : %7ld\n\r", error_reverse);
-
+#endif
 	return;
 }
 
@@ -888,10 +898,10 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
 	signed int rssi_forward, rssi_reverse, freq_error;
 	unsigned int status, total_pkt_count;
 	unsigned long error_forward, error_reverse;
-
+#if 0
 	uartSendString("\n\r");
 	uartSendString("Perform RF burst transmit function with fixed channel\n\r");
-
+#endif
 	// Set the packet length to a fixed packet size
 	set_rf_packet_length(trx_cfg->b_length);
 
@@ -907,10 +917,10 @@ void tx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
 
 	// start the timer
 	hal_timer_init(trx_cfg->packet_timer);
-
+#if 0
 	// start transmitting burst
 	ee_printf(" PKT FW-RSSI/ERR RW-RSSI/ERR FREQ_ERR\n\r");
-
+#endif
 	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)
 	hal_timer_stop();
 
 	radio_mode = RADIO_IDLE;
-
+#if 0
 	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("Forward Error count    : %7ld\n\r", error_forward);
 	ee_printf("Reverse Error count    : %7ld\n\r", error_reverse);
-
+#endif
 	return;
 }
 
@@ -1058,10 +1068,10 @@ void rx_ber_single(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
 
 	/* Initialize the RX chain, receive packet */
 	radio_receive_on();
-
+#if 0
 	// start transmitting burst
 	ee_printf(" PKT FW-RSSI/ERR FREQ_ERR\n\r");
-
+#endif
 	while (done == FALSE)
 	{
 
@@ -1147,10 +1157,10 @@ void rx_sniff(unsigned char *txBuffer, trx_cfg_struct *trx_cfg)
 	unsigned short rx_length;
 	unsigned long sec, ms;
 	int cc_status;
-
+#if 0
 	uartSendString("\n\r");
 	uartSendString("Started RX sniff analyzer:\n\r");
-
+#endif
 	done = FALSE;
 
 	/* 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)
  */
 void uartSendString(char *str)
 {
+#if 0
 	unsigned char ii;
 
 	for(ii=0;ii<UART_BUFF_SIZE;ii++)
@@ -1240,7 +1251,7 @@ void uartSendString(char *str)
 			ii = UART_BUFF_SIZE;
 		}
 	}
-
+#endif
 	return;
 }
 
@@ -1263,6 +1274,7 @@ void uartSendString(char *str)
  */
 unsigned char data_to_uart(unsigned char *data, unsigned char length)
 {
+#if 0
 	unsigned char dd;
 	char str[3];
 
@@ -1275,6 +1287,7 @@ unsigned char data_to_uart(unsigned char *data, unsigned char length)
 		uart_put_char(' ');
 	}
 	return dd;
+#endif
 }
 
 /******************************************************************************
diff --git a/source/test/LaunchPad_trx_main.c b/source/test/LaunchPad_trx_main.c
index 698e20d..4730a25 100644
--- a/source/test/LaunchPad_trx_main.c
+++ b/source/test/LaunchPad_trx_main.c
@@ -172,6 +172,7 @@ void main (void)
 		 *  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 0
 		if (uart_get_rx_end_of_str() == END_OF_LINE_DETECTED )
 		{
 			uart_reset_rx_end_of_str();
@@ -183,7 +184,7 @@ void main (void)
 				trx_cfg.trx_mode = MENU_IDLE;
 			}
 		}
-
+#endif
 		/*
 		 *    Main loop of state machine
 		 */
@@ -191,13 +192,23 @@ void main (void)
 		{
 		/* print the main menu to the UART buffer */
 		case MENU_RESTART:
+#if 0
 			main_menu(&trx_cfg);
+#endif
 			trx_cfg.trx_mode = MENU_IDLE;
 			break;
 		/* command string has been found on UART, parse it */
 		case MENU_SETUP:
+#if 0
 			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
+#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);
 			break;
 		/* blink led to indicate alive but idle state */
-- 
GitLab