µGFX  2.9
version 2.9
gos_nios.c
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.io/license.html
6  */
7 
8 #include "../../gfx.h"
9 
10 #if GFX_USE_OS_NIOS
11 
12 void _gosHeapInit(void);
13 void _gosThreadsInit(void);
14 
15 /*********************************************************
16  * Initialise
17  *********************************************************/
18 
19 void _gosInit(void)
20 {
21  // Set up the heap allocator
22  _gosHeapInit();
23 
24  // Start the scheduler
25  _gosThreadsInit();
26 }
27 
28 void _gosPostInit(void)
29 {
30 }
31 
32 void _gosDeinit(void)
33 {
34 }
35 
36 void gfxHalt(const char *msg)
37 {
38  volatile gU32 dummy;
39 
40  (void)msg;
41 
42  while(1) {
43  dummy++;
44  }
45 }
46 
47 void gfxExit(void) {
48  volatile gU32 dummy;
49 
50  while(1) {
51  dummy++;
52  }
53 }
54 
55 gTicks gfxSystemTicks(void)
56 {
57  return alt_nticks();
58 }
59 
60 gTicks gfxMillisecondsToTicks(gDelay ms)
61 {
62  return ms;
63 }
64 
65 #endif /* GFX_USE_OS_NIOS */
gTicks gfxSystemTicks(void)
Get the current operating system tick time.
gTicks gfxMillisecondsToTicks(gDelay ms)
Convert a given number of millseconds to a number of operating system ticks.
void gfxExit(void)
Exit the GFX application.
void gfxHalt(const char *msg)
Halt the GFX application due to an error.