Commit Graph

68 Commits

Author SHA1 Message Date
Frank
9312506217 detection of "OPI" flash (esp32s3 WROOM-2) 2024-10-30 18:40:26 +01:00
Frank
569ba1c626 s3: better handling of PSRAM pins 2024-09-21 19:29:28 +02:00
Frank
095d18bca5 board definition for T7-S3 (LILYGO / TTGO) 2024-09-21 19:27:17 +02:00
Frank
7f9da309c9 const const const
adding hints for the compiler for optimization.
In case your custom build complains about "const", just remove the keyword. based on e82f38e277, but going further :-)

* "const" class functions : function does not modify any class attributes ( --> "this" becomes const)

* __attribute__((pure)) :  function return value depends only on the parameters and/or global variables. The function does not modify any global or static variables.
* __attribute__((const)) : function only examines arguments (no globals), and has no effects except the return value. This slightly more strict than "pure"
* hot: tells the compiler "this functions is called very often"
* cold: the opposite of hot
2024-08-07 14:58:38 +02:00
Will Tatam
99511f2448 Merge branch 'mdev' into ESP32-HUB75-MatrixPanel-DMA 2024-02-22 21:39:53 +00:00
Will Tatam
a92292a780 Allocate pins using pinManager 2024-02-22 10:56:18 +00:00
netmindz
42109fe606 Merge branch 'mdev' into dmx_input 2024-01-16 13:27:42 +00:00
Frank
2265af57c9 pin info for PICO boards (cosmetic)
pico boards don't have PSRAM, but they reserve 16+17 for embedded flash
2024-01-02 19:49:41 +01:00
Frank
c8b7ad749a new pin owner 2023-12-15 22:09:48 +01:00
Frank
8905992a89 code spell checking - part4 (MM specific) 2023-12-15 00:14:57 +01:00
Arne
3b9b9f59e1 Revert "Rename WLED_ENABLE_DMX to WLED_ENABLE_DMX_OUTPUT"
This reverts commit e3f256bd44.
2023-10-22 20:52:31 +02:00
Arne
e3f256bd44 Rename WLED_ENABLE_DMX to WLED_ENABLE_DMX_OUTPUT 2023-09-24 13:30:17 +02:00
Arne
3da53bbed7 handle DMX_INPUT in PinManger::getOwnerText 2023-09-24 13:30:09 +02:00
Arne
a516a7b85f Move dmx_input pin allocations from wled.cpp to dmx.cpp 2023-09-24 13:30:09 +02:00
Frank
bb6f84d18c pin summary: don't report "fake" conflicts with same owner
sometimes happens in debug mode.

GPIO    | Assigned to           | Info
--------|-----------------------|------------
i/o   1   debug output      !! Conflict with debug output !!      Serial TX
2023-08-25 17:26:40 +02:00
Frank
3bd0f70109 minor fix for 8266
small typo, resulting in "A0" listed twice in the pin info.
2023-08-22 22:49:01 +02:00
Frank
7d0e627e14 some effect optimizations
* getpixelcolor: attribute pure - it reads memory, but does not write
* some optimizations for SEGMENT.blur() and SEGMENT.fadeToBlackBy()

* FX.c:pp remove double calls to blur() and fade_out()
* FX.cpp: SEGMENT.setUpLeds() added to effects, to enable LED buffering (safe some time because getPixelColor does not need to access NeopixelBus)

* a few other optimizations to safe time and avoid "expensive" operations
* set I2C bus speed to 400kHz (default is 100Khz)

* a few other small optimizations and tweaks
* pio: esp32 V4 builds use "patch5" toolchain version, which contains a few bugfixes especially for memory management.
2023-05-03 20:33:23 +02:00
Frank
cc9a19bc1d partial merge of upstream/main
* leaving out DotStarHspi5MhzMethod, as we are still on NPB 2.6.9 for eth boards
* leaving out the index.css/index.css changes, as I'm not sure how to merge this.

