aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-06-05 18:36:34 -0400
committerClyne Sullivan <clyne@bitgloo.com>2022-06-05 18:36:34 -0400
commit7fbb94cb15fdd20cd9ada11588568583128c77f4 (patch)
treeb774f823d35c9c77bf719d17a7dd70715effadce
parentfedc108c8f664b44ae1a4c0d6b6378584533c314 (diff)
move source to folder; openocd.sh programs directly
-rw-r--r--.gitignore2
-rw-r--r--Makefile20
-rwxr-xr-xopenocd.sh2
-rw-r--r--source/2048.c (renamed from 2048.c)0
-rw-r--r--source/2048.h (renamed from 2048.h)0
-rw-r--r--source/buttons.c (renamed from buttons.c)0
-rw-r--r--source/buttons.h (renamed from buttons.h)0
-rw-r--r--source/dogs.c (renamed from dogs.c)10
-rw-r--r--source/dogs.h (renamed from dogs.h)0
-rw-r--r--source/flapbird.c (renamed from flapbird.c)0
-rw-r--r--source/flapbird.h (renamed from flapbird.h)0
-rw-r--r--source/main.c (renamed from main.c)4
-rw-r--r--source/osal.c (renamed from osal.c)0
-rw-r--r--source/osal.h (renamed from osal.h)0
14 files changed, 11 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore
index 9d75526..9401e39 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
ChibiOS_*/
build
-.dep
+.*
diff --git a/Makefile b/Makefile
index 050356d..3fedc91 100644
--- a/Makefile
+++ b/Makefile
@@ -102,33 +102,17 @@ include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l0xx.m
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32L0xx/platform.mk
include $(CHIBIOS)/os/hal/boards/ST_NUCLEO32_L011K4/board.mk
-#include $(CHIBIOS)/os/hal/osal/os-less/ARMCMx/osal.mk
-#include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk
-# RTOS files (optional).
-#include $(CHIBIOS)/os/nil/nil.mk
-#include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
# Auto-build files in ./source recursively.
-#include $(CHIBIOS)/tools/mk/autobuild.mk
-# Other files (optional).
-#include $(CHIBIOS)/test/lib/test.mk
-#include $(CHIBIOS)/test/nil/nil_test.mk
-#include $(CHIBIOS)/test/oslib/oslib_test.mk
+include $(CHIBIOS)/tools/mk/autobuild.mk
# Define linker script file here
-#LDSCRIPT= $(STARTUPLD)/STM32L011x4.ld
LDSCRIPT= ./STM32L011x4.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(ALLCSRC) \
$(TESTSRC) \
- $(CHIBIOS)/os/hal/osal/lib/osal_vt.c \
- 2048.c \
- buttons.c \
- dogs.c \
- flapbird.c \
- main.c \
- osal.c
+ $(CHIBIOS)/os/hal/osal/lib/osal_vt.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
diff --git a/openocd.sh b/openocd.sh
index 90d4052..1ce7e72 100755
--- a/openocd.sh
+++ b/openocd.sh
@@ -1 +1 @@
-sudo openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/local/share/openocd/scripts/target/stm32l0.cfg
+openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/local/share/openocd/scripts/target/stm32l0.cfg -c "init; program build/ch.hex verify reset exit"
diff --git a/2048.c b/source/2048.c
index ce73844..ce73844 100644
--- a/2048.c
+++ b/source/2048.c
diff --git a/2048.h b/source/2048.h
index b8bdf14..b8bdf14 100644
--- a/2048.h
+++ b/source/2048.h
diff --git a/buttons.c b/source/buttons.c
index 45ea7bd..45ea7bd 100644
--- a/buttons.c
+++ b/source/buttons.c
diff --git a/buttons.h b/source/buttons.h
index ba7e02d..ba7e02d 100644
--- a/buttons.h
+++ b/source/buttons.h
diff --git a/dogs.c b/source/dogs.c
index 101339f..b986845 100644
--- a/dogs.c
+++ b/source/dogs.c
@@ -138,11 +138,11 @@ void dogs_init_display()
dogs_reset();
CS_HIGH;
- unsigned long int reset_sleep = (STM32_SYSCLK / 1000) * 100;
- while (reset_sleep != 0) {
- asm("nop; nop; nop; nop; nop");
- reset_sleep -= 8;
- }
+ unsigned long int reset_sleep = (STM32_SYSCLK / 1000) * 100;
+ while (reset_sleep != 0) {
+ asm("nop; nop; nop; nop; nop");
+ reset_sleep -= 8;
+ }
CS_LOW;
dogs_set_scroll_line(0);
diff --git a/dogs.h b/source/dogs.h
index 8af24fd..8af24fd 100644
--- a/dogs.h
+++ b/source/dogs.h
diff --git a/flapbird.c b/source/flapbird.c
index f2dd2cf..f2dd2cf 100644
--- a/flapbird.c
+++ b/source/flapbird.c
diff --git a/flapbird.h b/source/flapbird.h
index 7ab4199..7ab4199 100644
--- a/flapbird.h
+++ b/source/flapbird.h
diff --git a/main.c b/source/main.c
index 1ef13bf..fd753ea 100644
--- a/main.c
+++ b/source/main.c
@@ -42,9 +42,9 @@ static void alarm_callback(RTCDriver *rtcp, rtcevent_t event)
static bool sleep = false;
- bool sleep_button = (button_state & BUTTON_1) != 0;
+ bool sleep_button = (button_state & BUTTON_1) != 0;
if (sleep && !sleep_button)
- return;
+ return;
RCC->ICSCR |= 6 << RCC_ICSCR_MSIRANGE_Pos;
dogs_set_sleep(false);
diff --git a/osal.c b/source/osal.c
index 5c62069..5c62069 100644
--- a/osal.c
+++ b/source/osal.c
diff --git a/osal.h b/source/osal.h
index 30e1592..30e1592 100644
--- a/osal.h
+++ b/source/osal.h