From 81c6bb1ba794d703df2c6df60db0fad940a71cbc Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 2 Oct 2012 10:07:19 +0000 Subject: [PATCH] Make PCB args are now SKY9X and GRUVIN9X instead of ARM and V4 [sky9x] Temperature calibration [sky9x] RTC modifications --- applets/ersky9x/CoProc/main.c | 2 +- applets/ersky9x/serialFlash/main.c | 2 +- applets/libraries/libboard_atsam3s-ek/board.h | 2 +- src/FatFs/ffconf.h | 8 +- src/Makefile | 92 ++++----- src/beeper.h | 6 +- src/board_gruvin9x.cpp | 5 - src/{board_ersky9x.cpp => board_sky9x.cpp} | 16 +- src/{board_ersky9x.h => board_sky9x.h} | 15 +- src/drivers.cpp | 18 +- src/eeprom_avr.cpp | 10 +- src/eeprom_avr.h | 6 +- src/ersky9x/usb/device/core/USBDCallbacks.c | 79 -------- src/ersky9x/usb/device/core/USBDCallbacks.h | 65 ------- .../usb/device/core/USBDDriverCallbacks.h | 61 ------ .../usb/device/massstorage/_MSDIOFifo.c | 68 ------- src/frsky.cpp | 20 +- src/general_menus.cpp | 67 ++++--- src/gruvin9x/diskio.cpp | 2 +- src/haptic.cpp | 2 +- src/lcd.cpp | 6 +- src/lcd.h | 8 +- src/main_views.cpp | 18 +- src/menus.cpp | 2 +- src/menus.h | 4 +- src/model_menus.cpp | 62 +++---- src/myeeprom.h | 49 ++--- src/open9x.cpp | 175 +++++++++--------- src/open9x.h | 64 +++---- src/pulses_avr.cpp | 30 +-- src/sdcard.h | 8 +- src/simpgmspace.cpp | 28 +-- src/simpgmspace.h | 4 +- src/simu.cpp | 32 ++-- src/{ersky9x => sky9x}/AT91SAM3S2.h | 0 src/{ersky9x => sky9x}/AT91SAM3S4.h | 0 src/{ersky9x => sky9x}/MEDSdcard.c | 0 src/{ersky9x => sky9x}/Media.h | 0 src/{ersky9x => sky9x}/audio.cpp | 0 src/{ersky9x => sky9x}/audio.h | 0 src/{ersky9x => sky9x}/bluetooth.cpp | 0 src/{ersky9x => sky9x}/bluetooth.h | 0 src/{ersky9x => sky9x}/board.h | 2 +- src/{ersky9x => sky9x}/board_lowlevel.c | 0 src/{ersky9x => sky9x}/chip.h | 0 src/{ersky9x => sky9x}/core_cm3.c | 0 src/{ersky9x => sky9x}/core_cm3.h | 0 src/{ersky9x => sky9x}/crt.c | 0 src/{ersky9x => sky9x}/debug.cpp | 0 src/{ersky9x => sky9x}/debug.h | 0 src/{ersky9x => sky9x}/diskio.c | 0 src/{ersky9x => sky9x}/fifo.h | 0 src/{ersky9x => sky9x}/haptic_driver.cpp | 0 src/{ersky9x => sky9x}/haptic_driver.h | 0 src/{ersky9x => sky9x}/massstorage.cpp | 0 src/{ersky9x => sky9x}/rtc_driver.cpp | 0 src/{ersky9x => sky9x}/sam3s2c_flash.ld | 0 src/{ersky9x => sky9x}/sam3s4c_flash.ld | 0 src/{ersky9x => sky9x}/sdcard_driver.cpp | 0 src/{ersky9x => sky9x}/sound_driver.cpp | 1 - src/{ersky9x => sky9x}/sound_driver.h | 0 src/{ersky9x => sky9x}/syscalls.c | 0 .../common/core/USBConfigurationDescriptor.c | 0 .../common/core/USBConfigurationDescriptor.h | 0 .../usb/common/core/USBDeviceDescriptor.h | 0 .../core/USBDeviceQualifierDescriptor.h | 0 .../usb/common/core/USBEndpointDescriptor.c | 0 .../usb/common/core/USBEndpointDescriptor.h | 0 .../usb/common/core/USBFeatureRequest.c | 0 .../usb/common/core/USBFeatureRequest.h | 0 .../usb/common/core/USBGenericDescriptor.c | 0 .../usb/common/core/USBGenericDescriptor.h | 0 .../usb/common/core/USBGenericRequest.c | 0 .../usb/common/core/USBGenericRequest.h | 0 .../usb/common/core/USBGetDescriptorRequest.c | 0 .../usb/common/core/USBGetDescriptorRequest.h | 0 .../core/USBInterfaceAssociationDescriptor.h | 0 .../usb/common/core/USBInterfaceDescriptor.h | 0 .../usb/common/core/USBInterfaceRequest.c | 0 .../usb/common/core/USBInterfaceRequest.h | 0 .../usb/common/core/USBIrqHandler.c | 0 .../usb/common/core/USBIrqHandler.h | 0 .../usb/common/core/USBSetAddressRequest.c | 0 .../usb/common/core/USBSetAddressRequest.h | 0 .../common/core/USBSetConfigurationRequest.c | 0 .../common/core/USBSetConfigurationRequest.h | 0 .../usb/common/core/USBStringDescriptor.h | 0 .../common/massstorage/MSDeviceDescriptor.h | 0 .../massstorage/MSInterfaceDescriptor.h | 0 src/{ersky9x => sky9x}/usb/device/core/USBD.h | 15 ++ .../usb/device/core/USBDDriver.c | 3 +- .../usb/device/core/USBDDriver.h | 0 .../usb/device/core/USBDDriverDescriptors.h | 0 .../usb/device/core/USBD_UDP.c | 7 +- .../usb/device/massstorage/MSD.h | 0 .../usb/device/massstorage/MSDDStateMachine.c | 0 .../usb/device/massstorage/MSDDStateMachine.h | 0 .../usb/device/massstorage/MSDDriver.c | 2 - .../usb/device/massstorage/MSDDriver.h | 0 .../device/massstorage/MSDDriverDescriptors.c | 0 .../device/massstorage/MSDDriverDescriptors.h | 0 .../usb/device/massstorage/MSDIOFifo.h | 0 .../usb/device/massstorage/MSDLun.c | 0 .../usb/device/massstorage/MSDLun.h | 0 .../usb/device/massstorage/SBC.h | 0 .../usb/device/massstorage/SBCMethods.c | 0 .../usb/device/massstorage/SBCMethods.h | 0 src/{ersky9x => sky9x}/vectors_sam3s.c | 0 src/statistics_views.cpp | 22 +-- src/stock/audio.cpp | 4 +- src/stock/audio.h | 4 - src/translations.cpp | 12 +- src/translations.h | 14 +- src/translations/cz.h | 16 +- src/translations/de.h | 16 +- src/translations/en.h | 16 +- src/translations/fr.h | 16 +- src/translations/it.h | 16 +- src/translations/se.h | 16 +- 119 files changed, 474 insertions(+), 744 deletions(-) rename src/{board_ersky9x.cpp => board_sky9x.cpp} (95%) rename src/{board_ersky9x.h => board_sky9x.h} (89%) delete mode 100644 src/ersky9x/usb/device/core/USBDCallbacks.c delete mode 100644 src/ersky9x/usb/device/core/USBDCallbacks.h delete mode 100644 src/ersky9x/usb/device/core/USBDDriverCallbacks.h delete mode 100644 src/ersky9x/usb/device/massstorage/_MSDIOFifo.c rename src/{ersky9x => sky9x}/AT91SAM3S2.h (100%) rename src/{ersky9x => sky9x}/AT91SAM3S4.h (100%) rename src/{ersky9x => sky9x}/MEDSdcard.c (100%) rename src/{ersky9x => sky9x}/Media.h (100%) rename src/{ersky9x => sky9x}/audio.cpp (100%) rename src/{ersky9x => sky9x}/audio.h (100%) rename src/{ersky9x => sky9x}/bluetooth.cpp (100%) rename src/{ersky9x => sky9x}/bluetooth.h (100%) rename src/{ersky9x => sky9x}/board.h (97%) rename src/{ersky9x => sky9x}/board_lowlevel.c (100%) rename src/{ersky9x => sky9x}/chip.h (100%) rename src/{ersky9x => sky9x}/core_cm3.c (100%) rename src/{ersky9x => sky9x}/core_cm3.h (100%) rename src/{ersky9x => sky9x}/crt.c (100%) rename src/{ersky9x => sky9x}/debug.cpp (100%) rename src/{ersky9x => sky9x}/debug.h (100%) rename src/{ersky9x => sky9x}/diskio.c (100%) rename src/{ersky9x => sky9x}/fifo.h (100%) rename src/{ersky9x => sky9x}/haptic_driver.cpp (100%) rename src/{ersky9x => sky9x}/haptic_driver.h (100%) rename src/{ersky9x => sky9x}/massstorage.cpp (100%) rename src/{ersky9x => sky9x}/rtc_driver.cpp (100%) rename src/{ersky9x => sky9x}/sam3s2c_flash.ld (100%) rename src/{ersky9x => sky9x}/sam3s4c_flash.ld (100%) rename src/{ersky9x => sky9x}/sdcard_driver.cpp (100%) rename src/{ersky9x => sky9x}/sound_driver.cpp (96%) rename src/{ersky9x => sky9x}/sound_driver.h (100%) rename src/{ersky9x => sky9x}/syscalls.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBConfigurationDescriptor.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBConfigurationDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBDeviceDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBDeviceQualifierDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBEndpointDescriptor.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBEndpointDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBFeatureRequest.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBFeatureRequest.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBGenericDescriptor.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBGenericDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBGenericRequest.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBGenericRequest.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBGetDescriptorRequest.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBGetDescriptorRequest.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBInterfaceAssociationDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBInterfaceDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBInterfaceRequest.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBInterfaceRequest.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBIrqHandler.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBIrqHandler.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBSetAddressRequest.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBSetAddressRequest.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBSetConfigurationRequest.c (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBSetConfigurationRequest.h (100%) rename src/{ersky9x => sky9x}/usb/common/core/USBStringDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/massstorage/MSDeviceDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/common/massstorage/MSInterfaceDescriptor.h (100%) rename src/{ersky9x => sky9x}/usb/device/core/USBD.h (93%) rename src/{ersky9x => sky9x}/usb/device/core/USBDDriver.c (96%) rename src/{ersky9x => sky9x}/usb/device/core/USBDDriver.h (100%) rename src/{ersky9x => sky9x}/usb/device/core/USBDDriverDescriptors.h (100%) rename src/{ersky9x => sky9x}/usb/device/core/USBD_UDP.c (96%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSD.h (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDDStateMachine.c (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDDStateMachine.h (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDDriver.c (96%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDDriver.h (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDDriverDescriptors.c (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDDriverDescriptors.h (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDIOFifo.h (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDLun.c (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/MSDLun.h (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/SBC.h (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/SBCMethods.c (100%) rename src/{ersky9x => sky9x}/usb/device/massstorage/SBCMethods.h (100%) rename src/{ersky9x => sky9x}/vectors_sam3s.c (100%) diff --git a/applets/ersky9x/CoProc/main.c b/applets/ersky9x/CoProc/main.c index f8b2fddf5..c140df3cd 100644 --- a/applets/ersky9x/CoProc/main.c +++ b/applets/ersky9x/CoProc/main.c @@ -859,7 +859,7 @@ int main(int argc, char **argv) pMailbox->argument.outputInit.bufferSize = bufferSize; pMailbox->argument.outputInit.memorySize = 128*128 ; // TRACE_INFO("%s blockSize : 0x%lx bufferAddr : 0x%lx\n\r", -// "ersky9x", blockSize, pMailbox->argument.outputInit.bufferAddress); +// "sky9x", blockSize, pMailbox->argument.outputInit.bufferAddress); // } } diff --git a/applets/ersky9x/serialFlash/main.c b/applets/ersky9x/serialFlash/main.c index c034627fe..1da0b6f58 100644 --- a/applets/ersky9x/serialFlash/main.c +++ b/applets/ersky9x/serialFlash/main.c @@ -688,7 +688,7 @@ int main(int argc, char **argv) pMailbox->argument.outputInit.bufferSize = bufferSize; pMailbox->argument.outputInit.memorySize = 128*4096; // TRACE_INFO("%s blockSize : 0x%lx bufferAddr : 0x%lx\n\r", -// "ersky9x", blockSize, pMailbox->argument.outputInit.bufferAddress); +// "sky9x", blockSize, pMailbox->argument.outputInit.bufferAddress); // } } diff --git a/applets/libraries/libboard_atsam3s-ek/board.h b/applets/libraries/libboard_atsam3s-ek/board.h index 57681c7a3..bc974c557 100644 --- a/applets/libraries/libboard_atsam3s-ek/board.h +++ b/applets/libraries/libboard_atsam3s-ek/board.h @@ -127,7 +127,7 @@ #define BOARD_MAINOSC 12000000 /** Master clock frequency (when using board_lowlevel.c) */ -#define BOARD_MCK 64000000 +// #define BOARD_MCK 64000000 /*----------------------------------------------------------------------------*/ /** diff --git a/src/FatFs/ffconf.h b/src/FatFs/ffconf.h index 1dddedd0b..31fd13053 100644 --- a/src/FatFs/ffconf.h +++ b/src/FatFs/ffconf.h @@ -9,7 +9,7 @@ #ifndef _FFCONF #define _FFCONF 6502 /* Revision ID */ -#if defined(PCBARM) && !defined(SIMU) +#if defined(PCBSKY9X) && !defined(SIMU) #ifdef __cplusplus extern "C" { #endif @@ -98,7 +98,7 @@ extern "C" { / 1 - ASCII only (Valid for non LFN cfg.) */ -#if defined(PCBARM) +#if defined(PCBSKY9X) #define _USE_LFN 2 /* 0 to 3 */ #else #define _USE_LFN 1 /* 0 to 3 */ @@ -182,7 +182,7 @@ extern "C" { /* A header file that defines sync object types on the O/S, such as / windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */ -#if defined(PCBARM) +#if defined(PCBSKY9X) #define _FS_REENTRANT 1 /* 0:Disable or 1:Enable */ #else #define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */ @@ -197,7 +197,7 @@ extern "C" { / ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj / function must be added to the project. */ -#if defined(PCBARM) +#if defined(PCBSKY9X) #define _FS_SHARE 3 /* 0:Disable or >=1:Enable */ #else #define _FS_SHARE 2 /* 0:Disable or >=1:Enable */ diff --git a/src/Makefile b/src/Makefile index df637a61b..c8d9045a3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -50,7 +50,7 @@ DELAY = 5 #----------- BUILD OPTIONS --------------------------- # PCB version -# Values: STD, STD128, V4, ARM, X9D +# Values: STD, STD128, GRUVIN9X, SKY9X, X9D PCB = STD # PCB revision @@ -178,7 +178,7 @@ UNITS = METRIC # Values = YES, NO EEPROM_PROGRESS_BAR = NO -# Enable extra rotary encoders (V4 board only) +# Enable extra rotary encoders (Gruvin9x board only) # Values = YES, NO EXTRA_ROTARY_ENCODERS = NO @@ -220,7 +220,7 @@ ifeq ($(PCB), STD128) CPPDEFS += -DF_CPU=$(F_CPU)UL endif -ifeq ($(PCB), V4) +ifeq ($(PCB), GRUVIN9X) ifeq ($(PCBREV), REV0) CPPDEFS += -DREV0 else @@ -231,13 +231,13 @@ ifeq ($(PCB), V4) CPPDEFS += -DF_CPU=$(F_CPU)UL endif -ifeq ($(PCB), ARM) +ifeq ($(PCB), SKY9X) ifeq ($(PCBREV), REVA) CPPDEFS += -DREVA - LDSCRIPT = ersky9x/sam3s2c_flash.ld + LDSCRIPT = sky9x/sam3s2c_flash.ld else CPPDEFS += -DREVB - LDSCRIPT = ersky9x/sam3s4c_flash.ld + LDSCRIPT = sky9x/sam3s4c_flash.ld endif TRGT = arm-none-eabi- MCU = cortex-m3 @@ -245,7 +245,7 @@ endif ifeq ($(PCB), X9D) CPPDEFS += -DREVB - LDSCRIPT = ersky9x/sam3s4c_flash.ld + LDSCRIPT = sky9x/sam3s4c_flash.ld TRGT = arm-none-eabi- MCU = cortex-m4 endif @@ -430,76 +430,76 @@ RUN_FROM_FLASH = 1 ifeq ($(PCB), X9D) # X9D, so ... OPT = 2 - CPPDEFS += -DPCBX9D -DPCBARM -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 - EXTRAINCDIRS += ersky9x CoOS/kernel CoOS/portable - BOARDSRC = board_ersky9x.cpp - SRC += ersky9x/core_cm3.c ersky9x/board_lowlevel.c ersky9x/crt.c ersky9x/vectors_sam3s.c + CPPDEFS += -DPCBX9D -DPCBSKY9X -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 + EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable + BOARDSRC = board_sky9x.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 += ersky9x/usb/device/core/USBD_UDP.c ersky9x/usb/device/core/USBDDriver.c ersky9x/usb/device/core/USBDCallbacks.c - SRC += ersky9x/usb/device/massstorage/MSDDriver.c ersky9x/usb/device/massstorage/MSDDStateMachine.c ersky9x/usb/device/massstorage/MSDLun.c ersky9x/usb/device/massstorage/MSDDriverDescriptors.c ersky9x/usb/device/massstorage/SBCMethods.c - SRC += ersky9x/usb/common/core/USBEndpointDescriptor.c ersky9x/usb/common/core/USBGenericRequest.c ersky9x/usb/common/core/USBFeatureRequest.c ersky9x/usb/common/core/USBInterfaceRequest.c ersky9x/usb/common/core/USBGetDescriptorRequest.c ersky9x/usb/common/core/USBSetAddressRequest.c ersky9x/usb/common/core/USBSetConfigurationRequest.c ersky9x/usb/common/core/USBConfigurationDescriptor.c ersky9x/usb/common/core/USBGenericDescriptor.c - SRC += ersky9x/syscalls.c - SRC += ersky9x/MEDSdcard.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/syscalls.c + SRC += sky9x/MEDSdcard.c EEPROMSRC = eeprom_arm.cpp PULSESSRC = pulses_arm.cpp - CPPSRC += ersky9x/audio.cpp haptic.cpp - CPPSRC += ersky9x/sound_driver.cpp ersky9x/haptic_driver.cpp ersky9x/sdcard_driver.cpp + CPPSRC += sky9x/audio.cpp haptic.cpp + CPPSRC += sky9x/sound_driver.cpp sky9x/haptic_driver.cpp sky9x/sdcard_driver.cpp ifeq ($(SDCARD), YES) - SRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c ersky9x/diskio.c + SRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c sky9x/diskio.c CPPDEFS += -DVOICE endif ifeq ($(BLUETOOTH), YES) MODS:=${MODS}S CPPDEFS += -DBLUETOOTH - CPPSRC += ersky9x/bluetooth.cpp + CPPSRC += sky9x/bluetooth.cpp endif ifeq ($(DEBUG), YES) - CPPSRC += ersky9x/debug.cpp + CPPSRC += sky9x/debug.cpp endif endif -ifeq ($(PCB), ARM) - # ARM, so ... +ifeq ($(PCB), SKY9X) + # SKY9X, so ... OPT = 2 - CPPDEFS += -DPCBARM -DAUDIO -DHAPTIC -DRTCLOCK -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 - EXTRAINCDIRS += ersky9x CoOS/kernel CoOS/portable - BOARDSRC = board_ersky9x.cpp - SRC += ersky9x/core_cm3.c ersky9x/board_lowlevel.c ersky9x/crt.c ersky9x/vectors_sam3s.c + CPPDEFS += -DPCBSKY9X -DAUDIO -DHAPTIC -DRTCLOCK -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 + EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable + BOARDSRC = board_sky9x.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 += ersky9x/usb/device/core/USBD_UDP.c ersky9x/usb/device/core/USBDDriver.c ersky9x/usb/device/core/USBDCallbacks.c - SRC += ersky9x/usb/device/massstorage/MSDDriver.c ersky9x/usb/device/massstorage/MSDDStateMachine.c ersky9x/usb/device/massstorage/MSDLun.c ersky9x/usb/device/massstorage/MSDDriverDescriptors.c ersky9x/usb/device/massstorage/SBCMethods.c - SRC += ersky9x/usb/common/core/USBEndpointDescriptor.c ersky9x/usb/common/core/USBGenericRequest.c ersky9x/usb/common/core/USBFeatureRequest.c ersky9x/usb/common/core/USBInterfaceRequest.c ersky9x/usb/common/core/USBGetDescriptorRequest.c ersky9x/usb/common/core/USBSetAddressRequest.c ersky9x/usb/common/core/USBSetConfigurationRequest.c ersky9x/usb/common/core/USBConfigurationDescriptor.c ersky9x/usb/common/core/USBGenericDescriptor.c - SRC += ersky9x/syscalls.c - SRC += ersky9x/MEDSdcard.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/syscalls.c + SRC += sky9x/MEDSdcard.c EEPROMSRC = eeprom_arm.cpp PULSESSRC = pulses_arm.cpp - CPPSRC += rtc.cpp ersky9x/rtc_driver.cpp - CPPSRC += ersky9x/audio.cpp haptic.cpp - CPPSRC += ersky9x/sound_driver.cpp ersky9x/haptic_driver.cpp ersky9x/sdcard_driver.cpp ersky9x/massstorage.cpp + CPPSRC += rtc.cpp sky9x/rtc_driver.cpp + CPPSRC += sky9x/audio.cpp haptic.cpp + CPPSRC += sky9x/sound_driver.cpp sky9x/haptic_driver.cpp sky9x/sdcard_driver.cpp sky9x/massstorage.cpp ifeq ($(SDCARD), YES) - SRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c ersky9x/diskio.c + SRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c sky9x/diskio.c CPPDEFS += -DVOICE endif ifeq ($(BLUETOOTH), YES) MODS:=${MODS}S CPPDEFS += -DBLUETOOTH - CPPSRC += ersky9x/bluetooth.cpp + CPPSRC += sky9x/bluetooth.cpp endif ifeq ($(DEBUG), YES) - CPPSRC += ersky9x/debug.cpp + CPPSRC += sky9x/debug.cpp endif endif -ifeq ($(PCB), V4) - # V4 PCB, so ... +ifeq ($(PCB), GRUVIN9X) + # Gruvin9x PCB, so ... OPT = 2 - CPPDEFS += -DPCBV4 -DAUDIO -DHAPTIC -DROTARY_ENCODERS=2 + CPPDEFS += -DPCBGRUVIN9X -DAUDIO -DHAPTIC -DROTARY_ENCODERS=2 EXTRAINCDIRS += gruvin9x stock FatFs FatFs/option BOARDSRC += board_gruvin9x.cpp EEPROMSRC = eeprom_avr.cpp @@ -693,7 +693,7 @@ MSG_CLEANING = Cleaning project: ARMCPPFLAGS = -c -mcpu=$(MCU) -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=open9x.lst -Dat91sam3s4 -DRUN_FROM_FLASH=1 $(CPPFLAGS) $(GENDEPFLAGS) AVRCPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) -fwhole-program -ifneq ($(PCB), ARM) +ifneq ($(PCB), SKY9X) GCCVERSIONGTE462 := $(shell expr 4.6.2 \<= `$(CC) -dumpversion`) ifeq ($(GCCVERSIONGTE462),1) CPPFLAGS += -flto @@ -714,7 +714,7 @@ MIN_VER = ${shell sh -c "grep \"MIN_VERS\" open9x.h | cut -d\ -f3"} all: begin gccversion sizebefore build sizeafter end # Change the build target to build a HEX file or a library. -ifeq ($(PCB), ARM) +ifeq ($(PCB), SKY9X) build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm asterisk.lbm allsrc.cpp elf remallsrc bin hex lss else build: stamp_header font.lbm font_dblsize.lbm sticks.lbm s9xsplash.lbm asterisk.lbm allsrc.cpp elf remallsrc hex eep lss sym @@ -806,7 +806,7 @@ end: @echo # Display size of file. -ifeq ($(PCB), ARM) +ifeq ($(PCB), SKY9X) ELFSIZE = $(SIZE) $(TARGET).elf else MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) @@ -842,7 +842,7 @@ eeprom.bin: # Create final output files (.hex, .eep) from ELF output file. -ifeq ($(PCB), ARM) +ifeq ($(PCB), SKY9X) %.hex: %.elf @echo @echo $(MSG_FLASH) $@ @@ -886,7 +886,7 @@ remallsrc: $(REMOVE) allsrc.cpp # Link: create ELF output file from object files. -ifeq ($(PCB), ARM) +ifeq ($(PCB), SKY9X) %.o: %.c $(CC) $(ARMCPPFLAGS) $< -o $@ OBJS = $(SRC:.c=.o) diff --git a/src/beeper.h b/src/beeper.h index 96adb9628..3583a0776 100644 --- a/src/beeper.h +++ b/src/beeper.h @@ -44,8 +44,8 @@ extern bool warbleC; extern uint8_t hapticTick; #endif -#if defined(PCBARM) -#include "ersky9x/sound.h" +#if defined(PCBSKY9X) +#include "sky9x/sound.h" inline void _beep(uint8_t b) { buzzer_sound(b); } @@ -85,7 +85,7 @@ extern void beep(uint8_t val); #define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn) -#if !defined(PCBARM) +#if !defined(PCBSKY9X) FORCEINLINE void AUDIO_HEARTBEAT() { if(g_beepCnt) { diff --git a/src/board_gruvin9x.cpp b/src/board_gruvin9x.cpp index fce1c5c54..c33bef9c4 100644 --- a/src/board_gruvin9x.cpp +++ b/src/board_gruvin9x.cpp @@ -72,11 +72,6 @@ inline void board_init() TCCR0B = (1<ADC_CDR15 - 838) * 621) >> 11)) >> 3; // Filter it - if (temperature > maxTemperature) { + if (temperature < 200 && temperature > maxTemperature) { maxTemperature = temperature; } } @@ -1229,3 +1227,9 @@ uint16_t getCurrent() return (current_scale * Current) / 8192; } #endif + +uint8_t getTemperature() +{ + return temperature + g_eeGeneral.temperatureCalib; +} + diff --git a/src/board_ersky9x.h b/src/board_sky9x.h similarity index 89% rename from src/board_ersky9x.h rename to src/board_sky9x.h index 7b18cb69d..ebdf3f1a6 100644 --- a/src/board_ersky9x.h +++ b/src/board_sky9x.h @@ -31,17 +31,17 @@ * */ -#ifndef board_ersky9x_h -#define board_ersky9x_h +#ifndef board_sky9x_h +#define board_sky9x_h #include -#include "ersky9x/board.h" -#include "ersky9x/sound_driver.h" -#include "ersky9x/haptic_driver.h" -#include "ersky9x/debug.h" +#include "sky9x/board.h" +#include "sky9x/sound_driver.h" +#include "sky9x/haptic_driver.h" +#include "sky9x/debug.h" #if defined(BLUETOOTH) -#include "ersky9x/bluetooth.h" +#include "sky9x/bluetooth.h" #endif extern "C" { @@ -78,6 +78,7 @@ uint16_t getCurrent(); extern uint8_t temperature ; // Raw temp reading extern uint8_t maxTemperature ; // Raw temp reading +uint8_t getTemperature(); #define strcpy_P strcpy #define strcat_P strcat diff --git a/src/drivers.cpp b/src/drivers.cpp index 1fddca88f..67287029a 100644 --- a/src/drivers.cpp +++ b/src/drivers.cpp @@ -63,7 +63,7 @@ uint8_t getEvent(bool trim) } #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #define KEY_LONG_DELAY 32 #else #define KEY_LONG_DELAY 24 @@ -157,33 +157,25 @@ void per10ms() if (s_noHi) s_noHi--; if (trimsCheckTimer) trimsCheckTimer --; -#if defined (PCBARM) +#if defined (PCBSKY9X) Tenms |= 1 ; // 10 mS has passed #endif #if defined(RTCLOCK) - /* Update gloabal Date/Time every 100 per10ms cycles */ + /* Update global Date/Time every 100 per10ms cycles */ if (++g_ms100 == 100) { -#if defined(PCBARM) - if (g_rtcTime!=0) { - g_rtcTime++; // inc global unix timestamp one second - } else { - rtc_init(); // try to get a valid time from the coprocessor - } -#else g_rtcTime++; // inc global unix timestamp one second -#endif g_ms100 = 0; } #endif readKeysAndTrims(); -#if defined(MAVLINK) && !defined(PCBARM) +#if defined(MAVLINK) && !defined(PCBSKY9X) check_mavlink(); #endif -#if defined (FRSKY) && !defined(PCBARM) && !defined(AUDIO) && !defined(VOICE) +#if defined (FRSKY) && !defined(PCBSKY9X) && !defined(AUDIO) && !defined(VOICE) check_frsky(); #endif diff --git a/src/eeprom_avr.cpp b/src/eeprom_avr.cpp index b43f41405..68582ee58 100644 --- a/src/eeprom_avr.cpp +++ b/src/eeprom_avr.cpp @@ -60,7 +60,7 @@ inline void eeprom_write_byte() { EEAR = eeprom_pointer; EEDR = *eeprom_buffer_data; -#if defined (PCBV4) +#if defined (PCBGRUVIN9X) EECR |= 1< -#if defined(PCBV4) && !defined(REV0) +#if defined(PCBGRUVIN9X) && !defined(REV0) #define WRITE_DELAY_10MS 500 #else #define WRITE_DELAY_10MS 200 @@ -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) || defined(M128) +#if defined(PCBGRUVIN9X) || 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) || defined(M128) +#if defined(PCBGRUVIN9X) || defined(M128) #define FIRSTBLK 1 #define BLOCKS (1+(EESIZE-RESV)/BS) #define BLOCKS_OFFSET (RESV-BS) diff --git a/src/ersky9x/usb/device/core/USBDCallbacks.c b/src/ersky9x/usb/device/core/USBDCallbacks.c deleted file mode 100644 index 91dfd853f..000000000 --- a/src/ersky9x/usb/device/core/USBDCallbacks.c +++ /dev/null @@ -1,79 +0,0 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2008, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -//------------------------------------------------------------------------------ -// Headers -//------------------------------------------------------------------------------ - -#include "USBDCallbacks.h" -#include "USBD.h" -#include -#include - -void USBDCallbacks_Initialized(void) -{ - NVIC_EnableIRQ(UDP_IRQn); -} - -#if 0 -void USBDCallbacks_RequestReceived(const USBGenericRequest *pRequest) -{ - // Does nothing -} -#endif - -void USBDCallbacks_Reset(void) -{ - // Does nothing -} - -void USBDCallbacks_Resumed(void) -{ - // Does nothing -} - -void USBDCallbacks_Suspended(void) -{ - // Does nothing -} - -#if 0 -void USBDDriverCallbacks_ConfigurationChanged(unsigned char cfgnum) -{ - TRACE_INFO_WP("ConfigurationChanged "); -} -#endif - -void USBDDriverCallbacks_InterfaceSettingChanged( - unsigned char interface, - unsigned char setting) -{ - // TRACE_INFO_WP("InterfaceSettingChanged "); -} - diff --git a/src/ersky9x/usb/device/core/USBDCallbacks.h b/src/ersky9x/usb/device/core/USBDCallbacks.h deleted file mode 100644 index d4d5c7e7f..000000000 --- a/src/ersky9x/usb/device/core/USBDCallbacks.h +++ /dev/null @@ -1,65 +0,0 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2008, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - \unit - - !!!Purpose - - Definitions of callbacks used by the USBD API to notify the user - application of incoming events. These functions are declared as 'weak', - so they can be re-implemented elsewhere in the application in a - transparent way. -*/ - -#ifndef USBDCALLBACKS_H -#define USBDCALLBACKS_H - -//------------------------------------------------------------------------------ -// Headers -//------------------------------------------------------------------------------ - -#include - -//------------------------------------------------------------------------------ -// Exported functions -//------------------------------------------------------------------------------ - -extern void USBDCallbacks_Initialized(void); - -extern void USBDCallbacks_Reset(void); - -extern void USBDCallbacks_Suspended(void); - -extern void USBDCallbacks_Resumed(void); - -extern void USBDCallbacks_RequestReceived(const USBGenericRequest *request); - -#endif //#ifndef USBDCALLBACKS_H - diff --git a/src/ersky9x/usb/device/core/USBDDriverCallbacks.h b/src/ersky9x/usb/device/core/USBDDriverCallbacks.h deleted file mode 100644 index 053e8ac23..000000000 --- a/src/ersky9x/usb/device/core/USBDDriverCallbacks.h +++ /dev/null @@ -1,61 +0,0 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2008, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - \unit - - !!!Purpose - - Definition of several callbacks which are triggered by the USB software - driver after receiving specific requests. - - !!!Usage - - -# Re-implement the USBDDriverCallbacks_ConfigurationChanged - callback to know when the hosts changes the active configuration of - the device. - -# Re-implement the USBDDriverCallbacks_InterfaceSettingChanged - callback to get notified whenever the active setting of an interface - is changed by the host. -*/ - -#ifndef USBDDRIVERCALLBACKS_H -#define USBDDRIVERCALLBACKS_H - -//------------------------------------------------------------------------------ -// Exported functions -//------------------------------------------------------------------------------ - -extern void USBDDriverCallbacks_ConfigurationChanged(unsigned char cfgnum); - -extern void USBDDriverCallbacks_InterfaceSettingChanged(unsigned char interface, - unsigned char setting); - -#endif //#ifndef USBDDRIVERCALLBACKS_H - diff --git a/src/ersky9x/usb/device/massstorage/_MSDIOFifo.c b/src/ersky9x/usb/device/massstorage/_MSDIOFifo.c deleted file mode 100644 index 03f09a6a8..000000000 --- a/src/ersky9x/usb/device/massstorage/_MSDIOFifo.c +++ /dev/null @@ -1,68 +0,0 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2008, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -//------------------------------------------------------------------------------ -// Headers -//------------------------------------------------------------------------------ - -#include "MSDIOFifo.h" - -//------------------------------------------------------------------------------ -// Internal variables -//------------------------------------------------------------------------------ - - -//------------------------------------------------------------------------------ -// Exported functions -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ -//! \brief Initializes a MSDIOFifo instance. -//! \param pFifo Pointer to the MSDIOFifo instance to initialize -//! \param pBuffer Pointer to a buffer used for read/write operation and -//! which must be blockSize bytes aligned. -//! \param bufferSize Total size of the buffer in bytes -//------------------------------------------------------------------------------ -void MSDIOFifo_Init(MSDIOFifo *pFifo, - void * pBuffer, unsigned short bufferSize) -{ - pFifo->pBuffer = pBuffer; - pFifo->bufferSize = bufferSize; - - pFifo->inputNdx = 0; - pFifo->outputNdx = 0; - pFifo->inputTotal = 0; - pFifo->outputTotal = 0; - - pFifo->inputState = MSDIO_IDLE; - pFifo->outputState = MSDIO_IDLE; - - pFifo->fullCnt = 0; - pFifo->nullCnt = 0; -} diff --git a/src/frsky.cpp b/src/frsky.cpp index 51ce66a97..520e52f28 100644 --- a/src/frsky.cpp +++ b/src/frsky.cpp @@ -52,7 +52,7 @@ uint8_t frskyRxBuffer[FRSKY_RX_PACKET_SIZE]; // Receive buffer. 9 bytes (full packet), worst case 18 bytes with byte-stuffing (+1) uint8_t frskyTxBuffer[FRSKY_TX_PACKET_SIZE]; // Ditto for transmit buffer -#if !defined(PCBARM) +#if !defined(PCBSKY9X) uint8_t frskyTxBufferCount = 0; #endif uint8_t FrskyRxBufferReady = 0; @@ -428,7 +428,7 @@ void processFrskyPacket(uint8_t *packet) a second buffer to receive data while one buffer is being processed (slowly). */ -#if defined(PCBARM) +#if defined(PCBSKY9X) void processSerialData(uint8_t data) #else NOINLINE void processSerialData(uint8_t stat, uint8_t data) @@ -442,7 +442,7 @@ NOINLINE void processSerialData(uint8_t stat, uint8_t data) btPushByte(data); #endif -#if !defined(PCBARM) +#if !defined(PCBSKY9X) if (stat & ((1 << FE0) | (1 << DOR0) | (1 << UPE0))) { // discard buffer and start fresh on any comms error FrskyRxBufferReady = 0; @@ -498,7 +498,7 @@ NOINLINE void processSerialData(uint8_t stat, uint8_t data) } } -#if !defined(PCBARM) && !defined(SIMU) +#if !defined(PCBSKY9X) && !defined(SIMU) ISR(USART0_RX_vect) { uint8_t stat; @@ -549,7 +549,7 @@ ISR(USART0_RX_vect) #endif /******************************************/ -#if defined(PCBARM) +#if defined(PCBSKY9X) void frskyTransmitBuffer( uint32_t size ) { txPdcUsart( frskyTxBuffer, size ) ; @@ -564,7 +564,7 @@ void frskyTransmitBuffer() uint8_t frskyAlarmsSendState = 0 ; -#if defined(PCBARM) +#if defined(PCBSKY9X) void frskyPushValue(uint8_t *&ptr, uint8_t value) { // byte stuff the only byte than might need it @@ -678,7 +678,7 @@ inline void FRSKY10mspoll(void) NOINLINE void check_frsky() { -#if defined(PCBARM) +#if defined(PCBSKY9X) rxPdcUsart(processSerialData); // Receive serial data here #endif @@ -826,7 +826,7 @@ bool FRSKY_alarmRaised(uint8_t idx) } #endif -#if !defined(PCBARM) +#if !defined(PCBSKY9X) inline void FRSKY_EnableTXD(void) { frskyTxBufferCount = 0; @@ -845,7 +845,7 @@ void FRSKY_Init(void) // clear frsky variables resetTelemetry(); -#if defined(PCBARM) +#if defined(PCBSKY9X) startPdcUsartReceive() ; #elif !defined(SIMU) @@ -1177,7 +1177,7 @@ void displayGpsCoord(uint8_t y, char direction, int16_t bp, int16_t ap) uint8_t getTelemCustomField(uint8_t line, uint8_t col) { -#if defined(PCBARM) +#if defined(PCBSKY9X) return g_model.frsky.lines[2*line+col]; #else uint8_t result = (col==0 ? (g_model.frsky.lines[line] & 0x0f) : ((g_model.frsky.lines[line] & 0xf0) / 16)); diff --git a/src/general_menus.cpp b/src/general_menus.cpp index 6446072a6..4bd5268b3 100644 --- a/src/general_menus.cpp +++ b/src/general_menus.cpp @@ -46,7 +46,7 @@ enum EnumTabDiag { e_Vers, e_Keys, e_Ana, -#if defined(PCBARM) +#if defined(PCBSKY9X) e_Hardware, #endif e_Calib @@ -72,7 +72,7 @@ const MenuFuncP_PROGMEM menuTabDiag[] PROGMEM = { menuProcDiagVers, menuProcDiagKeys, menuProcDiagAna, -#if defined(PCBARM) +#if defined(PCBSKY9X) menuProcHardware, #endif menuProcDiagCalib @@ -114,12 +114,12 @@ enum menuProcSetupItems { ITEM_SETUP_HAPTIC_LENGTH, ITEM_SETUP_HAPTIC_STRENGTH, #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) ITEM_SETUP_BRIGHTNESS, #endif ITEM_SETUP_CONTRAST, ITEM_SETUP_BATTERY_WARNING, -#if defined(PCBARM) +#if defined(PCBSKY9X) ITEM_SETUP_CAPACITY_WARNING, ITEM_SETUP_TEMPERATURE_WARNING, #endif @@ -184,7 +184,7 @@ void menuProcSetup(uint8_t event) #else #define FRSKY_ZEROS #endif -#ifdef PCBARM +#ifdef PCBSKY9X #define ARM_ZEROS 0, 0, 0, #else #define ARM_ZEROS @@ -291,7 +291,7 @@ void menuProcSetup(uint8_t event) case ITEM_SETUP_SPEAKER_VOLUME: { lcd_putsLeft(y, STR_SPEAKER_VOLUME); -#if defined(PCBARM) +#if defined(PCBSKY9X) lcd_outdezAtt(GENERAL_PARAM_OFS, y, g_eeGeneral.speakerVolume, attr|LEFT); if (attr) { CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerVolume, 0, NUM_VOL_LEVELS-1); @@ -330,7 +330,7 @@ void menuProcSetup(uint8_t event) break; #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) case ITEM_SETUP_BRIGHTNESS: lcd_putsLeft(y, STR_BRIGHTNESS); lcd_outdezAtt(GENERAL_PARAM_OFS, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ; @@ -358,7 +358,7 @@ void menuProcSetup(uint8_t event) if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V break; -#if defined(PCBARM) +#if defined(PCBSKY9X) case ITEM_SETUP_CAPACITY_WARNING: lcd_putsLeft(y, STR_CAPAWARNING); putsTelemetryValue(GENERAL_PARAM_OFS, y, g_eeGeneral.mAhWarn*50, UNIT_MAH, attr|LEFT) ; @@ -367,8 +367,8 @@ void menuProcSetup(uint8_t event) case ITEM_SETUP_TEMPERATURE_WARNING: lcd_putsLeft(y, STR_TEMPWARNING); - putsTelemetryValue(GENERAL_PARAM_OFS, y, 80+g_eeGeneral.temperatureWarn, UNIT_DEGREES, attr|LEFT) ; - if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.temperatureWarn, -80, 40); // 0-120degrees + putsTelemetryValue(GENERAL_PARAM_OFS, y, g_eeGeneral.temperatureWarn, UNIT_DEGREES, attr|LEFT) ; + if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.temperatureWarn, 0, 120); // 0 means no alarm break; #endif @@ -496,7 +496,7 @@ void menuProcSetup(uint8_t event) } } -#if defined(PCBARM) +#if defined(PCBSKY9X) extern uint32_t sdAvailableAudioFiles; // TODO move that! #endif @@ -587,7 +587,7 @@ void menuProcSd(uint8_t event) s_menu[s_menu_count++] = STR_SD_FORMAT; } else { -#if defined(PCBARM) +#if defined(PCBSKY9X) uint8_t index = m_posVert-1-s_pgOfs; char * line = reusableBuffer.sd.lines[index]; if (!strcmp(line+strlen(line)-4, SOUNDS_EXT)) { @@ -727,7 +727,7 @@ void menuProcSd(uint8_t event) else if (result == STR_SD_FORMAT) { displayPopup(PSTR("Formatting...")); // TODO translations if (f_mkfs(0, 1, 0) == FR_OK) { -#if defined(PCBARM) +#if defined(PCBSKY9X) sdAvailableAudioFiles = 0; #endif f_chdir("/"); @@ -748,7 +748,7 @@ void menuProcSd(uint8_t event) if ((uint16_t)m_posVert == reusableBuffer.sd.count) m_posVert--; reusableBuffer.sd.offset = s_pgOfs-1; } -#if defined(PCBARM) +#if defined(PCBSKY9X) else if (result == STR_PLAY_FILE) { f_getcwd(lfn, SD_SCREEN_FILE_LENGTH); strcat(lfn, "/"); @@ -891,7 +891,9 @@ void menuProcDiagKeys(uint8_t event) void menuProcDiagAna(uint8_t event) { -#if defined(PCBARM) && defined(REVB) +#if defined(PCBSKY9X) && defined(REVB) +#define ANAS_ITEMS_COUNT 4 +#elif defined(PCBSKY9X) #define ANAS_ITEMS_COUNT 3 #else #define ANAS_ITEMS_COUNT 2 @@ -908,42 +910,48 @@ void menuProcDiagAna(uint8_t event) lcd_outdez8(x+10*FW-1, y, (int16_t)calibratedStick[CONVERT_MODE(i+1)-1]*25/256); } -#if !defined(PCBARM) +#if !defined(PCBSKY9X) // Display raw BandGap result (debug) lcd_puts(64+5, 1+4*FH, STR_BG); lcd_outdezAtt(64+5+6*FW-3, 1+4*FH, BandGap, 0); #endif - // Voltage calibration - lcd_putsLeft(6*FH-2, STR_BATT_CALIB); -#if defined(PCBARM) +#if defined(PCBSKY9X) + lcd_putsLeft(5*FH, STR_BATT_CALIB); static uint32_t adcBatt; adcBatt = ((adcBatt * 7) + anaIn(7)) / 8; // running average, sourced directly (to avoid unending debate :P) uint32_t batCalV = ( adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128 ) * 4191 ; batCalV /= 55296 ; - putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, batCalV, (m_posVert==1 ? INVERS : 0)); - // TODO PREC2 => lcd_outdezNAtt(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, batCalV, PREC2|(m_posVert==1 ? INVERS : 0)); -#elif defined(PCBV4) + putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 5*FH, batCalV, (m_posVert==1 ? INVERS : 0)); +#elif defined(PCBGRUVIN9X) + lcd_putsLeft(6*FH-2, STR_BATT_CALIB); // Gruvin wants 2 decimal places and instant update of volts calib field when button pressed static uint16_t adcBatt; adcBatt = ((adcBatt * 7) + anaIn(7)) / 8; // running average, sourced directly (to avoid unending debate :P) uint32_t batCalV = ((uint32_t)adcBatt*1390 + (10*(int32_t)adcBatt*g_eeGeneral.vBatCalib)/8) / BandGap; lcd_outdezNAtt(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, batCalV, PREC2|(m_posVert==1 ? INVERS : 0)); #else + lcd_putsLeft(6*FH-2, STR_BATT_CALIB); putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, g_vbat100mV, (m_posVert==1 ? INVERS : 0)); #endif if (m_posVert==1) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatCalib, -127, 127); -#if defined(PCBARM) && defined(REVB) - lcd_putsLeft(7*FH-2, STR_CURRENT_CALIB); - putsTelemetryValue(LEN_CALIB_FIELDS*FW+4*FW, 7*FH-2, getCurrent(), UNIT_MILLIAMPS, (m_posVert==2 ? INVERS : 0)) ; +#if defined(PCBSKY9X) && defined(REVB) + lcd_putsLeft(6*FH, STR_CURRENT_CALIB); + putsTelemetryValue(LEN_CALIB_FIELDS*FW+4*FW, 6*FH, getCurrent(), UNIT_MILLIAMPS, (m_posVert==2 ? INVERS : 0)) ; if (m_posVert==2) CHECK_INCDEC_GENVAR(event, g_eeGeneral.currentCalib, -49, 49); #endif +#if defined(PCBSKY9X) + lcd_putsLeft(7*FH, PSTR("Temp. Calib")); + putsTelemetryValue(LEN_CALIB_FIELDS*FW+4*FW, 7*FH, getTemperature(), UNIT_DEGREES, (m_posVert==3 ? INVERS : 0)) ; + if (m_posVert==3) CHECK_INCDEC_GENVAR(event, g_eeGeneral.temperatureCalib, -100, 100); +#endif } -#if defined(PCBARM) +#if defined(PCBSKY9X) enum menuProcHwItems { + ITEM_SETUP_HW_COPROC, ITEM_SETUP_HW_OPTREX_DISPLAY, ITEM_SETUP_HW_MAX }; @@ -951,7 +959,7 @@ enum menuProcHwItems { #define GENERAL_HW_PARAM_OFS (2+(15*FW)) void menuProcHardware(uint8_t event) { - MENU(PSTR("Hardware"), menuTabDiag, e_Hardware, ITEM_SETUP_HW_MAX+1, {0, 0}); + MENU(PSTR("Hardware"), menuTabDiag, e_Hardware, ITEM_SETUP_HW_MAX+1, {0, -1, 0}); uint8_t sub = m_posVert - 1; @@ -962,6 +970,11 @@ void menuProcHardware(uint8_t event) uint8_t attr = (sub == k ? blink : 0); switch(k) { + case ITEM_SETUP_HW_COPROC: + lcd_putsLeft(y, STR_COPROC); + lcd_outhex4(GENERAL_HW_PARAM_OFS, y, (Coproc_valid << 8) + Coproc_read); + break; + case ITEM_SETUP_HW_OPTREX_DISPLAY: // TODO remove STR_OPTREX_DISPLAY + translations here g_eeGeneral.optrexDisplay = selectMenuItem(GENERAL_HW_PARAM_OFS, y, PSTR("LCD"), PSTR("\006NormalOptrex"), g_eeGeneral.optrexDisplay, 0, 1, attr, event); diff --git a/src/gruvin9x/diskio.cpp b/src/gruvin9x/diskio.cpp index 66604375f..23459c399 100644 --- a/src/gruvin9x/diskio.cpp +++ b/src/gruvin9x/diskio.cpp @@ -69,7 +69,7 @@ /* Port Controls (Platform dependent) */ // GCC optimisation should result in a single CBI/SBI instructions here -#if defined (PCBV4) +#if defined (PCBGRUVIN9X) # define CS_LOW() PORTB &= ~0x01 /* MMC CS = L */ # define CS_HIGH() PORTB |= 0x01 /* MMC CS = H */ #else diff --git a/src/haptic.cpp b/src/haptic.cpp index 294f2b8d4..94af3e70f 100644 --- a/src/haptic.cpp +++ b/src/haptic.cpp @@ -52,7 +52,7 @@ void hapticQueue::heartbeat() if (buzzTimeLeft > 0) { buzzTimeLeft--; // time gets counted down -#if defined(PCBARM) +#if defined(PCBSKY9X) hapticOn(g_eeGeneral.hapticStrength * 20); #else if (hapticTick-- > 0) { diff --git a/src/lcd.cpp b/src/lcd.cpp index 949549b26..610490786 100644 --- a/src/lcd.cpp +++ b/src/lcd.cpp @@ -67,7 +67,7 @@ void lcd_img(uint8_t x, uint8_t y, const pm_uchar * img, uint8_t idx, uint8_t mo uint8_t lcdLastPos; -#if defined(PCBARM) +#if defined(PCBSKY9X) uint8_t lcdLock; uint32_t lcdInputs; #endif @@ -490,7 +490,7 @@ void putsTime(uint8_t x, uint8_t y, putstime_t tme, uint8_t att, uint8_t att2) qr = div(tme, 60); -#if defined(PCBARM) +#if defined(PCBSKY9X) if (tme >= 3600) { qr = div(qr.quot, 60); lcd_outdezAtt(x+2*FWNUM, y, qr.quot, att); @@ -668,7 +668,7 @@ void putsRotaryEncoderMode(uint8_t x, uint8_t y, uint8_t phase, uint8_t idx, uin } #endif -#ifdef PCBARM +#ifdef PCBSKY9X // LCD i/o pins // LCD_RES PC27 diff --git a/src/lcd.h b/src/lcd.h index db5e3d3c2..3ef6fe25b 100644 --- a/src/lcd.h +++ b/src/lcd.h @@ -87,9 +87,9 @@ #define SURROUNDED 0x100 -#if defined(PCBARM) +#if defined(PCBSKY9X) #define LcdFlags uint32_t -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #define LcdFlags uint16_t #else #define LcdFlags uint8_t @@ -102,7 +102,7 @@ extern uint8_t lcdLastPos; extern volatile uint8_t LcdLock ; #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) extern uint8_t lcdLock ; extern uint32_t lcdInputs ; #endif @@ -143,7 +143,7 @@ extern void putsChnLetter(uint8_t x, uint8_t y, uint8_t idx, uint8_t attr); extern void putsVolts(uint8_t x, uint8_t y, uint16_t volts, uint8_t att); extern void putsVBat(uint8_t x, uint8_t y, uint8_t att); -#if defined(PCBARM) +#if defined(PCBSKY9X) #define putstime_t int32_t #else #define putstime_t int16_t diff --git a/src/main_views.cpp b/src/main_views.cpp index 58ba4bd86..6a8a2cb80 100644 --- a/src/main_views.cpp +++ b/src/main_views.cpp @@ -99,7 +99,7 @@ void menuMainView(uint8_t event) case EVT_KEY_BREAK(KEY_RIGHT): case EVT_KEY_BREAK(KEY_LEFT): if (view_base <= e_inputs) { -#if defined(PCBARM) +#if defined(PCBSKY9X) if (view_base == e_inputs) g_eeGeneral.view ^= ALTERNATE_VIEW; else @@ -205,9 +205,9 @@ void menuMainView(uint8_t event) putsModelName(2*FW-2, 0*FH, g_model.name, g_eeGeneral.currModel, DBLSIZE); // Voltage (or alarm if any) -#if defined(PCBARM) - if (g_vbat100mV > g_eeGeneral.vBatWarn && temperature >= g_eeGeneral.temperatureWarn+80) { - putsTelemetryValue(6*FW-1, 3*FH, temperature, UNIT_DEGREES, BLINK|INVERS|DBLSIZE); +#if defined(PCBSKY9X) + if (g_vbat100mV > g_eeGeneral.vBatWarn && g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) { + putsTelemetryValue(6*FW-1, 3*FH, getTemperature(), UNIT_DEGREES, BLINK|INVERS|DBLSIZE); } else if (g_vbat100mV > g_eeGeneral.vBatWarn && g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.currentCalib)/8192/36) / 500 >= g_eeGeneral.mAhWarn) { putsTelemetryValue(7*FW-1, 3*FH, (g_eeGeneral.mAhUsed + Current_used*(488 + g_eeGeneral.currentCalib)/8192/36)/10, UNIT_MAH, BLINK|INVERS|DBLSIZE); @@ -278,7 +278,7 @@ void menuMainView(uint8_t event) if (view_base < e_inputs) { // scroll bar lcd_hlineStip(38, 34, 54, DOTTED); -#if defined(PCBARM) +#if defined(PCBSKY9X) lcd_hline(38 + (g_eeGeneral.view / ALTERNATE_VIEW) * 13, 34, 13, SOLID); #else lcd_hline((g_eeGeneral.view & ALTERNATE_VIEW) ? 64 : 38, 34, 26, SOLID); @@ -286,7 +286,7 @@ void menuMainView(uint8_t event) for (uint8_t i=0; i<8; i++) { uint8_t x0,y0; -#if defined(PCBARM) +#if defined(PCBSKY9X) uint8_t chan = 8*(g_eeGeneral.view / ALTERNATE_VIEW) + i; #else uint8_t chan = (g_eeGeneral.view & ALTERNATE_VIEW) ? 8+i : i; @@ -352,16 +352,16 @@ void menuMainView(uint8_t event) #endif //EXTRA_ROTARY_ENCODERS } #endif // ROTARY_ENCODERS -#if defined(PCBARM) +#if defined(PCBSKY9X) for (uint8_t i=0; i1 ? 3*FW+6 : 0), 4*FH+1 + (i%3)*FH, 10+i, getSwitch(10+i, 0) ? INVERS : 0); -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) for (uint8_t i=0; i1 ? 3*FW : 0), 4*FH+1 + (i%3)*FH, 10+i, getSwitch(10+i, 0) ? INVERS : 0); #else diff --git a/src/menus.cpp b/src/menus.cpp index 537957ba6..10007592e 100644 --- a/src/menus.cpp +++ b/src/menus.cpp @@ -187,7 +187,7 @@ bool check_submenu_simple(uint8_t event, uint8_t maxrow) #if defined(ROTARY_ENCODERS) -#if defined(PCBARM) +#if defined(PCBSKY9X) #define ROTARY_ENCODER_GRANULARITY 4 #else #define ROTARY_ENCODER_GRANULARITY 1 diff --git a/src/menus.h b/src/menus.h index 14bcec08a..2db9689e7 100644 --- a/src/menus.h +++ b/src/menus.h @@ -132,14 +132,14 @@ extern int8_t s_inflight_min; extern int8_t s_inflight_max; extern int8_t s_inflight_shift; extern uint8_t s_inflight_bitshift; -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #define PREPARE_INFLIGHT_BITFIELD(a) int8_t *bitfield = (a) #endif #define INFLIGHT(val) (s_inflight_value==&val ? SURROUNDED : 0) void checkInFlightIncDecModel(uint8_t event, int8_t *value, int8_t i_min, int8_t i_max, int8_t i_shift, const pm_char *label, uint8_t bitshift=0); #define CHECK_INFLIGHT_INCDEC_MODELVAR(event, var, imin, imax, ishift, label) \ checkInFlightIncDecModel(event, &var, imin, imax, ishift, label) -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #define CHECK_INFLIGHT_INCDEC_MODELVAR_BITFIELD(event, var, imin, imax, ishift, label, bitshift) \ checkInFlightIncDecModel(event, bitfield, imin, imax, ishift, label, bitshift); #endif diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 79ad374b0..dba9195ee 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -187,9 +187,9 @@ void menuProcModelSelect(uint8_t event) { TITLE(STR_MENUMODELSEL); -#if defined(PCBARM) +#if defined(PCBSKY9X) #define REFRESH(x) -#elif defined(PCBV4) && defined(SDCARD) +#elif defined(PCBGRUVIN9X) && defined(SDCARD) static bool refresh = true; #define REFRESH(x) refresh = (x) #else @@ -223,7 +223,7 @@ void menuProcModelSelect(uint8_t event) #endif if (s_editMode > 0) s_editMode = 0; -#if !defined(PCBARM) +#if !defined(PCBSKY9X) if (event #if defined(ROTARY_ENCODERS) || oldSub != m_posVert @@ -383,7 +383,7 @@ void menuProcModelSelect(uint8_t event) break; } -#if !defined(PCBARM) +#if !defined(PCBSKY9X) lcd_puts(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE); if (refresh) reusableBuffer.models.eepromfree = EeFsGetFree(); lcd_outdezAtt(17*FW, 0, reusableBuffer.models.eepromfree, 0); @@ -418,7 +418,7 @@ void menuProcModelSelect(uint8_t event) k %= MAX_MODELS; if (eeModelExists(k)) { -#if defined(PCBARM) +#if defined(PCBSKY9X) putsModelName(4*FW, y, ModelNames[k], k, 0); #else uint16_t & size = reusableBuffer.models.listsizes[i]; @@ -437,7 +437,7 @@ void menuProcModelSelect(uint8_t event) } if (s_warning) { -#if defined(PCBARM) +#if defined(PCBSKY9X) s_warning_info = ModelNames[sub]; #else char * name = reusableBuffer.models.mainname; @@ -565,7 +565,7 @@ enum menuProcModelItems { ITEM_MODEL_PROTOCOL_PARAMS }; -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) #define FIELD_TIMER_MAX 3 #else #define FIELD_TIMER_MAX 2 @@ -596,7 +596,7 @@ void menuProcModel(uint8_t event) switch(k) { case ITEM_MODEL_NAME: EditName(MODEL_PARAM_OFS, y, g_model.name, sizeof(g_model.name), event, attr, m_posHorz); -#if defined(PCBARM) +#if defined(PCBSKY9X) memcpy(ModelNames[g_eeGeneral.currModel], g_model.name, sizeof(g_model.name)); #endif break; @@ -610,7 +610,7 @@ void menuProcModel(uint8_t event) putsTime(15*FW, y, timer->val, (attr && m_posHorz==1 ? blink:0), (attr && m_posHorz==2 ? blink:0) ); -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) lcd_putcAtt(20*FW+1, y, g_model.timersXtra[k-ITEM_MODEL_TIMER1].remanent ? 'R' : '-', (attr && m_posHorz==3) ? blink : 0); #endif if (attr && (s_editMode>0 || p1valdiff)) { @@ -628,7 +628,7 @@ void menuProcModel(uint8_t event) timer->val -= qr.rem ; if ((int16_t)timer->val < 0) timer->val=0; break; -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) case 3: CHECK_INCDEC_MODELVAR(event, g_model.timersXtra[k-ITEM_MODEL_TIMER1].remanent, 0, 1); break; @@ -840,7 +840,7 @@ uint8_t editDelay(const uint8_t y, const uint8_t event, const uint8_t attr, cons #if defined(FLIGHT_PHASES) -#if defined(PCBARM) +#if defined(PCBSKY9X) #define PhasesType uint16_t #else #define PhasesType uint8_t @@ -850,12 +850,12 @@ PhasesType editPhases(uint8_t x, uint8_t y, uint8_t event, PhasesType value, uin { lcd_putsLeft(y, STR_FPHASE); -#if defined(PCBARM) +#if defined(PCBSKY9X) bool expoMenu = (x==EXPO_ONE_2ND_COLUMN-2*FW); #endif for (uint8_t p=0; p EXPO_ONE_2ND_COLUMN+2*FW))) continue; #endif @@ -980,7 +980,7 @@ void menuProcPhasesAll(uint8_t event) uint8_t att; for (uint8_t i=0; i7*FH) continue; #else @@ -1019,7 +1019,7 @@ void menuProcPhasesAll(uint8_t event) for (uint8_t t=0; tfadeIn && p->fadeOut) ? '*' : (p->fadeIn ? 'I' : 'O')); } -#if defined(PCBARM) +#if defined(PCBSKY9X) if (s_pgOfs != MAX_PHASES-6) return; #endif @@ -1459,7 +1459,7 @@ bool swapExpoMix(uint8_t expo, uint8_t &idx, uint8_t up) } enum ExposFields { -#ifdef PCBARM +#ifdef PCBSKY9X EXPO_FIELD_NAME, #endif EXPO_FIELD_WIDTH, @@ -1475,7 +1475,7 @@ enum ExposFields { EXPO_FIELD_MAX }; -#if defined(PCBARM) +#if defined(PCBSKY9X) #define EXPO_ONE_ARM_ROW sizeof(ed->name), #else #define EXPO_ONE_ARM_ROW @@ -1506,7 +1506,7 @@ void menuProcExpoOne(uint8_t event) uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0); switch(i) { -#if defined(PCBARM) +#if defined(PCBSKY9X) case EXPO_FIELD_NAME: EditName(EXPO_ONE_2ND_COLUMN-3*FW, y, ed->name, sizeof(ed->name), event, attr, m_posHorz); break; @@ -1577,7 +1577,7 @@ void menuProcExpoOne(uint8_t event) } enum MixFields { -#if defined(PCBARM) +#if defined(PCBSKY9X) MIX_FIELD_NAME, #endif MIX_FIELD_SOURCE, @@ -1600,7 +1600,7 @@ enum MixFields { MIX_FIELD_COUNT }; -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MIX_ONE_ARM_ROW sizeof(md2->name), #else #define MIX_ONE_ARM_ROW @@ -1631,7 +1631,7 @@ void menuProcMixOne(uint8_t event) uint8_t i = k + s_pgOfs; uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0); switch(i) { -#if defined(PCBARM) +#if defined(PCBSKY9X) case MIX_FIELD_NAME: EditName(MIXES_2ND_COLUMN, y, md2->name, sizeof(md2->name), event, attr, m_posHorz); break; @@ -1943,7 +1943,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event) else lcd_outdezAtt(EXPO_LINE_EXPO_POS, y, ed->curveParam, 0); -#if defined(PCBARM) +#if defined(PCBSKY9X) if (ed->name[0]) { putsSwitches(11*FW, y, ed->swtch, 0); lcd_putsnAtt(15*FW+2, y, ed->name, sizeof(ed->name), ZCHAR | (isExpoActive(i) ? BOLD : 0)); @@ -1965,7 +1965,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event) if (attr != 0) CHECK_INCDEC_MODELVAR(_event, md->weight, -125, 125); -#if defined(PCBARM) +#if defined(PCBSKY9X) if (md->name[0]) { lcd_putsnAtt(15*FW+2, y, md->name, sizeof(md->name), ZCHAR | (isMixActive(i) ? BOLD : 0)); } @@ -2165,7 +2165,7 @@ void menuProcLimits(uint8_t event) #endif if (active) { int16_t new_offset = checkIncDec(event, ld->offset, -1000, 1000, EE_MODEL|NO_INCDEC_MARKS); -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) if (checkIncDec_Ret) #endif { @@ -2289,7 +2289,7 @@ void menuProcCurvesAll(uint8_t event) } #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) enum CustomSwitchFields { CSW_FIELD_FUNCTION, CSW_FIELD_V1, @@ -2556,7 +2556,7 @@ void menuProcCustomSwitches(uint8_t event) void menuProcFunctionSwitches(uint8_t event) { -#if defined(PCBARM) && defined(SDCARD) +#if defined(PCBSKY9X) && defined(SDCARD) uint8_t _event = event; if (s_menu_count) { event = 0; @@ -2631,7 +2631,7 @@ void menuProcFunctionSwitches(uint8_t event) lcd_outdezAtt(21*FW, y, val_displayed, attr); } #endif -#if defined(PCBARM) && defined(SDCARD) +#if defined(PCBSKY9X) && defined(SDCARD) else if (sd->func == FUNC_PLAY_TRACK) { if (sd->param[0] && sd->param[1]) lcd_putsnAtt(15*FW, y, sd->param, sizeof(sd->param), attr); @@ -2651,7 +2651,7 @@ void menuProcFunctionSwitches(uint8_t event) putsChnRaw(17*FW, y, val_displayed+1, attr); } #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) else if (sd->func == FUNC_VOLUME) { val_max = NUM_XCHNRAW-1; putsChnRaw(17*FW, y, val_displayed+1, attr); @@ -2716,7 +2716,7 @@ void menuProcFunctionSwitches(uint8_t event) } } -#if defined(PCBARM) && defined(SDCARD) +#if defined(PCBSKY9X) && defined(SDCARD) if (s_menu_count) { const char * result = displayMenu(_event); if (result) { @@ -2992,7 +2992,7 @@ void menuProcTelemetry(uint8_t event) if (attr && m_posHorz==c && (s_editMode>0 || p1valdiff)) { CHECK_INCDEC_MODELVAR(event, value, 0, (j==3 && c==0) ? TELEM_STATUS_MAX : TELEM_DISPLAY_MAX); if (checkIncDec_Ret) { -#if defined (PCBARM) +#if defined (PCBSKY9X) g_model.frsky.lines[2*j+c] = value; #else g_model.frsky.lines[j] = (c==0 ? ((g_model.frsky.lines[j] & 0xf0) + (value & 0x0f)) : (g_model.frsky.lines[j] & 0x0f) + ((value & 0x0f) << 4)); diff --git a/src/myeeprom.h b/src/myeeprom.h index 16e671578..32c524993 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -48,9 +48,9 @@ #define WARN_MEM (!(g_eeGeneral.warnOpts & WARN_MEM_BIT)) #define BEEP_VAL ( (g_eeGeneral.warnOpts & WARN_BVAL_BIT) >>3 ) -#if defined(PCBARM) +#if defined(PCBSKY9X) #define EEPROM_VER 212 -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #define EEPROM_VER 211 #else #define EEPROM_VER 211 @@ -91,8 +91,8 @@ enum BeeperMode { e_mode_all }; -#if defined(PCBARM) -#define EXTRA_ARM_FIELDS \ +#if defined(PCBSKY9X) +#define EXTRA_SKY9X_FIELDS \ uint8_t speakerVolume; \ uint8_t backlightBright; \ int8_t currentCalib @@ -100,9 +100,10 @@ enum BeeperMode { int8_t temperatureWarn; \ uint8_t mAhWarn; \ uint16_t mAhUsed; \ - uint32_t globalTimer + uint32_t globalTimer; \ + int8_t temperatureCalib; #else -#define EXTRA_ARM_FIELDS +#define EXTRA_SKY9X_FIELDS #define EXTRA_GENERAL_FIELDS \ int8_t speakerVolume #endif @@ -135,7 +136,7 @@ PACK(typedef struct t_EEGeneral { int8_t backlightMode; TrainerData trainer; uint8_t view; //index of subview in main scrren - uint8_t btBaudrate:3; // TODO only needed on ARM + uint8_t btBaudrate:3; // TODO only needed on SKY9X int8_t beeperMode:2; uint8_t spare1:1; uint8_t disableMemoryWarning:1; @@ -163,7 +164,7 @@ PACK(typedef struct t_EEGeneral { uint8_t unexpectedShutdown:1; uint8_t speakerPitch; - EXTRA_ARM_FIELDS; + EXTRA_SKY9X_FIELDS; uint8_t variants; @@ -173,7 +174,7 @@ PACK(typedef struct t_EEGeneral { // eeprom modelspec -#if defined(PCBARM) +#if defined(PCBSKY9X) PACK(typedef struct t_ExpoData { uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both uint8_t chn; @@ -213,9 +214,9 @@ enum MixSources { MIXSRC_P1, MIXSRC_P2, MIXSRC_P3, -#if defined(PCBARM) +#if defined(PCBSKY9X) MIXSRC_REa, -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) MIXSRC_REa, MIXSRC_REb, #if defined(EXTRA_ROTARY_ENCODERS) @@ -270,7 +271,7 @@ enum MixSources { #define MODE_EXPO 0 #define MODE_CURVE 1 -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MAX_DELAY 60 /* 30 seconds */ #define MAX_SLOW 60 /* 30 seconds */ PACK(typedef struct t_MixData { @@ -317,7 +318,7 @@ PACK(typedef struct t_MixData { }) MixData; #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MAX_CSW_DURATION 120 /*60s*/ #define MAX_CSW_DELAY 120 /*60s*/ PACK(typedef struct t_CustomSwData { // Custom Switches data @@ -353,7 +354,7 @@ enum Functions { #if !defined(PCBSTD) FUNC_LOGS, #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) FUNC_VOLUME, #endif FUNC_BACKLIGHT, @@ -363,7 +364,7 @@ enum Functions { FUNC_MAX }; -#if defined(PCBARM) +#if defined(PCBSKY9X) PACK(typedef struct t_FuncSwData { // Function Switches data int8_t swtch; //input uint8_t func; @@ -470,7 +471,7 @@ enum VarioSource { VARIO_SOURCE_LAST = VARIO_SOURCE_A2, }; -#if defined(PCBARM) +#if defined(PCBSKY9X) PACK(typedef struct t_FrSkyBarData { uint8_t source; uint8_t barMin; // minimum for bar display @@ -499,7 +500,7 @@ enum FrskySource { FRSKY_SOURCE_CELLS, }; -#if defined(PCBARM) +#if defined(PCBSKY9X) PACK(typedef struct t_FrSkyData { FrSkyChannelData channels[2]; FrSkyRSSIAlarm rssiAlarms[2]; @@ -566,12 +567,12 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data #define ROTARY_ENCODER_MAX 1024 -#if defined(PCBARM) +#if defined(PCBSKY9X) #define NUM_ROTARY_ENCODERS_EXTRA 0 #define NUM_ROTARY_ENCODERS 1 #define ROTARY_ENCODER_ARRAY_EXTRA #define ROTARY_ENCODER_ARRAY int16_t rotaryEncoders[1]; -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #if defined(EXTRA_ROTARY_ENCODERS) #define NUM_ROTARY_ENCODERS_EXTRA 2 #define NUM_ROTARY_ENCODERS (2+NUM_ROTARY_ENCODERS_EXTRA) @@ -604,7 +605,7 @@ PACK(typedef struct t_PhaseData { ROTARY_ENCODER_ARRAY }) PhaseData; -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MAX_MODELS 60 #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 #define MAX_PHASES 9 @@ -612,7 +613,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) || defined(M128) +#elif defined(PCBGRUVIN9X) || defined(M128) #define MAX_MODELS 30 #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 #define MAX_PHASES 5 @@ -632,7 +633,7 @@ PACK(typedef struct t_PhaseData { #define MAX_TIMERS 2 -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MAX_CURVES 16 #define NUM_POINTS 512 #define CURVTYPE int16_t @@ -687,13 +688,13 @@ enum Dsm2Variants { #define TELEMETRY_DATA FrSkyData frsky #endif -#if defined(PCBV4) || defined(PCBARM) +#if defined(PCBGRUVIN9X) || defined(PCBSKY9X) #define BeepANACenter uint16_t #else #define BeepANACenter uint8_t #endif -#if defined(PCBV4) || defined(PCBARM) +#if defined(PCBGRUVIN9X) || defined(PCBSKY9X) PACK(typedef struct t_TimerDataExtra { uint16_t remanent:1; uint16_t value:15; diff --git a/src/open9x.cpp b/src/open9x.cpp index a85c67fcd..4049c4438 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -33,7 +33,7 @@ #include "open9x.h" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MIXER_STACK_SIZE 500 #define MENUS_STACK_SIZE 2500 #define AUDIO_STACK_SIZE 500 @@ -73,7 +73,7 @@ const pm_uchar splashdata[] PROGMEM = { 'S','P','S',0, const pm_uchar * splash_lbm = splashdata+4; #endif -#if defined(PCBV4) || defined(PCBARM) || defined(M128) || defined(EXTSTD) +#if defined(PCBGRUVIN9X) || defined(PCBSKY9X) || defined(M128) || defined(EXTSTD) const pm_uchar asterisk_lbm[] PROGMEM = { #include "asterisk.lbm" }; @@ -84,7 +84,7 @@ const pm_uchar asterisk_lbm[] PROGMEM = { EEGeneral g_eeGeneral; ModelData g_model; -#if !defined(PCBARM) +#if !defined(PCBSKY9X) uint8_t g_tmr1Latency_max; uint8_t g_tmr1Latency_min; #endif @@ -92,11 +92,11 @@ uint8_t g_tmr1Latency_min; uint8_t unexpectedShutdown = 0; uint16_t g_timeMainMax; -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) uint8_t g_timeMainLast; #endif -#if defined(AUDIO) && !defined(PCBARM) +#if defined(AUDIO) && !defined(PCBSKY9X) audioQueue audio; #endif @@ -451,7 +451,7 @@ void applyExpos(int16_t *anas) } } -#if !defined(PCBARM) +#if !defined(PCBSKY9X) int16_t calc100toRESX(int8_t x) { // return (int16_t)x*10 + x/4 - x/64; @@ -528,7 +528,7 @@ int16_t getValue(uint8_t i) /*srcRaw is shifted +1!*/ if(idelay) { if (result) { if (delays[cs_idx] > get_tmr10ms()) @@ -772,7 +772,7 @@ bool __getSwitch(int8_t swtch) bool getSwitch(int8_t swtch, bool nc) { -#if defined(PCBARM) +#if defined(PCBSKY9X) s_last_switch_used = 0; s_last_switch_value = 0; s_default_switch_value = nc; @@ -925,7 +925,7 @@ void incRotaryEncoder(uint8_t idx, int8_t inc) } #endif -#if defined(FRSKY) || defined(PCBARM) +#if defined(FRSKY) || defined(PCBSKY9X) void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att) { #ifdef IMPERIAL_UNITS @@ -956,7 +956,7 @@ void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t void clearKeyEvents() { -#if defined(PCBARM) +#if defined(PCBSKY9X) CoTickDelay(100); // 200ms #endif @@ -1031,7 +1031,7 @@ void doSplash() lcd_img(0, 0, splash_lbm, 0, 0); refreshDisplay(); -#if !defined(PCBARM) +#if !defined(PCBSKY9X) AUDIO_TADA(); #endif @@ -1056,7 +1056,7 @@ void doSplash() #if defined(SIMU) if (!main_thread_running) return; sleep(1/*ms*/); -#elif defined(PCBARM) +#elif defined(PCBSKY9X) CoTickDelay(1); #endif getADC_filt(); @@ -1087,7 +1087,7 @@ void doSplash() void checkAll() { -#if !defined(PCBARM) +#if !defined(PCBSKY9X) checkLowEEPROM(); #endif @@ -1095,7 +1095,7 @@ void checkAll() checkSwitches(); } -#if !defined(PCBARM) +#if !defined(PCBSKY9X) void checkLowEEPROM() { if (g_eeGeneral.disableMemoryWarning) return; @@ -1219,7 +1219,7 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO { lcd_clear(); -#if defined(PCBV4) || defined(PCBARM) || defined(M128) || defined(EXTSTD) +#if defined(PCBGRUVIN9X) || defined(PCBSKY9X) || defined(M128) || defined(EXTSTD) lcd_img(2, 0, asterisk_lbm, 0, 0); #else lcd_putsAtt(0, 0, PSTR("(!)"), DBLSIZE); @@ -1264,7 +1264,7 @@ void checkTrims() bool thro = (idx==THR_STICK && g_model.thrTrim); if (thro) v = 4; // if throttle trim and trim trottle then step=4 int16_t after = (k&1) ? before + v : before - v; // positive = k&1 -#if defined(PCBARM) +#if defined(PCBSKY9X) uint8_t beepTrim = 0; #else bool beepTrim = false; @@ -1322,7 +1322,7 @@ void checkTrims() #endif } -#if defined(PCBARM) && defined(REVB) +#if defined(PCBSKY9X) && defined(REVB) uint16_t Current_analogue; uint16_t Current_max; uint32_t Current_accumulator; @@ -1339,7 +1339,7 @@ static uint16_t s_anaFilt[NUMBER_ANALOG]; #if defined(SIMU) uint16_t BandGap = 225; -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) // #define STARTADCONV (ADCSRA = (1< only phone jack = slave mode -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) return SLAVE_MODE; #else static bool lastSlaveMode = false; @@ -1863,7 +1863,7 @@ PLAY_FUNCTION(playValue, uint8_t idx) } #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) static uint8_t currentSpeakerVolume = 255; uint8_t requiredSpeakerVolume; #endif @@ -1949,7 +1949,7 @@ void evalFunctions() } #endif -#if defined(PCBARM) && defined(SDCARD) +#if defined(PCBSKY9X) && defined(SDCARD) else if (sd->func == FUNC_PLAY_TRACK) { if (IS_PLAYING(i+1)) { switch_mask = 0; @@ -2323,11 +2323,11 @@ inline void doMixerCalculations(tmr10ms_t tmr10ms, uint8_t tick10ms) getADC_single() ; } -#if defined(PCBARM) && defined(REVB) && !defined(SIMU) +#if defined(PCBSKY9X) && defined(REVB) && !defined(SIMU) Current_analogue = ( Current_analogue * 31 + s_anaFilt[8] ) >> 5 ; if (Current_analogue > Current_max) Current_max = Current_analogue ; -#elif defined(PCBV4) && !defined(SIMU) +#elif defined(PCBGRUVIN9X) && !defined(SIMU) // For PCB V4, use our own 1.2V, external reference (connected to ADC3) ADCSRB &= ~(1<PIO_PDR = PIO_PC22 ; // Disable bit C22 Assign to peripheral } else { PIOC->PIO_PER = PIO_PC22 ; // Enable bit C22 as input } -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) // PPM signal on phono-jack. In or out? ... if(checkSlaveMode()) { PORTG |= (1<50) { AUDIO_TX_BATTERY_LOW(); } -#if defined(PCBARM) - else if (temperature >= g_eeGeneral.temperatureWarn+80) { +#if defined(PCBSKY9X) + else if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) { AUDIO_TX_TEMP_HIGH(); } else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.currentCalib)/8192/36) / 500 >= g_eeGeneral.mAhWarn) { @@ -2798,10 +2798,10 @@ void perMain() int16_t g_ppmIns[8]; uint8_t ppmInState = 0; //0=unsync 1..8= wait for value i-1 -#if !defined(SIMU) && !defined(PCBARM) +#if !defined(SIMU) && !defined(PCBSKY9X) volatile uint8_t g_tmr16KHz; //continuous timer 16ms (16MHz/1024/256) -- 8-bit counter overflow -#if defined (PCBV4) +#if defined (PCBGRUVIN9X) ISR(TIMER2_OVF_vect) #else ISR(TIMER0_OVF_vect) // TODO now NOBLOCK in er9x @@ -2817,7 +2817,7 @@ uint16_t getTmr16KHz() { while(1){ uint8_t hb = g_tmr16KHz; -#if defined (PCBV4) +#if defined (PCBGRUVIN9X) uint8_t lb = TCNT2; #else uint8_t lb = TCNT0; @@ -2826,7 +2826,7 @@ uint16_t getTmr16KHz() } } -#if defined (PCBV4) +#if defined (PCBGRUVIN9X) ISR(TIMER5_COMPA_vect, ISR_NOBLOCK) // mixer interrupt { cli(); @@ -2863,7 +2863,7 @@ ISR(TIMER5_COMPA_vect, ISR_NOBLOCK) // mixer interrupt } #endif -#if defined (PCBV4) +#if defined (PCBGRUVIN9X) ISR(TIMER2_COMPA_vect, ISR_NOBLOCK) //10ms timer #else // Clocks every 64 uS @@ -2872,7 +2872,7 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer { cli(); -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) TIMSK2 &= ~(1< 0) { @@ -3044,7 +3044,7 @@ FORCEINLINE void FRSKY_USART0_vect() } #endif -#if defined (DSM2_SERIAL) && !defined(PCBARM) +#if defined (DSM2_SERIAL) && !defined(PCBSKY9X) FORCEINLINE void DSM2_USART0_vect() { UDR0 = *((uint16_t*)pulses2MHzRPtr); @@ -3056,7 +3056,7 @@ FORCEINLINE void DSM2_USART0_vect() } #endif -#if !defined(SIMU) && !defined(PCBARM) +#if !defined(SIMU) && !defined(PCBSKY9X) #if defined (FRSKY) or defined(DSM2_SERIAL) ISR(USART0_UDRE_vect) { @@ -3134,7 +3134,7 @@ void moveTrimsToOffsets() // copy state of 3 primary to subtrim AUDIO_WARNING2(); } -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) void saveTimers() { for (uint8_t i=0; iPWM_CH_NUM[0].PWM_CDTYUPD = g_eeGeneral.backlightBright; #elif defined(VOICE) SET_VOLUME(g_eeGeneral.speakerVolume+7); #endif -#if defined(PCBARM) && defined(BLUETOOTH) +#if defined(PCBSKY9X) && defined(BLUETOOTH) btInit(); #endif +#if defined(RTCLOCK) + rtc_init(); +#endif + if (g_eeGeneral.backlightMode != e_backlight_mode_off) backlightOn(); // on Tx start turn the light on if (UNEXPECTED_SHUTDOWN()) { @@ -3237,7 +3241,7 @@ inline void open9xInit(OPEN9X_INIT_ARGS) else { doSplash(); -#if defined(PCBARM) && defined(SDCARD) +#if defined(PCBSKY9X) && defined(SDCARD) for (int i=0; i<500 && !Card_initialized; i++) { CoTickDelay(1); // 2ms } @@ -3247,22 +3251,17 @@ inline void open9xInit(OPEN9X_INIT_ARGS) checkAlarm(); } -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) if (!g_eeGeneral.unexpectedShutdown) { g_eeGeneral.unexpectedShutdown = 1; eeDirty(EE_GENERAL); } #endif -#if defined(PCBARM) - rtc_init(); - CoTickDelay(10); // 20ms - rtc_init(); -#endif lcdSetContrast(); backlightOn(); -#if defined(PCBARM) +#if defined(PCBSKY9X) start_ppm_capture(); // TODO inside startPulses? s_pulses_paused = false; @@ -3276,7 +3275,7 @@ inline void open9xInit(OPEN9X_INIT_ARGS) } } -#if defined(PCBARM) +#if defined(PCBSKY9X) void mixerTask(void * pdata) { s_pulses_paused = true; @@ -3369,7 +3368,7 @@ int main(void) // important to disable it before commencing with system initialisation (or // we could put a bunch more wdt_reset()s in. But I don't like that approach // during boot up.) -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) uint8_t mcusr = MCUSR; // save the WDT (etc) flags MCUSR = 0; // must be zeroed before disabling the WDT #elif defined(PCBSTD) @@ -3383,7 +3382,7 @@ int main(void) lcd_init(); -#if !defined(PCBARM) +#if !defined(PCBSKY9X) // Init Stack while interrupts are disabled #define STACKPTR _SFR_IO16(0x3D) { @@ -3435,11 +3434,11 @@ int main(void) init_rotary_sw(); #endif -#if !defined(PCBARM) +#if !defined(PCBSKY9X) open9xInit(mcusr); #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) if (check_soft_power() == e_power_usb) { soft_power_off(); // Only turn power off if necessary @@ -3488,12 +3487,12 @@ int main(void) CoStartOS(); #else -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) uint8_t shutdown_state = 0; #endif while(1) { -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) if ((shutdown_state=check_soft_power()) > e_power_trainer) break; #endif @@ -3514,9 +3513,9 @@ int main(void) if (t0 > g_timeMainMax) g_timeMainMax = t0; #endif } -#endif // PCBARM +#endif // PCBSKY9X -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) // Time to switch off lcd_clear() ; displayPopup(STR_SHUTDOWN); diff --git a/src/open9x.h b/src/open9x.h index 376b2aa73..1975d5397 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -50,15 +50,15 @@ #define WDT_RESET_STOCK() #endif -#if defined(PCBARM) -#include "board_ersky9x.h" -#elif defined(PCBV4) +#if defined(PCBSKY9X) +#include "board_sky9x.h" +#elif defined(PCBGRUVIN9X) #include "board_gruvin9x.h" #endif #if defined(SIMU) #include "simpgmspace.h" -#elif defined(PCBARM) +#elif defined(PCBSKY9X) typedef const unsigned char pm_uchar; typedef const char pm_char; typedef const uint16_t pm_uint16_t; @@ -93,7 +93,7 @@ extern void board_init(); #define PPM_CENTER 1500 -#if defined(PCBARM) +#if defined(PCBSKY9X) #include "eeprom_arm.h" #include "pulses_arm.h" #else @@ -127,7 +127,7 @@ extern uint8_t s_bind_allowed; #if !defined(SIMU) #define assert(x) -#if !defined(PCBARM) || !defined(DEBUG) +#if !defined(PCBSKY9X) || !defined(DEBUG) #define printf printf_not_allowed #endif #endif @@ -180,7 +180,7 @@ extern uint8_t s_bind_allowed; #define OUT_C_LCD_RES 2 #define OUT_C_LCD_CS1 1 -#if defined (PCBV4) +#if defined (PCBGRUVIN9X) # define INP_L_SPARE6 7 # define INP_L_SPARE5 6 @@ -295,9 +295,9 @@ extern uint8_t s_bind_allowed; #define DBLKEYS_PRESSED_RGT_UP(i) ((in & ((1<TC_CHANNEL[0].TC_CV; } #else uint16_t getTmr16KHz(); @@ -685,7 +685,7 @@ extern uint8_t s_eeDirtyMsk; extern void backlightOn(); -#if defined (PCBARM) +#if defined (PCBSKY9X) #define __BACKLIGHT_ON (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.backlightBright) #define __BACKLIGHT_OFF (PWM->PWM_CH_NUM[0].PWM_CDTY = 100) #ifdef REVB @@ -695,7 +695,7 @@ extern void backlightOn(); extern uint16_t Analog_values[NUMBER_ANALOG] ; void read_9_adc(void ) ; #endif -#elif defined (PCBV4) +#elif defined (PCBGRUVIN9X) #define SPEAKER_ON TCCR0A |= (1 << COM0A0) #define SPEAKER_OFF TCCR0A &= ~(1 << COM0A0) #define __BACKLIGHT_ON PORTC |= (1 << OUT_C_LIGHT) @@ -720,9 +720,9 @@ void read_9_adc(void ) ; #define BUZZER_OFF PORTE &= ~(1 << OUT_E_BUZZER) #if defined(HAPTIC) -#if defined(PCBARM) +#if defined(PCBSKY9X) #define HAPTIC_OFF hapticOff() -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #define HAPTIC_ON PORTD &= ~(1 << INP_D_HAPTIC) #define HAPTIC_OFF PORTD |= (1 << INP_D_HAPTIC) #else @@ -752,7 +752,7 @@ template FORCEINLINE t limit(t mi, t x, t ma) { return min(max(mi,x),ma uint16_t isqrt32(uint32_t n); #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #if !defined(SIMU) extern "C" { #include @@ -769,7 +769,7 @@ inline void resumeMixerCalculations() { CoLeaveMutexSection(mixerMutex); } -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) inline void pauseMixerCalculations() { cli(); @@ -788,7 +788,7 @@ inline void resumeMixerCalculations() #define resumeMixerCalculations() #endif -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) void saveTimers(); #else #define saveTimers() @@ -805,7 +805,7 @@ void generalDefault(); void modelDefault(uint8_t id); void resetProto(); -#if defined(PCBARM) +#if defined(PCBSKY9X) inline int32_t calc100toRESX(register int8_t x) { return ((uint32_t)x*655)>>6 ; @@ -833,7 +833,7 @@ extern int16_t calc1000toRESX(int16_t x); extern int16_t calcRESXto1000(int16_t x); #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) // This doesn't need protection on this processor #define tmr10ms_t uint32_t extern volatile tmr10ms_t g_tmr10ms; @@ -907,7 +907,7 @@ extern void incSubtrim(uint8_t idx, int16_t inc); extern void instantTrim(); extern void moveTrimsToOffsets(); -#if defined(PCBARM) +#if defined(PCBSKY9X) #define ACTIVE_EXPOS_TYPE uint32_t #define ACTIVE_MIXES_TYPE uint64_t #else @@ -932,7 +932,7 @@ inline bool isMixActive(uint8_t mix) #define isMixActive(x) false #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MASK_FSW_TYPE uint32_t // current max = 32 function switches #else #define MASK_FSW_TYPE uint16_t // current max = 16 function switches @@ -952,7 +952,7 @@ extern char userDataDisplayBuf[TELEM_SCREEN_BUFFER_SIZE]; // text buffer for frs #if defined(ROTARY_ENCODERS) // Global rotary encoder registers -- 8-bit, 0-255 -#if defined(PCBARM) +#if defined(PCBSKY9X) extern volatile uint32_t g_rotenc[ROTARY_ENCODERS]; #else extern volatile uint8_t g_rotenc[ROTARY_ENCODERS]; @@ -994,7 +994,7 @@ extern uint16_t jeti_keys; enum AUDIO_SOUNDS { AU_INACTIVITY, AU_TX_BATTERY_LOW, -#if defined(PCBARM) +#if defined(PCBSKY9X) AU_TX_MAH_HIGH, AU_TX_TEMP_HIGH, #endif @@ -1013,7 +1013,7 @@ enum AUDIO_SOUNDS { AU_WARNING2, AU_WARNING3, AU_TRIM_MIDDLE, -#if defined(PCBARM) +#if defined(PCBSKY9X) AU_TRIM_END, #endif AU_TADA, @@ -1046,8 +1046,8 @@ enum AUDIO_SOUNDS { }; #if defined(AUDIO) -#if defined(PCBARM) -#include "ersky9x/audio.h" +#if defined(PCBSKY9X) +#include "sky9x/audio.h" #else #include "stock/audio.h" #endif @@ -1059,7 +1059,7 @@ enum AUDIO_SOUNDS { #include "stock/voice.h" #endif -#if defined(PCBV4) && defined(VOICE) +#if defined(PCBGRUVIN9X) && defined(VOICE) #include "gruvin9x/somo14d.h" #endif @@ -1083,7 +1083,7 @@ union ReusableBuffer { /* 128 bytes on stock */ -#if !defined(PCBARM) +#if !defined(PCBSKY9X) uint8_t eefs_buffer[BLOCKS]; // used by EeFsck #endif @@ -1118,7 +1118,7 @@ extern union ReusableBuffer reusableBuffer; void checkFlashOnBeep(); -#if defined(FRSKY) || defined(PCBARM) +#if defined(FRSKY) || defined(PCBSKY9X) void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att); #endif diff --git a/src/pulses_avr.cpp b/src/pulses_avr.cpp index b61119ae4..e148c565b 100644 --- a/src/pulses_avr.cpp +++ b/src/pulses_avr.cpp @@ -61,7 +61,7 @@ void set_timer3_ppm( void ) ; void startPulses() { -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #if defined(DSM2_SERIAL) if (g_model.protocol != PROTO_DSM2) #endif @@ -115,7 +115,7 @@ ISR(TIMER1_COMPA_vect) //2MHz pulse generation (BLOCKING ISR) else #endif { -#if !defined(PCBV4) +#if !defined(PCBGRUVIN9X) // Original bitbang for PPM if (s_current_protocol != PROTO_NONE) { if (pulsePol) { @@ -128,7 +128,7 @@ ISR(TIMER1_COMPA_vect) //2MHz pulse generation (BLOCKING ISR) } } #else - // PCBV4 zero jitter hardware toggled PPM_out + // PCBGRUVIN9X zero jitter hardware toggled PPM_out OCR1B = *((uint16_t*)pulses2MHzRPtr); // duplicate capture (Timer1 in CTC mode, so restricted to OCR1A for int vector) // Toggle bit: Can't read PPM_OUT I/O pin when OC1B is connected (on the ATmega2560 -- can on ATmega64A!) @@ -152,7 +152,7 @@ ISR(TIMER1_COMPA_vect) //2MHz pulse generation (BLOCKING ISR) pulsePol = g_model.pulsePol; -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) TIMSK1 &= ~(1<PIO_PDSR &= ~0x00004000; PIOC->PIO_PDSR |= 0x00000800; -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) ping |= (1<PIO_PDSR |= 0x00004800; -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) ping &= ~(1<PIO_PDSR &= ~0x00000800; PIOC->PIO_PDSR |= 0x00004000; -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) ping &= ~(1< #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) FATFS g_FATFS_Obj; #endif @@ -412,7 +412,7 @@ FRESULT f_getcwd (TCHAR *path, UINT sz_path) return FR_OK; } -#if defined(PCBARM) +#if defined(PCBSKY9X) int32_t Card_state = SD_ST_MOUNTED; uint32_t Card_CSD[4]; // TODO elsewhere #endif diff --git a/src/simpgmspace.h b/src/simpgmspace.h index 19b307fb8..e5b8cf777 100644 --- a/src/simpgmspace.h +++ b/src/simpgmspace.h @@ -96,7 +96,7 @@ typedef const int16_t pm_int16_t; typedef const int8_t pm_int8_t; extern sem_t *eeprom_write_sem; -#if defined(PCBARM) +#if defined(PCBSKY9X) extern Pio Pioa, Piob, Pioc; extern Twi Twio; extern Dacc dacc; @@ -263,7 +263,7 @@ extern void rxPdcUsart( void (*pChProcess)(uint8_t x) ); #define UPE0 0 #define FE0 0 -#if defined(PCBARM) +#if defined(PCBSKY9X) extern volatile uint32_t Tenms; extern uint32_t Master_frequency; #define NVIC_EnableIRQ(x) diff --git a/src/simu.cpp b/src/simu.cpp index 14291b085..44504f78e 100644 --- a/src/simu.cpp +++ b/src/simu.cpp @@ -269,7 +269,7 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*) KEY_Left, INP_B_KEY_LFT, INP_L_KEY_LFT, (uint64_t)PIOC, ERSKY9X_LEFT_MASK, }; -#if defined(PCBARM) +#if defined(PCBSKY9X) PIOC->PIO_PDSR |= ERSKY9X_DOWN_MASK | ERSKY9X_UP_MASK | ERSKY9X_RIGHT_MASK | ERSKY9X_LEFT_MASK ; ERSKY9X_EXIT_PIO->PIO_PDSR |= ERSKY9X_EXIT_MASK; PIOB->PIO_PDSR |= ERSKY9X_MENU_MASK; @@ -277,7 +277,7 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*) temperature = 67; maxTemperature = 70; -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) uint8_t pin = (pinl & ~0x3f); #else uint8_t pin = (pinb & ~0x7e); @@ -285,9 +285,9 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*) for(unsigned i=0; igetKeyState(keys1[i])) { -#if defined(PCBARM) +#if defined(PCBSKY9X) ((Pio*)keys1[i+3])->PIO_PDSR &= ~(keys1[i+4]); -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) pin |= (1<PIO_PDSR |= (0x00800000 | 0x01000000 | 0x00000002 | 0x00000001); PIOB->PIO_PDSR |= (0x00000010); PIOC->PIO_PDSR |= (0x10000000 | 0x00000400 | 0x00000200); -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) pinj = 0; #else pind = 0; #endif for(unsigned i=0; igetKeyState(keys2[i])) { -#if defined(PCBARM) +#if defined(PCBSKY9X) switch(i) { case 6: PIOA->PIO_PDSR &= ~0x00800000; @@ -348,7 +348,7 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*) PIOC->PIO_PDSR &= ~0x00000200; break; } -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) pinj |= (1<PIO_PDSR, 20, 0 }, { KEY_6, PIOA->PIO_PDSR, 2, 0 }, { KEY_2, PIOA->PIO_PDSR, 15, 0 }, @@ -381,7 +381,7 @@ long Open9xSim::onTimeout(FXObject*,FXSelector,void*) { KEY_7, PIOC->PIO_PDSR, 16, 0 }, { KEY_8, PIOC->PIO_PDSR, 8, 0 } }; #else -#if defined(PCBV4) || defined(JETI) || defined(FRSKY) || defined(NMEA) || defined(ARDUPILOT) +#if defined(PCBGRUVIN9X) || defined(JETI) || defined(FRSKY) || defined(NMEA) || defined(ARDUPILOT) { KEY_1, pinc, INP_C_ThrCt, 0 }, { KEY_6, pinc, INP_C_AileDR, 0 }, #else @@ -437,9 +437,9 @@ void Open9xSim::refreshDiplay() { if (lcd_refresh) { lcd_refresh = false; -#if defined(PCBARM) +#if defined(PCBSKY9X) if (PWM->PWM_CH_NUM[0].PWM_CDTY != 100) -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) if (portc & 1<TWI_CR = TWI_CR_MSEN | TWI_CR_SVDIS ; // Master mode enable TWI0->TWI_MMR = 0x002F0000 ; // Device 5E (>>1) and master is writing NVIC_EnableIRQ(TWI0_IRQn) ; - setVolume(2) ; } static int8_t Volume_required ; diff --git a/src/ersky9x/sound_driver.h b/src/sky9x/sound_driver.h similarity index 100% rename from src/ersky9x/sound_driver.h rename to src/sky9x/sound_driver.h diff --git a/src/ersky9x/syscalls.c b/src/sky9x/syscalls.c similarity index 100% rename from src/ersky9x/syscalls.c rename to src/sky9x/syscalls.c diff --git a/src/ersky9x/usb/common/core/USBConfigurationDescriptor.c b/src/sky9x/usb/common/core/USBConfigurationDescriptor.c similarity index 100% rename from src/ersky9x/usb/common/core/USBConfigurationDescriptor.c rename to src/sky9x/usb/common/core/USBConfigurationDescriptor.c diff --git a/src/ersky9x/usb/common/core/USBConfigurationDescriptor.h b/src/sky9x/usb/common/core/USBConfigurationDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBConfigurationDescriptor.h rename to src/sky9x/usb/common/core/USBConfigurationDescriptor.h diff --git a/src/ersky9x/usb/common/core/USBDeviceDescriptor.h b/src/sky9x/usb/common/core/USBDeviceDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBDeviceDescriptor.h rename to src/sky9x/usb/common/core/USBDeviceDescriptor.h diff --git a/src/ersky9x/usb/common/core/USBDeviceQualifierDescriptor.h b/src/sky9x/usb/common/core/USBDeviceQualifierDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBDeviceQualifierDescriptor.h rename to src/sky9x/usb/common/core/USBDeviceQualifierDescriptor.h diff --git a/src/ersky9x/usb/common/core/USBEndpointDescriptor.c b/src/sky9x/usb/common/core/USBEndpointDescriptor.c similarity index 100% rename from src/ersky9x/usb/common/core/USBEndpointDescriptor.c rename to src/sky9x/usb/common/core/USBEndpointDescriptor.c diff --git a/src/ersky9x/usb/common/core/USBEndpointDescriptor.h b/src/sky9x/usb/common/core/USBEndpointDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBEndpointDescriptor.h rename to src/sky9x/usb/common/core/USBEndpointDescriptor.h diff --git a/src/ersky9x/usb/common/core/USBFeatureRequest.c b/src/sky9x/usb/common/core/USBFeatureRequest.c similarity index 100% rename from src/ersky9x/usb/common/core/USBFeatureRequest.c rename to src/sky9x/usb/common/core/USBFeatureRequest.c diff --git a/src/ersky9x/usb/common/core/USBFeatureRequest.h b/src/sky9x/usb/common/core/USBFeatureRequest.h similarity index 100% rename from src/ersky9x/usb/common/core/USBFeatureRequest.h rename to src/sky9x/usb/common/core/USBFeatureRequest.h diff --git a/src/ersky9x/usb/common/core/USBGenericDescriptor.c b/src/sky9x/usb/common/core/USBGenericDescriptor.c similarity index 100% rename from src/ersky9x/usb/common/core/USBGenericDescriptor.c rename to src/sky9x/usb/common/core/USBGenericDescriptor.c diff --git a/src/ersky9x/usb/common/core/USBGenericDescriptor.h b/src/sky9x/usb/common/core/USBGenericDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBGenericDescriptor.h rename to src/sky9x/usb/common/core/USBGenericDescriptor.h diff --git a/src/ersky9x/usb/common/core/USBGenericRequest.c b/src/sky9x/usb/common/core/USBGenericRequest.c similarity index 100% rename from src/ersky9x/usb/common/core/USBGenericRequest.c rename to src/sky9x/usb/common/core/USBGenericRequest.c diff --git a/src/ersky9x/usb/common/core/USBGenericRequest.h b/src/sky9x/usb/common/core/USBGenericRequest.h similarity index 100% rename from src/ersky9x/usb/common/core/USBGenericRequest.h rename to src/sky9x/usb/common/core/USBGenericRequest.h diff --git a/src/ersky9x/usb/common/core/USBGetDescriptorRequest.c b/src/sky9x/usb/common/core/USBGetDescriptorRequest.c similarity index 100% rename from src/ersky9x/usb/common/core/USBGetDescriptorRequest.c rename to src/sky9x/usb/common/core/USBGetDescriptorRequest.c diff --git a/src/ersky9x/usb/common/core/USBGetDescriptorRequest.h b/src/sky9x/usb/common/core/USBGetDescriptorRequest.h similarity index 100% rename from src/ersky9x/usb/common/core/USBGetDescriptorRequest.h rename to src/sky9x/usb/common/core/USBGetDescriptorRequest.h diff --git a/src/ersky9x/usb/common/core/USBInterfaceAssociationDescriptor.h b/src/sky9x/usb/common/core/USBInterfaceAssociationDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBInterfaceAssociationDescriptor.h rename to src/sky9x/usb/common/core/USBInterfaceAssociationDescriptor.h diff --git a/src/ersky9x/usb/common/core/USBInterfaceDescriptor.h b/src/sky9x/usb/common/core/USBInterfaceDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBInterfaceDescriptor.h rename to src/sky9x/usb/common/core/USBInterfaceDescriptor.h diff --git a/src/ersky9x/usb/common/core/USBInterfaceRequest.c b/src/sky9x/usb/common/core/USBInterfaceRequest.c similarity index 100% rename from src/ersky9x/usb/common/core/USBInterfaceRequest.c rename to src/sky9x/usb/common/core/USBInterfaceRequest.c diff --git a/src/ersky9x/usb/common/core/USBInterfaceRequest.h b/src/sky9x/usb/common/core/USBInterfaceRequest.h similarity index 100% rename from src/ersky9x/usb/common/core/USBInterfaceRequest.h rename to src/sky9x/usb/common/core/USBInterfaceRequest.h diff --git a/src/ersky9x/usb/common/core/USBIrqHandler.c b/src/sky9x/usb/common/core/USBIrqHandler.c similarity index 100% rename from src/ersky9x/usb/common/core/USBIrqHandler.c rename to src/sky9x/usb/common/core/USBIrqHandler.c diff --git a/src/ersky9x/usb/common/core/USBIrqHandler.h b/src/sky9x/usb/common/core/USBIrqHandler.h similarity index 100% rename from src/ersky9x/usb/common/core/USBIrqHandler.h rename to src/sky9x/usb/common/core/USBIrqHandler.h diff --git a/src/ersky9x/usb/common/core/USBSetAddressRequest.c b/src/sky9x/usb/common/core/USBSetAddressRequest.c similarity index 100% rename from src/ersky9x/usb/common/core/USBSetAddressRequest.c rename to src/sky9x/usb/common/core/USBSetAddressRequest.c diff --git a/src/ersky9x/usb/common/core/USBSetAddressRequest.h b/src/sky9x/usb/common/core/USBSetAddressRequest.h similarity index 100% rename from src/ersky9x/usb/common/core/USBSetAddressRequest.h rename to src/sky9x/usb/common/core/USBSetAddressRequest.h diff --git a/src/ersky9x/usb/common/core/USBSetConfigurationRequest.c b/src/sky9x/usb/common/core/USBSetConfigurationRequest.c similarity index 100% rename from src/ersky9x/usb/common/core/USBSetConfigurationRequest.c rename to src/sky9x/usb/common/core/USBSetConfigurationRequest.c diff --git a/src/ersky9x/usb/common/core/USBSetConfigurationRequest.h b/src/sky9x/usb/common/core/USBSetConfigurationRequest.h similarity index 100% rename from src/ersky9x/usb/common/core/USBSetConfigurationRequest.h rename to src/sky9x/usb/common/core/USBSetConfigurationRequest.h diff --git a/src/ersky9x/usb/common/core/USBStringDescriptor.h b/src/sky9x/usb/common/core/USBStringDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/core/USBStringDescriptor.h rename to src/sky9x/usb/common/core/USBStringDescriptor.h diff --git a/src/ersky9x/usb/common/massstorage/MSDeviceDescriptor.h b/src/sky9x/usb/common/massstorage/MSDeviceDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/massstorage/MSDeviceDescriptor.h rename to src/sky9x/usb/common/massstorage/MSDeviceDescriptor.h diff --git a/src/ersky9x/usb/common/massstorage/MSInterfaceDescriptor.h b/src/sky9x/usb/common/massstorage/MSInterfaceDescriptor.h similarity index 100% rename from src/ersky9x/usb/common/massstorage/MSInterfaceDescriptor.h rename to src/sky9x/usb/common/massstorage/MSInterfaceDescriptor.h diff --git a/src/ersky9x/usb/device/core/USBD.h b/src/sky9x/usb/device/core/USBD.h similarity index 93% rename from src/ersky9x/usb/device/core/USBD.h rename to src/sky9x/usb/device/core/USBD.h index 588254bf8..7c1474582 100644 --- a/src/ersky9x/usb/device/core/USBD.h +++ b/src/sky9x/usb/device/core/USBD.h @@ -271,5 +271,20 @@ extern unsigned char USBD_IsHighSpeed(void); extern void USBD_Test(unsigned char bIndex); +/* USBD Callbacks */ + +#define USBDCallbacks_Reset() + +#define USBDCallbacks_Suspended() + +#define USBDCallbacks_Resumed() + +extern void USBDCallbacks_RequestReceived(const USBGenericRequest *request); + +extern void USBDDriverCallbacks_ConfigurationChanged(unsigned char cfgnum); + +extern void USBDDriverCallbacks_InterfaceSettingChanged(unsigned char interface, + unsigned char setting); + #endif //#ifndef USBD_H diff --git a/src/ersky9x/usb/device/core/USBDDriver.c b/src/sky9x/usb/device/core/USBDDriver.c similarity index 96% rename from src/ersky9x/usb/device/core/USBDDriver.c rename to src/sky9x/usb/device/core/USBDDriver.c index d44adab66..e8315702b 100644 --- a/src/ersky9x/usb/device/core/USBDDriver.c +++ b/src/sky9x/usb/device/core/USBDDriver.c @@ -32,7 +32,6 @@ //------------------------------------------------------------------------------ #include "USBDDriver.h" -#include "USBDDriverCallbacks.h" #include "USBD.h" #include #include "debug.h" @@ -370,7 +369,7 @@ static void SetInterface( if (pDriver->pInterfaces[infnum] != setting) { pDriver->pInterfaces[infnum] = setting; - USBDDriverCallbacks_InterfaceSettingChanged(infnum, setting); + // USBDDriverCallbacks_InterfaceSettingChanged(infnum, setting); } // Acknowledge the request diff --git a/src/ersky9x/usb/device/core/USBDDriver.h b/src/sky9x/usb/device/core/USBDDriver.h similarity index 100% rename from src/ersky9x/usb/device/core/USBDDriver.h rename to src/sky9x/usb/device/core/USBDDriver.h diff --git a/src/ersky9x/usb/device/core/USBDDriverDescriptors.h b/src/sky9x/usb/device/core/USBDDriverDescriptors.h similarity index 100% rename from src/ersky9x/usb/device/core/USBDDriverDescriptors.h rename to src/sky9x/usb/device/core/USBDDriverDescriptors.h diff --git a/src/ersky9x/usb/device/core/USBD_UDP.c b/src/sky9x/usb/device/core/USBD_UDP.c similarity index 96% rename from src/ersky9x/usb/device/core/USBD_UDP.c rename to src/sky9x/usb/device/core/USBD_UDP.c index 93b4ec984..544f68596 100644 --- a/src/ersky9x/usb/device/core/USBD_UDP.c +++ b/src/sky9x/usb/device/core/USBD_UDP.c @@ -42,16 +42,11 @@ //------------------------------------------------------------------------------ #include "USBD.h" -#include "USBDCallbacks.h" #include -//#include #include "debug.h" -//#include -//#include #include #include - //------------------------------------------------------------------------------ // Local definitions //------------------------------------------------------------------------------ @@ -1713,7 +1708,7 @@ void USBD_Init(void) UDP->UDP_IER = UDP_IER_WAKEUP; // Configure interrupts - USBDCallbacks_Initialized(); + NVIC_EnableIRQ(UDP_IRQn); } //------------------------------------------------------------------------------ diff --git a/src/ersky9x/usb/device/massstorage/MSD.h b/src/sky9x/usb/device/massstorage/MSD.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSD.h rename to src/sky9x/usb/device/massstorage/MSD.h diff --git a/src/ersky9x/usb/device/massstorage/MSDDStateMachine.c b/src/sky9x/usb/device/massstorage/MSDDStateMachine.c similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDDStateMachine.c rename to src/sky9x/usb/device/massstorage/MSDDStateMachine.c diff --git a/src/ersky9x/usb/device/massstorage/MSDDStateMachine.h b/src/sky9x/usb/device/massstorage/MSDDStateMachine.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDDStateMachine.h rename to src/sky9x/usb/device/massstorage/MSDDStateMachine.h diff --git a/src/ersky9x/usb/device/massstorage/MSDDriver.c b/src/sky9x/usb/device/massstorage/MSDDriver.c similarity index 96% rename from src/ersky9x/usb/device/massstorage/MSDDriver.c rename to src/sky9x/usb/device/massstorage/MSDDriver.c index 1890f3308..4082bdd9e 100644 --- a/src/ersky9x/usb/device/massstorage/MSDDriver.c +++ b/src/sky9x/usb/device/massstorage/MSDDriver.c @@ -39,9 +39,7 @@ #include #include #include -#include #include -#include //----------------------------------------------------------------------------- // Internal variables diff --git a/src/ersky9x/usb/device/massstorage/MSDDriver.h b/src/sky9x/usb/device/massstorage/MSDDriver.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDDriver.h rename to src/sky9x/usb/device/massstorage/MSDDriver.h diff --git a/src/ersky9x/usb/device/massstorage/MSDDriverDescriptors.c b/src/sky9x/usb/device/massstorage/MSDDriverDescriptors.c similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDDriverDescriptors.c rename to src/sky9x/usb/device/massstorage/MSDDriverDescriptors.c diff --git a/src/ersky9x/usb/device/massstorage/MSDDriverDescriptors.h b/src/sky9x/usb/device/massstorage/MSDDriverDescriptors.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDDriverDescriptors.h rename to src/sky9x/usb/device/massstorage/MSDDriverDescriptors.h diff --git a/src/ersky9x/usb/device/massstorage/MSDIOFifo.h b/src/sky9x/usb/device/massstorage/MSDIOFifo.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDIOFifo.h rename to src/sky9x/usb/device/massstorage/MSDIOFifo.h diff --git a/src/ersky9x/usb/device/massstorage/MSDLun.c b/src/sky9x/usb/device/massstorage/MSDLun.c similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDLun.c rename to src/sky9x/usb/device/massstorage/MSDLun.c diff --git a/src/ersky9x/usb/device/massstorage/MSDLun.h b/src/sky9x/usb/device/massstorage/MSDLun.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/MSDLun.h rename to src/sky9x/usb/device/massstorage/MSDLun.h diff --git a/src/ersky9x/usb/device/massstorage/SBC.h b/src/sky9x/usb/device/massstorage/SBC.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/SBC.h rename to src/sky9x/usb/device/massstorage/SBC.h diff --git a/src/ersky9x/usb/device/massstorage/SBCMethods.c b/src/sky9x/usb/device/massstorage/SBCMethods.c similarity index 100% rename from src/ersky9x/usb/device/massstorage/SBCMethods.c rename to src/sky9x/usb/device/massstorage/SBCMethods.c diff --git a/src/ersky9x/usb/device/massstorage/SBCMethods.h b/src/sky9x/usb/device/massstorage/SBCMethods.h similarity index 100% rename from src/ersky9x/usb/device/massstorage/SBCMethods.h rename to src/sky9x/usb/device/massstorage/SBCMethods.h diff --git a/src/ersky9x/vectors_sam3s.c b/src/sky9x/vectors_sam3s.c similarity index 100% rename from src/ersky9x/vectors_sam3s.c rename to src/sky9x/vectors_sam3s.c diff --git a/src/statistics_views.cpp b/src/statistics_views.cpp index b3e67b283..a196f5f1f 100644 --- a/src/statistics_views.cpp +++ b/src/statistics_views.cpp @@ -79,7 +79,7 @@ void menuProcStatistic(uint8_t event) #endif } -#if defined(PCBARM) +#if defined(PCBSKY9X) #define MENU_DEBUG_COL_OFS (13*FW) #else #define MENU_DEBUG_COL_OFS (14*FW) @@ -89,7 +89,7 @@ void menuProcDebug(uint8_t event) TITLE(STR_MENUDEBUG); switch(event) { -#if defined(PCBARM) +#if defined(PCBSKY9X) case EVT_KEY_LONG(KEY_MENU): g_eeGeneral.mAhUsed = 0; g_eeGeneral.globalTimer = 0; @@ -97,13 +97,11 @@ void menuProcDebug(uint8_t event) Current_used = 0; sessionTimer = 0; killEvents(event); - rtc_init(); - CoTickDelay(5); AUDIO_KEYPAD_UP(); break; #endif case EVT_KEY_FIRST(KEY_MENU): -#if !defined(PCBARM) +#if !defined(PCBSKY9X) g_tmr1Latency_min = 0xff; g_tmr1Latency_max = 0; #endif @@ -119,7 +117,7 @@ void menuProcDebug(uint8_t event) break; } -#if !defined(PCBARM) +#if !defined(PCBSKY9X) lcd_putsLeft(1*FH, STR_TMR1LATMAXUS); lcd_outdez8(MENU_DEBUG_COL_OFS , 1*FH, g_tmr1Latency_max/2 ); lcd_putsLeft(2*FH, STR_TMR1LATMINUS); @@ -128,7 +126,7 @@ void menuProcDebug(uint8_t event) lcd_outdez8(MENU_DEBUG_COL_OFS , 3*FH, (g_tmr1Latency_max - g_tmr1Latency_min) /2 ); #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) lcd_putsLeft(5*FH, STR_TMAINMAXMS); lcd_outdezAtt(MENU_DEBUG_COL_OFS, 5*FH, (g_timeMainMax)/20, PREC2); #else @@ -136,9 +134,7 @@ void menuProcDebug(uint8_t event) lcd_outdezAtt(MENU_DEBUG_COL_OFS, 4*FH, (g_timeMainMax*100)/16, PREC2); #endif -#if defined(PCBARM) - lcd_putsLeft(1*FH, STR_COPROC); - lcd_outhex4(10*FW-3, 1*FH, (Coproc_valid << 8) + Coproc_read); +#if defined(PCBSKY9X) #if defined(REVB) lcd_putsLeft(2*FH, STR_CPU_CURRENT); putsTelemetryValue(MENU_DEBUG_COL_OFS, 2*FH, getCurrent(), UNIT_MILLIAMPS, 0); @@ -150,11 +146,11 @@ void menuProcDebug(uint8_t event) #endif lcd_putsLeft(4*FH, STR_CPU_TEMP); - putsTelemetryValue(MENU_DEBUG_COL_OFS, 4*FH, temperature, UNIT_DEGREES, 0); - putsTelemetryValue(20*FW+2, 4*FH, maxTemperature, UNIT_DEGREES, 0); + putsTelemetryValue(MENU_DEBUG_COL_OFS, 4*FH, getTemperature(), UNIT_DEGREES, 0); + putsTelemetryValue(20*FW+2, 4*FH, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_DEGREES, 0); #endif -#if !defined(PCBARM) +#if !defined(PCBSKY9X) lcd_puts( 0*FW, 5*FH, STR_FREESTACKMINB); lcd_outdezAtt(14*FW, 5*FH, stack_free(), UNSIGN) ; #endif diff --git a/src/stock/audio.cpp b/src/stock/audio.cpp index 83c2d4f58..2a2a19a44 100644 --- a/src/stock/audio.cpp +++ b/src/stock/audio.cpp @@ -57,7 +57,7 @@ void audioQueue::heartbeat() SPEAKER_OFF; } else { -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) if (toneFreq) { OCR0A = (5000 / toneFreq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?). SPEAKER_ON; @@ -84,7 +84,7 @@ void audioQueue::heartbeat() } else { if (tone2TimeLeft > 0) { -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) if (tone2Freq) { OCR0A = (5000 / tone2Freq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?). SPEAKER_ON; diff --git a/src/stock/audio.h b/src/stock/audio.h index 915784f2b..a31d82592 100644 --- a/src/stock/audio.h +++ b/src/stock/audio.h @@ -31,10 +31,6 @@ * */ -#if defined(PCBARM) -#include "ersky9x/sound.h" -#endif - #if defined(PCBSTD) #define SPEAKER_ON BUZZER_ON #define SPEAKER_OFF toneFreq=0; BUZZER_OFF diff --git a/src/translations.cpp b/src/translations.cpp index 4e40b29bd..7a44829d6 100644 --- a/src/translations.cpp +++ b/src/translations.cpp @@ -65,7 +65,7 @@ const pm_char STR_OPEN9X[] PROGMEM = ISTR(VFSWRESET) ISTR(FUNCSOUNDS) ISTR(VTELEMCHNS) -#if defined(FRSKY) || defined(PCBARM) +#if defined(FRSKY) || defined(PCBSKY9X) ISTR(VTELEMUNIT) ISTR(VALARM) ISTR(VALARMFN) @@ -87,7 +87,7 @@ const pm_char STR_OPEN9X[] PROGMEM = #if defined(DSM2) ISTR(DSM2MODE) #endif -#if defined(PCBV4) || defined (PCBARM) +#if defined(PCBGRUVIN9X) || defined (PCBSKY9X) ISTR(DATETIME) #endif ; @@ -233,7 +233,7 @@ const pm_char STR_EEPROMOVERFLOW[] PROGMEM = TR_EEPROMOVERFLOW; const pm_char STR_TRIMS2OFFSETS[] PROGMEM = TR_TRIMS2OFFSETS; const pm_char STR_MENURADIOSETUP[] PROGMEM = TR_MENURADIOSETUP; -#if defined(PCBV4) || defined(PCBARM) +#if defined(PCBGRUVIN9X) || defined(PCBSKY9X) const pm_char STR_MENUDATEANDTIME[] PROGMEM = TR_MENUDATEANDTIME; #endif @@ -300,18 +300,18 @@ const pm_char STR_LATITUDE[] PROGMEM = TR_LATITUDE; const pm_char STR_LONGITUDE[] PROGMEM = TR_LONGITUDE; #endif -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) const pm_char STR_SHUTDOWN[] PROGMEM = TR_SHUTDOWN; #endif const pm_char STR_BATT_CALIB[] PROGMEM = TR_BATT_CALIB; -#if defined(PCBARM) || defined(FRSKY) +#if defined(PCBSKY9X) || defined(FRSKY) const pm_char STR_VOLTAGE[] PROGMEM = TR_VOLTAGE; const pm_char STR_CURRENT[] PROGMEM = TR_CURRENT; #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) const pm_char STR_CURRENT_CALIB[] PROGMEM = TR_CURRENT_CALIB; #endif diff --git a/src/translations.h b/src/translations.h index 9c22a01df..c400a8ffc 100644 --- a/src/translations.h +++ b/src/translations.h @@ -92,7 +92,7 @@ extern const pm_char STR_OPEN9X[]; #define OFS_VFSWRESET (OFS_VFSWFUNC + sizeof(TR_VFSWFUNC)) #define OFS_FUNCSOUNDS (OFS_VFSWRESET + sizeof(TR_VFSWRESET)) #define OFS_VTELEMCHNS (OFS_FUNCSOUNDS + sizeof(TR_FUNCSOUNDS)) -#if defined(FRSKY) || defined(PCBARM) +#if defined(FRSKY) || defined(PCBSKY9X) #define OFS_VTELEMUNIT (OFS_VTELEMCHNS + sizeof(TR_VTELEMCHNS)) #define OFS_VALARM (OFS_VTELEMUNIT + sizeof(TR_VTELEMUNIT)) #define OFS_VALARMFN (OFS_VALARM + sizeof(TR_VALARM)) @@ -126,7 +126,7 @@ extern const pm_char STR_OPEN9X[]; #else #define OFS_ENDDSM2 (OFS_VTMRMODES + sizeof(TR_VTMRMODES)) #endif -#if defined(PCBV4) || defined (PCBARM) +#if defined(PCBGRUVIN9X) || defined (PCBSKY9X) #define OFS_DATETIME (OFS_ENDDSM2) #endif @@ -157,7 +157,7 @@ extern const pm_char STR_OPEN9X[]; #define STR_FUNCSOUNDS (STR_OPEN9X + OFS_FUNCSOUNDS) #define STR_VTELEMCHNS (STR_OPEN9X + OFS_VTELEMCHNS) -#if defined(FRSKY) || defined(PCBARM) +#if defined(FRSKY) || defined(PCBSKY9X) #define STR_VTELEMUNIT (STR_OPEN9X + OFS_VTELEMUNIT) #define STR_VALARM (STR_OPEN9X + OFS_VALARM) #define STR_VALARMFN (STR_OPEN9X + OFS_VALARMFN) @@ -190,7 +190,7 @@ extern const pm_char STR_OPEN9X[]; #define STR_VRENCODERS (STR_OPEN9X + OFS_VRENCODERS) #endif -#if defined(PCBV4) || defined(PCBARM) +#if defined(PCBGRUVIN9X) || defined(PCBSKY9X) #define STR_DATETIME (STR_OPEN9X + OFS_DATETIME) #endif @@ -374,18 +374,18 @@ extern const pm_char STR_LATITUDE[]; extern const pm_char STR_LONGITUDE[]; #endif -#if defined(PCBARM) || defined(PCBV4) +#if defined(PCBSKY9X) || defined(PCBGRUVIN9X) extern const pm_char STR_SHUTDOWN[]; #endif extern const pm_char STR_BATT_CALIB[]; -#if defined(PCBARM) || defined(FRSKY) +#if defined(PCBSKY9X) || defined(FRSKY) extern const pm_char STR_VOLTAGE[]; extern const pm_char STR_CURRENT[]; #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) extern const pm_char STR_CURRENT_CALIB[]; #define LEN_CALIB_FIELDS (PSIZE(TR_BATT_CALIB) > PSIZE(TR_CURRENT_CALIB) ? PSIZE(TR_BATT_CALIB) : PSIZE(TR_CURRENT_CALIB)) #else diff --git a/src/translations/cz.h b/src/translations/cz.h index 98c805117..024f1901b 100644 --- a/src/translations/cz.h +++ b/src/translations/cz.h @@ -36,7 +36,7 @@ #define TR_VTRIMINC "Exp ""ExJemn\212""Jemn\212 ""St\206edn\204""Hrub\212 " #define LEN_RETA123 "\001" -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #if defined(EXTRA_ROTARY_ENCODERS) #define TR_RETA123 "SVPK123abcd" #else //EXTRA_ROTARY_ENCODERS @@ -105,14 +105,14 @@ #define TR_PLAY_TRACK "[Hr\200t Stopu]\0" #define TR_PLAY_VALUE "[Hr\200t Hodn.]\0" #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #if defined(SDCARD) #define TR_SDCLOGS "Logov\200n\204 SD\0 " #else #define TR_SDCLOGS "[Logov\200n\204 SD]" #endif #define TR_FSW_VOLUME "Hlasitost\0 " -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #if defined(SDCARD) #define TR_SDCLOGS "Logování SD " #else @@ -184,18 +184,18 @@ #define TR_VRENCODERS "REa""REb" #define LEN_VSWITCHES "\003" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""CS1""CS2""CS3""CS4""CS5""CS6""CS7""CS8""CS9""CSA""CSB""CSC""CSD""CSE""CSF""CSG""CSH""CSI""CSJ""CSK""CSL""CSM""CSN""CSO""CSP""CSQ""CSR""CSS""CST""CSU""CSV""CSW""ZAP" #else #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""CS1""CS2""CS3""CS4""CS5""CS6""CS7""CS8""CS9""CSA""CSB""CSC""ZAP" #endif #define LEN_VSRCRAW "\004" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_ROTARY_ENCODERS_VSRCRAW "REa " -#elif defined(PCBV4) && defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb ""REc ""REd " -#elif defined(PCBV4) && !defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && !defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb " #else #define TR_ROTARY_ENCODERS_VSRCRAW @@ -332,7 +332,7 @@ #define STR_US (STR_TMR1LATMAXUS+12) #define TR_TMR1LATMINUS "Tmr1Lat min\003us" #define TR_TMR1JITTERUS "Tmr1 Jitter\003us" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_TMAINMAXMS "Tmain max\004ms" #else #define TR_TMAINMAXMS "Tmain max\005ms" diff --git a/src/translations/de.h b/src/translations/de.h index fddc20caa..412afe066 100644 --- a/src/translations/de.h +++ b/src/translations/de.h @@ -36,7 +36,7 @@ #define TR_VTRIMINC "Expo. ""X-Fein""Fein ""Mittel""Grob " #define LEN_RETA123 "\001" -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #if defined(EXTRA_ROTARY_ENCODERS) #define TR_RETA123 "RETA123abcd" #else //EXTRA_ROTARY_ENCODERS @@ -105,14 +105,14 @@ #define TR_PLAY_TRACK "[Play Track]\0" #define TR_PLAY_VALUE "[Play Value]\0" #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #if defined(SDCARD) #define TR_SDCLOGS "SDCARD Logs\0 " #else #define TR_SDCLOGS "[SDCARD Logs]" #endif #define TR_FSW_VOLUME "Volume\0 " -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #if defined(SDCARD) #define TR_SDCLOGS "SDcard Logs " #else @@ -184,18 +184,18 @@ #define TR_VRENCODERS "REa""REb" #define LEN_VSWITCHES "\003" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""SW1""SW2""SW3""SW4""SW5""SW6""SW7""SW8""SW9""SWA""SWB""SWC""SWD""SWE""SWF""SWG""SWH""SWI""SWJ""SWK""SWL""SWM""SWN""SWO""SWP""SWQ""SWR""SWS""SWT""SWU""SWV""SWW"" ON" #else #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""SW1""SW2""SW3""SW4""SW5""SW6""SW7""SW8""SW9""SWA""SWB""SWC"" ON" #endif #define LEN_VSRCRAW "\004" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_ROTARY_ENCODERS_VSRCRAW "REa " -#elif defined(PCBV4) && defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb ""REc ""REd " -#elif defined(PCBV4) && !defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && !defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb " #else #define TR_ROTARY_ENCODERS_VSRCRAW @@ -332,7 +332,7 @@ #define STR_US (STR_TMR1LATMAXUS+12) #define TR_TMR1LATMINUS "Tmr1Lat min\003us" #define TR_TMR1JITTERUS "Tmr1 Jitter\003us" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_TMAINMAXMS "Tmain max\004ms" #else #define TR_TMAINMAXMS "Tmain max\005ms" diff --git a/src/translations/en.h b/src/translations/en.h index a700db9ad..ba6c13cc6 100644 --- a/src/translations/en.h +++ b/src/translations/en.h @@ -36,7 +36,7 @@ #define TR_VTRIMINC "Exp ""ExFine""Fine ""Medium""Coarse" #define LEN_RETA123 "\001" -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #if defined(EXTRA_ROTARY_ENCODERS) #define TR_RETA123 "RETA123abcd" #else //EXTRA_ROTARY_ENCODERS @@ -105,14 +105,14 @@ #define TR_PLAY_TRACK "[Play Track]\0" #define TR_PLAY_VALUE "[Play Value]\0" #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #if defined(SDCARD) #define TR_SDCLOGS "SDCARD Logs\0 " #else #define TR_SDCLOGS "[SDCARD Logs]" #endif #define TR_FSW_VOLUME "Volume\0 " -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #if defined(SDCARD) #define TR_SDCLOGS "SDCARD Logs " #else @@ -185,18 +185,18 @@ #define TR_VRENCODERS "REa""REb" #define LEN_VSWITCHES "\003" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""CS1""CS2""CS3""CS4""CS5""CS6""CS7""CS8""CS9""CSA""CSB""CSC""CSD""CSE""CSF""CSG""CSH""CSI""CSJ""CSK""CSL""CSM""CSN""CSO""CSP""CSQ""CSR""CSS""CST""CSU""CSV""CSW"" ON" #else #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""CS1""CS2""CS3""CS4""CS5""CS6""CS7""CS8""CS9""CSA""CSB""CSC"" ON" #endif #define LEN_VSRCRAW "\004" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_ROTARY_ENCODERS_VSRCRAW "REa " -#elif defined(PCBV4) && defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb ""REc ""REd " -#elif defined(PCBV4) && !defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && !defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb " #else #define TR_ROTARY_ENCODERS_VSRCRAW @@ -333,7 +333,7 @@ #define STR_US (STR_TMR1LATMAXUS+12) #define TR_TMR1LATMINUS "Tmr1Lat min\003us" #define TR_TMR1JITTERUS "Tmr1 Jitter\003us" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_TMAINMAXMS "Tmain max\004ms" #else #define TR_TMAINMAXMS "Tmain max\005ms" diff --git a/src/translations/fr.h b/src/translations/fr.h index ef80340d0..1586f4b0f 100644 --- a/src/translations/fr.h +++ b/src/translations/fr.h @@ -36,7 +36,7 @@ #define TR_VTRIMINC "Expo ""ExFin ""Fin ""Moyen ""Gros " #define LEN_RETA123 "\001" -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #if defined(EXTRA_ROTARY_ENCODERS) #define TR_RETA123 "DPGA123abcd" #else //EXTRA_ROTARY_ENCODERS @@ -100,14 +100,14 @@ #define TR_PLAY_TRACK "[Jouer fich.]" #define TR_PLAY_VALUE "[Dire val.]\0 " #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #if defined(SDCARD) #define TR_SDCLOGS "Logs carte SD" #else #define TR_SDCLOGS "[Logs SD]\0 " #endif #define TR_FSW_VOLUME "Volume\0 " -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #if defined(SDCARD) #define TR_SDCLOGS "Logs carte SD" #else @@ -182,18 +182,18 @@ #define TR_VRENCODERS "REa""REb" #define LEN_VSWITCHES "\003" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""SW1""SW2""SW3""SW4""SW5""SW6""SW7""SW8""SW9""SWA""SWB""SWC""SWD""SWE""SWF""SWG""SWH""SWI""SWJ""SWK""SWL""SWM""SWN""SWO""SWP""SWQ""SWR""SWS""SWT""SWU""SWV""SWW"" ON" #else #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""SW1""SW2""SW3""SW4""SW5""SW6""SW7""SW8""SW9""SWA""SWB""SWC"" ON" #endif #define LEN_VSRCRAW "\004" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_ROTARY_ENCODERS_VSRCRAW "REa " -#elif defined(PCBV4) && defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb ""REc ""REd " -#elif defined(PCBV4) && !defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && !defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb " #else #define TR_ROTARY_ENCODERS_VSRCRAW @@ -330,7 +330,7 @@ #define STR_US (STR_TMR1LATMAXUS+12) #define TR_TMR1LATMINUS "Tmr1Lat min\003us" #define TR_TMR1JITTERUS "Tmr1 Jitter\003us" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_TMAINMAXMS "Tmain max\004ms" #else #define TR_TMAINMAXMS "Tmain max\005ms" diff --git a/src/translations/it.h b/src/translations/it.h index 2a362749c..68679bc42 100644 --- a/src/translations/it.h +++ b/src/translations/it.h @@ -36,7 +36,7 @@ #define TR_VTRIMINC "Exp ""ExFine""Fine ""Medio ""Ampio " #define LEN_RETA123 "\001" -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #if defined(EXTRA_ROTARY_ENCODERS) #define TR_RETA123 "RETA123abcd" #else //EXTRA_ROTARY_ENCODERS @@ -105,14 +105,14 @@ #define TR_PLAY_TRACK "[Brano]\0 " #define TR_PLAY_VALUE "[LeggiValore]" #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #if defined(SDCARD) #define TR_SDCLOGS "SDCARD Logs\0 " #else #define TR_SDCLOGS "[SDCARD Logs]" #endif #define TR_FSW_VOLUME "Volume\0 " -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #if defined(SDCARD) #define TR_SDCLOGS "SDCARD Logs" #else @@ -184,18 +184,18 @@ #define TR_VRENCODERS "REa""REb" #define LEN_VSWITCHES "\003" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""SW1""SW2""SW3""SW4""SW5""SW6""SW7""SW8""SW9""SWA""SWB""SWC""SWD""SWE""SWF""SWG""SWH""SWI""SWJ""SWK""SWL""SWM""SWN""SWO""SWP""SWQ""SWR""SWS""SWT""SWU""SWV""SWW"" ON" #else #define TR_VSWITCHES "THR""RUD""ELE""ID0""ID1""ID2""AIL""GEA""TRN""SW1""SW2""SW3""SW4""SW5""SW6""SW7""SW8""SW9""SWA""SWB""SWC"" ON" #endif #define LEN_VSRCRAW "\004" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_ROTARY_ENCODERS_VSRCRAW "REa " -#elif defined(PCBV4) && defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb ""REc ""REd " -#elif defined(PCBV4) && !defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && !defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb " #else #define TR_ROTARY_ENCODERS_VSRCRAW @@ -332,7 +332,7 @@ #define STR_US (STR_TMR1LATMAXUS+12) #define TR_TMR1LATMINUS "Tmr1Lat min\003us" #define TR_TMR1JITTERUS "Tmr1 Jitter\003us" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_TMAINMAXMS "Tmain max\004ms" #else #define TR_TMAINMAXMS "Tmain max\005ms" diff --git a/src/translations/se.h b/src/translations/se.h index 683dccc96..3da427de8 100644 --- a/src/translations/se.h +++ b/src/translations/se.h @@ -36,7 +36,7 @@ #define TR_VTRIMINC "Exp ""xFin ""Fin ""Medium""Grov " #define LEN_RETA123 "\001" -#if defined(PCBV4) +#if defined(PCBGRUVIN9X) #if defined(EXTRA_ROTARY_ENCODERS) #define TR_RETA123 "RHGS123abcd" #else //EXTRA_ROTARY_ENCODERS @@ -100,14 +100,14 @@ #define TR_PLAY_TRACK "[Spela Sp\200r]\0" #define TR_PLAY_VALUE "[Spela V\201rde]\0" #endif -#if defined(PCBARM) +#if defined(PCBSKY9X) #if defined(SDCARD) #define TR_SDCLOGS "[SDCARD Logg]" #else #define TR_SDCLOGS "[SDCARD Logg]" #endif #define TR_FSW_VOLUME "Volym\0 " -#elif defined(PCBV4) +#elif defined(PCBGRUVIN9X) #if defined(SDCARD) #define TR_SDCLOGS "SDCARD Loggar" #else @@ -182,18 +182,18 @@ #define TR_VRENCODERS "REa""REb" #define LEN_VSWITCHES "\003" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_VSWITCHES "GAS""ROD""H\205J""ID0""ID1""ID2""SKE""LAN""TRN""BR1""BR2""BR3""BR4""BR5""BR6""BR7""BR8""BR9""BRA""BRB""BRC""BRD""BRE""BRF""BRG""BRH""BRI""BRJ""BRK""BRL""BRM""BRN""BRO""BRP""BRQ""BRR""BRS""BRT""BRU""BRV""BRW"" P\203" #else #define TR_VSWITCHES "GAS""ROD""H\205J""ID0""ID1""ID2""SKE""LAN""TRN""BR1""BR2""BR3""BR4""BR5""BR6""BR7""BR8""BR9""BRA""BRB""BRC"" P\203" #endif #define LEN_VSRCRAW "\004" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_ROTARY_ENCODERS_VSRCRAW "REa " -#elif defined(PCBV4) && defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb ""REc ""REd " -#elif defined(PCBV4) && !defined(EXTRA_ROTARY_ENCODERS) +#elif defined(PCBGRUVIN9X) && !defined(EXTRA_ROTARY_ENCODERS) #define TR_ROTARY_ENCODERS_VSRCRAW "REa ""REb " #else #define TR_ROTARY_ENCODERS_VSRCRAW @@ -329,7 +329,7 @@ #define STR_US (STR_TMR1LATMAXUS+12) #define TR_TMR1LATMINUS "Tmr1Lat min\003us" #define TR_TMR1JITTERUS "Tmr1 Jitter\003us" -#if defined(PCBARM) +#if defined(PCBSKY9X) #define TR_TMAINMAXMS "Tmain max\004ms" #else #define TR_TMAINMAXMS "Tmain max\005ms"