From 72082e54fb4213d775d4d9739d8615c3cd8a6a1e Mon Sep 17 00:00:00 2001 From: Voinea Dragos Date: Mon, 14 Jun 2021 09:17:06 +0300 Subject: [PATCH] HAS_SYSTEM_TIMER_0 --- .../prusa3dboards/cores/prusa_einsy_rambo/wiring.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IDE_Board_Manager/prusa3dboards/cores/prusa_einsy_rambo/wiring.c b/IDE_Board_Manager/prusa3dboards/cores/prusa_einsy_rambo/wiring.c index 22c9e68..3e14659 100644 --- a/IDE_Board_Manager/prusa3dboards/cores/prusa_einsy_rambo/wiring.c +++ b/IDE_Board_Manager/prusa3dboards/cores/prusa_einsy_rambo/wiring.c @@ -35,15 +35,15 @@ #define FRACT_INC ((MICROSECONDS_PER_TIMER0_OVERFLOW % 1000) >> 3) #define FRACT_MAX (1000 >> 3) +#ifdef HAS_SYSTEM_TIMER_0 volatile unsigned long timer0_overflow_count = 0; volatile unsigned long timer0_millis = 0; -//static unsigned char timer0_fract = 0; +static unsigned char timer0_fract = 0; // As of Prusa Firmware 3.8 we need to disable the Arduino's hardcoded TIMER0_OVF_vect // to be able to replace it with our own implementation for HW PWM heatbed control. // That's also the one and only reason we need to define our own "board" // for the Arduino IDE. -#if 0 #if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) ISR(TIM0_OVF_vect) @@ -68,8 +68,6 @@ ISR(TIMER0_OVF_vect) timer0_overflow_count++; } -#endif - unsigned long millis() { unsigned long m; @@ -124,6 +122,8 @@ void delay(unsigned long ms) } } +#endif //HAS_SYSTEM_TIMER_0 + /* Delay for the given number of microseconds. Assumes a 1, 8, 12, 16, 20 or 24 MHz clock. */ void delayMicroseconds(unsigned int us) {