mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-19 11:01:46 +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,
|
PowerParameters::CurrentConsumptions::CURRENT_WIFI_BASE,
|
||||||
MESH_MAX_EXECUTION_DELAY_MS, NULL)) {
|
MESH_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||||
ESP_LOGE(TAG, "Failed to get power for mesh initialization");
|
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.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
||||||
mesh.onReceive(&receivedCallback);
|
mesh.onReceive(&receivedCallback);
|
||||||
|
@ -18,7 +18,7 @@ void Display::begin(void){
|
|||||||
PowerParameters::PowerConsumers::DISPLAY_OLED, PowerParameters::CurrentConsumptions::CURRENT_DISPLAY
|
PowerParameters::PowerConsumers::DISPLAY_OLED, PowerParameters::CurrentConsumptions::CURRENT_DISPLAY
|
||||||
,DISPLAY_MAX_EXECUTION_DELAY_MS, NULL)){
|
,DISPLAY_MAX_EXECUTION_DELAY_MS, NULL)){
|
||||||
ESP_LOGE(TAG,"Could not get power for Display");
|
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
|
//set Mux Ratio
|
||||||
sendDisplayCMD(muxRatio);
|
sendDisplayCMD(muxRatio);
|
||||||
|
@ -69,7 +69,7 @@ void LightDetection::beginInfrared(void){
|
|||||||
PowerParameters::CurrentConsumptions::CURRENT_PT * 4,
|
PowerParameters::CurrentConsumptions::CURRENT_PT * 4,
|
||||||
LIGHT_DETECTION_MAX_EXECUTION_DELAY_MS, NULL)) {
|
LIGHT_DETECTION_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||||
ESP_LOGE(TAG,"Could not get power for Infrared Phototransistors");
|
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);
|
digitalWrite(IR_PT_ENABLE,true);
|
||||||
pinMode(IR_PT_ENABLE, OUTPUT);
|
pinMode(IR_PT_ENABLE, OUTPUT);
|
||||||
@ -85,7 +85,7 @@ void LightDetection::beginDaylight(void){
|
|||||||
PowerParameters::CurrentConsumptions::CURRENT_PT * 2,
|
PowerParameters::CurrentConsumptions::CURRENT_PT * 2,
|
||||||
LIGHT_DETECTION_MAX_EXECUTION_DELAY_MS, NULL)) {
|
LIGHT_DETECTION_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||||
ESP_LOGE(TAG,"Could not get power for Daylight Phototransistors");
|
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);
|
digitalWrite(DL_PT_ENABLE,true);
|
||||||
pinMode(DL_PT_ENABLE, OUTPUT);
|
pinMode(DL_PT_ENABLE, OUTPUT);
|
||||||
|
@ -11,7 +11,7 @@ void MotionDetection::begin(void){
|
|||||||
PowerParameters::CurrentConsumptions::CURRENT_IMU,
|
PowerParameters::CurrentConsumptions::CURRENT_IMU,
|
||||||
IMU_MAX_EXECUTION_DELAY_MS, NULL)) {
|
IMU_MAX_EXECUTION_DELAY_MS, NULL)) {
|
||||||
ESP_LOGE(TAG, "Could not get power for MotionDetection");
|
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);
|
pinMode(34,OUTPUT);
|
||||||
digitalWrite(34,HIGH);
|
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_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) ){
|
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");
|
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();
|
rgbLeds.begin();
|
||||||
this->turnOffLed();
|
this->turnOffLed();
|
||||||
|
@ -38,7 +38,7 @@ void Power::begin() {
|
|||||||
PowerParameters::PowerConsumers::ESP,
|
PowerParameters::PowerConsumers::ESP,
|
||||||
PowerParameters::CurrentConsumptions::CURRENT_ESP_AVG))) {
|
PowerParameters::CurrentConsumptions::CURRENT_ESP_AVG))) {
|
||||||
ESP_LOGE(TAG, "Could not get power for ESP");
|
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