Fix core2 compilation

This commit is contained in:
Theo Arends 2021-01-20 15:06:34 +01:00
parent 61d7d2ee64
commit 14788a4e74
7 changed files with 25 additions and 23 deletions

View File

@ -389,7 +389,7 @@ void xsend_message_txt(char *msg) {
#ifdef DEBUG_EMAIL_PORT #ifdef DEBUG_EMAIL_PORT
AddLog_P(LOG_LEVEL_INFO, PSTR("%s"),msg); AddLog_P(LOG_LEVEL_INFO, PSTR("%s"),msg);
#endif #endif
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM) #if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
if (*msg=='@') { if (*msg=='@') {
msg++; msg++;
attach_File(msg); attach_File(msg);
@ -415,7 +415,7 @@ void xsend_message_txt(char *msg) {
#endif #endif
} }
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM) #if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
#include <LittleFS.h> #include <LittleFS.h>
extern FS *ufsp; extern FS *ufsp;

View File

@ -225,6 +225,12 @@ const uint16_t LOG_BUFFER_SIZE = 4000; // Max number of characters in lo
#error "Arduino ESP8266 Core versions before 2.7.1 are not supported" #error "Arduino ESP8266 Core versions before 2.7.1 are not supported"
#endif #endif
#define UFS_FILE_WRITE "w"
#define UFS_FILE_READ "r"
#define FS_FILE_WRITE "w"
#define FS_FILE_READ "r"
#define FS_FILE_APPEND "a"
#define TASM_FILE_SETTINGS "/.settings" // Settings binary blob #define TASM_FILE_SETTINGS "/.settings" // Settings binary blob
#define TASM_FILE_SETTINGS_LKG "/.settings.lkg" // Last Known Good Settings binary blob #define TASM_FILE_SETTINGS_LKG "/.settings.lkg" // Last Known Good Settings binary blob
#define TASM_FILE_ZIGBEE "/zb" // Zigbee settings blob as used by CC2530 on ESP32 #define TASM_FILE_ZIGBEE "/zb" // Zigbee settings blob as used by CC2530 on ESP32

View File

