Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ***********************************************************
- // ** NyaOS Sample **
- // ***********************************************************
- // http://teplofizik.diary.ru/p179560849.htm
- #include "nyaos.h"
- volatile int A = 0;
- // Процесс 1
- int Process1(uint32_t Argument)
- {
- while(1)
- {
- delay(1000000UL);
- LedOn(0);
- delay(1200000UL);
- LedOff(0);
- }
- }
- // Процесс 2
- int Process2(uint32_t Argument)
- {
- while(1)
- {
- delay(300000UL);
- LedOn(1);
- delay(1500000UL);
- LedOff(1);
- }
- }
- int main(void)
- {
- LedInit();
- // Инициализация и настройка ОС
- nyaos_Init();
- // Процесс 1
- nyaos_AddProcess("Process1", &Process1, 0, 0);
- // Процесс 2
- nyaos_AddProcess("Process2", &Process2, 0, 0);
- // Запуск ОС
- nyaos_Start();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement