Fix single core devices

This commit is contained in:
iranl
2024-12-26 19:11:41 +01:00
parent 5dcf5cd8b4
commit e8a8111b2a
3 changed files with 13 additions and 6 deletions

View File

@@ -5,7 +5,7 @@
#define NUKI_HUB_VERSION "9.06"
#define NUKI_HUB_VERSION_INT (uint32_t)906
#define NUKI_HUB_BUILD "unknownbuildnr"
#define NUKI_HUB_DATE "2024-12-22"
#define NUKI_HUB_DATE "2024-12-26"
#define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest"
#define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json"

View File

@@ -232,6 +232,7 @@ inline void initPreferences(Preferences* preferences)
Log->print("Last config version: ");
Log->println(lastConfigVer);
Log->print("Current config version: ");
Log->println(NUKI_HUB_VERSION_INT);
if(lastConfigVer >= NUKI_HUB_VERSION_INT && lastConfigVer < 20000) return;

View File

@@ -9,6 +9,7 @@
#include "Config.h"
#include "esp32-hal-log.h"
#include "hal/wdt_hal.h"
#include "esp_chip_info.h"
#ifndef NUKI_HUB_UPDATER
#include "NukiWrapper.h"
@@ -22,6 +23,7 @@
#include "PreferencesKeys.h"
#include "RestartReason.h"
#include "EspMillis.h"
#include "NimBLEDevice.h"
/*
#ifdef DEBUG_NUKIHUB
@@ -444,16 +446,20 @@ void setupTasks(bool ota)
};
esp_task_wdt_reconfigure(&twdt_config);
esp_chip_info_t info;
esp_chip_info(&info);
uint8_t espCores = info.cores;
if(ota)
{
xTaskCreatePinnedToCore(otaTask, "ota", 8192, NULL, 2, &otaTaskHandle, 1);
xTaskCreatePinnedToCore(otaTask, "ota", 8192, NULL, 2, &otaTaskHandle, (espCores > 1) ? 1 : 0);
esp_task_wdt_add(otaTaskHandle);
}
else
{
if(!disableNetwork)
{
xTaskCreatePinnedToCore(networkTask, "ntw", preferences->getInt(preference_task_size_network, NETWORK_TASK_SIZE), NULL, 3, &networkTaskHandle, 1);
xTaskCreatePinnedToCore(networkTask, "ntw", preferences->getInt(preference_task_size_network, NETWORK_TASK_SIZE), NULL, 3, &networkTaskHandle, (espCores > 1) ? 1 : 0);
esp_task_wdt_add(networkTaskHandle);
}
#ifndef NUKI_HUB_UPDATER