mirror of
				https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
				synced 2025-11-04 01:15:12 +01: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){
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,7 @@ public:
 | 
			
		||||
     * Can distingish between IR and Daylight 
 | 
			
		||||
     * 
 | 
			
		||||
     * @param type select which PTTransistors to compare
 | 
			
		||||
     * @return photoTransistors which sensor is exposed to the greatest amount of light
 | 
			
		||||
     * @return photoTransistors which sensor is exposed to the greatest amount of light, if all sensor read 0, the front sensor is returned
 | 
			
		||||
     */
 | 
			
		||||
    static photoTransistors getBrightest(ptType type);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user