CROSS_COMPILE ?= arm-none-eabi-
CC = $(CROSS_COMPILE)gcc
-#DEBUG = -g
+# DEBUG = -ggdb3
LD_DEBUG = $(DEBUG)
#LD_DEBUG = $(DEBUG) -Wl,--print-memory-usage
#LD_DEBUG = $(DEBUG) -Wl,--print-gc-sections -Wl,--print-output-format \
TARGET_INCLUDES = $(TARGET_DIR)/
OBJDIR = objs
-SRC = $(wildcard */*.c)
-SRC += $(wildcard lib/*/*.c)
-SRC += $(wildcard lib/protocols/*/*.c)
-OBJS = ${SRC:%.c=${OBJDIR}/%.o}
+C_SRC = $(wildcard */*.c)
+C_SRC += $(wildcard lib/*/*.c)
+C_SRC += $(wildcard lib/protocols/*/*.c)
+
+A_SRC = $(wildcard */*.s)
+A_SRC += $(wildcard lib/*/*.s)
+A_SRC += $(wildcard lib/protocols/*/*.s)
+
+
+OBJS = ${C_SRC:%.c=${OBJDIR}/%.o} ${A_SRC:%.s=${OBJDIR}/%.o}
DEPS = ${OBJS:%.o=$(OBJDIR)/%.d}
NAME_SRC = $(wildcard $(TARGET_DIR)/*.c)
}
/* Simple RLE decompressor */
-void uncompress_image(uint8_t *compressed_data,
+void uncompress_image(const uint8_t *compressed_data,
uint8_t *buffer)
{
int i;
}
/* Simple RLE decompressor, asm implementation, experimental */
-void uncompress_image_asm(uint8_t *compressed_data,
- uint8_t *buffer)
+void uncompress_image_asm_old(const uint8_t *compressed_data,
+ uint8_t *buffer)
{
// note: r0 is compressed_data/in, r1 is buffer
// r2 is end_buffer
--- /dev/null
+@ extdrv/ssd130x_oled_buffer.c
+@
+@ Set of functions helping using the 128x64 buffer for the SSD130X
+@
+@ Copyright 2017 Nathael Pajani <nathael.pajani@ed3l.fr>
+@
+@
+@ This program is free software: you can redistribute it and/or modify
+@ it under the terms of the GNU General Public License as published by
+@ the Free Software Foundation, either version 2 of the License, or
+@ (at your option) any later version.
+@
+@ This program is distributed in the hope that it will be useful,
+@ but WITHOUT ANY WARRANTY; without even the implied warranty of
+@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+@ GNU General Public License for more details.
+@
+@ You should have received a copy of the GNU General Public License
+@ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+.syntax unified
+.cpu cortex-m0
+.thumb
+
+@ exported symbol:
+.global uncompress_image_asm
+
+/* Simple RLE decompressor, asm implementation, experimental */
+.thumb_func
+uncompress_image_asm:
+ push {r4,r5,r14} @
+ movs r2, 128 @
+ lsls r2, 3 @
+ adds r2, r2, r1 @
+.label1:
+ ldrb r3, [r0] @
+ adds r0, 1 @
+ sxtb r3, r3 @
+ cmp r3, 0 @
+ bpl .set
+ rsbs r3, r3, 0 @ negs...
+ movs r5, 1 @
+ b .copy2
+.set:
+ adds r3, 3 @
+ movs r5, 0 @
+.copy2:
+ ldrb r4, [r0] @
+ strb r4, [r1] @
+ adds r0, r5 @
+ adds r1, 1 @
+ subs r3, 1 @
+ bne .copy2
+ subs r0, r0, r5 @
+ adds r0, r0, 1 @
+ cmp r1, r2 @
+ bne .label1
+ pop {r4,r5,r15} @ restaure r4 & r5
int ssd130x_buffer_set_tile(uint8_t* gddram, uint8_t x0, uint8_t y0, uint8_t* tile);
/* Simple RLE decompressor (two implementations, wip) */
-void uncompress_image(uint8_t* compressed_data,
+void uncompress_image(const uint8_t* compressed_data,
uint8_t* buffer);
-void uncompress_image_asm(uint8_t* compressed_data,
+void uncompress_image_asm(const uint8_t* compressed_data,
+ uint8_t* buffer);
+void uncompress_image_asm_old(const uint8_t* compressed_data,
uint8_t* buffer);
#endif