aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/KINETIS/FRDM-KL26Z/PWM
diff options
context:
space:
mode:
authorFabio Utzig <utzig@utzig.org>2016-05-08 20:59:01 -0300
committerFabio Utzig <utzig@utzig.org>2016-05-08 20:59:01 -0300
commit03c1e5074237ce5bc45f2655e0564eee8233c012 (patch)
tree80fc513f4a5f47e3bb1be9aae57c20bad30e7641 /testhal/KINETIS/FRDM-KL26Z/PWM
parentcf02c79b5aa7209542cbf1b0cefe703a2c0c60be (diff)
parent7d99206f055a3527bf1aa92052f9923f6cb744a5 (diff)
downloadChibiOS-Contrib-03c1e5074237ce5bc45f2655e0564eee8233c012.tar.gz
ChibiOS-Contrib-03c1e5074237ce5bc45f2655e0564eee8233c012.tar.bz2
ChibiOS-Contrib-03c1e5074237ce5bc45f2655e0564eee8233c012.zip
Merge pull request #71 from flabbergast/kinetis
[KINETIS] PAL driver: implement PAL_LINE.
Diffstat (limited to 'testhal/KINETIS/FRDM-KL26Z/PWM')
-rw-r--r--testhal/KINETIS/FRDM-KL26Z/PWM/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/testhal/KINETIS/FRDM-KL26Z/PWM/main.c b/testhal/KINETIS/FRDM-KL26Z/PWM/main.c
index 9e41bf6..740471a 100644
--- a/testhal/KINETIS/FRDM-KL26Z/PWM/main.c
+++ b/testhal/KINETIS/FRDM-KL26Z/PWM/main.c
@@ -104,9 +104,9 @@ static THD_FUNCTION(ButtonThread, arg) {
uint8_t newstate, state = PAL_HIGH;
while(true) {
- if(palReadPad(GPIO_BUTTON, PIN_BUTTON) != state) {
+ if(palReadLine(LINE_BUTTON) != state) {
chThdSleepMilliseconds(20); /* debounce */
- newstate = palReadPad(GPIO_BUTTON, PIN_BUTTON);
+ newstate = palReadLine(LINE_BUTTON);
if(newstate != state) {
state = newstate;
if(newstate == PAL_LOW) {
@@ -135,9 +135,9 @@ int main(void) {
/*
* Turn off the RGB LED.
*/
- palSetPad(GPIO_LED_RED, PIN_LED_RED); /* red */
- palSetPad(GPIO_LED_GREEN, PIN_LED_GREEN); /* green */
- palSetPad(GPIO_LED_BLUE, PIN_LED_BLUE); /* blue */
+ palSetLine(LINE_LED_RED); /* red */
+ palSetLine(LINE_LED_GREEN); /* green */
+ palSetLine(LINE_LED_BLUE); /* blue */
/*
* Create the button check thread.
@@ -149,9 +149,9 @@ int main(void) {
* Enable channels now to avoid a blink later.
*/
pwmStart(&PWM_DRIVER, &pwmcfg);
- palSetPadMode(GPIO_LED_RED, PIN_LED_RED, PAL_MODE_ALTERNATIVE_3);
- palSetPadMode(GPIO_LED_GREEN, PIN_LED_GREEN, PAL_MODE_ALTERNATIVE_3);
- palSetPadMode(GPIO_LED_BLUE, PIN_LED_BLUE, PAL_MODE_ALTERNATIVE_4);
+ palSetLineMode(LINE_LED_RED, PAL_MODE_ALTERNATIVE_3);
+ palSetLineMode(LINE_LED_GREEN, PAL_MODE_ALTERNATIVE_3);
+ palSetLineMode(LINE_LED_BLUE, PAL_MODE_ALTERNATIVE_4);
pwmEnableChannel(&PWM_DRIVER, 2, 0);
pwmEnableChannel(&PWM_DRIVER, 4, 0);
pwmEnableChannel(&PWM_DRIVER, 5, 0);