mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-19 02:51:47 +02:00
Change approach of notifying of power problem to be more beginner friendly
This commit is contained in:
parent
4c13eb593e
commit
598ac75e32
@ -82,7 +82,7 @@ void Communication::begin(void) {
|
||||
PowerParameters::CurrentConsumptions::CURRENT_WIFI_BASE,
|
||||
MESH_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||
ESP_LOGE(TAG, "Failed to get power for mesh initialization");
|
||||
throw "Failed to get power for mesh initialization";
|
||||
Serial.println("Failed to get power for mesh initialization");
|
||||
}
|
||||
mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
||||
mesh.onReceive(&receivedCallback);
|
||||
|
@ -18,7 +18,7 @@ void Display::begin(void){
|
||||
PowerParameters::PowerConsumers::DISPLAY_OLED, PowerParameters::CurrentConsumptions::CURRENT_DISPLAY
|
||||
,DISPLAY_MAX_EXECUTION_DELAY_MS, NULL)){
|
||||
ESP_LOGE(TAG,"Could not get power for Display");
|
||||
throw "Could not get power for Display";
|
||||
Serial.println("Could not get power for Display");
|
||||
}
|
||||
//set Mux Ratio
|
||||
sendDisplayCMD(muxRatio);
|
||||
|
@ -69,7 +69,7 @@ void LightDetection::beginInfrared(void){
|
||||
PowerParameters::CurrentConsumptions::CURRENT_PT * 4,
|
||||
LIGHT_DETECTION_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||
ESP_LOGE(TAG,"Could not get power for Infrared Phototransistors");
|
||||
throw "Could not get power for Infrared Phototransistors";
|
||||
Serial.println("Could not get power for Infrared Phototransistors");
|
||||
}
|
||||
digitalWrite(IR_PT_ENABLE,true);
|
||||
pinMode(IR_PT_ENABLE, OUTPUT);
|
||||
@ -85,7 +85,7 @@ void LightDetection::beginDaylight(void){
|
||||
PowerParameters::CurrentConsumptions::CURRENT_PT * 2,
|
||||
LIGHT_DETECTION_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||
ESP_LOGE(TAG,"Could not get power for Daylight Phototransistors");
|
||||
throw "Could not get power for Daylight Phototransistors";
|
||||
Serial.println("Could not get power for Daylight Phototransistors");
|
||||
}
|
||||
digitalWrite(DL_PT_ENABLE,true);
|
||||
pinMode(DL_PT_ENABLE, OUTPUT);
|
||||
|
@ -11,7 +11,7 @@ void MotionDetection::begin(void){
|
||||
PowerParameters::CurrentConsumptions::CURRENT_IMU,
|
||||
IMU_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||
ESP_LOGE(TAG, "Could not get power for MotionDetection");
|
||||
throw "Could not get power for MotionDetection";
|
||||
Serial.println("Could not get power for MotionDetection");
|
||||
}
|
||||
pinMode(34,OUTPUT);
|
||||
digitalWrite(34,HIGH);
|
||||
|
@ -9,7 +9,7 @@ void MultiColorLight::begin(void){
|
||||
Power::waitForCurrentAllowance(PowerParameters::PowerConsumers::LED_RGB_TOP_RIGHT, PowerParameters::CurrentConsumptions::CURRENT_LED_RGB_BASE, MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL) &&
|
||||
Power::waitForCurrentAllowance(PowerParameters::PowerConsumers::LED_RGB_BOTTOM, PowerParameters::CurrentConsumptions::CURRENT_LED_RGB_BASE, MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL) ){
|
||||
ESP_LOGE(TAG, "Could not get power for MultiColorLight");
|
||||
throw "Could not get power for MultiColorLight";
|
||||
Serial.println("Could not get power for MultiColorLight");
|
||||
}
|
||||
rgbLeds.begin();
|
||||
this->turnOffLed();
|
||||
|
@ -38,7 +38,7 @@ void Power::begin() {
|
||||
PowerParameters::PowerConsumers::ESP,
|
||||
PowerParameters::CurrentConsumptions::CURRENT_ESP_AVG))) {
|
||||
ESP_LOGE(TAG, "Could not get power for ESP");
|
||||
throw "Could not get power for ESP";
|
||||
Serial.println("Could not get power for ESP");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user