#include "os_tick.h"
#include "cmsis_os.h"
#include "include/rtthread.h"
#include "include/rthw.h"
osThreadId Task1Handle;
// Task function
void StartTask1(void *pvParameters) {
while (1) {
digitalWrite(8, HIGH);
delay(500);
digitalWrite(8, LOW);
delay(500);
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, STM32!");
pinMode(8, OUTPUT);
// Create a task with a priority of 1
osThreadDef(Task1, StartTask1, osPriorityNormal, 0, 128);
Task1Handle = osThreadCreate(osThread(Task1), NULL);
// Start the scheduler
osKernelStart();
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}