mirror of
				https://github.com/Show-maket/IR-protocol.git
				synced 2025-10-30 10:32:35 +00:00 
			
		
		
		
	add pin change
This commit is contained in:
		| @ -6,7 +6,7 @@ | ||||
|     ((uint16_t)((dataBuffer[h] << 8) | dataBuffer[l]) >= IR_Broadcast)\ | ||||
|     ) | ||||
|  | ||||
| IR_Decoder::IR_Decoder(uint16_t addr, IR_Encoder* encPair = nullptr) : addrSelf(addr), encoder(encPair) { | ||||
| IR_Decoder::IR_Decoder(const uint8_t isrPin, uint16_t addr, IR_Encoder* encPair = nullptr) : isrPin(isrPin), addrSelf(addr), encoder(encPair) { | ||||
|     rawBuffer = new uint8_t[bufferRawSize] { 0 }; | ||||
|     prevRise = prevFall = prevPrevFall = prevPrevRise = 0; | ||||
|     start_RX(); | ||||
| @ -191,7 +191,7 @@ void IR_Decoder::isr() { // в прерывании вызываем isr() | ||||
|     } | ||||
|     if (frontCounter > 0) {     // в преамбуле | ||||
|         uint32_t risePeriod = micros() - prevRise; | ||||
|         if ((PIND >> 2) & 1 && risePeriod < IR_timeout) { //  __/``` ↑ и мы в внутри пакета | ||||
|         if ((PIND >> isrPin) & 1 && risePeriod < IR_timeout) { //  __/``` ↑ и мы в внутри пакета | ||||
|  | ||||
|             if (risePeriod < riseTimeMin << 1) { // fix рваной единицы | ||||
|                 frontCounter += 2; | ||||
| @ -210,7 +210,7 @@ void IR_Decoder::isr() { // в прерывании вызываем isr() | ||||
|     } | ||||
|  | ||||
|     // определить направление фронта | ||||
|     if ((PIND >> 2) & 1) {                  // Если __/``` ↑ | ||||
|     if ((PIND >> isrPin) & 1) {                  // Если __/``` ↑ | ||||
|  | ||||
|         uint16_t risePeriod = micros() - prevRise; | ||||
|         uint16_t highTime = micros() - prevFall; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user