Merge branch 'Pascal' into master

This commit is contained in:
midelic 2017-12-24 20:24:59 +01:00 committed by GitHub
commit fc5495b6d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 54 additions and 5 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.bak

View File

@ -20,6 +20,7 @@ multiatmega328p.build.f_cpu=16000000L
multiatmega328p.build.core=arduino:arduino multiatmega328p.build.core=arduino:arduino
multiatmega328p.build.variant=arduino:eightanaloginputs multiatmega328p.build.variant=arduino:eightanaloginputs
multiatmega328p.build.extra_flags=-Wl,--relax multiatmega328p.build.extra_flags=-Wl,--relax
multiatmega328p.build.board=MULTI_AVR=102 multiatmega328p.build.board=MULTI_AVR=102
multiatmega328p.board.compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects multiatmega328p.board.compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
@ -37,6 +38,7 @@ multiatmega328p.bootloader.unlock_bits=0x3F
multiatmega328p.bootloader.lock_bits=0x0F multiatmega328p.bootloader.lock_bits=0x0F
multiatmega328p.menu.bootloader.none=No bootloader multiatmega328p.menu.bootloader.none=No bootloader
multiatmega328p.menu.bootloader.none.build.board=MULTI_NO_BOOT=102 multiatmega328p.menu.bootloader.none.build.board=MULTI_NO_BOOT=102
multiatmega328p.menu.bootloader.none.upload.maximum_size=32768 multiatmega328p.menu.bootloader.none.upload.maximum_size=32768
@ -44,6 +46,7 @@ multiatmega328p.menu.bootloader.none.bootloader.file=Multi4in1/AtmegaMultiEmpty.
multiatmega328p.menu.bootloader.none.bootloader.high_fuses=0xD7 multiatmega328p.menu.bootloader.none.bootloader.high_fuses=0xD7
multiatmega328p.menu.bootloader.optiboot=Flash from TX multiatmega328p.menu.bootloader.optiboot=Flash from TX
multiatmega328p.menu.bootloader.optiboot.build.board=MULTI_FLASH_FROM_TX=102 multiatmega328p.menu.bootloader.optiboot.build.board=MULTI_FLASH_FROM_TX=102
multiatmega328p.menu.bootloader.optiboot.upload.maximum_size=32256 multiatmega328p.menu.bootloader.optiboot.upload.maximum_size=32256
@ -52,6 +55,7 @@ multiatmega328p.menu.bootloader.optiboot.bootloader.high_fuses=0xD6
############################################################## ##############################################################
############################################################## ##############################################################
## Multi 4-in-1 (OrangeRX) ## Multi 4-in-1 (OrangeRX)
## -------------------------------------------------- ## --------------------------------------------------

View File

@ -1,3 +1,4 @@
## Override some platform.txt settings to create a .bin instead of a .hex file ## Override some platform.txt settings to create a .bin instead of a .hex file
## The two lines below can be uncommented to have the compiler create a .bin file instead of a .hex file ## The two lines below can be uncommented to have the compiler create a .bin file instead of a .hex file
#compiler.elf2hex.flags=-O binary -R .eeprom #compiler.elf2hex.flags=-O binary -R .eeprom
@ -6,3 +7,4 @@
## Make a .bin version of the .hex file ## Make a .bin version of the .hex file
## The line below can be uncommented to have a .bin file made as well as the .hex file ## The line below can be uncommented to have a .bin file made as well as the .hex file
#recipe.hooks.objcopy.postobjcopy.00.pattern.windows="{compiler.path}{compiler.objcopy.cmd}" -I ihex "{build.path}/{build.project_name}.hex" -O binary "{build.path}/{build.project_name}.bin" #recipe.hooks.objcopy.postobjcopy.00.pattern.windows="{compiler.path}{compiler.objcopy.cmd}" -I ihex "{build.path}/{build.project_name}.hex" -O binary "{build.path}/{build.project_name}.bin"

View File

