@MAJSTER XXL .
Throw IR taska priority to 0 on Core 1
syntax (task, name, memory reserve, NULL, priority, NULL, Core)
Otherwise it blocks the operation of the radio because it keeps looking for code.
I threw in the volume control for a test and it works. Code below.
It flies in the main loop. On me on this RC-406 the code VolumeUp is 0x14, VolumeDown is 0x15
The problem is when you hold the button down for a long while it dumps the RMT driver.
By the way I think you need to create void functions for: VolumeUp, VolumeDown, BankUp, BankDown.
More and more often whether in the web server or remote control it copies the same blocks and you can just cancel.
I have another old NEC IR receive function that was also dumping EPS but I have corrected it and it is test running on the other board. I will check this one further.
The code is for the one based on Freenove.
.
Throw IR taska priority to 0 on Core 1
syntax (task, name, memory reserve, NULL, priority, NULL, Core)
xTaskCreatePinnedToCore(ir_task, "ir_task", 2048, NULL, 0, NULL, 1);
Otherwise it blocks the operation of the radio because it keeps looking for code.
I threw in the volume control for a test and it works. Code below.
It flies in the main loop. On me on this RC-406 the code VolumeUp is 0x14, VolumeDown is 0x15
The problem is when you hold the button down for a long while it dumps the RMT driver.
By the way I think you need to create void functions for: VolumeUp, VolumeDown, BankUp, BankDown.
More and more often whether in the web server or remote control it copies the same blocks and you can just cancel.
I have another old NEC IR receive function that was also dumping EPS but I have corrected it and it is test running on the other board. I will check this one further.
The code is for the one based on Freenove.
if(ir_recv.nec_available())
{
if (ir_recv.data() != 0xffffffff)
{
Serial.printf("IR Protocol:%s, IR Code: %#x\r\n", ir_recv.protocol(), ir_recv.data());
dataIr = reverse_bits(ir_recv.data(),32);
address = (dataIr & 0xFF);
command = (dataIr >> 16);
Serial.printf("data:%#x\r\n",dataIr);
Serial.printf("address:%#x\r\n",address);
Serial.printf("command:%#x\r\n",command);
displayStartTime = millis();
timeDisplay = false;
volumeSet = true;
displayActive = true;
if ((address == 185) && (command == 14))
{
Serial.println("Volume UP");
volumeValue++;
if (volumeValue > 21) {
volumeValue = 21;
}
Serial.print("Wartość głośności: ");
Serial.println(volumeValue);
audio.setVolume(volumeValue); // zakres 0...21
// Używamy funkcji String() do konwersji liczby na tekst
String volumeValueStr = String(volumeValue); // Zamiana liczby VOLUME na ciąg znaków
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_fub14_tf);
u8g2.drawStr(65, 33, "VOLUME");
u8g2.drawStr(163, 33, volumeValueStr.c_str());
u8g2.drawRFrame(21, 42, 214, 14, 3); // Rysujmey ramke dla progress bara głosnosci
u8g2.drawRBox(23, 44, volumeValue * 10, 10, 2); // Progress bar głosnosci
u8g2.sendBuffer();
}
if ((address == 185) && (command == 15))
{
Serial.println("Volume Down");
volumeValue--;
if (volumeValue < 1) {
volumeValue = 1;
}
Serial.print("Wartość głośności: ");
Serial.println(volumeValue);
audio.setVolume(volumeValue); // zakres 0...21
// Używamy funkcji String() do konwersji liczby na tekst
String volumeValueStr = String(volumeValue); // Zamiana liczby VOLUME na ciąg znaków
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_fub14_tf);
u8g2.drawStr(65, 33, "VOLUME");
u8g2.drawStr(163, 33, volumeValueStr.c_str());
u8g2.drawRFrame(21, 42, 214, 14, 3); // Rysujmey ramke dla progress bara głosnosci
u8g2.drawRBox(23, 44, volumeValue * 10, 10, 2); // Progress bar głosnosci
u8g2.sendBuffer();
}
address = 0; // zerujemy kod pilota IR
command = 0;
}
}