Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
7895f5d2
Commit
7895f5d2
authored
Sep 06, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
efm32_hello: use freewatch_utils
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
b06b901d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
40 deletions
+5
-40
Makefile
sw/bootloader_test/Makefile
+1
-0
blink.c
sw/bootloader_test/blink.c
+4
-40
No files found.
sw/bootloader_test/Makefile
View file @
7895f5d2
...
...
@@ -128,6 +128,7 @@ C_SRC += \
../common/emlib/src/em_gpio.c
\
../common/emlib/src/em_system.c
\
../common/udelay.c
\
../common/freewatch/freewatch_utils.c
\
blink.c
s_SRC
+=
...
...
sw/bootloader_test/blink.c
View file @
7895f5d2
...
...
@@ -36,32 +36,8 @@
#include "em_cmu.h"
#include "em_gpio.h"
/* Counts 1ms timeTicks */
volatile
uint32_t
msTicks
;
#include <freewatch/freewatch_utils.h>
/* Local prototypes */
void
Delay
(
uint32_t
dlyTicks
);
/**************************************************************************//**
* @brief SysTick_Handler
* Interrupt Service Routine for system tick counter
*****************************************************************************/
void
SysTick_Handler
(
void
)
{
msTicks
++
;
/* increment counter necessary in Delay()*/
}
/**************************************************************************//**
* @brief Delays number of msTick Systicks (typically 1 ms)
* @param dlyTicks Number of ticks to delay
*****************************************************************************/
void
Delay
(
uint32_t
dlyTicks
)
{
uint32_t
curTicks
;
curTicks
=
msTicks
;
while
((
msTicks
-
curTicks
)
<
dlyTicks
);
}
/**************************************************************************//**
* @brief Main function
...
...
@@ -70,21 +46,9 @@ int main(void)
{
int
i
;
/* Setup SysTick Timer for 1 msec interrupts */
if
(
SysTick_Config
(
CMU_ClockFreqGet
(
cmuClock_CORE
)
/
1000
))
while
(
1
);
// Enable clocks and configure pins
CMU_ClockEnable
(
cmuClock_HFPER
,
true
);
CMU_ClockEnable
(
cmuClock_GPIO
,
true
);
GPIO_PinModeSet
(
gpioPortE
,
11
,
gpioModePushPull
,
0
);
GPIO_PinModeSet
(
gpioPortE
,
12
,
gpioModePushPull
,
0
);
freewatch_backlight_blinky
(
10
,
100
);
freewatch_backlight_blinky
(
200
,
15
);
freewatch_backlight_blinky
(
1000
,
5
);
/* Infinite blink loop */
while
(
1
)
{
GPIO_PinOutToggle
(
gpioPortE
,
11
);
GPIO_PinOutToggle
(
gpioPortE
,
12
);
Delay
(
200
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment