123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #include "ch.h"
- #include "hal.h"
- #include "rt_test_root.h"
- #include "oslib_test_root.h"
- static THD_WORKING_AREA(waThread1, 128);
- static THD_FUNCTION(Thread1, arg) {
- (void)arg;
- chRegSetThreadName("blinker");
- while (true) {
- palSetLine(LINE_LED2_GREEN);
- chThdSleepMilliseconds(500);
- palClearLine(LINE_LED2_GREEN);
- chThdSleepMilliseconds(500);
- }
- }
- int main(void) {
-
- halInit();
- chSysInit();
-
- palClearLine(LINE_ARD_D13);
- palSetLineMode(LINE_ARD_D13, PAL_MODE_OUTPUT_PUSHPULL);
-
- sdStart(&SD1, NULL);
-
- chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
-
- while (true) {
- if (palReadLine(LINE_BUTTON_USER)) {
- test_execute((BaseSequentialStream *)&SD1, &rt_test_suite);
- test_execute((BaseSequentialStream *)&SD1, &oslib_test_suite);
- }
- chThdSleepMilliseconds(500);
- }
- }
|