cppcheck update

pull/332/head
Peter Buchegger 2023-09-23 13:50:14 +00:00
rodzic fbb2071045
commit 5b2b9dfdd8
4 zmienionych plików z 0 dodań i 21 usunięć

Wyświetl plik

@ -37,39 +37,32 @@ OLEDDisplay::OLEDDisplay(OLEDDISPLAY_GEOMETRY g) : _geometry(g), _displayIsOn(fa
OLEDDisplay::~OLEDDisplay() { OLEDDisplay::~OLEDDisplay() {
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::displayOn() { void OLEDDisplay::displayOn() {
sendCommand(DISPLAYON); sendCommand(DISPLAYON);
_displayIsOn = true; _displayIsOn = true;
} }
// cppcheck-suppress unusedFunction
bool OLEDDisplay::isDisplayOn() const { bool OLEDDisplay::isDisplayOn() const {
return _displayIsOn; return _displayIsOn;
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::displayOff() { void OLEDDisplay::displayOff() {
sendCommand(DISPLAYOFF); sendCommand(DISPLAYOFF);
_displayIsOn = false; _displayIsOn = false;
} }
// cppcheck-suppress unusedFunction
bool OLEDDisplay::isDisplayOff() const { bool OLEDDisplay::isDisplayOff() const {
return !_displayIsOn; return !_displayIsOn;
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::invertDisplay() { void OLEDDisplay::invertDisplay() {
sendCommand(INVERTDISPLAY); sendCommand(INVERTDISPLAY);
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::normalDisplay() { void OLEDDisplay::normalDisplay() {
sendCommand(NORMALDISPLAY); sendCommand(NORMALDISPLAY);
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge, uint8_t comdetect) { void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge, uint8_t comdetect) {
sendCommand(SETPRECHARGE); // 0xD9 sendCommand(SETPRECHARGE); // 0xD9
sendCommand(precharge); // 0xF1 default, to lower the contrast, put 1-1F sendCommand(precharge); // 0xF1 default, to lower the contrast, put 1-1F
@ -82,7 +75,6 @@ void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge, uint8_t comde
sendCommand(DISPLAYON); sendCommand(DISPLAYON);
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::setBrightness(uint8_t brightness) { void OLEDDisplay::setBrightness(uint8_t brightness) {
uint8_t contrast = brightness * 1.171 - 43; uint8_t contrast = brightness * 1.171 - 43;
if (brightness < 128) { if (brightness < 128) {
@ -98,19 +90,16 @@ void OLEDDisplay::setBrightness(uint8_t brightness) {
setContrast(contrast, precharge, comdetect); setContrast(contrast, precharge, comdetect);
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::resetOrientation() { void OLEDDisplay::resetOrientation() {
sendCommand(SEGREMAP); sendCommand(SEGREMAP);
sendCommand(COMSCANINC); sendCommand(COMSCANINC);
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::flipScreenVertically() { void OLEDDisplay::flipScreenVertically() {
sendCommand(SEGREMAP | 0x01); sendCommand(SEGREMAP | 0x01);
sendCommand(COMSCANDEC); sendCommand(COMSCANDEC);
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::mirrorScreen() { void OLEDDisplay::mirrorScreen() {
sendCommand(SEGREMAP); sendCommand(SEGREMAP);
sendCommand(COMSCANDEC); sendCommand(COMSCANDEC);
@ -123,11 +112,9 @@ void OLEDDisplay::display(Bitmap *bitmap) {
internDisplay(bitmap); internDisplay(bitmap);
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::clear() { void OLEDDisplay::clear() {
} }
// cppcheck-suppress unusedFunction
uint OLEDDisplay::getWidth() { uint OLEDDisplay::getWidth() {
switch (_geometry) { switch (_geometry) {
case GEOMETRY_128_64: case GEOMETRY_128_64:
@ -140,7 +127,6 @@ uint OLEDDisplay::getWidth() {
return 0; return 0;
} }
// cppcheck-suppress unusedFunction
uint OLEDDisplay::getHeight() { uint OLEDDisplay::getHeight() {
switch (_geometry) { switch (_geometry) {
case GEOMETRY_128_64: case GEOMETRY_128_64:
@ -154,7 +140,6 @@ uint OLEDDisplay::getHeight() {
return 0; return 0;
} }
// cppcheck-suppress unusedFunction
void OLEDDisplay::sendInitCommands() { void OLEDDisplay::sendInitCommands() {
sendCommand(DISPLAYOFF); sendCommand(DISPLAYOFF);
sendCommand(SETDISPLAYCLOCKDIV); sendCommand(SETDISPLAYCLOCKDIV);

Wyświetl plik

@ -16,12 +16,10 @@ void PowerManagement::activateLoRa() {
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); axp.setPowerOutPut(AXP192_LDO2, AXP202_ON);
} }
// cppcheck-suppress unusedFunction
void PowerManagement::deactivateLoRa() { void PowerManagement::deactivateLoRa() {
axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF); axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF);
} }
// cppcheck-suppress unusedFunction
void PowerManagement::activateGPS() { void PowerManagement::activateGPS() {
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); axp.setPowerOutPut(AXP192_LDO3, AXP202_ON);
} }
@ -34,7 +32,6 @@ void PowerManagement::activateOLED() {
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON);
} }
// cppcheck-suppress unusedFunction
void PowerManagement::deactivateOLED() { void PowerManagement::deactivateOLED() {
axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF); axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF);
} }

Wyświetl plik

@ -48,7 +48,6 @@ bool TaskManager::loop(System &system) {
return ret; return ret;
} }
// cppcheck-suppress unusedFunction
void StatusFrame::drawStatusPage(Bitmap &bitmap) { void StatusFrame::drawStatusPage(Bitmap &bitmap) {
int y = 0; int y = 0;
for (Task const *const task : _tasks) { for (Task const *const task : _tasks) {

Wyświetl plik

@ -13,12 +13,10 @@ uint32_t Timer::getTriggerTimeInSec() const {
return (_nextTimeout - millis()) / 1000; return (_nextTimeout - millis()) / 1000;
} }
// cppcheck-suppress unusedFunction
bool Timer::isActive() const { bool Timer::isActive() const {
return _nextTimeout != 0; return _nextTimeout != 0;
} }
// cppcheck-suppress unusedFunction
void Timer::reset() { void Timer::reset() {
_nextTimeout = 0; _nextTimeout = 0;
} }