Merge pull request #4862 from DavePutz/issue_3383

Fix for issue #3383 - SAMD5x microcontroller.cpu.voltage
This commit is contained in:
Jeff Epler 2021-06-09 14:42:27 -05:00 committed by GitHub
commit 26a75f74ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 11 deletions

View File

@ -279,9 +279,6 @@ float common_hal_mcu_processor_get_temperature(void) {
}
float common_hal_mcu_processor_get_voltage(void) {
#if MICROCONTROLLER_VOLTAGE_DISABLE
return NAN;
#else
struct adc_sync_descriptor adc;
static Adc *adc_insts[] = ADC_INSTS;
@ -292,6 +289,7 @@ float common_hal_mcu_processor_get_voltage(void) {
#endif
#ifdef SAM_D5X_E5X
hri_supc_clear_VREF_ONDEMAND_bit(SUPC);
hri_supc_set_VREF_SEL_bf(SUPC, SUPC_VREF_SEL_1V0_Val);
hri_supc_set_VREF_VREFOE_bit(SUPC);
@ -326,7 +324,6 @@ float common_hal_mcu_processor_get_voltage(void) {
adc_sync_deinit(&adc);
// Multiply by 4 to compensate for SCALEDIOVCC division by 4.
return (reading / 4095.0f) * 4.0f;
#endif
}
uint32_t common_hal_mcu_processor_get_frequency(void) {

View File

@ -73,9 +73,6 @@
#define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51"
#elif defined(SAME54)
#define MICROPY_PY_SYS_PLATFORM "MicroChip SAME54"
#ifndef MICROCONTROLLER_VOLTAGE_DISABLE
#define MICROCONTROLLER_VOLTAGE_DISABLE (1)
#endif
#endif
#define SPI_FLASH_MAX_BAUDRATE 24000000
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
@ -243,8 +240,4 @@
CIRCUITPY_COMMON_ROOT_POINTERS \
mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT];
#ifndef MICROCONTROLLER_VOLTAGE_DISABLE
#define MICROCONTROLLER_VOLTAGE_DISABLE (0)
#endif
#endif // __INCLUDED_MPCONFIGPORT_H