Skip to content

Commit

Permalink
Flip GU312 screen to match case layout; hide serial midi toggle from …
Browse files Browse the repository at this point in the history
…admin panel if feature flag is off; long menu timeout
  • Loading branch information
akasaka committed Dec 16, 2024
1 parent 3e337cd commit a9374b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/app/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ void AppShimMenu::step() {
ProtoShimNavMenu::step();
if(hid_test_key_any()) {
last_touch_time = xTaskGetTickCount();
} else if (xTaskGetTickCount() - last_touch_time >= pdMS_TO_TICKS(back_stack.size() == 0 ? 5000 : 30000)) {
} else if (xTaskGetTickCount() - last_touch_time >= pdMS_TO_TICKS(30000)) {
pop_state(STATE_MENU, TRANSITION_SLIDE_HORIZONTAL_LEFT);
}
}
Expand Down
23 changes: 6 additions & 17 deletions src/display/gu312.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ void NoritakeGu312Driver::set_databus(uint8_t data) {

void NoritakeGu312Driver::pulse_clock() {
gpio_set_level(wr_gpio, 0);
delayMicroseconds(2);
delayMicroseconds(1);
gpio_set_level(wr_gpio, 1);
delayMicroseconds(2);
delayMicroseconds(1);
}

void NoritakeGu312Driver::set_is_command(bool rs) {
// H: COMMAND, L: Data
gpio_set_level(cd_gpio, rs ? 1 : 0);
delayMicroseconds(3);
delayMicroseconds(1);
}

void NoritakeGu312Driver::send_command(uint8_t cmd) {
Expand All @@ -116,7 +116,7 @@ void NoritakeGu312Driver::send_command(uint8_t cmd) {

void NoritakeGu312Driver::reset() {
ESP_LOGI(LOG_TAG, "Resetting");
taskENTER_CRITICAL(&_spinlock);
taskENTER_CRITICAL(&_spinlock);

send_command(0b11000); // brightness max
send_command(0b00010); // SCR2 on
Expand Down Expand Up @@ -147,8 +147,7 @@ void NoritakeGu312Driver::reset() {

ESP_LOGI(LOG_TAG, "Reset complete");

taskEXIT_CRITICAL(&_spinlock);
// while(true) vTaskDelay(portMAX_DELAY);
taskEXIT_CRITICAL(&_spinlock);
}

void NoritakeGu312Driver::set_power(bool power) {
Expand All @@ -159,16 +158,6 @@ void NoritakeGu312Driver::clear() {
ESP_LOGW(LOG_TAG, "Not supported!");
}

inline uint8_t flipByte(uint8_t c){
char r=0;
for(uint8_t i = 0; i < 8; i++){
r <<= 1;
r |= c & 1;
c >>= 1;
}
return r;
}

void NoritakeGu312Driver::write_fanta(const uint8_t * strides, size_t count) {
taskENTER_CRITICAL(&_spinlock);
if(fep_gpio != GPIO_NUM_NC) {
Expand All @@ -183,7 +172,7 @@ void NoritakeGu312Driver::write_fanta(const uint8_t * strides, size_t count) {
set_databus(0xc); pulse_clock();
send_command(0b01000); // WRITE mode
for(int i = 0; i < count; i++) {
set_databus(flipByte(strides[i]));
set_databus(strides[count - 1 - i]);
pulse_clock();
if(i % 2 != 0) {
set_databus(0);
Expand Down
2 changes: 2 additions & 0 deletions src/network/admin_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,9 @@ static void build() {

GP.SPOILER_BEGIN("Administration", GP_BLUE);
render_bool("Remote control server", PREFS_KEY_REMOTE_SERVER);
#if HAS(SERIAL_MIDI)
render_bool("Serial MIDI input", PREFS_KEY_SERIAL_MIDI);
#endif
#if HAS(HTTPFVU)
render_bool("Check for updates automatically", PREFS_KEY_FVU_AUTO_CHECK);
render_bool("Install updates automatically", PREFS_KEY_FVU_AUTO_INSTALL);
Expand Down

0 comments on commit a9374b9

Please sign in to comment.