diff options
author | marcoveeneman <marco-veeneman@hotmail.com> | 2015-03-04 20:32:05 +0100 |
---|---|---|
committer | marcoveeneman <marco-veeneman@hotmail.com> | 2015-03-04 20:32:05 +0100 |
commit | 42add52912afc3f835fa66af279eda91b3d4bbc4 (patch) | |
tree | 4b068a60fa0c86763438ace7ec7c8475abfa1a86 /testhal/TIVA | |
parent | 81b87913b45ae92a49ef115cae88d690de672f28 (diff) | |
download | ChibiOS-Contrib-42add52912afc3f835fa66af279eda91b3d4bbc4.tar.gz ChibiOS-Contrib-42add52912afc3f835fa66af279eda91b3d4bbc4.tar.bz2 ChibiOS-Contrib-42add52912afc3f835fa66af279eda91b3d4bbc4.zip |
Updated Tiva Testhal demos for GPT and PWM.
Diffstat (limited to 'testhal/TIVA')
-rw-r--r-- | testhal/TIVA/TM4C123x/GPT/main.c | 2 | ||||
-rw-r--r-- | testhal/TIVA/TM4C123x/PWM/main.c | 25 |
2 files changed, 9 insertions, 18 deletions
diff --git a/testhal/TIVA/TM4C123x/GPT/main.c b/testhal/TIVA/TM4C123x/GPT/main.c index 416c1ae..c365186 100644 --- a/testhal/TIVA/TM4C123x/GPT/main.c +++ b/testhal/TIVA/TM4C123x/GPT/main.c @@ -71,6 +71,8 @@ int main(void) halInit(); chSysInit(); + palSetPadMode(GPIOF, GPIOF_LED_RED, PAL_MODE_OUTPUT_PUSHPULL); + /* * Start the gpt drivers with the custom configurations. */ diff --git a/testhal/TIVA/TM4C123x/PWM/main.c b/testhal/TIVA/TM4C123x/PWM/main.c index 252ad5e..b2b69d3 100644 --- a/testhal/TIVA/TM4C123x/PWM/main.c +++ b/testhal/TIVA/TM4C123x/PWM/main.c @@ -74,6 +74,10 @@ int main(void) halInit(); chSysInit(); + palSetPadMode(GPIOF, GPIOF_LED_RED, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOF, GPIOF_LED_GREEN, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOF, GPIOF_LED_BLUE, PAL_MODE_OUTPUT_PUSHPULL); + /* * Start PWM driver */ @@ -109,24 +113,9 @@ int main(void) rgbColour[decColour] -= 1; rgbColour[incColour] += 1; - if (!palReadPad(GPIOF, GPIOF_SW1)) - { - pwmEnableChannel(&PWMD1, 0, 0); - pwmEnableChannel(&PWMD1, 1, 1); - pwmEnableChannel(&PWMD1, 2, 2); - } - else if (!palReadPad(GPIOF, GPIOF_SW2)) - { - pwmEnableChannel(&PWMD1, 0, pwmcfg.frequency - 2); - pwmEnableChannel(&PWMD1, 1, pwmcfg.frequency - 1); - pwmEnableChannel(&PWMD1, 2, pwmcfg.frequency); - } - else - { - pwmEnableChannel(&PWMD1, 0, rgbColour[0]); - pwmEnableChannel(&PWMD1, 1, rgbColour[1]); - pwmEnableChannel(&PWMD1, 2, rgbColour[2]); - } + pwmEnableChannel(&PWMD1, 0, rgbColour[0]); + pwmEnableChannel(&PWMD1, 1, rgbColour[1]); + pwmEnableChannel(&PWMD1, 2, rgbColour[2]); chThdSleepMilliseconds(1); } |