Browse Source

LED is blinking

main
Goran Mahovlic 2 years ago
parent
commit
5a9fd6db48
  1. 7
      Core/Src/gpio.c
  2. 83588
      Debug/stm32f746g-disco.hex
  3. 2
      Middlewares/eez/gui/data.h
  4. 52
      Src/eez-flow-template-stm32f746g-disco.eez-project
  5. 15
      Src/gui/data.cpp
  6. 15363
      Src/gui/document.cpp
  7. 4
      Src/gui/document.h

7
Core/Src/gpio.c

@ -220,6 +220,13 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
/*Configure GPIO pins : PGPin PGPin PGPin */
GPIO_InitStruct.Pin = ARDUINO_PWM_D3_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(ARDUINO_PWM_D3_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : PFPin PFPin PFPin PFPin
PFPin */
GPIO_InitStruct.Pin = ARDUINO_A4_Pin|ARDUINO_A5_Pin|ARDUINO_A1_Pin|ARDUINO_A2_Pin

83588
Debug/stm32f746g-disco.hex

File diff suppressed because it is too large Load Diff

2
Middlewares/eez/gui/data.h

@ -51,7 +51,7 @@ struct EnumItem {
};
extern const EnumItem *g_enumDefinitions[];
extern bool g_set_pin_status;
extern volatile int g_set_pin_status;
struct EnumValue {
uint16_t enumValue;

52
Src/eez-flow-template-stm32f746g-disco.eez-project

@ -174,8 +174,8 @@
"objID": "ddddb67e-d476-43e7-b706-a3413db953b0",
"name": "ARDUINO_PWM_D3_Pin_status",
"description": "Holding LED1 status",
"type": "boolean",
"defaultValue": "true",
"type": "integer",
"defaultValue": "0",
"persistent": false,
"native": true
}
@ -957,7 +957,7 @@
{
"objID": "6e5bd3bc-8c55-4c53-af36-a246759ce308",
"name": "Toggle_led",
"type": "boolean"
"type": "integer"
}
],
"data": "ARDUINO_PWM_D3_Pin_status",
@ -974,13 +974,13 @@
{
"objID": "2423378e-8115-4115-b51a-8c5575c58fc6",
"type": "TextWidget",
"left": 114,
"left": 89,
"top": 29,
"width": 337,
"width": 116,
"height": 32,
"customInputs": [],
"customOutputs": [],
"data": "\"ARDUINO_PWM_D3_Pin status\"",
"data": "\"LED_D3\"",
"style": {
"objID": "5c1fac69-801c-4cf8-fc1d-893983a6833d",
"inheritFrom": "default"
@ -990,15 +990,15 @@
{
"objID": "3d2c9d40-555a-4ae6-d626-2e575287407a",
"type": "SetVariableActionComponent",
"left": 167,
"top": -101,
"left": 127,
"top": -75,
"width": 339,
"height": 55,
"customInputs": [
{
"objID": "c286efe3-cd10-4a24-fe07-f499c55bd324",
"name": "data_in",
"type": "boolean"
"type": "integer"
}
],
"customOutputs": [],
@ -1009,6 +1009,38 @@
"value": "data_in"
}
]
},
{
"objID": "8f404b3f-4f54-4632-e462-a4d109de296c",
"type": "TextWidget",
"left": 0,
"top": 80,
"width": 480,
"height": 65,
"customInputs": [],
"customOutputs": [],
"data": "\"EEZ flow LED output\"",
"style": {
"objID": "385c5427-0e29-4d48-b266-3b6afa8a50f8",
"inheritFrom": "default_XL"
},
"timeline": []
},
{
"objID": "901b888a-2af5-4c6f-db87-7f85abfacb69",
"type": "TextWidget",
"left": 0,
"top": 144,
"width": 480,
"height": 65,
"customInputs": [],
"customOutputs": [],
"data": "\"Envox EEZ Studio\"",
"style": {
"objID": "385c5427-0e29-4d48-b266-3b6afa8a50f8",
"inheritFrom": "default_XL"
},
"timeline": []
}
],
"connectionLines": [
@ -1020,7 +1052,7 @@
"input": "@seqin"
},
{
"objID": "f9169f5e-f902-45e8-f1e1-e82bb6a9ce7e",
"objID": "c9adc4b8-975c-433f-c4d2-16d6f2f70ff6",
"source": "2a112e99-5217-4364-c1d9-ce69141b32e3",
"output": "Toggle_led",
"target": "3d2c9d40-555a-4ae6-d626-2e575287407a",

15
Src/gui/data.cpp

@ -1,14 +1,25 @@
#include <eez/gui/gui.h>
#include "../firmware.h"
#include "main.h"
namespace eez {
namespace gui {
const EnumItem *g_enumDefinitions[] = { nullptr };
bool g_set_pin_status = false;
volatile int g_set_pin_status = 0;
void data_arduino_pwm_d3_pin_status(DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value) {
value = Value(g_set_pin_status, VALUE_TYPE_BOOLEAN);
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);
}
}
}
} // namespace gui

15363
Src/gui/document.cpp

File diff suppressed because it is too large Load Diff

4
Src/gui/document.h

@ -183,7 +183,7 @@ enum PagesEnum {
PAGE_ID_PAGE2 = 4
};
extern const uint8_t assets[55672];
extern const uint8_t assets[55759];
#elif defined(EEZ_PLATFORM_SIMULATOR)
@ -368,7 +368,7 @@ enum PagesEnum {
PAGE_ID_PAGE2 = 5
};
extern const uint8_t assets[72109];
extern const uint8_t assets[72200];
#endif

Loading…
Cancel
Save