configmanager: bitwise display of payloadmask

This commit is contained in:
Verkehrsrot 2019-03-17 19:22:58 +01:00
parent c2b28a54cb
commit cb65d0ed6b
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,10 @@
#ifndef _CONFIGMANAGER_H #ifndef _CONFIGMANAGER_H
#define _CONFIGMANAGER_H #define _CONFIGMANAGER_H
#include <nvs.h>
#include <nvs_flash.h>
#include <bitset>
void eraseConfig(void); void eraseConfig(void);
void saveConfig(void); void saveConfig(void);
void loadConfig(void); void loadConfig(void);

View File

@ -1,8 +1,6 @@
/* configmanager persists runtime configuration using NVRAM of ESP32*/ /* configmanager persists runtime configuration using NVRAM of ESP32*/
#include "globals.h" #include "globals.h"
#include <nvs.h>
#include <nvs_flash.h>
// Local logging tag // Local logging tag
static const char TAG[] = "flash"; static const char TAG[] = "flash";
@ -335,7 +333,7 @@ void loadConfig() {
cfg.payloadmask = flash8; cfg.payloadmask = flash8;
ESP_LOGI(TAG, "payloadmask = %d", flash8); ESP_LOGI(TAG, "payloadmask = %d", flash8);
} else { } else {
ESP_LOGI(TAG, "payloadmask set to default %d", cfg.payloadmask); ESP_LOGI(TAG, "payloadmask set to default %d", std::bitset<8>(cfg.payloadmask));
saveConfig(); saveConfig();
} }