12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #include "ch.h"
- #include "hal.h"
- static THD_WORKING_AREA(waThread1, 32);
- static THD_FUNCTION(Thread1, arg) {
- (void)arg;
- chRegSetThreadName("Blinker");
- while (true) {
- palTogglePad(IOPORT2, PORTB_LED1);
- chThdSleepMilliseconds(1000);
- }
- }
- int main(void) {
-
- halInit();
- chSysInit();
-
- sdStart(&SD1, NULL);
-
- chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
- chnWrite(&SD1, (const uint8_t *)"Hello World!\r\n", 14);
- while (true) {
- chThdSleepMilliseconds(1000);
- }
- }
|