[sw/example] add eclipse project sources

This commit is contained in:
stnolting 2024-06-15 07:28:06 +02:00
parent 53ce186d5b
commit 34bb41e7be
2 changed files with 33 additions and 0 deletions

19
sw/example/eclipse/main.c Normal file
View file

@ -0,0 +1,19 @@
// Simple Eclipse example project
#include <neorv32.h>
int main() {
// clear GPIO output (set all bits to 0)
neorv32_gpio_port_set(0);
int cnt = 0;
while (1) {
neorv32_gpio_port_set(cnt++ & 0xFF); // increment counter and mask for lowest 8 bit
neorv32_cpu_delay_ms(250); // wait 250ms using busy wait
}
// this should never be reached
return 0;
}

View file

@ -0,0 +1,14 @@
# Use this makefile to specify all relevant CPU / compiler options
# as these cannot be issued by Eclipse (since this is a makefile-based project).
# Override the default CPU ISA
#override MARCH = rv32imc_zicsr_zifencei
# Override the default RISC-V GCC prefix
RISCV_PREFIX = riscv-none-elf-
# Modify this variable to fit your NEORV32 setup (neorv32 home folder)
NEORV32_HOME ?= ../../..
# Include the main NEORV32 makefile
include $(NEORV32_HOME)/sw/common/common.mk