Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds: adds esp82xx wifi upload support #422

Merged
merged 1 commit into from Apr 3, 2021

Conversation

cruwaller
Copy link
Collaborator

Support to upload firmware over the air to ESP82xx RX as well.

@AlessandroAU AlessandroAU merged commit 2cca18e into develop Apr 3, 2021
@AlessandroAU AlessandroAU deleted the pr-add-esp82xx-wifi-upload-support branch April 3, 2021 16:06
JyeSmith added a commit that referenced this pull request Apr 22, 2021
* user def for auto wifi interval (#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (#325)

* 2.4 GHz Rx Nano Diversity (#239)

* RX_Nano_Diversity

* Feature/binding (#304)

* adds binding

* Update user_defines.txt (#331)

* CCG Nano RX pin fix (#333)

* Added v2.0 20x20 RX (#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (#329)

* Ghost tx (#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (#331)

* CCG Nano RX pin fix (#333)

* Added v2.0 20x20 RX (#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (#361)

* Ghost bootloader (#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (#368)

* pp rx order and build details (#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (#375)

* 2.4 slimmer lite jr (#384)

* Added Happy Model RX target (based on R9MM target) (#385)

* Support for SIYI FM30 TX (#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (#399)

* removes stray return (#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (#392)

* fix lua offset (#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (#411)

* add ghost tx lite support

* Diversityfunction (#287)

* add diversity function

* Add sensitivity display in lua (#416)

* add sensitivity display in LUA

* 6km readme (#412)

* Added support for mac os (Darwin) (#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR #417 (#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (#448)

* Upgrade ESP8266 framework to allow larger IRAM (#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (#462)

Adds crc13 plus parity

* adds missing CRCInitializer (#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (#468)

* leave binding power to user selected (#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (#470)

* Convert LQCALC to be bit-based instead of 8-bit (#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (#477)

* FHSS tests (#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (#479)

* change CR 4/5 to LI 4/6 (#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (#472)

* Fix minor "bug" in FHSS (#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (#484)

* CRC Unit tests and proper fix for CRC13 (#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (#490)

* adds crcr14 (#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (#494) (#495)

* Add stress testing code to the CRC test (#496)

* Update tx_main.cpp (#482)

* Enable bootloader command and clean stm32 linker files (#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (#500)

* Support for MSP messages (#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (#502)

* Spam sync packets on rf param change (#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
brandonrc added a commit to brandonrc/ExpressLRS that referenced this pull request May 20, 2021
* user def for auto wifi interval (ExpressLRS#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (ExpressLRS#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (ExpressLRS#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (ExpressLRS#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (ExpressLRS#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (ExpressLRS#325)

* 2.4 GHz Rx Nano Diversity (ExpressLRS#239)

* RX_Nano_Diversity

* Feature/binding (ExpressLRS#304)

* adds binding

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (ExpressLRS#329)

* Ghost tx (ExpressLRS#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (ExpressLRS#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (ExpressLRS#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (ExpressLRS#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (ExpressLRS#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (ExpressLRS#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (ExpressLRS#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (ExpressLRS#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (ExpressLRS#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (ExpressLRS#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (ExpressLRS#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (ExpressLRS#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (ExpressLRS#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (ExpressLRS#361)

* Ghost bootloader (ExpressLRS#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (ExpressLRS#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (ExpressLRS#368)

* pp rx order and build details (ExpressLRS#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (ExpressLRS#375)

* 2.4 slimmer lite jr (ExpressLRS#384)

* Added Happy Model RX target (based on R9MM target) (ExpressLRS#385)

* Support for SIYI FM30 TX (ExpressLRS#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (ExpressLRS#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (ExpressLRS#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (ExpressLRS#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (ExpressLRS#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (ExpressLRS#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (ExpressLRS#399)

* removes stray return (ExpressLRS#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (ExpressLRS#392)

* fix lua offset (ExpressLRS#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (ExpressLRS#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (ExpressLRS#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (ExpressLRS#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (ExpressLRS#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (ExpressLRS#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (ExpressLRS#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (ExpressLRS#411)

* add ghost tx lite support

* Diversityfunction (ExpressLRS#287)

* add diversity function

* Add sensitivity display in lua (ExpressLRS#416)

* add sensitivity display in LUA

* 6km readme (ExpressLRS#412)

* Added support for mac os (Darwin) (ExpressLRS#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (ExpressLRS#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (ExpressLRS#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (ExpressLRS#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (ExpressLRS#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (ExpressLRS#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (ExpressLRS#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (ExpressLRS#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR ExpressLRS#417 (ExpressLRS#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (ExpressLRS#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (ExpressLRS#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (ExpressLRS#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (ExpressLRS#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (ExpressLRS#448)

* Upgrade ESP8266 framework to allow larger IRAM (ExpressLRS#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (ExpressLRS#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (ExpressLRS#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (ExpressLRS#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (ExpressLRS#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (ExpressLRS#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (ExpressLRS#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (ExpressLRS#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (ExpressLRS#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (ExpressLRS#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (ExpressLRS#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (ExpressLRS#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (ExpressLRS#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (ExpressLRS#462)

Adds crc13 plus parity

* adds missing CRCInitializer (ExpressLRS#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (ExpressLRS#468)

* leave binding power to user selected (ExpressLRS#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (ExpressLRS#470)

* Convert LQCALC to be bit-based instead of 8-bit (ExpressLRS#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (ExpressLRS#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (ExpressLRS#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (ExpressLRS#477)

* FHSS tests (ExpressLRS#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (ExpressLRS#479)

* change CR 4/5 to LI 4/6 (ExpressLRS#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (ExpressLRS#472)

* Fix minor "bug" in FHSS (ExpressLRS#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (ExpressLRS#484)

* CRC Unit tests and proper fix for CRC13 (ExpressLRS#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (ExpressLRS#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (ExpressLRS#490)

* adds crcr14 (ExpressLRS#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (ExpressLRS#494) (ExpressLRS#495)

* Add stress testing code to the CRC test (ExpressLRS#496)

* Update tx_main.cpp (ExpressLRS#482)

* Enable bootloader command and clean stm32 linker files (ExpressLRS#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (ExpressLRS#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (ExpressLRS#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (ExpressLRS#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (ExpressLRS#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (ExpressLRS#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (ExpressLRS#500)

* Support for MSP messages (ExpressLRS#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (ExpressLRS#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (ExpressLRS#502)

* Spam sync packets on rf param change (ExpressLRS#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (ExpressLRS#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
brandonrc added a commit to brandonrc/ExpressLRS that referenced this pull request May 20, 2021
* user def for auto wifi interval (ExpressLRS#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (ExpressLRS#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (ExpressLRS#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (ExpressLRS#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (ExpressLRS#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (ExpressLRS#325)

* 2.4 GHz Rx Nano Diversity (ExpressLRS#239)

* RX_Nano_Diversity

* Feature/binding (ExpressLRS#304)

* adds binding

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (ExpressLRS#329)

* Ghost tx (ExpressLRS#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (ExpressLRS#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (ExpressLRS#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (ExpressLRS#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (ExpressLRS#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (ExpressLRS#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (ExpressLRS#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (ExpressLRS#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (ExpressLRS#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (ExpressLRS#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (ExpressLRS#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (ExpressLRS#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (ExpressLRS#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (ExpressLRS#361)

* Ghost bootloader (ExpressLRS#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (ExpressLRS#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (ExpressLRS#368)

* pp rx order and build details (ExpressLRS#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (ExpressLRS#375)

* 2.4 slimmer lite jr (ExpressLRS#384)

* Added Happy Model RX target (based on R9MM target) (ExpressLRS#385)

* Support for SIYI FM30 TX (ExpressLRS#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (ExpressLRS#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (ExpressLRS#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (ExpressLRS#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (ExpressLRS#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (ExpressLRS#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (ExpressLRS#399)

* removes stray return (ExpressLRS#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (ExpressLRS#392)

* fix lua offset (ExpressLRS#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (ExpressLRS#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (ExpressLRS#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (ExpressLRS#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (ExpressLRS#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (ExpressLRS#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (ExpressLRS#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (ExpressLRS#411)

* add ghost tx lite support

* Diversityfunction (ExpressLRS#287)

* add diversity function

* Add sensitivity display in lua (ExpressLRS#416)

* add sensitivity display in LUA

* 6km readme (ExpressLRS#412)

* Added support for mac os (Darwin) (ExpressLRS#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (ExpressLRS#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (ExpressLRS#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (ExpressLRS#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (ExpressLRS#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (ExpressLRS#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (ExpressLRS#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (ExpressLRS#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR ExpressLRS#417 (ExpressLRS#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (ExpressLRS#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (ExpressLRS#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (ExpressLRS#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (ExpressLRS#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (ExpressLRS#448)

* Upgrade ESP8266 framework to allow larger IRAM (ExpressLRS#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (ExpressLRS#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (ExpressLRS#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (ExpressLRS#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (ExpressLRS#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (ExpressLRS#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (ExpressLRS#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (ExpressLRS#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (ExpressLRS#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (ExpressLRS#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (ExpressLRS#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (ExpressLRS#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (ExpressLRS#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (ExpressLRS#462)

Adds crc13 plus parity

* adds missing CRCInitializer (ExpressLRS#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (ExpressLRS#468)

* leave binding power to user selected (ExpressLRS#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (ExpressLRS#470)

* Convert LQCALC to be bit-based instead of 8-bit (ExpressLRS#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (ExpressLRS#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (ExpressLRS#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (ExpressLRS#477)

* FHSS tests (ExpressLRS#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (ExpressLRS#479)

* change CR 4/5 to LI 4/6 (ExpressLRS#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (ExpressLRS#472)

* Fix minor "bug" in FHSS (ExpressLRS#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (ExpressLRS#484)

* CRC Unit tests and proper fix for CRC13 (ExpressLRS#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (ExpressLRS#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (ExpressLRS#490)

* adds crcr14 (ExpressLRS#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (ExpressLRS#494) (ExpressLRS#495)

* Add stress testing code to the CRC test (ExpressLRS#496)

* Update tx_main.cpp (ExpressLRS#482)

* Enable bootloader command and clean stm32 linker files (ExpressLRS#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (ExpressLRS#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (ExpressLRS#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (ExpressLRS#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (ExpressLRS#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (ExpressLRS#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (ExpressLRS#500)

* Support for MSP messages (ExpressLRS#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (ExpressLRS#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (ExpressLRS#502)

* Spam sync packets on rf param change (ExpressLRS#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (ExpressLRS#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
brandonrc added a commit to brandonrc/ExpressLRS that referenced this pull request May 20, 2021
* user def for auto wifi interval (ExpressLRS#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (ExpressLRS#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (ExpressLRS#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (ExpressLRS#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (ExpressLRS#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (ExpressLRS#325)

* 2.4 GHz Rx Nano Diversity (ExpressLRS#239)

* RX_Nano_Diversity

* Feature/binding (ExpressLRS#304)

* adds binding

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (ExpressLRS#329)

* Ghost tx (ExpressLRS#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (ExpressLRS#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (ExpressLRS#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (ExpressLRS#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (ExpressLRS#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (ExpressLRS#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (ExpressLRS#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (ExpressLRS#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (ExpressLRS#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (ExpressLRS#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (ExpressLRS#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (ExpressLRS#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (ExpressLRS#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (ExpressLRS#361)

* Ghost bootloader (ExpressLRS#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (ExpressLRS#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (ExpressLRS#368)

* pp rx order and build details (ExpressLRS#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (ExpressLRS#375)

* 2.4 slimmer lite jr (ExpressLRS#384)

* Added Happy Model RX target (based on R9MM target) (ExpressLRS#385)

* Support for SIYI FM30 TX (ExpressLRS#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (ExpressLRS#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (ExpressLRS#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (ExpressLRS#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (ExpressLRS#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (ExpressLRS#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (ExpressLRS#399)

* removes stray return (ExpressLRS#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (ExpressLRS#392)

* fix lua offset (ExpressLRS#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (ExpressLRS#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (ExpressLRS#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (ExpressLRS#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (ExpressLRS#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (ExpressLRS#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (ExpressLRS#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (ExpressLRS#411)

* add ghost tx lite support

* Diversityfunction (ExpressLRS#287)

* add diversity function

* Add sensitivity display in lua (ExpressLRS#416)

* add sensitivity display in LUA

* 6km readme (ExpressLRS#412)

* Added support for mac os (Darwin) (ExpressLRS#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (ExpressLRS#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (ExpressLRS#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (ExpressLRS#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (ExpressLRS#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (ExpressLRS#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (ExpressLRS#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (ExpressLRS#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR ExpressLRS#417 (ExpressLRS#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (ExpressLRS#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (ExpressLRS#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (ExpressLRS#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (ExpressLRS#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (ExpressLRS#448)

* Upgrade ESP8266 framework to allow larger IRAM (ExpressLRS#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (ExpressLRS#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (ExpressLRS#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (ExpressLRS#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (ExpressLRS#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (ExpressLRS#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (ExpressLRS#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (ExpressLRS#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (ExpressLRS#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (ExpressLRS#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (ExpressLRS#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (ExpressLRS#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (ExpressLRS#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (ExpressLRS#462)

Adds crc13 plus parity

* adds missing CRCInitializer (ExpressLRS#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (ExpressLRS#468)

* leave binding power to user selected (ExpressLRS#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (ExpressLRS#470)

* Convert LQCALC to be bit-based instead of 8-bit (ExpressLRS#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (ExpressLRS#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (ExpressLRS#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (ExpressLRS#477)

* FHSS tests (ExpressLRS#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (ExpressLRS#479)

* change CR 4/5 to LI 4/6 (ExpressLRS#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (ExpressLRS#472)

* Fix minor "bug" in FHSS (ExpressLRS#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (ExpressLRS#484)

* CRC Unit tests and proper fix for CRC13 (ExpressLRS#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (ExpressLRS#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (ExpressLRS#490)

* adds crcr14 (ExpressLRS#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (ExpressLRS#494) (ExpressLRS#495)

* Add stress testing code to the CRC test (ExpressLRS#496)

* Update tx_main.cpp (ExpressLRS#482)

* Enable bootloader command and clean stm32 linker files (ExpressLRS#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (ExpressLRS#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (ExpressLRS#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (ExpressLRS#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (ExpressLRS#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (ExpressLRS#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (ExpressLRS#500)

* Support for MSP messages (ExpressLRS#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (ExpressLRS#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (ExpressLRS#502)

* Spam sync packets on rf param change (ExpressLRS#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (ExpressLRS#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
brandonrc added a commit to brandonrc/ExpressLRS that referenced this pull request May 20, 2021
* user def for auto wifi interval (ExpressLRS#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (ExpressLRS#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (ExpressLRS#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (ExpressLRS#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (ExpressLRS#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (ExpressLRS#325)

* 2.4 GHz Rx Nano Diversity (ExpressLRS#239)

* RX_Nano_Diversity

* Feature/binding (ExpressLRS#304)

* adds binding

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (ExpressLRS#329)

* Ghost tx (ExpressLRS#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (ExpressLRS#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (ExpressLRS#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (ExpressLRS#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (ExpressLRS#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (ExpressLRS#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (ExpressLRS#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (ExpressLRS#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (ExpressLRS#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (ExpressLRS#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (ExpressLRS#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (ExpressLRS#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (ExpressLRS#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (ExpressLRS#361)

* Ghost bootloader (ExpressLRS#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (ExpressLRS#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (ExpressLRS#368)

* pp rx order and build details (ExpressLRS#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (ExpressLRS#375)

* 2.4 slimmer lite jr (ExpressLRS#384)

* Added Happy Model RX target (based on R9MM target) (ExpressLRS#385)

* Support for SIYI FM30 TX (ExpressLRS#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (ExpressLRS#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (ExpressLRS#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (ExpressLRS#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (ExpressLRS#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (ExpressLRS#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (ExpressLRS#399)

* removes stray return (ExpressLRS#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (ExpressLRS#392)

* fix lua offset (ExpressLRS#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (ExpressLRS#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (ExpressLRS#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (ExpressLRS#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (ExpressLRS#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (ExpressLRS#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (ExpressLRS#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (ExpressLRS#411)

* add ghost tx lite support

* Diversityfunction (ExpressLRS#287)

* add diversity function

* Add sensitivity display in lua (ExpressLRS#416)

* add sensitivity display in LUA

* 6km readme (ExpressLRS#412)

* Added support for mac os (Darwin) (ExpressLRS#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (ExpressLRS#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (ExpressLRS#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (ExpressLRS#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (ExpressLRS#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (ExpressLRS#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (ExpressLRS#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (ExpressLRS#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR ExpressLRS#417 (ExpressLRS#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (ExpressLRS#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (ExpressLRS#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (ExpressLRS#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (ExpressLRS#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (ExpressLRS#448)

* Upgrade ESP8266 framework to allow larger IRAM (ExpressLRS#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (ExpressLRS#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (ExpressLRS#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (ExpressLRS#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (ExpressLRS#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (ExpressLRS#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (ExpressLRS#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (ExpressLRS#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (ExpressLRS#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (ExpressLRS#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (ExpressLRS#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (ExpressLRS#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (ExpressLRS#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (ExpressLRS#462)

Adds crc13 plus parity

* adds missing CRCInitializer (ExpressLRS#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (ExpressLRS#468)

* leave binding power to user selected (ExpressLRS#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (ExpressLRS#470)

* Convert LQCALC to be bit-based instead of 8-bit (ExpressLRS#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (ExpressLRS#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (ExpressLRS#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (ExpressLRS#477)

* FHSS tests (ExpressLRS#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (ExpressLRS#479)

* change CR 4/5 to LI 4/6 (ExpressLRS#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (ExpressLRS#472)

* Fix minor "bug" in FHSS (ExpressLRS#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (ExpressLRS#484)

* CRC Unit tests and proper fix for CRC13 (ExpressLRS#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (ExpressLRS#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (ExpressLRS#490)

* adds crcr14 (ExpressLRS#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (ExpressLRS#494) (ExpressLRS#495)

* Add stress testing code to the CRC test (ExpressLRS#496)

* Update tx_main.cpp (ExpressLRS#482)

* Enable bootloader command and clean stm32 linker files (ExpressLRS#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (ExpressLRS#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (ExpressLRS#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (ExpressLRS#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (ExpressLRS#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (ExpressLRS#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (ExpressLRS#500)

* Support for MSP messages (ExpressLRS#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (ExpressLRS#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (ExpressLRS#502)

* Spam sync packets on rf param change (ExpressLRS#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (ExpressLRS#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
brandonrc added a commit to brandonrc/ExpressLRS that referenced this pull request May 20, 2021
* user def for auto wifi interval (ExpressLRS#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (ExpressLRS#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (ExpressLRS#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (ExpressLRS#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (ExpressLRS#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (ExpressLRS#325)

* 2.4 GHz Rx Nano Diversity (ExpressLRS#239)

* RX_Nano_Diversity

* Feature/binding (ExpressLRS#304)

* adds binding

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (ExpressLRS#329)

* Ghost tx (ExpressLRS#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (ExpressLRS#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (ExpressLRS#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (ExpressLRS#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (ExpressLRS#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (ExpressLRS#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (ExpressLRS#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (ExpressLRS#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (ExpressLRS#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (ExpressLRS#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (ExpressLRS#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (ExpressLRS#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (ExpressLRS#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (ExpressLRS#361)

* Ghost bootloader (ExpressLRS#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (ExpressLRS#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (ExpressLRS#368)

* pp rx order and build details (ExpressLRS#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (ExpressLRS#375)

* 2.4 slimmer lite jr (ExpressLRS#384)

* Added Happy Model RX target (based on R9MM target) (ExpressLRS#385)

* Support for SIYI FM30 TX (ExpressLRS#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (ExpressLRS#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (ExpressLRS#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (ExpressLRS#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (ExpressLRS#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (ExpressLRS#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (ExpressLRS#399)

* removes stray return (ExpressLRS#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (ExpressLRS#392)

* fix lua offset (ExpressLRS#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (ExpressLRS#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (ExpressLRS#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (ExpressLRS#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (ExpressLRS#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (ExpressLRS#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (ExpressLRS#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (ExpressLRS#411)

* add ghost tx lite support

* Diversityfunction (ExpressLRS#287)

* add diversity function

* Add sensitivity display in lua (ExpressLRS#416)

* add sensitivity display in LUA

* 6km readme (ExpressLRS#412)

* Added support for mac os (Darwin) (ExpressLRS#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (ExpressLRS#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (ExpressLRS#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (ExpressLRS#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (ExpressLRS#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (ExpressLRS#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (ExpressLRS#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (ExpressLRS#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR ExpressLRS#417 (ExpressLRS#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (ExpressLRS#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (ExpressLRS#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (ExpressLRS#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (ExpressLRS#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (ExpressLRS#448)

* Upgrade ESP8266 framework to allow larger IRAM (ExpressLRS#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (ExpressLRS#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (ExpressLRS#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (ExpressLRS#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (ExpressLRS#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (ExpressLRS#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (ExpressLRS#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (ExpressLRS#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (ExpressLRS#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (ExpressLRS#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (ExpressLRS#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (ExpressLRS#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (ExpressLRS#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (ExpressLRS#462)

Adds crc13 plus parity

* adds missing CRCInitializer (ExpressLRS#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (ExpressLRS#468)

* leave binding power to user selected (ExpressLRS#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (ExpressLRS#470)

* Convert LQCALC to be bit-based instead of 8-bit (ExpressLRS#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (ExpressLRS#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (ExpressLRS#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (ExpressLRS#477)

* FHSS tests (ExpressLRS#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (ExpressLRS#479)

* change CR 4/5 to LI 4/6 (ExpressLRS#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (ExpressLRS#472)

* Fix minor "bug" in FHSS (ExpressLRS#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (ExpressLRS#484)

* CRC Unit tests and proper fix for CRC13 (ExpressLRS#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (ExpressLRS#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (ExpressLRS#490)

* adds crcr14 (ExpressLRS#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (ExpressLRS#494) (ExpressLRS#495)

* Add stress testing code to the CRC test (ExpressLRS#496)

* Update tx_main.cpp (ExpressLRS#482)

* Enable bootloader command and clean stm32 linker files (ExpressLRS#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (ExpressLRS#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (ExpressLRS#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (ExpressLRS#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (ExpressLRS#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (ExpressLRS#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (ExpressLRS#500)

* Support for MSP messages (ExpressLRS#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (ExpressLRS#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (ExpressLRS#502)

* Spam sync packets on rf param change (ExpressLRS#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (ExpressLRS#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
brandonrc added a commit to brandonrc/ExpressLRS that referenced this pull request May 20, 2021
* user def for auto wifi interval (ExpressLRS#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (ExpressLRS#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (ExpressLRS#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (ExpressLRS#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (ExpressLRS#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (ExpressLRS#325)

* 2.4 GHz Rx Nano Diversity (ExpressLRS#239)

* RX_Nano_Diversity

* Feature/binding (ExpressLRS#304)

* adds binding

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (ExpressLRS#329)

* Ghost tx (ExpressLRS#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (ExpressLRS#331)

* CCG Nano RX pin fix (ExpressLRS#333)

* Added v2.0 20x20 RX (ExpressLRS#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (ExpressLRS#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (ExpressLRS#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (ExpressLRS#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (ExpressLRS#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (ExpressLRS#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (ExpressLRS#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (ExpressLRS#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (ExpressLRS#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (ExpressLRS#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (ExpressLRS#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (ExpressLRS#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (ExpressLRS#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (ExpressLRS#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (ExpressLRS#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (ExpressLRS#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (ExpressLRS#361)

* Ghost bootloader (ExpressLRS#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (ExpressLRS#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (ExpressLRS#368)

* pp rx order and build details (ExpressLRS#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (ExpressLRS#375)

* 2.4 slimmer lite jr (ExpressLRS#384)

* Added Happy Model RX target (based on R9MM target) (ExpressLRS#385)

* Support for SIYI FM30 TX (ExpressLRS#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (ExpressLRS#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (ExpressLRS#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (ExpressLRS#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (ExpressLRS#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (ExpressLRS#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (ExpressLRS#399)

* removes stray return (ExpressLRS#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (ExpressLRS#392)

* fix lua offset (ExpressLRS#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (ExpressLRS#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (ExpressLRS#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (ExpressLRS#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (ExpressLRS#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (ExpressLRS#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (ExpressLRS#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (ExpressLRS#411)

* add ghost tx lite support

* Diversityfunction (ExpressLRS#287)

* add diversity function

* Add sensitivity display in lua (ExpressLRS#416)

* add sensitivity display in LUA

* 6km readme (ExpressLRS#412)

* Added support for mac os (Darwin) (ExpressLRS#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (ExpressLRS#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (ExpressLRS#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (ExpressLRS#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (ExpressLRS#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (ExpressLRS#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (ExpressLRS#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (ExpressLRS#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR ExpressLRS#417 (ExpressLRS#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (ExpressLRS#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (ExpressLRS#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (ExpressLRS#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (ExpressLRS#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (ExpressLRS#448)

* Upgrade ESP8266 framework to allow larger IRAM (ExpressLRS#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (ExpressLRS#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (ExpressLRS#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (ExpressLRS#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (ExpressLRS#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (ExpressLRS#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (ExpressLRS#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (ExpressLRS#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (ExpressLRS#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (ExpressLRS#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (ExpressLRS#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (ExpressLRS#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (ExpressLRS#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (ExpressLRS#462)

Adds crc13 plus parity

* adds missing CRCInitializer (ExpressLRS#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (ExpressLRS#468)

* leave binding power to user selected (ExpressLRS#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (ExpressLRS#470)

* Convert LQCALC to be bit-based instead of 8-bit (ExpressLRS#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (ExpressLRS#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (ExpressLRS#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (ExpressLRS#477)

* FHSS tests (ExpressLRS#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (ExpressLRS#479)

* change CR 4/5 to LI 4/6 (ExpressLRS#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (ExpressLRS#472)

* Fix minor "bug" in FHSS (ExpressLRS#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (ExpressLRS#484)

* CRC Unit tests and proper fix for CRC13 (ExpressLRS#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (ExpressLRS#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (ExpressLRS#490)

* adds crcr14 (ExpressLRS#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (ExpressLRS#494) (ExpressLRS#495)

* Add stress testing code to the CRC test (ExpressLRS#496)

* Update tx_main.cpp (ExpressLRS#482)

* Enable bootloader command and clean stm32 linker files (ExpressLRS#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (ExpressLRS#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (ExpressLRS#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (ExpressLRS#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (ExpressLRS#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (ExpressLRS#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (ExpressLRS#500)

* Support for MSP messages (ExpressLRS#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (ExpressLRS#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (ExpressLRS#502)

* Spam sync packets on rf param change (ExpressLRS#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (ExpressLRS#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
brandonrc added a commit that referenced this pull request May 20, 2021
* user def for auto wifi interval (#300)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* remove lq condition (#274)

* remove lq condition

* Update rx_main.cpp

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* put old bootloader frk generation back

* fix LOCK_ON_50HZ (#307)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* don't use stlink flash for legacy bootloader target

* adds tracer latency test results

* new images siyitx ghosttx frskylitepro frskylite-pullup (#314)

* new images siyitx ghosttx frskylitepro frskylite-pullup

* ftdi 2.4g diy lite

* adding README for diy 2.4 slim ftdi flashing

* typo readme fixed

* Fix link to ESP32 30 Pin Development Board (#323)

* Add 2.4 Ghz antenna to 2.4Ghz 1280 TX BOM (#325)

* 2.4 GHz Rx Nano Diversity (#239)

* RX_Nano_Diversity

* Feature/binding (#304)

* adds binding

* Update user_defines.txt (#331)

* CCG Nano RX pin fix (#333)

* Added v2.0 20x20 RX (#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* Fix BF passthrough init failing in DIY targets if already in PT (#329)

* Ghost tx (#327)

* Added ghost tx

* Added ghost tx target

* Updating the sx1280 driver to include the antenna select pin

* Updating the ini file for the ghost tx target

* Update antenna pins

* Updating the ghost_tx target in the ini file

* Commented out the RCSIgnal for now

* Updating ghost rcsignal pins

* Adding ghost_tx json board file

* Removing IDE files

* Adding variant, still need to adjust it all, not same variant as the RX

* Almost compiling :)

* Updated CRSF to include ghost tx

* Using a STM32F303CCT6 variant, still cannot get TX to work

* experimental ghost board files

* Update PeripheralPins.c

* Added define checks for music

* Update variant.cpp

* Update SX1280_hal.cpp

Typo, fix for ghost TX

* Update SX1280_hal.cpp

Fixed typos for ghost tx

* I can see debug serial messages

* Adding LEDs for ghost TX

* Setting power to low for testing

* Updated some variant files and created ghosttx IRQHandler

* updates

* working on bench

* Fixed the PA and RCSignal collision.

* GHOST_TX update

We got some power, 10mw to 50mw settings.

* Adjusting some power settings

Testing tomorrow with the 10, 25, 50, 100, and 250mw range.

Not real tests but just to see how it feels by a field.

* Cleaning up the dev code for official PR

* Update user_defines.txt (#331)

* CCG Nano RX pin fix (#333)

* Added v2.0 20x20 RX (#334)

* Added v2.0 20x20 RX

* Fix images

* Fix images some more

* Super slim pcb (#335)

* add super slim pcb

* add images and 3d models

* add print layout image

* add pcb pictures

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Feature STM32 simulated EEPROM support (#343)

* generic: .vscode cache dir removed from repo

* feature: STM32 simulated EEPROM

* 2.4 slimmer x9lite module (#346)

* Create readme.md

* Create readme.md

* Update readme.md

* Create x.md

* Create x.md

* Delete x.md

* Create x.md

* Add files via upload

* Delete x.md

* Add files via upload

* Rename PCB_2021-01-06_17-00-14_2021-02-05.json to EASYEDA-PCB_2021-01-06_17-00-14_2021-02-05.json

* Rename tx-slim-2.4g.sch_2021-02-05.json to EASYEDA-tx-slim-2.4g.sch_2021-02-05.json

* Add files via upload

* Update readme.md

* Add files via upload

* Update readme.md

* Update readme.md

* Update readme.md

* Add files via upload

* Delete x.md

* Rename PCB/2400MHz/TX1280-slimmer/readme.md to PCB/2400MHz/TX_SX1280_Slimmer/readme.md

* Create t.md

* Create t.md

* Create t.md

* Add files via upload

* Add files via upload

* updates

* Update readme.md

* Update readme.md

* updates

* update

* Delete 3.jpg

* Update readme.md

* Update readme.md

* Update tx_main.cpp

* Update CRSF.cpp

Fixed define issue I created.

* Fixed CRSF issue with GHOST_TX

Did not have include ghost_tx

* Revert "2.4 slimmer x9lite module (#346)"

This reverts commit c89ba79.

* Revert "Feature STM32 simulated EEPROM support (#343)"

This reverts commit 3f5d988.

* Revert "Revert "Feature STM32 simulated EEPROM support (#343)""

This reverts commit bd78235.

* Revert "Revert "2.4 slimmer x9lite module (#346)""

This reverts commit 0a97e56.

* Cleaning up files for GHOST_TX PR

Removing comments and unused code

* Removing IDE files

Clion created some IDE specific files.

* Cleaning up code for PR - Resolving cruwalller comments

* update power and buzzer

* Update platformio.ini

Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>

* updated 2.4 nano rx PCBs (#336)

* updated 2.4 nano rx PCBs

- Lager XO footprint for the FL520WFMT1.
- Remove ground form beneath the UFL.
- Adds wifi antenna

* Update tlm reporting to handset (#349)

Telemetry reporting changed to periodic and does not
depend on configured tlm ratio (OTA).
Reporting period can be  set manually according to
handset firmware requirement.

* fix develop tx issues (#358)

* CRSF: fix UART initialization

* TX: fix R9M DAC init and button init

* gitattributes file to auto generate version file for src releases (#359)

* Fix TLM issue

* fix ghst serial, remove backpack option

* Update user_defines.txt

* Adds new target for Happy Model ES915TX with power adjustments (#362)

* Adds new target for Happy Model ES915TX with power adjustments

* CR comments

* more CR comments

* CRSF: code cleanup to avoid duplicates (#360)

* CRSF: code cleanup to avoid duplicates

* fixed esp32 mixer sync

* tweaks

uart task to core 0 (arduino uses core 1)
disableWDT core 1.
debug baud set to 460800

* CRSF: small tweaks to make the uartwdt reporting a bit more stable

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Minor optimise (#356)

* Update common.h

* more

* Update user_defines.txt

* addresses comments

rename methods to make more sense

    void ICACHE_RAM_ATTR SetFrequencyHz(uint32_t freq);
    void ICACHE_RAM_ATTR SetFrequencyReg(uint32_t freq);

do comment changes

* Update FHSS.h

* revert user_def and cleanup some comments

* updates

remove consts
cleanup ICACHE_RAM_ATTR

* Update user_defines.txt

* fix build err

* fix ghst uart (set to push/pull)

* fix uart2

* Images for 20x20 0805 900Mhz RX component placement (#364)

* Images with component placement for 20x20 0805 900Mhz RX

* Buid Instructions

* fix CCG target STLINK flashing

* pp rx (#367)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* feature: validate serialrx configuration before applying the passthrough command (#361)

* Ghost bootloader (#354)

* feature: Ghost TX module STK500 bootloader

* bootloader: stm32f3 uart ctrl fix

* bootloader: ghost tx bootloader binary updated

Co-authored-by: cruwaller <cruwaller@gmail.com>

* cleanup platformio ini and defines (#363)

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* Compilation warnings fixed

* cleanup: platformio.ini to use common envs to avoid duplicate codes

* cleanup: some defines cleaned

* build fix

* build fix: platformio.ini was missing RX flags for ESP8285

* add via_stlink to CCG

* reset user_defs...

* Update platformio.ini

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* add v2 pcb and jr enclosure (#368)

* pp rx order and build details (#371)

* pp rx order and build details

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix HM target (#375)

* 2.4 slimmer lite jr (#384)

* Added Happy Model RX target (based on R9MM target) (#385)

* Support for SIYI FM30 TX (#381)

* Add FM30 bootloader although not yet functional

* Remove 250mW from FM30, was only 150mW anyway

* Minimal working R9M LP support (#366)

* Update targets.h

R9M Pro Lite Apc1 and Apc2

* Update POWERMGNT.h

Define R9M Max Power Output.

* Update POWERMGNT.cpp

Add Output powers for R9M Lite Pro SetOutputPower may not be correct.

* Update POWERMGNT.cpp

R9M Lite Pro use internal DACs

* Update tx_main.cpp

Enable DACs for R9M Lite Pro

* Update tx_main.cpp

Move PinMode to Void Setup

* Update targets.h

Updating R9M Lite Pro Pinout.

* Update POWERMGNT.h

Used enumerations for output powers where correct.

* Update targets.h

Added Buffer output enable pin for R9M Lite Pro.

* Fix RF switch control on R9M LP

* Fix EEPROM on R9M LP

* Bootloader: support for R9M lite pro.

* Bootloader support on R9M Lite Pro.

* Fix rebase artifacts

* Remove R9M_LITE_PRO_stock env for BL, because we cannot flash via stock BL.

Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>

* Finish pin initialization for inverter on FM30

* Rename BUFFER_OE to GPIO_PIN_RC_INVERT for clarity

* Fix missing extEEPROM library on some targets, dupe LED_RED

extEEPROM should only be included in targets that need it, not
in env_common_stm32

* Add telemetry support (#204)

* adds telemetry

* Move extEEPROM back into env_common_stm32

* add r9slim (old r9slim with 1 antenna port) target (#391)

* add r9slim target

* add frk bootloader

* remove frk as its not working, remove dumping bl

* resolve, remove unused bl

* remove comments

* Fix BUSYless 1280 lockups due to inadequate delay

The 1280 has 12-20uS BUSY periods during normal
command writes in addition to state changes. This
adds a deferred delay that is realized on the
next WaitNotBusy

* Revert GPIO_PIN_RC_INVERT to GPIO_PIN_BUFFER_OE

* Use defines for extra unused pin names

* Update build.yml

fix global builds failing

* fix esp32 link (#396)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* corrects r2 placement (#394)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* update to esptool v3 (#399)

* removes stray return (#400)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Switch FM30 to DFU bootloader

* Add environment support for flashing via DFU

* Fix: STM32L4xx (CCG + PP) simulated EEPROM fixed (#392)

* fix lua offset (#398)

* fix lua offset

* Bluetooth enable is actually active low

* Enable VCP as Serial for logging

* Reset after DFU upload

* Fixed MaxPower defines on POWERMGNT.h using enum items (#405)

* Fixed static defines using enum

* Updated maxpower and default power to take into account E28-2G4M27S (27dbm)

* Locked higher power for TARGET_1000mW_MODULE

* Limited max powers due to hardware limitations

* LORA1280F27 max power back to 250mW

* Fix warning about ignored tail of #ifdef (#413)

The test was only checking if the GPIO_PIN_FAN_EN was defined and ignored the last part checking that is was not UNDEF_PIN

* Removes unnecessary call to round on an integer value (#414)

Causes a cast to/from double as well and FP math is not the fastest in ESP32

* safeguard againts LUA and module mismatch (#406)

* add lua version compare

* fix code indent

* indentation change from space to tab

* reformat some other indents

* change sentence and add force use, add loading

* skip data length check on force use

* adds target namimnorc voyager targets (#410)

* Targets: Add NamimnoRC Alpha TX and RX targets (900MHz)

* ESPbackpack: R9M removed or replaced by STM32

* NamimnoRC Voyager (900MHz) RX and TX fixes

* Remove telemetry handling from 11bit mode (#415)

You can only enable telemetry in hybrid mode

* Ghost TX Lite (#411)

* add ghost tx lite support

* Diversityfunction (#287)

* add diversity function

* Add sensitivity display in lua (#416)

* add sensitivity display in LUA

* 6km readme (#412)

* Added support for mac os (Darwin) (#365)

* Removed os checks in runpython.py and added addition print statment to stlink.py

* Fix print statement in stlink.py

* Updating print statement in bootloader stlink.py

* Updating stlink to check for dawin (Mac OS)

* add 6km 500Hz record to readme

* change my name

Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>

* cleanup: platformio.ini file split into smaller pieces (#407)

* UNDEF_PIN is the farking devil

* Also fix new BUFFER_OE reference

* Moving OTA packet generation functions to OTA library (#417)

* Moving OTA packet generation functions to OTA library

* Fix some integer casting defects (#420)

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* adds GENERIC_CRC13 and parity lib (#418)

* adds GENERIC_CRC13 and parity lib

* update PP Rx cap

* update JLCPCB link

* Fix: passthrough to allow AUTO/OFF for serialrx_halfduplex (#423)

* Update rx_main.cpp

* Fixed ghost tx/rx led bug (#431)

* Fixed ghost tx/rx led bug

* Added LED init call to rx_main

* Feature: enable ESP82xx WIFI upload (#422)

* Fix needing double flash by disabing erase before write

* Cleaned up unused variable removed in PR #417 (#435)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir (#438)

* fixes DIY_2400_RX_ESP8285_SX1280_via_BetaflightPassthrough python dir

* fix platformio.ini

* Add FM30 to github workflow

* ESP82xx RX WIFI update improvements (#444)

* esp82xx rx web update to use local mdns

* config: esp82xx rx targets to use ip instead of dns

* Cleanup: STM32 linker command files merged (#437)

A common linker file is used to minimize maintenance.
MCU specific memory regions are kept in original files.

* Native unit testing (#428)

* Allow existing native tests to build and run

* Move targets and LowPassFilter headers to include directory

Remove Arduino.h where possible and use targets.h

* Expand the "native" target so tests compile and run

* Run the unit tests as part of the build

* Install native platform for tests

* Add tests for 10bit mode

* Move MSP tests to native tests

* Remove left over cruft

* Move encapsulated MSP tests to native tests

* Remove unused header

* Add unit test for CRSF mapping function

* Fix rounding errors in integer mapping function found by unit test

* Bugfix: if TLM_REPORT_INTERVAL_MS is defined LUA_VERSION const will be lost (#448)

* Upgrade ESP8266 framework to allow larger IRAM (#439)

* Change platform tools to allow chainging IRAM size

.

* Fix warnings caused by upgrading platform

* Fix commit hash to known working version of framework

* fix SYNC_INTERVAL (#393)

correct sync freq spacing

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Targets: adds target NamimnoRC FLASH TX and RX (#419)

* targets: add support for NamimnoRC FLASH (2.4GHz) module

* build fix: DAC_IN_USE definition corrected and POWERMGMT cleanups

* targets: namimnorc_2400.ini added to config list

* Update DAC.h

* Update build.yml

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Invert iq based on device addr (#222)

* init

* Update build.yml

* Improved timer locking code and freq offset adjust (PFD branch)  (#434)

* PFD training

* simplify

* bed time

* test code

* test code2

* test3

* restore defaults

* Update rx_main.cpp

* Update STM32_hwTimer.cpp

* don't print debug

* Update rx_main.cpp

* remove unused logic

* Pfd locked loop (#433)

* Remove ICACHE_RAM_ATTR from functions only used in setup

* Convert PFD to inline functions

* rename methods of PFD class

* Update platformio.ini

* updates

* Update rx_main.cpp

* Update rx_main.cpp

Co-authored-by: Paul Kendall <pkendall64@gmail.com>

* rename bool TickTock to isTick

* Update ESP8266_hwTimer.cpp

* fix build error

* one last time..

* PFD timer updates (move to tick())

* Update rx_main.cpp

* Update timing_diagram.pptx

* Fix NamimnoRC Voyager build (#451)

The DAC header file was checking the wrong build flag

* Revert "fix SYNC_INTERVAL (#393)"

This reverts commit d98ce89.

* hotfix diy 900M rx BF passthrough

* fix IQ swap

* fix IQ logic

* fix opentx linkstats reporting

* fix mod0 resulting in crash

* correct flash offset for bootloader + backpack

* fix all the things

* Fix R9SLIM RX build (#457)

Information was gleaned from the bootloader platform.ini file.

* Add SIYI FM30 mini RX (#456)

* Add a default debug_tool to platformio env
Does anyone else use a debugger?! :-D

* Add STM32F373xC variant with 16MHz crystal

* FM30 mini RX support

* Move stlink to stm32 debug env only haha I so dumb

* Refactor setup() for readability

Moved each initialization section to its own function,
and moved setup of serial to before the power-up
counter. The init doesn't even take 1ms and the libraries
write to Serial, which blocks if the buffer fills.

* Change RX to use POWERMGNT (still max power)

The FM30 series has a PA with absolute maximum input power
of +6dBm, prevent overpowering it with the +12.5 RX default

* Closer to zero average offset with no timerOffset

* Add bootloader/binaries build dir to gitignore

* Add FM30 mini RX bootloader, working!

* Updated bootloader which I forgot to check in question mark

* Finish the last of reorganizing RX setup()

* adds neutronrc 900 rx (#453)

* adds neutronrc 900 rx

* update speeds

* fixed

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Always calculate PFD result to prevent slew (#458)

If a packet wasn't received, the previous PFD result was being used over and over,
which would slew the hwtimer phase continously for each missed packet.

Also moves the intEvent to the first thing of the tock handler, because
it needs the reference time as close to when the timer fired as possible

* Parallel build (#450)

* Parallel builds

- Cache of platformio and python dependencies
- Fix flag parsing build_flags.py, passing flags via PLATFORMIO_BUILD_FLAGS creates a single entry with spaces!
- dynamically calculating the targets
- Added code to build_flags to allow removal of build flags, this means the defaults in user_defines.txt can be overridden/removed during the full build
- Build combos as part of each job

* Add detection for FM30 as 2400 regulatory domain

* fix adv tlm and minor things

* Update rx_main.cpp

* disable freq correction

* Adds crc13 plus parity  (#462)

Adds crc13 plus parity

* adds missing CRCInitializer (#465)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix betaflight passthrough flashing (#468)

* leave binding power to user selected (#466)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Quote the SOURCE parameter to the upload as that path may have spaces (#470)

* Convert LQCALC to be bit-based instead of 8-bit (#403)

* Convert LQCALC to be bit-based instead of 8-bit

* fix esp8266 rx uart

* Add Happy Model 2400 targets (#469)

* Added Happy Model 2400mhz targets

* Use extends for HM targets

* Link passthru to diy target

* bootloader: Fixed R9M firmare update using OpenTX (#474)

* fixes wifi

enables dns + mdns for esp32
disables mdns for esp8266 due to not enough space

* Add latest range tests to leaderboard (#477)

* FHSS tests (#464)

* Move FHSS & utils into libraries

* Rename utils to random

* Add FHSS tests

* Allow the tests to run under any Regulatory Domain

* Add another unit test for FHSS

* powermgmt: HappyModel ES915TX TX powers adjusted for 868MHz (#479)

* change CR 4/5 to LI 4/6 (#376)

* change CR 4/5 to LI 4/6

* Update common.cpp

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* lots of tweaks

platform update, timeout handling, better crsf.end(), set esp8266 to 160mhz, fast sync fix

* Add telemetry burst mode (#472)

* Fix minor "bug" in FHSS (#480)

Remove unused function

* Update diy_2400.ini

fix upload speed

* fix upload speed on 900mhz esp bfpassthrough

* fix freq offset adjustment

* fix diy espRX uploading

* Fix CRC13 error letting bad packets in (#484)

* CRC Unit tests and proper fix for CRC13 (#486)

* Fix CRC 13 to match known good CRC code

* Extend CRC test to use random data (#487)

* Extend CRC tests to use randomised test data

* Add 6-bit flip test

* Added extra test to check that 5 changed bits are detected as an error

* Changes to tests to use CRC poly from common.h

And also only use 50bits of data as in the OTA packet
Provide a define 'BIG_TEST' which will perform a million iterations vs 1000.

* Fixes as per review

* Increase number of big iterations to 10 million

Add "test" to print percentage of false positives for 6, 8 and 10 bit errors

* Handle stlink return val to properly indicate failure (#490)

* adds crcr14 (#493)

Co-authored-by: Jye <JyeSmith@users.noreply.github.com>

* Fix CRC14 unit tests (#494) (#495)

* Add stress testing code to the CRC test (#496)

* Update tx_main.cpp (#482)

* Enable bootloader command and clean stm32 linker files (#475)

* feature: enable bootloader command

Bootloader checks this memory area (if newer enough) and
perpare itself for fw update. Otherwise it skips the check
and starts ELRS firmware immediately.

* Bootloader: cleanup the code and fix ghst atto build error

Co-authored-by: AlessandroAU <alessandroaus@gmail.com>

* Change HYBRID_SWITCHES_8 to be 1-bit, 3-bit, 4-bit (#483)

* Conver SWITCHES_8 to be 1bit, 4bit, 3bit
AUX1 = 1-bit (2-pos), sent every frame
AUX2 = 4-bit (16-pos), round robin
AUX3-8 = 3-bit (3-pos or 6-pos), round robin

* Remove ARM_CHANNEL
The complexity involved in allowing the user to rearrange
the channels at both the TX and RX is far too high for its
benefit. AUX1 is always the ARM_CHANNEL as well as
the low-latency channel in HYBRID_SWITCHES_8

* Update test for new HYBRID_SWITCHES_8, add more

* Only add the git SHA to targets, not on tests
Fixes pio remote test not working because it doesn't
copy the git repository to the remote, only the files.

* Change AUX8 to be the 4-bit channel

* Remove debugging print

* Update tests for AUX8 wide switch

* Fix 6-pos switches not falling into Ardupilot range

* Convert switch endpoints to be 1000-2000

* Include RSSI2 in LINK telemetry, antenna in FC statistics (#459)

* Include RSSI2 in LINK telemetry
And also the active antenna to iNav, which actually uses it

* Move switchAntenna down closer to where it is used
Remove all the extra whitespace
Remove unused variable openTxRSSI

* Report TX power to OpenTX (except 50mW)

* Add powerToCrsfPower instead of currPowerToCrsfPower (#497)

* Add powerToCrsfPower instead of currPowerToCrsfPower
Also change the LUT for the return value to just use a case
statement since it is 20 byles less code on STM32?

* Super defines (#492)

* Add super_defines.txt to override user_defines.txt

* Use a safer iteration and modify build_flags in place

* Swtich back to allowing multiple undefines in flags
Our github workflows pass a bunch all in one line

* graphical stuff (#318)

* graphical stuff

* file export fix

* some additions

- hardware images updated
- attribution moved to readme
- styleguide with explanations

* redrawn and exported @2x resolution

* Support running unit tests on Windows (#500)

* Support for MSP messages (#473)

* working get api

* add config for tx

* add msp sender

* remove debug output

* lower timeout for resync

* add buffer for msp write requets

* reduce msp send rate

* compact telemetry frames before sending to skip empty data after crc

* add vtx setting + binding

* adjust tests for new msp function

* use msp sender without telmetry since binding/vtx also use the sender

* revert change of defines

* add length for msp messages + use macros for data size

* buffer on request during write is in transit

* schedule link package if msp receiver confirm value changed

* implement bind mode

* wait for response before sending next, add ttl for response to recover from missing messages

* fix exit bind mode

* Update CRSF.cpp

according to the opentx guys this delay here isn't needed anyway

Co-authored-by: Alessandro <AlessandroAUS@gmail.com>

* Python scripts updated (#504)

* scripts: enable support to build from zip file

* scripts: ESP firmware packing disabled for now

* targets: NamimnoRC ESP based 900 and 2400 receivers (#502)

* Spam sync packets on rf param change (#498)

* init

* Update tx_main.cpp

* remove extra prints

* Update tx_main.cpp

* Update tx_main.cpp

* more tweaks

* one more experiment

* Simplify rate switch and spamSync

* untested

* Don't change power if power isn't changed

* Make hwTimer have 1us resolution on TX

* FastForward hwTimer before EEPROM commit on TX
Writing to EEPROM blocks interrupts from firing if the code
exists in FLASH. Rather than try to move all the code to RAM
Just skip the timer forward to what it will be when the
write completes

* Add PRINT_RX_SCOREBOARD for RX debugging

* tweaks and fix for ESP32

Co-authored-by: Bryan Mayland <bmayland@capnbry.net>

* fix esp32 TX wifi not comming up

* ESP32 web update on radio failure + mode out of bound handling

* Update Readme.md (#348)

* Update Readme.md

Removed the supported hardware area (linked to the wiki instead, for size) and added some build flags

* Update README.MD part 2

Added More 2.4 Hardware options, and also added a link to the LR Comp wiki page

* Update README.md

* Added Donate Button

etc

* Updated Paypal colors to be inline with the paypal logo

see https://www.schemecolor.com/paypal.php

* Slimmed Supported Hardware List

merge when GHOST TX is in master now :)

* Update README.md

added more links to the wiki :)

Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com>
Co-authored-by: Jye <JyeSmith@users.noreply.github.com>
Co-authored-by: mavericm1 <33595410+mavericm1@users.noreply.github.com>
Co-authored-by: jurgelenas <julius@jurgelenas.lt>
Co-authored-by: wvarty <59873510+wvarty@users.noreply.github.com>
Co-authored-by: Cru Waller <24904289+cruwaller@users.noreply.github.com>
Co-authored-by: SpencerGraffunder <spencergraffunder@cedarville.edu>
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
Co-authored-by: Brandon Geraci <brandon.geraci@gmail.com>
Co-authored-by: Brandon Geraci <bradon.geraci@gmail.com>
Co-authored-by: P-I-Engineer <jarad.berkman@gmail.com>
Co-authored-by: cruwaller <cruwaller@gmail.com>
Co-authored-by: Johannes Bergmann <johbergmann@web.de>
Co-authored-by: Bryan Mayland <bmayland@capnbry.net>
Co-authored-by: Vladimir Pinchuk <vladimir.pinchuk01@gmail.com>
Co-authored-by: Jahnkeanater <jahnkeanater@aol.com>
Co-authored-by: Johannes <schugabe@gmx.at>
Co-authored-by: StonedDawg <68074253+StonedDawg@users.noreply.github.com>
Co-authored-by: Enrico Gambini <9280405+enrico1036@users.noreply.github.com>
Co-authored-by: Paul Kendall <pkendall64@gmail.com>
Co-authored-by: Spencer Graffunder <asymmetriccube@gmail.com>
Co-authored-by: Paweł Stefański <pawel.m.stefanski@gmail.com>
Co-authored-by: NiklasVoigt <niklasvoigt1997@gmail.com>
Co-authored-by: Nikhil Parikh <46944981+maybenikhil@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants