Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MSP430FR5994 BOOSTXL-CC1120-90 Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Energy-Driven Computing
MSP430FR5994 BOOSTXL-CC1120-90 Library
Commits
1ec114d1
Commit
1ec114d1
authored
6 years ago
by
Edward Longman
Browse files
Options
Downloads
Patches
Plain Diff
Add libary usage to minimal example
parent
a8a74a36
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/lib/uart_drv/CMakeLists.txt
+12
-0
12 additions, 0 deletions
source/lib/uart_drv/CMakeLists.txt
source/test/min.c
+81
-12
81 additions, 12 deletions
source/test/min.c
with
93 additions
and
12 deletions
source/lib/uart_drv/CMakeLists.txt
0 → 100644
+
12
−
0
View file @
1ec114d1
cmake_minimum_required
(
VERSION 2.8
)
include
(
${
CMAKE_SOURCE_DIR
}
/../common.cmake
)
add_library
(
uart_drv
STATIC
circ_buf.c
uart_drv.c
ee_printf.c
)
This diff is collapsed.
Click to expand it.
source/test/min.c
+
81
−
12
View file @
1ec114d1
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* LOCAL FUNCTIONS
* LOCAL FUNCTIONS
*/
*/
extern
void
msp_setup
(
void
);
extern
void
msp_setup
(
void
);
extern
unsigned
long
volatile
time_counter
;
unsigned
long
volatile
time_counter
;
/******************************************************************************
/******************************************************************************
* GLOBALS
* GLOBALS
...
@@ -57,7 +57,7 @@ void main (void)
...
@@ -57,7 +57,7 @@ void main (void)
msp_setup
();
msp_setup
();
/* Initialize the UART port */
/* Initialize the UART port */
//
hal_uart_init();
hal_uart_init
();
/* enable uart echo function */
/* enable uart echo function */
//uart_drv_toggle_echo();
//uart_drv_toggle_echo();
...
@@ -94,8 +94,9 @@ void main (void)
...
@@ -94,8 +94,9 @@ void main (void)
{
{
/* Put MCU in low power mode, wait for UART and blink LED */
/* Put MCU in low power mode, wait for UART and blink LED */
//Skip Low power mode to debug
HAL_LED2_OFF
();
HAL_LED2_OFF
();
_BIS_SR
(
LPM0_bits
+
GIE
);
//
_BIS_SR(LPM0_bits + GIE);
HAL_LED2_ON
();
HAL_LED2_ON
();
idle_counter
++
;
idle_counter
++
;
...
@@ -105,15 +106,23 @@ void main (void)
...
@@ -105,15 +106,23 @@ void main (void)
*/
*/
switch
(
state
)
switch
(
state
)
{
{
/* print the
main menu
to the UART buffer */
/* print the
tick state
to the UART buffer */
case
WAIT
:
case
WAIT
:
if
(
idl
e_counter
>
250
){
if
(
tim
e_counter
>
5
){
state
=
IDLE_RESET
;
state
=
IDLE_RESET
;
uartSendString
(
"Tic:
\n\r
"
);
time_counter
=
0
;
}
}
state
=
OPERATE
;
state
=
OPERATE
;
HAL_LED1_OFF
();
break
;
break
;
case
OPERATE
:
case
OPERATE
:
state
=
OPERATE
;
if
(
time_counter
>
5
){
state
=
WAIT
;
uartSendString
(
"Tic:
\n\r
"
);
time_counter
=
0
;
}
HAL_LED1_ON
();
break
;
break
;
default:
default:
state
=
WAIT
;
state
=
WAIT
;
...
@@ -121,3 +130,63 @@ void main (void)
...
@@ -121,3 +130,63 @@ void main (void)
}
}
}
}
}
}
/******************************************************************************
* @fn uartSendString
*
* @brief Implements a simple uart string sender by automatically finding
* the end of line delimeter and using it to call the uart sub
* functions
*
* input parameters
*
* @param unsigned char *str
*
* output parameters
*
* @return void
*
*/
void
uartSendString
(
char
*
str
)
{
unsigned
char
ii
;
for
(
ii
=
0
;
ii
<
UART_BUFF_SIZE
;
ii
++
)
{
if
(
str
[
ii
]
==
13
)
{
uart_put_str
(
str
,
ii
+
1
);
ii
=
UART_BUFF_SIZE
;
}
}
return
;
}
/******************************************************************************
* @fn wdt_isr
*
* @brief Interrupt service routine for watch dog timer.
*
* input parameters
*
* @param void
*
* output parameters
*
* @return void
*
*/
HAL_ISR_FUNC_DECLARATION
(
wdt_isr
,
WDT
)
{
/* global "0.5 second" counter used for printing time stamped packet sniffer data */
time_counter
++
;
/* check to see if wake on wdt is enabled */
if
(
wakeup_on_wdt
==
1
)
{
/* exit from low power mode on ISR exit */
//_BIC_SR_IRQ(LPM3_bits);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment