Update to 2.0.6
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -100,7 +100,7 @@ const uint8_t adc_pins[] = {
|
||||
#if HAS_HEATED_BED
|
||||
TEMP_BED_PIN,
|
||||
#endif
|
||||
#if HAS_HEATED_CHAMBER
|
||||
#if HAS_TEMP_CHAMBER
|
||||
TEMP_CHAMBER_PIN,
|
||||
#endif
|
||||
#if HAS_TEMP_ADC_1
|
||||
@@ -139,16 +139,22 @@ const uint8_t adc_pins[] = {
|
||||
#if HAS_JOY_ADC_Z
|
||||
JOY_Z_PIN,
|
||||
#endif
|
||||
#if ENABLED(POWER_MONITOR_CURRENT)
|
||||
POWER_MONITOR_CURRENT_PIN,
|
||||
#endif
|
||||
#if ENABLED(POWER_MONITOR_VOLTAGE)
|
||||
POWER_MONITOR_VOLTAGE_PIN,
|
||||
#endif
|
||||
};
|
||||
|
||||
enum TEMP_PINS : char {
|
||||
enum TempPinIndex : char {
|
||||
#if HAS_TEMP_ADC_0
|
||||
TEMP_0,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
TEMP_BED,
|
||||
#endif
|
||||
#if HAS_HEATED_CHAMBER
|
||||
#if HAS_TEMP_CHAMBER
|
||||
TEMP_CHAMBER,
|
||||
#endif
|
||||
#if HAS_TEMP_ADC_1
|
||||
@@ -187,6 +193,12 @@ enum TEMP_PINS : char {
|
||||
#if HAS_JOY_ADC_Z
|
||||
JOY_Z,
|
||||
#endif
|
||||
#if ENABLED(POWER_MONITOR_CURRENT)
|
||||
POWERMON_CURRENT,
|
||||
#endif
|
||||
#if ENABLED(POWER_MONITOR_VOLTAGE)
|
||||
POWERMON_VOLTS,
|
||||
#endif
|
||||
ADC_PIN_COUNT
|
||||
};
|
||||
|
||||
@@ -246,7 +258,7 @@ void HAL_init() {
|
||||
// HAL idle task
|
||||
void HAL_idletask() {
|
||||
#ifdef USE_USB_COMPOSITE
|
||||
#if ENABLED(SHARED_SD_CARD)
|
||||
#if HAS_SHARED_MEDIA
|
||||
// If Marlin is using the SD card we need to lock it to prevent access from
|
||||
// a PC via USB.
|
||||
// Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but
|
||||
@@ -254,7 +266,7 @@ void HAL_idletask() {
|
||||
// the disk if Marlin has it mounted. Unfortunately there is currently no way
|
||||
// to unmount the disk from the LCD menu.
|
||||
// if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
|
||||
/* copy from lpc1768 framework, should be fixed later for process SHARED_SD_CARD*/
|
||||
/* copy from lpc1768 framework, should be fixed later for process HAS_SHARED_MEDIA*/
|
||||
#endif
|
||||
// process USB mass storage device class loop
|
||||
MarlinMSC.loop();
|
||||
@@ -265,9 +277,8 @@ void HAL_clear_reset_source() { }
|
||||
|
||||
/**
|
||||
* TODO: Check this and change or remove.
|
||||
* currently returns 1 that's equal to poweron reset.
|
||||
*/
|
||||
uint8_t HAL_get_reset_source() { return 1; }
|
||||
uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
|
||||
|
||||
void _delay_ms(const int delay_ms) { delay(delay_ms); }
|
||||
|
||||
@@ -323,7 +334,8 @@ void HAL_adc_init() {
|
||||
}
|
||||
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
||||
TEMP_PINS pin_index;
|
||||
//TEMP_PINS pin_index;
|
||||
TempPinIndex pin_index;
|
||||
switch (adc_pin) {
|
||||
default: return;
|
||||
#if HAS_TEMP_ADC_0
|
||||
@@ -332,7 +344,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
||||
#if HAS_HEATED_BED
|
||||
case TEMP_BED_PIN: pin_index = TEMP_BED; break;
|
||||
#endif
|
||||
#if HAS_HEATED_CHAMBER
|
||||
#if HAS_TEMP_CHAMBER
|
||||
case TEMP_CHAMBER_PIN: pin_index = TEMP_CHAMBER; break;
|
||||
#endif
|
||||
#if HAS_TEMP_ADC_1
|
||||
@@ -371,6 +383,12 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
||||
#if ENABLED(ADC_KEYPAD)
|
||||
case ADC_KEYPAD_PIN: pin_index = ADC_KEY; break;
|
||||
#endif
|
||||
#if ENABLED(POWER_MONITOR_CURRENT)
|
||||
case POWER_MONITOR_CURRENT_PIN: pin_index = POWERMON_CURRENT; break;
|
||||
#endif
|
||||
#if ENABLED(POWER_MONITOR_VOLTAGE)
|
||||
case POWER_MONITOR_VOLTAGE_PIN: pin_index = POWERMON_VOLTS; break;
|
||||
#endif
|
||||
}
|
||||
HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user