Merge branch 'NewBoards'

This commit is contained in:
UT2UH
2020-11-11 13:31:04 +02:00
2 changed files with 6 additions and 4 deletions

View File

@@ -65,11 +65,11 @@ enum BitOrder {
#endif // abs
#ifndef min
#define min(a,b) ((a)<(b)?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#endif // min
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#endif // max
#define abs(x) ((x)>0?(x):-(x))

View File

@@ -56,7 +56,8 @@ TwoWire::begin(uint8_t sda, uint8_t scl, uint32_t frequency)
is_master_mode = true;
delete i2c_tx_buff, i2c_rx_buff;
delete i2c_tx_buff;
delete i2c_rx_buff;
i2c_tx_buff = new RingBuffer();
i2c_rx_buff = new RingBuffer();
@@ -88,7 +89,8 @@ TwoWire::begin(uint16_t slave_address, uint8_t sda, uint8_t scl)
plic_irq_register((plic_irq_t)(IRQN_I2C0_INTERRUPT + _i2c_num), maix_i2c_slave_irq, this);
plic_irq_enable((plic_irq_t)(IRQN_I2C0_INTERRUPT + _i2c_num));
delete i2c_tx_buff, i2c_rx_buff;
delete i2c_tx_buff;
delete i2c_rx_buff;
i2c_tx_buff = new RingBuffer();
i2c_rx_buff = new RingBuffer();