Created
June 16, 2014 14:56
-
-
Save gamazeps/3cc4581653f7dc61fbfa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include “hal.h” | |
#include “ch.h” | |
int main(void) { | |
halInit(); // initializes hardware abstraction layer | |
chSysInit(); // initializes ChibiOS kernel | |
// configures GPIOC pin 1 as output pushpull | |
palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL); | |
while(1) { | |
palSetPad(GPIOC, 1); // sets GPIOC 1 high | |
chThdSleepMilliseconds(500); // sleeps for 500ms | |
palClearPad(GPIOC, 1); // sets GPIOC 1 low | |
chThdSleepMilliseconds(500); // sleeps for 500ms | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment