-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from VisorFolks/development
Staging stable with project unification and dynamic memory support
- Loading branch information
Showing
61 changed files
with
1,641 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2022, Cyancore Team | ||
# | ||
# File Name : picotool.mk | ||
# Description : This is a build script to generate picotool | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
PICO_SDK_GIT := [email protected]:raspberrypi/pico-sdk.git | ||
PICO_TOOL_GIT := [email protected]:raspberrypi/picotool.git | ||
PICO_SDK_PATH := $(TOOLS_ROOT)/pico-sdk/ | ||
PICO_TOOL_PATH := $(TOOLS_ROOT)/picotool/ | ||
PICO_TOOL := $(MISC_TOOLS)/picotool | ||
PICO_TOOL_BUILD := $(PICO_TOOL_PATH)/build/picotool | ||
ELF2UF2 := $(MISC_TOOLS)/elf2uf2 | ||
|
||
ifneq ($(V),1) | ||
SILENT_LOGS := > cbuild.log 2> /dev/null | ||
endif | ||
|
||
P_TARGETS += elf2uf2 | ||
T_ALLOWLIST += get_picotool pt_clean install_pt_dep | ||
|
||
get_picotool: $(PICO_TOOL) $(ELF2UF2) | ||
|
||
$(PICO_TOOL): $(PICO_TOOL_BUILD) | ||
mkdir -p $(dir $@) | ||
cp $(PICO_TOOL_PATH)/build/picotool $@ | ||
|
||
$(PICO_TOOL_BUILD): $(PICO_SDK_PATH) $(PICO_TOOL_PATH) | ||
@echo "Building picotool ..." | ||
cd $(PICO_TOOL_PATH) && mkdir -p build && \ | ||
cd build && export PICO_SDK_PATH=$(PICO_SDK_PATH) && \ | ||
cmake ../ $(SILENT_LOGS) \ | ||
&& make $(SILENT_LOGS) | ||
|
||
$(ELF2UF2): $(PICO_SDK_PATH) | ||
@echo "Building elf2uf2 ..." | ||
mkdir -p $(MISC_TOOLS)/temp | ||
cd $(MISC_TOOLS)/temp; \ | ||
cmake $(PICO_SDK_PATH)/tools/elf2uf2 2>/dev/null >/dev/null; \ | ||
make >/dev/null 2>/dev/null | ||
cp $(MISC_TOOLS)/temp/elf2uf2 $@ | ||
rm -rf $(MISC_TOOLS)/temp | ||
|
||
elf2uf2: $(ELF2UF2) elf | ||
@echo "Generating $(notdir $(ELF:.elf=.uf2)) ..." | ||
$(ELF2UF2) $(ELF) $(ELF:.elf=.uf2) | ||
|
||
$(PICO_SDK_PATH): | ||
@echo "Fetching PICO SDK ..." | ||
git clone $(PICO_SDK_GIT) --quiet $@ | ||
|
||
$(PICO_TOOL_PATH): | ||
@echo "Fetching PICO Tool ..." | ||
git clone $(PICO_TOOL_GIT) --quiet $@ | ||
|
||
install_pt_dep: | ||
@echo "Installing Dependencies ..." | ||
@sudo apt-get install build-essential pkg-config libusb-1.0-0-dev -y -qq > /dev/null | ||
|
||
pt_clean: | ||
rm -rf $(PICO_SDK_PATH) $(PICO_TOOL_PATH) $(PICO_TOOL) $(ELF2UF2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2022, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file build project sources and specifies | ||
# project properties | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
BLP_DIR := $(GET_PATH) | ||
|
||
OPTIMIZATION := s | ||
|
||
EXE_MODE := terravisor | ||
|
||
DIR := $(BLP_DIR) | ||
include mk/obj.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2022, Cyancore Team | ||
* | ||
* File Name : project.c | ||
* Description : This file consists of project srouces | ||
* Primary Author : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <status.h> | ||
#include <syslog.h> | ||
#include <terravisor/bootstrap.h> | ||
#include <arch.h> | ||
#include <driver.h> | ||
#include <interrupt.h> | ||
#include <driver/onboardled.h> | ||
#include <platform.h> | ||
#include <time.h> | ||
|
||
void no_program(void); | ||
void plug() | ||
{ | ||
bootstrap(); | ||
driver_setup_all(); | ||
link_interrupt(int_arch, 2, no_program); | ||
|
||
syslog(info, "Bootloader!\n"); | ||
syslog(info, "Waiting for 2secs ...\n"); | ||
for(int i = 0; i < 40; i++) | ||
{ | ||
onboardled_toggle(); | ||
mdelay(50); | ||
} | ||
arch_di(); | ||
onboardled_off(); | ||
driver_exit_all(); | ||
platform_jump_to_user_code(); | ||
return; | ||
} | ||
|
||
void no_program() | ||
{ | ||
driver_setup_all(); | ||
syslog(fail, "No User program found!\n"); | ||
while(1) | ||
{ | ||
onboardled_toggle(); | ||
mdelay(1000); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2022, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file build project sources | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
DEMO_DIR := $(GET_PATH) | ||
|
||
OPTIMIZATION := s | ||
|
||
EXE_MODE := terravisor | ||
|
||
DIR := $(DEMO_DIR) | ||
include mk/obj.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* CYANCORE LICENSE | ||
* Copyrights (C) 2022, Cyancore Team | ||
* | ||
* File Name : project.c | ||
* Description : This file consists of project srouces | ||
* Primary Author : Akash Kollipara [[email protected]] | ||
* Organisation : Cyancore Core-Team | ||
*/ | ||
|
||
#include <status.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <terravisor/bootstrap.h> | ||
#include <driver.h> | ||
#include <driver/onboardled.h> | ||
#include <time.h> | ||
|
||
void plug() | ||
{ | ||
bootstrap(); | ||
driver_setup_all(); | ||
|
||
printf("Demo Program!\n"); | ||
return; | ||
} | ||
|
||
|
||
void play() | ||
{ | ||
static unsigned char i = 0; | ||
char progress[] = "-\\|/"; | ||
uint64_t time; | ||
char c = progress[(i++) % strlen(progress)]; | ||
get_timestamp(&time); | ||
time /= 1000U; | ||
|
||
printf("[%012llu] Running Blinky ... [%c]", time, c); | ||
|
||
onboardled_toggle(); | ||
|
||
mdelay(500); | ||
|
||
printf("\r"); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
# | ||
# CYANCORE LICENSE | ||
# Copyrights (C) 2019, Cyancore Team | ||
# Copyrights (C) 2019-2022, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file build project sources and specifies | ||
# project properties | ||
# Description : This file build and gathers project properties | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
PROJECT_DIR := $(GET_PATH) | ||
|
||
OPTIMIZATION := s | ||
|
||
EXE_MODE := terravisor | ||
|
||
include $(PROJECT_DIR)/../demo.src/build.mk | ||
include $(PROJECT_DIR)/config.mk | ||
|
||
DIR := $(PROJECT_DIR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ BOOTMSGS := 0 | |
EARLYCON_SERIAL := 1 | ||
CONSOLE_SERIAL := 1 | ||
TERRAKERN := 0 | ||
OBRDLED_ENABLE := 1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,14 @@ | |
# Copyrights (C) 2019, Cyancore Team | ||
# | ||
# File Name : build.mk | ||
# Description : This file build project sources and specifies | ||
# project properties | ||
# Description : This file builds and gathers project properties | ||
# Primary Author : Akash Kollipara [[email protected]] | ||
# Organisation : Cyancore Core-Team | ||
# | ||
|
||
PROJECT_DIR := $(GET_PATH) | ||
|
||
OPTIMIZATION := s | ||
|
||
EXE_MODE := terravisor | ||
|
||
include $(PROJECT_DIR)/../demo.src/build.mk | ||
include $(PROJECT_DIR)/config.mk | ||
|
||
DIR := $(PROJECT_DIR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.