mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
tropic: fix system power
This commit is contained in:
committed by
Daniel Agar
parent
5bec4d7aae
commit
8f2ede870e
@@ -19,7 +19,6 @@ param set-default SENS_EN_INA226 0
|
||||
param set-default BAT1_V_DIV 10.177939394
|
||||
param set-default BAT1_A_PER_V 15.391030303
|
||||
|
||||
|
||||
if [ -f "/fs/microsd/ipcfg-eth0" ]
|
||||
then
|
||||
else
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
@@ -142,7 +142,6 @@ CONFIG_NETDB_DNSCLIENT=y
|
||||
CONFIG_NETDB_DNSSERVER_NOADDR=y
|
||||
CONFIG_NETDEV_CAN_BITRATE_IOCTL=y
|
||||
CONFIG_NETDEV_CAN_FILTER_IOCTL=y
|
||||
CONFIG_NETDEV_IFINDEX=y
|
||||
CONFIG_NETDEV_LATEINIT=y
|
||||
CONFIG_NETDEV_PHY_IOCTL=y
|
||||
CONFIG_NETINIT_DHCPC=y
|
||||
|
||||
@@ -50,8 +50,10 @@
|
||||
#include "imxrt_gpio.h"
|
||||
#include "imxrt_iomuxc.h"
|
||||
#include "hardware/imxrt_pinmux.h"
|
||||
#include "hardware/imxrt_usb_analog.h"
|
||||
|
||||
#include <arch/board/board.h>
|
||||
#include <arm_internal.h>
|
||||
|
||||
/****************************************************************************************************
|
||||
* Definitions
|
||||
@@ -132,7 +134,7 @@
|
||||
|
||||
/* HW has to large of R termination on ADC todo:change when HW value is chosen */
|
||||
|
||||
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
|
||||
//#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
|
||||
|
||||
/* PWM
|
||||
*/
|
||||
@@ -185,6 +187,7 @@
|
||||
#define RC_SERIAL_SINGLEWIRE 1 // Suport Single wire wiring
|
||||
#define RC_SERIAL_SWAP_RXTX 1 // Set Swap (but not supported in HW) to use Single wire
|
||||
#define RC_SERIAL_SWAP_USING_SINGLEWIRE 1 // Set to use Single wire swap as HW does not support swap
|
||||
#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT
|
||||
|
||||
/* Safety Switch is HW version dependent on having an PX4IO
|
||||
* So we init to a benign state with the _INIT definition
|
||||
@@ -219,8 +222,20 @@
|
||||
* provides the true logic GPIO BOARD_ADC_xxxx macros.
|
||||
*/
|
||||
|
||||
//#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
|
||||
//#define BOARD_ADC_USB_CONNECTED (board_read_VBUS_state() == 0)
|
||||
#define BOARD_NUMBER_BRICKS 1
|
||||
|
||||
/* Use USB2 VBUS 4.7V comparator for valid check */
|
||||
static inline int board_read_usb2_vbus_state(void)
|
||||
{
|
||||
return (getreg32(IMXRT_USB_ANALOG_USB2_VBUS_DETECT_STAT) & USB_ANALOG_USB_VBUS_DETECT_STAT_VBUS_VALID) ? 0 : 1;
|
||||
}
|
||||
|
||||
#define BOARD_ADC_BRICK_VALID (board_read_usb2_vbus_state() == 0)
|
||||
|
||||
|
||||
|
||||
|
||||
#define BOARD_ADC_USB_CONNECTED (board_read_VBUS_state() == 0)
|
||||
|
||||
/* FMUv5 never powers odd the Servo rail */
|
||||
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
int imxrt_usb_initialize(void)
|
||||
{
|
||||
imxrt_clockall_usboh3();
|
||||
|
||||
// We abuse VBUS2 to check if system power checks VBUS gets below 4.7V
|
||||
putreg32(USB_ANALOG_USB_VBUS_DETECT_VBUSVALID_THRESH_4V7 | USB_ANALOG_USB_VBUS_DETECT_VBUSVALID_PWRUP_CMPS,
|
||||
IMXRT_USB_ANALOG_USB2_VBUS_DETECT);
|
||||
return 0;
|
||||
}
|
||||
/************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user