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

Add telemetry support #204

Merged
merged 66 commits into from Mar 16, 2021
Merged

Add telemetry support #204

merged 66 commits into from Mar 16, 2021

Conversation

schugabe
Copy link
Contributor

@schugabe schugabe commented Nov 1, 2020

This PR adds (optional) telemetry support.

Three new components are added:

  • Telemetry Receiver
  • Stubborn Sender
  • Stubborn Receiver

Telemetry Receiver

This is a rewrite of the crsf telemetry receiver that was already implemented. The receiver buffers the last received telemetry messages and has support to get the next updated messages. The following telemetry messages are supported: GPS, BATTERY_SENSOR, ATTITUDE, DEVICE_INFO, FLIGHT_MODE

Even if the telemetry support is disabled, some parts are required since the bootloader for stm32 targets is called via telemetry messages.

Stubborn Sender

The sender runs on the receiver on the quad. In HandleSendTelemetryResponse two different types of telemetry packages are sent to the tx: ELRS_TELEMETRY_TYPE_LINK (as before) and ELRS_TELEMETRY_TYPE_DATA. The new message sends 5 bytes at the same time until the tx flips one bit to confirm the reception. Then the next 5 bytes are sent until the bit is flipped again. This simple mechanism ensures that the data isn't duplicated and that the retransmit happens until the reception is confirmed.

If sender/receiver lose sync there is an automatic sync recovery in place.

ELRS_TELEMETRY_TYPE_LINK and ELRS_TELEMETRY_TYPE_DATA is sent in an alternating order.

  • To get the same link update rate the telemetry rate can be set to 32.
  • If you set a telemetry rate of 16, the ELRS_TELEMETRY_TYPE_DATA is sent twice as often. This way the link update happens at the same frequency as in the case of the telemetry rate of 64 but the telemetry data is sent faster

Stubborn Receiver

The receiver runs on the tx. The confirmation bit is sent on the slot of one of the 1-Bit switches or on the free bit in the hybrid switch data. When the receiver receives one complete frame, it's sent to opentx.

There are native tests for all modules that can be run without any hardware. I extracted some generic crsf definitions to a separte header file so I can use this defines without pulling in hardware dependent includes.

Test the PR

  • Enable telemetry in your FC
  • Scan for sensors on TX
  • check if you see the voltage RxBt value on the TX to verify that basic telemetry is working
  • Download my fork of the repository: https://github.com/schugabe/ExpressLRS
  • Open it in Visual Studio Code
  • In bottom left of the IDE you see "master-dev", click on it and select telemetry
  • Edit user settings: make sure you have the lines with "-DENABLE_TELEMETRY" and "-DHYBRID_SWITCHES_8" enabled
  • Flash TX + RX
  • Scan for sensors the list should be longer
  • Increase the telemetry rate with the expresslrs lua script. Increase the rate until the sensor lost warnings go away. I use up to 1:16 with 200Hz

@AlessandroAU
Copy link
Member

You've done a lot of work! Thank you. I promise I will take a deep look into this soon.

@schugabe schugabe force-pushed the telemetry branch 3 times, most recently from 4ddac0a to f0532d4 Compare December 4, 2020 21:06
@schugabe
Copy link
Contributor Author

schugabe commented Dec 4, 2020

@AlessandroAU I did merge in the current changes to the branch and it seems that everything is still working.

You mentioned on discord that you would like to send the LinkStatistics also with the new method. What would be the advantage? It does not seem that there is any more data in the LinkStatistics used.

@greenbigfrog
Copy link
Contributor

@mdj36 please join us in the Discord located at http://discord.gg/dS6ReFY for support and we'll try to help you. A Pull Request is definetly the wrong place :)
Also, please make sure to read through the wiki at https://github.com/AlessandroAU/ExpressLRS/wiki

@mdj36
Copy link

mdj36 commented Dec 5, 2020

From git clone everything runs go testing gps telemetry in Q7

@mdj36
Copy link

mdj36 commented Dec 6, 2020

Sory but no gps telemetry with build: 305f26b

@IllusionFpv
Copy link
Contributor

@schugabe one question about this code, I have some quads where I don't need telemetry but I want it in fixed wings, is it possible to enable telemetry option only in TX? So I can have telemetry only in crafts where I need (flashing with no telemetry in quad rxes for example)

@schugabe
Copy link
Contributor Author

schugabe commented Dec 8, 2020

@schugabe one question about this code, I have some quads where I don't need telemetry but I want it in fixed wings, is it possible to enable telemetry option only in TX? So I can have telemetry only in crafts where I need (flashing with no telemetry in quad rxes for example)

