configmanager: bitwise display of payloadmask
This commit is contained in:
parent
c2b28a54cb
commit
cb65d0ed6b
@ -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);
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user