️ Refactor still needs work

Reverting #23295
This commit is contained in:
Scott Lahteine
2021-12-25 23:15:17 -06:00
parent 00e6e90648
commit 6a8b9274a3
69 changed files with 1301 additions and 1771 deletions

View File

@@ -24,12 +24,6 @@
#include "../../inc/MarlinConfig.h"
#include "../shared/Delay.h"
extern MarlinHAL hal;
// ------------------------
// Serial ports
// ------------------------
MSerialT usb_serial(TERN0(EMERGENCY_PARSER, true));
// U8glib required functions
@@ -43,21 +37,42 @@ extern "C" {
//************************//
// return free heap space
int freeMemory() { return 0; }
int freeMemory() {
return 0;
}
// ------------------------
// ADC
// ------------------------
uint8_t MarlinHAL::active_ch = 0;
void HAL_adc_init() {
uint16_t MarlinHAL::adc_value() {
const pin_t pin = analogInputToDigitalPin(active_ch);
}
void HAL_adc_enable_channel(const uint8_t ch) {
}
uint8_t active_ch = 0;
void HAL_adc_start_conversion(const uint8_t ch) {
active_ch = ch;
}
bool HAL_adc_finished() {
return true;
}
uint16_t HAL_adc_get_result() {
pin_t pin = analogInputToDigitalPin(active_ch);
if (!VALID_PIN(pin)) return 0;
const uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF);
uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF);
return data; // return 10bit value as Marlin expects
}
void MarlinHAL::reboot() { /* Reset the application state and GPIO */ }
void HAL_pwm_init() {
}
void HAL_reboot() { /* Reset the application state and GPIO */ }
#endif // __PLAT_LINUX__