Commit Graph

31 Commits

Author SHA1 Message Date
Frank
8905992a89 code spell checking - part4 (MM specific) 2023-12-15 00:14:57 +01:00
Frank
907679c2f5 Merge remote-tracking branch 'upstream/main' into mdev 2023-03-19 15:15:12 +01:00
Ryan Horricks
7789379914 Fix typing to resolve build errors after installing the mpu6050_imu usermod. 2023-03-18 18:29:19 -06:00
Ewoud
c928df9d70 Usermod class vars pt3:
Moved initDone, addToConfig and readFromConfig to Usermod superclass

Updated cleanup procedure:

Part 1
- remove bool enabled = false/true (now default false)
- remove static const char _name[] and _enabled[]
- add constructor which calls superclass (temp?): XXXUsermod(const char *name, bool enabled):Usermod(name, enabled) {} 
- replace _enabled with "enabled"
- remove const char PROGMEM init for  _name[] and _enabled[]
Part 2
- Remove bool initDone = false;
- addToConfig: replace createNestedObject with Usermod::addToConfig(root); JsonObject top = root[FPSTR(_name)];
- readFromConfig: replace !top.isNull and enabled with bool configComplete = Usermod::readFromConfig(root);JsonObject top = root[FPSTR(_name)];

See Temperature, MPU6050 and weather as examples (rest to be done)
2023-03-16 15:41:23 +01:00
Ewoud
0b841c0788 MM Help small changes (add MPU6050) 2023-03-15 20:36:31 +01:00
Ewoud
ff6d5136ac Usermod class vars pt2: enabled default value 2023-03-15 18:18:11 +01:00
Ewoud
7337efec02 Usermod class vars part1: add enabled and _name for imu and dallas
usermod_mpu6050_imu.h and usermod_temperature.h:
- remove bool enabled = false/true (now default false)
- remove static const char _name[] and _enabled[]
- add constructor which calls superclass (temp?)
- replace _enabled with "enabled"
- remove const char PROGMEM init for  _name[] and _enabled[]

settings_um.htm:
- Add usermod table with class properties (name and enabled) -> WIP as not all UM's now and enable will be checkbox ? (compare with info tab...?)

fcn_declare.h
- add _name and enabled to Usermod class and add name to constructor

usermods_list.cpp
- add Usermod name to constructor for mpu6050 and temperature)
- to do add enabled is true to constructor
2023-03-15 17:48:37 +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
bb6662ee35 NetDebug: switch between serial/netdebug, store ip and port in settings
pio.ini: enable WLED_DEBUG_HOST in esp32_4MB_M_debug and esp32_16MB_M_debug

audio_reactive, um6050, wled.h
- replace DEBUGOUT.print(x) by DEBUGOUT(x) etc

wled.h: switch between serial/netdebug

cfg.cpp, set.cpp, wled.cpp, xml.cpp
- store netDebugPrintIP and netDebugPrintPort in cfg.json

index.js: rename info tab on off to Net Debug

settings.sync: add netdebug

net_debug.h/cpp: use global netDebugPrintIP remove debugPrintHostIP
2023-02-24 15:40:16 +01:00
Ewoud
9944f8dc72 global I2C and SPI pins and mpu6050 interrupt pin default to -1
As can otherwise cause conflicts, must be set in platformio explicitly to the right values

Set in platform io for _max configs
2023-01-11 17:32:19 +01:00
Frank
fb575bf8a7 remove stupid compiler warning 2023-01-08 21:15:12 +01:00
Frank
39ad4955b7 Adjust some usermods to use global I2C
* usermods only need to to `if (!pinManager.joinWire()) return;`

* joinWire will
* * check if global I2C are defined - return false if not defined
* * aloocate HW_I2C pins - return false on error
* * call Wire.begin() if needed.
2023-01-08 21:11:50 +01:00
Ewoud
bfa06df47c Tiny changes
0.14.0-b1.14 - 2301080
2023-01-08 10:52:22 +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
4409ceb3ec Merge remote-tracking branch 'origin/ac_main' into mdev 2023-01-02 21:05:03 +01:00
Blaz Kristan
6f67132f4b PROGMEM string optimisation. 2022-12-26 10:20:45 +01:00
Frank
5ec98c4c55 mpu usermod: add error message in info page (if semsor not found) 2022-12-19 16:32:44 +01:00
Frank
18d649a3a5 usermods: delay I2C pin allocation
delay i2C allocation / startup if global I2C pins = -1
2022-12-18 23:12:38 +01:00
Frank
2c9cde4096 I2C usermods: make sure that no Wire-begin(-1, -1) sneaks through 2022-12-17 21:42:16 +01:00
Frank
dae6de76f1 Improve co-existence of usermods sharing I2C
Improve co-existence of several popular usermods with respect to shared I2C bus.
- ensure that i2c_sda and i2c_scl are used when defined
- ensure that HW_PIN_SDA / HW_PIN_SCL are not overwritten
- ensure that Wire.begin()nis always called with user-defined pins (remove rogue Wire.begin() without parameters)
- ensure that set.cpp / cfg.cpp use esp32-specific global Wire objects.
2022-12-17 19:45:45 +01:00
Ewoud
ffe52fcbf5 Merge remote-tracking branch 'origin/ac_main' into mdev 2022-12-16 11:43:27 +01:00
srg74
8caeddde15 Spelling check by @wthomson (#2940)
A lot of spelling corrections. Now repo will sound like educated person :)

Co-authored-by: Bill Thomson <bt@kattt.org>
2022-12-10 16:12:55 +01:00
Frank
5fbbee2efc usermod bugfixes
4LD: fixing wrong type for PINs

mpu6050:
- fix "hidden" use of GPIO 15
- restore DEBUG macros (overwritten by I2CDev lib)
- fix not initialized memory problem
- added a few USER_PRINT messages
2022-12-06 16:54:00 +01:00
Christian Schwinne
0de928a674 Merge branch 'main' into 0_14 2022-10-20 00:44:40 +02:00
Ewowi
9414f531dd IMO support in usermod games, add 3D IMO cube effect
- platformio: add USERMOD_MPU6050_IMU and ElectronicCats/MPU6050 @ 0.6.0 to esp32mdevums
- USERMOD_MPU6050_IMU: update readme.md and usermod_mpu650_imu.h
- usermod_v2_games: support for  USERMOD_MPU6050_IMU, add mode_IMUTest and class Frame3D and mode_3DIMUCube, remove old gyro handling
- usermods_list.cpp: add USERMOD_MPU6050_IMU
2022-09-27 15:19:58 +02:00
Soren Singh Dary
8bd8975e0a Fixed the dependency (#2782) 2022-09-14 23:29:35 +02:00
Soren Singh Dary
2847921e5a Fixed a type in the file name (#2781) 2022-09-14 13:56:16 +02:00
Blaz Kristan
1de009a80d I2C & SPI fixes. Global interface. 2022-08-14 13:05:59 +02:00
Blaž Kristan
0a5a0bef48 Enhanced usermods. (#2522) 2022-02-01 09:33:57 +01:00
Jonathan Diamond
b2c656940b Added link for video and blog 2020-06-21 17:32:39 -07:00
Axlan
ed5491a480 Added usermod for connecting MPU6050 IMU 2020-06-20 19:44:29 -07:00