-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from esp-cpp/feature/40-brightness-controls
Feature/40 brightness controls
- Loading branch information
Showing
42 changed files
with
17,487 additions
and
914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include <algorithm> | ||
#include <atomic> | ||
|
||
void update_frame_time(float frame_time); | ||
void reset_frame_time(); | ||
|
||
float get_fps(); | ||
float get_frame_time(); | ||
float get_frame_time_max(); | ||
float get_frame_time_min(); | ||
float get_frame_time_avg(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "statistics.hpp" | ||
|
||
static uint32_t num_frames = 0; | ||
static float frame_time = 0.0f; | ||
static float frame_time_total = 0.0f; | ||
static float frame_time_max = 0.0f; | ||
static float frame_time_min = 0.0f; | ||
static float frame_time_avg = 0.0f; | ||
|
||
void update_frame_time(float frame_time) | ||
{ | ||
num_frames++; | ||
::frame_time = frame_time; | ||
frame_time_total = frame_time_total + frame_time; | ||
frame_time_max = std::max(frame_time_max, frame_time); | ||
frame_time_min = std::min(frame_time_min, frame_time); | ||
frame_time_avg = frame_time_total / num_frames; | ||
} | ||
|
||
void reset_frame_time() | ||
{ | ||
num_frames = 0; | ||
frame_time = 0.0f; | ||
frame_time_total = 0.0f; | ||
frame_time_max = 0.0f; | ||
frame_time_min = 100000.0f; // some large number | ||
frame_time_avg = 0.0f; | ||
} | ||
|
||
float get_fps() { | ||
if (frame_time_total == 0.0f) { | ||
return 0.0f; | ||
} | ||
return num_frames / frame_time_total; | ||
} | ||
|
||
float get_frame_time() { | ||
return frame_time; | ||
} | ||
|
||
float get_frame_time_max() { | ||
return frame_time_max; | ||
} | ||
|
||
float get_frame_time_min() { | ||
return frame_time_min; | ||
} | ||
|
||
float get_frame_time_avg() { | ||
return frame_time_avg; | ||
} |
Submodule espp
updated
95 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
squareline/autosave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
idf_component_register( | ||
SRC_DIRS "src" "generated" | ||
SRC_DIRS "src" "generated" "generated/screens" "generated/components" | ||
INCLUDE_DIRS "include" | ||
PRIV_INCLUDE_DIRS "generated" | ||
REQUIRES lvgl task display logger jpeg box-emu-hal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SET(SOURCES screens/ui_romscreen.c | ||
screens/ui_settingsscreen.c | ||
ui.c | ||
components/ui_comp_hook.c | ||
ui_helpers.c) | ||
|
||
add_library(ui ${SOURCES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This file was generated by SquareLine Studio | ||
// SquareLine Studio version: SquareLine Studio 1.3.3 | ||
// LVGL version: 8.3.3 | ||
// Project name: emu | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
screens/ui_romscreen.c | ||
screens/ui_settingsscreen.c | ||
ui.c | ||
components/ui_comp_hook.c | ||
ui_helpers.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// This file was generated by SquareLine Studio | ||
// SquareLine Studio version: SquareLine Studio 1.3.3 | ||
// LVGL version: 8.3.3 | ||
// Project name: emu | ||
|
||
#include "../ui.h" | ||
|
||
void ui_romscreen_screen_init(void) | ||
{ | ||
ui_romscreen = lv_obj_create(NULL); | ||
lv_obj_clear_flag( ui_romscreen, LV_OBJ_FLAG_SCROLLABLE ); /// Flags | ||
|
||
ui_header = lv_obj_create(ui_romscreen); | ||
lv_obj_set_height( ui_header, 75); | ||
lv_obj_set_width( ui_header, lv_pct(100)); | ||
lv_obj_set_align( ui_header, LV_ALIGN_TOP_MID ); | ||
lv_obj_clear_flag( ui_header, LV_OBJ_FLAG_SCROLLABLE ); /// Flags | ||
|
||
ui_settingsbutton = lv_btn_create(ui_header); | ||
lv_obj_set_width( ui_settingsbutton, 48); | ||
lv_obj_set_height( ui_settingsbutton, 48); | ||
lv_obj_set_align( ui_settingsbutton, LV_ALIGN_LEFT_MID ); | ||
lv_obj_add_flag( ui_settingsbutton, LV_OBJ_FLAG_SCROLL_ON_FOCUS ); /// Flags | ||
lv_obj_clear_flag( ui_settingsbutton, LV_OBJ_FLAG_SCROLLABLE ); /// Flags | ||
|
||
ui_Screen1_Label2 = lv_label_create(ui_settingsbutton); | ||
lv_obj_set_width( ui_Screen1_Label2, LV_SIZE_CONTENT); /// 1 | ||
lv_obj_set_height( ui_Screen1_Label2, LV_SIZE_CONTENT); /// 1 | ||
lv_obj_set_align( ui_Screen1_Label2, LV_ALIGN_CENTER ); | ||
lv_label_set_text(ui_Screen1_Label2,LV_SYMBOL_SETTINGS); | ||
|
||
ui_Screen1_Label1 = lv_label_create(ui_header); | ||
lv_obj_set_width( ui_Screen1_Label1, LV_SIZE_CONTENT); /// 1 | ||
lv_obj_set_height( ui_Screen1_Label1, LV_SIZE_CONTENT); /// 1 | ||
lv_obj_set_align( ui_Screen1_Label1, LV_ALIGN_CENTER ); | ||
lv_label_set_text(ui_Screen1_Label1,"Select Rom"); | ||
|
||
ui_playbutton = lv_btn_create(ui_header); | ||
lv_obj_set_width( ui_playbutton, 48); | ||
lv_obj_set_height( ui_playbutton, 48); | ||
lv_obj_set_align( ui_playbutton, LV_ALIGN_RIGHT_MID ); | ||
lv_obj_add_state( ui_playbutton, LV_STATE_CHECKED ); /// States | ||
lv_obj_add_flag( ui_playbutton, LV_OBJ_FLAG_SCROLL_ON_FOCUS ); /// Flags | ||
lv_obj_clear_flag( ui_playbutton, LV_OBJ_FLAG_SCROLLABLE ); /// Flags | ||
|
||
ui_Screen1_Label3 = lv_label_create(ui_playbutton); | ||
lv_obj_set_width( ui_Screen1_Label3, LV_SIZE_CONTENT); /// 1 | ||
lv_obj_set_height( ui_Screen1_Label3, LV_SIZE_CONTENT); /// 1 | ||
lv_obj_set_align( ui_Screen1_Label3, LV_ALIGN_CENTER ); | ||
lv_label_set_text(ui_Screen1_Label3,LV_SYMBOL_PLAY); | ||
|
||
ui_rompanel = lv_obj_create(ui_romscreen); | ||
lv_obj_set_width( ui_rompanel, 220); | ||
lv_obj_set_height( ui_rompanel, 165); | ||
lv_obj_set_align( ui_rompanel, LV_ALIGN_BOTTOM_LEFT ); | ||
lv_obj_add_flag( ui_rompanel, LV_OBJ_FLAG_SCROLL_ON_FOCUS | LV_OBJ_FLAG_SCROLL_ONE ); /// Flags | ||
lv_obj_set_scroll_dir(ui_rompanel, LV_DIR_VER); | ||
|
||
ui_boxartpanel = lv_obj_create(ui_romscreen); | ||
lv_obj_set_width( ui_boxartpanel, 100); | ||
lv_obj_set_height( ui_boxartpanel, 165); | ||
lv_obj_set_align( ui_boxartpanel, LV_ALIGN_BOTTOM_RIGHT ); | ||
lv_obj_clear_flag( ui_boxartpanel, LV_OBJ_FLAG_SCROLLABLE ); /// Flags | ||
|
||
ui_boxart = lv_img_create(ui_boxartpanel); | ||
lv_obj_set_width( ui_boxart, 100); | ||
lv_obj_set_height( ui_boxart, LV_SIZE_CONTENT); /// 1 | ||
lv_obj_set_align( ui_boxart, LV_ALIGN_CENTER ); | ||
lv_obj_add_flag( ui_boxart, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags | ||
lv_obj_clear_flag( ui_boxart, LV_OBJ_FLAG_SCROLLABLE ); /// Flags | ||
|
||
lv_obj_add_event_cb(ui_settingsbutton, ui_event_settingsbutton, LV_EVENT_ALL, NULL); | ||
|
||
} |
Oops, something went wrong.