-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86f1878
commit 85b7ead
Showing
6 changed files
with
120 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include "watch.h" | ||
|
||
void app_init(void) { | ||
} | ||
|
||
void app_wake_from_backup(void) { | ||
} | ||
|
||
void app_setup(void) { | ||
watch_enable_leds(); | ||
} | ||
|
||
void app_prepare_for_standby(void) { | ||
} | ||
|
||
void app_wake_from_standby(void) { | ||
} | ||
|
||
bool app_loop(void) { | ||
static uint8_t red = 0; | ||
static uint8_t green = 0; | ||
static uint8_t blue = 255; | ||
static uint8_t phase = 0; | ||
|
||
switch (phase) { | ||
case 0: | ||
red++; | ||
if (red == 255) phase = 1; | ||
break; | ||
case 1: | ||
green++; | ||
if (green == 255) phase = 2; | ||
break; | ||
case 2: | ||
red--; | ||
if (red == 0) phase = 3; | ||
break; | ||
case 3: | ||
blue++; | ||
if (blue == 255) phase = 4; | ||
break; | ||
case 4: | ||
green--; | ||
if (green == 0) phase = 5; | ||
break; | ||
case 5: | ||
red++; | ||
if (red == 255) phase = 6; | ||
break; | ||
case 6: | ||
blue--; | ||
if (blue == 0) { | ||
phase = 1; | ||
} | ||
break; | ||
} | ||
|
||
watch_set_led_color_rgb(red, green, blue); | ||
delay_ms(2); | ||
|
||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
TOP = ../../.. | ||
include $(TOP)/make.mk | ||
|
||
INCLUDES += \ | ||
-I../ | ||
|
||
SRCS += \ | ||
../app.c | ||
|
||
include $(TOP)/rules.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters