Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions drivers/ports/ESP32/actuators/led.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ void LED::LED_init() {

void LED::LED_on() {
gpio_set_level(static_cast<gpio_num_t>(_pin), 1);
printf("LED on\n");
}

void LED::LED_off() {
gpio_set_level(static_cast<gpio_num_t>(_pin), 0);
printf("LED off\n");
}
10 changes: 6 additions & 4 deletions drivers/ports/ESP32/bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace BSP{
void BSP_init_actuators() {
get_default_onboard_led()->LED_init();
get_blue_led()->LED_init();
get_red_led()->LED_init();
get_green_led()->LED_init();
}

void BSP_init_sensors() {
Expand Down Expand Up @@ -132,18 +134,18 @@ namespace BSP{

}

LED* get_blue_led() {
static LED led(2);
LED* get_blue_led() {
static LED led(16);
return &led;
}

LED* get_green_led() {
static LED led(13);
static LED led(17);
return &led;
}

LED* get_red_led() {
static LED led(14);
static LED led(5);
return &led;
}

Expand Down
8 changes: 4 additions & 4 deletions services/timebomb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ State TimeBomb::_wait_for_button(Event const * const e) {
switch (e->_sig) {

case ENTRY_SIGNAL: {
BSP::BSP_blue_led_on();
BSP::BSP_green_led_on();
status = HANDLED_STATUS;
break;
}
case EXIT_SIGNAL: {
BSP::BSP_blue_led_off();
BSP::BSP_green_led_off();
status = HANDLED_STATUS;
break;
}
Expand All @@ -82,14 +82,14 @@ State TimeBomb::_blink(Event const * const e) {
switch (e->_sig) {
case ENTRY_SIGNAL: {
printf("Enter blink\n");
BSP::BSP_blue_led_on();
BSP::BSP_red_led_on();
te->_arm((blink_time), 0U);
status = HANDLED_STATUS;
break;
}
case EXIT_SIGNAL: {
printf("Exit blink\n");
BSP::BSP_blue_led_off();
BSP::BSP_red_led_off();
status = HANDLED_STATUS;
break;
}
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ int main()
#endif
{
BSP::BSP_init();
BSP::BSP_LED_on();

#ifdef ESP32
Active::_run(TimeBomb::get_default_instance());
Expand Down
Loading