Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9b5ae73
Add pawn library and app
pipe01 Dec 27, 2025
1f666e5
Add support for event handlers
pipe01 Dec 28, 2025
f52443f
Move program data array to function
pipe01 Dec 28, 2025
ee46e43
Assert parameter count; set style properties
pipe01 Dec 28, 2025
70e3ec1
Fix task cleanup
pipe01 Dec 28, 2025
da76720
Set fonts and alignment
pipe01 Dec 28, 2025
2bf5a2d
Proper program loading
pipe01 Dec 28, 2025
59b222c
Add sprintf implementation and watchface stuff
pipe01 Dec 29, 2025
3aebf4b
Use numbered natives instead of named
pipe01 Dec 29, 2025
09d0538
Put program in flash
pipe01 Dec 29, 2025
e8f97d2
Make watchface program smaller
pipe01 Dec 29, 2025
a96de3c
Load program using overlays
pipe01 Dec 29, 2025
8cdc948
Load non-overlayed programs
pipe01 Dec 29, 2025
dc0923c
Show status icons
pipe01 Dec 29, 2025
4ad16fd
Move overlay max size constant to top
pipe01 Dec 29, 2025
e4148e7
Add error handling
pipe01 Dec 29, 2025
8544ad7
Handle touch gestures
pipe01 Dec 29, 2025
2a7e5ed
Modify amxpool to use a struct rather than global vars
pipe01 Dec 30, 2025
fbbe598
Replace watchface
pipe01 Dec 30, 2025
56fa587
Rewrite digital watchface in pawn and add pawn scripts
pipe01 Dec 30, 2025
ac0b81e
Add assembly trampoline to handle native functions more compactly
pipe01 Dec 30, 2025
3716c9b
Run program directly from ROM
pipe01 Dec 30, 2025
bf82df3
Load programs from external flash files
pipe01 Dec 31, 2025
d6b16fb
Guard execution if errored
pipe01 Dec 31, 2025
db17adf
Use unique_ptr for status icons
pipe01 Dec 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ set(LVGL_SRC
libs/lvgl/src/lv_widgets/lv_win.c
)

list(APPEND PAWN_SRC
pawn/amx.c
pawn/amxpool.c
)

