mirror of https://github.com/Desuuuu/klipper.git
lcd_st7920: Check CONFIG_MACH_AVR for slow mcus
Use CONFIG_MACH_AVR instead of CONFIG_CLOCK_FREQ to check for slow mcus. Some fast MCUs do not export a high clock frequency. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
b55703d837
commit
1b79ffcad2
|
@ -4,7 +4,7 @@
|
||||||
//
|
//
|
||||||
// This file may be distributed under the terms of the GNU GPLv3 license.
|
// This file may be distributed under the terms of the GNU GPLv3 license.
|
||||||
|
|
||||||
#include "autoconf.h" // CONFIG_CLOCK_FREQ
|
#include "autoconf.h" // CONFIG_MACH_AVR
|
||||||
#include "basecmd.h" // oid_alloc
|
#include "basecmd.h" // oid_alloc
|
||||||
#include "board/gpio.h" // gpio_out_write
|
#include "board/gpio.h" // gpio_out_write
|
||||||
#include "board/irq.h" // irq_disable
|
#include "board/irq.h" // irq_disable
|
||||||
|
@ -32,7 +32,7 @@ nsecs_to_ticks(uint32_t ns)
|
||||||
static inline void
|
static inline void
|
||||||
ndelay(uint32_t nsecs)
|
ndelay(uint32_t nsecs)
|
||||||
{
|
{
|
||||||
if (CONFIG_CLOCK_FREQ <= 48000000)
|
if (CONFIG_MACH_AVR)
|
||||||
// Slower MCUs don't require a delay
|
// Slower MCUs don't require a delay
|
||||||
return;
|
return;
|
||||||
uint32_t end = timer_read_time() + nsecs_to_ticks(nsecs);
|
uint32_t end = timer_read_time() + nsecs_to_ticks(nsecs);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//
|
//
|
||||||
// This file may be distributed under the terms of the GNU GPLv3 license.
|
// This file may be distributed under the terms of the GNU GPLv3 license.
|
||||||
|
|
||||||
#include "autoconf.h" // CONFIG_CLOCK_FREQ
|
#include "autoconf.h" // CONFIG_MACH_AVR
|
||||||
#include "basecmd.h" // oid_alloc
|
#include "basecmd.h" // oid_alloc
|
||||||
#include "board/gpio.h" // gpio_out_write
|
#include "board/gpio.h" // gpio_out_write
|
||||||
#include "board/irq.h" // irq_poll
|
#include "board/irq.h" // irq_poll
|
||||||
|
@ -31,7 +31,7 @@ nsecs_to_ticks(uint32_t ns)
|
||||||
static inline void
|
static inline void
|
||||||
ndelay(uint32_t nsecs)
|
ndelay(uint32_t nsecs)
|
||||||
{
|
{
|
||||||
if (CONFIG_CLOCK_FREQ <= 48000000)
|
if (CONFIG_MACH_AVR)
|
||||||
// Slower MCUs don't require a delay
|
// Slower MCUs don't require a delay
|
||||||
return;
|
return;
|
||||||
uint32_t end = timer_read_time() + nsecs_to_ticks(nsecs);
|
uint32_t end = timer_read_time() + nsecs_to_ticks(nsecs);
|
||||||
|
|
Loading…
Reference in New Issue