@ -1,11 +1,14 @@
# #
# Customized for the Atmega328p and OrangeRX (XMEGA) multi 4-in-1 boards. # Customized for the Atmega328p and OrangeRX (XMEGA) multi 4-in-1 boards.
# Both are AVR boards but need different compiler and upload flags and parameters. # Both are AVR boards but need different compiler and upload flags and parameters.
# #
# For more info: # For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Multi 4-in-1 AVR name=Multi 4-in-1 AVR
version=1.0.2 version=1.0.2
compiler.warning_flags=-w compiler.warning_flags=-w
@ -136,4 +139,3 @@ tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload
build.usb_manufacturer="Unknown" build.usb_manufacturer="Unknown"
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'

View File

@ -16,7 +16,9 @@ multistm32f103c.pid.0=0x0004
multistm32f103c.build.variant=generic_stm32f103c multistm32f103c.build.variant=generic_stm32f103c
multistm32f103c.build.vect=VECT_TAB_ADDR=0x8000000 multistm32f103c.build.vect=VECT_TAB_ADDR=0x8000000
multistm32f103c.build.core=maple multistm32f103c.build.core=maple
multistm32f103c.build.board=MULTI_STM32_FLASH_FROM_TX=103 multistm32f103c.build.board=MULTI_STM32_FLASH_FROM_TX=103
multistm32f103c.upload.use_1200bps_touch=false multistm32f103c.upload.use_1200bps_touch=false
multistm32f103c.upload.file_type=bin multistm32f103c.upload.file_type=bin
multistm32f103c.upload.auto_reset=true multistm32f103c.upload.auto_reset=true
@ -42,10 +44,12 @@ multistm32f103c.menu.upload_method.TxFlashMethod.upload.tool=tx_upload
multistm32f103c.menu.upload_method.TxFlashMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER multistm32f103c.menu.upload_method.TxFlashMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER
multistm32f103c.menu.upload_method.TxFlashMethod.build.vect=VECT_TAB_ADDR=0x8002000 multistm32f103c.menu.upload_method.TxFlashMethod.build.vect=VECT_TAB_ADDR=0x8002000
multistm32f103c.menu.upload_method.TxFlashMethod.build.ldscript=ld/bootloader_20.ld multistm32f103c.menu.upload_method.TxFlashMethod.build.ldscript=ld/bootloader_20.ld
multistm32f103c.menu.upload_method.TxFlashMethod.bootloader.file=Multi4in1/StmMultiBoot.bin multistm32f103c.menu.upload_method.TxFlashMethod.bootloader.file=Multi4in1/StmMultiBoot.bin
multistm32f103c.menu.upload_method.DFUUploadMethod=Upload via USB multistm32f103c.menu.upload_method.DFUUploadMethod=Upload via USB
multistm32f103c.menu.upload_method.DFUUploadMethod.build.board=MULTI_STM32_NO_BOOT=103 multistm32f103c.menu.upload_method.DFUUploadMethod.build.board=MULTI_STM32_NO_BOOT=103
multistm32f103c.menu.upload_method.DFUUploadMethod.upload.protocol=maple_dfu multistm32f103c.menu.upload_method.DFUUploadMethod.upload.protocol=maple_dfu
multistm32f103c.menu.upload_method.DFUUploadMethod.upload.tool=maple_upload multistm32f103c.menu.upload_method.DFUUploadMethod.upload.tool=maple_upload
multistm32f103c.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER multistm32f103c.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER
@ -61,4 +65,6 @@ multistm32f103c.menu.upload_method.serialMethod.upload.tool=serial_upload
multistm32f103c.menu.upload_method.serialMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG multistm32f103c.menu.upload_method.serialMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
multistm32f103c.menu.upload_method.serialMethod.build.board=MULTI_STM32_NO_BOOT=103 multistm32f103c.menu.upload_method.serialMethod.build.board=MULTI_STM32_NO_BOOT=103
############################################################## ##############################################################

View File

