LCD Baseshield GSOE GSOF
Dependents: WebserverGSOE_Schnaiter HC05__TI4_RP5_Schnaiter
Diff: SoftwareI2C.cpp
- Revision:
- 7:c3d157395c16
- Parent:
- 5:66ca6c9b15f2
- Child:
- 8:3bac0faac335
--- a/SoftwareI2C.cpp Mon Apr 27 19:59:58 2020 +0000 +++ b/SoftwareI2C.cpp Tue Apr 28 10:53:26 2020 +0000 @@ -36,7 +36,7 @@ */ void SoftwareI2C::read(uint8_t device_address, uint8_t* data, uint8_t data_bytes) { if (data == 0 || data_bytes == 0) return; - + __disable_irq(); device_address = device_address | 0x01; start(); putByte(device_address); @@ -48,6 +48,7 @@ } } stop(); + __enable_irq(); } /** @@ -58,7 +59,7 @@ */ void SoftwareI2C::write(uint8_t device_address, uint8_t* data, uint8_t data_bytes) { if (data == 0 || data_bytes == 0) return; - + __disable_irq(); device_address = device_address & 0xFE; start(); putByte(device_address); @@ -68,6 +69,7 @@ getAck(); } stop(); + __enable_irq(); } /**