Skip to content

Commit 07658e7

Browse files
committed
Libraries updated
1 parent 50e7db2 commit 07658e7

File tree

4 files changed

+64
-14
lines changed

4 files changed

+64
-14
lines changed

src/utils/ATtinySerialOut.cpp renamed to examples/WhistleSwitch/ATtinySerialOut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* 1 Start, 8 Data, 1 Stop, No Parity
88
*
99
* Using PB2 // (Pin7 on Tiny85) as default TX pin to be compatible with digispark board
10-
* To change the output pin, modify line 38 in TinySerialOut.h or or set it as compiler symbol like "-DTX_PIN PB1".
10+
* To change the output pin, modify the line "#define TX_PIN ..." in TinySerialOut.h or or set it as compiler symbol like "-DTX_PIN PB1".
1111
*
1212
* Using the Serial.print commands needs 4 bytes extra for each call.
1313
*

src/ATtinySerialOut.h renamed to examples/WhistleSwitch/ATtinySerialOut.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@
3030
// PCINT4/XTAL2/CLKO/OC1B/ADC2 (D4) PB4 3| |6 PB1 (D1) MISO/DO/AIN1/OC0B/OC1A/PCINT1
3131
// GND 4| |5 PB0 (D0) MOSI/DI/SDA/AIN0/OC0A/!OC1A/AREF/PCINT0
3232
// +----+
33+
34+
// ATMEL ATTINY167
35+
//
36+
// +-\/-+
37+
// RX 6 (D 0) PA0 1| |20 PB0 (D 8) 0 OC1AU TONE Timer 1 Channel A
38+
// TX 7 (D 1) PA1 2| |19 PB1 (D 9) 1 OC1BU Internal LED
39+
// 8 (D 2) PA2 3| |18 PB2 (D 10) 2 OC1AV Timer 1 Channel B
40+
// INT1 9 (D 3) PA3 4| |17 PB3 (D 11) 4 OC1BV connected with 51 Ohm to D- and 3.3 volt Zener.
41+
// AVCC 5| |16 GND
42+
// AGND 6| |15 VCC
43+
// 10 (D 4) PA4 7| |14 PB4 (D 12) XTAL1
44+
// 11 (D 5) PA5 8| |13 PB5 (D 13) XTAL2
45+
// 12 (D 6) PA6 9| |12 PB6 (D 14) 3 INT0 connected with 68 Ohm to D+ (and disconnected 3.3 volt Zener). Is terminated with ~20 kOhm if USB attached :-(
46+
// 5 (D 7) PA7 10| |11 PB7 (D 15)
47+
// +----+
48+
//
49+
3350
#ifndef TINY_SERIAL_OUT_H_
3451
#define TINY_SERIAL_OUT_H_
3552

@@ -51,7 +68,7 @@
5168
*/
5269
#if defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
5370
#ifndef TX_PIN
54-
#define TX_PIN PA1 // (package pin 2 on Tiny167) - can use one of PA0 to PA7 here
71+
#define TX_PIN PA1 // (package pin 2 / TXD on Tiny167) - can use one of PA0 to PA7 here
5572
#endif
5673
#ifndef TX_PORT
5774
#define TX_PORT PORTA
@@ -205,3 +222,5 @@ extern TinySerialOut Serial;
205222
#endif // defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
206223

207224
#endif /* TINY_SERIAL_OUT_H_ */
225+
226+
#pragma once

src/utils/ATtinyUtils.cpp renamed to examples/WhistleSwitch/ATtinyUtils.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
/*
2-
* TinyUtils.cpp
2+
* ATtinyUtils.cpp
3+
*
4+
* Copyright (C) 2018-2020 Armin Joachimsmeyer
5+
* Email: armin.joachimsmeyer@gmail.com
6+
*
7+
* This file is part of ArduinoUtils https://github.com/ArminJo/ArduinoUtils.
8+
*
9+
* ArduinoUtils is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
321
*
4-
* Created on: 05.03.2018
5-
* Author: Armin
622
*/
723
#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
824

@@ -16,8 +32,6 @@
1632
#include <avr/boot.h> // needed for boot_signature_byte_get()
1733
#include <avr/power.h> // needed for clock_prescale_set()
1834
#include <avr/sleep.h> // needed for isBODSFlagExistent()
19-
#include <avr/io.h>
20-
#include <avr/interrupt.h> // for sei() + cli()
2135
#include "digitalWriteFast.h"
2236

2337
// since we have not included Arduino.h

src/ATtinyUtils.h renamed to examples/WhistleSwitch/ATtinyUtils.h

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
/*
2-
* TinyUtils.h
2+
* ATtinyUtils.h
3+
*
4+
* Copyright (C) 2018-2020 Armin Joachimsmeyer
5+
* Email: armin.joachimsmeyer@gmail.com
6+
*
7+
* This file is part of ArduinoUtils https://github.com/ArminJo/ArduinoUtils.
8+
*
9+
* ArduinoUtils is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
321
*
4-
* Created on: 05.03.2018
5-
* Copyright (C) 2018 Armin Joachimsmeyer
6-
* armin.joachimsmeyer@gmail.com
722
*/
823

924
//
@@ -15,8 +30,8 @@
1530
// PCINT4/XTAL2/CLKO/OC1B/ADC2 (D4) PB4 3| |6 PB1 (D1) MISO/DO/AIN1/OC0B/OC1A/PCINT1 / TX Debug output
1631
// GND 4| |5 PB0 (D0) MOSI/DI/SDA/AIN0/OC0A/!OC1A/AREF/PCINT0
1732
// +----+
18-
#ifndef TINYUTILS_H_
19-
#define TINYUTILS_H_
33+
#ifndef ATTINYUTILS_H_
34+
#define ATTINYUTILS_H_
2035

2136
#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
2237

@@ -82,4 +97,6 @@ bool isBODSFlagExistent();
8297
void changeDigisparkClock();
8398

8499
#endif // defined (__AVR_ATtiny85__)
85-
#endif /* TINYUTILS_H_ */
100+
#endif /* ATTINYUTILS_H_ */
101+
102+
#pragma once

0 commit comments

Comments
 (0)