summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Add an Alarm face to movement (#96)TheOnePerson2022-10-258-12/+532
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add movement_play_alarm_beeps() to movement.c and make alarm sounds customizable. Add alarm indicator to simple watch face. * Add alarm face * alarm_face: fix problem with disabling alarms for 00:00. * Fix typos in comments and get rid of of unused variable warning * remove unnecessary constant * simple_clock_face: fix disappearing chime indicator after face switch, enable alarm indicator updates in app loop (for one-time alarms). movement: handle situations where watch is in sleep mode and chimes fire off at the same time as alarms properly. * alarm_face: tweak process of displaying things on the lcd. Add extra long and extra short alarms. Increase number of alarm slots to 16. * alarm face: fix alarms playing one beeping round more than set. * alarm face: add proper quick cycling of hour and minute setting * alarm-face: correct am/pm indication and some minor tweaks. Reset movement_config.h to current main branch. simple-watch-face: Remove unnecessary check and swap indicators (alarm / hourly chime) * alarm-face: reverse commit parts from another branch (accidentially commited logic depending on movement firmware auto firing the long press event) Co-authored-by: joeycastillo <joeycastillo@utexas.edu>
* | | Merge pull request #103 from wryun/long-press-home-to-settingsjoeycastillo2022-10-232-4/+26
|\ \ \ | |_|/ |/| | Long press of mode on home screen goes to settings
| * | make this an if/then to please emscriptenjoeycastillo2022-10-231-5/+6
| | |
| * | disable settings hiding by defaultjoeycastillo2022-10-232-4/+8
| | |
| * | Long press of mode on home screen goes to settingsJames Haggerty2022-10-192-4/+21
| |/ | | | | | | | | This also changes the default rotation so you don't see the settings screens.
* | Merge pull request #105 from niclashoyer/fix_schedulejoeycastillo2022-10-222-3/+19
|\ \ | | | | | | Fix scheduled tasks scheduling another task
| * | allow watch faces to schedule tasks from backgroundjoeycastillo2022-10-222-3/+15
| | |
| * | fix scheduled tasks scheduling another taskNiclas Hoyer2022-10-211-0/+4
|/ /
* / Adds a rate meter watchface (#101)David Singleton2022-10-184-0/+147
|/
* Merge pull request #94 from wryun/long-press-home-defaultjoeycastillo2022-10-152-6/+22
|\ | | | | Long press mode button to return to first watch face + fix lag when watch face changes
| * use watch_face_changed propertyjoeycastillo2022-10-121-1/+1
| |
| * document return value of watch_face_loopjoeycastillo2022-10-111-1/+5
| |
| * no need to set this (set in movement_move_to_face)joeycastillo2022-10-111-1/+0
| |
| * don't sleep on watch face changejoeycastillo2022-10-111-3/+11
| |
| * Make long press mode go back to face 0 instead of next faceJames Haggerty2022-10-121-3/+8
| |
* | Merge pull request #93 from wryun/make-starter-proj-work-in-simulatorjoeycastillo2022-10-113-0/+10
|\ \ | | | | | | Make starter project work in simulator
| * | add delay_ms function for simulatorjoeycastillo2022-10-113-2/+8
| | |
| * | only include watch_main_loop.h in simulator buildsjoeycastillo2022-10-112-1/+4
| | |
| * | Make starter project work in simulatorJames Haggerty2022-10-121-2/+3
| |/ | | | | | | Use the higher abstraction level sleeping.
* | Merge pull request #87 from wryun/readme-movementjoeycastillo2022-10-111-2/+23
|\ \ | |/ |/| Mention movement in the README (and link to website)
| * Mention movement in the README (and link to website)James Haggerty2022-10-111-2/+23
|/ | | | | | I know this is mostly going to be in the website, but I was initially confused about how to get things going, and it seemed worth having some simple 'getting started' here.
* implement stubs to make simulator build happyJoey Castillo2022-10-091-0/+26
|
* restore default watch faces (oops)Joey Castillo2022-10-091-1/+7
|
* add watch face for frequency correction and measurementJoey Castillo2022-10-095-9/+193
|
* Merge pull request #86 from michaelgruenewald/patch-1joeycastillo2022-10-082-1/+4
|\ | | | | Fix changed files detection in Make
| * Disable all built-in Make rulesMichael Gruenewald2022-10-081-0/+2
| |
| * Enable dependency files for the emscripten buildMichael Gruenewald2022-10-081-0/+1
| |
| * Fix DEPFILESMichael Grünewald2022-10-061-1/+1
|/
* add script for bulk flashing boardsJoey Castillo2022-09-162-0/+37
|
* Merge pull request #84 from jackbondpreston/mainWesley Ellis2022-09-042-14/+35
|\ | | | | add support for multiple TOTP keys
| * add support for multiple TOTP keysJack Bond-Preston2022-08-292-14/+35
|/
* add watch_reset_to_bootloader function (resolves #81)Joey Castillo2022-08-143-0/+14
|
* Merge pull request #80 from joeycastillo/lfsjoeycastillo2022-08-0325-13/+870
|\ | | | | Movement: add a lil file system with lfs
| * Merge branch 'main' of github.com:joeycastillo/Sensor-Watch into lfsJoey Castillo2022-08-0218-86/+752
| |\ | |/ |/|
* | Merge pull request #79 from jackbondpreston/mainjoeycastillo2022-07-251-1/+1
|\ \ | | | | | | movement: fix movement_request_wake() prototype
| * | movement: fix movement_request_wake() prototypeJack Bond-Preston2022-07-251-1/+1
| | | | | | | | | | | | This function has `void` args, currently it can throw a compiler warning
* | | Wake Face (#77)joshber2022-07-256-0/+260
|/ / | | | | Co-authored-by: Josh Berson <low.note0488@fastmail.com>
* | movement: wake programmatically from background and play alarmJoey Castillo2022-07-172-12/+34
| |
* | Merge pull request #78 from tahnok/fix-python3-uf2joeycastillo2022-07-141-1/+1
|\ \ | | | | | | Replace python with python3 for calling uf2conv
| * | Replace python with python3 for calling uf2convWesley Ellis2022-07-141-1/+1
|/ / | | | | | | | | | | | | | | Instead of calling python use python3. On a default debian 11 install there is no python binary, only python3. Given that the uf2conv script is written for python 3 I think this is a safe change to make
* | new testsJoey Castillo2022-07-053-14/+109
| |
* | WIP new testsJoey Castillo2022-07-051-65/+23
| |
* | reduce flicker of LED by defaultJoey Castillo2022-07-041-1/+1
| |
* | Merge branch 'main' of github.com:joeycastillo/Sensor-WatchJoey Castillo2022-06-110-0/+0
|\ \
| * | Parallelize alternate fw builds (#66)George Hahn2022-05-292-4/+33
| | |
* | | Merge branch 'parallelize-builds' of https://github.com/GeorgeHahn/Sensor-WatchJoey Castillo2022-05-222-4/+33
|\ \ \ | |/ / |/| |
| * | Make submodule and directory rules order-only prerequisites on objectsGeorge Hahn2022-05-191-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This instructs make to run the tinyusb and directory rules before building any objects. Docs: [1]. After this change, `make clean` started running the tinyusb submodule rule before cleaning. This appears to have been caused by one of the `build/*.d` files overlapping with the `tinyusb` name, triggering that rule. I didn't trace this all the way down to a root cause, but switching the include to something less broad solved the issue. Roughly guided by [2]. 1: https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html 2: http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
| * | fixup: restore deleted lineGeorge Hahn2022-05-101-0/+1
| | |
| * | Move parallel flag into makefile with crossplatform supportGeorge Hahn2022-05-102-2/+13
| | |
| * | Perform OS detection in makefileGeorge Hahn2022-05-101-1/+15
| | |
s="p">.start; range->size = kexec_crash_area.size; } else range->start = range->size = 0; return 0; } static int kexec_get_cpu(xen_kexec_range_t *range) { int nr = range->nr; int nr_bytes = 0; if ( nr < 0 || nr >= num_present_cpus() ) return -EINVAL; nr_bytes += sizeof_note("CORE", sizeof(ELF_Prstatus)); nr_bytes += sizeof_note("Xen", sizeof(crash_xen_core_t)); /* The Xen info note is included in CPU0's range. */ if ( nr == 0 ) nr_bytes += sizeof_note("Xen", sizeof(crash_xen_info_t)); if ( per_cpu(crash_notes, nr) == NULL ) { Elf_Note *note; note = per_cpu(crash_notes, nr) = xmalloc_bytes(nr_bytes); if ( note == NULL ) return -ENOMEM; /* Setup CORE note. */ setup_note(note, "CORE", NT_PRSTATUS, sizeof(ELF_Prstatus)); /* Setup Xen CORE note. */ note = ELFNOTE_NEXT(note); setup_note(note, "Xen", XEN_ELFNOTE_CRASH_REGS, sizeof(crash_xen_core_t)); if (nr == 0) { /* Setup system wide Xen info note. */ xen_crash_note = note = ELFNOTE_NEXT(note); setup_note(note, "Xen", XEN_ELFNOTE_CRASH_INFO, sizeof(crash_xen_info_t)); } } range->start = __pa((unsigned long)per_cpu(crash_notes, nr)); range->size = nr_bytes; return 0; } static int kexec_get_vmcoreinfo(xen_kexec_range_t *range) { range->start = __pa((unsigned long)vmcoreinfo_data); range->size = VMCOREINFO_BYTES; return 0; } static int kexec_get_range_internal(xen_kexec_range_t *range) { int ret = -EINVAL; switch ( range->range ) { case KEXEC_RANGE_MA_CRASH: ret = kexec_get_reserve(range); break; case KEXEC_RANGE_MA_CPU: ret = kexec_get_cpu(range); break; case KEXEC_RANGE_MA_VMCOREINFO: ret = kexec_get_vmcoreinfo(range); break; default: ret = machine_kexec_get(range); break; } return ret; } static int kexec_get_range(XEN_GUEST_HANDLE(void) uarg) { xen_kexec_range_t range; int ret = -EINVAL; if ( unlikely(copy_from_guest(&range, uarg, 1)) ) return -EFAULT; ret = kexec_get_range_internal(&range); if ( ret == 0 && unlikely(copy_to_guest(uarg, &range, 1)) ) return -EFAULT; return ret; } static int kexec_get_range_compat(XEN_GUEST_HANDLE(void) uarg) { #ifdef CONFIG_COMPAT xen_kexec_range_t range; compat_kexec_range_t compat_range; int ret = -EINVAL; if ( unlikely(copy_from_guest(&compat_range, uarg, 1)) ) return -EFAULT; XLAT_kexec_range(&range, &compat_range); ret = kexec_get_range_internal(&range); if ( ret == 0 ) { XLAT_kexec_range(&compat_range, &range); if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) ) return -EFAULT; } return ret; #else /* CONFIG_COMPAT */ return 0; #endif /* CONFIG_COMPAT */ } static int kexec_load_get_bits(int type, int *base, int *bit) { switch ( type ) { case KEXEC_TYPE_DEFAULT: *base = KEXEC_IMAGE_DEFAULT_BASE; *bit = KEXEC_FLAG_DEFAULT_POS; break; case KEXEC_TYPE_CRASH: *base = KEXEC_IMAGE_CRASH_BASE; *bit = KEXEC_FLAG_CRASH_POS; break; default: return -1; } return 0; } void vmcoreinfo_append_str(const char *fmt, ...) { va_list args; char buf[0x50]; int r; size_t note_size = sizeof(Elf_Note) + ELFNOTE_ALIGN(strlen(VMCOREINFO_NOTE_NAME) + 1); if (vmcoreinfo_size + note_size + sizeof(buf) > VMCOREINFO_BYTES) return; va_start(args, fmt); r = vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); memcpy(&vmcoreinfo_data[note_size + vmcoreinfo_size], buf, r); vmcoreinfo_size += r; } static void crash_save_vmcoreinfo(void) { size_t data_size; if (vmcoreinfo_size > 0) /* already saved */ return; data_size = VMCOREINFO_BYTES - (sizeof(Elf_Note) + ELFNOTE_ALIGN(strlen(VMCOREINFO_NOTE_NAME) + 1)); setup_note((Elf_Note *)vmcoreinfo_data, VMCOREINFO_NOTE_NAME, 0, data_size); VMCOREINFO_PAGESIZE(PAGE_SIZE); VMCOREINFO_SYMBOL(domain_list); VMCOREINFO_SYMBOL(frame_table); VMCOREINFO_SYMBOL(max_page); VMCOREINFO_STRUCT_SIZE(page_info); VMCOREINFO_STRUCT_SIZE(domain); VMCOREINFO_OFFSET(page_info, count_info); VMCOREINFO_OFFSET_ALIAS(page_info, u, _domain); VMCOREINFO_OFFSET(domain, domain_id); VMCOREINFO_OFFSET(domain, next_in_list); #ifdef ARCH_CRASH_SAVE_VMCOREINFO arch_crash_save_vmcoreinfo(); #endif } static int kexec_load_unload_internal(unsigned long op, xen_kexec_load_t *load) { xen_kexec_image_t *image; int base, bit, pos; int ret = 0; if ( kexec_load_get_bits(load->type, &base, &bit) ) return -EINVAL; pos = (test_bit(bit, &kexec_flags) != 0); /* Load the user data into an unused image */ if ( op == KEXEC_CMD_kexec_load ) { image = &kexec_image[base + !pos]; BUG_ON(test_bit((base + !pos), &kexec_flags)); /* must be free */ memcpy(image, &load->image, sizeof(*image)); if ( !(ret = machine_kexec_load(load->type, base + !pos, image)) ) { /* Set image present bit */ set_bit((base + !pos), &kexec_flags); /* Make new image the active one */ change_bit(bit, &kexec_flags); } crash_save_vmcoreinfo(); } /* Unload the old image if present and load successful */ if ( ret == 0 && !test_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags) ) { if ( test_and_clear_bit((base + pos), &kexec_flags) ) { image = &kexec_image[base + pos]; machine_kexec_unload(load->type, base + pos, image); } } return ret; } static int kexec_load_unload(unsigned long op, XEN_GUEST_HANDLE(void) uarg) { xen_kexec_load_t load; if ( unlikely(copy_from_guest(&load, uarg, 1)) ) return -EFAULT; return kexec_load_unload_internal(op, &load); } static int kexec_load_unload_compat(unsigned long op, XEN_GUEST_HANDLE(void) uarg) { #ifdef CONFIG_COMPAT compat_kexec_load_t compat_load; xen_kexec_load_t load; if ( unlikely(copy_from_guest(&compat_load, uarg, 1)) ) return -EFAULT; /* This is a bit dodgy, load.image is inside load, * but XLAT_kexec_load (which is automatically generated) * doesn't translate load.image (correctly) * Just copy load->type, the only other member, manually instead. * * XLAT_kexec_load(&load, &compat_load); */ load.type = compat_load.type; XLAT_kexec_image(&load.image, &compat_load.image); return kexec_load_unload_internal(op, &load); #else /* CONFIG_COMPAT */ return 0; #endif /* CONFIG_COMPAT */ } static int kexec_exec(XEN_GUEST_HANDLE(void) uarg) { xen_kexec_exec_t exec; xen_kexec_image_t *image; int base, bit, pos; if ( unlikely(copy_from_guest(&exec, uarg, 1)) ) return -EFAULT; if ( kexec_load_get_bits(exec.type, &base, &bit) ) return -EINVAL; pos = (test_bit(bit, &kexec_flags) != 0); /* Only allow kexec/kdump into loaded images */ if ( !test_bit(base + pos, &kexec_flags) ) return -ENOENT; switch (exec.type) { case KEXEC_TYPE_DEFAULT: image = &kexec_image[base + pos]; one_cpu_only(); machine_reboot_kexec(image); /* Does not return */ break; case KEXEC_TYPE_CRASH: kexec_crash(); /* Does not return */ break; } return -EINVAL; /* never reached */ } int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg, int compat) { unsigned long flags; int ret = -EINVAL; if ( !IS_PRIV(current->domain) ) return -EPERM; ret = xsm_kexec(); if ( ret ) return ret; switch ( op ) { case KEXEC_CMD_kexec_get_range: if (compat) ret = kexec_get_range_compat(uarg); else ret = kexec_get_range(uarg); break; case KEXEC_CMD_kexec_load: case KEXEC_CMD_kexec_unload: spin_lock_irqsave(&kexec_lock, flags); if (!test_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags)) { if (compat) ret = kexec_load_unload_compat(op, uarg); else ret = kexec_load_unload(op, uarg); } spin_unlock_irqrestore(&kexec_lock, flags); break; case KEXEC_CMD_kexec: ret = kexec_exec(uarg); break; } return ret; } long do_kexec_op(unsigned long op, XEN_GUEST_HANDLE(void) uarg) { return do_kexec_op_internal(op, uarg, 0); } #ifdef CONFIG_COMPAT int compat_kexec_op(unsigned long op, XEN_GUEST_HANDLE(void) uarg) { return do_kexec_op_internal(op, uarg, 1); } #endif /* * Local variables: * mode: C * c-set-style: "BSD" * c-basic-offset: 4 * tab-width: 4 * indent-tabs-mode: nil * End: */