🐛 Fix some Simulator on Windows issues (#22516)

This commit is contained in:
Jason Smith
2021-08-08 19:25:17 -07:00
committed by Scott Lahteine
parent dc67705049
commit e3c294dc9b
10 changed files with 93 additions and 85 deletions

View File

@ -21,6 +21,8 @@
* Support routines for X86_64
*/
#pragma once
/**
* Translation of routines & variables used by pinsDebug.h
*/
@ -37,16 +39,16 @@
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
// active ADC function/mode/code values for PINSEL registers
constexpr int8_t ADC_pin_mode(pin_t pin) {
inline constexpr int8_t ADC_pin_mode(pin_t pin) {
return (-1);
}
int8_t get_pin_mode(pin_t pin) {
inline int8_t get_pin_mode(pin_t pin) {
if (!VALID_PIN(pin)) return -1;
return 0;
}
bool GET_PINMODE(pin_t pin) {
inline bool GET_PINMODE(pin_t pin) {
int8_t pin_mode = get_pin_mode(pin);
if (pin_mode == -1 || pin_mode == ADC_pin_mode(pin)) // found an invalid pin or active analog pin
return false;
@ -54,6 +56,6 @@ bool GET_PINMODE(pin_t pin) {
return (Gpio::getMode(pin) != 0); //input/output state
}
bool GET_ARRAY_IS_DIGITAL(pin_t pin) {
inline bool GET_ARRAY_IS_DIGITAL(pin_t pin) {
return (!IS_ANALOG(pin) || get_pin_mode(pin) != ADC_pin_mode(pin));
}

View File

@ -59,7 +59,7 @@
#if ENABLED(U8GLIB_ST7920)
#include <U8glib.h>
#include <U8glib-HAL.h>
#include "../../shared/Delay.h"
#undef SPI_SPEED

View File

@ -63,7 +63,7 @@
#define SPI_SPEED 2 // About 2 MHz
#include <Arduino.h>
#include <U8glib.h>
#include <U8glib-HAL.h>
#ifdef __cplusplus
extern "C" {
@ -209,7 +209,7 @@ uint8_t u8g_com_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt
#endif
#elif !ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI, HAS_MARLINUI_HD44780) && HAS_MARLINUI_U8GLIB
#include <U8glib.h>
#include <U8glib-HAL.h>
uint8_t u8g_com_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {return 0;}
#endif // HAS_MARLINUI_U8GLIB && !U8GLIB_ST7920
#endif // __PLAT_NATIVE_SIM__