If your quad does not output telemetry nothing is sent back to the TX. So you could simply flash everything with telemetry enabled and use the settings of the FC to disable/enable telemetry as you need it. But I have to try this use case before I can really confirm that it works. Did you try my branch? Does it work for you?

@IllusionFpv
Copy link
Contributor

@schugabe not tried yet, but I refer to the possibilty of using default basic telemetry on quad and enable telemetry on wing's rx for example

@ssombra
Copy link

ssombra commented Dec 8, 2020

@schugabe one question about this code, I have some quads where I don't need telemetry but I want it in fixed wings, is it possible to enable telemetry option only in TX? So I can have telemetry only in crafts where I need (flashing with no telemetry in quad rxes for example)

If your quad does not output telemetry nothing is sent back to the TX. So you could simply flash everything with telemetry enabled and use the settings of the FC to disable/enable telemetry as you need it. But I have to try this use case before I can really confirm that it works. Did you try my branch? Does it work for you?

How can I try your branch? I would like to try telemetry on my quads.

@schugabe
Copy link
Contributor Author

schugabe commented Dec 8, 2020

@schugabe one question about this code, I have some quads where I don't need telemetry but I want it in fixed wings, is it possible to enable telemetry option only in TX? So I can have telemetry only in crafts where I need (flashing with no telemetry in quad rxes for example)

If your quad does not output telemetry nothing is sent back to the TX. So you could simply flash everything with telemetry enabled and use the settings of the FC to disable/enable telemetry as you need it. But I have to try this use case before I can really confirm that it works. Did you try my branch? Does it work for you?

How can I try your branch? I would like to try telemetry on my quads.

I updated the description of the PR. If you need more information you could join the discord.

@schugabe
Copy link
Contributor Author

schugabe commented Dec 8, 2020

@schugabe not tried yet, but I refer to the possibilty of using default basic telemetry on quad and enable telemetry on wing's rx for example

The link status telemtry still would be sent back but the battery voltage isn't sent any more. So there is basic telemetry but if you need more data you have the option to enable this feature.

@ssombra
Copy link

ssombra commented Dec 8, 2020

@schugabe one question about this code, I have some quads where I don't need telemetry but I want it in fixed wings, is it possible to enable telemetry option only in TX? So I can have telemetry only in crafts where I need (flashing with no telemetry in quad rxes for example)

If your quad does not output telemetry nothing is sent back to the TX. So you could simply flash everything with telemetry enabled and use the settings of the FC to disable/enable telemetry as you need it. But I have to try this use case before I can really confirm that it works. Did you try my branch? Does it work for you?

How can I try your branch? I would like to try telemetry on my quads.

I updated the description of the PR. If you need more information you could join the discord.

Just flashed your branch and, although I do receive more sensors, including GPS which was I was looking for, I keep getting "telemetry lost", "telemetry recovered" messages.

@ssombra
Copy link

ssombra commented Dec 8, 2020

@schugabe one question about this code, I have some quads where I don't need telemetry but I want it in fixed wings, is it possible to enable telemetry option only in TX? So I can have telemetry only in crafts where I need (flashing with no telemetry in quad rxes for example)

If your quad does not output telemetry nothing is sent back to the TX. So you could simply flash everything with telemetry enabled and use the settings of the FC to disable/enable telemetry as you need it. But I have to try this use case before I can really confirm that it works. Did you try my branch? Does it work for you?

How can I try your branch? I would like to try telemetry on my quads.

I updated the description of the PR. If you need more information you could join the discord.

Just flashed your branch and, although I do receive more sensors, including GPS which was I was looking for, I keep getting "telemetry lost", "telemetry recovered" messages.

My setup: QX7, RM9 and r9mm

@schugabe
Copy link
Contributor Author

schugabe commented Dec 9, 2020

@ssombra I forgot to mention that you have to increase the telemetry rate with the expresslrs lua script. Increase the rate until the warnings go away. I use up to 1:16 with 200Hz to get the fastest update rate.
If the warnings are not resolved this way please post the Hz/tlm rate settings and also what flight controller + firmware you are using.

@ssombra
Copy link

ssombra commented Dec 9, 2020

@ssombra I forgot to mention that you have to increase the telemetry rate with the expresslrs lua script. Increase the rate until the warnings go away. I use up to 1:16 with 200Hz to get the fastest update rate.
If the warnings are not resolved this way please post the Hz/tlm rate settings and also what flight controller + firmware you are using.

