Skip to content

Commit 1893fba

Browse files
authored
Merge pull request #53 from hfmanson/master
Fix get_sample_byte, int8_t -> uint8_t
2 parents 1f2cf46 + cacf2f0 commit 1893fba

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ prepare-sha2017: prepare
2929

3030
clean:
3131
rm -rf "$(BUILDDIR)"
32+
rm components/micropython/mpconfigoverrides.h
3233
source "$(IDF_PATH)/export.sh" && idf.py clean
3334

3435
build:

components/driver_sndmixer/snd_source_wav.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int IRAM_ATTR wav_init_source(const void *data_start, const void *data_end, int
7373
chunk_hdr_t *ch = (chunk_hdr_t *)p;
7474
if (memcmp(ch->magic, "fmt ", 4) == 0) {
7575
if (ch->fmt.fmtcode != WAVE_FORMAT_PCM) {
76-
printf("Unsupported wav format: %d\n", ch->fmt.fmtcode);
76+
ESP_LOGW(TAG, "Unsupported wav format: %d\n", ch->fmt.fmtcode);
7777
goto err;
7878
}
7979
wav->rate = ch->fmt.samplespersec;
@@ -91,10 +91,10 @@ int IRAM_ATTR wav_init_source(const void *data_start, const void *data_end, int
9191
}
9292

9393
if (wav->bits != 8 && wav->bits != 16) {
94-
printf("No fmt chunk or unsupported bits/sample: %d\n", wav->bits);
94+
ESP_LOGW(TAG, "No fmt chunk or unsupported bits/sample: %d\n", wav->bits);
9595
goto err;
9696
}
97-
printf("Wav: %d bit/sample, %d Hz, %d bytes long\n", wav->bits, wav->rate, wav->data_len);
97+
ESP_LOGI(TAG, "channels: %d, bits: %d, rate: %d, len: %d", wav->channels, wav->bits, wav->rate, wav->data_len);
9898
wav->pos = 0;
9999
*ctx = (void *)wav;
100100
*stereo = (wav->channels >= 2);
@@ -183,8 +183,8 @@ int IRAM_ATTR wav_get_sample_rate(void *ctx) {
183183
return wav->rate;
184184
}
185185

186-
int8_t get_sample_byte(wav_ctx_t *wav) {
187-
int8_t rv = 0;
186+
uint8_t get_sample_byte(wav_ctx_t *wav) {
187+
uint8_t rv = 0;
188188
if(wav->stream) {
189189
int read = wav->stream_read(wav->stream, &rv, 1);
190190
wav->pos += read;

components/micropython/help.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@ const char esp32_help_text[] =
44
"Welcome to BadgePython!\n"
55
"\n"
66
"Please visit https://docs.badge.team/ for documentation and a getting started guide.\n"
7+
"\n"
8+
"Control commands:\n"
9+
" CTRL-A -- on a blank line, enter raw REPL mode\n"
10+
" CTRL-B -- on a blank line, enter normal REPL mode\n"
11+
" CTRL-C -- interrupt a running program\n"
12+
" CTRL-D -- on a blank line, do a soft reset of the board\n"
13+
" CTRL-E -- on a blank line, enter paste mode\n"
714
"\n";

partition_tables/mch2022.csv

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
nvs, data, nvs, 0x9000, 16K,
44
otadata, data, ota, 0xD000, 8K,
55
phy_init, data, phy, 0xF000, 4K,
6-
ota_0, 0, ota_0, 0x10000, 1600K,
7-
ota_1, 0, ota_1, 0x1A0000, 1600K,
6+
ota_0, 0, ota_0, 0x10000, 3200K,
87
appfs, 0x43, 3, 0x330000, 8000K,
98
locfd, data, fat, 0xB00000, 5120K,

0 commit comments

Comments
 (0)