aboutsummaryrefslogtreecommitdiffstats
path: root/src/gos/gos_nios.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gos/gos_nios.c')
-rw-r--r--src/gos/gos_nios.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/gos/gos_nios.c b/src/gos/gos_nios.c
new file mode 100644
index 00000000..36e3b19b
--- /dev/null
+++ b/src/gos/gos_nios.c
@@ -0,0 +1,64 @@
+/*
+ * 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
+ */
+
+#include "../../gfx.h"
+
+#if GFX_USE_OS_NIOS
+
+void _gosHeapInit(void);
+void _gosThreadsInit(void);
+
+/*********************************************************
+ * Initialise
+ *********************************************************/
+
+void _gosInit(void)
+{
+ // Set up the heap allocator
+ _gosHeapInit();
+
+ // Start the scheduler
+ _gosThreadsInit();
+}
+
+void _gosDeinit(void)
+{
+}
+
+void gfxHalt(const char *msg)
+{
+ volatile uint32_t dummy;
+
+ (void)msg;
+
+ while(1) {
+ dummy++;
+ }
+}
+
+void gfxExit(void) {
+ volatile uint32_t dummy;
+
+ while(1) {
+ dummy++;
+ }
+}
+#include <stdio.h>
+systemticks_t gfxSystemTicks(void)
+{
+ volatile alt_u32 ticks = alt_nticks();
+
+ printf("Ticks: %d\r\n", ticks);
+ return ticks;
+}
+
+systemticks_t gfxMillisecondsToTicks(delaytime_t ms)
+{
+ return ms;
+}
+
+#endif /* GFX_USE_OS_NIOS */