Skip to content

Commit

Permalink
ready to release 1.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
marchingband committed Dec 23, 2021
1 parent b235fdc commit 9ec3311
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 21 deletions.
34 changes: 17 additions & 17 deletions examples/wvr_dev_board/wvr_dev_board.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

WVR wvr;

Button *switch_one;
Button *switch_two;
Button *switchOne;
Button *switchTwo;

void onEncoderDevBoard(bool down)
{
Expand Down Expand Up @@ -38,34 +38,34 @@ void onPotDevBoard(uint32_t raw_val)
if(temp != val)
{
val = temp;
log_i("%d", val);
// log_i("%d", val);
wvr.setGlobalVolume(val);
}
}

void switch_one_up(void)
void switchOneUp(void)
{
log_i("switch one up");
// log_i("switch one up");
wvr.unmute();
// rgb_set_color(100 /* red */,100 /* green */,100 /* blue */); // makes white
}

void switch_one_down(void)
void switchOneDown(void)
{
log_i("switch one down");
// log_i("switch one down");
wvr.mute();
// rgb_set_color(0 ,0 ,0); // turn off RGB LED
}

void switch_two_up(void)
void switchTwoUp(void)
{
log_i("switch two up");
// log_i("switch two up");
wvr.wifiOn();
}

void switch_two_down(void)
void switchTwoDown(void)
{
log_i("switch two down");
// log_i("switch two down");
wvr.wifiOff();
}

Expand All @@ -86,13 +86,13 @@ void setup() {
pinMode(D3, INPUT_PULLUP);
pinMode(D4, INPUT_PULLUP);

switch_one = new Button(D3, FALLING, 60);
switch_two = new Button(D4, FALLING, 60);
switchOne = new Button(D3, FALLING, 60);
switchTwo = new Button(D4, FALLING, 60);

switch_one->onPress(switch_one_up);
switch_one->onRelease(switch_one_down);
switch_two->onPress(switch_two_up);
switch_two->onRelease(switch_two_down);
switchOne->onPress(switchOneUp);
switchOne->onRelease(switchOneDown);
switchTwo->onPress(switchTwoUp);
switchTwo->onRelease(switchTwoDown);

wvr.wifiIsOn = get_metadata()->wifi_starts_on;
log_i("wifi is %s", wvr.wifiIsOn ? "on" : "off");
Expand Down
12 changes: 10 additions & 2 deletions src/boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void bootFromEmmc(int index)
uint8_t *buf = (uint8_t *)ps_malloc(SECTOR_SIZE);

log_i("starting update");
int loop_num = 0;
for(int i=0;i<num_sectors;i++){
feedLoopWDT();
ESP_ERROR_CHECK(emmc_read(buf,sector++,1));
Expand All @@ -34,7 +35,10 @@ void bootFromEmmc(int index)
Update.abort();
break;
} else {
printf(".");
if(loop_num++ % 20 == 0)
{
Serial.print(".");
}
}
}
ESP_ERROR_CHECK(emmc_read(buf,sector++,1));
Expand Down Expand Up @@ -83,6 +87,7 @@ void boot_into_recovery_mode(void)
uint8_t *buf = (uint8_t *)ps_malloc(SECTOR_SIZE);

log_i("starting update");
int loop_num = 0;
for(int i=0;i<num_sectors;i++){
ESP_ERROR_CHECK(emmc_read(buf,sector++,1));
size_t written = Update.write(buf, SECTOR_SIZE);
Expand All @@ -91,7 +96,10 @@ void boot_into_recovery_mode(void)
Update.abort();
break;
} else {
printf(".");
if(loop_num++ % 20 == 0)
{
Serial.print(".");
}
}
}
ESP_ERROR_CHECK(emmc_read(buf,sector++,1));
Expand Down
4 changes: 2 additions & 2 deletions src/bundle.h

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ void handleWav(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t
AsyncWebHeader* note_string = request->getHeader("note");
sscanf(note_string->value().c_str(), "%d", &w_note);
w_start_block = find_gap_in_file_system(w_size);
if(w_start_block == 0)
{
// error no mem
request->send(507);
}
}
if(w_start_block == 0)
{
feedLoopWDT();
return;
}
//always
feedLoopWDT();
Expand Down Expand Up @@ -268,6 +278,16 @@ void handleRack(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_
sscanf(request->getHeader("layer")->value().c_str(), "%d", &r_layer);
r_rack_json = request->getHeader("rack-json")->value().c_str();
r_start_block = find_gap_in_file_system(total);
if(r_start_block == 0)
{
//error no mem
request->send(507);
}
}
if(r_start_block == 0)
{
feedLoopWDT();
return;
}
//always
feedLoopWDT();
Expand Down Expand Up @@ -723,6 +743,12 @@ void server_begin() {
handleRPC
);

server.on(
"/emmcReset",
HTTP_GET,
handleEmmcReset
);

ws.onEvent(onWsEvent);
server.addHandler(&ws);

Expand Down

0 comments on commit 9ec3311

Please sign in to comment.