123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include "ch.h"
- #include "hal.h"
- static THD_WORKING_AREA(waThread1, 32);
- static THD_FUNCTION(Thread1, arg) {
- (void)arg;
- chRegSetThreadName("Blinker");
- while (true) {
- palClearPad(IOPORT5, PORTE_LED);
- chThdSleepMilliseconds(1000);
- palSetPad(IOPORT5, PORTE_LED);
- chThdSleepMilliseconds(1000);
- }
- }
- int main(void) {
-
- halInit();
- chSysInit();
-
- chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
- while (true) {
- chThdSleepMilliseconds(100);
- }
- }
|