@ -1,3 +1,4 @@
# #
# Customized for the STM32 multi 4-in-1 board. # Customized for the STM32 multi 4-in-1 board.
# Based on an STM32F103CB MCU. # Based on an STM32F103CB MCU.
@ -6,6 +7,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Multi 4-in-1 STM32 name=Multi 4-in-1 STM32
version=1.0.3 version=1.0.3
compiler.warning_flags=-w -DDEBUG_LEVEL=DEBUG_NONE compiler.warning_flags=-w -DDEBUG_LEVEL=DEBUG_NONE
@ -48,6 +50,7 @@ build.hs_flag=
build.upload_flags= build.upload_flags=
build.extra_flags= {build.upload_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} build.extra_flags= {build.upload_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags}
# These can be overridden in platform.local.txt # These can be overridden in platform.local.txt
compiler.c.extra_flags= compiler.c.extra_flags=
compiler.c.elf.extra_flags="-L{build.variant.path}/ld" compiler.c.elf.extra_flags="-L{build.variant.path}/ld"
@ -56,6 +59,7 @@ compiler.S.extra_flags=
compiler.ar.extra_flags= compiler.ar.extra_flags=
compiler.elf2hex.extra_flags= compiler.elf2hex.extra_flags=
compiler.libs.c.flags="-I{build.system.path}/libmaple" "-I{build.system.path}/libmaple/include" "-I{build.system.path}/libmaple/stm32f1/include" "-I{build.system.path}/libmaple/usb/stm32f1" "-I{build.system.path}/libmaple/usb/usb_lib" compiler.libs.c.flags="-I{build.system.path}/libmaple" "-I{build.system.path}/libmaple/include" "-I{build.system.path}/libmaple/stm32f1/include" "-I{build.system.path}/libmaple/usb/stm32f1" "-I{build.system.path}/libmaple/usb/usb_lib"
# USB Flags # USB Flags
@ -99,6 +103,7 @@ recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
## Save Compiled Binary ## Save Compiled Binary
recipe.output.tmp_file={build.project_name}.bin recipe.output.tmp_file={build.project_name}.bin
#recipe.output.save_file={build.project_name}.{build.variant}.bin #recipe.output.save_file={build.project_name}.{build.variant}.bin
recipe.output.save_file=multi-stm.bin recipe.output.save_file=multi-stm.bin
## Copy hex ## Copy hex
@ -114,6 +119,7 @@ recipe.hooks.savehex.postsavehex.01.pattern.linux="{runtime.platform.path}/tools
recipe.hooks.savehex.postsavehex.01.pattern.linux64="{runtime.platform.path}/tools/linux64/do_version" "{build.path}" "{build.project_name}" "{build.source.path}" {build.board} EXPORT recipe.hooks.savehex.postsavehex.01.pattern.linux64="{runtime.platform.path}/tools/linux64/do_version" "{build.path}" "{build.project_name}" "{build.source.path}" {build.board} EXPORT
recipe.hooks.savehex.postsavehex.01.pattern.macosx="{runtime.platform.path}/tools/macosx/do_version" "{build.path}" "{build.project_name}" "{build.source.path}" {build.board} EXPORT recipe.hooks.savehex.postsavehex.01.pattern.macosx="{runtime.platform.path}/tools/macosx/do_version" "{build.path}" "{build.project_name}" "{build.source.path}" {build.board} EXPORT
# Uploader tools # Uploader tools
# ------------------- # -------------------

View File

@ -76,6 +76,7 @@ void *_sbrk(int incr) {
return ret; return ret;
} }
__weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) { __weak int _open(const char *path __attribute__((unused)), int flags __attribute__((unused)), ...) {
return 1; return 1;
} }
@ -85,10 +86,12 @@ __weak int _close(int fd __attribute__((unused))) {
} }
__weak int _fstat(int fd __attribute__((unused)), struct stat *st) { __weak int _fstat(int fd __attribute__((unused)), struct stat *st) {
st->st_mode = S_IFCHR; st->st_mode = S_IFCHR;
return 0; return 0;
} }
__weak int _isatty(int fd __attribute__((unused))) { __weak int _isatty(int fd __attribute__((unused))) {
return 1; return 1;
} }
@ -98,6 +101,7 @@ __weak int isatty(int fd __attribute__((unused))) {
} }
__weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) { __weak int _lseek(int fd __attribute__((unused)), off_t pos __attribute__((unused)), int whence __attribute__((unused))) {
return -1; return -1;
} }
@ -106,13 +110,18 @@ __weak unsigned char getch(void) {
} }
__weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) { __weak int _read(int fd __attribute__((unused)), char *buf, size_t cnt __attribute__((unused))) {
*buf = getch(); *buf = getch();
return 1; return 1;
} }
__weak void putch(unsigned char c __attribute__((unused))) { __weak void putch(unsigned char c __attribute__((unused))) {
} }
__weak void cgets(char *s, int bufsize) { __weak void cgets(char *s, int bufsize) {
@ -155,7 +164,9 @@ __weak void cgets(char *s, int bufsize) {
return; return;
} }
__weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) { __weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
int i; int i;
for (i = 0; i < cnt; i++) for (i = 0; i < cnt; i++)
@ -165,12 +176,16 @@ __weak int _write(int fd __attribute__((unused)), const char *buf, size_t cnt) {
} }
/* Override fgets() in newlib with a version that does line editing */ /* Override fgets() in newlib with a version that does line editing */
__weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) { __weak char *fgets(char *s, int bufsize, void *f __attribute__((unused))) {
cgets(s, bufsize); cgets(s, bufsize);
return s; return s;
} }
__weak void _exit(int exitcode __attribute__((unused))) { __weak void _exit(int exitcode __attribute__((unused))) {
while (1) while (1)
; ;
} }

