mirror of
https://github.com/stnolting/neorv32.git
synced 2025-04-24 06:07:52 -04:00
[sw/example] add eclipse project sources
This commit is contained in:
parent
53ce186d5b
commit
34bb41e7be
2 changed files with 33 additions and 0 deletions
19
sw/example/eclipse/main.c
Normal file
19
sw/example/eclipse/main.c
Normal 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;
|
||||
}
|
14
sw/example/eclipse/makefile
Normal file
14
sw/example/eclipse/makefile
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue