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
Configurable I2C pins for PWM capable (ESP32) receivers #2425
Conversation
Skip blank values in Lua TextSelection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with my recommended changes to the lua option generator / default config.
- BetaFPV SuperP with defining the target SDA/SCL pins - PASS can only make those pins I2C
- BetaFPV SuperP without defining the target SDA/SCL pins - FAIL can make any pins I2C, but they do not function. See changes to
setupWire()
below. PASS after changes - RadioMaster ER8 changing two pins to I2C - PASS (after changes) can make any pins I2C
- PWMP
6- FAIL changes needed. Offers DShot option, pin function not correct,I2C still does not work after changes (does not detect any devices)EDIT: I am an idiot that can not count past 5. This is a 5 pin PWMP not 6, works after assigning the correct pins, but needs DShot removed still.
For testing I2C I connected a BME280 and added a detect the end of to setupWire():
for(uint8_t address = 1; address < 127; ++address)
{
Wire.beginTransmission(address);
if (Wire.endTransmission() == 0)
DBGLN("I2C 0x%x", address);
}
Not sure why the ESP8266 does not find any I2C devices. Have you tested any ESP with I2C with this PR? Maybe my Matek P6 has the wrong pullup values, I will check with logic analyzer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, you even took out the DShot define. [my man! meme] For a moment I thought something was broken because the SCL showed up blank on the Lua, but then I reviewed the diff and did a little dance.
Retested all the above cases, checked via Lua and webui, everything is perfect and the new pin feature badges look great!
EDIT: webui screenshot for those who aren't fortunate enough to have seen how nice the Features badges look
Just for good measure, and because I put it on my desk and intended to test it as well, I tested with a RadioMaster 6ch Vario RX which has dedicated, non-shared I2C. Performed correctly, no pins show the feature for I2C and the Lua does not allow I2C to be selected for use on the PWM pins. |
# Conflicts: # src/html/index.html # src/html/scan.js
* Device Targets tweeaks (#2319) * Adding Happymodel EPW6 900MHz PWMP target (#2332) * HappyModel EPW6 900MHz PWMP target * extra commas removed * External module baudrate 400k baud max air-rate is 333Hz (#2327) * External module max freq at 400k baud is 333Hz * Adjust configured air-rate based on baud rate This ensures the OLED and Lua will display the correct/runtime value. Also, by saving the adjusted air rate, we ensure that the sync packet contains the correct rate. * Remove unnecessary IRAM attribute * Use startup baudrate rather than index If they don't match then all hell breaks loose! * Only modify the serial port if we've calculated a baud rate * Add pocket radio alias (#2342) * add prior_target_name to Jumper T-20 (#2351) * correct sx1280 irqMask and dio1Mask data type (#2335) * Correct rx power when using Regulatory_Domain_EU_CE_2400 (#2334) * correct rx power when using Regulatory_Domain_EU_CE_2400 * Slightly simpler getMaxPower implementation --------- Co-authored-by: Paul Kendall <pkendall64@gmail.com> * Add Back Stock BL to other STM targets (#2354) * Set power_high and _max to the same value (#2359) Happymodel 900 comes with a fan. Also the 900RX does NOT have a fan! * Faster fuzzy_snr (removed exp and float) (#2378) * Giving the precision back to `fuzzy_snr` (#2379) * Giving the preicision back to fuzzy snr * lower the scaleing factor for better fitted in int_16 * curly braket style matcing * Fix ESP8285 RX as TX (#2387) * end the build-in serial before starting CRSF serial * Remove the dodgy hacks/workarounds * Allow binary flash of DUPLETX_ESP (#2393) * hadling div/0 condition in fuzzy_snr (#2399) * Add float support to Lua (#2415) * added float to elrsV3 script * attempting unload float code at radio check * moved check radio check * initialize index 9 in if statement * Add lua float implementation, change VTX channel to int type * Consolidation of all numeric types to use common load/save/displays * Use one field for exit/back * Operate in place on fieldData that is just one chunk * Return of arrows for EdgeTX 2.9 -- Merge fieldGetString and fieldGetSelectOpts -- Remove byteToStr and loadSymbolChars * Remove lua float impl and example * Extra break :( --------- Co-authored-by: MNS26 <michaelsnip@hotmail.com> * Remove the UART_INVERTED option (#2409) * Remove the UART_INVERTED option It's not actually used any more. It just sets whether the (ESP32) TX starts in inverted mode or not! * Deprecate rather then remove options * Support Graupner HoTT telemetry sensors (#2408) * initial commit for master * adapt to #2383 * adapt to #2383 * moved all static to class definition scheduling code changed to follow now-last > rate scheme integer lat/long calculation fixed style else if style violations * updated to project style guide * Baro and Battery detection are used in a status latching way. Updated accordingly Made checking Baro and Battery detection use getter Moved HoTT frame processing to processBytes() and added check for frame start and end byte to frame sanity checks * changes to satisfy style guide revamped HoTT telemetry frames to a more consistent style * missed renaming a field * Fix my cockup and flash optimisation (#2417) * Fix debugging the timer offsets (#2407) * Fix for SELECT types with only one value (#2416) * Adding DShot Output to ESP32-based ELRS PWM Receivers (#2346) * Add DShot Output First pass at adding DShot output using the DShotRMT library * Add use only for ESP32 * Only include DShotRMT when PWM is defined * Move DShot options to end of array * Trying to make DShot output mappable Kind of works but slows the output significantly for some reason. Need to troubleshoot. * Finally working! Erased flash and did a clean build * Reorder DShot enum so it comes before Serial * Map DShot output to new RMT channels * Fixes for Dshot Had to upgrade the base platform because of RMT driver bugs! * Upgrade config to shift somSerial up to it's new value * Minor cleanup * Disallow DShot on ESP8285 and GPIO0 on ESP32 Also fix previous balls up * Set throttle to zero on dshot initialisation So the ESC can continue its initialisation * Fix crash when selecting DShot * code reformat * Fix 8285 compilation --------- Co-authored-by: Paul Kendall <pkendall64@gmail.com> * Update PWM.h (typo fix) (#2427) * Use external targets repo (backport) (#2426) * add udp wifi joystick * check if udp is not null * change type to int32 to match crsf type * add mdns services back in * add port to joystick broadcast * map channel range similar to BLE joystick range * add usage documentation * add usage documentation * fix RSNR after #2399 (#2436) * fix LBT fall back mode (#2430) * Optimize and fix broken FM30 target (#2413) * Remove lto for FM30, back into CRITICAL_FLASH * Remove use of std::function where possible * Terrible fix for headTrackingEnabled compile error * All separate firmware dir to targets dir (#2433) * SPIEx on ESP32 was using the wrong underlying bus! (#2431) * OLED/TFT menu updates (#2432) * Add switch-mode and antenna-mode menu entries * Remove unused define * Various web UI fixes and improvements (#2422) * Improve display of wifi-on-interval in web UI * A little nicer UX around the bind-phrase handling * Add missing Serial protocols and UX improvements * Nicer upload buttons * Make label usage consistent * Use more portable CSS * Fix TX bug * Only query wifi networks when clicking on the network tab * puts the fix for #2028 back into business - 3.x.x-maintenance (#2438) * Hide lua backpack items if the backpack is disabled (#2429) * Disable Backpack Telemetry lua item if backpack disabled * Hide backpack items instead of changing the text * Include INFO type in reloadRelatedFields() * Embarassing bad code was reloading EXIT/Devices too * Shorten broadcast magic, include len of name, network byte order * Update documentation for changes * Convert to more generic UDP service * Allow default parameters, limit to 1000Hz max * joystick_begin params are optional * Add device name to elrs.udp MDNS record * Send integers in little endian format instead of network order * Oops, undo the setting out the out directory * Fixes for LEDC driven PWM channels on ESP32 (#2423) * fixes for LEDC PWM channels on ESP32 * Do NOT set failsafe on startup - needs discussion * Fixes as per review * Set failsafe on startup * Address review comments * change channel range to 15bit * improve documentation * fifo: avoid overflowing size argument (#2442) Co-authored-by: bkleiner <b.kleiner@str8labs.com> * pack struct * send response after stopping the joystick * Automatically save the RX initial rate on disconnect (#2424) * Automatically save the RX initial rate on disconnect * Remove Init Rate RX lua config item * chore: adapt serial protocol labels in WebUI and LUA script (#2459) * adapted labels for serial protocol selection in WebUI and LUA script * revert LUA label to "Protocol" * add nvs set and get for backpackTlmEnabled (#2467) * Configurable I2C pins for PWM capable (ESP32) receivers (#2425) * Configurable I2C pins * Lua configuration of I2C pins Skip blank values in Lua TextSelection * WebUI updated for I2C configuration * Set global flag if I2C enabled * Fixes after review and discussion on discord * Add indicators as to the supported features of a pin * fix-HARDWARE_led_reg_green-spelling --------- Co-authored-by: deadbytefpv <83231715+deadbytefpv@users.noreply.github.com> Co-authored-by: Paul Kendall <pkendall64@gmail.com> Co-authored-by: Jye <14170229+JyeSmith@users.noreply.github.com> Co-authored-by: Sunjun Kim <SunjunKim@users.noreply.github.com> Co-authored-by: Bryan Mayland <bmayland@capnbry.net> Co-authored-by: MNS26 <michaelsnip@hotmail.com> Co-authored-by: Michael <mha1@users.noreply.github.com> Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> Co-authored-by: Arkhipov Ivan <arkhipov.iv99@mail.ru> Co-authored-by: Johannes Kasberger <schugabe@gmx.at> Co-authored-by: Benedikt Kleiner <benedikt.kleiner@googlemail.com> Co-authored-by: bkleiner <b.kleiner@str8labs.com>
This allows the user to select which pins to use as I2C pins (
I2C SDA
andI2C SCL
in Lua).Also this allows a target to nominate pins as I2C pins, so only those pins are able to be selected. e.g. the BetaFPV Super-P receivers which have a separate connector for I2C.
Allowing the user to enable I2C currently means that an SPL06 barometer can be wired up to provide altitude and vertical speed telemetry.