Skip to content

Commit

Permalink
Fix GTM32_PRO_VB Serial and HAL via watchdog (MarlinFirmware#12753)
Browse files Browse the repository at this point in the history
Move `watchdog_reset` from `.h` to `.cpp` to eliminate the need to include `MarlinConfig.h` in a HAL-related file.
  • Loading branch information
Phr3d13 authored and thinkyhead committed Jan 3, 2019
1 parent 288340c commit 01f7559
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
#include <libmaple/iwdg.h>
#include "watchdog_STM32F1.h"

void watchdog_reset() {
#if PIN_EXISTS(LED)
TOGGLE(LED_PIN); // heartbeat indicator
#endif
iwdg_feed();
}

void watchdogSetup(void) {
// do whatever. don't remove this function.
}
Expand Down
9 changes: 1 addition & 8 deletions Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

#include <libmaple/iwdg.h>

#include "../../inc/MarlinConfig.h"

/**
* The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
* 625 reload value (counts down to 0)
Expand All @@ -43,9 +41,4 @@ void watchdog_init();

// Reset watchdog. MUST be called at least every 4 seconds after the
// first watchdog_init or STM32F1 will reset.
inline void watchdog_reset() {
#if PIN_EXISTS(LED)
TOGGLE(LED_PIN); // heart beat indicator
#endif
iwdg_feed();
}
void watchdog_reset();

0 comments on commit 01f7559

Please sign in to comment.