You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
#include <eez/gui/gui.h> |
|
#include "../firmware.h" |
|
#include "main.h" |
|
|
|
namespace eez { |
|
namespace gui { |
|
|
|
const EnumItem *g_enumDefinitions[] = { nullptr }; |
|
volatile int g_set_pin_status = 0; |
|
|
|
void data_arduino_pwm_d3_pin_status(DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value) { |
|
if (operation == DATA_OPERATION_GET) { |
|
value = g_set_pin_status; |
|
} else if (operation == DATA_OPERATION_SET) { |
|
g_set_pin_status = value.getInt(); |
|
if(g_set_pin_status){ |
|
HAL_GPIO_WritePin(ARDUINO_PWM_D3_GPIO_Port, ARDUINO_PWM_D3_Pin, GPIO_PIN_SET); |
|
} |
|
else{ |
|
HAL_GPIO_WritePin(ARDUINO_PWM_D3_GPIO_Port, ARDUINO_PWM_D3_Pin, GPIO_PIN_RESET); |
|
} |
|
} |
|
} |
|
|
|
void data_btn_color(DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value){ |
|
if (operation == DATA_OPERATION_GET) { |
|
g_set_pin_status = HAL_GPIO_ReadPin(USER_BTN_GPIO_Port, USER_BTN_Pin); |
|
value = g_set_pin_status; |
|
if(g_set_pin_status){ |
|
HAL_GPIO_WritePin(ARDUINO_PWM_D3_GPIO_Port, ARDUINO_PWM_D3_Pin, GPIO_PIN_SET); |
|
} |
|
else{ |
|
HAL_GPIO_WritePin(ARDUINO_PWM_D3_GPIO_Port, ARDUINO_PWM_D3_Pin, GPIO_PIN_RESET); |
|
} |
|
} |
|
} |
|
|
|
} // namespace gui |
|
} // namespace eez
|
|
|