Проверка в analogWrite(), добавление экземпляров для Wire, SPI, Serial #21

Merged
klassents merged 12 commits from v0.5.1_editing into v0.5.1 2025-05-27 12:35:38 +03:00
6 changed files with 12 additions and 3 deletions
Showing only changes of commit 2a561ad0ed - Show all commits

View File

@ -8,10 +8,13 @@
#include "wiring_LL.h"
// HardwareSerial class objects for use in Arduino IDE
HardwareSerial Serial(0);
HardwareSerial Serial0(0);
#if SERIAL_PORT_QTY > 1
HardwareSerial Serial1(1);
#endif
// default interface
HardwareSerial& Serial = DEFAULT_SERIAL;
void serialEvent() __attribute__((weak));
bool Serial0_available() __attribute__((weak));
@ -144,7 +147,7 @@ extern "C" void __attribute__((optimize("O3"))) serial_interrupt_handler(uint8_t
{
if (uartNumInt == 0)
{
Serial.rx_complete_irq();
Serial0.rx_complete_irq();
}
else if ((uartNumInt == 1) && (SERIAL_PORT_QTY > 1))
{

View File

@ -103,10 +103,12 @@ class HardwareSerial : public Stream
inline void rx_complete_irq(void) __attribute__((always_inline, optimize("O3")));
};
extern HardwareSerial Serial;
extern HardwareSerial Serial0;
#if SERIAL_PORT_QTY > 1
extern HardwareSerial Serial1;
#endif
// default interface
extern HardwareSerial& Serial;
extern void serialEventRun(void) __attribute__((weak));

View File

@ -81,6 +81,7 @@ void additionalPinsDeinit(uint32_t PinNumber);
// UART
// available uarts quantity
#define SERIAL_PORT_QTY 2
#define DEFAULT_SERIAL Serial0
// ADC
#define MCU_ADC_RESOLUTION 12 // bits

View File

@ -76,6 +76,7 @@ static inline void additionalPinsDeinit(uint32_t PinNumber){}
// UART
// available uarts quantity
#define SERIAL_PORT_QTY 2
#define DEFAULT_SERIAL Serial0
// ADC
#define MCU_ADC_RESOLUTION 12 // bits

View File

@ -109,6 +109,7 @@ static inline void additionalPinsDeinit(uint32_t PinNumber){}
// UART
// available uarts quantity
#define SERIAL_PORT_QTY 2
#define DEFAULT_SERIAL Serial0
// ADC
#define MCU_ADC_RESOLUTION 12 // bits

View File

@ -122,6 +122,7 @@ static inline void additionalPinsDeinit(uint32_t PinNumber){}
// UART
// available uarts quantity
#define SERIAL_PORT_QTY 2
#define DEFAULT_SERIAL Serial0
// ADC
#define MCU_ADC_RESOLUTION 12 // bits