1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include "hal.h"
- #include "ch.h"
- #include "nil_test_root.h"
- THD_WORKING_AREA(waThread1, 128);
- THD_FUNCTION(Thread1, arg) {
- (void)arg;
- while (true) {
- palTogglePad(IOPORT2, PORTB_LED1);
- chThdSleepMilliseconds(500);
- }
- }
- THD_WORKING_AREA(waThread2, 128);
- THD_FUNCTION(Thread2, arg) {
- (void)arg;
- bool runTestSuite = true;
-
- sdStart(&SD1, NULL);
- while (true) {
- if (runTestSuite) {
- test_execute((BaseSequentialStream *)&SD1, &nil_test_suite);
- runTestSuite = false;
- }
- chThdSleepMilliseconds(500);
- }
- }
- THD_TABLE_BEGIN
- THD_TABLE_ENTRY(waThread1, "blinker", Thread1, NULL)
- THD_TABLE_ENTRY(wa_test_support, "test_support", test_support, (void *)&nil.threads[2])
- THD_TABLE_ENTRY(waThread2, "tester", Thread2, NULL)
- THD_TABLE_END
- int main(void) {
-
- halInit();
- chSysInit();
-
- while (true) {
- }
- }
|