Skip to content

Commit 3d538fa

Browse files
committed
PROS 2.11.0 with updated license and exposed I2C functions
0 parents  commit 3d538fa

File tree

110 files changed

+15764
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+15764
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
bin/
2+
doc/
3+
libpros.a
4+
libpros_sym.a
5+
include/*.h.gch
6+
.clang_complete
7+
.gcc-flags.json
8+
.project
9+
.cproject

Doxyfile

+1,089
Large diffs are not rendered by default.

LICENSE

+373
Large diffs are not rendered by default.

Makefile

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Universal C Makefile for MCU targets
2+
3+
LIBNAME=libpros
4+
5+
# Path to project root (for top-level, so the project is in ./; first-level, ../; etc.)
6+
ROOT=.
7+
# Binary output directory
8+
BINDIR=$(ROOT)/bin
9+
# Subdirectories to include in the build
10+
SUBDIRS=src
11+
12+
# Nothing below here needs to be modified by typical users
13+
14+
# Include common aspects of this project
15+
-include $(ROOT)/common.mk
16+
17+
ASMSRC:=$(wildcard *.$(ASMEXT))
18+
ASMOBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(ASMSRC:.$(ASMEXT)=.o))
19+
HEADERS:=$(wildcard *.$(HEXT))
20+
CSRC=$(wildcard *.$(CEXT))
21+
COBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(CSRC:.$(CEXT)=.o))
22+
CPPSRC:=$(wildcard *.$(CPPEXT))
23+
CPPOBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(CPPSRC:.$(CPPEXT)=.o))
24+
OUT:=$(BINDIR)/$(OUTNAME)
25+
26+
.PHONY: all clean documentation library upload _force_look
27+
28+
# By default, compile program
29+
all: $(BINDIR) $(OUT)
30+
31+
# Remove all intermediate object files (remove the binary directory)
32+
clean:
33+
-rm -f $(OUT)
34+
-rm -rf $(BINDIR)
35+
36+
# Uploads program to device
37+
upload: all
38+
$(UPLOAD)
39+
40+
# Phony force-look target
41+
_force_look:
42+
@true
43+
44+
# Compiles library for general HS use
45+
library: clean $(BINDIR) $(SUBDIRS) $(ASMOBJ) $(COBJ) $(CPPOBJ)
46+
# Get rid of junk that the user should be doing
47+
-rm -f $(BINDIR)/opcontrol.o
48+
-rm -f $(BINDIR)/init.o
49+
-rm -f $(BINDIR)/auto.o
50+
$(MCUPREFIX)ar rvs $(BINDIR)/$(LIBNAME)_sym.a $(BINDIR)/*.o
51+
$(MCUPREFIX)objcopy -S -g --strip-unneeded --keep-symbols public.txt $(BINDIR)/$(LIBNAME)_sym.a $(BINDIR)/$(LIBNAME).a
52+
53+
# Builds the documentation
54+
documentation:
55+
doxygen Doxyfile
56+
57+
# Looks in subdirectories for things to make
58+
$(SUBDIRS): %: _force_look
59+
@$(MAKE) --no-print-directory -C $@
60+
61+
# Ensure binary directory exists
62+
$(BINDIR):
63+
-@mkdir -p $(BINDIR)
64+
65+
# Compile program
66+
$(OUT): $(SUBDIRS) $(ASMOBJ) $(COBJ) $(CPPOBJ)
67+
@echo LN $(BINDIR)/*.o $(LIBRARIES) to $@
68+
@$(CC) $(LDFLAGS) $(BINDIR)/*.o $(LIBRARIES) -o $@
69+
@$(MCUPREFIX)size $(SIZEFLAGS) $(OUT)
70+
$(MCUPREPARE)
71+
72+
# Assembly source file management
73+
$(ASMOBJ): $(BINDIR)/%.o: %.$(ASMEXT) $(HEADERS)
74+
@echo AS $<
75+
@$(AS) $(AFLAGS) -o $@ $<
76+
77+
# Object management
78+
$(COBJ): $(BINDIR)/%.o: %.$(CEXT) $(HEADERS)
79+
@echo CC $(INCLUDE) $<
80+
@$(CC) $(INCLUDE) $(CFLAGS) -o $@ $<
81+
82+
$(CPPOBJ): $(BINDIR)/%.o: %.$(CPPEXT) $(HEADERS)
83+
@echo CPC $(INCLUDE) $<
84+
@$(CPPCC) $(INCLUDE) $(CPPFLAGS) -o $@ $<

README.md

+1,065

common.mk

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Universal C Makefile for MCU targets
2+
# Top-level template file to configure build
3+
4+
# Makefile for IFI VeX Cortex Microcontroller (STM32F103VD series)
5+
DEVICE=VexCortex
6+
# Libraries to include in the link (use -L and -l) e.g. -lm, -lmyLib
7+
LIBRARIES=-lgcc -lm
8+
# Prefix for ARM tools (must be on the path)
9+
MCUPREFIX=arm-none-eabi-
10+
# Flags for the assembler
11+
MCUAFLAGS=-mthumb -mcpu=cortex-m3 -mlittle-endian
12+
# Flags for the compiler
13+
MCUCFLAGS=-mthumb -mcpu=cortex-m3 -mlittle-endian
14+
# Flags for the linker
15+
MCULFLAGS=-nostartfiles -Wl,-static -Bfirmware -Wl,-T -Xlinker firmware/cortex.ld
16+
# Prepares the elf file by converting it to a binary that java can write
17+
MCUPREPARE=$(OBJCOPY) $(OUT) -O binary $(BINDIR)/$(OUTBIN)
18+
# Advanced sizing flags
19+
SIZEFLAGS=
20+
# Uploads program using java
21+
UPLOAD=@java -jar firmware/uniflash.jar vex $(BINDIR)/$(OUTBIN)
22+
23+
# Advanced options
24+
ASMEXT=s
25+
CEXT=c
26+
CPPEXT=cpp
27+
HEXT=h
28+
INCLUDE=-I$(ROOT)/include -I$(ROOT)/src
29+
OUTBIN=output.bin
30+
OUTNAME=output.elf
31+
32+
# Flags for programs
33+
AFLAGS:=$(MCUAFLAGS)
34+
ARFLAGS:=$(MCUCFLAGS)
35+
CCFLAGS:=-c -Wall $(MCUCFLAGS) -Os -ffunction-sections -fsigned-char -fomit-frame-pointer -fsingle-precision-constant
36+
CFLAGS:=$(CCFLAGS) -std=gnu99 -Werror=implicit-function-declaration
37+
CPPFLAGS:=$(CCFLAGS) -fno-exceptions -fno-rtti -felide-constructors
38+
LDFLAGS:=-Wall $(MCUCFLAGS) $(MCULFLAGS) -Wl,--gc-sections
39+
40+
# Tools used in program
41+
AR:=$(MCUPREFIX)ar
42+
AS:=$(MCUPREFIX)as
43+
CC:=$(MCUPREFIX)gcc
44+
CPPCC:=$(MCUPREFIX)g++
45+
OBJCOPY:=$(MCUPREFIX)objcopy

doc_img/check_homedir.png

18.4 KB

doc_img/close_projects.png

15.7 KB

doc_img/disable_update_check.png

31.5 KB

doc_img/driver_select.png

19.8 KB

doc_img/error_description.png

6.69 KB

doc_img/error_messages.png

13.4 KB

doc_img/git_addtoindex.png

30.3 KB

doc_img/git_commit.png

17.8 KB

doc_img/git_commitmsg.png

39.3 KB

doc_img/git_compareto.png

10 KB

doc_img/git_comparison.png

28.9 KB

doc_img/git_destroychanges.png

17 KB

doc_img/git_github.png

9.8 KB

doc_img/git_importproject.png

22.8 KB

doc_img/git_importremote.png

21.6 KB

doc_img/git_importselect.png

17.1 KB

doc_img/git_ischanged.png

4.18 KB

doc_img/git_newrepo.png

15.8 KB

doc_img/git_pasteproject.png

12.3 KB

doc_img/git_selectcommit.png

18 KB

doc_img/git_warning.png

17.7 KB

doc_img/goto_workbench.png

3.89 KB

doc_img/importitems.png

3.93 KB

doc_img/install_mac.png

144 KB

doc_img/library_files.png

5.54 KB

doc_img/new_header.png

9.9 KB

doc_img/new_source.png

10.2 KB

doc_img/open_projects.png

10.8 KB

doc_img/pl2303_driver_windows.png

44.3 KB

doc_img/pros_cmdline.png

19.2 KB

doc_img/pros_defaultproject.png

15.2 KB

doc_img/pros_newother.png

16.2 KB

doc_img/pros_newprojectmenu.png

9.99 KB

doc_img/pros_newprojectwizard.png

15.6 KB

doc_img/pros_noplug.png

8.64 KB

doc_img/pros_noproject.png

20.9 KB

doc_img/pros_shortcut_linux.png

15.9 KB

doc_img/pros_upload.png

10.7 KB

doc_img/pros_upload_fs.png

11.5 KB

doc_img/pros_vs2010_add.png

18.4 KB

doc_img/pros_vs2010_config1.png

20.4 KB

doc_img/pros_vs2010_config2.png

24.7 KB

doc_img/pros_vs2010_config3.png

20.8 KB

doc_img/pros_vs2010_copy.png

31.9 KB

doc_img/pros_vs2010_create.png

32.2 KB

doc_img/switch_version.png

6.05 KB

doc_img/terminal_config.png

16.6 KB

doc_img/terminal_connect.png

2.75 KB

doc_img/terminal_install.png

18 KB

doc_img/terminal_open.png

23.3 KB

doc_img/uac_install.png

20.9 KB

doc_img/unamem.png

10.7 KB

doc_img/vex_driver_windows.png

63.2 KB

doc_img/workspace_select.png

14.8 KB

firmware/STM32F10x.ld

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/* Memory space definitions */
2+
MEMORY {
3+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
4+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K
5+
}
6+
7+
/* Higher address of the user mode stack */
8+
EXTERN ( _estack );
9+
PROVIDE ( _estack = ORIGIN(RAM) + LENGTH(RAM) );
10+
11+
/* This sends all unreferenced IRQHandlers to reset. */
12+
PROVIDE ( ISR_SWI = 0 );
13+
PROVIDE ( ISR_IRQ = 0 );
14+
PROVIDE ( ISR_Prefetch = 0 );
15+
PROVIDE ( ISR_Abort = 0 );
16+
PROVIDE ( ISR_FIQ = 0 );
17+
18+
PROVIDE ( ISR_NMI = 0 );
19+
PROVIDE ( ISR_HardFault = 0 );
20+
PROVIDE ( ISR_MemManage = 0 );
21+
PROVIDE ( ISR_BusFault = 0 );
22+
PROVIDE ( ISR_UsageFault = 0 );
23+
24+
PROVIDE ( ISR_SVC = 0 );
25+
PROVIDE ( ISR_DebugMon = 0 );
26+
PROVIDE ( ISR_PendSV = 0 );
27+
PROVIDE ( ISR_SysTick = 0 );
28+
29+
PROVIDE ( ISR_WWDG = 0 );
30+
PROVIDE ( ISR_PVD = 0 );
31+
PROVIDE ( ISR_TAMPER = 0 );
32+
PROVIDE ( ISR_RTC = 0 );
33+
PROVIDE ( ISR_FLASH = 0 );
34+
PROVIDE ( ISR_RCC = 0 );
35+
PROVIDE ( ISR_EXTI0 = 0 );
36+
PROVIDE ( ISR_EXTI1 = 0 );
37+
PROVIDE ( ISR_EXTI2 = 0 );
38+
PROVIDE ( ISR_EXTI3 = 0 );
39+
PROVIDE ( ISR_EXTI4 = 0 );
40+
PROVIDE ( ISR_DMAChannel1 = 0 );
41+
PROVIDE ( ISR_DMAChannel2 = 0 );
42+
PROVIDE ( ISR_DMAChannel3 = 0 );
43+
PROVIDE ( ISR_DMAChannel4 = 0 );
44+
PROVIDE ( ISR_DMAChannel5 = 0 );
45+
PROVIDE ( ISR_DMAChannel6 = 0 );
46+
PROVIDE ( ISR_DMAChannel7 = 0 );
47+
PROVIDE ( ISR_DMA1_Channel1 = 0 );
48+
PROVIDE ( ISR_DMA1_Channel2 = 0 );
49+
PROVIDE ( ISR_DMA1_Channel3 = 0 );
50+
PROVIDE ( ISR_DMA1_Channel4 = 0 );
51+
PROVIDE ( ISR_DMA1_Channel5 = 0 );
52+
PROVIDE ( ISR_DMA1_Channel6 = 0 );
53+
PROVIDE ( ISR_DMA1_Channel7 = 0 );
54+
PROVIDE ( ISR_ADC = 0 );
55+
PROVIDE ( ISR_ADC1_2 = 0 );
56+
PROVIDE ( ISR_USB_HP_CAN_TX = 0 );
57+
PROVIDE ( ISR_USB_HP_CAN1_TX = 0 );
58+
PROVIDE ( ISR_USB_LP_CAN_RX0 = 0 );
59+
PROVIDE ( ISR_USB_LP_CAN1_RX0 = 0 );
60+
PROVIDE ( ISR_CAN_RX1 = 0 );
61+
PROVIDE ( ISR_CAN1_RX1 = 0 );
62+
PROVIDE ( ISR_CAN_SCE = 0 );
63+
PROVIDE ( ISR_CAN1_SCE = 0 );
64+
PROVIDE ( ISR_EXTI9_5 = 0 );
65+
PROVIDE ( ISR_TIM1_BRK = 0 );
66+
PROVIDE ( ISR_TIM1_UP = 0 );
67+
PROVIDE ( ISR_TIM1_TRG_COM = 0 );
68+
PROVIDE ( ISR_TIM1_CC = 0 );
69+
PROVIDE ( ISR_TIM2 = 0 );
70+
PROVIDE ( ISR_TIM3 = 0 );
71+
PROVIDE ( ISR_TIM4 = 0 );
72+
PROVIDE ( ISR_I2C1_EV = 0 );
73+
PROVIDE ( ISR_I2C1_ER = 0 );
74+
PROVIDE ( ISR_I2C2_EV = 0 );
75+
PROVIDE ( ISR_I2C2_ER = 0 );
76+
PROVIDE ( ISR_SPI1 = 0 );
77+
PROVIDE ( ISR_SPI2 = 0 );
78+
PROVIDE ( ISR_USART1 = 0 );
79+
PROVIDE ( ISR_USART2 = 0 );
80+
PROVIDE ( ISR_USART3 = 0 );
81+
PROVIDE ( ISR_EXTI15_10 = 0 );
82+
PROVIDE ( ISR_RTCAlarm = 0 );
83+
PROVIDE ( ISR_USBWakeUp = 0 );
84+
PROVIDE ( ISR_TIM8_BRK = 0 );
85+
PROVIDE ( ISR_TIM8_UP = 0 );
86+
PROVIDE ( ISR_TIM8_TRG_COM = 0 );
87+
PROVIDE ( ISR_TIM8_CC = 0 );
88+
PROVIDE ( ISR_ADC3 = 0 );
89+
PROVIDE ( ISR_FSMC = 0 );
90+
PROVIDE ( ISR_SDIO = 0 );
91+
PROVIDE ( ISR_TIM5 = 0 );
92+
PROVIDE ( ISR_SPI3 = 0 );
93+
PROVIDE ( ISR_UART4 = 0 );
94+
PROVIDE ( ISR_UART5 = 0 );
95+
PROVIDE ( ISR_TIM6 = 0 );
96+
PROVIDE ( ISR_TIM7 = 0 );
97+
PROVIDE ( ISR_DMA2_Channel1 = 0 );
98+
PROVIDE ( ISR_DMA2_Channel2 = 0 );
99+
PROVIDE ( ISR_DMA2_Channel3 = 0 );
100+
PROVIDE ( ISR_DMA2_Channel4_5 = 0 );