View File

@ -1,4 +1,5 @@
# Arduino IDE board definitions for Multi 4-in-1 # Arduino IDE board definitions for Multi 4-in-1
Board definitions are available for the Atmega328p, STM32, and OrangeRX modules. The board definitions make it easier to compile and install the multiprotocol module firmware. Board definitions are available for the Atmega328p, STM32, and OrangeRX modules. The board definitions make it easier to compile and install the multiprotocol module firmware.
**Note:** The Orange RX module is now included in the **Multi 4-in-1 AVR Boards** package, it no longer has a dedicated package. If you have the dedicated OrangeRX package installed you should remove it and install the most recent AVR package (v1.0.2 or newer). **Note:** The Orange RX module is now included in the **Multi 4-in-1 AVR Boards** package, it no longer has a dedicated package. If you have the dedicated OrangeRX package installed you should remove it and install the most recent AVR package (v1.0.2 or newer).
@ -34,15 +35,19 @@ The board definitions are installed using the Arduino IDE Boards Manager.
## Verify the boards are installed ## Verify the boards are installed
1. Click **Tools -> Board** 1. Click **Tools -> Board**
2. Scroll down the list to the **Multi 4-in-1** board headings verify that the boards you installed are available: 2. Scroll down the list to the **Multi 4-in-1** board headings verify that the boards you installed are available:
![Image](/docs/images/boards-menu.jpg) ![Image](/docs/images/boards-menu.jpg)
* **Multi 4-in-1 (STM32F103CB)** for the STM32 module * **Multi 4-in-1 (STM32F103CB)** for the STM32 module
* **Multi 4-in-1 (Atmega328p, 3.3V, 16MHz)** for the Atmega module * **Multi 4-in-1 (Atmega328p, 3.3V, 16MHz)** for the Atmega module
* **Multi 4-in-1 (OrangeRX)** for the OrangeRX module * **Multi 4-in-1 (OrangeRX)** for the OrangeRX module
## Compiling and Uploading ## Compiling and Uploading
Refer to the hardware-specific pages for information on compiling the firmware and uploading it to the multiprotocol module: Refer to the hardware-specific pages for information on compiling the firmware and uploading it to the multiprotocol module:
* [Compiling for Atmega](/docs/Compiling.md) * [Compiling for Atmega](/docs/Compiling.md)
* [Compiling for STM32](/docs/Compiling_STM32.md) * [Compiling for STM32](/docs/Compiling_STM32.md)
* [Compiling for OrangeRX](/docs/Compiling_OrangeTx.md) * [Compiling for OrangeRX](/docs/Compiling_OrangeTx.md)

View File

