Adding support for NIOS-II platform
This commit is contained in:
parent
870901880b
commit
eaf0b19fb8
9 changed files with 123 additions and 2 deletions
|
@ -26,6 +26,7 @@ FIX: Fixing issue in touchscreen calibration code
|
||||||
FEATURE: Added GFX_OS_PRE_INIT_FUNCTION for early hardware initialization
|
FEATURE: Added GFX_OS_PRE_INIT_FUNCTION for early hardware initialization
|
||||||
FIX: Fixing GTIMER for high clock rate devices
|
FIX: Fixing GTIMER for high clock rate devices
|
||||||
FEATURE: Added GFX_COMPILER_KEIL and GFX_COMPILER_ARMCC macros
|
FEATURE: Added GFX_COMPILER_KEIL and GFX_COMPILER_ARMCC macros
|
||||||
|
FEATURE: Added support for NIOS-II platform
|
||||||
|
|
||||||
|
|
||||||
*** Release 2.3 ***
|
*** Release 2.3 ***
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
//#define GFX_USE_OS_KEIL FALSE
|
//#define GFX_USE_OS_KEIL FALSE
|
||||||
//#define GFX_USE_OS_CMSIS FALSE
|
//#define GFX_USE_OS_CMSIS FALSE
|
||||||
//#define GFX_USE_OS_RAW32 FALSE
|
//#define GFX_USE_OS_RAW32 FALSE
|
||||||
|
//#define GFX_USE_OS_NIOS FALSE
|
||||||
// #define INTERRUPTS_OFF() optional_code
|
// #define INTERRUPTS_OFF() optional_code
|
||||||
// #define INTERRUPTS_ON() optional_code
|
// #define INTERRUPTS_ON() optional_code
|
||||||
|
|
||||||
|
|
|
@ -478,6 +478,8 @@
|
||||||
#include "gos_cmsis.h"
|
#include "gos_cmsis.h"
|
||||||
#elif GFX_USE_OS_KEIL
|
#elif GFX_USE_OS_KEIL
|
||||||
#include "gos_keil.h"
|
#include "gos_keil.h"
|
||||||
|
#elif GFX_USE_OS_NIOS
|
||||||
|
#include "gos_nios.h"
|
||||||
#else
|
#else
|
||||||
#error "Your operating system is not supported yet"
|
#error "Your operating system is not supported yet"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,6 +13,7 @@ GFXSRC += $(GFXLIB)/src/gos/gos_chibios.c \
|
||||||
$(GFXLIB)/src/gos/gos_rawrtos.c \
|
$(GFXLIB)/src/gos/gos_rawrtos.c \
|
||||||
$(GFXLIB)/src/gos/gos_arduino.c \
|
$(GFXLIB)/src/gos/gos_arduino.c \
|
||||||
$(GFXLIB)/src/gos/gos_cmsis.c \
|
$(GFXLIB)/src/gos/gos_cmsis.c \
|
||||||
|
$(GFXLIB)/src/gos/gos_nios.c \
|
||||||
$(GFXLIB)/src/gos/gos_x_threads.c \
|
$(GFXLIB)/src/gos/gos_x_threads.c \
|
||||||
$(GFXLIB)/src/gos/gos_x_heap.c
|
$(GFXLIB)/src/gos/gos_x_heap.c
|
||||||
|
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
#include "gos_rawrtos.c"
|
#include "gos_rawrtos.c"
|
||||||
#include "gos_win32.c"
|
#include "gos_win32.c"
|
||||||
#include "gos_cmsis.c"
|
#include "gos_cmsis.c"
|
||||||
|
#include "gos_nios.c"
|
||||||
#include "gos_x_threads.c"
|
#include "gos_x_threads.c"
|
||||||
#include "gos_x_heap.c"
|
#include "gos_x_heap.c"
|
||||||
|
|
64
src/gos/gos_nios.c
Normal file
64
src/gos/gos_nios.c
Normal file
|
@ -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 */
|
44
src/gos/gos_nios.h
Normal file
44
src/gos/gos_nios.h
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _GOS_NIOS_H
|
||||||
|
#define _GOS_NIOS_H
|
||||||
|
|
||||||
|
#if GFX_USE_OS_NIOS
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <sys/alt_alarm.h>
|
||||||
|
|
||||||
|
typedef alt_u32 systemticks_t;
|
||||||
|
typedef alt_u32 delaytime_t;
|
||||||
|
typedef unsigned char bool_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void gfxHalt(const char* msg);
|
||||||
|
void gfxExit(void);
|
||||||
|
systemticks_t gfxSystemTicks(void);
|
||||||
|
systemticks_t gfxMillisecondsToTicks(delaytime_t ms);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Use the generic thread handling and heap handling
|
||||||
|
#define GOS_NEED_X_THREADS TRUE
|
||||||
|
#define GOS_NEED_X_HEAP TRUE
|
||||||
|
|
||||||
|
#include "gos_x_threads.h"
|
||||||
|
#include "gos_x_heap.h"
|
||||||
|
|
||||||
|
#endif /* GFX_USE_OS_NIOS */
|
||||||
|
#endif /* _GOS_NIOS_H */
|
|
@ -97,6 +97,13 @@
|
||||||
#ifndef GFX_USE_OS_KEIL
|
#ifndef GFX_USE_OS_KEIL
|
||||||
#define GFX_USE_OS_KEIL FALSE
|
#define GFX_USE_OS_KEIL FALSE
|
||||||
#endif
|
#endif
|
||||||
|
/**
|
||||||
|
* @brief Use NIOS-II
|
||||||
|
* @details Defaults to FALSE
|
||||||
|
*/
|
||||||
|
#ifndef GFX_USE_OS_NIOS
|
||||||
|
#define GFX_USE_OS_NIOS FALSE
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*
|
*
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#ifndef _GOS_RULES_H
|
#ifndef _GOS_RULES_H
|
||||||
#define _GOS_RULES_H
|
#define _GOS_RULES_H
|
||||||
|
|
||||||
#if !GFX_USE_OS_CHIBIOS && !GFX_USE_OS_WIN32 && !GFX_USE_OS_LINUX && !GFX_USE_OS_OSX && !GFX_USE_OS_RAW32 && !GFX_USE_OS_FREERTOS && !GFX_USE_OS_ECOS && !GFX_USE_OS_RAWRTOS && !GFX_USE_OS_ARDUINO && !GFX_USE_OS_CMSIS && !GFX_USE_OS_KEIL
|
#if !GFX_USE_OS_CHIBIOS && !GFX_USE_OS_WIN32 && !GFX_USE_OS_LINUX && !GFX_USE_OS_OSX && !GFX_USE_OS_RAW32 && !GFX_USE_OS_FREERTOS && !GFX_USE_OS_ECOS && !GFX_USE_OS_RAWRTOS && !GFX_USE_OS_ARDUINO && !GFX_USE_OS_CMSIS && !GFX_USE_OS_KEIL && !GFX_USE_OS_NIOS
|
||||||
#if GFX_DISPLAY_RULE_WARNINGS
|
#if GFX_DISPLAY_RULE_WARNINGS
|
||||||
#warning "GOS: No Operating System has been defined. ChibiOS (GFX_USE_OS_CHIBIOS) has been turned on for you."
|
#warning "GOS: No Operating System has been defined. ChibiOS (GFX_USE_OS_CHIBIOS) has been turned on for you."
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
#define GFX_USE_OS_CHIBIOS TRUE
|
#define GFX_USE_OS_CHIBIOS TRUE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GFX_USE_OS_CHIBIOS + GFX_USE_OS_WIN32 + GFX_USE_OS_LINUX + GFX_USE_OS_OSX + GFX_USE_OS_RAW32 + GFX_USE_OS_FREERTOS + GFX_USE_OS_ECOS + GFX_USE_OS_RAWRTOS + GFX_USE_OS_ARDUINO + GFX_USE_OS_CMSIS + GFX_USE_OS_KEIL != 1 * TRUE
|
#if GFX_USE_OS_CHIBIOS + GFX_USE_OS_WIN32 + GFX_USE_OS_LINUX + GFX_USE_OS_OSX + GFX_USE_OS_RAW32 + GFX_USE_OS_FREERTOS + GFX_USE_OS_ECOS + GFX_USE_OS_RAWRTOS + GFX_USE_OS_ARDUINO + GFX_USE_OS_CMSIS + GFX_USE_OS_KEIL + GFX_USE_OS_NIOS != 1 * TRUE
|
||||||
#error "GOS: More than one operation system has been defined as TRUE."
|
#error "GOS: More than one operation system has been defined as TRUE."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue