version 2.8
gos_arduino.h
1 /*
2  * This file is subject to the terms of the GFX License. If a copy of
3  * the license was not distributed with this file, you can obtain one at:
4  *
5  * http://ugfx.org/license.html
6  */
7 
8 /**
9  * The arduino GOS implementation is similar to the bare metal raw32 gos implementation.
10  * It uses cooperative multi-tasking. Be careful
11  * when writing device drivers not to disturb the assumptions this creates by performing
12  * call-backs to uGFX code unless you define the INTERRUPTS_OFF() and INTERRUPTS_ON() macros.
13  * It still requires some C runtime library support...
14  * enough startup to initialise the stack, interrupts, static data etc and call main().
15  * setjmp() and longjmp() - for threading
16  * memcpy() - for heap and threading
17  * malloc(), realloc and free() - if GOS_RAW_HEAP_SIZE == 0
18  *
19  * You must also define the following routines in your own code so that timing functions will work...
20  * systemticks_t gfxSystemTicks(void);
21  * systemticks_t gfxMillisecondsToTicks(delaytime_t ms);
22  */
23 #ifndef _GOS_ARDUINO_H
24 #define _GOS_ARDUINO_H
25 
26 #if GFX_USE_OS_ARDUINO
27 
28 #include <Arduino.h>
29 
30 /*===========================================================================*/
31 /* Type definitions */
32 /*===========================================================================*/
33 
34 typedef unsigned char bool_t;
35 
36 #if 0
37  // Already defined by Arduino
38  typedef signed char int8_t;
39  typedef unsigned char uint8_t;
40  typedef signed short int16_t;
41  typedef unsigned short uint16_t;
42  typedef signed int int32_t;
43  typedef unsigned int uint32_t;
44  typedef uint32_t size_t;
45 #endif
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51  void gfxHalt(const char *msg);
52  void gfxExit(void);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 /*===========================================================================*/
59 /* Use the generic thread handling and heap handling */
60 /*===========================================================================*/
61 
62 #define GOS_NEED_X_THREADS TRUE
63 #define GOS_NEED_X_HEAP TRUE
64 
65 #include "gos_x_threads.h"
66 #include "gos_x_heap.h"
67 
68 #endif /* GFX_USE_OS_ARDUINO */
69 #endif /* _GOS_ARDUINO_H */
void gfxExit(void)
Exit the GFX application.
void gfxHalt(const char *msg)
Halt the GFX application due to an error.