Disable debug features (to prepare for release)
This commit is contained in:
48
src/c/main.c
48
src/c/main.c
@@ -2,7 +2,7 @@
|
||||
#include <pebble.h>
|
||||
|
||||
// DEBUG memory usage layer
|
||||
static TextLayer *s_memory_layer;
|
||||
// static TextLayer *s_memory_layer;
|
||||
|
||||
// declare general statics
|
||||
static Window *s_main_window;
|
||||
@@ -185,9 +185,9 @@ static void update_minute_1() {
|
||||
first_minute_update = false;
|
||||
|
||||
// DEBUG memory usage layer
|
||||
static char s_memory_buffer[32];
|
||||
snprintf(s_memory_buffer, sizeof(s_memory_buffer), "%d/%d", (int)heap_bytes_used(), (int)heap_bytes_free() + (int)heap_bytes_used());
|
||||
text_layer_set_text(s_memory_layer, s_memory_buffer);
|
||||
// static char s_memory_buffer[32];
|
||||
// snprintf(s_memory_buffer, sizeof(s_memory_buffer), "%d/%d", (int)heap_bytes_used(), (int)heap_bytes_free() + (int)heap_bytes_used());
|
||||
// text_layer_set_text(s_memory_layer, s_memory_buffer);
|
||||
}
|
||||
|
||||
static void schedule_guy_animation(Animation *raise_tmpl, Animation *out_tmpl, Animation *in_tmpl, AnimationStoppedHandler out_handler) {
|
||||
@@ -287,7 +287,7 @@ static void main_window_load(Window *window) {
|
||||
layer_add_child(window_layer, bitmap_layer_get_layer(s_bt_layer));
|
||||
|
||||
// DEBUG memory usage layer
|
||||
layer_add_child(window_layer, text_layer_get_layer(s_memory_layer));
|
||||
// layer_add_child(window_layer, text_layer_get_layer(s_memory_layer));
|
||||
|
||||
// create animation templates
|
||||
//// butt raise
|
||||
@@ -345,22 +345,22 @@ static void bluetooth_callback(bool connected) {
|
||||
}
|
||||
|
||||
// DEBUG buttons
|
||||
static void up_single_click_handler(ClickRecognizerRef recognizer, void *context) {
|
||||
Window *window = (Window *)context;
|
||||
update_minute_60();
|
||||
}
|
||||
// static void up_single_click_handler(ClickRecognizerRef recognizer, void *context) {
|
||||
// Window *window = (Window *)context;
|
||||
// update_minute_60();
|
||||
//}
|
||||
|
||||
// DEBUG buttons
|
||||
static void down_single_click_handler(ClickRecognizerRef recognizer, void *context) {
|
||||
Window *window = (Window *)context;
|
||||
update_minute_30();
|
||||
}
|
||||
// static void down_single_click_handler(ClickRecognizerRef recognizer, void *context) {
|
||||
// Window *window = (Window *)context;
|
||||
// update_minute_30();
|
||||
//}
|
||||
|
||||
// DEBUG buttons
|
||||
static void click_config_provider(Window *window) {
|
||||
window_single_click_subscribe(BUTTON_ID_UP, up_single_click_handler);
|
||||
window_single_click_subscribe(BUTTON_ID_DOWN, down_single_click_handler);
|
||||
}
|
||||
// static void click_config_provider(Window *window) {
|
||||
// window_single_click_subscribe(BUTTON_ID_UP, up_single_click_handler);
|
||||
// window_single_click_subscribe(BUTTON_ID_DOWN, down_single_click_handler);
|
||||
//}
|
||||
|
||||
// set up the app on launch (don't put app logic in here);
|
||||
static void init() {
|
||||
@@ -440,11 +440,11 @@ static void init() {
|
||||
bitmap_layer_set_compositing_mode(s_bt_layer, GCompOpSet);
|
||||
bitmap_layer_set_alignment(s_bt_layer, GAlignCenter);
|
||||
//// DEBUG memory usage layer
|
||||
s_memory_layer = text_layer_create(GRect(0, PBL_DISPLAY_HEIGHT - 24, PBL_DISPLAY_WIDTH, 14));
|
||||
text_layer_set_background_color(s_memory_layer, GColorClear);
|
||||
text_layer_set_font(s_memory_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14));
|
||||
text_layer_set_text_color(s_memory_layer, GColorWhite);
|
||||
PBL_IF_ROUND_ELSE(text_layer_set_text_alignment(s_memory_layer, GTextAlignmentCenter), text_layer_set_text_alignment(s_memory_layer, GTextAlignmentLeft));
|
||||
// s_memory_layer = text_layer_create(GRect(0, PBL_DISPLAY_HEIGHT - 24, PBL_DISPLAY_WIDTH, 14));
|
||||
// text_layer_set_background_color(s_memory_layer, GColorClear);
|
||||
// text_layer_set_font(s_memory_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14));
|
||||
// text_layer_set_text_color(s_memory_layer, GColorWhite);
|
||||
// PBL_IF_ROUND_ELSE(text_layer_set_text_alignment(s_memory_layer, GTextAlignmentCenter), text_layer_set_text_alignment(s_memory_layer, GTextAlignmentLeft));
|
||||
|
||||
// make sure the time is displayed from the start
|
||||
// and that the date/bt indicators are centered
|
||||
@@ -464,7 +464,7 @@ static void init() {
|
||||
tick_timer_service_subscribe(MINUTE_UNIT, minute_handler);
|
||||
|
||||
// DEBUG buttons
|
||||
window_set_click_config_provider(s_main_window, (ClickConfigProvider)click_config_provider);
|
||||
// window_set_click_config_provider(s_main_window, (ClickConfigProvider)click_config_provider);
|
||||
}
|
||||
|
||||
// free memory on app exit
|
||||
@@ -478,7 +478,7 @@ static void deinit() {
|
||||
bitmap_layer_destroy(s_bt_layer);
|
||||
|
||||
// DEBUG memory usage layer
|
||||
text_layer_destroy(s_memory_layer);
|
||||
// text_layer_destroy(s_memory_layer);
|
||||
|
||||
// unload font
|
||||
fonts_unload_custom_font(s_custom_font);
|
||||
|
||||
Reference in New Issue
Block a user