1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-19 09:54:15 +01:00

pipx: COM device ids are now 32bit not 8bit

The COM layer now uses 32bit device ids rather than
8bit.  All code that stores these ids must now use
uint32_t to hold them.

Since these 32bit numbers are really just opaque
pointers, it is (reasonably) safe to assume that
they won't be 0.  The logic around tracking the
*_previous_com_port could probably be cleaned up
to remove that assumption.

Missed this fixup in the recent hwinit changes.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2776 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
stac 2011-02-13 15:54:26 +00:00 committed by stac
parent f3bce1705b
commit 967bb9bb9c
3 changed files with 12 additions and 12 deletions

View File

@ -108,7 +108,7 @@ typedef struct
// *****************************************************************************
// local variables
int8_t apiconfig_previous_com_port = -1;
uint32_t apiconfig_previous_com_port = 0;
volatile uint16_t apiconfig_rx_config_timer = 0;
volatile uint16_t apiconfig_rx_timer = 0;
@ -455,7 +455,7 @@ void apiconfig_process(void)
// decide which comm-port we are using (usart or usb)
bool usb_comms = false; // TRUE if we are using the usb port for comms.
uint8_t comm_port = PIOS_COM_SERIAL; // default to using the usart comm-port
uint32_t comm_port = PIOS_COM_SERIAL; // default to using the usart comm-port
#if defined(PIOS_INCLUDE_USB_HID)
if (PIOS_USB_HID_CheckAvailable(0))
@ -468,7 +468,7 @@ void apiconfig_process(void)
// ********************
// check to see if the local communication port has changed (usart/usb)
if (apiconfig_previous_com_port < 0 && apiconfig_previous_com_port != comm_port)
if (apiconfig_previous_com_port == 0 && apiconfig_previous_com_port != comm_port)
{ // the local communications port has changed .. remove any data in the buffers
apiconfig_rx_buffer_wr = 0;
apiconfig_tx_buffer_wr = 0;
@ -691,7 +691,7 @@ void apiconfig_process(void)
void apiconfig_init(void)
{
apiconfig_previous_com_port = -1;
apiconfig_previous_com_port = 0;
apiconfig_rx_buffer_wr = 0;

View File

@ -155,7 +155,7 @@ static const uint8_t crc_table[256] = {
// *****************************************************************************
// local variables
int8_t api_previous_com_port = -1;
uint32_t api_previous_com_port = 0;
volatile uint16_t api_rx_timer = 0;
volatile uint16_t api_tx_timer = 0;
@ -299,7 +299,7 @@ void api_process(void)
// decide which comm-port we are using (usart or usb)
bool usb_comms = false; // TRUE if we are using the usb port for comms.
uint8_t comm_port = PIOS_COM_SERIAL; // default to using the usart comm-port
uint32_t comm_port = PIOS_COM_SERIAL; // default to using the usart comm-port
#if defined(PIOS_INCLUDE_USB_HID)
if (PIOS_USB_HID_CheckAvailable(0))
@ -312,7 +312,7 @@ void api_process(void)
// ********************
// check to see if the local communication port has changed (usart/usb)
if (api_previous_com_port < 0 && api_previous_com_port != comm_port)
if (api_previous_com_port == 0 && api_previous_com_port != comm_port)
{ // the local communications port has changed .. remove any data in the buffers
api_rx_buffer_wr = 0;
api_tx_buffer_wr = 0;
@ -487,7 +487,7 @@ void api_process(void)
void api_init(void)
{
api_previous_com_port = -1;
api_previous_com_port = 0;
api_rx_buffer_wr = 0;

View File

@ -38,7 +38,7 @@
// *****************************************************************************
// local variables
int8_t trans_previous_com_port = -1;
uint32_t trans_previous_com_port = 0;
volatile uint16_t trans_rx_timer = 0;
volatile uint16_t trans_tx_timer = 0;
@ -67,7 +67,7 @@ void trans_process(void)
// decide which comm-port we are using (usart or usb)
bool usb_comms = false; // TRUE if we are using the usb port for comms.
uint8_t comm_port = PIOS_COM_SERIAL; // default to using the usart comm-port
uint32_t comm_port = PIOS_COM_SERIAL; // default to using the usart comm-port
#if defined(PIOS_INCLUDE_USB_HID)
if (PIOS_USB_HID_CheckAvailable(0))
@ -80,7 +80,7 @@ void trans_process(void)
// ********************
// check to see if the local communication port has changed (usart/usb)
if (trans_previous_com_port < 0 && trans_previous_com_port != comm_port)
if (trans_previous_com_port == 0 && trans_previous_com_port != comm_port)
{ // the local communications port has changed .. remove any data in the buffers
trans_temp_buffer2_wr = 0;
}
@ -205,7 +205,7 @@ void trans_process(void)
void trans_init(void)
{
trans_previous_com_port = -1;
trans_previous_com_port = 0;
trans_temp_buffer2_wr = 0;