mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
Add command `Gpios 255
`
Add command ``Gpios 255`` to show all possible GPIO configurations
This commit is contained in:
parent
58dc18844b
commit
31e5617043
@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
- Support for EZO PRS sensors by Christopher Tremblay (#9659)
|
- Support for EZO PRS sensors by Christopher Tremblay (#9659)
|
||||||
- Zigbee reduce battery drain (#9642)
|
- Zigbee reduce battery drain (#9642)
|
||||||
- Zigbee added ``ZbMap`` command to describe Zigbee topology (#9651)
|
- Zigbee added ``ZbMap`` command to describe Zigbee topology (#9651)
|
||||||
|
- Command ``Gpios 255`` to show all possible GPIO configurations
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- PlatformIO library structure redesigned for compilation speed by Jason2866
|
- PlatformIO library structure redesigned for compilation speed by Jason2866
|
||||||
|
@ -59,6 +59,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
|
|||||||
|
|
||||||
## Changelog v9.0.0.3
|
## Changelog v9.0.0.3
|
||||||
### Added
|
### Added
|
||||||
|
- Command ``Gpios 255`` to show all possible GPIO configurations
|
||||||
- Command ``NoDelay`` for immediate backlog command execution by Erik Montnemery (#9544)
|
- Command ``NoDelay`` for immediate backlog command execution by Erik Montnemery (#9544)
|
||||||
- Command ``SwitchMode 15`` sending only MQTT message on switch change (#9593)
|
- Command ``SwitchMode 15`` sending only MQTT message on switch change (#9593)
|
||||||
- Command ``ShutterChange`` to increment change position (#9594)
|
- Command ``ShutterChange`` to increment change position (#9594)
|
||||||
|
@ -1189,13 +1189,20 @@ void CmndGpio(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ShowGpios(const uint16_t *NiceList, uint32_t size, uint32_t offset, uint32_t &lines) {
|
void ShowGpios(const uint16_t *NiceList, uint32_t size, uint32_t offset, uint32_t &lines) {
|
||||||
|
uint32_t ridx;
|
||||||
|
uint32_t midx;
|
||||||
myio cmodule;
|
myio cmodule;
|
||||||
ModuleGpios(&cmodule);
|
ModuleGpios(&cmodule);
|
||||||
bool jsflg = false;
|
bool jsflg = false;
|
||||||
for (uint32_t i = offset; i < size; i++) { // Skip ADC_NONE
|
for (uint32_t i = offset; i < size; i++) { // Skip ADC_NONE
|
||||||
uint32_t ridx = pgm_read_word(NiceList + i) & 0xFFE0;
|
if (NiceList == nullptr) {
|
||||||
uint32_t midx = BGPIO(ridx);
|
ridx = AGPIO(i);
|
||||||
|
midx = i;
|
||||||
|
} else {
|
||||||
|
ridx = pgm_read_word(NiceList + i) & 0xFFE0;
|
||||||
|
midx = BGPIO(ridx);
|
||||||
if ((XdrvMailbox.payload != 255) && GetUsedInModule(midx, cmodule.io)) { continue; }
|
if ((XdrvMailbox.payload != 255) && GetUsedInModule(midx, cmodule.io)) { continue; }
|
||||||
|
}
|
||||||
if (!jsflg) {
|
if (!jsflg) {
|
||||||
Response_P(PSTR("{\"" D_CMND_GPIOS "%d\":{"), lines);
|
Response_P(PSTR("{\"" D_CMND_GPIOS "%d\":{"), lines);
|
||||||
} else {
|
} else {
|
||||||
@ -1214,19 +1221,18 @@ void ShowGpios(const uint16_t *NiceList, uint32_t size, uint32_t offset, uint32_
|
|||||||
|
|
||||||
void CmndGpios(void)
|
void CmndGpios(void)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if (XdrvMailbox.payload == 17) {
|
|
||||||
DumpConvertTable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
uint32_t lines = 1;
|
uint32_t lines = 1;
|
||||||
|
if (XdrvMailbox.payload == 255) {
|
||||||
|
// DumpConvertTable();
|
||||||
|
ShowGpios(nullptr, GPIO_SENSOR_END, 0, lines);
|
||||||
|
} else {
|
||||||
ShowGpios(kGpioNiceList, ARRAY_SIZE(kGpioNiceList), 0, lines);
|
ShowGpios(kGpioNiceList, ARRAY_SIZE(kGpioNiceList), 0, lines);
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
#ifndef USE_ADC_VCC
|
#ifndef USE_ADC_VCC
|
||||||
ShowGpios(kAdcNiceList, ARRAY_SIZE(kAdcNiceList), 1, lines);
|
ShowGpios(kAdcNiceList, ARRAY_SIZE(kAdcNiceList), 1, lines);
|
||||||
#endif // USE_ADC_VCC
|
#endif // USE_ADC_VCC
|
||||||
#endif // ESP8266
|
#endif // ESP8266
|
||||||
|
}
|
||||||
ResponseClear();
|
ResponseClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user