Skip to content

Commit

Permalink
fix: Fix spare parts window position on start.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcgamboa committed Mar 3, 2024
1 parent 6c1b4ec commit d106025
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/boards/board_Blue_Pill.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ cboard_Blue_Pill::cboard_Blue_Pill(void) {
master_uart[2].rx_pin = 0;

bitbang_pwm_init(&pwm_out, this, 20);
bitbang_out_init(&rmt_out, this, 0);

PICSimLab.UpdateGUI(MIPS, GT_COMBO, GA_ADD, (void*)"Qemu CPU MIPS");
buffer[0] = ',';
Expand All @@ -278,6 +279,10 @@ cboard_Blue_Pill::~cboard_Blue_Pill(void) {
// Reset board status

void cboard_Blue_Pill::Reset(void) {
if (qemu_started != 1) {
return;
}

MReset(1);

PICSimLab.UpdateStatus(PS_SERIAL, "Serial: " + std::string(SERIALDEVICE));
Expand Down
1 change: 1 addition & 0 deletions src/boards/board_STM32_H103.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ cboard_STM32_H103::cboard_STM32_H103(void) {
master_uart[2].rx_pin = 0;

bitbang_pwm_init(&pwm_out, this, 20);
bitbang_out_init(&rmt_out, this, 0);

PICSimLab.UpdateGUI(MIPS, GT_COMBO, GA_ADD, (void*)"Qemu CPU MIPS");
buffer[0] = ',';
Expand Down
5 changes: 5 additions & 0 deletions src/picsimlab1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,11 @@ void CPWindow1::_EvOnCreate(CControl* control) {
PICSimLab.OnWindowCmd = &CPWindow1::OnWindowCmd;
PICSimLab.OnSystemCmd = &CPWindow1::OnSystemCmd;

SpareParts.OnCanvasCmd = &CPWindow5::OnCanvasCmd;
SpareParts.OnWindowCmd = &CPWindow5::OnWindowCmd;

Oscilloscope.OnWindowCmd = &CPWindow4::OnWindowCmd;

PICSimLab.Init();

// board menu
Expand Down
1 change: 0 additions & 1 deletion src/picsimlab4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ void CPWindow4::_EvOnCreate(CControl* control) {
? ("PICSimLab[" + std::to_string(PICSimLab.GetInstanceNumber()) + "] - ")
: ("PICSimLab - ")) +
"Oscilloscope");
Oscilloscope.OnWindowCmd = &CPWindow4::OnWindowCmd;
}

void CPWindow4::_EvOnShow(CControl* control) {
Expand Down
3 changes: 0 additions & 3 deletions src/picsimlab5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ void CPWindow5::menu1_EvMenuActive(CControl* control) {
}

void CPWindow5::_EvOnCreate(CControl* control) {
SpareParts.OnCanvasCmd = &CPWindow5::OnCanvasCmd;
SpareParts.OnWindowCmd = &CPWindow5::OnWindowCmd;

if (SpareParts.GetLoadConfigFile().length() > 0)
SpareParts.LoadConfig(SpareParts.GetLoadConfigFile());

Expand Down

0 comments on commit d106025

Please sign in to comment.