63 lines
1.1 KiB
C
63 lines
1.1 KiB
C
/******************************************************************************
|
|
*
|
|
* Copyright (c) 2017-2019 by Löwenware Ltd
|
|
* Please, refer LICENSE file for legal information
|
|
*
|
|
******************************************************************************/
|
|
|
|
/**
|
|
* @file main.c
|
|
* @author Ilja Kartašov <ik@lowenware.com>
|
|
* @brief
|
|
*
|
|
* @see https://lowenware.com/
|
|
*/
|
|
|
|
#include <leos/log.h>
|
|
#include <leos/irq.h>
|
|
#include <leos/leos.h>
|
|
#include <leos/task.h>
|
|
#include <drivers/timer/timer.h>
|
|
|
|
void
|
|
Leos_demoTask(void *arg);
|
|
|
|
|
|
void
|
|
Leos_run(void)
|
|
{
|
|
Log_init();
|
|
|
|
Log_putS("Starting LEOS (EL");
|
|
Log_putI(AArch64_getEL(), 10);
|
|
Log_putS(")\r\n");
|
|
|
|
AArch64_init();
|
|
|
|
IRQ_init();
|
|
Timer_init();
|
|
IRQ_enable();
|
|
|
|
Task_initSheduler();
|
|
if (Task_create(Leos_demoTask, "Task 1") == -1)
|
|
Log_putS("Task 1 was not created\r\n");
|
|
|
|
for (;;) {
|
|
Log_putU(Timer_getTicks(), 10);
|
|
Log_putS(". Idle Task\r\n");
|
|
Task_yield();
|
|
}
|
|
}
|
|
|
|
void
|
|
Leos_demoTask(void *arg)
|
|
{
|
|
for (;;) {
|
|
Log_putU(Timer_getTicks(), 10);
|
|
Log_putS(". ");
|
|
Log_putS((const char *)arg);
|
|
Log_putS("\r\n");
|
|
Task_yield();
|
|
}
|
|
}
|