mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
As David request
This commit is contained in:
@@ -116,6 +116,7 @@
|
|||||||
# error "ADC STM32_PLL2P_FREQUENCY too high - no divisor found "
|
# error "ADC STM32_PLL2P_FREQUENCY too high - no divisor found "
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ADC3_INTERNAL_TEMP_SENSOR_CHANNEL 18 //define to map the internal temperature channel.
|
||||||
|
|
||||||
int px4_arch_adc_init(uint32_t base_address)
|
int px4_arch_adc_init(uint32_t base_address)
|
||||||
{
|
{
|
||||||
@@ -276,8 +277,10 @@ uint32_t px4_arch_adc_sample(uint32_t base_address, unsigned channel)
|
|||||||
{
|
{
|
||||||
irqstate_t flags = px4_enter_critical_section();
|
irqstate_t flags = px4_enter_critical_section();
|
||||||
|
|
||||||
if (channel > PX4_ADC_ADC3_CHANNEL_OFFSET) {
|
/* Add a channel mapping for ADC3 on the H7 */
|
||||||
channel = channel - PX4_ADC_ADC3_CHANNEL_OFFSET;
|
|
||||||
|
if (channel == PX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL) {
|
||||||
|
channel = ADC3_INTERNAL_TEMP_SENSOR_CHANNEL;
|
||||||
base_address = STM32_ADC3_BASE;
|
base_address = STM32_ADC3_BASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ int stm32h7_flash_lock(size_t addr);
|
|||||||
int stm32h7_flash_unlock(size_t addr);
|
int stm32h7_flash_unlock(size_t addr);
|
||||||
int stm32h7_flash_writeprotect(size_t block, bool enabled);
|
int stm32h7_flash_writeprotect(size_t block, bool enabled);
|
||||||
#define stm32_flash_lock() stm32h7_flash_lock(PX4_FLASH_BASE)
|
#define stm32_flash_lock() stm32h7_flash_lock(PX4_FLASH_BASE)
|
||||||
#define PX4_ADC_ADC3_CHANNEL_OFFSET 7
|
|
||||||
#define PX4_ADC_ADC3_BASE STM32_ADC3_BASE
|
#define PX4_ADC_ADC3_BASE STM32_ADC3_BASE
|
||||||
#define PX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL (18 + PX4_ADC_ADC3_CHANNEL_OFFSET) //Valid for ADC3 on H7x3
|
#define PX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL (20) //Valid for ADC3 on H7x3
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|||||||
Reference in New Issue
Block a user