Set time on make (#35)
* Time can get set from makefile * Added setting make time into simulator * Added Hash in settings * Added default location * Cuts the Githash to 6 characters in the settings in case the makefile didn't do that already * bump gossamer commit * remove automatic timezone setting * automatic time set: rename MAKEFILE_ to BUILD_ to match gossamer * Revert "Added default location" This reverts commit c24f69450fd40472c4f6cebb790a56c3f0d69cb6. * silence warning * watch_get_init_date_time: explicitly initialize all fields to 0 --------- Co-authored-by: Joey Castillo <joeycastillo@utexas.edu>
This commit is contained in:
@@ -215,6 +215,19 @@ static void blue_led_setting_advance(void) {
|
||||
movement_set_backlight_color(color);
|
||||
}
|
||||
|
||||
static void git_hash_setting_display(uint8_t subsecond) {
|
||||
(void) subsecond;
|
||||
char buf[8];
|
||||
// BUILD_GIT_HASH will already be truncated to 6 characters in the makefile, but this is to be safe.
|
||||
sprintf(buf, "%.6s", BUILD_GIT_HASH);
|
||||
watch_display_text_with_fallback(WATCH_POSITION_TOP_LEFT, "GH ", "GH");
|
||||
watch_display_text(WATCH_POSITION_BOTTOM, buf);
|
||||
}
|
||||
|
||||
static void git_hash_setting_advance(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
void settings_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
@@ -223,6 +236,9 @@ void settings_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
int8_t current_setting = 0;
|
||||
|
||||
state->num_settings = 5; // baseline, without LED settings
|
||||
#ifdef BUILD_GIT_HASH
|
||||
state->num_settings++;
|
||||
#endif
|
||||
#ifdef WATCH_RED_TCC_CHANNEL
|
||||
state->num_settings++;
|
||||
#endif
|
||||
@@ -247,6 +263,11 @@ void settings_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
state->settings_screens[current_setting].display = low_energy_setting_display;
|
||||
state->settings_screens[current_setting].advance = low_energy_setting_advance;
|
||||
current_setting++;
|
||||
#endif
|
||||
#ifdef BUILD_GIT_HASH
|
||||
state->settings_screens[current_setting].display = git_hash_setting_display;
|
||||
state->settings_screens[current_setting].advance = git_hash_setting_advance;
|
||||
current_setting++;
|
||||
#endif
|
||||
state->settings_screens[current_setting].display = led_duration_setting_display;
|
||||
state->settings_screens[current_setting].advance = led_duration_setting_advance;
|
||||
|
||||
Reference in New Issue
Block a user