Skip to content

Commit

Permalink
R1B5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Aug 27, 2019
1 parent 6d8e19d commit 2b7bbe5
Show file tree
Hide file tree
Showing 32 changed files with 6,565 additions and 833 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
build
modular-psu-firmware.eez-project-ui-state
src/third_party/stm32/Debug
src/third_party/stm32_r1b1

src/eez/gui/document_stm32.h
src/eez/gui/document_stm32.cpp
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ add_definitions(-DOPTION_AUX_TEMP_SENSOR=1)
add_definitions(-DOPTION_EXT_RTC=1)
add_definitions(-DOPTION_ENCODER=1)
add_definitions(-DOPTION_EXT_EEPROM=1)
add_definitions(-DOPTION_SDCARD=1)
add_definitions(-DOPTION_SDCARD=0)
add_definitions(-DOPTION_SDRAM=1)
add_definitions(-DEEZ_MCU_REVISION_R1B5=1)

if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
add_definitions(-DOPTION_ETHERNET=0)
Expand Down
38 changes: 13 additions & 25 deletions modular-psu-firmware.eez-project
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"files": [
{
"fileName": "gui/document_<configuration>.h",
"template": "//${eez-studio DATA_ENUM}\n\n//${eez-studio DATA_FUNCS_DECL}\n\n//${eez-studio DATA_ARRAY_DECL}\n\n//${eez-studio ACTIONS_ENUM}\n\n//${eez-studio ACTIONS_FUNCS_DECL}\n\n//${eez-studio ACTIONS_ARRAY_DECL}\n\n//${eez-studio GUI_FONTS_ENUM}\n\n//${eez-studio GUI_BITMAPS_ENUM}\n\n//${eez-studio GUI_STYLES_ENUM}\n\n//${eez-studio GUI_PAGES_ENUM}\n\n//${eez-studio GUI_ASSETS_DECL}\n"
"template": "//${eez-studio DATA_ENUM}\n\n//${eez-studio DATA_FUNCS_DECL}\n\n//${eez-studio DATA_ARRAY_DECL}\n\n//${eez-studio ACTIONS_ENUM}\n\n//${eez-studio ACTIONS_FUNCS_DECL}\n\n//${eez-studio ACTIONS_ARRAY_DECL}\n\n//${eez-studio GUI_FONTS_ENUM}\n\n//${eez-studio GUI_BITMAPS_ENUM}\n\n//${eez-studio GUI_STYLES_ENUM}\n\n//${eez-studio GUI_PAGES_ENUM}\n\n#ifdef OPTION_SDRAM\n//${eez-studio GUI_ASSETS_DECL_COMPRESSED}\n#else\n//${eez-studio GUI_ASSETS_DECL}\n#endif\n"
},
{
"fileName": "gui/document_<configuration>.cpp",
"template": "//${eez-studio DATA_ARRAY_DEF}\n\n//${eez-studio ACTIONS_ARRAY_DEF}\n\n//${eez-studio GUI_ASSETS_DEF}\n"
"template": "//${eez-studio DATA_ARRAY_DEF}\n\n//${eez-studio ACTIONS_ARRAY_DEF}\n\n#ifdef OPTION_SDRAM\n//${eez-studio GUI_ASSETS_DEF_COMPRESSED}\n#else\n//${eez-studio GUI_ASSETS_DEF}\n#endif\n"
},
{
"fileName": "scpi/commands_<configuration>.h",
Expand Down Expand Up @@ -2095,54 +2095,42 @@
},
{
"name": "simulator_load",
"implementationType": "native",
"usedIn": [
"simulator"
]
},
{
"name": "select_theme",
"implementationType": "native"
"name": "select_theme"
},
{
"name": "toggle_channels_max_view",
"implementationType": "native"
"name": "toggle_channels_max_view"
},
{
"name": "show_scripts",
"implementationType": "native"
"name": "show_scripts"
},
{
"name": "start_script",
"implementationType": "native"
"name": "start_script"
},
{
"name": "set_scripts_page_mode_scripts",
"implementationType": "native"
"name": "set_scripts_page_mode_scripts"
},
{
"name": "set_scripts_page_mode_shell",
"implementationType": "native"
"name": "set_scripts_page_mode_shell"
},
{
"name": "scripts_previous_page",
"implementationType": "native"
"name": "scripts_previous_page"
},
{
"name": "scripts_next_page",
"implementationType": "native"
"name": "scripts_next_page"
},
{
"name": "edit_animations_duration",
"implementationType": "native"
"name": "edit_animations_duration"
},
{
"name": "hard_reset",
"implementationType": "native"
"name": "hard_reset"
},
{
"name": "user_switch_clicked",
"implementationType": "native"
"name": "user_switch_clicked"
}
],
"extensionDefinitions": [
Expand Down
2 changes: 0 additions & 2 deletions src/eez/apps/psu/conf_advanced.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
#define IDN_MODEL "EEZ BB3 (Simulator)"
#endif

#define EEZ_PSU_SELECTED_REVISION EEZ_MCU_REVISION_R1B5

#define MCU_NAME "STM32F7"
#define MCU_REVISION "R1B5"

Expand Down
10 changes: 9 additions & 1 deletion src/eez/apps/psu/io_pins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ static bool g_digitalOutputPinState[2] = { false, false };

int ioPinRead(int pin) {
if (pin == EXT_TRIG1) {
return HAL_GPIO_ReadPin(DIN1_GPIO_Port, DIN1_Pin) ? 1 : 0;
#if EEZ_MCU_REVISION_R1B5
return HAL_GPIO_ReadPin(UART_RX_DIN1_GPIO_Port, UART_RX_DIN1_Pin) ? 1 : 0;
#else
return HAL_GPIO_ReadPin(DIN1_GPIO_Port, _DIN1_Pin) ? 1 : 0;
#endif
} {
assert(pin == EXT_TRIG2);
return HAL_GPIO_ReadPin(DIN2_GPIO_Port, DIN2_Pin) ? 1 : 0;
Expand All @@ -57,7 +61,11 @@ int ioPinRead(int pin) {

void ioPinWrite(int pin, int state) {
if (pin == DOUT1) {
#if EEZ_MCU_REVISION_R1B5
HAL_GPIO_WritePin(UART_TX_DOUT1_GPIO_Port, UART_TX_DOUT1_Pin, state ? GPIO_PIN_SET : GPIO_PIN_RESET);
#else
HAL_GPIO_WritePin(DOUT1_GPIO_Port, DOUT1_Pin, state ? GPIO_PIN_SET : GPIO_PIN_RESET);
#endif
} else {
assert(pin == DOUT2);
HAL_GPIO_WritePin(DOUT2_GPIO_Port, DOUT2_Pin, state ? GPIO_PIN_SET : GPIO_PIN_RESET);
Expand Down
1 change: 0 additions & 1 deletion src/eez/gui/app_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ void AppContext::doShowPage(int index, Page *page) {
}

if (m_activePage) {
m_activePage->pageAlloc();
m_activePage->pageWillAppear();
}

Expand Down
4 changes: 4 additions & 0 deletions src/eez/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ Page *getPageFromId(int pageId) {
break;
}

if (page) {
page->pageAlloc();
}

return page;
}

Expand Down
5 changes: 5 additions & 0 deletions src/eez/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ unsigned int generateTuneSamples(int *tune, int sampleRate, uint16_t *pMemBuffer
#endif
}
}

// add zero to the end
*pMemBuffer = 0;
size++;

return size;
}

Expand Down
Loading

0 comments on commit 2b7bbe5

Please sign in to comment.