From 46db120e2722b41b10b9fa78fca5f669bfc8fd47 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 25 Mar 2016 20:49:56 +0300 Subject: Initial udev rules and blink project --- .gitignore | 2 ++ 49-digispark.rules | 2 ++ blink/Makefile | 8 ++++++++ blink/blink.c | 16 ++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 .gitignore create mode 100644 49-digispark.rules create mode 100644 blink/Makefile create mode 100644 blink/blink.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb8a616 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +*.hex diff --git a/49-digispark.rules b/49-digispark.rules new file mode 100644 index 0000000..d7b4705 --- /dev/null +++ b/49-digispark.rules @@ -0,0 +1,2 @@ +SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666" +KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1" diff --git a/blink/Makefile b/blink/Makefile new file mode 100644 index 0000000..a5a366a --- /dev/null +++ b/blink/Makefile @@ -0,0 +1,8 @@ + +default: + # compile for attiny86 with warnings, optimizations, and 1 MHz clock frequency + avr-gcc -Wall -Os -DF_CPU=16500000L -mmcu=attiny85 -o blink.o blink.c + avr-objcopy -j .text -j .data -O ihex blink.o blink.hex + +clean: /dev/null + rm -f blink.o blink.hex diff --git a/blink/blink.c b/blink/blink.c new file mode 100644 index 0000000..d5c9ce7 --- /dev/null +++ b/blink/blink.c @@ -0,0 +1,16 @@ + +#include +#include +#include + + +int main() { + DDRB |= _BV(DDB1); + while (1) { + PORTB ^= _BV(PB1); + _delay_ms(100); + PORTB ^= _BV(PB1); + _delay_ms(900); + } +} + -- cgit v1.3.1