1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
- #include "VOICE.h"
- #include "cmsis_os2.h"
- #include "ohos_init.h"
- #define TASK_STACK_SIZE 1024 * 8
- #define TASK_PRIO 25
- static void ExampleTask(void)
- {
- BoardInit();
- while (1)
- {
-
- BeepStatusSet(ON);
- LedRed1StatusSet(ON);
- LedRed2StatusSet(ON);
- LedBlue1StatusSet(OFF);
- LedBlue2StatusSet(OFF);
- osDelay(50);
- BeepStatusSet(OFF);
- LedRed1StatusSet(OFF);
- LedRed2StatusSet(OFF);
- LedBlue1StatusSet(ON);
- LedBlue2StatusSet(ON);
- osDelay(150);
- }
- }
- static void ExampleEntry(void)
- {
- osThreadAttr_t attr;
- attr.name = "ExampleTask";
- attr.attr_bits = 0U;
- attr.cb_mem = NULL;
- attr.cb_size = 0U;
- attr.stack_mem = NULL;
- attr.stack_size = TASK_STACK_SIZE;
- attr.priority = TASK_PRIO;
- if (osThreadNew((osThreadFunc_t)ExampleTask, NULL, &attr) == NULL) {
- printf("Failed to create ExampleTask!\n");
- }
- }
- APP_FEATURE_INIT(ExampleEntry);
|