Changes to STM32F1 HAL (#8833)

Some to correct missing files from previous PR to completely avoid
HardwareTimer Class (reduce overhead). Some changes to formatting.
Changes to DMA ADC to work correctly.
Change to F1 sanity check.
This commit is contained in:
victorpv
2017-12-20 16:16:36 -06:00
committed by Scott Lahteine
parent 913d9e9a59
commit 2ec4113cb2
8 changed files with 129 additions and 99 deletions

View File

@@ -88,16 +88,30 @@ uint8 adc_pins[] = {
};
enum TEMP_PINS {
TEMP_0,
TEMP_1,
TEMP_2,
TEMP_3,
TEMP_4,
TEMP_BED,
FILWIDTH
#if HAS_TEMP_0
TEMP_0,
#endif
#if HAS_TEMP_1
TEMP_1,
#endif
#if HAS_TEMP_2
TEMP_2,
#endif
#if HAS_TEMP_3
TEMP_3,
#endif
#if HAS_TEMP_4
TEMP_4,
#endif
#if HAS_TEMP_BED
TEMP_BED,
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
FILWIDTH,
#endif
ADC_PIN_COUNT
};
#define ADC_PIN_COUNT (sizeof(adc_pins)/sizeof(adc_pins[0]))
uint16_t HAL_adc_results[ADC_PIN_COUNT];
@@ -181,13 +195,24 @@ void HAL_adc_init(void) {
void HAL_adc_start_conversion(const uint8_t adc_pin) {
TEMP_PINS pin_index;
switch (adc_pin) {
default:
case TEMP_0_PIN: pin_index = TEMP_0; break;
case TEMP_1_PIN: pin_index = TEMP_1; break;
case TEMP_2_PIN: pin_index = TEMP_2; break;
case TEMP_3_PIN: pin_index = TEMP_3; break;
case TEMP_4_PIN: pin_index = TEMP_4; break;
case TEMP_BED_PIN: pin_index = TEMP_BED; break;
#if HAS_TEMP_0
case TEMP_0_PIN: pin_index = TEMP_0; break;
#endif
#if HAS_TEMP_1
case TEMP_1_PIN: pin_index = TEMP_1; break;
#endif
#if HAS_TEMP_2
case TEMP_2_PIN: pin_index = TEMP_2; break;
#endif
#if HAS_TEMP_3
case TEMP_3_PIN: pin_index = TEMP_3; break;
#endif
#if HAS_TEMP_4
case TEMP_4_PIN: pin_index = TEMP_4; break;
#endif
#if HAS_TEMP_BED
case TEMP_BED_PIN: pin_index = TEMP_BED; break;
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
case FILWIDTH_PIN: pin_index = FILWIDTH; break;
#endif