That did the trick! thanks. Which is the downside of increasing the telemetry rate? is there a deterioration of the performance in some way? range for instance? I flashed a long range quad I had set up with iNav and of course GPS information is valuable, but if there is a trade off between having that information in the radio and losing range, I can live with only the OSD GPS information.

@greenbigfrog
Copy link
Contributor

Basically, at 1:16, it'll send 16 controll packets, pause for one and listen for the telemetry packet, before then sending another 16, waiting for one telemetry, and so on
It's not about range, more about an increase in latency etc again from my understanding since every once in a while you're trading a control packet for a telemtry one.

Your rx only sends out telemetry with roughly 50mW IIRC, so it's your telemetry link limiting your range.
For a dedicated longrange system that requires telemetry (ardupilot etc), you'll want to look into using a seperate telemetry link with higher bidirectional power most likely.

@ssombra
Copy link

ssombra commented Dec 9, 2020

Basically, at 1:16, it'll send 16 controll packets, pause for one and listen for the telemetry packet, before then sending another 16, waiting for one telemetry, and so on
It's not about range, more about an increase in latency etc again from my understanding since every once in a while you're trading a control packet for a telemtry one.

Your rx only sends out telemetry with roughly 50mW IIRC, so it's your telemetry link limiting your range.
For a dedicated longrange system that requires telemetry (ardupilot etc), you'll want to look into using a seperate telemetry link with higher bidirectional power most likely.

Thanks for the explanation, I think I got it. Actually when I said long range it is more likely medium range cruiser (not expecting going tens of kms away). In both cases anyway, latency is not a big of an issue. Regarding telemetry on the radio, it is just for having coordinates in case of an accident and no OSD recording (it happens :)).

@Rogero-
Copy link
Contributor

Rogero- commented Dec 10, 2020

hi, i know the hard work and complications already present with the Telemetry addition to ELRS, just please keep in mind the Betaflight Configuration LUA script requirements if possible to have it working someday, it helps a great deal in tuning quads and changing settings on the field (maybe as an option that can be enabled or not if it affects the Link performance/latency) since you're the only one currently working on the Telemetry related code, and thanks for your efforts.

@schugabe
Copy link
Contributor Author

I know that some people would like to have the LUA feature but I did not look into it yet.

Since I got some feedback and it seems to work for other people as well I'm removing the draft flag of the PR.

@schugabe schugabe marked this pull request as ready for review December 14, 2020 08:02
@ClickNciak
Copy link

Waiting for this great feature!!!
Other great value, amazing work 🙌🏽

@jejakmedia
Copy link

I've tried it. but telemetry works fine at 200hz pack rates

@jejakmedia
Copy link

@schugabe one question about this code, I have some quads where I don't need telemetry but I want it in fixed wings, is it possible to enable telemetry option only in TX? So I can have telemetry only in crafts where I need (flashing with no telemetry in quad rxes for example)

If your quad does not output telemetry nothing is sent back to the TX. So you could simply flash everything with telemetry enabled and use the settings of the FC to disable/enable telemetry as you need it. But I have to try this use case before I can really confirm that it works. Did you try my branch? Does it work for you?

How can I try your branch? I would like to try telemetry on my quads.

I updated the description of the PR. If you need more information you could join the discord.

Just flashed your branch and, although I do receive more sensors, including GPS which was I was looking for, I keep getting "telemetry lost", "telemetry recovered" messages.

I've tried it. but telemetry works fine at 200hz pack rates

@bobbillfold
Copy link

@jejakmedia Did you get Betaflight LUA 1.5 scripts working? I have telemetry, but BF LUA stuck on initializing screen

@greenbigfrog
Copy link
Contributor

greenbigfrog commented Jan 13, 2021

@jejakmedia Did you get Betaflight LUA 1.5 scripts working? I have telemetry, but BF LUA stuck on initializing screen

Are you actually running this branch/code? (Not sure if it works even if you do.)

@bobbillfold
Copy link

@jejakmedia I used the RC, but didn't think BF LUA was fully supported yet. Still doing my research, but I think we need full telemetry. Just got that same answer on discord.

@cruwaller
Copy link
Collaborator

Rebased after PR merges to develop branch. Fixes also build issue with 2400 targets.

@jejakmedia
Copy link

Rebased after PR merges to develop branch. Fixes also build issue with 2400 targets.

where is i can download new file merger?

@cruwaller
Copy link
Collaborator

Rebased after PR merges to develop branch. Fixes also build issue with 2400 targets.

