-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab261af
commit c4c1bd6
Showing
129 changed files
with
126 additions
and
26 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,52 @@ | ||
# | ||
CC = sdcc | ||
CFLAGS += --model-small --opt-code-speed -I /usr/share/sdcc/include | ||
LDFLAGS_FLASH = \ | ||
--out-fmt-ihx \ | ||
--code-loc 0x000 --code-size 0x4000 \ | ||
--xram-loc 0xf000 --xram-size 0x300 \ | ||
--iram-size 0x100 | ||
ifdef DEBUG | ||
CFLAGS += --debug | ||
endif | ||
|
||
#programmer binary | ||
CC_TOOL ?= cc-tool | ||
|
||
RESULT ?= opensky_$(notdir $(TARGET)) | ||
|
||
# fetch this dir during include | ||
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST))) | ||
ARCH_DIR = arch/cc251x | ||
CFLAGS += -I$(SELF_DIR) -I ./ -I$(ARCH_DIR) | ||
HAL_SRC = hal_led.c hal_uart.c hal_clocksource.c hal_timeout.c hal_wdt.c hal_delay.c hal_dma.c hal_spi.c | ||
HAL_SRC += hal_cc25xx.c hal_io.c hal_adc.c hal_storage.c hal_sbus.c hal_ppm.c hal_soft_spi.c hal_soft_serial.c | ||
SRC = $(GENERIC_SRCS) $(HAL_SRC:%.c=$(ARCH_DIR)/%.c) | ||
ADB=$(SRC:.c=.adb) | ||
ASM=$(SRC:.c=.asm) | ||
LNK=$(SRC:.c=.lnk) | ||
LST=$(SRC:.c=.lst) | ||
REL=$(SRC:.c=.rel) | ||
RST=$(SRC:.c=.rst) | ||
SYM=$(SRC:.c=.sym) | ||
|
||
OUTPUT=$(RESULT).hex | ||
|
||
PCDB=$(PROGS:.hex=.cdb) | ||
PLNK=$(PROGS:.hex=.lnk) | ||
PMAP=$(PROGS:.hex=.map) | ||
PMEM=$(PROGS:.hex=.mem) | ||
PAOM=$(PROGS:.hex=) | ||
%.rel : %.c | ||
$(CC) -c $(CFLAGS) -o$*.rel $< | ||
|
||
board: $(OUTPUT) | ||
|
||
$(OUTPUT): $(REL) Makefile | ||
$(CC) $(LDFLAGS_FLASH) $(CFLAGS) -o $(OUTPUT) $(REL) | ||
clean: | ||
rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM) | ||
rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM) | ||
|
||
flash: $(RESULT).hex | ||
$(CC_TOOL) -f -e -w $(RESULT).hex |
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,47 @@ | ||
#include "portmacros.h" | ||
|
||
//pin layout ISP header | ||
#define ISP_DATA P2_1 | ||
#define ISP_CLOCK P2_2 | ||
|
||
#define PPM_OUT_PIN 4 | ||
|
||
//note: change of adc ch require change in adc.c! | ||
#define ADC_PORT P0 | ||
#define ADC0 5 | ||
#define ADC1 6 | ||
//acs712 in inverted mode on adc1? | ||
//when powered by 5V we can use a trick | ||
//to get a good resolution: use inverted power inputs | ||
// 0A = 2.5V | ||
//30A = 0.0V | ||
#define ADC1_USE_ACS712 1 | ||
|
||
//voltage divider on my board is 10 / 5.6 k, scale to 100 / 56 to avoid floating point calc | ||
#define ADC0_DIVIDER_A 100 | ||
#define ADC0_DIVIDER_B 56 | ||
|
||
//APA102 SPI CLOCK | ||
#define SOFT_SPI_CLOCK_PORT P2 | ||
#define SOFT_SPI_CLOCK_PIN 1 | ||
//APA102 SPI DATA | ||
#define SOFT_SPI_MOSI_PORT P2 | ||
#define SOFT_SPI_MOSI_PIN 2 | ||
|
||
//P0.2 is NC! change this to P0.3 (debug tx) | ||
#define BIND_PORT P0 | ||
#define BIND_PIN 2 | ||
|
||
//leds | ||
#define LED_GREEN_PORT P1 | ||
#define LED_GREEN_PIN 1 | ||
//re led is NC! | ||
#define LED_RED_PORT P1 | ||
#define LED_RED_PIN 2 | ||
|
||
|
||
//hub telemetry input (will run a soft serial port) | ||
#define SOFT_SERIAL_PORT P2 | ||
#define SOFT_SERIAL_PIN 1 | ||
|
||
|
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
File renamed without changes.