firmware/cortex.ld

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/* Include STM32F10X linker scripts */
2+
INCLUDE "STM32F10x.ld"
3+
4+
EXTERN ( _heapbegin );
5+
6+
/* Section definitions for Cortex firmware flashing */
7+
SECTIONS {
8+
.isr_vector : {
9+
/* startup code, prevents garbage collection from eating everything */
10+
KEEP(*(.isr_vector))
11+
. = ALIGN(4);
12+
} >FLASH
13+
.text : {
14+
. = ALIGN(4);
15+
*(.text)
16+
*(.text.*)
17+
/* Preinit array of functions */
18+
__preinit_array_start = .;
19+
KEEP (*(.preinit_array))
20+
__preinit_array_end = .;
21+
. = ALIGN(4);
22+
/* Init array of functions */
23+
KEEP(*(.init))
24+
. = ALIGN(4);
25+
__init_array_start = .;
26+
KEEP (*(SORT(.init_array.*)))
27+
KEEP (*(.init_array))
28+
__init_array_end = .;
29+
. = ALIGN(4);
30+
/* C++ constructors */
31+
KEEP (*crtbegin.o(.ctors))
32+
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
33+
KEEP (*(SORT(.ctors.*)))
34+
KEEP (*crtend.o(.ctors))
35+
. = ALIGN(4);
36+
/* Finalizer array of functions */
37+
KEEP(*(.fini))
38+
. = ALIGN(4);
39+
__fini_array_start = .;
40+
KEEP (*(.fini_array))
41+
KEEP (*(SORT(.fini_array.*)))
42+
__fini_array_end = .;
43+
. = ALIGN(4);
44+
/* C++ destructors */
45+
KEEP (*crtbegin.o(.dtors))
46+
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
47+
KEEP (*(SORT(.dtors.*)))
48+
KEEP (*crtend.o(.dtors))
49+
_etext = .;
50+
_srdata = .;
51+
. = ALIGN(4);
52+
*(.rodata)
53+
*(.rodata*)
54+
*(.glue_7)
55+
*(.glue_7t)
56+
. = ALIGN(4);
57+
_erdata = .;
58+
_sidata = .;
59+
} >FLASH
60+
/* The program executes knowing that the data is in the RAM, but the loader puts the
61+
* initial values in the FLASH (inidata). The startup copies the initial values over */
62+
.data : AT ( _sidata ) {
63+
. = ALIGN(4);
64+
_sdata = .;
65+
*(.data)
66+
*(.data.*)
67+
*(.RAMtext)
68+
. = ALIGN(4);
69+
_edata = .;
70+
} >RAM
71+
/* Uninitialized data (zero-fill) section */
72+
.bss : {
73+
. = ALIGN(4);
74+
_sbss = .;
75+
*(.bss)
76+
*(COMMON)
77+
. = ALIGN(4);
78+
_ebss = .;
79+
. = ALIGN(8);
80+
_heapbegin = .;
81+
} >RAM
82+
83+
/DISCARD/ : {
84+
libc.a ( * )
85+
libg.a ( * )
86+
libm.a ( * )
87+
libgcc.a ( * )
88+
libstdc++.a ( * )
89+
libsupc++.a ( * )
90+
}
91+
/* ARM exception unwinding, mandated by ARM EABI C++ standard (with -fno-exceptions?) */
92+
.ARM.exidx 0 : { *(.ARM.exidx*) }
93+
/* Stabs debugging sections */
94+
.stab 0 : { *(.stab) }
95+
.stabstr 0 : { *(.stabstr) }
96+
.stab.excl 0 : { *(.stab.excl) }
97+
.stab.exclstr 0 : { *(.stab.exclstr) }
98+
.stab.index 0 : { *(.stab.index) }
99+
.stab.indexstr 0 : { *(.stab.indexstr) }
100+
.comment 0 : { *(.comment) }
101+
/* DWARF 1 */
102+
.debug 0 : { *(.debug) }
103+
.line 0 : { *(.line) }
104+
/* GNU DWARF 1 extensions */
105+
.debug_srcinfo 0 : { *(.debug_srcinfo) }
106+
.debug_sfnames 0 : { *(.debug_sfnames) }
107+
/* DWARF 1.1 and DWARF 2 */
108+
.debug_aranges 0 : { *(.debug_aranges) }
109+
.debug_pubnames 0 : { *(.debug_pubnames) }
110+
/* DWARF 2 */
111+
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
112+
.debug_abbrev 0 : { *(.debug_abbrev) }
113+
.debug_line 0 : { *(.debug_line) }
114+
.debug_frame 0 : { *(.debug_frame) }
115+
.debug_str 0 : { *(.debug_str) }
116+
.debug_loc 0 : { *(.debug_loc) }
117+
.debug_macinfo 0 : { *(.debug_macinfo) }
118+
/* SGI/MIPS DWARF 2 extensions */
119+
.debug_weaknames 0 : { *(.debug_weaknames) }
120+
.debug_funcnames 0 : { *(.debug_funcnames) }
121+
.debug_typenames 0 : { *(.debug_typenames) }
122+
.debug_varnames 0 : { *(.debug_varnames) }
123+
}

firmware/uniflash.jar

1.06 MB
Binary file not shown.

0 commit comments

Comments
 (0)