Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.DS_Store
*~
*.dep
*.bin

# Prerequisites
*.d
Expand Down
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
export BOARD = stm32f429discovery
ROOTDIR = $(CURDIR)/uC-sdk

export ROOTDIR = $(CURDIR)/uC-sdk
export VERBOSE = true

ifeq ($(wildcard $(ROOTDIR)/uC-sdk.root),)
ifneq ($(wildcard ../../../uC-sdk.root),)
ROOTDIR = ../../..
endif
endif

TARGET = bootloader.bin
TARGET_SRCS = bootloader.c
#TARGET_SRCS = bootloader.c uGL-stm32f429discovery.c uGL/stm32f429i_discovery.c uGL/stm32f429i_discovery_sdram.c uGL/fonts.c
TARGET_SRCS = bootloader.c uGL/uGL-uGPU.c

LIBDEPS = \
$(ROOTDIR)/FreeRTOS/libFreeRTOS.a \
Expand All @@ -24,14 +18,18 @@ $(ROOTDIR)/hardware/libhardware.a \
LIBS = -Wl,--start-group $(LIBDEPS) -Wl,--end-group
TARGET_INCLUDES = include

export MAINDIR = $(CURDIR)

include $(MAINDIR)/uGL/config.mk
include $(ROOTDIR)/common.mk

all: uC-sdk $(TARGET)
all: uC-sdk uGL $(TARGET)

clean: clean-generic
$(Q)$(MAKE) $(MAKE_OPTS) -C $(ROOTDIR) clean
$(Q)$(MAKE) $(MAKE_OPTS) -C uGL clean

.PHONY: uC-sdk
.PHONY: uC-sdk uGL

$(ROOTDIR)/FreeRTOS/libFreeRTOS.a: uC-sdk
$(ROOTDIR)/arch/libarch.a: uC-sdk
Expand All @@ -41,13 +39,19 @@ $(ROOTDIR)/libm/libm.a: uC-sdk
$(ROOTDIR)/acorn/libacorn.a: uC-sdk
$(ROOTDIR)/hardware/libhardware.a: uC-sdk

uGL:
$(E) "[MAKE] Entering uGL"
$(Q)$(MAKE) $(MAKE_OPTS) -C uGL

uC-sdk:
$(E) "[MAKE] Entering uC-sdk"
$(Q)$(MAKE) $(MAKE_OPTS) -C $(ROOTDIR)

deps: ldeps
$(E) "[DEPS] Creating dependency tree for uC-sdk"
$(Q)$(MAKE) $(MAKE_OPTS) -C $(ROOTDIR) ldeps
$(E) "[DEPS] Creating dependency tree for uGL"
$(Q)$(MAKE) $(MAKE_OPTS) -C uGL ldeps

include $(ROOTDIR)/FreeRTOS/config.mk
include $(ROOTDIR)/arch/config.mk
Expand Down
67 changes: 67 additions & 0 deletions bootloader.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,71 @@
#include <stdlib.h>

#include "uGL/uGL.h"
#include "logo.h"
/*
void drawRainbow()
{
uGL_color_t c;
for (uint16_t i = 0 ; i < 40 ; i++)
{
//rouge => jaune
c.r = 0xff; c.g = i * 0xff / 40; c.b = 0x00;
uGL_drawVLine(i, 0, 10, c);
//jaune => vert
c.r = 0xff - i * 0xff / 40; c.g = 0xff; c.b = 0x00;
uGL_drawVLine(i + 40, 0, 10, c);
//vert => cyan
c.r = 0x00; c.g = 0xff; c.b = i * 0xff / 40;
uGL_drawVLine(i + 80, 0, 10, c);
//cyan => bleu
c.r = 0x00; c.g = 0xff - i * 0xff / 40; c.b = 0xff;
uGL_drawVLine(i + 120, 0, 10, c);
//bleu => violet
c.r = i * 0xff / 40; c.g = 0x00; c.b = 0xff;
uGL_drawVLine(i + 160, 0, 10, c);
//violet => rouge
c.r = 0xff; c.g = 0x00; c.b = 0xff - i * 0xff / 40;
uGL_drawVLine(i + 200, 0, 10, c);
}
}*/

int main()
{
uGL_init();

uGL_sprite_t sprite_logo = { .id = 0, .pixels = &logo};
uGl_loadSprite(&sprite_logo);
uGl_drawSprite(&sprite_logo, (480 - 64) / 2, (272 - 64) / 2);
/*
uGL_color_t backgroundcolor = { .r = 255, .g = 255, .b = 255 };
uGL_drawRectangle(0, 0, 240, 320, backgroundcolor);

uGL_color_t black = { .r = 0, .g = 0, .b = 0 };
for (uint8_t i = 0 ; i < 6 ; i++)
uGL_drawHLine(0, i * 50, 240, black);

for (uint8_t i = 0 ; i < 4 ; i++)
uGL_drawVLine(i * 50, 0, 320, black);

uGL_color_t gradientcolor = { .r = 0, .g = 0, .b = 0 };
for (uint8_t i = 0 ; i < 255 ; i++)
{
gradientcolor.g = i;
uGL_drawPixel(10, i, gradientcolor);
uGL_drawHLine(20, i, 10, gradientcolor);
}

drawRainbow();

uGL_color_t rectcolor = { .r = 250, .g = 120, .b = 10 };
uGL_drawFrame(10, 30, 100, 50, rectcolor);

uGL_color_t hlinecolor = { .r = 50, .g = 240, .b = 20 };
uGL_drawHLine(120, 80, 100, hlinecolor);

uGL_color_t vlinecolor = { .r = 250, .g = 240, .b = 10 };
uGL_drawVLine(90, 20, 200, vlinecolor);*/

while(1);
return 0;
}
636 changes: 636 additions & 0 deletions logo.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion uC-sdk
20 changes: 20 additions & 0 deletions uGL/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
all: $(TARGET_OBJ)

export BOARD = stm32f429discovery

include $(ROOTDIR)/common.mk
include config.mk
include $(ROOTDIR)/arch/config.mk
include $(ROOTDIR)/hardware/config.mk

TARGET_SRCS += font.c
#TARGET_SRCS += uGL-stm32f429discovery.c
TARGET_SRCS += uGL-uGPU.c
TARGET_SRCS += stm32f429i_discovery.c
#TARGET_SRCS += stm32f429i_discovery_lcd.c
TARGET_SRCS += stm32f429i_discovery_sdram.c

include $(ROOTDIR)/target-rules.mk

clean: clean-generic

5 changes: 5 additions & 0 deletions uGL/config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TARGET_INCLUDES += $(MAINDIR)/uGL

ifeq ($(USE_MPU),true)
TARGET_CPPFLAGS += -DportUSING_MPU_WRAPPERS=1
endif
Loading