update code base to Marlin 2.0.9.2
This commit is contained in:
35
Marlin/src/HAL/LPC1768/HAL.cpp
Executable file → Normal file
35
Marlin/src/HAL/LPC1768/HAL.cpp
Executable file → Normal file
@@ -16,10 +16,9 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef TARGET_LPC1768
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
@@ -30,21 +29,18 @@
|
||||
#include "watchdog.h"
|
||||
#endif
|
||||
|
||||
DefaultSerial1 USBSerial(false, UsbSerial);
|
||||
|
||||
uint32_t HAL_adc_reading = 0;
|
||||
|
||||
// U8glib required functions
|
||||
extern "C" void u8g_xMicroDelay(uint16_t val) {
|
||||
DELAY_US(val);
|
||||
}
|
||||
extern "C" void u8g_MicroDelay() {
|
||||
u8g_xMicroDelay(1);
|
||||
}
|
||||
extern "C" void u8g_10MicroDelay() {
|
||||
u8g_xMicroDelay(10);
|
||||
}
|
||||
extern "C" void u8g_Delay(uint16_t val) {
|
||||
delay(val);
|
||||
extern "C" {
|
||||
void u8g_xMicroDelay(uint16_t val) { DELAY_US(val); }
|
||||
void u8g_MicroDelay() { u8g_xMicroDelay(1); }
|
||||
void u8g_10MicroDelay() { u8g_xMicroDelay(10); }
|
||||
void u8g_Delay(uint16_t val) { delay(val); }
|
||||
}
|
||||
|
||||
//************************//
|
||||
|
||||
// return free heap space
|
||||
@@ -67,12 +63,15 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) {
|
||||
return ind > -1 ? ind : dval;
|
||||
}
|
||||
|
||||
void flashFirmware(const int16_t) { NVIC_SystemReset(); }
|
||||
void flashFirmware(const int16_t) {
|
||||
delay(500); // Give OS time to disconnect
|
||||
USB_Connect(false); // USB clear connection
|
||||
delay(1000); // Give OS time to notice
|
||||
HAL_reboot();
|
||||
}
|
||||
|
||||
void HAL_clear_reset_source(void) {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
watchdog_clear_timeout_flag();
|
||||
#endif
|
||||
TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag());
|
||||
}
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
@@ -82,4 +81,6 @@ uint8_t HAL_get_reset_source(void) {
|
||||
return RST_POWER_ON;
|
||||
}
|
||||
|
||||
void HAL_reboot() { NVIC_SystemReset(); }
|
||||
|
||||
#endif // TARGET_LPC1768
|
||||
|
Reference in New Issue
Block a user