where is i can download new file merger?

Just fetch this PR again :)
You might need to reset your local checkout if you have clone the repo. Or just clone it again :)
I think easiest is to use ELRS Configurator which should handle all automatically :)

@cruwaller
Copy link
Collaborator

Oh my bad, Configurator does not have that new flag :/
You need to use old school method 😎

@jurgelenas
Copy link
Member

Oh my bad, Configurator does not have that new flag :/
You need to use old school method 😎

I could add that user define in the configurator :)

@jejakmedia
Copy link

jejakmedia commented Mar 6, 2021

Oh my bad, Configurator does not have that new flag :/
You need to use old school method sunglasses

Telemetry Issues Latest rebased PR # 204

my setup: 100Hz 100 mw TLM Ratio 1:32 & 1:16 (same result)

https://youtu.be/IlCAHUr6VA0

A new problem after PR (Add telemetry support # 204) merged. In this video I use the last rebase PR # 204. The results of the gps telemetry are very slow as is the TBS Crossfire.
In December 2020 I tried rebase PR # 204 and the results were amazing, GPS telemetry was very fast. Does anyone have a December 2020 rebase file? I'll put it back on or anyone can solve this issues?
#204

@jejakmedia
Copy link

the more telemetry messages, the slower the speed of telemetry such as TBS Crossfire. do can speed telemetry of GPS like as TQly (Like i before rebased)

@brandonrc
Copy link
Member

Found this in Facebook. Someone posted it. Looks like people are complaining about GPS update speed on telemetry.

Marios Chrysomallis solve: https://youtu.be/7K3g4HDLw2s

@brandonrc
Copy link
Member

Nvm saw it on the development branch as well... late to the party

@JyeSmith JyeSmith merged commit c40ff93 into ExpressLRS:develop Mar 16, 2021
@expipiplus1
Copy link

I think that the readme could use an update as the mentions of telemetry functionality seem a little out of date now.

@sfjuocekr
Copy link

I've compiled and flashed the latest develop branch to my newly received HappyModel ES915.

I do get telemetry, but only the first ten values. GPS, BATTERY_SENSOR, ATTITUDE, DEVICE_INFO and FLIGHT_MODE are not received.

@schugabe
Copy link
Contributor Author

schugabe commented Apr 9, 2021

I've compiled and flashed the latest develop branch to my newly received HappyModel ES915.

I do get telemetry, but only the first ten values. GPS, BATTERY_SENSOR, ATTITUDE, DEVICE_INFO and FLIGHT_MODE are not received.

Did you enable telemetry? You have to remove the # from this line:
https://github.com/ExpressLRS/ExpressLRS/blob/develop/src/user_defines.txt#L66

For more questions please join the discord

@sfjuocekr
Copy link

Yes, I did remove the comment hash (I wasn't born yesterday).

I think I found the culprit, the TX pin on the FC I tried to use seems to be high all the time. Will try another FC today, but I'm fairly sure that is the issue as I couldn't get passthrough flashing to work on that one either.

@mdj36
Copy link

mdj36 commented Apr 13, 2021

At a moment most stable release for me:
https://github.com/schugabe/ExpressLRS/tree/telemetry-before-rebase Yes telemetry update would be nice to have faster (current 2.5 sec update time), but R9 2019 and r9mm working just fine i use 100 mw power for flights around me ( till 1.5 km from me). now issue stable works use it on my favorite 5 drones.
You can have always fresh with many bugs and really unstable: https://github.com/ExpressLRS/ExpressLRS/tree/develop version but flashing twice or more time per day i am little bit tied :)

@sergeyprokofev
Copy link

I've compiled and flashed the latest develop branch to my newly received HappyModel ES915.

I do get telemetry, but only the first ten values. GPS, BATTERY_SENSOR, ATTITUDE, DEVICE_INFO and FLIGHT_MODE are not received.
Confirm. Inav only has the first ten telemetry values. In BF, all values are. Tested on Matek F405se.

@Pairan
Copy link

Pairan commented Apr 20, 2021

@schugabe
In my tests I found, that the telemetry values first show up after the second start of the flying thing! The Receiver reports to receive telemetry data yet the desired GPS and stuff is missing at that point.
After shutting down the wing and restarting is, the telemetry immediately shows up and GPS is broadcasted after having a satelite link

... hope this observation helps who is trying this PR too :) Looking forward to see this stable as it can't be something big and nasty (otherwise it wouldn't work, right?)

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>
@schugabe schugabe deleted the telemetry branch April 28, 2021 18:00
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