12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #include "ch.h"
- #include "hal.h"
- #include "rt_test_root.h"
- #include "oslib_test_root.h"
- static THD_WORKING_AREA(waThread1, 512);
- static THD_FUNCTION(Thread1, arg) {
- (void)arg;
- chRegSetThreadName("blinker");
- while (true) {
- palToggleLine(LINE_LED_BLUE);
- chThdSleepMilliseconds(80);
- palToggleLine(LINE_LED_BLUE);
- chThdSleepMilliseconds(120);
- palToggleLine(LINE_LED_BLUE);
- chThdSleepMilliseconds(120);
- palToggleLine(LINE_LED_BLUE);
- chThdSleepMilliseconds(120);
- palToggleLine(LINE_LED_BLUE);
- chThdSleepMilliseconds(160);
- palToggleLine(LINE_LED_BLUE);
- chThdSleepMilliseconds(600);
- }
- }
- static const SerialConfig sdcfg = {
- 115200,
- 0,
- UART_MR_PAR_NO
- };
- int main(void) {
-
- halInit();
- chSysInit();
-
- sdStart(&SD1, &sdcfg);
-
- chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
-
- while (true) {
- if(!palReadPad(PIOB, PIOB_USER_PB)) {
- test_execute((BaseSequentialStream *)&SD1, &rt_test_suite);
- test_execute((BaseSequentialStream *)&SD1, &oslib_test_suite);
- }
- chThdSleepMilliseconds(500);
- }
- }
|