mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:49:51 +08:00
Honor micro hal
This commit is contained in:
committed by
Lorenz Meier
parent
9db89ea4cf
commit
ddb9bc3242
@@ -545,7 +545,7 @@ HC_SR04::measure()
|
||||
usleep(10); // 10us
|
||||
px4_arch_gpiowrite(_gpio_tab[_cycle_counter].trig_port, false);
|
||||
|
||||
stm32_gpiosetevent(_gpio_tab[_cycle_counter].echo_port, true, true, false, sonar_isr);
|
||||
px4_arch_gpiosetevent(_gpio_tab[_cycle_counter].echo_port, true, true, false, sonar_isr);
|
||||
_status = 0;
|
||||
ret = OK;
|
||||
|
||||
@@ -562,7 +562,7 @@ HC_SR04::collect()
|
||||
/* read from the sensor */
|
||||
if (_status != 2) {
|
||||
DEVICE_DEBUG("erro sonar %d ,status=%d", _cycle_counter, _status);
|
||||
stm32_gpiosetevent(_gpio_tab[_cycle_counter].echo_port, true, true, false, nullptr);
|
||||
px4_arch_gpiosetevent(_gpio_tab[_cycle_counter].echo_port, true, true, false, nullptr);
|
||||
perf_end(_sample_perf);
|
||||
return (ret);
|
||||
}
|
||||
@@ -629,7 +629,7 @@ HC_SR04::collect()
|
||||
|
||||
ret = OK;
|
||||
|
||||
stm32_gpiosetevent(_gpio_tab[_cycle_counter].echo_port, true, true, false, nullptr); /* close interrupt */
|
||||
px4_arch_gpiosetevent(_gpio_tab[_cycle_counter].echo_port, true, true, false, nullptr); /* close interrupt */
|
||||
perf_end(_sample_perf);
|
||||
#endif
|
||||
return ret;
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
#include "up_internal.h"
|
||||
#include "up_arch.h"
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_gpio.h"
|
||||
#include "stm32_tim.h"
|
||||
#include <systemlib/err.h>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
* @author Lorenz Meier <lorenz@px4.io>
|
||||
*/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <px4_config.h>
|
||||
#include <systemlib/param/param.h>
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,8 +58,7 @@
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <drivers/drv_adc.h>
|
||||
|
||||
#include <arch/stm32/chip.h>
|
||||
#include <stm32.h>
|
||||
#include <stm32_adc.h>
|
||||
#include <stm32_gpio.h>
|
||||
|
||||
#include <systemlib/err.h>
|
||||
@@ -68,6 +67,7 @@
|
||||
#include <uORB/topics/system_power.h>
|
||||
#include <uORB/topics/adc_report.h>
|
||||
|
||||
#if defined(ADC_CHANNELS)
|
||||
/*
|
||||
* Register accessors.
|
||||
* For now, no reason not to just use ADC1.
|
||||
@@ -363,6 +363,7 @@ ADC::update_system_power(hrt_abstime now)
|
||||
*/
|
||||
// these are not ADC related, but it is convenient to
|
||||
// publish these to the same topic
|
||||
|
||||
system_power.usb_connected = BOARD_ADC_USB_CONNECTED;
|
||||
|
||||
system_power.brick_valid = BOARD_ADC_BRICK_VALID;
|
||||
@@ -482,3 +483,4 @@ adc_main(int argc, char *argv[])
|
||||
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -76,11 +76,6 @@
|
||||
|
||||
#include "drv_input_capture.h"
|
||||
|
||||
#include <chip.h>
|
||||
#include <up_internal.h>
|
||||
#include <up_arch.h>
|
||||
|
||||
#include <stm32.h>
|
||||
#include <stm32_gpio.h>
|
||||
#include <stm32_tim.h>
|
||||
|
||||
|
||||
@@ -60,11 +60,6 @@
|
||||
|
||||
#include "drv_io_timer.h"
|
||||
|
||||
#include <chip.h>
|
||||
#include <up_internal.h>
|
||||
#include <up_arch.h>
|
||||
|
||||
#include <stm32.h>
|
||||
#include <stm32_gpio.h>
|
||||
#include <stm32_tim.h>
|
||||
|
||||
|
||||
@@ -61,11 +61,6 @@
|
||||
#include "drv_io_timer.h"
|
||||
#include "drv_pwm_servo.h"
|
||||
|
||||
#include <chip.h>
|
||||
#include <up_internal.h>
|
||||
#include <up_arch.h>
|
||||
|
||||
#include <stm32.h>
|
||||
#include <stm32_tim.h>
|
||||
|
||||
int up_pwm_servo_set(unsigned channel, servo_position_t value)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2013 PX4 Development Team. All rights reserved.
|
||||
* Copyright (C) 2013, 2016 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -107,14 +107,6 @@
|
||||
#include <board_config.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
|
||||
#include <arch/stm32/chip.h>
|
||||
#include <up_internal.h>
|
||||
#include <up_arch.h>
|
||||
|
||||
#include <stm32.h>
|
||||
#include <stm32_gpio.h>
|
||||
#include <stm32_tim.h>
|
||||
|
||||
#include <systemlib/err.h>
|
||||
#include <systemlib/circuit_breaker.h>
|
||||
|
||||
@@ -830,7 +822,7 @@ ToneAlarm::next_note()
|
||||
|
||||
// tune looks bad (unexpected EOF, bad character, etc.)
|
||||
tune_error:
|
||||
lowsyslog("tune error\n");
|
||||
syslog(LOG_ERR, "tune error\n");
|
||||
_repeat = false; // don't loop on error
|
||||
|
||||
// stop (and potentially restart) the tune
|
||||
|
||||
Reference in New Issue
Block a user