mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
ahrscomms: remove unused sync and switch_proto messages
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1582 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
80c92ba54b
commit
d1dc300081
@ -678,16 +678,6 @@ void process_spi_request(void)
|
||||
//dump_spi_message(PIOS_COM_AUX, "+", (uint8_t *)&user_rx_v1, sizeof(user_rx_v1));
|
||||
|
||||
switch (user_rx_v1.payload.user.t) {
|
||||
case OPAHRS_MSG_V1_REQ_SYNC:
|
||||
opahrs_msg_v1_init_user_tx (&user_tx_v1, OPAHRS_MSG_V1_RSP_SYNC);
|
||||
user_tx_v1.payload.user.v.rsp.sync.i_am_a_bootloader = FALSE;
|
||||
user_tx_v1.payload.user.v.rsp.sync.hw_version = 1;
|
||||
user_tx_v1.payload.user.v.rsp.sync.bl_version = 2;
|
||||
user_tx_v1.payload.user.v.rsp.sync.fw_version = 3;
|
||||
user_tx_v1.payload.user.v.rsp.sync.cookie = user_rx_v1.payload.user.v.req.sync.cookie;
|
||||
dump_spi_message(PIOS_COM_AUX, "S", (uint8_t *)&user_tx_v1, sizeof(user_tx_v1));
|
||||
lfsm_user_set_tx_v1 (&user_tx_v1);
|
||||
break;
|
||||
case OPAHRS_MSG_V1_REQ_RESET:
|
||||
PIOS_DELAY_WaitmS(user_rx_v1.payload.user.v.req.reset.reset_delay_in_ms);
|
||||
PIOS_SYS_Reset();
|
||||
|
@ -224,29 +224,6 @@ enum opahrs_result PIOS_OPAHRS_resync(void)
|
||||
return rc;
|
||||
}
|
||||
|
||||
enum opahrs_result PIOS_OPAHRS_Sync(struct opahrs_msg_v1 *rsp)
|
||||
{
|
||||
struct opahrs_msg_v1 req;
|
||||
enum opahrs_result rc;
|
||||
|
||||
if (!rsp) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Make up a sync request */
|
||||
opahrs_msg_v1_init_user_tx (&req, OPAHRS_MSG_V1_REQ_SYNC);
|
||||
req.payload.user.v.req.sync.cookie = 0xDEADBEEF;
|
||||
|
||||
/* Send the message until it is received */
|
||||
rc = opahrs_msg_v1_send_req (&req);
|
||||
if (rc != OPAHRS_RESULT_OK) {
|
||||
/* Failed to send the request, bail out */
|
||||
return rc;
|
||||
}
|
||||
|
||||
return opahrs_msg_v1_recv_rsp (OPAHRS_MSG_V1_RSP_SYNC, rsp);
|
||||
}
|
||||
|
||||
enum opahrs_result PIOS_OPAHRS_GetAttitudeRaw(struct opahrs_msg_v1 *rsp)
|
||||
{
|
||||
struct opahrs_msg_v1 req;
|
||||
|
@ -67,18 +67,18 @@ struct opahrs_msg_link {
|
||||
struct opahrs_msg_v0_req_nop {
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_req_sync {
|
||||
uint32_t cookie;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_req_serial {
|
||||
struct opahrs_msg_v0_req_versions {
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_req_reset {
|
||||
uint32_t reset_delay_in_ms;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_req_switch_proto {
|
||||
struct opahrs_msg_v0_req_boot {
|
||||
uint32_t boot_delay_in_ms;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_req_serial {
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_req_fwup_start {
|
||||
@ -93,12 +93,10 @@ struct opahrs_msg_v0_req_fwup_verify {
|
||||
union opahrs_msg_v0_req {
|
||||
/* Mandatory for all bootloader and all application loads */
|
||||
struct opahrs_msg_v0_req_nop nop;
|
||||
struct opahrs_msg_v0_req_sync sync;
|
||||
struct opahrs_msg_v0_req_serial serial;
|
||||
struct opahrs_msg_v0_req_reset reset;
|
||||
|
||||
/* Only implemented by the application */
|
||||
struct opahrs_msg_v0_req_switch_proto switch_proto;
|
||||
|
||||
/* Only implemented by bootloaders */
|
||||
struct opahrs_msg_v0_req_fwup_start fwup_start;
|
||||
@ -106,16 +104,6 @@ union opahrs_msg_v0_req {
|
||||
struct opahrs_msg_v0_req_fwup_verify fwup_verify;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_rsp_sync {
|
||||
uint8_t i_am_a_bootloader;
|
||||
uint8_t hw_version;
|
||||
uint16_t bl_version;
|
||||
uint32_t fw_version;
|
||||
|
||||
uint32_t cookie;
|
||||
uint32_t alternate_proto_version;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v0_rsp_serial {
|
||||
uint8_t serial_bcd[24];
|
||||
} __attribute__((__packed__));
|
||||
@ -125,7 +113,6 @@ struct opahrs_msg_v0_rsp_fwup_status {
|
||||
|
||||
union opahrs_msg_v0_rsp {
|
||||
/* Mandatory for all bootloader and all application loads */
|
||||
struct opahrs_msg_v0_rsp_sync sync;
|
||||
struct opahrs_msg_v0_rsp_serial serial;
|
||||
|
||||
/* Only implemented by bootloaders */
|
||||
@ -134,16 +121,13 @@ union opahrs_msg_v0_rsp {
|
||||
|
||||
enum opahrs_msg_v0_tag {
|
||||
OPAHRS_MSG_V0_REQ_NOP = 0x00,
|
||||
OPAHRS_MSG_V0_REQ_SYNC,
|
||||
OPAHRS_MSG_V0_REQ_RESET,
|
||||
OPAHRS_MSG_V0_REQ_SERIAL,
|
||||
OPAHRS_MSG_V0_REQ_SWITCH_PROTO,
|
||||
|
||||
OPAHRS_MSG_V0_REQ_FWUP_START,
|
||||
OPAHRS_MSG_V0_REQ_FWUP_DATA,
|
||||
OPAHRS_MSG_V0_REQ_FWUP_VERIFY,
|
||||
|
||||
OPAHRS_MSG_V0_RSP_SYNC,
|
||||
OPAHRS_MSG_V0_RSP_SERIAL,
|
||||
OPAHRS_MSG_V0_RSP_FWUP_STATUS,
|
||||
};
|
||||
@ -173,10 +157,6 @@ struct opahrs_msg_v0 {
|
||||
struct opahrs_msg_v1_req_nop {
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v1_req_sync {
|
||||
uint32_t cookie;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v1_req_reset {
|
||||
uint32_t reset_delay_in_ms;
|
||||
} __attribute__((__packed__));
|
||||
@ -227,7 +207,6 @@ struct opahrs_msg_v1_req_calibration {
|
||||
|
||||
union opahrs_msg_v1_req {
|
||||
struct opahrs_msg_v1_req_nop nop;
|
||||
struct opahrs_msg_v1_req_sync sync;
|
||||
struct opahrs_msg_v1_req_reset reset;
|
||||
struct opahrs_msg_v1_req_serial serial;
|
||||
struct opahrs_msg_v1_req_update update;
|
||||
@ -237,15 +216,6 @@ union opahrs_msg_v1_req {
|
||||
struct opahrs_msg_v1_req_calibration calibration;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v1_rsp_sync {
|
||||
uint8_t i_am_a_bootloader;
|
||||
uint8_t hw_version;
|
||||
uint16_t bl_version;
|
||||
uint32_t fw_version;
|
||||
|
||||
uint32_t cookie;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct opahrs_msg_v1_rsp_serial {
|
||||
uint8_t serial_bcd[25];
|
||||
} __attribute__((__packed__));
|
||||
@ -307,7 +277,6 @@ struct opahrs_msg_v1_rsp_calibration {
|
||||
} __attribute__((__packed__));
|
||||
|
||||
union opahrs_msg_v1_rsp {
|
||||
struct opahrs_msg_v1_rsp_sync sync;
|
||||
struct opahrs_msg_v1_rsp_serial serial;
|
||||
struct opahrs_msg_v1_rsp_north north;
|
||||
struct opahrs_msg_v1_rsp_algorithm algorithm;
|
||||
@ -318,7 +287,6 @@ union opahrs_msg_v1_rsp {
|
||||
|
||||
enum opahrs_msg_v1_tag {
|
||||
OPAHRS_MSG_V1_REQ_NOP = 0x02000000,
|
||||
OPAHRS_MSG_V1_REQ_SYNC,
|
||||
OPAHRS_MSG_V1_REQ_RESET,
|
||||
OPAHRS_MSG_V1_REQ_SERIAL,
|
||||
OPAHRS_MSG_V1_REQ_NORTH,
|
||||
@ -327,7 +295,6 @@ enum opahrs_msg_v1_tag {
|
||||
OPAHRS_MSG_V1_REQ_ATTITUDERAW,
|
||||
OPAHRS_MSG_V1_REQ_CALIBRATION,
|
||||
|
||||
OPAHRS_MSG_V1_RSP_SYNC,
|
||||
OPAHRS_MSG_V1_RSP_SERIAL,
|
||||
OPAHRS_MSG_V1_RSP_NORTH,
|
||||
OPAHRS_MSG_V1_RSP_ALGORITHM,
|
||||
|
Loading…
Reference in New Issue
Block a user