Skip to content

Commit 9e1303b

Browse files
committed
Improved prints
1 parent c64b1c5 commit 9e1303b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+302
-325
lines changed

.github/workflows/LibraryBuild.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@
1010
# This is the name of the workflow, visible on GitHub UI.
1111
name: LibraryBuild
1212
on:
13+
workflow_dispatch: # To run it manually
14+
description: 'manual build check'
1315
push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
1416
paths:
1517
- '**.ino'
1618
- '**.cpp'
17-
- '**.h'
1819
- '**.hpp'
20+
- '**.h'
1921
- '**LibraryBuild.yml'
2022
pull_request:
2123
paths:
2224
- '**.ino'
2325
- '**.cpp'
24-
- '**.h'
2526
- '**.hpp'
27+
- '**.h'
2628
- '**LibraryBuild.yml'
2729

2830
jobs:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# PlatformIoPublish.yml
2+
# Github workflow script to publish a release to PlatformIo.
3+
#
4+
# Copyright (C) 2021 Armin Joachimsmeyer
5+
# https://github.com/ArminJo/Github-Actions
6+
#
7+
8+
# This is the name of the workflow, visible on GitHub UI.
9+
name: PlatformIo publishing
10+
on:
11+
workflow_dispatch: # To run it manually
12+
description: manual PlatformIo publishing
13+
release: # see: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#example-using-multiple-events-with-activity-types-or-configuration
14+
types:
15+
- created
16+
17+
jobs:
18+
publish:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install platformio
30+
- name: Build and publish
31+
env:
32+
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_TOKEN }}
33+
run: |
34+
pio package pack
35+
pio package publish --owner arminjo --non-interactive

examples/ControlRelay/ControlRelay.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <Arduino.h>
3535

3636
#if FLASHEND <= 0x1FFF // For 8k flash or less, like ATtiny85. Exclude exotic protocols.
37-
#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program space.
37+
#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
3838
#define EXCLUDE_EXOTIC_PROTOCOLS
3939
#endif
4040
/*
@@ -55,7 +55,7 @@ void setup() {
5555
pinMode(RELAY_PIN, OUTPUT);
5656

5757
Serial.begin(115200);
58-
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) || defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
58+
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/|| defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
5959
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
6060
#endif
6161
// Just to know which program is running on my Arduino
@@ -64,8 +64,9 @@ void setup() {
6464
// Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
6565
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
6666

67-
Serial.print(F("Ready to receive IR signals at pin "));
68-
Serial.println(IR_RECEIVE_PIN);
67+
Serial.print(F("Ready to receive IR signals of protocols: "));
68+
printActiveIRProtocols(&Serial);
69+
Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
6970
}
7071

7172
int on = 0;

examples/ControlRelay/PinDefinitionsAndMore.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* GNU General Public License for more details.
2121
*
2222
* You should have received a copy of the GNU General Public License
23-
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
23+
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
2424
*
2525
*/
2626

@@ -54,9 +54,7 @@
5454
#if defined(ESP8266)
5555
#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
5656
#define IR_RECEIVE_PIN 14 // D5
57-
#define IR_RECEIVE_PIN_STRING "D5"
5857
#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
59-
#define IR_SEND_PIN_STRING "D6"
6058
#define _IR_TIMING_TEST_PIN 13 // D7
6159
#define APPLICATION_PIN 0 // D3
6260

