Skip to content

Commit

Permalink
v1.2.9
Browse files Browse the repository at this point in the history
- Fix API options decoding (URL decode)
- Added "Scheduling.ListOccurrences" API
- Implemented HomeGenie's extended Cron expressions syntax
- Memory usage optimizations
- Added DISABLE_SSE compiler flag
  • Loading branch information
genemars committed Apr 24, 2024
1 parent 09ea3c6 commit fd33893
Show file tree
Hide file tree
Showing 28 changed files with 650 additions and 78 deletions.
10 changes: 5 additions & 5 deletions lib/ESP32_BleSerial/src/BleSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <Arduino.h>

#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
//#include <BLEUtils.h>
//#include <BLEServer.h>
#include <BLE2902.h>
#include "ByteRingBuffer.h"

Expand Down Expand Up @@ -72,9 +72,9 @@ class BleSerial : public BLECharacteristicCallbacks, public BLEServerCallbacks,
Bluetooth LE GATT UUIDs for the Nordic UART profile
Change UUID here if required
*/
const char *BLE_SERIAL_SERVICE_UUID = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
const char *BLE_RX_UUID = "6e400002-b5a3-f393-e0a9-e50e24dcca9e";
const char *BLE_TX_UUID = "6e400003-b5a3-f393-e0a9-e50e24dcca9e";
const char *BLE_SERIAL_SERVICE_UUID PROGMEM = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
const char *BLE_RX_UUID PROGMEM = "6e400002-b5a3-f393-e0a9-e50e24dcca9e";
const char *BLE_TX_UUID PROGMEM = "6e400003-b5a3-f393-e0a9-e50e24dcca9e";

bool started = false;
};
2 changes: 1 addition & 1 deletion lib/ESP32_BleSerial/src/ByteRingBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ template <size_t N>
class ByteRingBuffer
{
private:
uint8_t buffer[N];
uint8_t buffer[N]{};
int head = 0;
int tail = 0;

Expand Down
2 changes: 1 addition & 1 deletion lib/duktape-2.7.0/src/duk_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,7 @@ typedef struct duk_hthread duk_context;
#undef DUK_USE_FUNCPTR_ENC16
#define DUK_USE_FUNCTION_BUILTIN
#define DUK_USE_FUNC_FILENAME_PROPERTY
#define DUK_USE_FUNC_NAME_PROPERTY
//#define DUK_USE_FUNC_NAME_PROPERTY
#undef DUK_USE_GC_TORTURE
#undef DUK_USE_GET_MONOTONIC_TIME
#undef DUK_USE_GET_RANDOM_DOUBLE
Expand Down
2 changes: 1 addition & 1 deletion src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "defs.h"

#include <Arduino.h>
#ifndef DISABLE_AUTOMATION
#ifdef CONFIG_CREATE_AUTOMATION_TASK
#include <FreeRTOSConfig.h>
#endif
#ifdef ESP32
Expand Down
2 changes: 1 addition & 1 deletion src/HomeGenie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace Service {
xTaskCreate(
reinterpret_cast<TaskFunction_t>(ProgramEngine::worker),
"ScheduledTask",
20480, // this might require some adjustments
10240, // this might require some adjustments
nullptr,
tskIDLE_PRIORITY + 1,
nullptr
Expand Down
2 changes: 1 addition & 1 deletion src/HomeGenie.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace Service {
Module* getDefaultModule();
Module* getModule(String* domain, String* address);

const char* getModuleJSON(Module* module);
static const char* getModuleJSON(Module* module);
unsigned int writeModuleListJSON(ResponseCallback *outputCallback);
unsigned int writeModuleJSON(ResponseCallback *outputCallback, String* domain, String* address);
unsigned int writeGroupListJSON(ResponseCallback *outputCallback);
Expand Down
13 changes: 11 additions & 2 deletions src/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ String Utility::getByteString(uint64_t *data, uint16_t length) {
return stringData;
}

RGBColor Utility::hsv2rgb(float h, float s, float v) {
ColorRGB Utility::hsv2rgb(float h, float s, float v) {
float r, g, b;

int i = floor(h * 6);
Expand All @@ -139,10 +139,19 @@ RGBColor Utility::hsv2rgb(float h, float s, float v) {
case 5: r = v, g = p, b = q; break;
}

RGBColor color;
ColorRGB color;
color.r = r * 255;
color.g = g * 255;
color.b = b * 255;

return color;
}

uint32_t Utility::getFreeMem() {
#ifdef ESP8266
uint32_t freeMem = system_get_free_heap_size();
#else
uint32_t freeMem = esp_get_free_heap_size();
#endif
return freeMem;
}
7 changes: 4 additions & 3 deletions src/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
#include "Config.h"


typedef struct RGBColor {
typedef struct ColorRGB {
int r;
int g;
int b;
} RGBColor;
} ColorRGB; // renamed from RGBColor to ColorRGB to prevent conflicts with LGFX


class Utility {
Expand All @@ -54,7 +54,8 @@ class Utility {
static String byteToHex(uint64_t b);
static uint32_t reverseBits(uint32_t n);
static uint8_t reverseByte(uint8_t n);
static RGBColor hsv2rgb(float H, float S, float V);
static ColorRGB hsv2rgb(float H, float S, float V);
static uint32_t getFreeMem();
};

#endif //HOMEGENIE_MINI_UTILITY_H
Loading

0 comments on commit fd33893

Please sign in to comment.