-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff220ae
commit 3a63198
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Keep this first line. | ||
GOSSAMER_PATH = ../.. | ||
|
||
# If your firmware targets a specific board, specify it here, | ||
# or omit it and provide it on the command line (make BOARD=foo). | ||
BOARD=circuitplayground | ||
|
||
# Leave this line here. | ||
include $(GOSSAMER_PATH)/make.mk | ||
|
||
SRCS += \ | ||
./app.c \ | ||
|
||
# Finally, leave this line at the bottom of the file. | ||
include $(GOSSAMER_PATH)/rules.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "app.h" | ||
#include "delay.h" | ||
#include "tcc.h" | ||
|
||
void app_init(void) { | ||
} | ||
|
||
void app_setup(void) { | ||
HAL_GPIO_A1_out(); | ||
HAL_GPIO_A1_pmuxen(HAL_GPIO_PMUX_TC_TCC); | ||
|
||
// 8 Mhz / 250 = 32 kHz | ||
tcc_init(0, GENERIC_CLOCK_0, TCC_PRESCALER_DIV1); | ||
tcc_set_wavegen(0, TCC_WAVEGEN_NORMAL_PWM); | ||
tcc_set_period(0, 250, false); | ||
tcc_set_cc(0, 1, 125, false); | ||
tcc_enable(0); | ||
} | ||
|
||
bool app_loop(void) { | ||
return false; | ||
} |