2015-04-07 13:22:04 +00:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms of the GFX License. If a copy of
|
|
|
|
* the license was not distributed with this file, you can obtain one at:
|
|
|
|
*
|
|
|
|
* http://ugfx.org/license.html
|
|
|
|
*/
|
|
|
|
|
2015-11-21 09:27:08 +00:00
|
|
|
#include "../../gfx.h"
|
2015-04-07 13:22:04 +00:00
|
|
|
|
|
|
|
#if GFX_USE_OS_ARDUINO
|
|
|
|
|
|
|
|
#include <string.h> // Prototype for memcpy()
|
|
|
|
|
2015-07-16 09:02:59 +00:00
|
|
|
void _gosHeapInit(void);
|
|
|
|
void _gosThreadsInit(void);
|
2015-04-07 13:22:04 +00:00
|
|
|
|
|
|
|
/*********************************************************
|
|
|
|
* Initialise
|
|
|
|
*********************************************************/
|
|
|
|
|
|
|
|
void _gosInit(void)
|
|
|
|
{
|
|
|
|
/* No initialization of the operating system itself is needed as there isn't one.
|
|
|
|
* On the other hand the C runtime should still already be initialized before
|
|
|
|
* getting here!
|
|
|
|
*/
|
2015-07-16 09:02:59 +00:00
|
|
|
#if !GFX_OS_INIT_NO_WARNING
|
2017-06-30 09:43:51 +00:00
|
|
|
#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
|
|
|
|
#warning "GOS: Arduino - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
|
|
|
|
#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
|
|
|
|
COMPILER_WARNING("GOS: Arduino - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!")
|
|
|
|
#endif
|
2015-07-16 09:02:59 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Start the heap allocator
|
|
|
|
_gosHeapInit();
|
2015-04-07 13:22:04 +00:00
|
|
|
|
|
|
|
// Start the scheduler
|
|
|
|
_gosThreadsInit();
|
|
|
|
}
|
|
|
|
|
2017-03-04 05:02:55 +00:00
|
|
|
void _gosPostInit(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-04-07 13:22:04 +00:00
|
|
|
void _gosDeinit(void)
|
|
|
|
{
|
|
|
|
/* ToDo */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************
|
|
|
|
* Exit everything functions
|
|
|
|
*********************************************************/
|
|
|
|
|
|
|
|
void gfxHalt(const char *msg) {
|
|
|
|
volatile uint32_t dummy;
|
|
|
|
(void) msg;
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
dummy++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void gfxExit(void) {
|
|
|
|
volatile uint32_t dummy;
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
dummy++;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************
|
|
|
|
* Sleep functions
|
|
|
|
*********************************************************/
|
|
|
|
|
2015-07-16 09:02:59 +00:00
|
|
|
systemticks_t gfxSystemTicks(void) {
|
|
|
|
return millis();
|
2015-04-07 13:22:04 +00:00
|
|
|
}
|
2015-07-16 09:02:59 +00:00
|
|
|
systemticks_t gfxMillisecondsToTicks(delaytime_t ms) {
|
|
|
|
return ms;
|
2015-04-07 13:22:04 +00:00
|
|
|
}
|
|
|
|
|
2015-07-16 09:02:59 +00:00
|
|
|
#endif /* GFX_USE_OS_ARDUINO */
|