Skip to content

Commit 5649c6d

Browse files
committed
stick at arduino-cli 0.9.0 see arduino/arduino-cli#821
1 parent 7840190 commit 5649c6d

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

Diff for: .github/workflows/TestCompile.yml

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
# - digistump:avr:digispark-tiny # ATtiny85 board @16.5 MHz
4141
- digistump:avr:digispark-tiny16 # ATtiny85 board @16 MHz
4242
- digistump:avr:digispark-pro
43+
- digistump:avr:MHETtiny88 # Chinese MH-Tiny ATTiny88
4344

4445
# Specify parameters for each board.
4546
# With examples-exclude you may exclude specific examples for a board. Use a comma separated list.
@@ -76,6 +77,7 @@ jobs:
7677
- name: Compile all examples
7778
uses: ArminJo/arduino-test-compile@master
7879
with:
80+
cli-version: 0.9.0 # see https://github.com/arduino/arduino-cli/issues/821
7981
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
8082
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
8183
platform-default-url: ${{ env.PLATFORM_DEFAULT_URL }}

Diff for: README.md

+38
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,44 @@ You may also test the [t85_agressive bootloader](firmware/configuration#overview
4040
It works for my boards but the USB timing is not guaranteed as stable as in the other configurations.
4141
Do not forget to change the `upload.maximum_size` entry in *%localappdata%\Arduino15\packages\digistump\hardware\avr\1.6.8\boards.txt* to **6778**.<br/>
4242

43+
# Pin layout
44+
### ATtiny85 on Digispark
45+
46+
```
47+
+-\/-+
48+
RESET/ADC0 (D5) PB5 1| |8 VCC
49+
USB- ADC3 (D3) PB3 2| |7 PB2 (D2) INT0/ADC1 - default TX Debug output for ATtinySerialOut
50+
USB+ ADC2 (D4) PB4 3| |6 PB1 (D1) MISO/DO/AIN1/OC0B/OC1A/PCINT1 - (Digispark) LED
51+
GND 4| |5 PB0 (D0) OC0A/AIN0
52+
+----+
53+
USB+ and USB- are each connected to a 3.3 volt Zener to GND and with a 68 Ohm series resistor to the ATtiny pin.
54+
On boards with a micro USB connector, the series resistor is 22 Ohm instead of 68 Ohm.
55+
USB- has a 1k pullup resistor to indicate a low-speed device (standard says 1k5).
56+
USB+ and USB- are each terminated on the host side with 15k to 25k pull-down resistors.
57+
```
58+
59+
### ATtiny167 on Digispark pro
60+
Digital Pin numbers in braces are for ATTinyCore library
61+
62+
```
63+
+-\/-+
64+
RX 6 (D0) PA0 1| |20 PB0 (D8) 0 OC1AU
65+
TX 7 (D1) PA1 2| |19 PB1 (D9) 1 OC1BU - (Digispark) LED
66+
8 (D2) PA2 3| |18 PB2 (D10) 2 OC1AV
67+
INT1 9 (D3) PA3 4| |17 PB3 (D11) 4 OC1BV USB-
68+
AVCC 5| |16 GND
69+
AGND 6| |15 VCC
70+
10 (D4) PA4 7| |14 PB4 (D12) XTAL1
71+
11 (D5) PA5 8| |13 PB5 (D13) XTAL2
72+
12 (D6) PA6 9| |12 PB6 (D14) 3 INT0 USB+
73+
5 (D7) PA7 10| |11 PB7 (D15) RESET
74+
+----+
75+
USB+ and USB- are each connected to a 3.3 volt Zener to GND and with a 51 Ohm series resistor to the ATtiny pin.
76+
USB- has a 1k5 pullup resistor to indicate a low-speed device.
77+
USB+ and USB- are each terminated on the host side with 15k to 25k pull-down resistors.
78+
79+
```
80+
4381
## Oak board
4482
The Arduino ESP8266 core available with https://arduino.esp8266.com/stable/package_esp8266com_index.json supports the *Digistump Oak* board now, better use that.
4583

Diff for: digistump-avr/libraries/DigisparkKeyboard/DigiKeyboard.h

+21-2
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,30 @@ class DigiKeyboardDevice: public Print {
9898
sendKeyStroke(keyStroke, 0);
9999
}
100100

101+
void enableLEDFeedback() {
102+
sUseFeedbackLed = true;
103+
}
104+
105+
void disableLEDFeedback() {
106+
sUseFeedbackLed = false;
107+
}
108+
101109
//sendKeyStroke: sends a key press AND release with modifiers
102110
void sendKeyStroke(byte keyStroke, byte modifiers) {
111+
sendKeyStroke(keyStroke, modifiers,false);
112+
}
113+
114+
//sendKeyStroke: sends a key press AND release with modifiers
115+
void sendKeyStroke(byte keyStroke, byte modifiers, bool aUseFeedbackLed) {
116+
if(aUseFeedbackLed) {
117+
digitalWrite(LED_BUILTIN, HIGH);
118+
}
103119
sendKeyPress(keyStroke, modifiers);
104120
// This stops endlessly repeating keystrokes:
105121
sendKeyPress(0, 0);
122+
if(aUseFeedbackLed) {
123+
digitalWrite(LED_BUILTIN, LOW);
124+
}
106125
}
107126

108127
//sendKeyPress: sends a key press only - no release
@@ -173,12 +192,12 @@ class DigiKeyboardDevice: public Print {
173192
data = pgm_read_byte_near(keycodes_ascii + (chr - 0x20));
174193
}
175194
if (data) {
176-
sendKeyStroke(keycode_to_key(data), keycode_to_modifier(data));
195+
sendKeyStroke(keycode_to_key(data), keycode_to_modifier(data),sUseFeedbackLed);
177196
}
178197
return 1;
179198
}
180199

181-
//private: TODO: Make friend?
200+
bool sUseFeedbackLed = false;
182201
uchar reportBuffer[2]; // buffer for HID reports [ 1 modifier byte + (len-1) key strokes]
183202
using Print::write;
184203
};

0 commit comments

Comments
 (0)