60 lines
1023 B
C
60 lines
1023 B
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_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();
|
|
Task_create(Leos_demoTask, "Task 1");
|
|
|
|
for (;;) {
|
|
Log_putU(Timer_getTicks(), 10);
|
|
Log_putS(". idle\r\n");
|
|
Task_yield();
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
Leos_demoTask(void *arg)
|
|
{
|
|
for (;;) {
|
|
Log_putU(Timer_getTicks(), 10);
|
|
Log_putS((const char *)arg);
|
|
Log_putS("\r\n");
|
|
Task_yield();
|
|
}
|
|
}
|