Skip to content

Commit

Permalink
Low Battery Display
Browse files Browse the repository at this point in the history
Added display of low battery on the watchapp.
  • Loading branch information
333fred committed Feb 3, 2016
1 parent b920b9f commit 2f822d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions src/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern status_type s_blue2_status;
extern status_type s_blue3_status;

// Constant text strings for the connection statuses
const char *eth = "Eth", *ds = "DS", *radio = "Rd", *rio = "RIO", *code = "Cd", *estop = "Est", *good = "G", *bwu = "BWU", *byp = "BYP";
const char *eth = "Eth", *ds = "DS", *radio = "Rd", *rio = "RIO", *code = "Cd", *estop = "Est", *good = "G", *bwu = "BWU", *byp = "BYP", *bat = "Bat";

// Updates the text on the screen with the current values. It uses the correct display whether
// the current update type is status or team number.
Expand Down Expand Up @@ -179,6 +179,10 @@ void set_alliance_status(status_type status, uint8_t alliance, uint8_t team) {
text = byp;
hi_contrast = false;
break;
case BAT:
text = bat;
hi_contrast = true;
break;
}
set_alliance_text(text, hi_contrast, alliance, team, false);
}
Expand Down Expand Up @@ -208,16 +212,16 @@ void setup_text_window_load(Layer *window_layer) {
layer_add_child(window_layer, text_layer_get_layer(s_blue_header));

// Create the layers for the different alliance statuses
setup_alliance_textlayer(&s_red1, window_layer, 74, 112, s_source_code_pro);
setup_alliance_textlayer(&s_red2, window_layer, 74, 66, s_source_code_pro);
setup_alliance_textlayer(&s_red3, window_layer, 74, 20, s_source_code_pro);
setup_alliance_textlayer(&s_red1, window_layer, 73, 112, s_source_code_pro);
setup_alliance_textlayer(&s_red2, window_layer, 73, 66, s_source_code_pro);
setup_alliance_textlayer(&s_red3, window_layer, 73, 20, s_source_code_pro);
setup_alliance_textlayer(&s_blue1, window_layer, 0, 20, s_source_code_pro);
setup_alliance_textlayer(&s_blue2, window_layer, 0, 66, s_source_code_pro);
setup_alliance_textlayer(&s_blue3, window_layer, 0, 112, s_source_code_pro);

setup_alliance_textlayer(&s_red1_number, window_layer, 74, 112, s_source_code_pro_number);
setup_alliance_textlayer(&s_red2_number, window_layer, 74, 66, s_source_code_pro_number);
setup_alliance_textlayer(&s_red3_number, window_layer, 74, 20, s_source_code_pro_number);
setup_alliance_textlayer(&s_red1_number, window_layer, 73, 112, s_source_code_pro_number);
setup_alliance_textlayer(&s_red2_number, window_layer, 73, 66, s_source_code_pro_number);
setup_alliance_textlayer(&s_red3_number, window_layer, 73, 20, s_source_code_pro_number);
setup_alliance_textlayer(&s_blue1_number, window_layer, 0, 20, s_source_code_pro_number);
setup_alliance_textlayer(&s_blue2_number, window_layer, 0, 66, s_source_code_pro_number);
setup_alliance_textlayer(&s_blue3_number, window_layer, 0, 112, s_source_code_pro_number);
Expand Down
2 changes: 1 addition & 1 deletion src/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <pebble.h>

typedef enum {
ETH=0, DS=1, RADIO=2, RIO=3, CODE=4, ESTOP=5, GOOD=6, BWU=7, BYP = 8
ETH=0, DS=1, RADIO=2, RIO=3, CODE=4, ESTOP=5, GOOD=6, BWU=7, BYP = 8, BAT = 9
} status_type;

char* translate_error(AppMessageResult res);

0 comments on commit 2f822d3

Please sign in to comment.