diff options
author | edolomb <none@example.com> | 2018-02-26 22:31:26 +0000 |
---|---|---|
committer | edolomb <none@example.com> | 2018-02-26 22:31:26 +0000 |
commit | 1f6ddb8b2dd0427d86a8b29f7cfd4c6b2d126287 (patch) | |
tree | d7204b2fb8d976b81b75a5bd988d118ef6b61078 /testhal/ATSAMA5D2/TC/main.c | |
parent | 6c7ca9f494416116c6fddd54ab8e36dd94228627 (diff) | |
download | ChibiOS-1f6ddb8b2dd0427d86a8b29f7cfd4c6b2d126287.tar.gz ChibiOS-1f6ddb8b2dd0427d86a8b29f7cfd4c6b2d126287.tar.bz2 ChibiOS-1f6ddb8b2dd0427d86a8b29f7cfd4c6b2d126287.zip |
Updated Demo
git-svn-id: https://svn.code.sf.net/p/chibios/svn2/trunk@11564 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'testhal/ATSAMA5D2/TC/main.c')
-rwxr-xr-x | testhal/ATSAMA5D2/TC/main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/testhal/ATSAMA5D2/TC/main.c b/testhal/ATSAMA5D2/TC/main.c index f681a06c9..af7c6eda5 100755 --- a/testhal/ATSAMA5D2/TC/main.c +++ b/testhal/ATSAMA5D2/TC/main.c @@ -19,9 +19,9 @@ static TCConfig tccfg = {
{
- {TC_OUTPUT_ACTIVE, 440 , NULL}, /* 440 hz clock frequency. */
- {TC_OUTPUT_DISABLED, 0, NULL},
- {TC_OUTPUT_DISABLED, 0, NULL}
+ {TC_OUTPUT_DISABLED, 0, NULL}, /* Channel 0. */
+ {TC_OUTPUT_ACTIVE, 440 , NULL}, /* Channel 1, 440 hz clock frequency. */
+ {TC_OUTPUT_DISABLED, 0, NULL} /* Channel 2. */
}
};
@@ -35,10 +35,10 @@ static THD_FUNCTION(Thread1, arg) { chRegSetThreadName("buzzer");
while (true) {
- tcEnableChannel(&TCD0, 0, 50);
+ tcEnableChannel(&TCD0, 1, 50);
palClearLine(LINE_LED_RED);
chThdSleepMilliseconds(500);
- tcDisableChannel(&TCD0, 0);
+ tcDisableChannel(&TCD0, 1);
palSetLine(LINE_LED_RED);
chThdSleepMilliseconds(500);
}
@@ -62,10 +62,11 @@ int main(void) { /*
* Initializes the TC0 driver.
- * GPIOA19 is the TC0 channel 0 output.
+ * PD11 is the TC0 channel 1 output.
*/
- palSetGroupMode(PIOA, PAL_PORT_BIT(19), 0U,
- PAL_SAMA_FUNC_PERIPH_D | PAL_MODE_SECURE);
+ palSetGroupMode(PIOD, PAL_PORT_BIT(11), 0U,
+ PAL_SAMA_FUNC_PERIPH_A | PAL_MODE_SECURE);
+
tcStart(&TCD0, &tccfg);
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
|