mirror of https://github.com/arendst/Tasmota.git
Webcamshutdown - use FUNC_ABOUT_TO_RESTART (#21462)
* use FUNC_ABOUT_TO_RESTART for webcam shutdown in webcamv2 * fix an annoying compile warning - lengths are pre-checked to fit anyway.
This commit is contained in:
parent
25a2a46917
commit
a78169b43a
|
@ -3012,7 +3012,10 @@ bool Xdrv99(uint32_t function) {
|
||||||
WcSetStreamserver(Settings->webcam_config.stream);
|
WcSetStreamserver(Settings->webcam_config.stream);
|
||||||
WCStartOperationTask();
|
WCStartOperationTask();
|
||||||
break;
|
break;
|
||||||
case FUNC_SAVE_BEFORE_RESTART: {
|
|
||||||
|
case FUNC_ABOUT_TO_RESTART: {
|
||||||
|
// this code will kill off the cam completely, allowing nice clean restarts
|
||||||
|
|
||||||
// stop cam clock
|
// stop cam clock
|
||||||
#ifdef WEBCAM_DEV_DEBUG
|
#ifdef WEBCAM_DEV_DEBUG
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("CAM: FUNC_SAVE_BEFORE_RESTART"));
|
AddLog(LOG_LEVEL_DEBUG, PSTR("CAM: FUNC_SAVE_BEFORE_RESTART"));
|
||||||
|
@ -3037,6 +3040,7 @@ bool Xdrv99(uint32_t function) {
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("CAM: FUNC_SAVE_BEFORE_RESTART after delay"));
|
AddLog(LOG_LEVEL_DEBUG, PSTR("CAM: FUNC_SAVE_BEFORE_RESTART after delay"));
|
||||||
#endif
|
#endif
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case FUNC_ACTIVE:
|
case FUNC_ACTIVE:
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2789,7 +2789,7 @@ void HandleMI32Key(){
|
||||||
|
|
||||||
WSContentSend_P(HTTP_KEY_ADDED, mac, key);
|
WSContentSend_P(HTTP_KEY_ADDED, mac, key);
|
||||||
|
|
||||||
strncat(key, mac, sizeof(key));
|
strcat(key, mac);
|
||||||
MI32AddKey(key, nullptr);
|
MI32AddKey(key, nullptr);
|
||||||
|
|
||||||
// WSContentSpaceButton(BUTTON_CONFIGURATION);
|
// WSContentSpaceButton(BUTTON_CONFIGURATION);
|
||||||
|
|
Loading…
Reference in New Issue