@ -8,6 +8,7 @@
"online": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module" "online": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module"
}, },
"platforms": [{ "platforms": [{
"name": "Multi 4-in-1 AVR Boards", "name": "Multi 4-in-1 AVR Boards",
"architecture": "avr", "architecture": "avr",
"version": "1.0.0", "version": "1.0.0",
@ -16,6 +17,7 @@
"online": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module" "online": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module"
}, },
"url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/raw/master/BootLoaders/Archives/package_multi_4in1_board_v1.0.0.zip", "url": "https://github.com/pascallanger/DIY-Multiprotocol-TX-Module/raw/master/BootLoaders/Archives/package_multi_4in1_board_v1.0.0.zip",
"archiveFileName": "package_multi_4in1_board_v1.0.0.zip", "archiveFileName": "package_multi_4in1_board_v1.0.0.zip",
"checksum": "SHA-256:3DE301E9FC3C8A81CB2CEDE3458A68C626A9A5C37A73FA9C85BE9D841935684D", "checksum": "SHA-256:3DE301E9FC3C8A81CB2CEDE3458A68C626A9A5C37A73FA9C85BE9D841935684D",
"size": "3205", "size": "3205",
@ -25,6 +27,7 @@
"toolsDependencies": [] "toolsDependencies": []
}, },
{ {
"name": "Multi 4-in-1 AVR Boards", "name": "Multi 4-in-1 AVR Boards",
"architecture": "avr", "architecture": "avr",
"version": "1.0.1", "version": "1.0.1",
@ -60,6 +63,7 @@
"toolsDependencies": [] "toolsDependencies": []
}, },
{ {
"name": "Multi 4-in-1 STM32 Board", "name": "Multi 4-in-1 STM32 Board",
"architecture": "STM32F1", "architecture": "STM32F1",
"version": "1.0.0", "version": "1.0.0",

Binary file not shown.

Binary file not shown.

View File

@ -179,6 +179,7 @@ static void AFHDS2A_build_packet(uint8_t type)
packet[0] = 0x56; packet[0] = 0x56;
for(uint8_t ch=0; ch<14; ch++) for(uint8_t ch=0; ch<14; ch++)
{ {
#ifdef FAILSAFE_ENABLE #ifdef FAILSAFE_ENABLE
uint16_t failsafeMicros = (Failsafe_data[CH_AETR[ch]]*5)/8+860; uint16_t failsafeMicros = (Failsafe_data[CH_AETR[ch]]*5)/8+860;
if( failsafeMicros!=FAILSAFE_CHANNEL_HOLD+860) if( failsafeMicros!=FAILSAFE_CHANNEL_HOLD+860)
@ -192,6 +193,7 @@ static void AFHDS2A_build_packet(uint8_t type)
packet[9 + ch*2] = 0xff; packet[9 + ch*2] = 0xff;
packet[10+ ch*2] = 0xff; packet[10+ ch*2] = 0xff;
} }
} }
break; break;
case AFHDS2A_PACKET_SETTINGS: case AFHDS2A_PACKET_SETTINGS:

View File

@ -1,3 +1,4 @@
/* ************************** /* **************************
* By Midelic on RCGroups * * By Midelic on RCGroups *
************************** **************************
@ -350,4 +351,5 @@ uint16_t initFrSkyX()
FrX_receive_seq = 0 ; FrX_receive_seq = 0 ;
return 10000; return 10000;
} }
#endif #endif

View File

@ -17,6 +17,7 @@
// Version // Version
//****************** //******************
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_REVISION 0 #define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 0 #define VERSION_PATCH_LEVEL 0

View File

@ -1,3 +1,4 @@
/********************************************************* /*********************************************************
Multiprotocol Tx code Multiprotocol Tx code
by Midelic and Pascal Langer(hpnuts) by Midelic and Pascal Langer(hpnuts)
@ -1656,6 +1657,4 @@ static uint32_t random_id(uint16_t address, uint8_t create_new)
WDTCSR = 0; // Disable Watchdog interrupt WDTCSR = 0; // Disable Watchdog interrupt
} }
} }
#endif #endif

View File

@ -1,3 +1,4 @@
/* /*
This project is free software: you can redistribute it and/or modify This project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@ -7,7 +7,6 @@ The Deviation project (on which this project was based) have a useful list of mo
<img src="http://img2.cheapdrone.co.uk/images/upload/2014/12/X5C%203/SKU115108-7.jpg" Width="200" Height="200" /> <img src="http://img2.cheapdrone.co.uk/images/upload/2014/12/X5C%203/SKU115108-7.jpg" Width="200" Height="200" />
## Channel Map ## Channel Map
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9 CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|--- ---|---|---|---|---|---|---|---|---
A|E|T|R|FLIP|RATES|PICTURE|VIDEO|HEADLESS A|E|T|R|FLIP|RATES|PICTURE|VIDEO|HEADLESS