|
392 | 392 |
|
393 | 393 | #define INTERFACE_UPDATE_COOLDOWN 2000 //time in ms to wait between websockets, alexa, and MQTT updates |
394 | 394 |
|
| 395 | +// HW_PIN_SCL & HW_PIN_SDA are used for information in usermods settings page and usermods themselves |
| 396 | +// which GPIO pins are actually used in a hardwarea layout (controller board) |
| 397 | +#if defined(I2CSCLPIN) && !defined(HW_PIN_SCL) |
| 398 | + #define HW_PIN_SCL I2CSCLPIN |
| 399 | +#endif |
| 400 | +#if defined(I2CSDAPIN) && !defined(HW_PIN_SDA) |
| 401 | + #define HW_PIN_SDA I2CSDAPIN |
| 402 | +#endif |
| 403 | +// you cannot change HW I2C pins on 8266 |
395 | 404 | #if defined(ESP8266) && defined(HW_PIN_SCL) |
396 | 405 | #undef HW_PIN_SCL |
397 | 406 | #endif |
398 | 407 | #if defined(ESP8266) && defined(HW_PIN_SDA) |
399 | 408 | #undef HW_PIN_SDA |
400 | 409 | #endif |
| 410 | +// defaults for 1st I2C on ESP32 (Wire global) |
401 | 411 | #ifndef HW_PIN_SCL |
402 | 412 | #define HW_PIN_SCL SCL |
403 | 413 | #endif |
404 | 414 | #ifndef HW_PIN_SDA |
405 | 415 | #define HW_PIN_SDA SDA |
406 | 416 | #endif |
407 | 417 |
|
| 418 | +// HW_PIN_SCLKSPI & HW_PIN_MOSISPI & HW_PIN_MISOSPI are used for information in usermods settings page and usermods themselves |
| 419 | +// which GPIO pins are actually used in a hardwarea layout (controller board) |
| 420 | +#if defined(SPISCLKPIN) && !defined(HW_PIN_CLOCKSPI) |
| 421 | + #define HW_PIN_CLOCKSPI SPISCLKPIN |
| 422 | +#endif |
| 423 | +#if defined(SPIMOSIPIN) && !defined(HW_PIN_MOSISPI) |
| 424 | + #define HW_PIN_MOSISPI SPIMOSIPIN |
| 425 | +#endif |
| 426 | +#if defined(SPIMISOPIN) && !defined(HW_PIN_MISOSPI) |
| 427 | + #define HW_PIN_MISOSPI SPIMISOPIN |
| 428 | +#endif |
| 429 | +// you cannot change HW SPI pins on 8266 |
408 | 430 | #if defined(ESP8266) && defined(HW_PIN_CLOCKSPI) |
409 | 431 | #undef HW_PIN_CLOCKSPI |
410 | 432 | #endif |
|
414 | 436 | #if defined(ESP8266) && defined(HW_PIN_MISOSPI) |
415 | 437 | #undef HW_PIN_MISOSPI |
416 | 438 | #endif |
417 | | -#if defined(ESP8266) && defined(HW_PIN_CSSPI) |
418 | | - #undef HW_PIN_CSSPI |
419 | | -#endif |
420 | | -// defaults for VSPI |
| 439 | +// defaults for VSPI on ESP32 (SPI global, SPI.cpp) as HSPI is used by WLED (bus_wrapper.h) |
421 | 440 | #ifndef HW_PIN_CLOCKSPI |
422 | 441 | #define HW_PIN_CLOCKSPI SCK |
423 | 442 | #endif |
|
427 | 446 | #ifndef HW_PIN_MISOSPI |
428 | 447 | #define HW_PIN_MISOSPI MISO |
429 | 448 | #endif |
430 | | -#ifndef HW_PIN_CSSPI |
431 | | - #define HW_PIN_CSSPI SS |
432 | | -#endif |
433 | 449 |
|
434 | 450 | #endif |
0 commit comments