Skip to content

Commit

Permalink
initial guppy screen code commit. code at 0.0.11-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ballaswag committed Dec 13, 2023
1 parent a11e0b6 commit 4a5cf94
Show file tree
Hide file tree
Showing 1,067 changed files with 559,426 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "lvgl"]
path = lvgl
url = https://github.com/lvgl/lvgl.git
[submodule "lv_drivers"]
path = lv_drivers
url = https://github.com/littlevgl/lv_drivers.git
[submodule "libhv"]
path = libhv
url = https://github.com/ithewei/libhv.git
[submodule "spdlog"]
path = spdlog
url = https://github.com/gabime/spdlog.git
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

116 changes: 116 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#
# Makefile
#
ifdef CROSS_COMPILE
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
CPP = $(CC) -E
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
endif

LVGL_DIR_NAME ?= lvgl
LVGL_DIR ?= .

WARNINGS := -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith \
-fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess \
-Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic \
-Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=2048 \
-Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter \
-Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes \
-Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare -std=c99
CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ $(WARNINGS) -Ilibhv/include/hv -Iwpa_supplicant/src/common
LDFLAGS ?= -lm -Llibhv/lib -l:libhv.a -latomic -lpthread -Lwpa_supplicant/wpa_supplicant/ -l:libwpa_client.a -lstdc++fs
BIN = guppyscreen
BUILD_DIR = ./build
BUILD_OBJ_DIR = $(BUILD_DIR)/obj
BUILD_BIN_DIR = $(BUILD_DIR)/bin

prefix ?= /usr
bindir ?= $(prefix)/bin

#Collect the files to compile
MAINSRC = $(wildcard $(LVGL_DIR)/src/*.cpp)

include $(LVGL_DIR)/lvgl/lvgl.mk
include $(LVGL_DIR)/lv_drivers/lv_drivers.mk

CSRCS += $(wildcard $(LVGL_DIR)/assets/*.c)

ifdef ZBOLT
CSRCS += $(wildcard $(LVGL_DIR)/assets/zbolt/*.c)
DEFINES += -D ZBOLT
else
CSRCS += $(wildcard $(LVGL_DIR)/assets/material/*.c)
endif

ifdef GUPPYSCREEN_VERSION
DEFINES += -D GUPPYSCREEN_VERSION="\"${GUPPYSCREEN_VERSION}\""
endif

OBJEXT ?= .o

AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))

MAINOBJ = $(MAINSRC:.cpp=$(OBJEXT))

OBJS = $(AOBJS) $(COBJS) $(MAINOBJ)
TARGET = $(addprefix $(BUILD_OBJ_DIR)/, $(patsubst ./%, %, $(OBJS)))

INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ -I./spdlog/include
LDLIBS := -lm

DEFINES += -D _GNU_SOURCE -D SPDLOG_HEADER_ONLY

ifdef SIMULATION
DEFINES += -D LV_BUILD_TEST=0 -D SIMULATOR
LDLIBS += -lSDL2
endif

COMPILE_CC = $(CC) $(CFLAGS) $(INC) $(DEFINES)
COMPILE_CXX = $(CC) $(CFLAGS) $(INC) $(DEFINES)

## MAINOBJ -> OBJFILES

all: default

build_libhv:
$(MAKE) -C libhv -j $(nproc) clean

build_wpaclient:
$(MAKE) -C wpa_supplicant/wpa_supplicant -j $(nproc) libwpa_client.a

$(BUILD_OBJ_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(COMPILE_CXX) -std=c++17 $(CFLAGS) -c $< -o $@
@echo "CXX $<"

$(BUILD_OBJ_DIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(COMPILE_CC) $(CFLAGS) -c $< -o $@
@echo "CC $<"

default: $(TARGET)
@mkdir -p $(dir $(BUILD_BIN_DIR)/)
$(CXX) -o $(BUILD_BIN_DIR)/$(BIN) $(TARGET) $(LDFLAGS) $(LDLIBS)
@echo "CXX $<"

libhvclean:
$(MAKE) -C libhv clean

wpaclean:
$(MAKE) -C wpa_supplicant/wpa_supplicant clean

clean:
rm -rf $(BUILD_DIR)

install:
install -d $(DESTDIR)$(bindir)
install $(BUILD_BIN_DIR)/$(BIN) $(DESTDIR)$(bindir)

uninstall:
$(RM) -r $(addprefix $(DESTDIR)$(bindir)/,$(BIN))
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ Earlier development screenshots can be found [here](https://github.com/ballaswag
https://www.reddit.com/r/crealityk1/comments/17jp59g/new_touch_ui_for_the_k1/

## Support Guppy Screen
You can directly support this project using [GitHub Sponsors](https://github.com/sponsors/ballaswag/) or [Ko-Fi](https://ko-fi.com/ballaswag)
You can directly support this project by <a href='https://ko-fi.com/ballaswag' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
or
[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/ballaswag)

## Credits
[Material Design Icons](https://pictogrammers.com/library/mdi/)
Expand Down
Loading

0 comments on commit 4a5cf94

Please sign in to comment.