@mikrojs/firmware 0.8.0 → 0.10.0-pr-134.g682936a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@
5
5
  #include <esp_heap_caps.h>
6
6
  #include <esp_mac.h>
7
7
  #include <esp_random.h>
8
+ #include <esp_sleep.h>
8
9
  #include <esp_system.h>
9
10
  #include <esp_rtc_time.h>
10
11
  #include <esp_timer.h>
@@ -40,6 +41,16 @@ static void esp32_restart(void) {
40
41
  esp_restart();
41
42
  }
42
43
 
44
+ static void esp32_deep_sleep_us(uint64_t us) {
45
+ /* Flush + close the file log so buffered lines reach flash; deep sleep
46
+ * reboots the chip on wake, same as mik__sleep_deep does for the JS API. */
47
+ mik_logfile_close();
48
+ esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
49
+ esp_sleep_enable_timer_wakeup(us);
50
+ esp_deep_sleep_start();
51
+ /* Never reached */
52
+ }
53
+
43
54
  static void esp32_yield(void) {
44
55
  vTaskDelay(1);
45
56
  }
@@ -205,6 +216,7 @@ static const MIKPlatform esp32_platform = {
205
216
  .get_rtc_us = esp32_get_rtc_us,
206
217
  .random = esp32_random,
207
218
  .restart = esp32_restart,
219
+ .deep_sleep_us = esp32_deep_sleep_us,
208
220
  .yield = esp32_yield,
209
221
  .get_free_system_mem = esp32_get_free_system_mem,
210
222
  .get_min_free_system_mem = esp32_get_min_free_system_mem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikrojs/firmware",
3
- "version": "0.8.0",
3
+ "version": "0.10.0-pr-134.g682936a",
4
4
  "description": "Mikro.js ESP32 firmware: ESP-IDF component, build tools, and project template",
5
5
  "keywords": [
6
6
  "esp-idf",
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "esbuild": "^0.28.0",
54
- "@mikrojs/quickjs": "0.8.0",
55
- "@mikrojs/native": "0.8.0"
54
+ "@mikrojs/native": "0.10.0-pr-134.g682936a",
55
+ "@mikrojs/quickjs": "0.10.0-pr-134.g682936a"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=24.0.0"
Binary file
Binary file
Binary file
Binary file
Binary file