代码如下
led底层驱动参考安富莱的吧 我用的原子的开发板 但是底层驱动自己修改了
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "led.h"
#include "cmsis_os.h"
void Led_Switch(void const*arg)
{
for(;;)
{
Led_on((uint32_t)arg);
osDelay(500);
Led_off((uint32_t)arg);
osDelay(200);
}
}
osThreadDef(Led_Switch,osPriorityNormal,2,0);
int main(void)
{
osKernelInitialize();
LED_Init();
osThreadCreate(osThread(Led_Switch),(void*)1UL);
osThreadCreate(osThread(Led_Switch),(void*)0UL);
osKernelStart();
}