Skip to content

Commit

Permalink
otaku chimes
Browse files Browse the repository at this point in the history
  • Loading branch information
zyphlar committed Jan 18, 2024
1 parent 3968b4e commit 2a00ba5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
40 changes: 39 additions & 1 deletion src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ void DisplayApp::Refresh() {

Messages msg;
if (xQueueReceive(msgQueue, &msg, queueTimeout) == pdTRUE) {

// let's do otaku chimes
uint8_t myHour = dateTimeController.Hours();
uint8_t myChimes = 9-(((int)floor(myHour/2))%6);

switch (msg) {
case Messages::DimScreen:
DimScreen();
Expand Down Expand Up @@ -377,7 +382,40 @@ void DisplayApp::Refresh() {
break;
case Messages::Chime:
LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
motorController.RunForDuration(35);

// hour chime
// 0 9
// 1 9
// 2 8
// 3 8
// 4 7
// 5 7
// 6 6
// 7 6
// 8 5
// 9 5
// 10 4
// 11 4
// 12 9
// 13 9
// 14 8
// 15 8
// 16 7
// 17 7
// 18 6
// 19 6
// 20 5
// 21 5
// 22 4
// 23 4
motorController.RunForDuration(15);
// NRF_LOG_INFO("buzzing %d times", myChimes);

for (uint8_t i=0; i<myChimes; i++){
// NRF_LOG_INFO("buzz!");
motorController.RunForDuration(400);
vTaskDelay(400);
}
break;
case Messages::OnChargingEvent:
RestoreBrightness();
Expand Down
4 changes: 2 additions & 2 deletions src/displayapp/screens/WatchFaceAnalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ void WatchFaceAnalog::drawWatchFaceWadokei(){
sHour = hour;
sMinute = minute;

hour_point_trace[0] = CoordinateRelocate(HourLength*.7, hourAngle+90-33);
hour_point_trace[0] = CoordinateRelocate(28, hourAngle+90-66); //axis radius minus line stroke
hour_point_trace[1] = CoordinateRelocate(HourLength, hourAngle+90);

hour_point[0] = CoordinateRelocate(HourLength*.7, hourAngle+90+33);
hour_point[0] = CoordinateRelocate(28, hourAngle+90+66); //axis radius minus line stroke
hour_point[1] = CoordinateRelocate(HourLength, hourAngle+90);

lv_line_set_points(hour_body, hour_point, 2);
Expand Down
4 changes: 2 additions & 2 deletions src/displayapp/screens/settings/SettingSetTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ SettingSetTime::SettingSetTime(Pinetime::Controllers::DateTime& dateTimeControll

lv_obj_t* staticLabel = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(staticLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
lv_label_set_text_static(staticLabel, "00:00:00");
lv_obj_align(staticLabel, lv_scr_act(), LV_ALIGN_CENTER, 0, POS_Y_TEXT);
lv_label_set_text_static(staticLabel, ":00");
lv_obj_align(staticLabel, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -33, POS_Y_TEXT);

hourCounter.Create();
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
Expand Down

0 comments on commit 2a00ba5

Please sign in to comment.