Skip to content

Commit

Permalink
No leading space when sending without wait. See #76
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Dec 21, 2022
1 parent 3291d0c commit f77b6bd
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 90 deletions.
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
<div align = center>

# [IRMP](https://github.com/IRMP-org/IRMP) - Infrared Multi Protocol Decoder + Encoder
Available as Arduino library "IRMP"
A library enabling the sending & receiving of infra-red signals. Supports 50 different protocols with a low memory footprint.

[![Badge License: GPLv3](https://img.shields.io/badge/License-GPLv3-brightgreen.svg)](https://www.gnu.org/licenses/gpl-3.0)
&nbsp; &nbsp;
[![Badge Version](https://img.shields.io/github/v/release/IRMP-org/IRMP?include_prereleases&color=yellow&logo=DocuSign&logoColor=white)](https://github.com/IRMP-org/IRMP/releases/latest)
&nbsp; &nbsp;
[![Badge Commits since latest](https://img.shields.io/github/commits-since/IRMP-org/IRMP/latest?color=yellow)](https://github.com/IRMP-org/IRMP/commits/master)
&nbsp; &nbsp;
[![Badge Build Status](https://github.com/IRMP-org/IRMP/workflows/LibraryBuild/badge.svg)](https://github.com/IRMP-org/IRMP/actions)
&nbsp; &nbsp;
![Badge Hit Counter](https://visitor-badge.laobi.icu/badge?page_id=IRMP-org_IRMP)
<br/>
<br/>
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)

### [Version 3.6.3](https://github.com/IRMP-org/IRMP/archive/master.zip) - work in progress
Available as [Arduino library "IRMP"](https://www.arduinolibraries.info/libraries/irmp).

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Installation instructions](https://www.ardu-badge.com/badge/irmp.svg?)](https://www.ardu-badge.com/IRMP)
[![Commits since latest](https://img.shields.io/github/commits-since/IRMP-org/IRMP/latest)](https://github.com/IRMP-org/IRMP/commits/master)
[![Build Status](https://github.com/IRMP-org/IRMP/workflows/LibraryBuild/badge.svg)](https://github.com/IRMP-org/IRMP/actions)
![Hit Counter](https://visitor-badge.laobi.icu/badge?page_id=ukw100_IRMP)
[![Button Install](https://img.shields.io/badge/Install-brightgreen?logoColor=white&logo=GitBook)](https://www.ardu-badge.com/IRMP)
&nbsp; &nbsp;
[![Button Changelog](https://img.shields.io/badge/Changelog-blue?logoColor=white&logo=AzureArtifacts)](https://github.com/IRMP-org/IRMP#revision-history)

</div>

## 50 IR protocols supported and low memory footprint
- Only 39 protocols can be enabled for receive at the same time, because some of them are quite similar and conflicts with each other.

# Features
- Total of 50 IR protocols supported.
- Up to 39 protocols can be enabled for receive at the same time, because some of the 50 protocols are quite similar and conflicts with each other.
- 39 protocols are available for send.
- FLASH usage in bytes: 1500 for one protocol, 4300 for 15 main and 8000 for all 39 protocols.
- Low memory footprint. FLASH usage in bytes: 1500 for one protocol, 4300 for 15 main and 8000 for all 39 protocols.
- RAM usage in bytes: 52, 73 and 100.

| Nano running AllProtocol example | YouTube Video | Instructable |
Expand Down Expand Up @@ -327,12 +343,13 @@ The **tone library (using timer 2) is still available**. You can use it alternat
- Fixed FEEDBACK_LED_IS_ACTIVE_LOW bug.
- Added Kaseikyo Panasonic decode.
- Added ATtiny88 / AVR timer1 timer support.
- Fixed unexpected leading space for irsnd_send_data(...,false).
### Version 3.6.1
- Fixed NO_LED_FEEDBACK_CODE bug.
### Version 3.6.0
- Improved timings by Jörg R.
- Improved timings by Jörg R.
- Support for NEC 8 bit address.
- Fixed ATmega4809 bug.
- RP2040 support added.
Expand Down
2 changes: 1 addition & 1 deletion examples/AllProtocols/AllProtocols.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Uses a callback function which is called every time a complete IR command was received.
* Prints data to LCD connected parallel at pin 4-9 or serial at pin A4, A5
*
* Copyright (C) 2019-2021 Armin Joachimsmeyer
* Copyright (C) 2019-2022 Armin Joachimsmeyer
* armin.joachimsmeyer@gmail.com
*
* This file is part of IRMP https://github.com/IRMP-org/IRMP.
Expand Down
2 changes: 1 addition & 1 deletion examples/Callback/Callback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Uses a callback function which is called every time a complete IR command was received.
* This example additionally filters commands from a remote control named WM010 sending NEC commands
*
* Copyright (C) 2019-2020 Armin Joachimsmeyer
* Copyright (C) 2019-2022 Armin Joachimsmeyer
* armin.joachimsmeyer@gmail.com
*
* This file is part of IRMP https://github.com/IRMP-org/IRMP.
Expand Down
2 changes: 1 addition & 1 deletion examples/Interrupt/Interrupt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* If you get warnings of redefining symbols, just ignore them or undefine them first (see Interrupt example).
* The exact names can be found in the library file irmpSelectAllProtocols.h (see Callback example).
*
* Copyright (C) 2019-2021 Armin Joachimsmeyer
* Copyright (C) 2019-2022 Armin Joachimsmeyer
* armin.joachimsmeyer@gmail.com
*
* This file is part of IRMP https://github.com/IRMP-org/IRMP.
Expand Down
5 changes: 3 additions & 2 deletions examples/SimpleSender/SimpleSender.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SimpleSender.cpp
*
* Sends Samsung protocol frames.
* Sends NEC or Samsung protocol frames.
* Is able to send IR protocol data of 15 main protocols.
*
* Sony SIRCS
Expand Down Expand Up @@ -50,7 +50,8 @@
#define IRSND_PROTOCOL_NAMES 1 // Enable protocol number mapping to protocol strings - requires some FLASH.

#include <irsndSelectMain15Protocols.h>
// or use only one protocol to save programming space
// or disable #include <irsndSelectMain15Protocols.h> and use only one protocol to save programming space
//#define IRSND_SUPPORT_NEC_PROTOCOL 1
//#define IRSND_SUPPORT_NEC_PROTOCOL 1

/*
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version=3.6.2
author=Frank Meyer, Armin Joachimsmeyer
maintainer=Armin Joachimsmeyer <armin.arduino@gmail.com>, frank@fli4l.de
sentence=Receive and send infrared signals.<br/>
paragraph=<ul><li>Supports <b>50 different IR and 3 RF protocols</b>.</li><li>Can receive <b>40 protocols concurrently</b>.</li><li><b>Small</b> footprint and <b>robust</b> decoding.</li><li>Receive and send can be used in the <b>same sketch.</b></li><li>Supports ATtiny, AVR and MegaAVR boards as well as ESP8266, ESP32, STM32, SAMD, RP2040 and Apollo boards.</li></ul><br/><br/><b>New: </b>Added ATtiny88 / AVR timer1 timer support.</b><br/>
paragraph=<ul><li>Supports <b>50 different IR and 3 RF protocols</b>.</li><li>Can receive <b>40 protocols concurrently</b>.</li><li><b>Small</b> footprint and <b>robust</b> decoding.</li><li>Receive and send can be used in the <b>same sketch.</b></li><li>Supports ATtiny, AVR and MegaAVR boards as well as ESP8266, ESP32, STM32, SAMD, RP2040 and Apollo boards.</li></ul><br/><br/><b>New: </b>Added ATtiny88 / AVR timer1 timer support. Fixed send timing bug.<br/>
category=Signal Input/Output
url=https://github.com/IRMP-org/IRMP
architectures=avr,megaavr,samd,esp8266,esp32,stm32,STM32F1,apollo3,mbed,mbed_nano,rp2040
Expand Down
17 changes: 12 additions & 5 deletions src/IRTimer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ uint16_t sTimerCompareCapureValue;
* But for AVR saving the timer settings is possible anyway, since it only consists of saving registers.
* This helps cooperation with other libraries using the same timer.
*/
void storeIRTimer(void) {
void storeIRTimer(void)
{
#if defined(__AVR_ATmega16__)
sTimerTCCRA = TCCR2;
sTimerOCR = OCR2;
Expand Down Expand Up @@ -471,7 +472,8 @@ void storeIRTimer(void) {
/*
* Restore settings of the timer e.g. for IRSND
*/
void restoreIRTimer(void) {
void restoreIRTimer(void)
{
#if defined(__AVR_ATmega16__)
TCCR2 = sTimerTCCRA;
OCR2 = sTimerOCR;
Expand Down Expand Up @@ -585,7 +587,8 @@ void restoreIRTimer(void) {
* NOT used if IRMP_ENABLE_PIN_CHANGE_INTERRUPT is defined
* Initialize timer to generate interrupts at a rate F_INTERRUPTS (15000) per second to poll the input pin.
*/
void disableIRTimerInterrupt(void) {
void disableIRTimerInterrupt(void)
{
#if defined(__AVR__)
// Use Timer 2
# if defined(__AVR_ATmega16__)
Expand Down Expand Up @@ -661,7 +664,8 @@ void disableIRTimerInterrupt(void) {
}

// used by AllProtocols example
void enableIRTimerInterrupt(void) {
void enableIRTimerInterrupt(void)
{
#if defined(__AVR__)
// Use Timer 2
# if defined(__AVR_ATmega16__)
Expand Down Expand Up @@ -875,13 +879,16 @@ void irmp_timer_ISR(void)
// This in turn calls irsnd_on() or irsnd_off(). Empty call requires additional 0.7 us.
if (!irsnd_ISR())
{
// End of frame
restoreIRTimer();
# if ! defined(USE_ONE_TIMER_FOR_IRMP_AND_IRSND)
// only send mode required -> disable interrupt
disableIRTimerInterrupt();
# endif
sDivider = 1; // to call irsnd_ISR() directly at next interrupt
} else {
sDivider = 4;
}
sDivider = 4;
}
} // if(irsnd_busy)
#endif // defined(_IRSND_H_) || defined(USE_ONE_TIMER_FOR_IRMP_AND_IRSND)
Expand Down
2 changes: 1 addition & 1 deletion src/irsnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@

#define IRSND_NO_REPETITIONS 0 // no repetitions
#define IRSND_MAX_REPETITIONS 14 // max # of repetitions
#define IRSND_ENDLESS_REPETITION 15 // endless repetions
#define IRSND_ENDLESS_REPETITION 15 // endless repetitions
#define IRSND_REPETITION_MASK 0x0F // lower nibble of flags
#define IRSND_RAW_REPETITION_FRAME 0x10 // send one or more raw repetition frames, yet only used for NEC
#define IRSND_SUPPRESS_TRAILER 0x20 // suppress trailer
Expand Down
Loading

0 comments on commit f77b6bd

Please sign in to comment.