[ACT] First simu now compiles. Next step: the keys

This commit is contained in:
bsongis
2012-12-21 07:35:02 +00:00
parent 3d6d7e6a20
commit cea3ee724e
17 changed files with 277 additions and 85 deletions
+26 -30
View File
@@ -50,7 +50,7 @@ DELAY = 5
#----------- BUILD OPTIONS ---------------------------
# PCB version
# Values: STD, STD128, GRUVIN9X, SKY9X, X9D
# Values: STD, STD128, GRUVIN9X, SKY9X, X9D, ACT
PCB = STD
# PCB revision
@@ -268,7 +268,14 @@ endif
ifeq ($(PCB), X9D)
ARCH = ARM
LDSCRIPT = sky9x/sam3s4c_flash.ld
LDSCRIPT = x9d/stm32_flash.ld
TRGT = arm-none-eabi-
MCU = cortex-m3
endif
ifeq ($(PCB), ACT)
ARCH = ARM
LDSCRIPT = x9d/stm32_flash.ld
TRGT = arm-none-eabi-
MCU = cortex-m3
endif
@@ -458,39 +465,23 @@ endif
RUN_FROM_FLASH = 1
ifeq ($(PCB), ACT)
# ACT, so ...
# ACT radio
OPT = 2
CPPDEFS += -DPCBACT -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 -DLCD260
CPPDEFS += -DPCBACT -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 -DLCD260
EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable
EXTRAINCDIRS += x9d/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc x9d/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include
BOARDSRC = board_x9d.cpp
EXTRABOARDSRC += x9d/lcd_driver.cpp
SRC += sky9x/core_cm3.c sky9x/board_lowlevel.c sky9x/crt.c sky9x/vectors_sam3s.c
# SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c
# SRC += sky9x/usb/device/core/USBD_UDP.c sky9x/usb/device/core/USBDDriver.c
# SRC += sky9x/usb/device/massstorage/MSDDriver.c sky9x/usb/device/massstorage/MSDDStateMachine.c sky9x/usb/device/massstorage/MSDLun.c sky9x/usb/device/massstorage/MSDDriverDescriptors.c sky9x/usb/device/massstorage/SBCMethods.c
# SRC += sky9x/usb/common/core/USBEndpointDescriptor.c sky9x/usb/common/core/USBGenericRequest.c sky9x/usb/common/core/USBFeatureRequest.c sky9x/usb/common/core/USBInterfaceRequest.c sky9x/usb/common/core/USBGetDescriptorRequest.c sky9x/usb/common/core/USBSetAddressRequest.c sky9x/usb/common/core/USBSetConfigurationRequest.c sky9x/usb/common/core/USBConfigurationDescriptor.c sky9x/usb/common/core/USBGenericDescriptor.c
# SRC += sky9x/MEDSdcard.c
SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c
EEPROMSRC = eeprom_arm.cpp eeprom_conversions.cpp
CPPSRC += x9d/eeprom_driver.cpp x9d/pulses_driver.cpp x9d/keys_driver.cpp x9d/audio_driver.cpp
CPPSRC += sky9x/audio.cpp
PULSESSRC = pulses_arm.cpp
# CPPSRC += sky9x/audio.cpp haptic.cpp
# CPPSRC += sky9x/sound_driver.cpp sky9x/sdcard_driver.cpp
CPPSRC += bmp.cpp monitors_views.cpp
ifeq ($(SDCARD), YES)
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c # sky9x/diskio.cpp
CPPDEFS += -DVOICE
EXTRAINCDIRS += FatFs FatFs/option
endif
ifeq ($(DEBUG), YES)
CPPSRC += sky9x/debug.cpp
SRC += sky9x/syscalls.c
endif
CPPSRC += monitors_views.cpp
endif
ifeq ($(PCB), X9D)
# X9D, so ...
# X9D radio
OPT = 2
CPPDEFS += -DPCBX9D -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 -DLCD212
EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable
@@ -519,7 +510,7 @@ ifeq ($(PCB), X9D)
endif
ifeq ($(PCB), SKY9X)
# SKY9X, so ...
# 9x radio with a sky9x replacement board
OPT = 2
CPPDEFS += -DPCBSKY9X -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1
EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable
@@ -559,7 +550,7 @@ ifeq ($(PCB), SKY9X)
endif
ifeq ($(PCB), GRUVIN9X)
# Gruvin9x PCB, so ...
# 9x radio with a gruvin9x replacement board
OPT = 2
CPPDEFS += -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC -DROTARY_ENCODERS=2
EXTRAINCDIRS += gruvin9x stock FatFs FatFs/option
@@ -586,7 +577,7 @@ ifeq ($(PCB), GRUVIN9X)
endif
ifeq ($(PCB), STD128)
# STD PCB with Atmega 128, so ...
# 9x radio with Atmega 64 replace by Atmega 128
OPT = 2
CPPDEFS += -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=0x8000
EXTRAINCDIRS += stock
@@ -622,7 +613,7 @@ ifeq ($(PCB), STD128)
endif
ifeq ($(PCB), STD)
# STD PCB, so ...
# 9x radio
OPT = s
EXTRAINCDIRS += stock
CPPDEFS += -DPCBSTD -DCPUM64 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
@@ -801,7 +792,7 @@ eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym
lbm: font.lbm font_tiny.lbm font_small.lbm font_midsize.lbm font_dblsize.lbm sticks.lbm splash_9x.lbm splash_X9D.lbm asterisk.lbm
lbm: font.lbm font_tiny.lbm font_small.lbm font_midsize.lbm font_dblsize.lbm sticks.lbm splash_9x.lbm splash_X9D.lbm splash_ACT.lbm asterisk.lbm
# Build stamp-file
stamp_header:
@@ -890,6 +881,11 @@ splash_X9D.lbm: splash_X9D.xbm
@echo "Convert X9D splash from xbm to lbm:"
$(IMG2LBM) $< $@ img
splash_ACT.lbm: splash_ACT.xbm
@echo
@echo "Convert ACT splash from xbm to lbm:"
$(IMG2LBM) $< $@ img
asterisk.lbm: asterisk.xbm
@echo
@echo "Convert asterisk from xbm to lbm:"
+2
View File
@@ -425,7 +425,9 @@ void eeLoadModel(uint8_t id)
FRSKY_setModelAlarms();
#endif
#if defined(SDCARD)
refreshModelAudioFiles();
#endif
LOAD_MODEL_BITMAP();
}
+11 -9
View File
@@ -33,7 +33,7 @@
#include "open9x.h"
#if defined(LCD212)
#if defined(LCD212) || defined(LCD260)
#define BOX_WIDTH 31
#define LBOX_CENTERX (BOX_WIDTH/2 + 17)
#define LBOX_CENTERY (DISPLAY_H-BOX_WIDTH/2-10)
@@ -158,7 +158,7 @@ void displayTrims(uint8_t phase)
}
}
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
void displaySliders()
{
for (uint8_t i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; i++) {
@@ -227,7 +227,7 @@ void displayVoltage()
else {
LcdFlags att = (g_vbat100mV <= g_eeGeneral.vBatWarn ? BLINK|INVERS : 0) | MIDSIZE;
putsVBat(VBATT_X-1, VBATT_Y, att|NO_UNIT);
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
lcd_putcAtt(VBATTUNIT_X, VBATTUNIT_Y, 'v', MIDSIZE);
#else
lcd_putc(VBATT_X, VBATTUNIT_Y, 'V');
@@ -243,7 +243,7 @@ void displayVoltage()
}
#endif
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define EVT_KEY_MODEL_MENU EVT_KEY_BREAK(KEY_MENU)
#define EVT_KEY_GENERAL_MENU EVT_KEY_LONG(KEY_MENU)
#define EVT_KEY_TELEMETRY EVT_KEY_LONG(KEY_PAGE)
@@ -255,7 +255,7 @@ void displayVoltage()
#define EVT_KEY_STATISTICS EVT_KEY_LONG(KEY_UP)
#endif
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
void menuMainViewChannelsMonitor(uint8_t event)
{
switch(event) {
@@ -317,7 +317,7 @@ void menuMainView(uint8_t event)
#endif
#if !defined(READONLY)
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
case EVT_KEY_LONG(KEY_MENU):// go to last menu
pushMenu(lastPopMenu());
killEvents(event);
@@ -335,7 +335,7 @@ void menuMainView(uint8_t event)
break;
#endif
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
case EVT_KEY_BREAK(KEY_PAGE):
eeDirty(EE_GENERAL);
g_eeGeneral.view += 1;
@@ -391,7 +391,7 @@ void menuMainView(uint8_t event)
s_gvar_timer = 0;
}
#endif
#if !defined(LCD212)
#if !defined(LCD212) && !defined(LCD260)
else if (view == VIEW_TIMER2) {
resetTimer(1);
}
@@ -426,12 +426,14 @@ void menuMainView(uint8_t event)
displayTrims(phase);
}
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
// Sliders (Pots / Sliders)
displaySliders();
#if defined(PCBX9D)
// Model Bitmap
lcd_img(BITMAP_X, BITMAP_Y, modelBitmap, 0, 0);
#endif
// Switches
for (uint8_t i=0; i<8; i++) {
+3 -3
View File
@@ -200,7 +200,7 @@ bool check_submenu_simple(check_event_t event, uint8_t maxrow)
return check_simple(event, 0, 0, 0, maxrow);
}
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
void check_rotary_encoder(uint8_t & event)
{
if (event==EVT_KEY_REPT(KEY_LEFT) || event==EVT_KEY_FIRST(KEY_LEFT)) {
@@ -286,7 +286,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
#if defined(ROTARY_ENCODERS)
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
if (!(s_warning || s_menu_count || s_editMode<0))
CHECK_ROTARY_ENCODER(event);
#else
@@ -519,7 +519,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
}
break;
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
case EVT_KEY_REPT(KEY_RIGHT): //inc
if (l_posHorz==maxcol) break;
// no break
+1 -1
View File
@@ -142,7 +142,7 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
#define CHECK_INCDEC_GENVAR(event, var, min, max) \
var = checkIncDecGen(event,var,min,max)
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
void check_rotary_encoder(uint8_t & event);
#define CHECK_ROTARY_ENCODER(event) check_rotary_encoder(event)
#elif defined(ROTARY_ENCODERS)
+12 -12
View File
@@ -247,7 +247,7 @@ void menuModelSelect(uint8_t event)
int8_t oldSub = m_posVert;
if (!check_submenu_simple(_event_, MAX_MODELS-1)) return;
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
if (m_posVert < 0) m_posVert = MAX_MODELS-1;
#elif defined(ROTARY_ENCODERS)
if (m_posVert < 0) m_posVert = 0;
@@ -312,7 +312,7 @@ void menuModelSelect(uint8_t event)
#endif
case EVT_KEY_LONG(KEY_ENTER):
case EVT_KEY_BREAK(KEY_ENTER):
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
if (s_editMode < 0) {
s_editMode = 0;
break;
@@ -387,7 +387,7 @@ void menuModelSelect(uint8_t event)
}
break;
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
case EVT_KEY_FIRST(KEY_LEFT):
case EVT_KEY_FIRST(KEY_RIGHT):
if (sub == g_eeGeneral.currModel) {
@@ -400,7 +400,7 @@ void menuModelSelect(uint8_t event)
case EVT_KEY_FIRST(KEY_MOVE_UP):
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
if (s_editMode == -1) {
chainMenu(event == EVT_KEY_FIRST(KEY_RIGHT) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
return;
@@ -571,7 +571,7 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, boo
if (!navigationRotaryEncoder(event))
break;
// no break
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
case EVT_KEY_LONG(KEY_ENTER):
#endif
if (v==0) {
@@ -1402,7 +1402,7 @@ void menuModelCurveOne(uint8_t event)
case EVT_KEY_BREAK(KEY_ENTER):
if (s_editMode <= 0)
m_posHorz = 0;
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
else if (s_editMode == 1)
s_editMode = (crv.custom && m_posHorz>0 && m_posHorz<crv.points-1) ? 2 : 3;
else if (s_editMode == 2)
@@ -1497,7 +1497,7 @@ void menuModelCurveOne(uint8_t event)
int8_t x = -100 + 200*i/(crv.points-1);
if (crv.custom && i>0 && i<crv.points-1) x = crv.crv[crv.points+i-1];
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
lcd_puts(7, 2*FH, PSTR("x=")); lcd_outdezAtt(7+2*FW, 2*FH, x, LEFT|(s_editMode==2 ? BLINK|INVERS : 0));
lcd_puts(7, 3*FH, PSTR("y=")); lcd_outdezAtt(7+2*FW, 3*FH, crv.crv[i], LEFT|(s_editMode==3 ? BLINK|INVERS : 0));
#else
@@ -1506,7 +1506,7 @@ void menuModelCurveOne(uint8_t event)
#endif
lcd_rect(3, 1*FH+4, 7*FW-2, 3*FH-2);
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
if (event==EVT_KEY_FIRST(KEY_MINUS) || event==EVT_KEY_FIRST(KEY_PLUS) || event==EVT_KEY_REPT(KEY_MINUS) || event==EVT_KEY_REPT(KEY_PLUS)) {
if (s_editMode == 2)
CHECK_INCDEC_MODELVAR(event, crv.crv[crv.points+i-1], i==1 ? -99 : crv.crv[crv.points+i-2]+1, i==crv.points-2 ? 99 : crv.crv[crv.points+i]-1); // edit X
@@ -1813,7 +1813,7 @@ enum MixFields {
void menuModelMixOne(uint8_t event)
{
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
if (event == EVT_KEY_LONG(KEY_PAGE)) {
pushMenu(menuChannelsMonitor);
killEvents(event);
@@ -2235,7 +2235,7 @@ void menuModelExposAll(uint8_t event)
void menuModelMixAll(uint8_t event)
{
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
if (event == EVT_KEY_LONG(KEY_PAGE)) {
pushMenu(menuChannelsMonitor);
killEvents(event);
@@ -2271,7 +2271,7 @@ enum LimitsItems {
ITEM_LIMITS_MAXROW = ITEM_LIMITS_COUNT-1
};
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define LIMITS_DIRECTION_POS 12*FW+4
#define LIMITS_MAX_POS 16*FW+4
#define LIMITS_REVERT_POS 18*FW
@@ -3064,7 +3064,7 @@ void menuModelTelemetry(uint8_t event)
switch (event) {
case EVT_KEY_BREAK(KEY_DOWN):
case EVT_KEY_BREAK(KEY_UP):
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
case EVT_KEY_BREAK(KEY_LEFT):
case EVT_KEY_BREAK(KEY_RIGHT):
#endif
+13 -7
View File
@@ -48,7 +48,9 @@
#define WARN_MEM (!(g_eeGeneral.warnOpts & WARN_MEM_BIT))
#define BEEP_VAL ( (g_eeGeneral.warnOpts & WARN_BVAL_BIT) >>3 )
#if defined(PCBX9D)
#if defined(PCBACT)
#define EEPROM_VER 213
#elif defined(PCBX9D)
#define EEPROM_VER 213
#elif defined(PCBSKY9X)
#define EEPROM_VER 213
@@ -78,7 +80,7 @@ PACK(typedef struct t_FrSkyRSSIAlarm {
int8_t value:6;
}) FrSkyRSSIAlarm;
#if defined(LCD212)
#if defined(LCD212) || defined(LCD260)
enum MainViews {
VIEW_INPUTS,
VIEW_SWITCHES,
@@ -185,7 +187,7 @@ PACK(typedef struct t_EEGeneral {
}) EEGeneral;
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define LEN_MODEL_NAME 12
#define LEN_EXPOMIX_NAME 10
#define LEN_FP_NAME 10
@@ -549,7 +551,11 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data
#define ROTARY_ENCODER_MAX 1024
#if defined(PCBX9D)
#if defined(PCBACT)
#define NUM_ROTARY_ENCODERS 1
#define ROTARY_ENCODER_ARRAY_EXTRA
#define ROTARY_ENCODER_ARRAY int16_t rotaryEncoders[1];
#elif defined(PCBX9D)
#define NUM_ROTARY_ENCODERS_EXTRA 0
#define NUM_ROTARY_ENCODERS 0
#define ROTARY_ENCODER_ARRAY_EXTRA
@@ -662,7 +668,7 @@ enum MixSources {
MIXSRC_Ele,
MIXSRC_Thr,
MIXSRC_Ail,
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
MIXSRC_S1,
MIXSRC_S2,
MIXSRC_S3,
@@ -687,7 +693,7 @@ enum MixSources {
MIXSRC_TrimThr,
MIXSRC_TrimAil,
MIXSRC_MAX ,
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
MIXSRC_SA,
MIXSRC_SB,
MIXSRC_SC,
@@ -800,7 +806,7 @@ enum Dsm2Variants {
#define BeepANACenter uint8_t
#endif
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define MODELDATA_EXTRA char bitmap[10]
#else
#define MODELDATA_EXTRA
+2 -2
View File
@@ -630,7 +630,7 @@ int16_t getValue(uint8_t i)
#endif
else if(i<MIXSRC_TrimAil) return calc1000toRESX((int16_t)8 * getTrimValue(s_perout_flight_phase, i-(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS)));
else if(i<MIXSRC_MAX) return 1024;
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
else if(i<MIXSRC_SA) return (keyState(SW_SA0) ? -1024 : 1024);
else if(i<MIXSRC_SB) return (keyState(SW_SB0) ? -1024 : (keyState(SW_SB1) ? 0 : 1024));
else if(i<MIXSRC_SC) return (keyState(SW_SC0) ? -1024 : (keyState(SW_SC1) ? 0 : 1024));
@@ -2312,7 +2312,7 @@ void perOut(uint8_t mode, uint8_t tick10ms)
else {
if (k < NUM_STICKS)
v = md->noExpo ? rawAnas[k] : anas[k]; //Switch is on. MAX=FULL=512 or value.
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
// TODO
#else
else if (k >= MIXSRC_THR-1 && k <= MIXSRC_SWC-1) {
+10 -10
View File
@@ -153,7 +153,7 @@
#define VARIO_VARIANT 0x0080
#define HAPTIC_VARIANT 0x0100 */
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#include "board_x9d.h"
#elif defined(PCBSKY9X)
#include "board_sky9x.h"
@@ -441,7 +441,7 @@ extern uint8_t channel_order(uint8_t x);
enum EnumKeys {
KEY_MENU,
KEY_EXIT,
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
KEY_ENTER,
KEY_PAGE,
KEY_PLUS,
@@ -470,7 +470,7 @@ enum EnumKeys {
//SW_NC,
//SW_ON,
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
SW_SA0=SW_BASE,
SW_SA2,
SW_SB0,
@@ -521,7 +521,7 @@ enum EnumKeys {
#define DSW(x) (1+(x)-SW_BASE)
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define KEY_RIGHT KEY_PLUS
#define KEY_UP KEY_PLUS
#define KEY_LEFT KEY_MINUS
@@ -612,7 +612,7 @@ enum CswFunctions {
#define NUM_STICKS 4
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define MAX_PSWITCH (SW_SH2-SW_SA0+1)
#define NUM_POTS 4
#define NUM_SW_SRCRAW 8
@@ -627,7 +627,7 @@ enum CswFunctions {
#define SWITCH_OFF (-SWITCH_ON)
#define NUM_CYC 3
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define CSW_PPM_BASE 24 // TODO garbage to compile ...
#else
#define CSW_PPM_BASE (MIXSRC_3POS+NUM_CYC) // because srcRaw is shifted +1!
@@ -656,7 +656,7 @@ enum CswFunctions {
#define NUM_XCHNRAW (NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS+NUM_STICKS+1/*MAX*/+NUM_SW_SRCRAW+NUM_CYC+NUM_PPM+NUM_CHNOUT)
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define NUM_XCHNMIX (NUM_XCHNRAW+NUM_CSW)
#define NUM_XCHNCSW (NUM_XCHNRAW+NUM_CSW+NUM_TELEMETRY)
#define NUM_XCHNPLAY (NUM_XCHNRAW+NUM_CSW+TELEM_DISPLAY_MAX)
@@ -876,7 +876,7 @@ extern uint8_t s_traceWr;
extern int8_t s_traceCnt;
#endif
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
static inline uint16_t getTmr2MHz() { return 0; }
#elif defined(PCBSKY9X)
static inline uint16_t getTmr2MHz() { return TC1->TC_CHANNEL[0].TC_CV; }
@@ -932,7 +932,7 @@ extern void backlightOn();
void read_9_adc(void);
#endif
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define __BACKLIGHT_ON
#define __BACKLIGHT_OFF
#elif defined (PCBSKY9X)
@@ -1363,7 +1363,7 @@ char * strcat_zchar(char * dest, char * name, uint8_t size, const char *defaultN
#define ZLEN(s) zlen(s, sizeof(s))
#endif
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define KEY_MOVE_UP KEY_MINUS
#define KEY_MOVE_DOWN KEY_PLUS
#else
+2 -2
View File
@@ -67,7 +67,7 @@ void startPulses()
void setupPulsesPPM() // Don't enable interrupts through here
{
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
register Pwm *pwmptr = PWM;
#endif
@@ -82,7 +82,7 @@ void setupPulsesPPM() // Don't enable interrupts through here
ptr = Pulses;
uint32_t p = 8 + g_model.ppmNCH * 2; //Channels *2
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
pwmptr->PWM_CH_NUM[3].PWM_CDTYUPD = (g_model.ppmDelay * 50 + 300) * 2; //Stoplen *2
if (g_model.pulsePol)
pwmptr->PWM_CH_NUM[3].PWM_CMR |= 0x00000200 ; // CPOL
+3 -1
View File
@@ -88,7 +88,9 @@ extern uint32_t sd_card_mounted();
#define sd_card_mounted() (true)
#endif
#if defined(PCBX9D)
#if defined(PCBACT)
#define O9X_FOURCC 0x3478396F // o9x for ACT
#elif defined(PCBX9D)
#define O9X_FOURCC 0x3378396F // o9x for X9D
#elif defined(PCBSKY9X)
#define O9X_FOURCC 0x3278396F // o9x for sky9x
+2 -2
View File
@@ -43,7 +43,7 @@ uint16_t dummyport16;
const char *eepromFile = NULL;
FILE *fp = NULL;
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
GPIO_TypeDef gpiob;
GPIO_TypeDef gpioc;
#elif defined(PCBSKY9X)
@@ -92,7 +92,7 @@ sem_t *eeprom_write_sem;
void setSwitch(int8_t swtch)
{
switch (swtch) {
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
case DSW(SW_SA0):
GPIOB->IDR &= ~(1<<31);
break;
+1 -1
View File
@@ -95,7 +95,7 @@ typedef const uint8_t pm_uint8_t;
typedef const int16_t pm_int16_t;
typedef const int8_t pm_int8_t;
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
extern GPIO_TypeDef gpiob;
#undef GPIOB
#define GPIOB (&gpiob)
+11 -3
View File
@@ -49,12 +49,14 @@
int g_snapshot_idx = 0;
uint64_t toto = 0;
#if defined(PCBX9D)
#if defined(PCBX9D) || defined(PCBACT)
#define ERSKY9X_RETURN_PIO GPIOC->IDR
#define ERSKY9X_RETURN_MASK 0x20
#define ERSKY9X_EXIT_PIO GPIOC->IDR
#define ERSKY9X_EXIT_MASK (0x01000000)
#define ERSKY9X_UP_PIO GPIOC->IDR
#define ERSKY9X_UP_MASK 0x00
#define ERSKY9X_DOWN_PIO GPIOC->IDR
#define ERSKY9X_DOWN_MASK 0x00
#define ERSKY9X_RIGHT_PIO GPIOC->IDR
#define ERSKY9X_RIGHT_MASK 0x10
@@ -69,9 +71,11 @@ uint64_t toto = 0;
#define ERSKY9X_RETURN_MASK (0x40)
#define ERSKY9X_EXIT_PIO PIOA->PIO_PDSR
#define ERSKY9X_EXIT_MASK (0x80000000)
#define ERSKY9X_UP_PIO PIOC
#define ERSKY9X_UP_MASK (0x08 >> 1)
#define ERSKY9X_RIGHT_PIO PIOC->PIO_PDSR
#define ERSKY9X_RIGHT_MASK (0x20 >> 1)
#define ERSKY9X_DOWN_PIO PIOC->PIO_PDSR
#define ERSKY9X_DOWN_MASK (0x10 >> 1)
#define ERSKY9X_LEFT_PIO PIOC->PIO_PDSR
#define ERSKY9X_LEFT_MASK (0x40 >> 1)
@@ -80,9 +84,11 @@ uint64_t toto = 0;
#define ERSKY9X_RETURN_MASK (0x20)
#define ERSKY9X_EXIT_MASK (0x01000000)
#define ERSKY9X_EXIT_PIO PIOC->PIO_PDSR
#define ERSKY9X_UP_PIO PIOC
#define ERSKY9X_UP_MASK (0x04 >> 1)
#define ERSKY9X_RIGHT_PIO PIOC->PIO_PDSR
#define ERSKY9X_RIGHT_MASK (0x20 >> 1)
#define ERSKY9X_DOWN_PIO PIOC->PIO_PDSR
#define ERSKY9X_DOWN_MASK (0x40 >> 1)
#define ERSKY9X_LEFT_PIO PIOC->PIO_PDSR
#define ERSKY9X_LEFT_MASK (0x10 >> 1)
@@ -93,9 +99,11 @@ uint64_t toto = 0;
#define ERSKY9X_RETURN_MASK toto
#define ERSKY9X_EXIT_MASK toto
#define ERSKY9X_EXIT_PIO toto
#define ERSKY9X_UP_PIO toto
#define ERSKY9X_UP_MASK toto
#define ERSKY9X_RIGHT_PIO toto
#define ERSKY9X_RIGHT_MASK toto
#define ERSKY9X_DOWN_PIO toto
#define ERSKY9X_DOWN_MASK toto
#define ERSKY9X_LEFT_PIO toto
#define ERSKY9X_LEFT_MASK toto
@@ -304,8 +312,8 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*)
KEY_Page_Up, INP_B_KEY_MEN, INP_L_KEY_MEN, (uint64_t)&KEY_MENU_PIO, KEY_MENU_MASK,
KEY_Page_Down, INP_B_KEY_EXT, INP_L_KEY_EXT, (uint64_t)&KEY_PAGE_PIO, KEY_PAGE_MASK,
#else
KEY_Up, INP_B_KEY_UP, INP_L_KEY_UP, (uint64_t)PIOC, ERSKY9X_UP_MASK,
KEY_Down, INP_B_KEY_DWN, INP_L_KEY_DWN, (uint64_t)PIOC, ERSKY9X_DOWN_MASK,
KEY_Up, INP_B_KEY_UP, INP_L_KEY_UP, (uint64_t)&ERSKY9X_UP_PIO, ERSKY9X_UP_MASK,
KEY_Down, INP_B_KEY_DWN, INP_L_KEY_DWN, (uint64_t)&ERSKY9X_DOWN_PIO, ERSKY9X_DOWN_MASK,
#endif
};
+2 -2
View File
@@ -428,7 +428,7 @@ void AudioQueue::wakeup()
if (state != AUDIO_PLAYING_TONE) {
state = AUDIO_PLAYING_TONE;
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
register Dacc *dacptr = DACC;
dacptr->DACC_TPR = CONVERT_PTR(Sine_values);
dacptr->DACC_TNPR = CONVERT_PTR(Sine_values);
@@ -474,7 +474,7 @@ void AudioQueue::wakeup()
else if (ridx == widx && prioIdx < 0 && backgroundContext.fragment.duration > 0) {
if (state != AUDIO_PLAYING_TONE) {
state = AUDIO_PLAYING_TONE;
#if !defined(PCBX9D)
#if !defined(PCBX9D) && !defined(PCBACT)
register Dacc *dacptr = DACC;
dacptr->DACC_TPR = CONVERT_PTR(Sine_values);
dacptr->DACC_TNPR = CONVERT_PTR(Sine_values);
+5
View File
@@ -190,8 +190,13 @@ extern void pushPrompt(uint16_t prompt, uint8_t id=0);
#define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id))
#define STOP_PLAY(id) audioQueue.stopPlay((id))
#define AUDIO_RESET() audioQueue.reset()
#if defined(SDCARD)
#define PLAY_PHASE_OFF(phase) do { char filename[64]; if (isAudioFileAvailable((PHASE_AUDIO_CATEGORY << 24) + (phase << 16) + AUDIO_EVENT_OFF, filename)) audioQueue.playFile(filename); } while (0)
#define PLAY_PHASE_ON(phase) do { char filename[64]; if (isAudioFileAvailable((PHASE_AUDIO_CATEGORY << 24) + (phase << 16) + AUDIO_EVENT_ON, filename)) audioQueue.playFile(filename); } while (0)
#else
#define PLAY_PHASE_OFF(phase)
#define PLAY_PHASE_ON(phase)
#endif
extern void refreshSystemAudioFiles();
extern void refreshModelAudioFiles();
+171
View File
@@ -0,0 +1,171 @@
/*
*****************************************************************************
**
** File : stm32_flash.ld
**
** Abstract : Linker script for STM32F207IG Device with
** 1MByte FLASH, 128KByte SRAM
**
** Set heap size, stack size and stack location according
** to application requirements.
**
** Set memory bank area and size if external memory is used.
**
** Target : STMicroelectronics STM32
**
** Environment : Atollic TrueSTUDIO(R)
**
** Distribution: The file is distributed “as is,” without any warranty
** of any kind.
**
** (c)Copyright Atollic AB.
** You may use this file as-is or modify it according to the needs of your
** project. Distribution of this file (unmodified or modified) is not
** permitted. Atollic AB permit registered Atollic TrueSTUDIO(R) users the
** rights to distribute the assembled, compiled & linked contents of this
** file as part of an application binary file, provided that it is built
** using the Atollic TrueSTUDIO(R) toolchain.
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20020000; /* end of 128K SRAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x200; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH
/* The program code and other data goes into FLASH */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
.ARM : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >FLASH
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >FLASH
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(.fini_array*))
KEEP (*(SORT(.fini_array.*)))
PROVIDE_HIDDEN (__fini_array_end = .);
} >FLASH
/* used by the startup to initialize data */
_sidata = .;
/* Initialized data sections goes into RAM, load LMA copy after code */
.data : AT ( _sidata )
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM
/* Uninitialized data section */
. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM
PROVIDE ( end = _ebss );
PROVIDE ( _end = _ebss );
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(4);
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(4);
} >RAM
/* MEMORY_bank1 section, code must be located here explicitly */
/* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
.memory_b1_text :
{
*(.mb1text) /* .mb1text sections (code) */
*(.mb1text*) /* .mb1text* sections (code) */
*(.mb1rodata) /* read-only data (constants) */
*(.mb1rodata*)
} >MEMORY_B1
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
.ARM.attributes 0 : { *(.ARM.attributes) }
}