diff --git a/src/Makefile b/src/Makefile index 1555c2eb1..6b0d8cdba 100644 --- a/src/Makefile +++ b/src/Makefile @@ -585,7 +585,7 @@ ifeq ($(PCB), TARANIS) PULSESSRC = protocols/pulses_arm.cpp protocols/ppm_arm.cpp protocols/pxx_arm.cpp CPPSRC += audio_arm.cpp CPPSRC += targets/taranis/pwr_driver.cpp targets/taranis/pulses_driver.cpp targets/taranis/keys_driver.cpp targets/taranis/adc_driver.cpp targets/taranis/trainer_driver.cpp targets/taranis/audio_driver.cpp targets/taranis/delays.cpp targets/taranis/uart_driver.cpp targets/taranis/sport_driver.cpp - CPPSRC += bmp.cpp gui/view_channels.cpp + CPPSRC += bmp.cpp gui/view_channels.cpp gui/view_about.cpp SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c @@ -1072,7 +1072,7 @@ bitmaps/font.lbm: bitmaps/font.xbm bitmaps/font_extra.xbm bitmaps/font_tiny.xbm $(IMG2LBM) translations/font_dblsize_fr.xbm translations/font_dblsize_fr.lbm 10x14 $(IMG2LBM) translations/font_dblsize_es.xbm translations/font_dblsize_es.lbm 10x14 -bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_taranis.png bitmaps/logo_taranis.bmp bitmaps/icons.png bitmaps/asterisk.xbm +bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_taranis.png bitmaps/logo_taranis.bmp bitmaps/icons.png bitmaps/asterisk.xbm bitmaps/about.png @echo @echo "Convert bitmaps from xbm to lbm:" $(IMG2LBM) bitmaps/sticks_4x1.xbm bitmaps/sticks.lbm img 4 @@ -1081,6 +1081,7 @@ bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_ $(IMG2LBM) bitmaps/logo_taranis.bmp bitmaps/logo_taranis.lbm bmp $(IMG2LBM) bitmaps/icons.png bitmaps/icons.lbm bmp $(IMG2LBM) bitmaps/asterisk.xbm bitmaps/asterisk.lbm img + $(IMG2LBM) bitmaps/about.png bitmaps/about.lbm bmp # Eye candy. # AVR Studio 3.x does not check make's exit code but relies on diff --git a/src/audio_arm.cpp b/src/audio_arm.cpp index cfe85f737..dc5d861c8 100644 --- a/src/audio_arm.cpp +++ b/src/audio_arm.cpp @@ -111,7 +111,7 @@ void refreshSystemAudioFiles() strncpy(filename+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); assert(sizeof(audioFilenames)==AU_FRSKY_FIRST*sizeof(char *)); - assert(sizeof(sdAvailableSystemAudioFiles)*8 > AU_FRSKY_FIRST); + assert(sizeof(sdAvailableSystemAudioFiles)*8 >= AU_FRSKY_FIRST); uint32_t availableAudioFiles = 0; diff --git a/src/gui/menus.cpp b/src/gui/menus.cpp index 4a02785c3..b4a85f02b 100644 --- a/src/gui/menus.cpp +++ b/src/gui/menus.cpp @@ -950,7 +950,7 @@ const char * displayMenu(uint8_t event) const char * result = NULL; uint8_t display_count = min(s_menu_count, (uint16_t)MENU_MAX_LINES); - uint8_t y = (display_count >= 5 ? MENU_Y - FH : MENU_Y); + uint8_t y = (display_count >= 5 ? MENU_Y - FH - 1 : MENU_Y); lcd_filled_rect(MENU_X, y, MENU_W, display_count * (FH+1) + 2, SOLID, ERASE); lcd_rect(MENU_X, y, MENU_W, display_count * (FH+1) + 2); diff --git a/src/gui/menus.h b/src/gui/menus.h index 6cd2f9e81..acce88d0b 100644 --- a/src/gui/menus.h +++ b/src/gui/menus.h @@ -119,6 +119,7 @@ void menuModelSelect(uint8_t event); void menuModelCustomFunctions(uint8_t event); void menuStatisticsView(uint8_t event); void menuStatisticsDebug(uint8_t event); +void menuAboutView(uint8_t event); #if defined(NAVIGATION_POT1) extern int16_t p1valdiff; diff --git a/src/gui/view_about.cpp b/src/gui/view_about.cpp new file mode 100644 index 000000000..9ffa7ee60 --- /dev/null +++ b/src/gui/view_about.cpp @@ -0,0 +1,138 @@ +/* + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "../opentx.h" + +#if defined(PCBTARANIS) + const pm_uchar about_bmp[] PROGMEM = { + #include "../bitmaps/about.lbm" + }; +#endif + +enum AboutScreens { + ABOUT_OPENTX, + ABOUT_BERTRAND, + ABOUT_MIKE, + ABOUT_ROMOLO, + ABOUT_ANDRE, + ABOUT_ROB, + ABOUT_MARTIN, + ABOUT_HARDWARE, + ABOUT_END, + ABOUT_COUNT, +}; + +void menuAboutView(uint8_t event) +{ + static int screenIndex; + static int greyIndex; + + switch(event) + { + case EVT_ENTRY: + screenIndex = 0; + greyIndex = 0; + break; + case EVT_KEY_FIRST(KEY_UP): + case EVT_KEY_FIRST(KEY_DOWN): + case EVT_KEY_FIRST(KEY_EXIT): + case EVT_KEY_FIRST(KEY_ENTER): + chainMenu(menuMainView); + return; + } + + lcd_bmp(0, 0, about_bmp); + lcd_putsAtt(64, 0, PSTR("ABOUT US"), DBLSIZE); + lcd_hline(62, 18, 120); + lcd_hline(62, 19, 130, GREY_DEFAULT); + + LcdFlags att = GREY(max(0, 15-greyIndex/2)); + int screenDuration = 150; + + switch (screenIndex) { + case ABOUT_OPENTX: + case ABOUT_END: + lcd_putsAtt(62, 24, PSTR("OpenTX was developed for free"), SMLSIZE); + lcd_putsAtt(62, 36, PSTR("Your donation will ensure"), SMLSIZE); + lcd_putsAtt(62, 44, PSTR("that it remains free and open"), SMLSIZE); + lcd_putsAtt(62, 56, PSTR("The amount is up to you!"), SMLSIZE); + screenDuration = 300; + break; + + case ABOUT_BERTRAND: + lcd_putsAtt(62, 24, PSTR("Bertrand Songis"), att); + lcd_putsAtt(68, 36, PSTR("OpenTX main author"), att|SMLSIZE); + break; + + case ABOUT_MIKE: + lcd_putsAtt(62, 24, PSTR("Mike Blandford"), att); + lcd_putsAtt(68, 36, PSTR("Drivers guru"), att|SMLSIZE); + break; + + case ABOUT_ROMOLO: + lcd_putsAtt(62, 24, PSTR("Romolo Manfredini"), att); + lcd_putsAtt(68, 36, PSTR("Companion9x main developer"), att|SMLSIZE); + break; + + case ABOUT_ANDRE: + lcd_putsAtt(62, 24, PSTR("Andre Bernet"), att); + lcd_putsAtt(68, 36, PSTR("Features / usability"), att|SMLSIZE); + break; + + case ABOUT_ROB: + lcd_putsAtt(62, 24, PSTR("Rob Thomson"), att); + lcd_putsAtt(68, 36, PSTR("Openrcforums webmaster"), att|SMLSIZE); + break; + + case ABOUT_MARTIN: + lcd_putsAtt(62, 24, PSTR("Martin Hotar"), att); + lcd_putsAtt(68, 36, PSTR("Graphics designer"), att|SMLSIZE); + break; + + case ABOUT_HARDWARE: + lcd_putsAtt(62, 24, PSTR("FrSky"), att); + lcd_putsAtt(68, 36, PSTR("Hardware designer/producer"), att|SMLSIZE); + screenDuration = 300; + break; + } + + if (++greyIndex == screenDuration) { + greyIndex = 0; + if (++screenIndex == ABOUT_COUNT) { + chainMenu(menuMainView); + } + } +} diff --git a/src/gui/view_main.cpp b/src/gui/view_main.cpp index e95305101..b29216f69 100644 --- a/src/gui/view_main.cpp +++ b/src/gui/view_main.cpp @@ -443,6 +443,11 @@ void onMainViewMenu(const char *result) else if (result == STR_STATISTICS) { chainMenu(menuStatisticsView); } +#if defined(PCBTARANIS) + else if (result == STR_ABOUT_US) { + chainMenu(menuAboutView); + } +#endif } #endif @@ -503,6 +508,9 @@ void menuMainView(uint8_t event) MENU_ADD_ITEM(STR_RESET_TELEMETRY); #endif MENU_ADD_ITEM(STR_STATISTICS); +#if defined(PCBTARANIS) + MENU_ADD_ITEM(STR_ABOUT_US); +#endif menuHandler = onMainViewMenu; break; #endif diff --git a/src/targets/taranis/trainer_driver.cpp b/src/targets/taranis/trainer_driver.cpp index 8e317cd79..4753b1e0d 100644 --- a/src/targets/taranis/trainer_driver.cpp +++ b/src/targets/taranis/trainer_driver.cpp @@ -57,7 +57,7 @@ void init_trainer_ppm() TIM3->PSC = (PERI1_FREQUENCY * TIMER_MULT_APB1) / 2000000 - 1 ; // 0.5uS TIM3->CCER = TIM_CCER_CC4E ; TIM3->CCMR2 = TIM_CCMR2_OC4M_1 | TIM_CCMR2_OC4M_2 | TIM_CCMR2_OC4PE ; // PWM mode 1 - TIM3->CCR4 = 600 ; // 300 uS pulse + TIM3->CCR4 = (g_model.moduleData[TRAINER_MODULE].ppmDelay*50+300)*2; TIM3->BDTR = TIM_BDTR_MOE ; TIM3->EGR = 1 ; // TIM3->DIER = TIM_DIER_UDE ; @@ -148,7 +148,6 @@ extern "C" void TIM3_IRQHandler() TrainerPulsePtr = ppmStream[TRAINER_MODULE]; TIM3->DIER |= TIM_DIER_UDE ; - TIM3->SR &= ~TIM_SR_UIF ; // Clear this flag TIM3->DIER |= TIM_DIER_UIE ; // Enable this interrupt } diff --git a/src/translations.cpp b/src/translations.cpp index 95f695d0c..a122c075b 100644 --- a/src/translations.cpp +++ b/src/translations.cpp @@ -357,6 +357,7 @@ const pm_char STR_RESET_TIMER1[] PROGMEM = "Reset Timer1"; const pm_char STR_RESET_TIMER2[] PROGMEM = "Reset Timer2"; const pm_char STR_RESET_TELEMETRY[] PROGMEM = "Reset Telemetry"; const pm_char STR_STATISTICS[] PROGMEM = "Statistics"; +const pm_char STR_ABOUT_US[] PROGMEM = "About Us"; #endif const pm_char STR_RESET[] PROGMEM = "[Reset]"; diff --git a/src/translations.h b/src/translations.h index bbc8f6c5e..38e211188 100644 --- a/src/translations.h +++ b/src/translations.h @@ -473,6 +473,7 @@ extern const pm_char STR_CURRENT[]; extern const pm_char STR_RESET_TIMER2[]; extern const pm_char STR_RESET_TELEMETRY[]; extern const pm_char STR_STATISTICS[]; + extern const pm_char STR_ABOUT_US[]; #endif extern const pm_char STR_RESET[]; diff --git a/util/tts.py b/util/tts.py index a1e391009..4c1cb98e4 100644 --- a/util/tts.py +++ b/util/tts.py @@ -148,6 +148,7 @@ if __name__ == "__main__": defaultcodec = "pcm_alaw" if "en" in sys.argv: + directory = "en" if "sapi" in sys.argv: if "scottish" in sys.argv: tts.SetVoiceByName("ScanSoftFiona_Full_22kHz") @@ -254,6 +255,7 @@ if __name__ == "__main__": elif "fr" in sys.argv: + directory = "fr" if "sapi" in sys.argv: tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz") voice = "french" @@ -293,6 +295,7 @@ if __name__ == "__main__": elif "it" in sys.argv: + directory = "it" if "sapi" in sys.argv: tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz") voice = "italian" @@ -363,6 +366,7 @@ if __name__ == "__main__": sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i)) elif "de" in sys.argv: + directory = "de" if "sapi" in sys.argv: tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz") voice = "german" @@ -432,6 +436,7 @@ if __name__ == "__main__": sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i)) elif "pt" in sys.argv: + directory = "pt" if "sapi" in sys.argv: tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz") voice = "portuguese" @@ -510,6 +515,7 @@ if __name__ == "__main__": sounds.extend(generate(s, f, PROMPT_CUSTOM_BASE+i)) elif "cz" in sys.argv: + directory = "cz" if "sapi" in sys.argv: tts.SetVoiceByName("ScanSoftZuzana_Full_22kHz") voice = "czech" @@ -601,13 +607,13 @@ if __name__ == "__main__": for f, s in systemSounds: l = u"" if board == "sky9x": - l += u"SOUNDS/SYSTEM;" + l += u"SOUNDS/%s/SYSTEM;" % directory l += f + u";" + s + u"\n" csvFile.write(l.encode("latin-1")) for f, s in sounds: l = u"" if board == "sky9x": - l += u"SOUNDS;" + l += u"SOUNDS/%s;" % directory l += f + u";" + s + u"\n" csvFile.write(l.encode("latin-1")) csvFile.close() @@ -617,13 +623,13 @@ if __name__ == "__main__": zip = zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED) for f, s in systemSounds: if board == "sky9x": - zip.write(f, "SOUNDS/SYSTEM/" + f) + zip.write(f, "SOUNDS/%s/SYSTEM/" % directory + f) else: zip.write(f, f) os.remove(f) for f, s in sounds: if board == "sky9x": - zip.write(f, "SOUNDS/" + f) + zip.write(f, "SOUNDS/%s/" % directory + f) else: zip.write(f, f) os.remove(f)