mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 05:36:39 +00:00
Fix core2 compilation
This commit is contained in:
parent
61d7d2ee64
commit
14788a4e74
@ -389,7 +389,7 @@ void xsend_message_txt(char *msg) {
|
||||
#ifdef DEBUG_EMAIL_PORT
|
||||
AddLog_P(LOG_LEVEL_INFO, PSTR("%s"),msg);
|
||||
#endif
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
|
||||
if (*msg=='@') {
|
||||
msg++;
|
||||
attach_File(msg);
|
||||
@ -415,7 +415,7 @@ void xsend_message_txt(char *msg) {
|
||||
#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>
|
||||
extern FS *ufsp;
|
||||
|
||||
|
@ -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"
|
||||
#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_LKG "/.settings.lkg" // Last Known Good Settings binary blob
|
||||
#define TASM_FILE_ZIGBEE "/zb" // Zigbee settings blob as used by CC2530 on ESP32
|
||||
|
@ -196,12 +196,6 @@ void alt_eeprom_readBytes(uint32_t adr, uint32_t len, uint8_t *buf) {
|
||||
|
||||
#include "FS.h"
|
||||
|
||||
#define FS_FILE_WRITE "w"
|
||||
#define FS_FILE_READ "r"
|
||||
#define FS_FILE_APPEND "a"
|
||||
|
||||
|
||||
|
||||
#if USE_SCRIPT_FATFS==-1
|
||||
#ifdef ESP32
|
||||
//#include "FS.h"
|
||||
@ -7491,7 +7485,7 @@ bool Xdrv10(uint8_t function)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // UFILESYSTEM
|
||||
#endif // USE_UFILESYS
|
||||
|
||||
|
||||
// indicates scripter enabled (use rules[][] as single array)
|
||||
|
@ -497,7 +497,7 @@ void DisplayText(void)
|
||||
cp += var;
|
||||
linebuf[fill] = 0;
|
||||
break;
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(UFILESYSTEM)
|
||||
#if (defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)) || defined(USE_UFILESYS)
|
||||
case 'P':
|
||||
{ char *ep=strchr(cp,':');
|
||||
if (ep) {
|
||||
@ -682,7 +682,7 @@ void DisplayText(void)
|
||||
RedrawGraph(temp,temp1);
|
||||
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') {
|
||||
cp++;
|
||||
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 // 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;
|
||||
#define XBUFF_LEN 128
|
||||
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
|
||||
#include <SD.h>
|
||||
#endif
|
||||
|
@ -572,7 +572,7 @@ void I2S_WR_Show(void) {
|
||||
|
||||
#ifdef ESP32
|
||||
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 (!out) return;
|
||||
|
||||
|
@ -50,9 +50,6 @@ ufsfree free size in kB
|
||||
#define UFS_TFAT 2
|
||||
#define UFS_TLFS 3
|
||||
|
||||
#define UFS_FILE_WRITE "w"
|
||||
#define UFS_FILE_READ "r"
|
||||
|
||||
#ifdef ESP8266
|
||||
#include <LittleFS.h>
|
||||
#include <SPI.h>
|
||||
|
@ -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)
|
||||
{
|
||||
#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;
|
||||
}
|
||||
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 fmyGrn = (float)map(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 fmyRed = (float)wsmap(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].red, scheme.colors[end].red) / dimmer;
|
||||
float fmyGrn = (float)wsmap(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].green, scheme.colors[end].green) / dimmer;
|
||||
float fmyBlu = (float)wsmap(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].blue, scheme.colors[end].blue) / dimmer;
|
||||
mColor->red = (uint8_t)fmyRed;
|
||||
mColor->green = (uint8_t)fmyGrn;
|
||||
mColor->blue = (uint8_t)fmyBlu;
|
||||
@ -316,9 +321,9 @@ void Ws2812Gradient(uint32_t schemenr)
|
||||
Ws2812GradientColor(schemenr, ¤tColor, range, gradRange, i + offset + 1);
|
||||
}
|
||||
// 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.G = map(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.R = wsmap(Light.strip_timer_counter % speed, 0, speed, oldColor.red, currentColor.red);
|
||||
c.G = wsmap(Light.strip_timer_counter % speed, 0, speed, oldColor.green, currentColor.green);
|
||||
c.B = wsmap(Light.strip_timer_counter % speed, 0, speed, oldColor.blue, currentColor.blue);
|
||||
strip->SetPixelColor(i, c);
|
||||
oldColor = currentColor;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user