@ewoudwijma we need to merge the JS and CSS parts when you are back; I'll stay with our MM version for now.
2023-04-14 19:53:04 +02:00
Ewoud
27c4d98ada Net Debug / Net Serial updates
Add PinManagerClass::manageDebugTXPin to handle allocating pins for WLED_DEBUG_HOST and WLED_DEBUG
2023-03-23 14:21:42 +01:00
Frank
2de7971623 mpu6050 usermod: allow to disable usermod
* added usermod config information (so it can be disabled)
* check that "INTERRUPT_PIN" does support interrupts (MM specific)
* expose "dmpReady" in public interface
* adjusted games usermod to switch to "simulation" in case mpu6050 is not active

Still toDo:
1. add interrupt PIN and errormessages to settings page.
2. de-alloc intPin when disabled (and disable interrupt)
3. usermod is still destroying DEBUG_PRINT macros.
4. temporarily disable MPU interrupt when  onUpdateBegin(true)
2023-03-14 20:52:48 +01:00
Ewoud
f00558c5f4 DEBUGOUT improvements 2023-02-24 19:03:52 +01:00
Ewoud
15d753aa4a Show analog pins in pin dropdown and show only if analog signal
- shorten oappend MM function names
- add aOpt: analog options only
- add pin 17 for esp8266 (analog pin)
- add a.pins array to show analog pins in pin dropdown
2023-01-23 20:44:12 +01:00
Frank
5eb18a6173 Pin Info update
* Additional functions: isPinPWM, isPinINT
* aliases: PM_ADC1 instead of PinManagerClass::ADC1
* make getADCPin work on "classic ESP32"

--> Tested and works on 8266, ESP32 (default platform), ESP32 (V4 Platform). ESP32-S3, ESP32-S2, ESP32-C3
2023-01-20 22:13:30 +01:00
Frank
45e46822a1 PinManager: additional GPIO infos
bool isPinTouch(int gpio);                                   // true if gpio supports touch functions
  bool isPinAnalog(int gpio);                                  // true if gpio supports analogRead
  bool isPinADC1(int gpio);                                    // true if gpio supports analogRead, and it belongs to ADC unit 1
  bool isPinADC2(int gpio);                                    // true if gpio supports analogRead, and it belongs to ADC unit 2
  #define PM_NO_PIN 255
  typedef enum { ADC_none = 0, ADC1 = 1, ADC2 = 2 } AdcIdentifier;
  uint8_t  getADCPin(AdcIdentifier adcUnit, uint8_t adcPort);   // get GPIO number for ADC unit x, channel y. 255 = no such pin
2023-01-20 19:21:45 +01:00
Frank
a320068bbe I2C: allow any GPIO on 8266 (experimental)
as it turns out, also on 8266 any pin can be assigned to I2C. Only SPI pins are fixed, and GPIO16 should not be used as it does not support interrupts.
2023-01-15 22:13:46 +01:00
Frank
1e8fcfb0aa I2C pin settings bugfix (8266)
* It was not possible any more to set I2C pins back to "-1", to disable I2C.
This fixes the problem.
* HW_PIN_SDA / HW_PIN_SCL may contain "-1" --> use PIN numbers directly on 8266 (I2C pins cannot be changed any way on 8266)
2023-01-11 22:26:35 +01:00
Ewoud
bba57d4771 Remove I2CSCL/SDA/SCLK/MOSI/MISOPIN rename *_DATASPI to *_MOSISPI
use HW_PIN_* instead
2023-01-09 17:41:52 +01:00
Frank
533ea2dad7 small fix (WLED_DEBUG) 2023-01-09 12:20:33 +01:00
Frank
edb6bfc2f9 small fix for 8266 2023-01-08 19:25:26 +01:00
Frank
b29ff1186b best of I2CSPI-refactor
* cherry-picking my additions to pinmanger
* toDo: replace Wire.begin() with pinManager.joinWire()
2023-01-08 19:09:30 +01:00
Ewoud
66b15d32d9 Merge remote-tracking branch 'upstream/main' into mdev 2023-01-07 12:01:03 +01:00
Blaž Kristan
506b6b51ce whitespace cleanup 2023-01-06 09:24:29 +01:00
Ewoud
642d7d91ea i2c_sda, i2c_scl, spi_mosi, spi_miso, spi_sclk without HW_PIN_*, bh1750
platformio: 
- add bh1750 to _max
- define rotary defaults for wemos

usermod_bh1750
- Remove HW_PIN_* and replace by i2c_sda etc
- add appendConfigData

usermods mpu6050_imu, rtc, 4ld, pinmanager
- Remove HW_PIN_* 

