- в модулях Wire, SPI, Serial приведена в соответствие нумерация используемых экземпляров и периферии микроконтроллера.
- в функции analogWrite() перед запуском ШИМ проверяется, не запущен ли уже указанный канал.
- добавлена возможность переопределения функции main() в скетчах.
- при старте программы задается граница кэшируемой области SPIFI в соответствии с размером текущего исполняемого кода.
- исправление выявленных ошибок.
Co-authored-by: KLASSENTS <klassen@elron.tech>
Co-committed-by: KLASSENTS <klassen@elron.tech>
This commit was merged in pull request #25.
This commit is contained in:
klassents authored and klassents committed 2025-05-30 12:24:08 +03:00
1 parent f1e091bf77
commit eb9b1aa0c9
37 files changed
+248 -156

No files matched your search

+1 -1
View File
@@ -94,7 +94,7 @@ struct EEPROMClass{
uint16_t length() { return (uint16_t)EEPROM_LENGHT; }
template< typename T >
T &put(int idx, T &data)
const T &put(int idx, const T &data)
{
void* dataPointer = (void*)&data;
// check if idx is valid
+4 -2
View File
@@ -1,9 +1,11 @@
#include "SPI.h"
SPIClass SPI(1);
SPIClass SPI1(1);
#if SPI_COMMON_QTY > 1
SPIClass SPI1(0);
SPIClass SPI0(0);
#endif
// default interface
SPIClass& SPI = DEFAULT_SPI;
static uint8_t reverse_bits(uint8_t byte);
+4 -2
View File
@@ -127,9 +127,11 @@ public:
void setClockDivider(uint8_t clockDiv);
};
extern SPIClass SPI;
#if SPI_COMMON_QTY > 1
extern SPIClass SPI1;
#if SPI_COMMON_QTY > 1
extern SPIClass SPI0;
#endif
// default interface
extern SPIClass& SPI;
#endif
+7 -5
View File
@@ -287,15 +287,17 @@ void TwoWire::onRequest( void (*function)(void) )
extern "C" void __attribute__((optimize("O3"))) wire_interrupt_handler(uint8_t num)
{
if (num == 1)
twi_interruptHandler(Wire.getHandler());
twi_interruptHandler(Wire1.getHandler());
#if I2C_COMMON_QTY>1
else if (num == 0)
twi_interruptHandler(Wire1.getHandler());
twi_interruptHandler(Wire0.getHandler());
#endif
}
// ----------------------------- Preinstantiate Objects ----------------------------- //
TwoWire Wire = TwoWire(1);
#if I2C_COMMON_QTY>1
TwoWire Wire1 = TwoWire(0);
TwoWire Wire1 = TwoWire(1); // I2C1 is always available
#if I2C_COMMON_QTY > 1
TwoWire Wire0 = TwoWire(0); // I2C0 is available on some boards
#endif
// default interface
TwoWire& Wire = DEFAULT_WIRE;
+4 -2
View File
@@ -90,9 +90,11 @@ class TwoWire : public Stream
void onRequest( void (*)(void) );
};
extern TwoWire Wire;
#if I2C_COMMON_QTY>1
extern TwoWire Wire1;
#if I2C_COMMON_QTY>1
extern TwoWire Wire0;
#endif
// default interface
extern TwoWire& Wire;
#endif