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

Add the UART library to normal compile so that it includes the ISR add some basic UART output

parent 3c317116
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,10 @@ link_directories( ...@@ -20,7 +20,10 @@ link_directories(
add_executable(${PROJECT_NAME}_min test/min.c lib/hal_mcu/hal_mcu.c) add_executable(${PROJECT_NAME}_min test/min.c lib/hal_mcu/hal_mcu.c)
target_link_libraries(${PROJECT_NAME}_min uart_drv) target_link_libraries(${PROJECT_NAME}_min uart_drv)
add_executable(${PROJECT_NAME}_min2 test/min2.c lib/hal_mcu/hal_mcu.c) add_executable(${PROJECT_NAME}_min2 test/min2.c lib/hal_mcu/hal_mcu.c
lib/uart_drv/uart_drv.c
lib/uart_drv/circ_buf.c
lib/uart_drv/ee_printf.c)
target_link_libraries(${PROJECT_NAME}_min2) target_link_libraries(${PROJECT_NAME}_min2)
add_executable(${PROJECT_NAME}_rxer test/LaunchPad_trx_main.c test/LaunchPad_trx_demo.c) add_executable(${PROJECT_NAME}_rxer test/LaunchPad_trx_main.c test/LaunchPad_trx_demo.c)
......
...@@ -2,14 +2,20 @@ ...@@ -2,14 +2,20 @@
#include "stdio.h" #include "stdio.h"
#include "lib/radio_drv/hal_types.h" #include "lib/radio_drv/hal_types.h"
#include "lib/hal_mcu/hal_mcu_fr5.h" #include "lib/hal_mcu/hal_mcu_fr5.h"
#include "lib/uart_drv/uart_drv.h"
/****************************************************************************** /******************************************************************************
* LOCAL FUNCTIONS * LOCAL FUNCTIONS
*/ */
extern void msp_setup(void); extern void msp_setup(void);
unsigned long volatile time_counter; int ee_printf(const char *fmt, ...);
/******************************************************************************
* GLOBALS
*/
char u_str[UART_BUFF_SIZE];
unsigned char txBuffer[TX_BUFF_SIZE];
unsigned long volatile time_counter;
/****************************************************************************** /******************************************************************************
* @fn main * @fn main
...@@ -44,6 +50,9 @@ void main (void) ...@@ -44,6 +50,9 @@ void main (void)
//Comes from lib/hal_mcu/hal_mcu.c //Comes from lib/hal_mcu/hal_mcu.c
msp_setup(); msp_setup();
/* Initialize the UART port */
hal_uart_init();
// Enable the interupts on port 2 to catch the user button (TRXEB) // Enable the interupts on port 2 to catch the user button (TRXEB)
...@@ -53,9 +62,13 @@ void main (void) ...@@ -53,9 +62,13 @@ void main (void)
/* Infinite loop with a 1 second timer */ /* Infinite loop with a 1 second timer */
while(1) while(1)
{ {
P1OUT ^= BIT0;
_delay_us(4166); _delay_us(4166);
_delay_us(8332); _delay_us(8332);
if(idle_counter!=time_counter){
idle_counter=time_counter;
ee_printf("Cnt:%3i\n\r", idle_counter);
_delay_us(100000);
}
} }
} }
...@@ -75,6 +88,7 @@ void main (void) ...@@ -75,6 +88,7 @@ void main (void)
*/ */
HAL_ISR_FUNC_DECLARATION(wdt_isr,WDT) HAL_ISR_FUNC_DECLARATION(wdt_isr,WDT)
{ {
time_counter++;
/* global "0.5 second" counter used for printing time stamped packet sniffer data */ /* global "0.5 second" counter used for printing time stamped packet sniffer data */
P1OUT ^= BIT1; P1OUT ^= BIT1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment