Skip to content

Commit

Permalink
upgrade to Pebble SDK 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
unlobito committed May 31, 2015
1 parent 9de192c commit c6ae802
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 52 deletions.
97 changes: 52 additions & 45 deletions appinfo.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,54 @@
{
"appKeys": {
"card_barcode_data": 22,
"card_index": 20,
"card_name": 23,
"card_value": 21,
"error": 99,
"fetch_data": 0,
"number_of_cards": 10,
"pushing_data": 1,
"rewards_updated_at": 13
},
"capabilities": [
"configurable"
],
"companyName": "Henri Watson",
"longName": "Skunk",
"projectType": "native",
"resources": {
"media": [
{
"file": "images/error.png",
"name": "IMAGE_ERROR",
"type": "png"
},
{
"file": "images/refresh.png",
"name": "IMAGE_REFRESH",
"type": "png"
},
{
"file": "images/icon.png",
"menuIcon": true,
"name": "IMAGE_MENU_ICON",
"type": "png"
}
]
},
"sdkVersion": "2",
"shortName": "Skunk",
"uuid": "1e420b43-63be-45f7-822c-2a7d57a55384",
"versionCode": 1,
"versionLabel": "1.0",
"watchapp": {
"watchface": false
}
"appKeys": {
"fetch_data": 0,
"pushing_data": 1,

"number_of_cards": 10,
"rewards_updated_at": 13,

"card_index": 20,
"card_value": 21,
"card_barcode_data": 22,
"card_name": 23,

"error": 99
},
"capabilities": [
"configurable"
],
"companyName": "Henri Watson",
"longName": "Skunk",
"projectType": "native",
"resources": {
"media": [
{
"file": "images/error.png",
"name": "IMAGE_ERROR",
"type": "png"
},
{
"file": "images/refresh.png",
"name": "IMAGE_REFRESH",
"type": "png"
},
{
"file": "images/icon.png",
"menuIcon": true,
"name": "IMAGE_MENU_ICON",
"type": "png"
}
]
},
"sdkVersion": "3",
"shortName": "Skunk",
"uuid": "1e420b43-63be-45f7-822c-2a7d57a55384",
"versionCode": 1,
"versionLabel": "1.0",
"watchapp": {
"watchface": false
},
"targetPlatforms": [
"aplite",
"basalt"
]
}
5 changes: 4 additions & 1 deletion src/error_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ void error_window_init(void) {
window = window_create();
window_set_background_color(window, GColorBlack);
window_set_click_config_provider(window, window_click_config_provider);
window_set_fullscreen(window, true);

#ifdef PBL_PLATFORM_APLITE
window_set_fullscreen(window, true);
#endif

static const WindowHandlers window_handlers = {
.load = window_load,
Expand Down
7 changes: 5 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ static void init(void) {
window = window_create();
window_set_background_color(window, GColorBlack);
window_set_click_config_provider(window, window_click_config_provider);
window_set_fullscreen(window, true);

#ifdef PBL_PLATFORM_APLITE
window_set_fullscreen(window, true);
#endif

static const WindowHandlers window_handlers = {
.load = window_load,
Expand Down Expand Up @@ -141,7 +144,7 @@ static void window_up_click_handler(ClickRecognizerRef recognizer, void *context

uint8_t num_cards = 0;
persist_read_data(STORAGE_NUMBER_OF_CARDS, &num_cards, sizeof(num_cards));

if (num_cards > 0) {
current_page = (current_page - 1) % num_cards;
update_visible_layers();
Expand Down
25 changes: 21 additions & 4 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# Feel free to customize this to your needs.
#

import os.path

top = '.'
out = 'build'

Expand All @@ -17,8 +19,23 @@ def configure(ctx):
def build(ctx):
ctx.load('pebble_sdk')

ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'),
target='pebble-app.elf')
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.pbl_bundle(elf='pebble-app.elf',
js=ctx.path.ant_glob('src/js/**/*.js'))
ctx.set_group('bundle')
ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob('src/js/**/*.js'))

0 comments on commit c6ae802

Please sign in to comment.