From c6629366899a33fb85d2c463b6b99a75b7b92609 Mon Sep 17 00:00:00 2001 From: RedHawk Date: Thu, 6 Apr 2023 11:12:47 +0300 Subject: [PATCH] peripherals: Commented out until fixed. Peripherals were following old lpc chip pinout (lpc15xx). We have different (lpc11u6x). I decided to comment them out until we figure out correct pinout. (project should always build in master) --- source/shoh/src/peripherals/DigitalIoPin.cpp | 7 +++++++ source/shoh/src/peripherals/DigitalIoPin.h | 9 +++++++++ source/shoh/src/peripherals/EEPROMWrapper.cpp | 8 ++++++++ source/shoh/src/peripherals/EEPROMWrapper.h | 10 ++++++++++ source/shoh/src/peripherals/I2C.cpp | 8 ++++++++ source/shoh/src/peripherals/I2C.h | 9 +++++++++ source/shoh/src/peripherals/LiquidCrystal.cpp | 8 ++++++++ source/shoh/src/peripherals/LiquidCrystal.h | 10 +++++++++- source/shoh/src/peripherals/LpcUart.cpp | 8 ++++++++ source/shoh/src/peripherals/LpcUart.h | 10 ++++++++++ 10 files changed, 86 insertions(+), 1 deletion(-) diff --git a/source/shoh/src/peripherals/DigitalIoPin.cpp b/source/shoh/src/peripherals/DigitalIoPin.cpp index 13f7d87..5972107 100644 --- a/source/shoh/src/peripherals/DigitalIoPin.cpp +++ b/source/shoh/src/peripherals/DigitalIoPin.cpp @@ -7,6 +7,10 @@ #include "DigitalIoPin.h" +// Remove this when code will be reworked. +#ifndef DIGITALIOPIN_NOT_FIXED +// Remove this when code will be reworked. + DigitalIoPin::DigitalIoPin (int port, int pin, bool input, bool pullup, bool invert) { @@ -62,3 +66,6 @@ DigitalIoPin::write (bool value) Chip_GPIO_SetPinState (LPC_GPIO, _io._port, _io._pin, ((_io._invert) ? !value : value)); } +//Remove this when code will be reworked. +#endif /* DIGITALIOPIN_NOT_FIXED */ +//Remove this when code will be reworked. diff --git a/source/shoh/src/peripherals/DigitalIoPin.h b/source/shoh/src/peripherals/DigitalIoPin.h index de004af..8745c2d 100644 --- a/source/shoh/src/peripherals/DigitalIoPin.h +++ b/source/shoh/src/peripherals/DigitalIoPin.h @@ -8,6 +8,11 @@ #ifndef DIGITALIOPIN_H_ #define DIGITALIOPIN_H_ +// Remove this when code will be reworked. +#define DIGITALIOPIN_NOT_FIXED +#ifndef DIGITALIOPIN_NOT_FIXED +// Remove this when code will be reworked. + #define UINT8_MAX_VALUE 255 #include @@ -40,4 +45,8 @@ private: void setIoPin (); }; +//Remove this when code will be reworked. +#endif /* DIGITALIOPIN_NOT_FIXED */ +//Remove this when code will be reworked. + #endif /* DIGITALIOPIN_H_ */ diff --git a/source/shoh/src/peripherals/EEPROMWrapper.cpp b/source/shoh/src/peripherals/EEPROMWrapper.cpp index 4f9f160..3f6a28f 100644 --- a/source/shoh/src/peripherals/EEPROMWrapper.cpp +++ b/source/shoh/src/peripherals/EEPROMWrapper.cpp @@ -7,6 +7,10 @@ #include +// Remove this when code will be reworked. +#ifndef EEPROMWRAPPER_NOT_FIXED +// Remove this when code will be reworked. + EEPROM_Wrapper::EEPROM_Wrapper () { /* Enable EEPROM clock and reset EEPROM controller */ @@ -93,3 +97,7 @@ EEPROM_Wrapper::write_to (uint32_t addr, void *data, uint32_t size_of_data) e_memcpy (data, buffer, size_of_data); eeprom_use (buffer, addr, size_of_data, WRITE); } + +// Remove this when code will be reworked. +#endif /* EEPROMWRAPPER_NOT_FIXED */ +// Remove this when code will be reworked. diff --git a/source/shoh/src/peripherals/EEPROMWrapper.h b/source/shoh/src/peripherals/EEPROMWrapper.h index b0aed9b..94d0278 100644 --- a/source/shoh/src/peripherals/EEPROMWrapper.h +++ b/source/shoh/src/peripherals/EEPROMWrapper.h @@ -8,6 +8,12 @@ #ifndef EEPROMWRAPPER_H_ #define EEPROMWRAPPER_H_ +// Remove this when code will be reworked. +#define EEPROMWRAPPER_NOT_FIXED +#ifndef EEPROMWRAPPER_NOT_FIXED +// Remove this when code will be reworked. + + #include "FreeRTOS.h" #include "task.h" #include "chip.h" @@ -80,4 +86,8 @@ private: uint8_t buffer[EEPROM_MAX_BUFER_SIZE] = { 0 }; }; +// Remove this when code will be reworked. +#endif /* EEPROMWRAPPER_NOT_FIXED */ +// Remove this when code will be reworked. + #endif /* EEPROMWRAPPER_H_ */ diff --git a/source/shoh/src/peripherals/I2C.cpp b/source/shoh/src/peripherals/I2C.cpp index 19a0b6f..ce365dc 100644 --- a/source/shoh/src/peripherals/I2C.cpp +++ b/source/shoh/src/peripherals/I2C.cpp @@ -40,6 +40,10 @@ #include "I2C.h" +// Remove this when code will be reworked. +#ifndef I2C_NOT_FIXED +// Remove this when code will be reworked. + I2C::I2C (const I2C_config &cfg) : device (nullptr) { // if(cfg.device_number == 0) { @@ -158,3 +162,7 @@ I2C::I2CM_XferBlocking (LPC_I2C_T *pI2C, I2CM_XFER_T *xfer) } return ret; } + +// Remove this when code will be reworked. +#endif /* I2C_NOT_FIXED */ +// Remove this when code will be reworked. diff --git a/source/shoh/src/peripherals/I2C.h b/source/shoh/src/peripherals/I2C.h index 910a596..733debd 100644 --- a/source/shoh/src/peripherals/I2C.h +++ b/source/shoh/src/peripherals/I2C.h @@ -8,6 +8,11 @@ #ifndef I2C_H_ #define I2C_H_ +// Remove this when code will be reworked. +#define I2C_NOT_FIXED +#ifndef I2C_NOT_FIXED +// Remove this when code will be reworked. + #include "chip.h" struct I2C_config { @@ -30,4 +35,8 @@ private: static uint32_t I2CM_XferBlocking(LPC_I2C_T *pI2C, I2CM_XFER_T *xfer); }; +// Remove this when code will be reworked. +#endif /* I2C_NOT_FIXED */ +// Remove this when code will be reworked. + #endif /* I2C_H_ */ diff --git a/source/shoh/src/peripherals/LiquidCrystal.cpp b/source/shoh/src/peripherals/LiquidCrystal.cpp index 234f925..6fe05ef 100644 --- a/source/shoh/src/peripherals/LiquidCrystal.cpp +++ b/source/shoh/src/peripherals/LiquidCrystal.cpp @@ -1,5 +1,10 @@ #include "LiquidCrystal.h" +// Remove this when code will be reworked. +#ifndef LiquidCrystal_NOT_FIXED +// Remove this when code will be reworked. + + #include #include "chip.h" @@ -287,3 +292,6 @@ void LiquidCrystal::write4bits(uint8_t value) { pulseEnable(); } +// Remove this when code will be reworked. +#endif /* LiquidCrystal_NOT_FIXED */ +// Remove this when code will be reworked. diff --git a/source/shoh/src/peripherals/LiquidCrystal.h b/source/shoh/src/peripherals/LiquidCrystal.h index 7c4dcee..546565e 100644 --- a/source/shoh/src/peripherals/LiquidCrystal.h +++ b/source/shoh/src/peripherals/LiquidCrystal.h @@ -1,6 +1,10 @@ #ifndef LiquidCrystal_h #define LiquidCrystal_h +// Remove this when code will be reworked. +#define LiquidCrystal_NOT_FIXED +#ifndef LiquidCrystal_NOT_FIXED +// Remove this when code will be reworked. #include #include @@ -94,4 +98,8 @@ private: uint8_t _numlines,_currline; }; -#endif +// Remove this when code will be reworked. +#endif /* LiquidCrystal_NOT_FIXED */ +// Remove this when code will be reworked. + +#endif /* LiquidCrystal_h */ diff --git a/source/shoh/src/peripherals/LpcUart.cpp b/source/shoh/src/peripherals/LpcUart.cpp index e90bcc0..7e4e08d 100644 --- a/source/shoh/src/peripherals/LpcUart.cpp +++ b/source/shoh/src/peripherals/LpcUart.cpp @@ -9,6 +9,10 @@ #include #include "LpcUart.h" +// Remove this when code will be reworked. +#ifndef LPCUART_NOT_FIXED +// Remove this when code will be reworked. + static LpcUart *u0; static LpcUart *u1; @@ -313,3 +317,7 @@ bool LpcUart::txempty() return (RingBuffer_GetCount(&txring) == 0); } + +// Remove this when code will be reworked. +#endif /* LPCUART_NOT_FIXED */ +// Remove this when code will be reworked. diff --git a/source/shoh/src/peripherals/LpcUart.h b/source/shoh/src/peripherals/LpcUart.h index 2e7e799..38a88ac 100644 --- a/source/shoh/src/peripherals/LpcUart.h +++ b/source/shoh/src/peripherals/LpcUart.h @@ -8,6 +8,12 @@ #ifndef LPCUART_H_ #define LPCUART_H_ +// Remove this when code will be reworked. +#define LPCUART_NOT_FIXED +#ifndef LPCUART_NOT_FIXED +// Remove this when code will be reworked. + + #include "chip.h" #include "FreeRTOS.h" #include "task.h" @@ -69,4 +75,8 @@ private: Fmutex write_mutex; }; +// Remove this when code will be reworked. +#endif /* LPCUART_NOT_FIXED */ +// Remove this when code will be reworked. + #endif /* LPCUART_H_ */