Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
mavlink_bridge.h
00001 /* MAVLink adapter header */ 00002 #ifndef __MAVLINK_BRIDGE_HEADER_H 00003 #define __MAVLINK_BRIDGE_HEADER_H 00004 00005 #define MAVLINK_USE_CONVENIENCE_FUNCTIONS 00006 00007 #include "mavlink_types.h" 00008 00009 /* Struct that stores the communication settings of this system. 00010 you can also define / alter these settings elsewhere, as long 00011 as they're included BEFORE mavlink.h. 00012 So you can set the 00013 00014 mavlink_system.sysid = 100; // System ID, 1-255 00015 mavlink_system.compid = 50; // Component/Subsystem ID, 1-255 00016 00017 Lines also in your main.c, e.g. by reading these parameter from EEPROM. 00018 */ 00019 mavlink_system_t mavlink_system; 00020 00021 /** 00022 * @brief Send one char (uint8_t) over a comm channel 00023 * 00024 * @param chan MAVLink channel to use, usually MAVLINK_COMM_0 = UART0 00025 * @param ch Character to send 00026 */ 00027 static inline void comm_send_ch(mavlink_channel_t chan, uint8_t ch) { 00028 extern Serial pc; 00029 00030 if (chan == MAVLINK_COMM_0) { 00031 pc.putc(ch); 00032 } 00033 if (chan == MAVLINK_COMM_1) { 00034 // write to mavlink logfile 00035 } 00036 } 00037 00038 #include "protocol.h" 00039 #include "common/common.h" 00040 00041 #endif /* YOUR_MAVLINK_BRIDGE_HEADER_H *//* MAVLink adapter header */
Generated on Tue Jul 12 2022 14:09:25 by 1.7.2