@@ -89,15 +87,17 @@ void noTone(uint8_t _pin){
8987
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
9088
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
9189
#define IR_RECEIVE_PIN PA6
92-
#define IR_RECEIVE_PIN_STRING "PA6"
9390
#define IR_SEND_PIN PA7
94-
#define IR_SEND_PIN_STRING "PA7"
9591
#define TONE_PIN PA3
96-
#define _IR_TIMING_TEST_PIN PA5
92+
#define _IR_TIMING_TEST_PIN PA5
9793
#define APPLICATION_PIN PA2
94+
# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
95+
// BluePill LED is active low
96+
#define FEEDBACK_LED_IS_ACTIVE_LOW
97+
# endif
9898

9999
#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board
100-
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". saves 370 bytes program space and 38 bytes RAM for digistump core
100+
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". saves 370 bytes program memory and 38 bytes RAM for digistump core
101101
#define IR_RECEIVE_PIN 0
102102
#define IR_SEND_PIN 4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
103103
#define TONE_PIN 3
@@ -119,7 +119,7 @@ void noTone(uint8_t _pin){
119119
# endif
120120

121121
#elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board
122-
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program space
122+
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory
123123
// Pin 6 is TX pin 7 is RX
124124
#define IR_RECEIVE_PIN 3 // INT1
125125
#define IR_SEND_PIN 4

examples/IRDispatcherDemo/IRCommandDispatcher.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Library to process IR commands by calling functions specified in a mapping array.
55
*
6-
* To run this example you need to install the "IRremote" library under "Tools -> Manage Libraries..." or "Ctrl+Shift+I"
6+
* To run this example you need to install the "IRremote" or "IRMP" library under "Tools -> Manage Libraries..." or "Ctrl+Shift+I"
77
*
88
* Copyright (C) 2019-2021 Armin Joachimsmeyer
99
@@ -23,11 +23,11 @@
2323
* GNU General Public License for more details.
2424
*
2525
* You should have received a copy of the GNU General Public License
26-
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
26+
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
2727
*/
2828

29-
#ifndef IR_COMMAND_DISPATCHER_H
30-
#define IR_COMMAND_DISPATCHER_H
29+
#ifndef _IR_COMMAND_DISPATCHER_H
30+
#define _IR_COMMAND_DISPATCHER_H
3131

3232
#include <stdint.h>
3333

@@ -103,5 +103,5 @@ class IRCommandDispatcher {
103103

104104
extern IRCommandDispatcher IRDispatcher;
105105

106-
#endif // IR_COMMAND_DISPATCHER_H
106+
#endif // _IR_COMMAND_DISPATCHER_H
107107
#pragma once

examples/IRDispatcherDemo/IRCommandDispatcher.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* GNU General Public License for more details.
3030
*
3131
* You should have received a copy of the GNU General Public License
32-
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
32+
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
3333
*/
3434
#ifndef _IR_COMMAND_DISPATCHER_HPP
3535
#define _IR_COMMAND_DISPATCHER_HPP

examples/IRDispatcherDemo/IRCommandMapping.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*
99
*/
1010

11-
#ifndef IR_COMMAND_MAPPING_H_
12-
#define IR_COMMAND_MAPPING_H_
11+
#ifndef _IR_COMMAND_MAPPING_H
12+
#define _IR_COMMAND_MAPPING_H
1313

1414
#include <Arduino.h>
1515
//#include "Commands.h" // includes all the commands used in the mapping arrays below
@@ -27,9 +27,9 @@
2727
#error "Please choose only one remote for compile"
2828
#endif
2929

30-
#ifdef USE_KEYES_REMOTE_CLONE
30+
#if defined(USE_KEYES_REMOTE_CLONE)
3131
#define IR_REMOTE_NAME "KEYES_CLONE"
32-
// Codes for the KEYES CLONE remote control with 17 Keys with number pad above direction control
32+
// Codes for the KEYES CLONE remote control with 17 keys with number pad above direction control
3333
#if defined(USE_IRMP_LIBRARY)
3434
#define IR_ADDRESS 0xFF00 // IRMP interprets NEC addresses always as 16 bit
3535
#else
@@ -81,7 +81,7 @@
8181

8282
#endif
8383

84-
#ifdef USE_KEYES_REMOTE
84+
#if defined(USE_KEYES_REMOTE)
8585
#define IR_REMOTE_NAME "KEYES"
8686
/*
8787
* FIRST:
@@ -191,6 +191,5 @@ const struct IRToCommandMappingStruct IRMapping[] =
191191
{ COMMAND_INCREASE_BLINK, IR_COMMAND_FLAG_REPEATABLE_NON_BLOCKING, &doIncreaseBlinkFrequency, increaseBlink },
192192
{ COMMAND_DECREASE_BLINK, IR_COMMAND_FLAG_REPEATABLE_NON_BLOCKING, &doDecreaseBlinkFrequency, decreaseBlink } };
193193

194-
#endif /* IR_COMMAND_MAPPING_H_ */
195-
194+
#endif / _IR_COMMAND_MAPPING_H
196195
#pragma once

examples/IRDispatcherDemo/IRDispatcherDemo.ino

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* GNU General Public License for more details.
2121
*
2222
* You should have received a copy of the GNU General Public License
23-
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
23+
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
2424
*
2525
*/
2626

@@ -115,7 +115,7 @@ void doTone2200();
115115
void setup() {
116116
pinMode(LED_BUILTIN, OUTPUT);
117117
Serial.begin(115200);
118-
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) || defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
118+
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/|| defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
119119
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
120120
#endif
121121
#if defined(ESP8266)
@@ -146,11 +146,7 @@ void setup() {
146146

147147
Serial.print(F("Ready to receive IR signals of protocols: "));
148148
irmp_print_active_protocols(&Serial);
149-
# if defined(ARDUINO_ARCH_STM32)
150-
Serial.println(F("at pin " IRMP_INPUT_PIN_STRING));
151-
# else
152149
Serial.println(F("at pin " STR(IRMP_INPUT_PIN)));
153-
# endif
154150

155151
# if defined(ALTERNATIVE_IR_FEEDBACK_LED_PIN)
156152
irmp_irsnd_LEDFeedback(true); // Enable receive signal feedback at ALTERNATIVE_IR_FEEDBACK_LED_PIN

examples/IRDispatcherDemo/PinDefinitionsAndMore.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* GNU General Public License for more details.
2121
*
2222
* You should have received a copy of the GNU General Public License
23-
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
23+
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
2424
*
2525
*/
2626

@@ -54,9 +54,7 @@
5454
#if defined(ESP8266)
5555
#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
5656
#define IR_RECEIVE_PIN 14 // D5
57-
#define IR_RECEIVE_PIN_STRING "D5"
5857
#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
59-
#define IR_SEND_PIN_STRING "D6"
6058
#define _IR_TIMING_TEST_PIN 13 // D7
6159
#define APPLICATION_PIN 0 // D3
6260

@@ -89,15 +87,17 @@ void noTone(uint8_t _pin){
8987
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
9088
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
9189
#define IR_RECEIVE_PIN PA6
92-
#define IR_RECEIVE_PIN_STRING "PA6"
9390
#define IR_SEND_PIN PA7
94-
#define IR_SEND_PIN_STRING "PA7"
9591
#define TONE_PIN PA3
96-
#define _IR_TIMING_TEST_PIN PA5
92+
#define _IR_TIMING_TEST_PIN PA5
9793
#define APPLICATION_PIN PA2
94+
# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
95+
// BluePill LED is active low
96+
#define FEEDBACK_LED_IS_ACTIVE_LOW
97+
# endif
9898

9999
#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board
100-
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". saves 370 bytes program space and 38 bytes RAM for digistump core
100+
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". saves 370 bytes program memory and 38 bytes RAM for digistump core
101101
#define IR_RECEIVE_PIN 0
102102
#define IR_SEND_PIN 4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
103103
#define TONE_PIN 3
@@ -119,7 +119,7 @@ void noTone(uint8_t _pin){
119119
# endif
120120

121121
#elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board
122-
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program space
122+
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory
123123
// Pin 6 is TX pin 7 is RX
124124
#define IR_RECEIVE_PIN 3 // INT1
125125
#define IR_SEND_PIN 4

examples/IRremoteExtensionTest/IRremoteExtensionTest.ino

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IRExtensionClass IRExtension(&IrReceiver);
1919

2020
void setup() {
2121
Serial.begin(115200);
22-
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) || defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
22+
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/|| defined(SERIALUSB_PID) || defined(ARDUINO_attiny3217)
2323
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
2424
#endif
2525
// Just to know which program is running on my Arduino
@@ -29,12 +29,9 @@ void setup() {
2929
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
3030

3131

32-
Serial.print(F("Ready to receive IR signals at pin "));
33-
#if defined(ARDUINO_ARCH_STM32) || defined(ESP8266)
34-
Serial.println(IR_RECEIVE_PIN_STRING);
35-
#else
36-
Serial.println(IR_RECEIVE_PIN);
37-
#endif
32+
Serial.print(F("Ready to receive IR signals of protocols: "));
33+
printActiveIRProtocols(&Serial);
34+
Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
3835

3936
}
4037

0 commit comments

Comments
 (0)