Skip to content

Commit

Permalink
Merge branch 'joeycastillo:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bolknote authored Nov 16, 2024
2 parents 096b771 + e8f31be commit 868145e
Show file tree
Hide file tree
Showing 82 changed files with 14,522 additions and 177 deletions.
10 changes: 5 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM ubuntu:22.10

# TODO: install emscripten (https://emscripten.org/docs/getting_started/downloads.html)
FROM ubuntu:24.04

# TODO: Clean this up once buildkit is supported gracefully in devcontainers
# https://github.com/microsoft/vscode-remote-release/issues/1409
Expand All @@ -27,7 +25,9 @@ RUN apt-get update \
# ca certs need to be available for fetching git submodules
ca-certificates \
# python is used to convert binaries to uf2 files
python3 python-is-python3
python3 python-is-python3 \
# emscripten for building simulator
emscripten

# Download and verify both x86-64 and aarch64 toolchains. This is unfortunate and
# slows down the build, but it's a clean-ish option until buildkit can be used.
Expand All @@ -47,4 +47,4 @@ RUN /bin/sh -c 'set -ex && \
fi'

RUN rm $X86_64_TOOLCHAIN_FILENAME
RUN rm $AARCH64_TOOLCHAIN_FILENAME
RUN rm $AARCH64_TOOLCHAIN_FILENAME
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
COLOR: BLUE

jobs:
jobs:
build:
container:
image: ghcr.io/armmbed/mbed-os-env:latest
Expand All @@ -29,7 +29,7 @@ jobs:
run: make
working-directory: 'movement/make'
- name: Upload UF2
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: watch.uf2
path: movement/make/build/watch.uf2
Expand All @@ -52,7 +52,7 @@ jobs:
cp watch.html index.html
tar -czf simulator.tar.gz index.html watch.wasm watch.js
- name: Upload simulator build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: simulator.tar.gz
path: movement/make/build-sim/simulator.tar.gz
9 changes: 3 additions & 6 deletions apps/beats-time/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <string.h>
#include <math.h>
#include "watch.h"
#include "watch_utility.h"

const int8_t UTC_OFFSET = 4; // set to your current UTC offset to see correct beats time
const uint8_t BEAT_REFRESH_FREQUENCY = 8;
Expand Down Expand Up @@ -203,7 +204,6 @@ void set_time_mode_handle_primary_button(void) {

void set_time_mode_handle_secondary_button(void) {
watch_date_time date_time = watch_rtc_get_date_time();
const uint8_t days_in_month[12] = {31, 28, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31};

switch (application_state.page) {
case 0: // hour
Expand All @@ -224,13 +224,10 @@ void set_time_mode_handle_secondary_button(void) {
break;
case 5: // day
date_time.unit.day = date_time.unit.day + 1;
// can't set to the 29th on a leap year. if it's february 29, set to 11:59 on the 28th.
// and it should roll over.
if (date_time.unit.day > days_in_month[date_time.unit.month - 1]) {
date_time.unit.day = 1;
}
break;
}
if (date_time.unit.day > days_in_month(date_time.unit.month, date_time.unit.year + WATCH_RTC_REFERENCE_YEAR))
date_time.unit.day = 1;
watch_rtc_set_date_time(date_time);
}

Expand Down
14 changes: 14 additions & 0 deletions make.mk
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,20 @@ SRCS += \

endif

ifeq ($(LED), BLUE)
CFLAGS += -DWATCH_IS_BLUE_BOARD
endif

ifndef COLOR
$(error Set the COLOR variable to RED, BLUE, or GREEN depending on what board you have.)
endif

COLOR_VALID := $(filter $(COLOR),RED BLUE GREEN)

ifeq ($(COLOR_VALID),)
$(error COLOR must be RED, BLUE, or GREEN)
endif

ifeq ($(COLOR), BLUE)
CFLAGS += -DWATCH_IS_BLUE_BOARD
endif
Expand Down
Loading

0 comments on commit 868145e

Please sign in to comment.