list(APPEND IMAGE_FILES
displayapp/icons/battery/batteryicon.c
)
Expand Down Expand Up @@ -398,6 +403,7 @@ list(APPEND SOURCE_FILES
displayapp/screens/Alarm.cpp
displayapp/screens/Styles.cpp
displayapp/screens/WeatherSymbols.cpp
displayapp/screens/Pawn.cpp
displayapp/Colors.cpp
displayapp/widgets/Counter.cpp
displayapp/widgets/PageIndicator.cpp
Expand Down Expand Up @@ -900,6 +906,47 @@ target_compile_options(lvgl PRIVATE
$<$<COMPILE_LANGUAGE:ASM>: ${ASM_FLAGS}>
)

# pawn
add_library(pawn STATIC ${PAWN_SRC})
target_include_directories(pawn SYSTEM PUBLIC . ../)
target_include_directories(pawn SYSTEM PUBLIC ${INCLUDES_FROM_LIBS})
target_compile_options(pawn PRIVATE
${COMMON_FLAGS}
-DNDEBUG
-DAMX_ANSIONLY
-DAMX_NODYNALOAD
-DAMX_DONT_RELOCATE

# -DAMX_ALIGN
# -DAMX_ALLOT
# -DAMX_DEFCALLBACK
-DAMX_CLEANUP
# -DAMX_CLONE
-DAMX_EXEC
# -DAMX_FLAGS
-DAMX_INIT
# -DAMX_MEMINFO
# -DAMX_NAMELENGTH
# -DAMX_NATIVEINFO
-DAMX_PUSHXXX
-DAMX_RAISEERROR
# -DAMX_REGISTER
-DAMX_SETCALLBACK
# -DAMX_SETDEBUGHOOK
# -DAMX_UTF8XXX
# -DAMX_XXXNATIVES
-DAMX_XXXPUBLICS
-DAMX_XXXPUBVARS
-DAMX_XXXSTRING
# -DAMX_XXXTAGS
# -DAMX_XXXUSERDATA
# -DAMX_VERIFYADDR
$<$<CONFIG:DEBUG>: ${DEBUG_FLAGS}>
$<$<CONFIG:RELEASE>: ${RELEASE_FLAGS}>
$<$<COMPILE_LANGUAGE:CXX>: ${CXX_FLAGS}>
$<$<COMPILE_LANGUAGE:ASM>: ${ASM_FLAGS}>
)

# LITTLEFS_SRC
add_library(littlefs STATIC ${LITTLEFS_SRC})
target_include_directories(littlefs SYSTEM PUBLIC . ../)
Expand All @@ -918,7 +965,7 @@ set(EXECUTABLE_FILE_NAME ${EXECUTABLE_NAME}-${pinetime_VERSION_MAJOR}.${pinetime
set(NRF5_LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/gcc_nrf52.ld")
add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES})
set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_FILE_NAME})
target_link_libraries(${EXECUTABLE_NAME} nimble nrf-sdk lvgl littlefs infinitime_fonts infinitime_apps)
target_link_libraries(${EXECUTABLE_NAME} nimble nrf-sdk lvgl pawn littlefs infinitime_fonts infinitime_apps)
target_compile_options(${EXECUTABLE_NAME} PUBLIC
${COMMON_FLAGS}
${WARNING_FLAGS}
Expand Down Expand Up @@ -952,7 +999,7 @@ set(IMAGE_MCUBOOT_FILE_NAME_BIN ${EXECUTABLE_MCUBOOT_NAME}-image-${pinetime_VERS
set(DFU_MCUBOOT_FILE_NAME ${EXECUTABLE_MCUBOOT_NAME}-dfu-${pinetime_VERSION_MAJOR}.${pinetime_VERSION_MINOR}.${pinetime_VERSION_PATCH}.zip)
set(NRF5_LINKER_SCRIPT_MCUBOOT "${CMAKE_SOURCE_DIR}/gcc_nrf52-mcuboot.ld")
add_executable(${EXECUTABLE_MCUBOOT_NAME} ${SOURCE_FILES})
target_link_libraries(${EXECUTABLE_MCUBOOT_NAME} nimble nrf-sdk lvgl littlefs infinitime_fonts infinitime_apps)
target_link_libraries(${EXECUTABLE_MCUBOOT_NAME} nimble nrf-sdk lvgl pawn littlefs infinitime_fonts infinitime_apps)
set_target_properties(${EXECUTABLE_MCUBOOT_NAME} PROPERTIES OUTPUT_NAME ${EXECUTABLE_MCUBOOT_FILE_NAME})
target_compile_options(${EXECUTABLE_MCUBOOT_NAME} PUBLIC
${COMMON_FLAGS}
Expand Down
1 change: 1 addition & 0 deletions src/displayapp/UserApps.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "displayapp/screens/Alarm.h"
#include "displayapp/screens/Dice.h"
#include "displayapp/screens/Pawn.h"
#include "displayapp/screens/Timer.h"
#include "displayapp/screens/Twos.h"
#include "displayapp/screens/Tile.h"
Expand Down
1 change: 1 addition & 0 deletions src/displayapp/apps/Apps.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace Pinetime {
Dice,
Weather,
PassKey,
Pawn,
QuickSettings,
Settings,
SettingWatchFace,
Expand Down
1 change: 1 addition & 0 deletions src/displayapp/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if(DEFINED ENABLE_USERAPPS)
set(USERAPP_TYPES ${ENABLE_USERAPPS} CACHE STRING "List of user apps to build into the firmware")
else ()
set(DEFAULT_USER_APP_TYPES "Apps::StopWatch")
set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Pawn")
set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Alarm")
set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Timer")
set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Steps")
Expand Down
Loading
Loading