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:
btsimonh 2024-05-25 18:51:46 +01:00 committed by GitHub
parent 25a2a46917
commit a78169b43a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -3012,7 +3012,10 @@ bool Xdrv99(uint32_t function) {
WcSetStreamserver(Settings->webcam_config.stream);
WCStartOperationTask();
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
#ifdef WEBCAM_DEV_DEBUG
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"));
#endif
} break;
case FUNC_ACTIVE:
result = true;
break;

View File

@ -2789,7 +2789,7 @@ void HandleMI32Key(){
WSContentSend_P(HTTP_KEY_ADDED, mac, key);
strncat(key, mac, sizeof(key));
strcat(key, mac);
MI32AddKey(key, nullptr);
// WSContentSpaceButton(BUTTON_CONFIGURATION);