change SDA2:pin (etc) to SDA:pin
2023-01-05 16:35:49 +01:00
Ewoud
86ceca5de7 Usermods: add removeOptions e.g. for pin MCLK
- add replaceOption to analogmic
- fix: right default for audio reactive scl
- pinmanager add case UM_Battery
2023-01-02 21:42:19 +01:00
Frank
97989bb773 experimental support for some special boards
- show VBAT pin (if board definitely has that feature)
- some WROVER board have cross-connection between GPIO 25/27 and PIN 16/17
- experimental support for boards that have NEOPIXEL_I2C_POWER
2023-01-01 21:33:06 +01:00
Frank
e6bd66d35d improve support for -S2
got myself an adafruit "qt py -S2" with tinyUF2 bootloader. So I wanted to get that working. And it does work :-).
FFT time = 10ms (instead of 2ms on classic ESP32)  is a very good result, also virtual USB runs much better now.
2022-12-22 23:22:58 +01:00
Frank
f9b9716fdd Improvements for -S2
- new partition table for boards with UF2 boot (Adafruit qt py S2)
- better treatment of debug out using "USBCDC" native port
- workarounds for watchdog crashes on -S2
- Add missing but mandatory build flags for -S2 and -C3
2022-12-21 17:25:41 +01:00
Frank
f48895f61f add gpio info for USERMOD_DALLASTEMPERATURE 2022-12-20 19:24:23 +01:00
Frank
ddad7269ed pin info: more default usermod pins 2022-12-20 17:49:34 +01:00
Frank
191bbf93f3 post-merge changes
reconciling disagreements between MM and AC source code
2022-12-06 16:07:12 +01:00
Ewoud
3160a0b090 Merge remote-tracking branch 'origin/ac_main' into mdev 2022-12-06 14:38:49 +01:00
Frank
e7f07f5bfc pinmanager robustness improvement
make sure that array bounds are not violated in pinManager class.
2022-12-05 17:04:54 +01:00
Frank
58688d25ae update for usermessages
wled.h:
- Don't use Serial directly -S2 as S2 serial driver is buggy.
- added USER_FLUSH macro
wled.cpp
- replace fluh with FLUSH
- print ArduionoOTA info (if enabled)
wled_server.cpp:
- added userlog info after file upload.
pinn_manager:
- don't show "(default)" is the PIN is actually assigned to HW drivers
- bugfix for getPinOwner()
2022-12-05 12:48:03 +01:00
Frank
0c3adf1f8a pin info small improvements 2022-12-04 20:09:10 +01:00
Frank
676cc26171 use Serial.print for important info like wifi stuff
.. and for other important info.
Will be muted automatically in case that serial is in used for other purposes.
2022-12-04 17:52:10 +01:00
Frank
1a9a1cbbbe small change to simplify pin info texts 2022-12-04 16:54:12 +01:00
Frank
bb8fb5f6aa pin info improvements
- add WLED_NUM_PINS constant, to get rid of magic number "50"
- only show I2S defaults when USERMOD_AUDIOREACTIVE is enabled
- added alternate names for SPI pins
- small correction for -C3
2022-12-04 14:43:31 +01:00
Frank
eaa619df69 pin info: conflicts include input-only
record conflict if pin was requested as in/out but pin is input-only
2022-12-04 02:50:57 +01:00
Frank
d2d8a86d81 pin info: show conflicts
* set.cpp: reject non-ADC pins as analog button pins (bugfix)
* pinmanager:
record conflicts
added getOwnerText(PinOwner tag) and getPinConflicts(int gpio)

GPIO    | Assigned to           | Info
--------|-----------------------|------------
i/o   0   Button            !! Conflict with AudioReactive (UM) !!        (default) I2S MCLK
i/o   1   debug output            Serial TX
i/o   2   ./.                     (default) LED pin
i/o   3   ./.                     Serial RX
i/o   5   ./.                     (default) SPI SS
i/o  13   Button            !! Conflict with IR Receiver !!

PIN ALLOC error: GPIO19 for analog button #2 is not an analog pin!
2022-12-04 02:22:50 +01:00
Frank
52c3aa8378 small, very small change
JTAG debug pins seems to be irrelevant on ESP32
2022-12-02 20:32:53 +01:00