mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-14 06:21:41 +02:00
fixed warnings in LightDetection
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
#include "LightDetection.h"
|
||||
#include <limits.h>
|
||||
|
||||
void LightDetection::begin(void){
|
||||
LightDetection::beginInfrared();
|
||||
@ -6,7 +7,6 @@ void LightDetection::begin(void){
|
||||
};
|
||||
|
||||
uint16_t LightDetection::getValue(photoTransistors sensor){
|
||||
uint16_t result;
|
||||
switch(sensor){
|
||||
//Fall Through intended
|
||||
case IR_FRONT:
|
||||
@ -17,6 +17,9 @@ uint16_t LightDetection::getValue(photoTransistors sensor){
|
||||
case DL_BOTTOM:
|
||||
case DL_FRONT:
|
||||
return readDLPT(sensor);
|
||||
default:
|
||||
//currently not reachable, just if enum will be extended in the future
|
||||
return UINT16_MAX;
|
||||
}
|
||||
};
|
||||
|
||||
@ -26,6 +29,7 @@ photoTransistors LightDetection::getBrightest(ptType type){
|
||||
uint16_t currentReading = 0;
|
||||
|
||||
if (type == IR){
|
||||
maxSensor = IR_FRONT;
|
||||
for(const auto pt : allIRPTs){
|
||||
currentReading = LightDetection::getValue(pt);
|
||||
if (currentReading > maxReading){
|
||||
@ -34,6 +38,7 @@ photoTransistors LightDetection::getBrightest(ptType type){
|
||||
}
|
||||
}
|
||||
} else {
|
||||
maxSensor = DL_FRONT;
|
||||
for(const auto pt : allDLPTs){
|
||||
currentReading = LightDetection::getValue(pt);
|
||||
if (currentReading > maxReading){
|
||||
|
Reference in New Issue
Block a user