diff options
author | Dave Hodder <dave.hodder@focusrite.com> | 2018-11-13 13:28:22 +0000 |
---|---|---|
committer | Dave Hodder <dave.hodder@focusrite.com> | 2018-11-13 13:28:22 +0000 |
commit | 665a064c16e902344eaf3f1a1c62c8cea35bf22c (patch) | |
tree | a6c1cae573620415d647d496e32ade91e6f27f61 | |
parent | 165dddc42bf05b53f8e8ce4511681e289f043705 (diff) | |
download | launchpad-polymaker-665a064c16e902344eaf3f1a1c62c8cea35bf22c.tar.gz launchpad-polymaker-665a064c16e902344eaf3f1a1c62c8cea35bf22c.zip |
implemented hal_read_led(), removed debug symbols bloating the library
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | include/app.h | 13 | ||||
-rw-r--r-- | lib/launchpad_pro.a | bin | 16960880 -> 179592 bytes | |||
-rw-r--r-- | tools/simulator.c | 7 |
4 files changed, 21 insertions, 5 deletions
@@ -24,15 +24,15 @@ CC = arm-none-eabi-gcc | |||
24 | LD = arm-none-eabi-gcc | 24 | LD = arm-none-eabi-gcc |
25 | OBJCOPY = arm-none-eabi-objcopy | 25 | OBJCOPY = arm-none-eabi-objcopy |
26 | 26 | ||
27 | CFLAGS = -Os -g -Wall -I.\ | 27 | CFLAGS = -Os -Wall -I.\ |
28 | -D_STM32F103RBT6_ -D_STM3x_ -D_STM32x_ -mthumb -mcpu=cortex-m3 \ | 28 | -D_STM32F103RBT6_ -D_STM3x_ -D_STM32x_ -mthumb -mcpu=cortex-m3 \ |
29 | -fsigned-char -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=6000000UL \ | 29 | -fsigned-char -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=6000000UL \ |
30 | -DCMSIS -DUSE_GLOBAL_CONFIG -g3 -ffunction-sections -std=c99 -mlittle-endian \ | 30 | -DCMSIS -DUSE_GLOBAL_CONFIG -ffunction-sections -std=c99 -mlittle-endian \ |
31 | $(INCLUDES) -o | 31 | $(INCLUDES) -o |
32 | 32 | ||
33 | LDSCRIPT = stm32_flash.ld | 33 | LDSCRIPT = stm32_flash.ld |
34 | 34 | ||
35 | LDFLAGS += -T$(LDSCRIPT) -u _start -u _Minimum_Stack_Size -mcpu=cortex-m3 -mthumb -specs=nano.specs -specs=nosys.specs -nostdlib -Wl,-static -g3 -N -nostartfiles -Wl,--gc-sections | 35 | LDFLAGS += -T$(LDSCRIPT) -u _start -u _Minimum_Stack_Size -mcpu=cortex-m3 -mthumb -specs=nano.specs -specs=nosys.specs -nostdlib -Wl,-static -N -nostartfiles -Wl,--gc-sections |
36 | 36 | ||
37 | all: $(SYX) | 37 | all: $(SYX) |
38 | 38 | ||
diff --git a/include/app.h b/include/app.h index 96801eb..b06f7a6 100644 --- a/include/app.h +++ b/include/app.h | |||
@@ -71,6 +71,19 @@ | |||
71 | void hal_plot_led(u8 type, u8 index, u8 red, u8 green, u8 blue); | 71 | void hal_plot_led(u8 type, u8 index, u8 red, u8 green, u8 blue); |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * Read the RGB value of an LED. This function is safe to call from any | ||
75 | * of the app functions below, at any time. Result is undefined if an invalid address is passed | ||
76 | * for any of the red, green or blue components. | ||
77 | * | ||
78 | * @param type - TYPEPAD to address any pad or button, TYPESETUP to address the Setup LED | ||
79 | * @param index - The index of the button, as above | ||
80 | * @param red - address to read red colour value, in [0, MAXLED]. | ||
81 | * @param green - address to read green colour value, in [0, MAXLED] | ||
82 | * @param blue - address to read blue colour value, in [0, MAXLED] | ||
83 | */ | ||
84 | void hal_read_led(u8 type, u8 index, u8 *red, u8 *green, u8 *blue); | ||
85 | |||
86 | /** | ||
74 | * Send a MIDI message to either USB port or to the DIN output. | 87 | * Send a MIDI message to either USB port or to the DIN output. |
75 | * | 88 | * |
76 | * @param port - which port to send the message to - can be USBSTANDALONE, USBMIDI or DINMIDI. | 89 | * @param port - which port to send the message to - can be USBSTANDALONE, USBMIDI or DINMIDI. |
diff --git a/lib/launchpad_pro.a b/lib/launchpad_pro.a index 383c9c6..70b470c 100644 --- a/lib/launchpad_pro.a +++ b/lib/launchpad_pro.a | |||
Binary files differ | |||
diff --git a/tools/simulator.c b/tools/simulator.c index ab4eee1..cec1ede 100644 --- a/tools/simulator.c +++ b/tools/simulator.c | |||
@@ -41,8 +41,11 @@ | |||
41 | 41 | ||
42 | void hal_plot_led(u8 type, u8 index, u8 red, u8 green, u8 blue) | 42 | void hal_plot_led(u8 type, u8 index, u8 red, u8 green, u8 blue) |
43 | { | 43 | { |
44 | // wire this up to MIDI out... | 44 | // wire this up to MIDI out...? |
45 | printf("...hal_plot_led(%d, %d, %d, %d, %d);\n", type, index, red, green, blue); | 45 | } |
46 | |||
47 | void hal_read_led(u8 type, u8 index, u8 *red, u8 *green, u8 *blue) | ||
48 | { | ||
46 | } | 49 | } |
47 | 50 | ||
48 | void hal_send_midi(u8 port, u8 status, u8 d1, u8 d2) | 51 | void hal_send_midi(u8 port, u8 status, u8 d1, u8 d2) |