mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 09:15:38 +03:00
Atmega 128 support
This commit is contained in:
parent
fee65d8ae5
commit
5712b03bca
6 changed files with 44 additions and 16 deletions
39
src/Makefile
39
src/Makefile
|
@ -50,7 +50,7 @@ DELAY = 5
|
|||
#----------- BUILD OPTIONS ---------------------------
|
||||
|
||||
# PCB version
|
||||
# Values: STD, V4, ARM
|
||||
# Values: STD, STD128, V4, ARM
|
||||
PCB = STD
|
||||
|
||||
# PCB revision
|
||||
|
@ -214,6 +214,12 @@ ifeq ($(PCB), STD)
|
|||
XCURVES = NO
|
||||
endif
|
||||
|
||||
ifeq ($(PCB), STD128)
|
||||
TRGT = avr-
|
||||
MCU = atmega128
|
||||
CPPDEFS += -DF_CPU=$(F_CPU)UL
|
||||
endif
|
||||
|
||||
ifeq ($(PCB), V4)
|
||||
ifeq ($(PCBREV), REV0)
|
||||
CPPDEFS += -DREV0
|
||||
|
@ -465,6 +471,37 @@ ifeq ($(PCB), V4)
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PCB), STD128)
|
||||
# STD PCB with Atmega 128, so ...
|
||||
OPT = 2
|
||||
CPPDEFS += -DPCBSTD -DM128
|
||||
EXTRAINCDIRS += stock
|
||||
BOARDSRC = board_stock.cpp
|
||||
EEPROMSRC = eeprom_avr.cpp
|
||||
PULSESSRC = pulses_avr.cpp
|
||||
|
||||
ifeq ($(AUDIO), YES)
|
||||
CPPDEFS += -DAUDIO
|
||||
CPPSRC += stock/audio.cpp
|
||||
else
|
||||
CPPSRC += beeper.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(VOICE), YES)
|
||||
CPPSRC += stock/voice.cpp
|
||||
CPPDEFS += -DVOICE
|
||||
endif
|
||||
|
||||
ifeq ($(HAPTIC), YES)
|
||||
CPPDEFS += -DHAPTIC
|
||||
CPPSRC += haptic.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(SP22), YES)
|
||||
CPPDEFS += -DSP22
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PCB), STD)
|
||||
# STD PCB, so ...
|
||||
OPT = s
|
||||
|
|
|
@ -47,7 +47,7 @@ extern uint16_t s_eeDirtyTime10ms;
|
|||
// bs=16 128 blocks verlust link:128 16files:16*8 128 sum 256
|
||||
// bs=32 64 blocks verlust link: 64 16files:16*16 256 sum 320
|
||||
//
|
||||
#if defined(PCBV4)
|
||||
#if defined(PCBV4) || defined(M128)
|
||||
#define EESIZE 4096
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 36
|
||||
|
@ -84,7 +84,7 @@ PACK(struct EeFs{
|
|||
|
||||
#define RESV sizeof(EeFs) //reserv for eeprom header with directory (eeFs)
|
||||
|
||||
#if defined(PCBV4)
|
||||
#if defined(PCBV4) || defined(M128)
|
||||
#define FIRSTBLK 1
|
||||
#define BLOCKS (1+(EESIZE-RESV)/BS)
|
||||
#define BLOCKS_OFFSET (RESV-BS)
|
||||
|
|
|
@ -607,7 +607,7 @@ PACK(typedef struct t_PhaseData {
|
|||
#define MAX_EXPOS 32
|
||||
#define NUM_CSW 32 // number of custom switches
|
||||
#define NUM_FSW 32 // number of functions assigned to switches
|
||||
#elif defined(PCBV4)
|
||||
#elif defined(PCBV4) || defined(M128)
|
||||
#define MAX_MODELS 30
|
||||
#define NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define MAX_PHASES 5
|
||||
|
|
|
@ -193,7 +193,7 @@ CustomSwData *cswaddress(uint8_t idx)
|
|||
return &g_model.customSw[idx];
|
||||
}
|
||||
|
||||
#if defined(PCBSTD)
|
||||
#if defined(PCBSTD) && !defined(M128)
|
||||
void memclear(void *ptr, uint8_t size)
|
||||
{
|
||||
memset(ptr, 0, size);
|
||||
|
@ -1156,7 +1156,7 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
|||
{
|
||||
lcd_clear();
|
||||
|
||||
#if defined(PCBV4) || defined(PCBARM) || defined(EXTSTD)
|
||||
#if defined(PCBV4) || defined(PCBARM) || defined(M128) || defined(EXTSTD)
|
||||
lcd_img(2, 0, asterisk_lbm, 0, 0);
|
||||
#else
|
||||
lcd_putsAtt(0, 0, PSTR("(!)"), DBLSIZE);
|
||||
|
|
|
@ -628,7 +628,7 @@ uint16_t getTmr16KHz();
|
|||
|
||||
uint16_t stack_free();
|
||||
|
||||
#if defined(PCBSTD)
|
||||
#if defined(PCBSTD) && !defined(M128)
|
||||
void memclear(void *ptr, uint8_t size);
|
||||
#else
|
||||
#define memclear(p, s) memset(p, 0, s)
|
||||
|
|
|
@ -177,15 +177,6 @@ void *main_thread(void *)
|
|||
if (main_thread_running == 1) {
|
||||
#if defined(SPLASH)
|
||||
doSplash();
|
||||
#elif defined(PCBSTD) && defined(VOICE)
|
||||
lcd_clear();
|
||||
lcd_putsAtt(20, 28, PSTR("Open9x..."), DBLSIZE);
|
||||
refreshDisplay();
|
||||
tmr10ms_t tgtime = get_tmr10ms() + (2*100); /* 2 seconds */
|
||||
while (tgtime != get_tmr10ms()/* && !keyDown()*/) {
|
||||
if (!main_thread_running) break;
|
||||
sleep(1/*ms*/);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(PCBARM)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue