From: Keith Packard Date: Thu, 6 Nov 2014 06:11:44 +0000 (-0800) Subject: altos: Rename microwater to microsplash X-Git-Tag: bdale-altosdroid~6^2~26 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=b67556949aa080fc5e70771e972de880e44eca12 altos: Rename microwater to microsplash Signed-off-by: Keith Packard --- diff --git a/src/microsplash/.gitignore b/src/microsplash/.gitignore new file mode 100644 index 00000000..0573d989 --- /dev/null +++ b/src/microsplash/.gitignore @@ -0,0 +1,2 @@ +ao_product.h +microwater-* diff --git a/src/microsplash/Makefile b/src/microsplash/Makefile new file mode 100644 index 00000000..10cb825b --- /dev/null +++ b/src/microsplash/Makefile @@ -0,0 +1,121 @@ +# +# Tiny AltOS build +# +# +vpath % ../attiny:../drivers:../kernel:../product:.. +vpath ao-make-product.5c ../util +vpath make-altitude-pa ../util + +include ../avr/Makefile.defs + +PUBLISH_DIR=$(HOME)/altusmetrumllc/Binaries +PUBLISH_FILE=$(PUBLISH_DIR)/$(PROG)-$(VERSION).hex + +MCU=attiny85 +DUDECPUTYPE=t85 +#PROGRAMMER=stk500v2 -P usb +LOADSLOW=-i 32 -B 32 +LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w: + +#LDFLAGS=-L$(LDSCRIPTS) -Tavr25.x + +ALTOS_SRC = \ + ao_micropeak.c \ + ao_spi_attiny.c \ + ao_led.c \ + ao_clock.c \ + ao_ms5607.c \ + ao_exti.c \ + ao_convert_pa.c \ + ao_report_micro.c \ + ao_notask.c \ + ao_eeprom_tiny.c \ + ao_panic.c \ + ao_log_micro.c \ + ao_async.c \ + ao_microflight.c \ + ao_microkalman.c + +INC=\ + ao.h \ + ao_pins.h \ + ao_arch.h \ + ao_arch_funcs.h \ + ao_exti.h \ + ao_ms5607.h \ + ao_log_micro.h \ + ao_micropeak.h \ + altitude-pa.h + +IDPRODUCT=0 +PRODUCT=MicroSplash-v0.1 +PRODUCT_DEF=-DMICROPEAK +CFLAGS = $(PRODUCT_DEF) -I. -I../attiny -I../kernel -I.. -I../drivers -I../product +CFLAGS += -g -mmcu=$(MCU) -Wall -Wstrict-prototypes -O2 -mcall-prologues -DATTINY + +NICKLE=nickle + +PROG=microsplash-v1.0 + +SRC=$(ALTOS_SRC) +OBJ=$(SRC:.c=.o) + +V=0 +# The user has explicitly enabled quiet compilation. +ifeq ($(V),0) +quiet = @printf " $1 $2 $@\n"; $($1) +endif +# Otherwise, print the full command line. +quiet ?= $($1) + +all: $(PROG) $(PROG).hex + +CHECK=sh ../util/check-avr-mem + +$(PROG): Makefile $(OBJ) + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) + $(call quiet,CHECK) $(PROG) || ($(RM) -f $(PROG); exit 1) + +$(PROG).hex: $(PROG) + avr-size $(PROG) + $(OBJCOPY) -R .eeprom -O ihex $(PROG) $@ + + +load: $(PROG).hex + $(LOADCMD) $(LOADARG)$(PROG).hex + +load-slow: $(PROG).hex + $(LOADCMD) $(LOADSLOW) $(LOADARG)$(PROG).hex + +ao_product.h: ao-make-product.5c ../Version + $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ + +ao_product.o: ao_product.c ao_product.h + +%.o : %.c $(INC) + $(call quiet,CC) -c $(CFLAGS) $< + +distclean: clean + +clean: + rm -f *.o $(PROG) $(PROG).hex + rm -f ao_product.h + + +publish: $(PROG).hex + cp -a $(PROG).hex $(PUBLISH_FILE) + +load-product: + $(LOADCMD) $(LOADARG)$(PUBLISH_FILE) + +load-product-slow: + $(LOADCMD) $(LOADSLOW) $(LOADARG)$(PUBLISH_FILE) + +../altitude-pa.h: make-altitude-pa + nickle $< > $@ + +install: + +uninstall: + +$(OBJ): ao_product.h $(INC) diff --git a/src/microsplash/ao_pins.h b/src/microsplash/ao_pins.h new file mode 100644 index 00000000..37885ec2 --- /dev/null +++ b/src/microsplash/ao_pins.h @@ -0,0 +1,70 @@ +/* + * Copyright © 2011 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#ifndef _AO_PINS_H_ +#define _AO_PINS_H_ +#include + +#define AO_LED_ORANGE (1<<4) +#define AO_LED_SERIAL 4 +#define AO_LED_PANIC AO_LED_ORANGE +#define AO_LED_REPORT AO_LED_ORANGE +#define LEDS_AVAILABLE (AO_LED_ORANGE) +#define USE_SERIAL_1_STDIN 0 +#define HAS_USB 0 +#define PACKET_HAS_SLAVE 0 +#define HAS_SERIAL_1 0 +#define HAS_TASK 0 +#define HAS_MS5607 1 +#define HAS_MS5611 0 +#define HAS_EEPROM 0 +#define HAS_BEEP 0 +#define AVR_CLOCK 250000UL + +/* SPI */ +#define SPI_PORT PORTB +#define SPI_PIN PINB +#define SPI_DIR DDRB +#define AO_MS5607_CS_PORT PORTB +#define AO_MS5607_CS_PIN 3 + +/* MS5607 */ +#define AO_MS5607_SPI_INDEX 0 +#define AO_MS5607_MISO_PORT PORTB +#define AO_MS5607_MISO_PIN 0 +#define AO_MS5607_BARO_OVERSAMPLE 4096 +#define AO_MS5607_TEMP_OVERSAMPLE 1024 + +/* I2C */ +#define I2C_PORT PORTB +#define I2C_PIN PINB +#define I2C_DIR DDRB +#define I2C_PIN_SCL PINB2 +#define I2C_PIN_SDA PINB0 + +#define AO_CONST_ATTRIB PROGMEM +typedef int32_t alt_t; +#define FETCH_ALT(o) ((alt_t) pgm_read_dword(&altitude_table[o])) + +#define AO_ALT_VALUE(x) ((x) * (alt_t) 10) + +/* Pressure change (in Pa) to detect boost */ +#ifndef BOOST_DETECT +#define BOOST_DETECT 120 /* 10m at sea level, 12m at 2000m */ +#endif + +#endif /* _AO_PINS_H_ */ diff --git a/src/microwater/.gitignore b/src/microwater/.gitignore deleted file mode 100644 index 0573d989..00000000 --- a/src/microwater/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -ao_product.h -microwater-* diff --git a/src/microwater/Makefile b/src/microwater/Makefile deleted file mode 100644 index a49cda4b..00000000 --- a/src/microwater/Makefile +++ /dev/null @@ -1,121 +0,0 @@ -# -# Tiny AltOS build -# -# -vpath % ../attiny:../drivers:../kernel:../product:.. -vpath ao-make-product.5c ../util -vpath make-altitude-pa ../util - -include ../avr/Makefile.defs - -PUBLISH_DIR=$(HOME)/altusmetrumllc/Binaries -PUBLISH_FILE=$(PUBLISH_DIR)/$(PROG)-$(VERSION).hex - -MCU=attiny85 -DUDECPUTYPE=t85 -#PROGRAMMER=stk500v2 -P usb -LOADSLOW=-i 32 -B 32 -LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w: - -#LDFLAGS=-L$(LDSCRIPTS) -Tavr25.x - -ALTOS_SRC = \ - ao_micropeak.c \ - ao_spi_attiny.c \ - ao_led.c \ - ao_clock.c \ - ao_ms5607.c \ - ao_exti.c \ - ao_convert_pa.c \ - ao_report_micro.c \ - ao_notask.c \ - ao_eeprom_tiny.c \ - ao_panic.c \ - ao_log_micro.c \ - ao_async.c \ - ao_microflight.c \ - ao_microkalman.c - -INC=\ - ao.h \ - ao_pins.h \ - ao_arch.h \ - ao_arch_funcs.h \ - ao_exti.h \ - ao_ms5607.h \ - ao_log_micro.h \ - ao_micropeak.h \ - altitude-pa.h - -IDPRODUCT=0 -PRODUCT=MicroWater-v0.1 -PRODUCT_DEF=-DMICROPEAK -CFLAGS = $(PRODUCT_DEF) -I. -I../attiny -I../kernel -I.. -I../drivers -I../product -CFLAGS += -g -mmcu=$(MCU) -Wall -Wstrict-prototypes -O2 -mcall-prologues -DATTINY - -NICKLE=nickle - -PROG=microwater-v0.1 - -SRC=$(ALTOS_SRC) -OBJ=$(SRC:.c=.o) - -V=0 -# The user has explicitly enabled quiet compilation. -ifeq ($(V),0) -quiet = @printf " $1 $2 $@\n"; $($1) -endif -# Otherwise, print the full command line. -quiet ?= $($1) - -all: $(PROG) $(PROG).hex - -CHECK=sh ../util/check-avr-mem - -$(PROG): Makefile $(OBJ) - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) - $(call quiet,CHECK) $(PROG) || ($(RM) -f $(PROG); exit 1) - -$(PROG).hex: $(PROG) - avr-size $(PROG) - $(OBJCOPY) -R .eeprom -O ihex $(PROG) $@ - - -load: $(PROG).hex - $(LOADCMD) $(LOADARG)$(PROG).hex - -load-slow: $(PROG).hex - $(LOADCMD) $(LOADSLOW) $(LOADARG)$(PROG).hex - -ao_product.h: ao-make-product.5c ../Version - $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ - -ao_product.o: ao_product.c ao_product.h - -%.o : %.c $(INC) - $(call quiet,CC) -c $(CFLAGS) $< - -distclean: clean - -clean: - rm -f *.o $(PROG) $(PROG).hex - rm -f ao_product.h - - -publish: $(PROG).hex - cp -a $(PROG).hex $(PUBLISH_FILE) - -load-product: - $(LOADCMD) $(LOADARG)$(PUBLISH_FILE) - -load-product-slow: - $(LOADCMD) $(LOADSLOW) $(LOADARG)$(PUBLISH_FILE) - -../altitude-pa.h: make-altitude-pa - nickle $< > $@ - -install: - -uninstall: - -$(OBJ): ao_product.h $(INC) diff --git a/src/microwater/ao_pins.h b/src/microwater/ao_pins.h deleted file mode 100644 index 37885ec2..00000000 --- a/src/microwater/ao_pins.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright © 2011 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -#ifndef _AO_PINS_H_ -#define _AO_PINS_H_ -#include - -#define AO_LED_ORANGE (1<<4) -#define AO_LED_SERIAL 4 -#define AO_LED_PANIC AO_LED_ORANGE -#define AO_LED_REPORT AO_LED_ORANGE -#define LEDS_AVAILABLE (AO_LED_ORANGE) -#define USE_SERIAL_1_STDIN 0 -#define HAS_USB 0 -#define PACKET_HAS_SLAVE 0 -#define HAS_SERIAL_1 0 -#define HAS_TASK 0 -#define HAS_MS5607 1 -#define HAS_MS5611 0 -#define HAS_EEPROM 0 -#define HAS_BEEP 0 -#define AVR_CLOCK 250000UL - -/* SPI */ -#define SPI_PORT PORTB -#define SPI_PIN PINB -#define SPI_DIR DDRB -#define AO_MS5607_CS_PORT PORTB -#define AO_MS5607_CS_PIN 3 - -/* MS5607 */ -#define AO_MS5607_SPI_INDEX 0 -#define AO_MS5607_MISO_PORT PORTB -#define AO_MS5607_MISO_PIN 0 -#define AO_MS5607_BARO_OVERSAMPLE 4096 -#define AO_MS5607_TEMP_OVERSAMPLE 1024 - -/* I2C */ -#define I2C_PORT PORTB -#define I2C_PIN PINB -#define I2C_DIR DDRB -#define I2C_PIN_SCL PINB2 -#define I2C_PIN_SDA PINB0 - -#define AO_CONST_ATTRIB PROGMEM -typedef int32_t alt_t; -#define FETCH_ALT(o) ((alt_t) pgm_read_dword(&altitude_table[o])) - -#define AO_ALT_VALUE(x) ((x) * (alt_t) 10) - -/* Pressure change (in Pa) to detect boost */ -#ifndef BOOST_DETECT -#define BOOST_DETECT 120 /* 10m at sea level, 12m at 2000m */ -#endif - -#endif /* _AO_PINS_H_ */