@ -196,12 +196,6 @@ void alt_eeprom_readBytes(uint32_t adr, uint32_t len, uint8_t *buf) {
#include "FS.h" #include "FS.h"
#define FS_FILE_WRITE "w"
#define FS_FILE_READ "r"
#define FS_FILE_APPEND "a"
#if USE_SCRIPT_FATFS==-1 #if USE_SCRIPT_FATFS==-1
#ifdef ESP32 #ifdef ESP32
//#include "FS.h" //#include "FS.h"
@ -7491,7 +7485,7 @@ bool Xdrv10(uint8_t function)
#endif #endif
#endif // UFILESYSTEM #endif // USE_UFILESYS
// indicates scripter enabled (use rules[][] as single array) // indicates scripter enabled (use rules[][] as single array)

View File

@ -497,7 +497,7 @@ void DisplayText(void)
cp += var; cp += var;
linebuf[fill] = 0; linebuf[fill] = 0;
break; break;
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM) #if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
case 'P': case 'P':
{ char *ep=strchr(cp,':'); { char *ep=strchr(cp,':');
if (ep) { if (ep) {
@ -682,7 +682,7 @@ void DisplayText(void)
RedrawGraph(temp,temp1); RedrawGraph(temp,temp1);
break; break;
} }
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM) #if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
if (*cp=='s') { if (*cp=='s') {
cp++; cp++;
var=atoiv(cp,&temp); var=atoiv(cp,&temp);
@ -1575,7 +1575,7 @@ char get_jpeg_size(unsigned char* data, unsigned int data_size, unsigned short *
#endif // JPEG_PICTS #endif // JPEG_PICTS
#endif // ESP32 #endif // ESP32
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM) #if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
extern FS *ufsp; extern FS *ufsp;
#define XBUFF_LEN 128 #define XBUFF_LEN 128
void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp, bool inverted ) { void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp, bool inverted ) {
@ -1920,7 +1920,7 @@ void DisplayCheckGraph() {
} }
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM) #if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
#ifdef ESP32 #ifdef ESP32
#include <SD.h> #include <SD.h>
#endif #endif

View File

@ -572,7 +572,7 @@ void I2S_WR_Show(void) {
#ifdef ESP32 #ifdef ESP32
void Play_mp3(const char *path) { void Play_mp3(const char *path) {
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM) #if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
if (decoder || mp3) return; if (decoder || mp3) return;
if (!out) return; if (!out) return;

View File

@ -50,9 +50,6 @@ ufsfree free size in kB
#define UFS_TFAT 2 #define UFS_TFAT 2
#define UFS_TLFS 3 #define UFS_TLFS 3
#define UFS_FILE_WRITE "w"
#define UFS_FILE_READ "r"
#ifdef ESP8266 #ifdef ESP8266
#include <LittleFS.h> #include <LittleFS.h>
#include <SPI.h> #include <SPI.h>

View File

@ -171,6 +171,11 @@ struct WS2812 {
/********************************************************************************************/ /********************************************************************************************/
// For some reason map fails to compile so renamed to wsmap
long wsmap(long x, long in_min, long in_max, long out_min, long out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
void Ws2812StripShow(void) void Ws2812StripShow(void)
{ {
#if (USE_WS2812_CTYPE > NEO_3LED) #if (USE_WS2812_CTYPE > NEO_3LED)
@ -276,9 +281,9 @@ void Ws2812GradientColor(uint32_t schemenr, struct WsColor* mColor, uint32_t ran
end = (scheme.count -1) - end; end = (scheme.count -1) - end;
} }
float dimmer = 100 / (float)Settings.light_dimmer; float dimmer = 100 / (float)Settings.light_dimmer;
float fmyRed = (float)map(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].red, scheme.colors[end].red) / dimmer; float fmyRed = (float)wsmap(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].red, scheme.colors[end].red) / dimmer;
float fmyGrn = (float)map(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].green, scheme.colors[end].green) / dimmer; float fmyGrn = (float)wsmap(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].green, scheme.colors[end].green) / dimmer;
float fmyBlu = (float)map(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].blue, scheme.colors[end].blue) / dimmer; float fmyBlu = (float)wsmap(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].blue, scheme.colors[end].blue) / dimmer;
mColor->red = (uint8_t)fmyRed; mColor->red = (uint8_t)fmyRed;
mColor->green = (uint8_t)fmyGrn; mColor->green = (uint8_t)fmyGrn;
mColor->blue = (uint8_t)fmyBlu; mColor->blue = (uint8_t)fmyBlu;
@ -316,9 +321,9 @@ void Ws2812Gradient(uint32_t schemenr)
Ws2812GradientColor(schemenr, &currentColor, range, gradRange, i + offset + 1); Ws2812GradientColor(schemenr, &currentColor, range, gradRange, i + offset + 1);
} }
// Blend old and current color based on time for smooth movement. // Blend old and current color based on time for smooth movement.
c.R = map(Light.strip_timer_counter % speed, 0, speed, oldColor.red, currentColor.red); c.R = wsmap(Light.strip_timer_counter % speed, 0, speed, oldColor.red, currentColor.red);
c.G = map(Light.strip_timer_counter % speed, 0, speed, oldColor.green, currentColor.green); c.G = wsmap(Light.strip_timer_counter % speed, 0, speed, oldColor.green, currentColor.green);
c.B = map(Light.strip_timer_counter % speed, 0, speed, oldColor.blue, currentColor.blue); c.B = wsmap(Light.strip_timer_counter % speed, 0, speed, oldColor.blue, currentColor.blue);
strip->SetPixelColor(i, c); strip->SetPixelColor(i, c);
oldColor = currentColor; oldColor = currentColor;
} }