aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-05-26 09:14:26 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-05-26 12:39:34 -0400
commita82e949c00aceaedd9d9a76ddcc3c88c9cad3d80 (patch)
tree685af9ff540b0407cfb0f96664fc3dccbc160152 /src/avr
parentca9756413f2793279b5ba1c1ecf274ce734b2087 (diff)
downloadkutter-a82e949c00aceaedd9d9a76ddcc3c88c9cad3d80.tar.gz
kutter-a82e949c00aceaedd9d9a76ddcc3c88c9cad3d80.tar.xz
kutter-a82e949c00aceaedd9d9a76ddcc3c88c9cad3d80.zip
build: Use compile_time_request system for init, tasks, and shutdown
Avoid using linker magic to define the init, task, and shutdown functions. Instead, use the compile_time_request system. This simplifies the build and produces more efficient code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/avr')
-rw-r--r--src/avr/Makefile2
-rw-r--r--src/avr/serial.c2
-rw-r--r--src/avr/timer.c6
-rw-r--r--src/avr/usbserial.c2
-rw-r--r--src/avr/watchdog.c4
5 files changed, 8 insertions, 8 deletions
diff --git a/src/avr/Makefile b/src/avr/Makefile
index fa9258b1..94cebfff 100644
--- a/src/avr/Makefile
+++ b/src/avr/Makefile
@@ -14,7 +14,7 @@ src-$(CONFIG_AVR_USBSERIAL) += avr/usbserial.c ../lib/pjrc_usb_serial/usb_serial
src-$(CONFIG_AVR_SERIAL) += avr/serial.c
# Suppress broken "misspelled signal handler" warnings on gcc 4.8.1
-CFLAGS_klipper.o := $(CFLAGS_klipper.o) $(if $(filter 4.8.1, $(shell $(CC) -dumpversion)), -w)
+CFLAGS_klipper.elf := $(CFLAGS_klipper.elf) $(if $(filter 4.8.1, $(shell $(CC) -dumpversion)), -w)
# Build the additional hex output file
target-y += $(OUT)klipper.elf.hex
diff --git a/src/avr/serial.c b/src/avr/serial.c
index 8628b602..3aff121f 100644
--- a/src/avr/serial.c
+++ b/src/avr/serial.c
@@ -25,7 +25,7 @@ static uint8_t transmit_pos, transmit_max;
DECL_CONSTANT(SERIAL_BAUD, CONFIG_SERIAL_BAUD);
-static void
+void
serial_init(void)
{
if (CONFIG_SERIAL_BAUD_U2X) {
diff --git a/src/avr/timer.c b/src/avr/timer.c
index a0acac73..92459af3 100644
--- a/src/avr/timer.c
+++ b/src/avr/timer.c
@@ -71,7 +71,7 @@ timer_repeat_set(uint16_t next)
}
// Reset the timer - clear settings and dispatch next timer immediately
-static void
+void
timer_reset(void)
{
uint16_t now = timer_get();
@@ -81,7 +81,7 @@ timer_reset(void)
}
DECL_SHUTDOWN(timer_reset);
-static void
+void
timer_init(void)
{
if (CONFIG_AVR_CLKPR != -1 && (uint8_t)CONFIG_AVR_CLKPR != CLKPR) {
@@ -193,7 +193,7 @@ done:
// Periodic background task that temporarily boosts priority of
// timers. This helps prioritize timers when tasks are idling.
-static void
+void
timer_task(void)
{
irq_disable();
diff --git a/src/avr/usbserial.c b/src/avr/usbserial.c
index 4cf1bd0f..3b14ea0a 100644
--- a/src/avr/usbserial.c
+++ b/src/avr/usbserial.c
@@ -14,7 +14,7 @@ static char receive_buf[USBSERIAL_BUFFER_SIZE];
static uint8_t receive_pos;
static char transmit_buf[USBSERIAL_BUFFER_SIZE];
-static void
+void
usbserial_init(void)
{
usb_init();
diff --git a/src/avr/watchdog.c b/src/avr/watchdog.c
index 306f2cd8..61b5fc5f 100644
--- a/src/avr/watchdog.c
+++ b/src/avr/watchdog.c
@@ -18,7 +18,7 @@ ISR(WDT_vect)
shutdown("Watchdog timer!");
}
-static void
+void
watchdog_reset(void)
{
wdt_reset();
@@ -29,7 +29,7 @@ watchdog_reset(void)
}
DECL_TASK(watchdog_reset);
-static void
+void
watchdog_init(void)
{
// 0.5s timeout, interrupt and system reset