diff --git a/appinfo.json b/appinfo.json new file mode 100644 index 0000000..5485bfd --- /dev/null +++ b/appinfo.json @@ -0,0 +1,33 @@ +{ + "appKeys": {}, + "capabilities": [ + "" + ], + "companyName": "MPG13", + "enableMultiJS": true, + "longName": "Crash", + "projectType": "native", + "resources": { + "media": [ + { + "file": "images/icon.png", + "menuIcon": true, + "name": "ICON", + "targetPlatforms": null, + "type": "png" + } + ] + }, + "sdkVersion": "3", + "shortName": "Crash", + "targetPlatforms": [ + "aplite", + "basalt", + "chalk" + ], + "uuid": "42a16663-bbfb-4b1c-b6a5-0a50ccd200d1", + "versionLabel": "1.0", + "watchapp": { + "watchface": false + } +} diff --git a/resources/images/icon.png b/resources/images/icon.png new file mode 100644 index 0000000..54f74f1 Binary files /dev/null and b/resources/images/icon.png differ diff --git a/src/screen.c b/src/screen.c new file mode 100644 index 0000000..8316bd5 --- /dev/null +++ b/src/screen.c @@ -0,0 +1,45 @@ +#include + +static Window *s_window; +static TextLayer *s_text_layer; + +static void init(void) { + // Create window + s_window = window_create(); + Layer *window_layer = window_get_root_layer(s_window); + GRect bounds = layer_get_bounds(window_layer); + + //text + s_text_layer = text_layer_create(bounds); + text_layer_set_text(s_text_layer, "P:/ Error: main.c not found P:/ Trying again... P:/ Error: main.c not found P:/ Trying again... P:/ Error: main.c not found P:/ Exceeded retries P:/ Reboot to try to launch P:/ Input disconnected P:/ Error: Data Corrupted P:/ _ Pebble Terminal v 3.9.2"); + + //font + text_layer_set_font(s_text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14)); + text_layer_set_text_alignment(s_text_layer, GTextAlignmentLeft); + + //ad layer + layer_add_child(window_get_root_layer(s_window), text_layer_get_layer(s_text_layer)); + + //indent + text_layer_enable_screen_text_flow_and_paging(s_text_layer, 2); + + //window animation + window_stack_push(s_window, false); + + // App Logs + APP_LOG(APP_LOG_LEVEL_DEBUG, "'crashed'"); +} + +static void deinit(void) { + // Destroy layer + text_layer_destroy(s_text_layer); + + // Destroy window + window_destroy(s_window); +} + +int main(void) { + init(); + app_event_loop(); + deinit(); +} diff --git a/wscript b/wscript new file mode 100644 index 0000000..78aad52 --- /dev/null +++ b/wscript @@ -0,0 +1,41 @@ +# +# This file is the default set of rules to compile a Pebble project. +# +# Feel free to customize this to your needs. +# + +import os.path + +top = '.' +out = 'build' + + +def options(ctx): + ctx.load('pebble_sdk') + + +def configure(ctx): + ctx.load('pebble_sdk') + + +def build(ctx): + ctx.load('pebble_sdk') + + build_worker = os.path.exists('worker_src') + binaries = [] + + for p in ctx.env.TARGET_PLATFORMS: + ctx.set_env(ctx.all_envs[p]) + ctx.set_group(ctx.env.PLATFORM_NAME) + app_elf = '{}/pebble-app.elf'.format(ctx.env.BUILD_DIR) + ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'), target=app_elf) + + if build_worker: + worker_elf = '{}/pebble-worker.elf'.format(ctx.env.BUILD_DIR) + binaries.append({'platform': p, 'app_elf': app_elf, 'worker_elf': worker_elf}) + ctx.pbl_worker(source=ctx.path.ant_glob('worker_src/**/*.c'), target=worker_elf) + else: + binaries.append({'platform': p, 'app_elf': app_elf}) + + ctx.set_group('bundle') + ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob('src/js/**/*.js'), js_entry_file='src/js/app.js')