Skip to content

Commit

Permalink
Merge pull request #130 from m5stack/develop
Browse files Browse the repository at this point in the history
0.2.0
  • Loading branch information
lovyan03 authored Nov 8, 2024
2 parents da41430 + 2e81436 commit cf1aec3
Show file tree
Hide file tree
Showing 24 changed files with 897 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ void setup(void)

while (false == SD.begin(GPIO_NUM_4, SPI, 25000000))
{
delay(500);
M5.delay(500);
}

gfxSetup(&M5.Display);
Expand All @@ -487,7 +487,7 @@ void loop(void)
}
else
{
delay(1);
M5.delay(1);
}

M5.update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ void loop(void)
{
for (auto filename : files) {
playSdWav(filename);
delay(500);
M5.delay(500);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static void decodeTask(void*)
{
for (;;)
{
delay(1);
M5.delay(1);
if (playindex != ~0u)
{
auto index = playindex;
Expand Down Expand Up @@ -588,7 +588,7 @@ void setup(void)
preallocateCodec = malloc(preallocateCodecSize);
if (!preallocateBuffer || !preallocateCodec) {
M5.Display.printf("FATAL ERROR: Unable to preallocate %d bytes for app\n", preallocateBufferSize + preallocateCodecSize);
for (;;) { delay(1000); }
for (;;) { M5.delay(1000); }
}

{ /// custom setting
Expand Down Expand Up @@ -616,7 +616,7 @@ void setup(void)
// Try forever
while (WiFi.status() != WL_CONNECTED) {
M5.Display.print(".");
delay(100);
M5.delay(100);
}
M5.Display.clear();

Expand All @@ -636,7 +636,7 @@ void loop(void)
int frame;
do
{
delay(1);
M5.delay(1);
} while (prev_frame == (frame = millis() >> 3)); /// 8 msec cycle wait
prev_frame = frame;
}
Expand Down
22 changes: 19 additions & 3 deletions examples/Basic/HowToUse/HowToUse.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
// If you use SD card, write this.
#include <SD.h>

#if __has_include(<LittleFS.h>)
// If you use LittleFS, write this.
// #include <LittleFS.h>
#endif

#if __has_include(<SPIFFS.h>)
// If you use SPIFFS, write this.
#include <SPIFFS.h>
// #include <SPIFFS.h>
#endif

#endif

Expand Down Expand Up @@ -275,6 +282,9 @@ void setup(void)
case m5::board_t::board_M5AtomS3:
name = "ATOMS3";
break;
case m5::board_t::board_M5AtomS3R:
name = "ATOMS3R";
break;
case m5::board_t::board_M5Dial:
name = "Dial";
break;
Expand Down Expand Up @@ -329,8 +339,14 @@ void setup(void)
case m5::board_t::board_M5Station:
name = "Station";
break;
case m5::board_t::board_M5Atom:
name = "ATOM";
case m5::board_t::board_M5AtomLite:
name = "ATOM Lite";
break;
case m5::board_t::board_M5AtomMatrix:
name = "ATOM Matrix";
break;
case m5::board_t::board_M5AtomEcho:
name = "ATOM ECHO";
break;
case m5::board_t::board_M5AtomPsram:
name = "ATOM PSRAM";
Expand Down
8 changes: 2 additions & 6 deletions examples/Basic/Microphone/Microphone.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ static size_t rec_record_idx = 2;
static size_t draw_record_idx = 0;
static int16_t *rec_data;

#if !defined ( ARDUINO )
void delay(uint32_t msec) { vTaskDelay(msec / portTICK_PERIOD_MS ); }
#endif

void setup(void)
{
auto cfg = M5.config();
Expand Down Expand Up @@ -96,7 +92,7 @@ void loop(void)
if (M5.Speaker.isEnabled())
{
M5.Display.clear();
while (M5.Mic.isRecording()) { delay(1); }
while (M5.Mic.isRecording()) { M5.delay(1); }

/// Since the microphone and speaker cannot be used at the same time, turn off the microphone here.
M5.Mic.end();
Expand All @@ -115,7 +111,7 @@ void loop(void)
}
do
{
delay(1);
M5.delay(1);
M5.update();
} while (M5.Speaker.isPlaying());

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/Rtc/Rtc.ino
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void setup(void)
for (int i = 20; i && WiFi.status() != WL_CONNECTED; --i)
{
M5.Log.print(".");
delay(500);
M5.delay(500);
}
if (WiFi.status() == WL_CONNECTED) {
M5.Log.println("\r\nWiFi Connected.");
Expand All @@ -72,10 +72,10 @@ void setup(void)
while (sntp_get_sync_status() != SNTP_SYNC_STATUS_COMPLETED)
{
M5.Log.print(".");
delay(1000);
M5.delay(1000);
}
#else
delay(1600);
M5.delay(1600);
struct tm timeInfo;
while (!getLocalTime(&timeInfo, 1000))
{
Expand All @@ -101,7 +101,7 @@ void loop(void)
{
static constexpr const char* const wd[7] = {"Sun","Mon","Tue","Wed","Thr","Fri","Sat"};

delay(500);
M5.delay(500);

auto dt = M5.Rtc.getDateTime();
M5.Display.setCursor(0,0);
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"dependencies": [
{
"name": "M5GFX",
"version": ">=0.1.17"
"version": ">=0.2.0"
}
],
"version": "0.1.17",
"version": "0.2.0",
"frameworks": ["arduino", "espidf", "*"],
"platforms": ["espressif32", "native"],
"headers": "M5Unified.h"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=M5Unified
version=0.1.17
version=0.2.0
author=M5Stack
maintainer=M5Stack
sentence=Library for M5Stack/Core2/Tough/CoreS3/CoreS3SE, M5StickC/C-Plus/C-Plus2, M5CoreInk, M5Paper, M5ATOM, M5STAMP, M5Station, M5Dial, M5DinMeter, M5Capsule, M5Cardputer, M5VAMeter
Expand Down
Loading

0 comments on commit cf1aec3

Please sign in to comment.