Skip to content

Commit

Permalink
Update for change in Marlins HAL interface
Browse files Browse the repository at this point in the history
  • Loading branch information
p3p committed Feb 17, 2022
1 parent 9f21b26 commit e66170e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/MarlinSimulator/marlin_hal_impl/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,33 @@ int freeMemory() {
// ADC
// ------------------------

void HAL_adc_init() {
void MarlinHAL::adc_init() {

}

void HAL_adc_enable_channel(const uint8_t ch) {
void MarlinHAL::adc_enable(const uint8_t ch) {

}

uint8_t active_ch = 0;
void HAL_adc_start_conversion(const uint8_t ch) {
uint8_t MarlinHAL::active_ch = 0;
void MarlinHAL::adc_start(const uint8_t ch) {
active_ch = ch;
}

bool HAL_adc_finished() {
bool MarlinHAL::adc_ready() {
return true;
}

uint16_t HAL_adc_get_result() {
uint16_t MarlinHAL::adc_value() {
pin_t pin = analogInputToDigitalPin(active_ch);
if (!VALID_PIN(pin)) return 0;
uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF);
return data; // return 10bit value as Marlin expects
}

void HAL_pwm_init() {
void MarlinHAL::reboot() { /* Reset the application state and GPIO */ }

}

void HAL_reboot() { /* Reset the application state and GPIO */ }
void MarlinHAL::idletask() {}

// Maple Compatibility
volatile uint32_t systick_uptime_millis = 0;
Expand Down

0 comments on commit e66170e

Please sign in to comment.