aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-06-30 17:18:49 +0200
committerKarel Kočí <cynerd@email.cz>2016-06-30 17:18:49 +0200
commit4e1ce86af16307bf7d42657db07600867c7c4bbc (patch)
tree5d0dfddea221c91545a9bd57ac7face5842291d4 /examples
parent147cb7f0e67d1f3c3274effa5476607e24664182 (diff)
downloadavr-ioe-4e1ce86af16307bf7d42657db07600867c7c4bbc.tar.gz
avr-ioe-4e1ce86af16307bf7d42657db07600867c7c4bbc.tar.bz2
avr-ioe-4e1ce86af16307bf7d42657db07600867c7c4bbc.zip
Add some more progress and split non-core functionality to separate repo
More progress to implementation and some changes in project it self. This library will implement only drivers for features on chip but nothing else. Everything connected externally is now in separate repository.
Diffstat (limited to 'examples')
-rw-r--r--examples/blink/blink.c6
-rw-r--r--examples/blink/build/config.h1
-rw-r--r--examples/dht22usart/dht22.c26
-rw-r--r--examples/dht22usart/makefile40
4 files changed, 4 insertions, 69 deletions
diff --git a/examples/blink/blink.c b/examples/blink/blink.c
index 8386d4b..6a81aee 100644
--- a/examples/blink/blink.c
+++ b/examples/blink/blink.c
@@ -3,12 +3,12 @@
#include <ioport.h>
int main() {
- io_setout(IO_B3);
+ io_setout(IO_B0);
while (1) {
- io_hight(IO_B3);
+ io_hight(IO_B0);
_delay_ms(500);
- io_low(IO_B3);
+ io_low(IO_B0);
_delay_ms(500);
}
}
diff --git a/examples/blink/build/config.h b/examples/blink/build/config.h
new file mode 100644
index 0000000..5fff870
--- /dev/null
+++ b/examples/blink/build/config.h
@@ -0,0 +1 @@
+#define CONFIG_IOPORTS y
diff --git a/examples/dht22usart/dht22.c b/examples/dht22usart/dht22.c
deleted file mode 100644
index ec643aa..0000000
--- a/examples/dht22usart/dht22.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <avr/io.h>
-#include <avr/interrupt.h>
-#include <util/delay.h>
-#include <string.h>
-#include "../../usart.h"
-//#include "../../sensor_dht22.h"
-
-void rec(uint8_t data) {
- if (data == '\r') {
- // TODO read sensor and send data
- }
-}
-
-const struct dht22_port dht22_ports[] = {
- {&DDRC, &PORTC, &PINC, _BV(PORTC4), NULL, 0}
-};
-
-int main() {
- //usart_async_open();
- //sei();
- //usart_receive = rec;
- //dht22_init(0);
-
- timer_init(COUNTER0_PWM);
- while (1);
-}
diff --git a/examples/dht22usart/makefile b/examples/dht22usart/makefile
deleted file mode 100644
index fb69068..0000000
--- a/examples/dht22usart/makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-MAKEFLAGS += --no-builtin-rules
-
-MMCU = atmega328p
-F_CPU = 16000000L
-IOE_PREFIX = ../..
-IOE_SHORTOUTPUT=y
-IOE_CFLAGS = -Os -ffunction-sections -fdata-sections -fshort-enums -Wall \
- -DF_CPU=$(F_CPU) -mmcu=$(MMCU) \
- -DCONFIG_IOE_USART \
- -DCONFIG_IOE_USART_OUTBUFFER_SIZE=64 \
- -DCONFIG_IOE_USART_OUTBUFFER_MODE=0 \
- -DCONFIG_IOE_USART_OUTFILE \
- -DCONFIG_IOE_USART_BAUD=115200 \
- -DCONFIG_IOE_USART_PARITY=USART_PARITY_NONE \
- -DCONFIG_IOE_USART_STOPBIT=USART_STOPBIT_SINGLE \
- -DCONFIG_IOE_USART_DATABITS=8 \
- -DCONFIG_IOE_TIMERS \
- -DCONFIG_IOE_SENSOR_DHT22 \
- -DCONFIG_IOE_SENSOR_DHT22_TIMER=COUNTER0_PWM
-
-all: dht22.hex
- @echo Now you can flash dht22.hex to your chip.
-
-clean: ioeclean
- $(RM) dht22.o
- $(RM) dht22.elf dht22.hex
-
-include ../../avr-ioe.mk
-
-dht22.elf: %.elf: $(IOE_OBJ) dht22.o
- @echo " LD $@"
- @avr-gcc -Os -mmcu=$(MMCU) $^ -o $@
-
-dht22.hex: %.hex: %.elf
- @echo " OBJCOPY $@"
- @avr-objcopy -O ihex -R .eeprom $< $@
-
-dht22.o: %.o: %.c
- @echo " CC $@"
- @avr-gcc $(IOE_CFLAGS) -c -o $@ $<