diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 88589ff..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -oroca_bldc/.dep/* -oroca_bldc/build/lst/* -oroca_bldc/build/oroca_bldc.dmp -oroca_bldc/build/oroca_bldc.elf -oroca_bldc/build/oroca_bldc.hex -oroca_bldc/build/oroca_bldc.map -oroca_bldc/build/obj/* \ No newline at end of file diff --git a/MAVLINK_msg/ASLUAV.xml b/MAVLINK_msg/ASLUAV.xml new file mode 100644 index 0000000..0c3e394 --- /dev/null +++ b/MAVLINK_msg/ASLUAV.xml @@ -0,0 +1,176 @@ + + + + + common.xml + + + + + Mission command to reset Maximum Power Point Tracker (MPPT) + MPPT number + Empty + Empty + Empty + Empty + Empty + Empty + + + Mission command to perform a power cycle on payload + Complete power cycle + VISensor power cycle + Empty + Empty + Empty + Empty + Empty + + + + + + Voltage and current sensor data + Power board voltage sensor reading in volts + Power board current sensor reading in amps + Board current sensor 1 reading in amps + Board current sensor 2 reading in amps + + + Maximum Power Point Tracker (MPPT) sensor data for solar module power performance tracking + MPPT last timestamp + MPPT1 voltage + MPPT1 current + MPPT1 pwm + MPPT1 status + MPPT2 voltage + MPPT2 current + MPPT2 pwm + MPPT2 status + MPPT3 voltage + MPPT3 current + MPPT3 pwm + MPPT3 status + + + ASL-fixed-wing controller data + Timestamp + ASLCTRL control-mode (manual, stabilized, auto, etc...) + See sourcecode for a description of these values... + + + Pitch angle [deg] + Pitch angle reference[deg] + + + + + + + Airspeed reference [m/s] + + Yaw angle [deg] + Yaw angle reference[deg] + Roll angle [deg] + Roll angle reference[deg] + + + + + + + + + ASL-fixed-wing controller debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + Debug data + + + Extended state information for ASLUAVs + Status of the position-indicator LEDs + Status of the IRIDIUM satellite communication system + Status vector for up to 8 servos + Motor RPM + + + + Extended EKF state estimates for ASLUAVs + Time since system start [us] + Magnitude of wind velocity (in lateral inertial plane) [m/s] + Wind heading angle from North [rad] + Z (Down) component of inertial wind velocity [m/s] + Magnitude of air velocity [m/s] + Sideslip angle [rad] + Angle of attack [rad] + + + Off-board controls/commands for ASLUAVs + Time since system start [us] + Elevator command [~] + Throttle command [~] + Throttle 2 command [~] + Left aileron command [~] + Right aileron command [~] + Rudder command [~] + Off-board computer status + + + Atmospheric sensors (temperature, humidity, ...) + Ambient temperature [degrees Celsius] + Relative humidity [%] + + + Battery pack monitoring data for Li-Ion batteries + Battery pack temperature in [deg C] + Battery pack voltage in [mV] + Battery pack current in [mA] + Battery pack state-of-charge + Battery monitor status report bits in Hex + Battery monitor serial number in Hex + Battery monitor sensor host FET control in Hex + Battery pack cell 1 voltage in [mV] + Battery pack cell 2 voltage in [mV] + Battery pack cell 3 voltage in [mV] + Battery pack cell 4 voltage in [mV] + Battery pack cell 5 voltage in [mV] + Battery pack cell 6 voltage in [mV] + + + Fixed-wing soaring (i.e. thermal seeking) data + Timestamp [ms] + Timestamp since last mode change[ms] + Updraft speed at current/local airplane position [m/s] + Thermal core updraft strength [m/s] + Thermal radius [m] + Thermal center latitude [deg] + Thermal center longitude [deg] + Variance W + Variance R + Variance Lat + Variance Lon + Suggested loiter radius [m] + Control Mode [-] + Data valid [-] + + + Monitoring of sensorpod status + Timestamp in linuxtime [ms] (since 1.1.1970) + Rate of ROS topic 1 + Rate of ROS topic 2 + Rate of ROS topic 3 + Rate of ROS topic 4 + Number of recording nodes + Temperature of sensorpod CPU in [deg C] + Free space available in recordings directory in [Gb] * 1e2 + + + diff --git a/MAVLINK_msg/ardupilotmega.xml b/MAVLINK_msg/ardupilotmega.xml new file mode 100644 index 0000000..e04c0b1 --- /dev/null +++ b/MAVLINK_msg/ardupilotmega.xml @@ -0,0 +1,1564 @@ + + + common.xml + + + + + + Mission command to perform motor test + motor sequence number (a number from 1 to max number of motors on the vehicle) + throttle type (0=throttle percentage, 1=PWM, 2=pilot throttle channel pass-through. See MOTOR_TEST_THROTTLE_TYPE enum) + throttle + timeout (in seconds) + Empty + Empty + Empty + + + + Mission command to operate EPM gripper + gripper number (a number from 1 to max number of grippers on the vehicle) + gripper action (0=release, 1=grab. See GRIPPER_ACTIONS enum) + Empty + Empty + Empty + Empty + Empty + + + + Enable/disable autotune + enable (1: enable, 0:disable) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Mission command to wait for an altitude or downwards vertical speed. This is meant for high altitude balloon launches, allowing the aircraft to be idle until either an altitude is reached or a negative vertical speed is reached (indicating early balloon burst). The wiggle time is how often to wiggle the control surfaces to prevent them seizing up. + altitude (m) + descent speed (m/s) + Wiggle Time (s) + Empty + Empty + Empty + Empty + + + + A system wide power-off event has been initiated. + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + + + FLY button has been clicked. + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + + FLY button has been held for 1.5 seconds. + Takeoff altitude + Empty + Empty + Empty + Empty + Empty + Empty + + + + PAUSE button has been clicked. + 1 if Solo is in a shot mode, 0 otherwise + Empty + Empty + Empty + Empty + Empty + Empty + + + + Initiate a magnetometer calibration + uint8_t bitmask of magnetometers (0 means all) + Automatically retry on failure (0=no retry, 1=retry). + Save without user input (0=require input, 1=autosave). + Delay (seconds) + Autoreboot (0=user reboot, 1=autoreboot) + Empty + Empty + + + + Initiate a magnetometer calibration + uint8_t bitmask of magnetometers (0 means all) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Cancel a running magnetometer calibration + uint8_t bitmask of magnetometers (0 means all) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Reply with the version banner + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + + Causes the gimbal to reset and boot as if it was just powered on + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + + Command autopilot to get into factory test/diagnostic mode + 0 means get out of test mode, 1 means get into test mode + Empty + Empty + Empty + Empty + Empty + Empty + + + + Reports progress and success or failure of gimbal axis calibration procedure + Gimbal axis we're reporting calibration progress for + Current calibration progress for this axis, 0x64=100% + Status of the calibration + Empty + Empty + Empty + Empty + + + + Starts commutation calibration on the gimbal + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + + Erases gimbal application and parameters + Magic number + Magic number + Magic number + Magic number + Magic number + Magic number + Magic number + + + + + + + pre-initialization + + + + disabled + + + + checking limits + + + + a limit has been breached + + + + taking action eg. RTL + + + + we're no longer in breach of a limit + + + + + + + pre-initialization + + + + disabled + + + + checking limits + + + + + + Flags in RALLY_POINT message + + Flag set when requiring favorable winds for landing. + + + + Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land. + + + + + + + Disable parachute release + + + + Enable parachute release + + + + Release parachute + + + + + + + throttle as a percentage from 0 ~ 100 + + + + throttle as an absolute PWM value (normally in range of 1000~2000) + + + + throttle pass-through from pilot's transmitter + + + + + + Gripper actions. + + gripper release of cargo + + + + gripper grabs onto cargo + + + + + + + Camera heartbeat, announce camera component ID at 1hz + + + + Camera image triggered + + + + Camera connection lost + + + + Camera unknown error + + + + Camera battery low. Parameter p1 shows reported voltage + + + + Camera storage low. Parameter p1 shows reported shots remaining + + + + Camera storage low. Parameter p1 shows reported video minutes remaining + + + + + + + Shooting photos, not video + + + + Shooting video, not stills + + + + Unable to achieve requested exposure (e.g. shutter speed too low) + + + + Closed loop feedback from camera, we know for sure it has successfully taken a picture + + + + Open loop camera, an image trigger has been requested but we can't know for sure it has successfully taken a picture + + + + + + + Gimbal is powered on but has not started initializing yet + + + + Gimbal is currently running calibration on the pitch axis + + + + Gimbal is currently running calibration on the roll axis + + + + Gimbal is currently running calibration on the yaw axis + + + + Gimbal has finished calibrating and initializing, but is relaxed pending reception of first rate command from copter + + + + Gimbal is actively stabilizing + + + + Gimbal is relaxed because it missed more than 10 expected rate command messages in a row. Gimbal will move back to active mode when it receives a new rate command + + + + + + Gimbal yaw axis + + + + Gimbal pitch axis + + + + Gimbal roll axis + + + + + + Axis calibration is in progress + + + + Axis calibration succeeded + + + + Axis calibration failed + + + + + + Whether or not this axis requires calibration is unknown at this time + + + + This axis requires calibration + + + + This axis does not require calibration + + + + + + + No GoPro connected + + + + The detected GoPro is not HeroBus compatible + + + + A HeroBus compatible GoPro is connected + + + + An unrecoverable error was encountered with the connected GoPro, it may require a power cycle + + + + + + + GoPro is currently recording + + + + + + The write message with ID indicated succeeded + + + + The write message with ID indicated failed + + + + + + (Get/Set) + + + + (Get/Set) + + + + (___/Set) + + + + (Get/___) + + + + (Get/___) + + + + (Get/Set) + + + + + (Get/Set) + + + + (Get/Set) + + + + (Get/Set) + + + + (Get/Set) + + + + (Get/Set) Hero 3+ Only + + + + (Get/Set) Hero 3+ Only + + + + (Get/Set) Hero 3+ Only + + + + (Get/Set) Hero 3+ Only + + + + (Get/Set) Hero 3+ Only + + + + (Get/Set) + + + + + (Get/Set) + + + + + + Video mode + + + + Photo mode + + + + Burst mode, hero 3+ only + + + + Time lapse mode, hero 3+ only + + + + Multi shot mode, hero 4 only + + + + Playback mode, hero 4 only, silver only except when LCD or HDMI is connected to black + + + + Playback mode, hero 4 only + + + + Mode not yet known + + + + + + 848 x 480 (480p) + + + + 1280 x 720 (720p) + + + + 1280 x 960 (960p) + + + + 1920 x 1080 (1080p) + + + + 1920 x 1440 (1440p) + + + + 2704 x 1440 (2.7k-17:9) + + + + 2704 x 1524 (2.7k-16:9) + + + + 2704 x 2028 (2.7k-4:3) + + + + 3840 x 2160 (4k-16:9) + + + + 4096 x 2160 (4k-17:9) + + + + 1280 x 720 (720p-SuperView) + + + + 1920 x 1080 (1080p-SuperView) + + + + 2704 x 1520 (2.7k-SuperView) + + + + 3840 x 2160 (4k-SuperView) + + + + + + 12 FPS + + + + 15 FPS + + + + 24 FPS + + + + 25 FPS + + + + 30 FPS + + + + 48 FPS + + + + 50 FPS + + + + 60 FPS + + + + 80 FPS + + + + 90 FPS + + + + 100 FPS + + + + 120 FPS + + + + 240 FPS + + + + 12.5 FPS + + + + + + 0x00: Wide + + + + 0x01: Medium + + + + 0x02: Narrow + + + + + + 0=NTSC, 1=PAL + + + + + + 5MP Medium + + + + 7MP Medium + + + + 7MP Wide + + + + 10MP Wide + + + + 12MP Wide + + + + + + Auto + + + + 3000K + + + + 5500K + + + + 6500K + + + + Camera Raw + + + + + + Auto + + + + Neutral + + + + + + ISO 400 + + + + ISO 800 (Only Hero 4) + + + + ISO 1600 + + + + ISO 3200 (Only Hero 4) + + + + ISO 6400 + + + + + + Low Sharpness + + + + Medium Sharpness + + + + High Sharpness + + + + + + -5.0 EV (Hero 3+ Only) + + + + -4.5 EV (Hero 3+ Only) + + + + -4.0 EV (Hero 3+ Only) + + + + -3.5 EV (Hero 3+ Only) + + + + -3.0 EV (Hero 3+ Only) + + + + -2.5 EV (Hero 3+ Only) + + + + -2.0 EV + + + + -1.5 EV + + + + -1.0 EV + + + + -0.5 EV + + + + 0.0 EV + + + + +0.5 EV + + + + +1.0 EV + + + + +1.5 EV + + + + +2.0 EV + + + + +2.5 EV (Hero 3+ Only) + + + + +3.0 EV (Hero 3+ Only) + + + + +3.5 EV (Hero 3+ Only) + + + + +4.0 EV (Hero 3+ Only) + + + + +4.5 EV (Hero 3+ Only) + + + + +5.0 EV (Hero 3+ Only) + + + + + + Charging disabled + + + + Charging enabled + + + + + + Unknown gopro model + + + + Hero 3+ Silver (HeroBus not supported by GoPro) + + + + Hero 3+ Black + + + + Hero 4 Silver + + + + Hero 4 Black + + + + + + 3 Shots / 1 Second + + + + 5 Shots / 1 Second + + + + 10 Shots / 1 Second + + + + 10 Shots / 2 Second + + + + 10 Shots / 3 Second (Hero 4 Only) + + + + 30 Shots / 1 Second + + + + 30 Shots / 2 Second + + + + 30 Shots / 3 Second + + + + 30 Shots / 6 Second + + + + + + + LED patterns off (return control to regular vehicle control) + + + + LEDs show pattern during firmware update + + + + Custom Pattern using custom bytes fields + + + + + + Flags in EKF_STATUS message + + set if EKF's attitude estimate is good + + + + set if EKF's horizontal velocity estimate is good + + + + set if EKF's vertical velocity estimate is good + + + + set if EKF's horizontal position (relative) estimate is good + + + + set if EKF's horizontal position (absolute) estimate is good + + + + set if EKF's vertical position (absolute) estimate is good + + + + set if EKF's vertical position (above ground) estimate is good + + + + EKF is in constant position mode and does not know it's absolute or relative position + + + + set if EKF's predicted horizontal position (relative) estimate is good + + + + set if EKF's predicted horizontal position (absolute) estimate is good + + + + + + + + + + + + + + + + + + + + + + Special ACK block numbers control activation of dataflash log streaming + + + + UAV to stop sending DataFlash blocks + + + + + UAV to start sending DataFlash blocks + + + + + + + Possible remote log data block statuses + + This block has NOT been received + + + + This block has been received + + + + + + + Offsets and calibrations values for hardware sensors. This makes it easier to debug the calibration process. + magnetometer X offset + magnetometer Y offset + magnetometer Z offset + magnetic declination (radians) + raw pressure from barometer + raw temperature from barometer + gyro X calibration + gyro Y calibration + gyro Z calibration + accel X calibration + accel Y calibration + accel Z calibration + + + + Deprecated. Use MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS instead. Set the magnetometer offsets + System ID + Component ID + magnetometer X offset + magnetometer Y offset + magnetometer Z offset + + + + state of APM memory + heap top + free memory + + + + raw ADC output + ADC output 1 + ADC output 2 + ADC output 3 + ADC output 4 + ADC output 5 + ADC output 6 + + + + + Configure on-board Camera Control System. + System ID + Component ID + Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) + Divisor number //e.g. 1000 means 1/1000 (0 means ignore) + F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) + ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) + Exposure type enumeration from 1 to N (0 means ignore) + Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once + Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) + Extra parameters enumeration (0 means ignore) + Correspondent value to given extra_param + + + + Control on-board Camera Control System to take shots. + System ID + Component ID + 0: stop, 1: start or keep it up //Session control e.g. show/hide lens + 1 to N //Zoom's absolute position (0 means ignore) + -100 to 100 //Zooming step value to offset zoom from the current position + 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus + 0: ignore, 1: shot or start filming + Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once + Extra parameters enumeration (0 means ignore) + Correspondent value to given extra_param + + + + + Message to configure a camera mount, directional antenna, etc. + System ID + Component ID + mount operating mode (see MAV_MOUNT_MODE enum) + (1 = yes, 0 = no) + (1 = yes, 0 = no) + (1 = yes, 0 = no) + + + + Message to control a camera mount, directional antenna, etc. + System ID + Component ID + pitch(deg*100) or lat, depending on mount mode + roll(deg*100) or lon depending on mount mode + yaw(deg*100) or alt (in cm) depending on mount mode + if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) + + + + Message with some status from APM to GCS about camera or antenna mount + System ID + Component ID + pitch(deg*100) + roll(deg*100) + yaw(deg*100) + + + + + A fence point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS + System ID + Component ID + point index (first point is 1, 0 is for return point) + total number of points (for sanity checking) + Latitude of point + Longitude of point + + + + Request a current fence point from MAV + System ID + Component ID + point index (first point is 1, 0 is for return point) + + + + Status of geo-fencing. Sent in extended status stream when fencing enabled + 0 if currently inside fence, 1 if outside + number of fence breaches + last breach type (see FENCE_BREACH_* enum) + time of last breach in milliseconds since boot + + + + Status of DCM attitude estimator + X gyro drift estimate rad/s + Y gyro drift estimate rad/s + Z gyro drift estimate rad/s + average accel_weight + average renormalisation value + average error_roll_pitch value + average error_yaw value + + + + Status of simulation environment, if used + Roll angle (rad) + Pitch angle (rad) + Yaw angle (rad) + X acceleration m/s/s + Y acceleration m/s/s + Z acceleration m/s/s + Angular speed around X axis rad/s + Angular speed around Y axis rad/s + Angular speed around Z axis rad/s + Latitude in degrees * 1E7 + Longitude in degrees * 1E7 + + + + Status of key hardware + board voltage (mV) + I2C error count + + + + Status generated by radio + local signal strength + remote signal strength + how full the tx buffer is as a percentage + background noise level + remote background noise level + receive errors + count of error corrected packets + + + + + Status of AP_Limits. Sent in extended status stream when AP_Limits is enabled + state of AP_Limits, (see enum LimitState, LIMITS_STATE) + time of last breach in milliseconds since boot + time of last recovery action in milliseconds since boot + time of last successful recovery in milliseconds since boot + time of last all-clear in milliseconds since boot + number of fence breaches + AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE) + AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE) + AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE) + + + + Wind estimation + wind direction that wind is coming from (degrees) + wind speed in ground plane (m/s) + vertical wind speed (m/s) + + + + Data packet, size 16 + data type + data length + raw data + + + + Data packet, size 32 + data type + data length + raw data + + + + Data packet, size 64 + data type + data length + raw data + + + + Data packet, size 96 + data type + data length + raw data + + + + Rangefinder reporting + distance in meters + raw voltage if available, zero otherwise + + + + Airspeed auto-calibration + GPS velocity north m/s + GPS velocity east m/s + GPS velocity down m/s + Differential pressure pascals + Estimated to true airspeed ratio + Airspeed ratio + EKF state x + EKF state y + EKF state z + EKF Pax + EKF Pby + EKF Pcz + + + + + A rally point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS + System ID + Component ID + point index (first point is 0) + total number of points (for sanity checking) + Latitude of point in degrees * 1E7 + Longitude of point in degrees * 1E7 + Transit / loiter altitude in meters relative to home + + Break altitude in meters relative to home + Heading to aim for when landing. In centi-degrees. + See RALLY_FLAGS enum for definition of the bitmask. + + + + Request a current rally point from MAV. MAV should respond with a RALLY_POINT message. MAV should not respond if the request is invalid. + System ID + Component ID + point index (first point is 0) + + + + Status of compassmot calibration + throttle (percent*10) + current (amps) + interference (percent) + Motor Compensation X + Motor Compensation Y + Motor Compensation Z + + + + + Status of secondary AHRS filter if available + Roll angle (rad) + Pitch angle (rad) + Yaw angle (rad) + Altitude (MSL) + Latitude in degrees * 1E7 + Longitude in degrees * 1E7 + + + + + Camera Event + Image timestamp (microseconds since UNIX epoch, according to camera clock) + System ID + + Camera ID + + Image index + + See CAMERA_STATUS_TYPES enum for definition of the bitmask + Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + + + + + Camera Capture Feedback + Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB) + System ID + + Camera ID + + Image index + + Latitude in (deg * 1E7) + Longitude in (deg * 1E7) + Altitude Absolute (meters AMSL) + Altitude Relative (meters above HOME location) + Camera Roll angle (earth frame, degrees, +-180) + + Camera Pitch angle (earth frame, degrees, +-180) + + Camera Yaw (earth frame, degrees, 0-360, true) + + Focal Length (mm) + + See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask + + + + + 2nd Battery status + voltage in millivolts + Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + + + + Status of third AHRS filter if available. This is for ANU research group (Ali and Sean) + Roll angle (rad) + Pitch angle (rad) + Yaw angle (rad) + Altitude (MSL) + Latitude in degrees * 1E7 + Longitude in degrees * 1E7 + test variable1 + test variable2 + test variable3 + test variable4 + + + + Request the autopilot version from the system/component. + System ID + Component ID + + + + + Send a block of log data to remote location + System ID + Component ID + log data block sequence number + log data block + + + + Send Status of each log block that autopilot board might have sent + System ID + Component ID + log data block sequence number + log data block status + + + + Control vehicle LEDs + System ID + Component ID + Instance (LED instance to control or 255 for all LEDs) + Pattern (see LED_PATTERN_ENUM) + Custom Byte Length + Custom Bytes + + + + Reports progress of compass calibration. + Compass being calibrated + Bitmask of compasses being calibrated + Status (see MAG_CAL_STATUS enum) + Attempt number + Completion percentage + Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid) + Body frame direction vector for display + Body frame direction vector for display + Body frame direction vector for display + + + + Reports results of completed compass calibration. Sent until MAG_CAL_ACK received. + Compass being calibrated + Bitmask of compasses being calibrated + Status (see MAG_CAL_STATUS enum) + 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters + RMS milligauss residuals + X offset + Y offset + Z offset + X diagonal (matrix 11) + Y diagonal (matrix 22) + Z diagonal (matrix 33) + X off-diagonal (matrix 12 and 21) + Y off-diagonal (matrix 13 and 31) + Z off-diagonal (matrix 32 and 23) + + + + + EKF Status message including flags and variances + Flags + + Velocity variance + + Horizontal Position variance + Vertical Position variance + Compass variance + Terrain Altitude variance + + + + + PID tuning information + axis + desired rate (degrees/s) + achieved rate (degrees/s) + FF component + P component + I component + D component + + + + 3 axis gimbal mesuraments + System ID + Component ID + Time since last update (seconds) + Delta angle X (radians) + Delta angle Y (radians) + Delta angle X (radians) + Delta velocity X (m/s) + Delta velocity Y (m/s) + Delta velocity Z (m/s) + Joint ROLL (radians) + Joint EL (radians) + Joint AZ (radians) + + + + Control message for rate gimbal + System ID + Component ID + Demanded angular rate X (rad/s) + Demanded angular rate Y (rad/s) + Demanded angular rate Z (rad/s) + + + + 100 Hz gimbal torque command telemetry + System ID + Component ID + Roll Torque Command + Elevation Torque Command + Azimuth Torque Command + + + + + Heartbeat from a HeroBus attached GoPro + Status + Current capture mode + additional status bits + + + + + Request a GOPRO_COMMAND response from the GoPro + System ID + Component ID + Command ID + + + + Response from a GOPRO_COMMAND get request + Command ID + Status + Value + + + + Request to set a GOPRO_COMMAND with a desired + System ID + Component ID + Command ID + Value + + + + Response from a GOPRO_COMMAND set request + Command ID + Status + + + + + RPM sensor output + RPM Sensor1 + RPM Sensor2 + + + diff --git a/MAVLINK_msg/autoquad.xml b/MAVLINK_msg/autoquad.xml new file mode 100644 index 0000000..8c22478 --- /dev/null +++ b/MAVLINK_msg/autoquad.xml @@ -0,0 +1,169 @@ + + + common.xml + 3 + + + Track current version of these definitions (can be used by checking value of AUTOQUAD_MAVLINK_DEFS_VERSION_ENUM_END). Append a new entry for each published change. + + + + Available operating modes/statuses for AutoQuad flight controller. + Bitmask up to 32 bits. Low side bits for base modes, high side for + additional active features/modifiers/constraints. + + System is initializing + + + + System is *armed* and standing by, with no throttle input and no autonomous mode + + + Flying (throttle input detected), assumed under manual control unless other mode bits are set + + + Altitude hold engaged + + + Position hold engaged + + + Externally-guided (eg. GCS) navigation mode + + + Autonomous mission execution mode + + + + Ready but *not armed* + + + Calibration mode active + + + + No valid control input (eg. no radio link) + + + Battery is low (stage 1 warning) + + + Battery is depleted (stage 2 warning) + + + + Dynamic Velocity Hold is active (PH with proportional manual direction override) + + + ynamic Altitude Override is active (AH with proportional manual adjustment) + + + + Craft is at ceiling altitude + + + Ceiling altitude is set + + + Heading-Free dynamic mode active + + + Heading-Free locked mode active + + + Automatic Return to Home is active + + + System is in failsafe recovery mode + + + + + Orbit a waypoint. + Orbit radius in meters + Loiter time in decimal seconds + Maximum horizontal speed in m/s + Desired yaw angle at waypoint + Latitude + Longitude + Altitude + + + Start/stop AutoQuad telemetry values stream. + Start or stop (1 or 0) + Stream frequency in us + Dataset ID (refer to aq_mavlink.h::mavlinkCustomDataSets enum in AQ flight controller code) + Empty + Empty + Empty + Empty + + + + Request AutoQuad firmware version number. + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + + + + Motor/ESC telemetry data. + + + + + + Sends up to 20 raw float values. + Index of message + value1 + value2 + value3 + value4 + value5 + value6 + value7 + value8 + value9 + value10 + value11 + value12 + value13 + value14 + value15 + value16 + value17 + value18 + value19 + value20 + + + Sends ESC32 telemetry data for up to 4 motors. Multiple messages may be sent in sequence when system has > 4 motors. Data is described as follows: + // unsigned int state : 3; + // unsigned int vin : 12; // x 100 + // unsigned int amps : 14; // x 100 + // unsigned int rpm : 15; + // unsigned int duty : 8; // x (255/100) + // - Data Version 2 - + // unsigned int errors : 9; // Bad detects error count + // - Data Version 3 - + // unsigned int temp : 9; // (Deg C + 32) * 4 + // unsigned int errCode : 3; + + Timestamp of the component clock since boot time in ms. + Sequence number of message (first set of 4 motors is #1, next 4 is #2, etc). + Total number of active ESCs/motors on the system. + Number of active ESCs in this sequence (1 through this many array members will be populated with data) + ESC/Motor ID + Age of each ESC telemetry reading in ms compared to boot time. A value of 0xFFFF means timeout/no data. + Version of data structure (determines contents). + Data bits 1-32 for each ESC. + Data bits 33-64 for each ESC. + + + diff --git a/MAVLINK_msg/common.xml b/MAVLINK_msg/common.xml new file mode 100644 index 0000000..7b043aa --- /dev/null +++ b/MAVLINK_msg/common.xml @@ -0,0 +1,3440 @@ + + + 3 + + + Micro air vehicle / autopilot classes. This identifies the individual model. + + Generic autopilot, full support for everything + + + Reserved for future use. + + + SLUGS autopilot, http://slugsuav.soe.ucsc.edu + + + ArduPilotMega / ArduCopter, http://diydrones.com + + + OpenPilot, http://openpilot.org + + + Generic autopilot only supporting simple waypoints + + + Generic autopilot supporting waypoints and other simple navigation commands + + + Generic autopilot supporting the full mission command set + + + No valid autopilot, e.g. a GCS or other MAVLink component + + + PPZ UAV - http://nongnu.org/paparazzi + + + UAV Dev Board + + + FlexiPilot + + + PX4 Autopilot - http://pixhawk.ethz.ch/px4/ + + + SMACCMPilot - http://smaccmpilot.org + + + AutoQuad -- http://autoquad.org + + + Armazila -- http://armazila.com + + + Aerob -- http://aerob.ru + + + ASLUAV autopilot -- http://www.asl.ethz.ch + + + + + Generic micro air vehicle. + + + Fixed wing aircraft. + + + Quadrotor + + + Coaxial helicopter + + + Normal helicopter with tail rotor. + + + Ground installation + + + Operator control unit / ground control station + + + Airship, controlled + + + Free balloon, uncontrolled + + + Rocket + + + Ground rover + + + Surface vessel, boat, ship + + + Submarine + + + Hexarotor + + + Octorotor + + + Octorotor + + + Flapping wing + + + Flapping wing + + + Onboard companion controller + + + Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. + + + Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. + + + Tiltrotor VTOL + + + + VTOL reserved 2 + + + VTOL reserved 3 + + + VTOL reserved 4 + + + VTOL reserved 5 + + + Onboard gimbal + + + Onboard ADSB peripheral + + + + These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65. + + development release + + + alpha release + + + beta release + + + release candidate + + + official stable release + + + + + These flags encode the MAV mode. + + 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. + + + 0b01000000 remote control input is enabled. + + + 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. + + + 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. + + + 0b00001000 guided mode enabled, system flies MISSIONs / mission items. + + + 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. + + + 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. + + + 0b00000001 Reserved for future use. + + + + These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. + + First bit: 10000000 + + + Second bit: 01000000 + + + Third bit: 00100000 + + + Fourth bit: 00010000 + + + Fifth bit: 00001000 + + + Sixt bit: 00000100 + + + Seventh bit: 00000010 + + + Eighth bit: 00000001 + + + + Override command, pauses current mission execution and moves immediately to a position + + Hold at the current position. + + + Continue with the next item in mission execution. + + + Hold at the current position of the system + + + Hold at the position specified in the parameters of the DO_HOLD action + + + + These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it + simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. + + System is not ready to fly, booting, calibrating, etc. No flag is set. + + + System is allowed to be active, under assisted RC control. + + + System is allowed to be active, under assisted RC control. + + + System is allowed to be active, under manual (RC) control, no stabilization + + + System is allowed to be active, under manual (RC) control, no stabilization + + + System is allowed to be active, under autonomous control, manual setpoint + + + System is allowed to be active, under autonomous control, manual setpoint + + + System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) + + + System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) + + + UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. + + + UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. + + + + + Uninitialized system, state is unknown. + + + System is booting up. + + + System is calibrating and not flight-ready. + + + System is grounded and on standby. It can be launched any time. + + + System is active and might be already airborne. Motors are engaged. + + + System is in a non-normal flight mode. It can however still navigate. + + + System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. + + + System just initialized its power-down sequence, will shut down now. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + On Screen Display (OSD) devices for video links + + + Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol + + + + These encode the sensors whose status is sent as part of the SYS_STATUS message. + + 0x01 3D gyro + + + 0x02 3D accelerometer + + + 0x04 3D magnetometer + + + 0x08 absolute pressure + + + 0x10 differential pressure + + + 0x20 GPS + + + 0x40 optical flow + + + 0x80 computer vision position + + + 0x100 laser based position + + + 0x200 external ground truth (Vicon or Leica) + + + 0x400 3D angular rate control + + + 0x800 attitude stabilization + + + 0x1000 yaw position + + + 0x2000 z/altitude control + + + 0x4000 x/y position control + + + 0x8000 motor outputs / control + + + 0x10000 rc receiver + + + 0x20000 2nd 3D gyro + + + 0x40000 2nd 3D accelerometer + + + 0x80000 2nd 3D magnetometer + + + 0x100000 geofence + + + 0x200000 AHRS subsystem health + + + 0x400000 Terrain subsystem health + + + 0x800000 Motors are reversed + + + + + Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) + + + Local coordinate frame, Z-up (x: north, y: east, z: down). + + + NOT a coordinate frame, indicates a mission command. + + + Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. + + + Local coordinate frame, Z-down (x: east, y: north, z: up) + + + Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) + + + Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. + + + Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. + + + Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. + + + Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. + + + Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. + + + Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. + + + + + + + + + + + + + + + + + + + + + + + + + + Disable fenced mode + + + Switched to guided mode to return point (fence point 0) + + + Report fence breach, but don't take action + + + Switched to guided mode to return point (fence point 0) with manual throttle control + + + + + + No last fence breach + + + Breached minimum altitude + + + Breached maximum altitude + + + Breached fence boundary + + + + + Enumeration of possible mount operation modes + Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization + Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. + Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization + Load neutral position and start RC Roll,Pitch,Yaw control with stabilization + Load neutral position and start to point to Lat,Lon,Alt + + + Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. + + Navigate to MISSION. + Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing) + Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached) + 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control. + Desired yaw angle at MISSION (rotary wing) + Latitude + Longitude + Altitude + + + Loiter around this MISSION an unlimited amount of time + Empty + Empty + Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise + Desired yaw angle. + Latitude + Longitude + Altitude + + + Loiter around this MISSION for X turns + Turns + Empty + Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise + Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle + Latitude + Longitude + Altitude + + + Loiter around this MISSION for X seconds + Seconds (decimal) + Empty + Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise + Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle + Latitude + Longitude + Altitude + + + Return to launch location + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Land at location + Abort Alt + Empty + Empty + Desired yaw angle + Latitude + Longitude + Altitude + + + Takeoff from ground / hand + Minimum pitch (if airspeed sensor present), desired pitch without sensor + Empty + Empty + Yaw angle (if magnetometer present), ignored without magnetometer + Latitude + Longitude + Altitude + + + Land at local position (local frame only) + Landing target number (if available) + Maximum accepted offset from desired landing position [m] - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land + Landing descend rate [ms^-1] + Desired yaw angle [rad] + Y-axis position [m] + X-axis position [m] + Z-axis / ground level position [m] + + + Takeoff from local position (local frame only) + Minimum pitch (if airspeed sensor present), desired pitch without sensor [rad] + Empty + Takeoff ascend rate [ms^-1] + Yaw angle [rad] (if magnetometer or another yaw estimation source present), ignored without one of these + Y-axis position [m] + X-axis position [m] + Z-axis position [m] + + + Vehicle following, i.e. this waypoint represents the position of a moving vehicle + Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation + Ground speed of vehicle to be followed + Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise + Desired yaw angle. + Latitude + Longitude + Altitude + + + Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. + Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. + Empty + Empty + Empty + Empty + Empty + Desired altitude in meters + + + Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. + Heading Required (0 = False) + Radius in meters. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter. + Empty + Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location + Latitude + Longitude + Altitude + + + Being following a target + System ID (the system ID of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode + RESERVED + RESERVED + altitude flag: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home + altitude + RESERVED + TTL in seconds in which the MAV should go to the default position hold mode after a message rx timeout + + + Reposition the MAV after a follow target command has been sent + Camera q1 (where 0 is on the ray from the camera to the tracking device) + Camera q2 + Camera q3 + Camera q4 + altitude offset from target (m) + X offset from target (m) + Y offset from target (m) + + + Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. + Region of intereset mode. (see MAV_ROI enum) + MISSION index/ target ID. (see MAV_ROI enum) + ROI index (allows a vehicle to manage multiple ROI's) + Empty + x the location of the fixed ROI (see MAV_FRAME) + y + z + + + Control autonomous path planning on the MAV. + 0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning + 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid + Empty + Yaw angle at goal, in compass degrees, [0..360] + Latitude/X of goal + Longitude/Y of goal + Altitude/Z of goal + + + Navigate to MISSION using a spline path. + Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing) + Empty + Empty + Empty + Latitude/X of goal + Longitude/Y of goal + Altitude/Z of goal + + + Takeoff from ground using VTOL mode + Empty + Empty + Empty + Yaw angle in degrees + Latitude + Longitude + Altitude + + + Land using VTOL mode + Empty + Empty + Empty + Yaw angle in degrees + Latitude + Longitude + Altitude + + + + + + hand control over to an external controller + On / Off (> 0.5f on) + Empty + Empty + Empty + Empty + Empty + Empty + + + Delay the next navigation command a number of seconds or until a specified time + Delay in seconds (decimal, -1 to enable time-of-day fields) + hour (24h format, UTC, -1 to ignore) + minute (24h format, UTC, -1 to ignore) + second (24h format, UTC) + Empty + Empty + Empty + + + NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Delay mission state machine. + Delay in seconds (decimal) + Empty + Empty + Empty + Empty + Empty + Empty + + + Ascend/descend at rate. Delay mission state machine until desired altitude reached. + Descent / Ascend rate (m/s) + Empty + Empty + Empty + Empty + Empty + Finish Altitude + + + Delay mission state machine until within desired distance of next NAV point. + Distance (meters) + Empty + Empty + Empty + Empty + Empty + Empty + + + Reach a certain target angle. + target angle: [0-360], 0 is north + speed during yaw change:[deg per second] + direction: negative: counter clockwise, positive: clockwise [-1,1] + relative offset or absolute angle: [ 1,0] + Empty + Empty + Empty + + + NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Set system mode. + Mode, as defined by ENUM MAV_MODE + Custom mode - this is system specific, please refer to the individual autopilot specifications for details. + Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details. + Empty + Empty + Empty + Empty + + + Jump to the desired command in the mission list. Repeat this action only the specified number of times + Sequence number + Repeat count + Empty + Empty + Empty + Empty + Empty + + + Change speed and/or throttle set points. + Speed type (0=Airspeed, 1=Ground Speed) + Speed (m/s, -1 indicates no change) + Throttle ( Percent, -1 indicates no change) + absolute or relative [0,1] + Empty + Empty + Empty + + + Changes the home location either to the current location or a specified location. + Use current (1=use current location, 0=use specified location) + Empty + Empty + Empty + Latitude + Longitude + Altitude + + + Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. + Parameter number + Parameter value + Empty + Empty + Empty + Empty + Empty + + + Set a relay to a condition. + Relay number + Setting (1=on, 0=off, others possible depending on system hardware) + Empty + Empty + Empty + Empty + Empty + + + Cycle a relay on and off for a desired number of cyles with a desired period. + Relay number + Cycle count + Cycle time (seconds, decimal) + Empty + Empty + Empty + Empty + + + Set a servo to a desired PWM value. + Servo number + PWM (microseconds, 1000 to 2000 typical) + Empty + Empty + Empty + Empty + Empty + + + Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. + Servo number + PWM (microseconds, 1000 to 2000 typical) + Cycle count + Cycle time (seconds) + Empty + Empty + Empty + + + Terminate flight immediately + Flight termination activated if > 0.5 + Empty + Empty + Empty + Empty + Empty + Empty + + + Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. + Empty + Empty + Empty + Empty + Latitude + Longitude + Empty + + + Mission command to perform a landing from a rally point. + Break altitude (meters) + Landing speed (m/s) + Empty + Empty + Empty + Empty + Empty + + + Mission command to safely abort an autonmous landing. + Altitude (meters) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Reposition the vehicle to a specific WGS84 global position. + Ground speed, less than 0 (-1) for default + Bitmask of option flags, see the MAV_DO_REPOSITION_FLAGS enum. + Reserved + Yaw heading, NaN for unchanged. For planes indicates loiter direction (0: clockwise, 1: counter clockwise) + Latitude (deg * 1E7) + Longitude (deg * 1E7) + Altitude (meters) + + + If in a GPS controlled position mode, hold the current position or continue. + 0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + Control onboard camera system. + Camera ID (-1 for all) + Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw + Transmission mode: 0: video stream, >0: single images every n seconds (decimal) + Recording: 0: disabled, 1: enabled compressed, 2: enabled raw + Empty + Empty + Empty + + + Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. + Region of intereset mode. (see MAV_ROI enum) + MISSION index/ target ID. (see MAV_ROI enum) + ROI index (allows a vehicle to manage multiple ROI's) + Empty + x the location of the fixed ROI (see MAV_FRAME) + y + z + + + + + Mission command to configure an on-board camera controller system. + Modes: P, TV, AV, M, Etc + Shutter speed: Divisor number for one second + Aperture: F stop number + ISO number e.g. 80, 100, 200, Etc + Exposure type enumerator + Command Identity + Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) + + + + Mission command to control an on-board camera controller system. + Session control e.g. show/hide lens + Zoom's absolute position + Zooming step value to offset zoom from the current position + Focus Locking, Unlocking or Re-locking + Shooting Command + Command Identity + Empty + + + + + Mission command to configure a camera or antenna mount + Mount operation mode (see MAV_MOUNT_MODE enum) + stabilize roll? (1 = yes, 0 = no) + stabilize pitch? (1 = yes, 0 = no) + stabilize yaw? (1 = yes, 0 = no) + Empty + Empty + Empty + + + + Mission command to control a camera or antenna mount + pitch or lat in degrees, depending on mount mode. + roll or lon in degrees depending on mount mode + yaw or alt (in meters) depending on mount mode + reserved + reserved + reserved + MAV_MOUNT_MODE enum value + + + + Mission command to set CAM_TRIGG_DIST for this flight + Camera trigger distance (meters) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Mission command to enable the geofence + enable? (0=disable, 1=enable, 2=disable_floor_only) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Mission command to trigger a parachute + action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Change to/from inverted flight + inverted (0=normal, 1=inverted) + Empty + Empty + Empty + Empty + Empty + Empty + + + + Mission command to control a camera or antenna mount, using a quaternion as reference. + q1 - quaternion param #1, w (1 in null-rotation) + q2 - quaternion param #2, x (0 in null-rotation) + q3 - quaternion param #3, y (0 in null-rotation) + q4 - quaternion param #4, z (0 in null-rotation) + Empty + Empty + Empty + + + + set id of master controller + System ID + Component ID + Empty + Empty + Empty + Empty + Empty + + + + set limits for external control + timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout + absolute altitude min (in meters, AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit + absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit + horizontal move limit (in meters, AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit + Empty + Empty + Empty + + + + NOP - This command is only used to mark the upper limit of the DO commands in the enumeration + Empty + Empty + Empty + Empty + Empty + Empty + Empty + + + Trigger calibration. This command will be only accepted if in pre-flight mode. + Gyro calibration: 0: no, 1: yes + Magnetometer calibration: 0: no, 1: yes + Ground pressure: 0: no, 1: yes + Radio calibration: 0: no, 1: yes + Accelerometer calibration: 0: no, 1: yes + Compass/Motor interference calibration: 0: no, 1: yes + Empty + + + Set sensor offsets. This command will be only accepted if in pre-flight mode. + Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer + X axis offset (or generic dimension 1), in the sensor's raw units + Y axis offset (or generic dimension 2), in the sensor's raw units + Z axis offset (or generic dimension 3), in the sensor's raw units + Generic dimension 4, in the sensor's raw units + Generic dimension 5, in the sensor's raw units + Generic dimension 6, in the sensor's raw units + + + Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. + 1: Trigger actuator ID assignment and direction mapping. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. + Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults + Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults + Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: start logging with rate of param 3 in Hz (e.g. set to 1000 for 1000 Hz logging) + Reserved + Empty + Empty + Empty + + + Request the reboot or shutdown of system components. + 0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded. + 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded. + Reserved, send 0 + Reserved, send 0 + Reserved, send 0 + Reserved, send 0 + Reserved, send 0 + + + Hold / continue the current action + MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan + MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position + MAV_FRAME coordinate frame of hold point + Desired yaw angle in degrees + Latitude / X position + Longitude / Y position + Altitude / Z position + + + start running a mission + first_item: the first mission item to run + last_item: the last mission item to run (after this item is run, the mission ends) + + + Arms / Disarms a component + 1 to arm, 0 to disarm + + + Request the home position from the vehicle. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + Starts receiver pairing + 0:Spektrum + 0:Spektrum DSM2, 1:Spektrum DSMX + + + Request the interval between messages for a particular MAVLink message ID + The MAVLink message ID + + + Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM + The MAVLink message ID + The interval between two messages, in microseconds. Set to -1 to disable and 0 to request default rate. + + + Request autopilot capabilities + 1: Request autopilot version + Reserved (all remaining params) + + + Start image capture sequence + Duration between two consecutive pictures (in seconds) + Number of images to capture total - 0 for unlimited capture + Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc) + + + + Stop image capture sequence + Reserved + Reserved + + + + Enable or disable on-board camera triggering system. + Trigger enable/disable (0 for disable, 1 for start) + Shutter integration time (in ms) + Reserved + + + + Starts video capture + Camera ID (0 for all cameras), 1 for first, 2 for second, etc. + Frames per second + Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc) + + + + Stop the current video capture + Reserved + Reserved + + + + Create a panorama at the current position + Viewing angle horizontal of the panorama (in degrees, +- 0.5 the total angle) + Viewing angle vertical of panorama (in degrees) + Speed of the horizontal rotation (in degrees per second) + Speed of the vertical rotation (in degrees per second) + + + + Request VTOL transition + The target VTOL state, as defined by ENUM MAV_VTOL_STATE. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used. + + + + + + + Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. + Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list. + Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will. + Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will. + Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will. + Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT + Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT + Altitude, in meters AMSL + + + Control the payload deployment. + Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests. + Reserved + Reserved + Reserved + Reserved + Reserved + Reserved + + + + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + User defined + User defined + User defined + User defined + Latitude unscaled + Longitude unscaled + Altitude, in meters AMSL + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + User defined + User defined + User defined + User defined + User defined + User defined + User defined + + + + + THIS INTERFACE IS DEPRECATED AS OF JULY 2015. Please use MESSAGE_INTERVAL instead. A data stream is not a fixed set of messages, but rather a + recommendation to the autopilot software. Individual autopilots may or may not obey + the recommended messages. + + Enable all data streams + + + Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. + + + Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS + + + Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW + + + Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. + + + Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. + + + Dependent on the autopilot + + + Dependent on the autopilot + + + Dependent on the autopilot + + + + The ROI (region of interest) for the vehicle. This can be + be used by the vehicle for camera/vehicle attitude alignment (see + MAV_CMD_NAV_ROI). + + No region of interest. + + + Point toward next MISSION. + + + Point toward given MISSION. + + + Point toward fixed location. + + + Point toward of given id. + + + + ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. + + Command / mission item is ok. + + + Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. + + + The system is refusing to accept this command from this source / communication partner. + + + Command or mission item is not supported, other commands would be accepted. + + + The coordinate frame of this command / mission item is not supported. + + + The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. + + + The X or latitude value is out of range. + + + The Y or longitude value is out of range. + + + The Z or altitude value is out of range. + + + + Specifies the datatype of a MAVLink parameter. + + 8-bit unsigned integer + + + 8-bit signed integer + + + 16-bit unsigned integer + + + 16-bit signed integer + + + 32-bit unsigned integer + + + 32-bit signed integer + + + 64-bit unsigned integer + + + 64-bit signed integer + + + 32-bit floating-point + + + 64-bit floating-point + + + + result from a mavlink command + + Command ACCEPTED and EXECUTED + + + Command TEMPORARY REJECTED/DENIED + + + Command PERMANENTLY DENIED + + + Command UNKNOWN/UNSUPPORTED + + + Command executed, but failed + + + + result in a mavlink mission ack + + mission accepted OK + + + generic error / not accepting mission commands at all right now + + + coordinate frame is not supported + + + command is not supported + + + mission item exceeds storage space + + + one of the parameters has an invalid value + + + param1 has an invalid value + + + param2 has an invalid value + + + param3 has an invalid value + + + param4 has an invalid value + + + x/param5 has an invalid value + + + y/param6 has an invalid value + + + param7 has an invalid value + + + received waypoint out of sequence + + + not accepting any mission commands from this communication partner + + + + Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. + + System is unusable. This is a "panic" condition. + + + Action should be taken immediately. Indicates error in non-critical systems. + + + Action must be taken immediately. Indicates failure in a primary system. + + + Indicates an error in secondary/redundant systems. + + + Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. + + + An unusual event has occured, though not an error condition. This should be investigated for the root cause. + + + Normal operational messages. Useful for logging. No action is required for these messages. + + + Useful non-operational messages that can assist in debugging. These should not occur during normal operation. + + + + Power supply status flags (bitmask) + + main brick power supply valid + + + main servo power supply valid for FMU + + + USB power is connected + + + peripheral supply is in over-current state + + + hi-power peripheral supply is in over-current state + + + Power status has changed since boot + + + + SERIAL_CONTROL device types + + First telemetry port + + + Second telemetry port + + + First GPS port + + + Second GPS port + + + system shell + + + + SERIAL_CONTROL flags (bitmask) + + Set if this is a reply + + + Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message + + + Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set + + + Block on writes to the serial port + + + Send multiple replies until port is drained + + + + Enumeration of distance sensor types + + Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units + + + Ultrasound rangefinder, e.g. MaxBotix units + + + Infrared rangefinder, e.g. Sharp units + + + + Enumeration of sensor orientation, according to its rotations + + Roll: 0, Pitch: 0, Yaw: 0 + + + Roll: 0, Pitch: 0, Yaw: 45 + + + Roll: 0, Pitch: 0, Yaw: 90 + + + Roll: 0, Pitch: 0, Yaw: 135 + + + Roll: 0, Pitch: 0, Yaw: 180 + + + Roll: 0, Pitch: 0, Yaw: 225 + + + Roll: 0, Pitch: 0, Yaw: 270 + + + Roll: 0, Pitch: 0, Yaw: 315 + + + Roll: 180, Pitch: 0, Yaw: 0 + + + Roll: 180, Pitch: 0, Yaw: 45 + + + Roll: 180, Pitch: 0, Yaw: 90 + + + Roll: 180, Pitch: 0, Yaw: 135 + + + Roll: 0, Pitch: 180, Yaw: 0 + + + Roll: 180, Pitch: 0, Yaw: 225 + + + Roll: 180, Pitch: 0, Yaw: 270 + + + Roll: 180, Pitch: 0, Yaw: 315 + + + Roll: 90, Pitch: 0, Yaw: 0 + + + Roll: 90, Pitch: 0, Yaw: 45 + + + Roll: 90, Pitch: 0, Yaw: 90 + + + Roll: 90, Pitch: 0, Yaw: 135 + + + Roll: 270, Pitch: 0, Yaw: 0 + + + Roll: 270, Pitch: 0, Yaw: 45 + + + Roll: 270, Pitch: 0, Yaw: 90 + + + Roll: 270, Pitch: 0, Yaw: 135 + + + Roll: 0, Pitch: 90, Yaw: 0 + + + Roll: 0, Pitch: 270, Yaw: 0 + + + Roll: 0, Pitch: 180, Yaw: 90 + + + Roll: 0, Pitch: 180, Yaw: 270 + + + Roll: 90, Pitch: 90, Yaw: 0 + + + Roll: 180, Pitch: 90, Yaw: 0 + + + Roll: 270, Pitch: 90, Yaw: 0 + + + Roll: 90, Pitch: 180, Yaw: 0 + + + Roll: 270, Pitch: 180, Yaw: 0 + + + Roll: 90, Pitch: 270, Yaw: 0 + + + Roll: 180, Pitch: 270, Yaw: 0 + + + Roll: 270, Pitch: 270, Yaw: 0 + + + Roll: 90, Pitch: 180, Yaw: 90 + + + Roll: 90, Pitch: 0, Yaw: 270 + + + Roll: 315, Pitch: 315, Yaw: 315 + + + + Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. + + Autopilot supports MISSION float message type. + + + Autopilot supports the new param float message type. + + + Autopilot supports MISSION_INT scaled integer message type. + + + Autopilot supports COMMAND_INT scaled integer message type. + + + Autopilot supports the new param union message type. + + + Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. + + + Autopilot supports commanding attitude offboard. + + + Autopilot supports commanding position and velocity targets in local NED frame. + + + Autopilot supports commanding position and velocity targets in global scaled integers. + + + Autopilot supports terrain protocol / data handling. + + + Autopilot supports direct actuator control. + + + Autopilot supports the flight termination command. + + + Autopilot supports onboard compass calibration. + + + + Enumeration of estimator types + + This is a naive estimator without any real covariance feedback. + + + Computer vision based estimate. Might be up to scale. + + + Visual-inertial estimate. + + + Plain GPS estimate. + + + Estimator integrating GPS and inertial sensing. + + + + Enumeration of battery types + + Not specified. + + + Lithium polymer battery + + + Lithium-iron-phosphate battery + + + Lithium-ION battery + + + Nickel metal hydride battery + + + + Enumeration of battery functions + + Battery function is unknown + + + Battery supports all flight systems + + + Battery for the propulsion system + + + Avionics battery + + + Payload battery + + + + Enumeration of VTOL states + + MAV is not configured as VTOL + + + VTOL is in transition from multicopter to fixed-wing + + + VTOL is in transition from fixed-wing to multicopter + + + VTOL is in multicopter state + + + VTOL is in fixed-wing state + + + + Enumeration of landed detector states + + MAV landed state is unknown + + + MAV is landed (on ground) + + + MAV is in air + + + + Enumeration of the ADSB altimeter types + + Altitude reported from a Baro source using QNH reference + + + Altitude reported from a GNSS source + + + + ADSB classification for the type of vehicle emitting the transponder signal + + + + + + + + + + + + + + + + + + + + + + + These flags indicate status such as data validity of each data source. Set = data valid + + + + + + + + + + Bitmask of options for the MAV_CMD_DO_REPOSITION + + The aircraft should immediately transition into guided. This should not be set for follow me applications + + + + + Flags in EKF_STATUS message + + True if the attitude estimate is good + + + + True if the horizontal velocity estimate is good + + + + True if the vertical velocity estimate is good + + + + True if the horizontal position (relative) estimate is good + + + + True if the horizontal position (absolute) estimate is good + + + + True if the vertical position (absolute) estimate is good + + + + True if the vertical position (above ground) estimate is good + + + + True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow) + + + + True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate + + + + True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate + + + + True if the EKF has detected a GPS glitch + + + + + + The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). + Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) + Autopilot type / class. defined in MAV_AUTOPILOT ENUM + System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h + A bitfield for use for autopilot-specific flags. + System status flag, see MAV_STATE ENUM + MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version + + + The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. + Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 + Battery voltage, in millivolts (1 = 1 millivolt) + Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery + Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + Autopilot-specific errors + Autopilot-specific errors + Autopilot-specific errors + Autopilot-specific errors + + + The system time is the time of the master clock, typically the computer clock of the main onboard computer. + Timestamp of the master clock in microseconds since UNIX epoch. + Timestamp of the component clock since boot time in milliseconds. + + + + A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. + Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) + PING sequence + 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system + 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + + + Request to control this MAV + System the GCS requests control for + 0: request control of this MAV, 1: Release control of this MAV + 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + + + Accept / deny control of this MAV + ID of the GCS this message + 0: request control of this MAV, 1: Release control of this MAV + 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + + + Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. + key + + + THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with MAV_CMD_DO_SET_MODE INSTEAD. Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. + The system setting the mode + The new base mode + The new autopilot-specific mode. This field can be ignored by an autopilot. + + + + Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. + System ID + Component ID + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + + + Request all parameters of this component. After his request, all parameters are emitted. + System ID + Component ID + + + Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Onboard parameter value + Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + Total number of onboard parameters + Index of this onboard parameter + + + Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. + System ID + Component ID + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Onboard parameter value + Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + + + The global position, as returned by the Global Positioning System (GPS). This is + NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. + GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + Number of satellites visible. If unknown, set to 255 + + + The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. + Number of satellites visible + Global satellite ID + 0: Satellite not used, 1: used for localization + Elevation (0: right on top of receiver, 90: on the horizon) of satellite + Direction of satellite, 0: 0 deg, 255: 360 deg. + Signal to noise ratio of satellite + + + The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units + Timestamp (milliseconds since system boot) + X acceleration (mg) + Y acceleration (mg) + Z acceleration (mg) + Angular speed around X axis (millirad /sec) + Angular speed around Y axis (millirad /sec) + Angular speed around Z axis (millirad /sec) + X Magnetic field (milli tesla) + Y Magnetic field (milli tesla) + Z Magnetic field (milli tesla) + + + The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + X acceleration (raw) + Y acceleration (raw) + Z acceleration (raw) + Angular speed around X axis (raw) + Angular speed around Y axis (raw) + Angular speed around Z axis (raw) + X Magnetic field (raw) + Y Magnetic field (raw) + Z Magnetic field (raw) + + + The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + Absolute pressure (raw) + Differential pressure 1 (raw, 0 if nonexistant) + Differential pressure 2 (raw, 0 if nonexistant) + Raw Temperature measurement (raw) + + + The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. + Timestamp (milliseconds since system boot) + Absolute pressure (hectopascal) + Differential pressure 1 (hectopascal) + Temperature measurement (0.01 degrees celsius) + + + The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). + Timestamp (milliseconds since system boot) + Roll angle (rad, -pi..+pi) + Pitch angle (rad, -pi..+pi) + Yaw angle (rad, -pi..+pi) + Roll angular speed (rad/s) + Pitch angular speed (rad/s) + Yaw angular speed (rad/s) + + + The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + Timestamp (milliseconds since system boot) + Quaternion component 1, w (1 in null-rotation) + Quaternion component 2, x (0 in null-rotation) + Quaternion component 3, y (0 in null-rotation) + Quaternion component 4, z (0 in null-rotation) + Roll angular speed (rad/s) + Pitch angular speed (rad/s) + Yaw angular speed (rad/s) + + + The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + Timestamp (milliseconds since system boot) + X Position + Y Position + Z Position + X Speed + Y Speed + Z Speed + + + The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It + is designed as scaled integer message since the resolution of float is not sufficient. + Timestamp (milliseconds since system boot) + Latitude, expressed as degrees * 1E7 + Longitude, expressed as degrees * 1E7 + Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) + Altitude above ground in meters, expressed as * 1000 (millimeters) + Ground X Speed (Latitude, positive north), expressed as m/s * 100 + Ground Y Speed (Longitude, positive east), expressed as m/s * 100 + Ground Z Speed (Altitude, positive down), expressed as m/s * 100 + Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + + + The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to UINT16_MAX. + Timestamp (milliseconds since system boot) + Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + + + The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + Timestamp (milliseconds since system boot) + Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + + + The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. + Timestamp (microseconds since system boot) + Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. + Servo output 1 value, in microseconds + Servo output 2 value, in microseconds + Servo output 3 value, in microseconds + Servo output 4 value, in microseconds + Servo output 5 value, in microseconds + Servo output 6 value, in microseconds + Servo output 7 value, in microseconds + Servo output 8 value, in microseconds + + + Request a partial list of mission items from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol. If start and end index are the same, just send one waypoint. + System ID + Component ID + Start index, 0 by default + End index, -1 by default (-1: send list to end). Else a valid index of the list + + + This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! + System ID + Component ID + Start index, 0 by default and smaller / equal to the largest index of the current onboard list. + End index, equal or greater than start index. + + + Message encoding a mission item. This message is emitted to announce + the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also http://qgroundcontrol.org/mavlink/waypoint_protocol. + System ID + Component ID + Sequence + The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + false:0, true:1 + autocontinue to next wp + PARAM1, see MAV_CMD enum + PARAM2, see MAV_CMD enum + PARAM3, see MAV_CMD enum + PARAM4, see MAV_CMD enum + PARAM5 / local: x position, global: latitude + PARAM6 / y position: global: longitude + PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + + + Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol + System ID + Component ID + Sequence + + + Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). + System ID + Component ID + Sequence + + + Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. + Sequence + + + Request the overall list of mission items from the system/component. + System ID + Component ID + + + This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. + System ID + Component ID + Number of mission items in the sequence + + + Delete all mission items at once. + System ID + Component ID + + + A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. + Sequence + + + Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). + System ID + Component ID + See MAV_MISSION_RESULT enum + + + As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. + System ID + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84, in degrees * 1E7 + Altitude (AMSL), in meters * 1000 (positive for up) + + + Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (AMSL), in meters * 1000 (positive for up) + + + Bind a RC channel to a parameter. The parameter should change accoding to the RC channel value. + System ID + Component ID + Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC. + Initial parameter value + Scale, maps the RC range [-1, 1] to a parameter value + Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + + + Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. http://qgroundcontrol.org/mavlink/waypoint_protocol + System ID + Component ID + Sequence + + + Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. + System ID + Component ID + Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + x position 1 / Latitude 1 + y position 1 / Longitude 1 + z position 1 / Altitude 1 + x position 2 / Latitude 2 + y position 2 / Longitude 2 + z position 2 / Altitude 2 + + + Read out the safety zone the MAV currently assumes. + Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + x position 1 / Latitude 1 + y position 1 / Longitude 1 + z position 1 / Altitude 1 + x position 2 / Latitude 2 + y position 2 / Longitude 2 + z position 2 / Altitude 2 + + + The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + Timestamp (milliseconds since system boot) + Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + Roll angular speed (rad/s) + Pitch angular speed (rad/s) + Yaw angular speed (rad/s) + Attitude covariance + + + The state of the fixed wing navigation and position controller. + Current desired roll in degrees + Current desired pitch in degrees + Current desired heading in degrees + Bearing to current MISSION/target in degrees + Distance to active MISSION in meters + Current altitude error in meters + Current airspeed error in meters/second + Current crosstrack error on x-y plane in meters + + + The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset. + Timestamp (milliseconds since system boot) + Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver. + Class id of the estimator this estimate originated from. + Latitude, expressed as degrees * 1E7 + Longitude, expressed as degrees * 1E7 + Altitude in meters, expressed as * 1000 (millimeters), above MSL + Altitude above ground in meters, expressed as * 1000 (millimeters) + Ground X Speed (Latitude), expressed as m/s + Ground Y Speed (Longitude), expressed as m/s + Ground Z Speed (Altitude), expressed as m/s + Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.) + + + The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp + Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver. + Class id of the estimator this estimate originated from. + X Position + Y Position + Z Position + X Speed (m/s) + Y Speed (m/s) + Z Speed (m/s) + X Acceleration (m/s^2) + Y Acceleration (m/s^2) + Z Acceleration (m/s^2) + Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.) + + + The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + Timestamp (milliseconds since system boot) + Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + + + THIS INTERFACE IS DEPRECATED. USE SET_MESSAGE_INTERVAL INSTEAD. + The target requested to send the message stream. + The target requested to send the message stream. + The ID of the requested data stream + The requested message rate + 1 to start sending, 0 to stop sending. + + + THIS INTERFACE IS DEPRECATED. USE MESSAGE_INTERVAL INSTEAD. + The ID of the requested data stream + The message rate + 1 stream is enabled, 0 stream is stopped. + + + This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled an buttons are also transmit as boolean values of their + The system to be controlled. + X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + + + The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of UINT16_MAX means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + System ID + Component ID + RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. + RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. + RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. + RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. + RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. + RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. + RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. + RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + + + Message encoding a mission item. This message is emitted to announce + the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See alsohttp://qgroundcontrol.org/mavlink/waypoint_protocol. + System ID + Component ID + Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + false:0, true:1 + autocontinue to next wp + PARAM1, see MAV_CMD enum + PARAM2, see MAV_CMD enum + PARAM3, see MAV_CMD enum + PARAM4, see MAV_CMD enum + PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + + + Metrics typically displayed on a HUD for fixed wing aircraft + Current airspeed in m/s + Current ground speed in m/s + Current heading in degrees, in compass units (0..360, 0=north) + Current throttle setting in integer percent, 0 to 100 + Current altitude (MSL), in meters + Current climb rate in meters/second + + + Message encoding a command with parameters as scaled integers. Scaling depends on the actual command value. + System ID + Component ID + The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h + The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs + false:0, true:1 + autocontinue to next wp + PARAM1, see MAV_CMD enum + PARAM2, see MAV_CMD enum + PARAM3, see MAV_CMD enum + PARAM4, see MAV_CMD enum + PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + + + Send a command with up to seven parameters to the MAV + System which should execute the command + Component which should execute the command, 0 for all components + Command ID, as defined by MAV_CMD enum. + 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + Parameter 1, as defined by MAV_CMD enum. + Parameter 2, as defined by MAV_CMD enum. + Parameter 3, as defined by MAV_CMD enum. + Parameter 4, as defined by MAV_CMD enum. + Parameter 5, as defined by MAV_CMD enum. + Parameter 6, as defined by MAV_CMD enum. + Parameter 7, as defined by MAV_CMD enum. + + + Report status of a command. Includes feedback wether the command was executed. + Command ID, as defined by MAV_CMD enum. + See MAV_RESULT enum + + + Setpoint in roll, pitch, yaw and thrust from the operator + Timestamp in milliseconds since system boot + Desired roll rate in radians per second + Desired pitch rate in radians per second + Desired yaw rate in radians per second + Collective thrust, normalized to 0 .. 1 + Flight mode switch position, 0.. 255 + Override mode switch position, 0.. 255 + + + Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system). + Timestamp in milliseconds since system boot + System ID + Component ID + Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude + Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + Body roll rate in radians per second + Body roll rate in radians per second + Body roll rate in radians per second + Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + + + Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way. + Timestamp in milliseconds since system boot + Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + Body roll rate in radians per second + Body roll rate in radians per second + Body roll rate in radians per second + Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + + + Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system). + Timestamp in milliseconds since system boot + System ID + Component ID + Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + X Position in NED frame in meters + Y Position in NED frame in meters + Z Position in NED frame in meters (note, altitude is negative in NED) + X velocity in NED frame in meter / s + Y velocity in NED frame in meter / s + Z velocity in NED frame in meter / s + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint in rad + yaw rate setpoint in rad/s + + + Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way. + Timestamp in milliseconds since system boot + Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + X Position in NED frame in meters + Y Position in NED frame in meters + Z Position in NED frame in meters (note, altitude is negative in NED) + X velocity in NED frame in meter / s + Y velocity in NED frame in meter / s + Z velocity in NED frame in meter / s + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint in rad + yaw rate setpoint in rad/s + + + Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system). + Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + System ID + Component ID + Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + X Position in WGS84 frame in 1e7 * meters + Y Position in WGS84 frame in 1e7 * meters + Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + X velocity in NED frame in meter / s + Y velocity in NED frame in meter / s + Z velocity in NED frame in meter / s + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint in rad + yaw rate setpoint in rad/s + + + Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way. + Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + X Position in WGS84 frame in 1e7 * meters + Y Position in WGS84 frame in 1e7 * meters + Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + X velocity in NED frame in meter / s + Y velocity in NED frame in meter / s + Z velocity in NED frame in meter / s + X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + yaw setpoint in rad + yaw rate setpoint in rad/s + + + The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + Timestamp (milliseconds since system boot) + X Position + Y Position + Z Position + Roll + Pitch + Yaw + + + DEPRECATED PACKET! Suffers from missing airspeed fields and singularities due to Euler angles. Please use HIL_STATE_QUATERNION instead. Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations. + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + Roll angle (rad) + Pitch angle (rad) + Yaw angle (rad) + Body frame roll / phi angular speed (rad/s) + Body frame pitch / theta angular speed (rad/s) + Body frame yaw / psi angular speed (rad/s) + Latitude, expressed as * 1E7 + Longitude, expressed as * 1E7 + Altitude in meters, expressed as * 1000 (millimeters) + Ground X Speed (Latitude), expressed as m/s * 100 + Ground Y Speed (Longitude), expressed as m/s * 100 + Ground Z Speed (Altitude), expressed as m/s * 100 + X acceleration (mg) + Y acceleration (mg) + Z acceleration (mg) + + + Sent from autopilot to simulation. Hardware in the loop control outputs + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + Control output -1 .. 1 + Control output -1 .. 1 + Control output -1 .. 1 + Throttle 0 .. 1 + Aux 1, -1 .. 1 + Aux 2, -1 .. 1 + Aux 3, -1 .. 1 + Aux 4, -1 .. 1 + System mode (MAV_MODE) + Navigation mode (MAV_NAV_MODE) + + + Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + RC channel 1 value, in microseconds + RC channel 2 value, in microseconds + RC channel 3 value, in microseconds + RC channel 4 value, in microseconds + RC channel 5 value, in microseconds + RC channel 6 value, in microseconds + RC channel 7 value, in microseconds + RC channel 8 value, in microseconds + RC channel 9 value, in microseconds + RC channel 10 value, in microseconds + RC channel 11 value, in microseconds + RC channel 12 value, in microseconds + Receive signal strength indicator, 0: 0%, 255: 100% + + + Optical flow from a flow sensor (e.g. optical mouse sensor) + Timestamp (UNIX) + Sensor ID + Flow in pixels * 10 in x-sensor direction (dezi-pixels) + Flow in pixels * 10 in y-sensor direction (dezi-pixels) + Flow in meters in x-sensor direction, angular-speed compensated + Flow in meters in y-sensor direction, angular-speed compensated + Optical flow quality / confidence. 0: bad, 255: maximum quality + Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + + + Timestamp (microseconds, synced to UNIX time or since system boot) + Global X position + Global Y position + Global Z position + Roll angle in rad + Pitch angle in rad + Yaw angle in rad + + + Timestamp (microseconds, synced to UNIX time or since system boot) + Global X position + Global Y position + Global Z position + Roll angle in rad + Pitch angle in rad + Yaw angle in rad + + + Timestamp (microseconds, synced to UNIX time or since system boot) + Global X speed + Global Y speed + Global Z speed + + + Timestamp (microseconds, synced to UNIX time or since system boot) + Global X position + Global Y position + Global Z position + Roll angle in rad + Pitch angle in rad + Yaw angle in rad + + + The IMU readings in SI units in NED body frame + Timestamp (microseconds, synced to UNIX time or since system boot) + X acceleration (m/s^2) + Y acceleration (m/s^2) + Z acceleration (m/s^2) + Angular speed around X axis (rad / sec) + Angular speed around Y axis (rad / sec) + Angular speed around Z axis (rad / sec) + X Magnetic field (Gauss) + Y Magnetic field (Gauss) + Z Magnetic field (Gauss) + Absolute pressure in millibar + Differential pressure in millibar + Altitude calculated from pressure + Temperature in degrees celsius + Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + + + Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor) + Timestamp (microseconds, synced to UNIX time or since system boot) + Sensor ID + Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + RH rotation around X axis (rad) + RH rotation around Y axis (rad) + RH rotation around Z axis (rad) + Temperature * 100 in centi-degrees Celsius + Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + Time in microseconds since the distance was sampled. + Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + + + The IMU readings in SI units in NED body frame + Timestamp (microseconds, synced to UNIX time or since system boot) + X acceleration (m/s^2) + Y acceleration (m/s^2) + Z acceleration (m/s^2) + Angular speed around X axis in body frame (rad / sec) + Angular speed around Y axis in body frame (rad / sec) + Angular speed around Z axis in body frame (rad / sec) + X Magnetic field (Gauss) + Y Magnetic field (Gauss) + Z Magnetic field (Gauss) + Absolute pressure in millibar + Differential pressure (airspeed) in millibar + Altitude calculated from pressure + Temperature in degrees celsius + Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. + + + + Status of simulation environment, if used + True attitude quaternion component 1, w (1 in null-rotation) + True attitude quaternion component 2, x (0 in null-rotation) + True attitude quaternion component 3, y (0 in null-rotation) + True attitude quaternion component 4, z (0 in null-rotation) + Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + X acceleration m/s/s + Y acceleration m/s/s + Z acceleration m/s/s + Angular speed around X axis rad/s + Angular speed around Y axis rad/s + Angular speed around Z axis rad/s + Latitude in degrees + Longitude in degrees + Altitude in meters + Horizontal position standard deviation + Vertical position standard deviation + True velocity in m/s in NORTH direction in earth-fixed NED frame + True velocity in m/s in EAST direction in earth-fixed NED frame + True velocity in m/s in DOWN direction in earth-fixed NED frame + + + + Status generated by radio and injected into MAVLink stream. + Local signal strength + Remote signal strength + Remaining free buffer space in percent. + Background noise level + Remote background noise level + Receive errors + Count of error corrected packets + + + File transfer message + Network ID (0 for broadcast) + System ID (0 for broadcast) + Component ID (0 for broadcast) + Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + + + Time synchronization message. + Time sync timestamp 1 + Time sync timestamp 2 + + + Camera-IMU triggering and synchronisation message. + Timestamp for the image frame in microseconds + Image frame sequence + + + The global position, as returned by the Global Positioning System (GPS). This is + NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 + GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 + GPS ground speed (m/s * 100). If unknown, set to: 65535 + GPS velocity in cm/s in NORTH direction in earth-fixed NED frame + GPS velocity in cm/s in EAST direction in earth-fixed NED frame + GPS velocity in cm/s in DOWN direction in earth-fixed NED frame + Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 + Number of satellites visible. If unknown, set to 255 + + + Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor) + Timestamp (microseconds, synced to UNIX time or since system boot) + Sensor ID + Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + RH rotation around X axis (rad) + RH rotation around Y axis (rad) + RH rotation around Z axis (rad) + Temperature * 100 in centi-degrees Celsius + Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + Time in microseconds since the distance was sampled. + Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + + + Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations. + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + Body frame roll / phi angular speed (rad/s) + Body frame pitch / theta angular speed (rad/s) + Body frame yaw / psi angular speed (rad/s) + Latitude, expressed as * 1E7 + Longitude, expressed as * 1E7 + Altitude in meters, expressed as * 1000 (millimeters) + Ground X Speed (Latitude), expressed as m/s * 100 + Ground Y Speed (Longitude), expressed as m/s * 100 + Ground Z Speed (Altitude), expressed as m/s * 100 + Indicated airspeed, expressed as m/s * 100 + True airspeed, expressed as m/s * 100 + X acceleration (mg) + Y acceleration (mg) + Z acceleration (mg) + + + The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units + Timestamp (milliseconds since system boot) + X acceleration (mg) + Y acceleration (mg) + Z acceleration (mg) + Angular speed around X axis (millirad /sec) + Angular speed around Y axis (millirad /sec) + Angular speed around Z axis (millirad /sec) + X Magnetic field (milli tesla) + Y Magnetic field (milli tesla) + Z Magnetic field (milli tesla) + + + Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. + System ID + Component ID + First log id (0 for first available) + Last log id (0xffff for last available) + + + Reply to LOG_REQUEST_LIST + Log id + Total number of logs + High log number + UTC timestamp of log in seconds since 1970, or 0 if not available + Size of the log (may be approximate) in bytes + + + Request a chunk of a log + System ID + Component ID + Log id (from LOG_ENTRY reply) + Offset into the log + Number of bytes + + + Reply to LOG_REQUEST_DATA + Log id (from LOG_ENTRY reply) + Offset into the log + Number of bytes (zero for end of log) + log data + + + Erase all logs + System ID + Component ID + + + Stop log transfer and resume normal logging + System ID + Component ID + + + data for injecting into the onboard GPS (used for DGPS) + System ID + Component ID + data length + raw data (110 is enough for 12 satellites of RTCMv2) + + + Second GPS data. Coordinate frame is right-handed, Z-axis up (GPS frame). + Timestamp (microseconds since UNIX epoch or microseconds since system boot) + 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + Number of satellites visible. If unknown, set to 255 + Number of DGPS satellites + Age of DGPS info + + + Power supply status + 5V rail voltage in millivolts + servo rail voltage in millivolts + power supply status flags (see MAV_POWER_STATUS enum) + + + Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate. + See SERIAL_CONTROL_DEV enum + See SERIAL_CONTROL_FLAG enum + Timeout for reply data in milliseconds + Baudrate of transfer. Zero means no change. + how many bytes in this transfer + serial data + + + RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + Time since boot of last baseline message received in ms. + Identification of connected RTK receiver. + GPS Week Number of last baseline + GPS Time of Week of last baseline + GPS-specific health report for RTK data. + Rate of baseline messages being received by GPS, in HZ + Current number of sats used for RTK calculation. + Coordinate system of baseline. 0 == ECEF, 1 == NED + Current baseline in ECEF x or NED north component in mm. + Current baseline in ECEF y or NED east component in mm. + Current baseline in ECEF z or NED down component in mm. + Current estimate of baseline accuracy. + Current number of integer ambiguity hypotheses. + + + RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + Time since boot of last baseline message received in ms. + Identification of connected RTK receiver. + GPS Week Number of last baseline + GPS Time of Week of last baseline + GPS-specific health report for RTK data. + Rate of baseline messages being received by GPS, in HZ + Current number of sats used for RTK calculation. + Coordinate system of baseline. 0 == ECEF, 1 == NED + Current baseline in ECEF x or NED north component in mm. + Current baseline in ECEF y or NED east component in mm. + Current baseline in ECEF z or NED down component in mm. + Current estimate of baseline accuracy. + Current number of integer ambiguity hypotheses. + + + The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units + Timestamp (milliseconds since system boot) + X acceleration (mg) + Y acceleration (mg) + Z acceleration (mg) + Angular speed around X axis (millirad /sec) + Angular speed around Y axis (millirad /sec) + Angular speed around Z axis (millirad /sec) + X Magnetic field (milli tesla) + Y Magnetic field (milli tesla) + Z Magnetic field (milli tesla) + + + type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) + total data size in bytes (set on ACK only) + Width of a matrix or image + Height of a matrix or image + number of packets beeing sent (set on ACK only) + payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) + JPEG quality out of [1,100] + + + sequence number (starting with 0 on every transmission) + image data bytes + + + Time since system boot + Minimum distance the sensor can measure in centimeters + Maximum distance the sensor can measure in centimeters + Current distance reading + Type from MAV_DISTANCE_SENSOR enum. + Onboard ID of the sensor + Direction the sensor faces from MAV_SENSOR_ORIENTATION enum. + Measurement covariance in centimeters, 0 for unknown / invalid readings + + + Request for terrain data and terrain status + Latitude of SW corner of first grid (degrees *10^7) + Longitude of SW corner of first grid (in degrees *10^7) + Grid spacing in meters + Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + + + Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST + Latitude of SW corner of first grid (degrees *10^7) + Longitude of SW corner of first grid (in degrees *10^7) + Grid spacing in meters + bit within the terrain request mask + Terrain data in meters AMSL + + + Request that the vehicle report terrain height at the given location. Used by GCS to check if vehicle has all terrain data needed for a mission. + Latitude (degrees *10^7) + Longitude (degrees *10^7) + + + Response from a TERRAIN_CHECK request + Latitude (degrees *10^7) + Longitude (degrees *10^7) + grid spacing (zero if terrain at this location unavailable) + Terrain height in meters AMSL + Current vehicle height above lat/lon terrain height (meters) + Number of 4x4 terrain blocks waiting to be received or read from disk + Number of 4x4 terrain blocks in memory + + + Barometer readings for 2nd barometer + Timestamp (milliseconds since system boot) + Absolute pressure (hectopascal) + Differential pressure 1 (hectopascal) + Temperature measurement (0.01 degrees celsius) + + + Motion capture attitude and position + Timestamp (micros since boot or Unix epoch) + Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + X position in meters (NED) + Y position in meters (NED) + Z position in meters (NED) + + + Set the vehicle attitude and body angular rates. + Timestamp (micros since boot or Unix epoch) + Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + System ID + Component ID + Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + + + Set the vehicle attitude and body angular rates. + Timestamp (micros since boot or Unix epoch) + Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + + + The current system altitude. + Timestamp (milliseconds since system boot) + This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. + This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + This is the altitude above the home position. It resets on each change of the current home position. + This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + + + The autopilot is requesting a resource (file, binary, other type of data) + Request ID. This ID should be re-used when sending back URI contents + The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + + + Barometer readings for 3rd barometer + Timestamp (milliseconds since system boot) + Absolute pressure (hectopascal) + Differential pressure 1 (hectopascal) + Temperature measurement (0.01 degrees celsius) + + + current motion information from a designated system + Timestamp in milliseconds since system boot + bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84), in degrees * 1E7 + AMSL, in meters + target velocity (0,0,0) for unknown + linear target acceleration (0,0,0) for unknown + (1 0 0 0 for unknown) + (0 0 0 for unknown) + eph epv + button states or switches of a tracker device + + + The smoothed, monotonic system state used to feed the control loops of the system. + Timestamp (micros since boot or Unix epoch) + X acceleration in body frame + Y acceleration in body frame + Z acceleration in body frame + X velocity in body frame + Y velocity in body frame + Z velocity in body frame + X position in local frame + Y position in local frame + Z position in local frame + Airspeed, set to -1 if unknown + Variance of body velocity estimate + Variance in local position + The attitude, represented as Quaternion + Angular rate in roll axis + Angular rate in pitch axis + Angular rate in yaw axis + + + Battery information + Battery ID + Function of the battery + Type (chemistry) of the battery + Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. + Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. + Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate + Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate + Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + + + Version and capability of autopilot software + bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) + Firmware version number + Middleware version number + Operating system version number + HW / board version (last 8 bytes should be silicon ID, if any) + Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + ID of the board vendor + ID of the product + UID if provided by hardware + + + The location of a landing area captured from a downward facing camera + Timestamp (micros since boot or Unix epoch) + The ID of the target if multiple targets are present + MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. + X-axis angular offset (in radians) of the target from the center of the image + Y-axis angular offset (in radians) of the target from the center of the image + Distance to the target from the vehicle in meters + Size in radians of target along x-axis + Size in radians of target along y-axis + + + + Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovaton test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovaton test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user. + Timestamp (micros since boot or Unix epoch) + Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. + Velocity innovation test ratio + Horizontal position innovation test ratio + Vertical position innovation test ratio + Magnetometer innovation test ratio + Height above terrain innovation test ratio + True airspeed innovation test ratio + Horizontal position 1-STD accuracy relative to the EKF local origin (m) + Vertical position 1-STD accuracy relative to the EKF local origin (m) + + + Timestamp (micros since boot or Unix epoch) + Wind in X (NED) direction in m/s + Wind in Y (NED) direction in m/s + Wind in Z (NED) direction in m/s + Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. + Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. + AMSL altitude (m) this measurement was taken at + Horizontal speed 1-STD accuracy + Vertical speed 1-STD accuracy + + + Vibration levels and accelerometer clipping + Timestamp (micros since boot or Unix epoch) + Vibration levels on X-axis + Vibration levels on Y-axis + Vibration levels on Z-axis + first accelerometer clipping count + second accelerometer clipping count + third accelerometer clipping count + + + This message can be requested by sending the MAV_CMD_GET_HOME_POSITION command. The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The position the system will return to and land on. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84, in degrees * 1E7 + Altitude (AMSL), in meters * 1000 (positive for up) + Local X position of this position in the local coordinate frame + Local Y position of this position in the local coordinate frame + Local Z position of this position in the local coordinate frame + World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + + + The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + System ID. + Latitude (WGS84), in degrees * 1E7 + Longitude (WGS84, in degrees * 1E7 + Altitude (AMSL), in meters * 1000 (positive for up) + Local X position of this position in the local coordinate frame + Local Y position of this position in the local coordinate frame + Local Z position of this position in the local coordinate frame + World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + + + This interface replaces DATA_STREAM + The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + + + Provides state for additional features + The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + + + The location and information of an ADSB vehicle + ICAO address + Latitude, expressed as degrees * 1E7 + Longitude, expressed as degrees * 1E7 + Type from ADSB_ALTITUDE_TYPE enum + Altitude(ASL) in millimeters + Course over ground in centidegrees + The horizontal velocity in centimeters/second + The vertical velocity in centimeters/second, positive is up + The callsign, 8+null + Type from ADSB_EMITTER_TYPE enum + Time since last communication in seconds + Flags to indicate various statuses including valid data fields + Squawk code + + + Message implementing parts of the V2 payload specs in V1 frames for transitional support. + Network ID (0 for broadcast) + System ID (0 for broadcast) + Component ID (0 for broadcast) + A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + + + Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + Starting address of the debug variables + Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + Memory contents at specified address + + + Name + Timestamp + x + y + z + + + Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + Timestamp (milliseconds since system boot) + Name of the debug variable + Floating point value + + + Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + Timestamp (milliseconds since system boot) + Name of the debug variable + Signed integer value + + + Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). + Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. + Status text message, without null termination character + + + Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. + Timestamp (milliseconds since system boot) + index of debug variable + DEBUG value + + + diff --git a/MAVLINK_msg/matrixpilot.xml b/MAVLINK_msg/matrixpilot.xml new file mode 100644 index 0000000..29d368d --- /dev/null +++ b/MAVLINK_msg/matrixpilot.xml @@ -0,0 +1,284 @@ + + + common.xml + + + + + + + + Action required when performing CMD_PREFLIGHT_STORAGE + + Read all parameters from storage + + + Write all parameters to storage + + + Clear all parameters in storage + + + Read specific parameters from storage + + + Write specific parameters to storage + + + Clear specific parameters in storage + + + do nothing + + + + + + Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. + Storage action: Action defined by MAV_PREFLIGHT_STORAGE_ACTION_ADVANCED + Storage area as defined by parameter database + Storage flags as defined by parameter database + Empty + Empty + Empty + Empty + + + + + + + + + Depreciated but used as a compiler flag. Do not remove + System ID + Component ID + + + Reqest reading of flexifunction data + System ID + Component ID + Type of flexifunction data requested + index into data where needed + + + Flexifunction type and parameters for component at function index from buffer + System ID + Component ID + Function index + Total count of functions + Address in the flexifunction data, Set to 0xFFFF to use address in target memory + Size of the + Settings data + + + Flexifunction type and parameters for component at function index from buffer + System ID + Component ID + Function index + result of acknowledge, 0=fail, 1=good + + + Acknowldge sucess or failure of a flexifunction command + System ID + Component ID + 0=inputs, 1=outputs + index of first directory entry to write + count of directory entries to write + Settings data + + + Acknowldge sucess or failure of a flexifunction command + System ID + Component ID + 0=inputs, 1=outputs + index of first directory entry to write + count of directory entries to write + result of acknowledge, 0=fail, 1=good + + + Acknowldge sucess or failure of a flexifunction command + System ID + Component ID + Flexifunction command type + + + Acknowldge sucess or failure of a flexifunction command + Command acknowledged + result of acknowledge + + + Backwards compatible MAVLink version of SERIAL_UDB_EXTRA - F2: Format Part A + Serial UDB Extra Time + Serial UDB Extra Status + Serial UDB Extra Latitude + Serial UDB Extra Longitude + Serial UDB Extra Altitude + Serial UDB Extra Waypoint Index + Serial UDB Extra Rmat 0 + Serial UDB Extra Rmat 1 + Serial UDB Extra Rmat 2 + Serial UDB Extra Rmat 3 + Serial UDB Extra Rmat 4 + Serial UDB Extra Rmat 5 + Serial UDB Extra Rmat 6 + Serial UDB Extra Rmat 7 + Serial UDB Extra Rmat 8 + Serial UDB Extra GPS Course Over Ground + Serial UDB Extra Speed Over Ground + Serial UDB Extra CPU Load + Serial UDB Extra Voltage in MilliVolts + Serial UDB Extra 3D IMU Air Speed + Serial UDB Extra Estimated Wind 0 + Serial UDB Extra Estimated Wind 1 + Serial UDB Extra Estimated Wind 2 + Serial UDB Extra Magnetic Field Earth 0 + Serial UDB Extra Magnetic Field Earth 1 + Serial UDB Extra Magnetic Field Earth 2 + Serial UDB Extra Number of Sattelites in View + Serial UDB Extra GPS Horizontal Dilution of Precision + + + Backwards compatible version of SERIAL_UDB_EXTRA - F2: Part B + Serial UDB Extra Time + Serial UDB Extra PWM Input Channel 1 + Serial UDB Extra PWM Input Channel 2 + Serial UDB Extra PWM Input Channel 3 + Serial UDB Extra PWM Input Channel 4 + Serial UDB Extra PWM Input Channel 5 + Serial UDB Extra PWM Input Channel 6 + Serial UDB Extra PWM Input Channel 7 + Serial UDB Extra PWM Input Channel 8 + Serial UDB Extra PWM Input Channel 9 + Serial UDB Extra PWM Input Channel 10 + Serial UDB Extra PWM Output Channel 1 + Serial UDB Extra PWM Output Channel 2 + Serial UDB Extra PWM Output Channel 3 + Serial UDB Extra PWM Output Channel 4 + Serial UDB Extra PWM Output Channel 5 + Serial UDB Extra PWM Output Channel 6 + Serial UDB Extra PWM Output Channel 7 + Serial UDB Extra PWM Output Channel 8 + Serial UDB Extra PWM Output Channel 9 + Serial UDB Extra PWM Output Channel 10 + Serial UDB Extra IMU Location X + Serial UDB Extra IMU Location Y + Serial UDB Extra IMU Location Z + Serial UDB Extra Status Flags + Serial UDB Extra Oscillator Failure Count + Serial UDB Extra IMU Velocity X + Serial UDB Extra IMU Velocity Y + Serial UDB Extra IMU Velocity Z + Serial UDB Extra Current Waypoint Goal X + Serial UDB Extra Current Waypoint Goal Y + Serial UDB Extra Current Waypoint Goal Z + Serial UDB Extra Stack Memory Free + + + Backwards compatible version of SERIAL_UDB_EXTRA F4: format + Serial UDB Extra Roll Stabilization with Ailerons Enabled + Serial UDB Extra Roll Stabilization with Rudder Enabled + Serial UDB Extra Pitch Stabilization Enabled + Serial UDB Extra Yaw Stabilization using Rudder Enabled + Serial UDB Extra Yaw Stabilization using Ailerons Enabled + Serial UDB Extra Navigation with Ailerons Enabled + Serial UDB Extra Navigation with Rudder Enabled + Serial UDB Extra Type of Alitude Hold when in Stabilized Mode + Serial UDB Extra Type of Alitude Hold when in Waypoint Mode + Serial UDB Extra Firmware racing mode enabled + + + Backwards compatible version of SERIAL_UDB_EXTRA F5: format + Serial UDB YAWKP_AILERON Gain for Proporional control of navigation + Serial UDB YAWKD_AILERON Gain for Rate control of navigation + Serial UDB Extra ROLLKP Gain for Proportional control of roll stabilization + Serial UDB Extra ROLLKD Gain for Rate control of roll stabilization + YAW_STABILIZATION_AILERON Proportional control + Gain For Boosting Manual Aileron control When Plane Stabilized + + + Backwards compatible version of SERIAL_UDB_EXTRA F6: format + Serial UDB Extra PITCHGAIN Proportional Control + Serial UDB Extra Pitch Rate Control + Serial UDB Extra Rudder to Elevator Mix + Serial UDB Extra Roll to Elevator Mix + Gain For Boosting Manual Elevator control When Plane Stabilized + + + Backwards compatible version of SERIAL_UDB_EXTRA F7: format + Serial UDB YAWKP_RUDDER Gain for Proporional control of navigation + Serial UDB YAWKD_RUDDER Gain for Rate control of navigation + Serial UDB Extra ROLLKP_RUDDER Gain for Proportional control of roll stabilization + Serial UDB Extra ROLLKD_RUDDER Gain for Rate control of roll stabilization + SERIAL UDB EXTRA Rudder Boost Gain to Manual Control when stabilized + Serial UDB Extra Return To Landing - Angle to Pitch Plane Down + + + Backwards compatible version of SERIAL_UDB_EXTRA F8: format + Serial UDB Extra HEIGHT_TARGET_MAX + Serial UDB Extra HEIGHT_TARGET_MIN + Serial UDB Extra ALT_HOLD_THROTTLE_MIN + Serial UDB Extra ALT_HOLD_THROTTLE_MAX + Serial UDB Extra ALT_HOLD_PITCH_MIN + Serial UDB Extra ALT_HOLD_PITCH_MAX + Serial UDB Extra ALT_HOLD_PITCH_HIGH + + + Backwards compatible version of SERIAL_UDB_EXTRA F13: format + Serial UDB Extra GPS Week Number + Serial UDB Extra MP Origin Latitude + Serial UDB Extra MP Origin Longitude + Serial UDB Extra MP Origin Altitude Above Sea Level + + + Backwards compatible version of SERIAL_UDB_EXTRA F14: format + Serial UDB Extra Wind Estimation Enabled + Serial UDB Extra Type of GPS Unit + Serial UDB Extra Dead Reckoning Enabled + Serial UDB Extra Type of UDB Hardware + Serial UDB Extra Type of Airframe + Serial UDB Extra Reboot Regitster of DSPIC + Serial UDB Extra Last dspic Trap Flags + Serial UDB Extra Type Program Address of Last Trap + Serial UDB Extra Number of Ocillator Failures + Serial UDB Extra UDB Internal Clock Configuration + Serial UDB Extra Type of Flight Plan + + + Backwards compatible version of SERIAL_UDB_EXTRA F15 and F16: format + Serial UDB Extra Model Name Of Vehicle + Serial UDB Extra Registraton Number of Vehicle + + + Serial UDB Extra Name of Expected Lead Pilot + Serial UDB Extra URL of Lead Pilot or Team + + + The altitude measured by sensors and IMU + Timestamp (milliseconds since system boot) + GPS altitude in meters, expressed as * 1000 (millimeters), above MSL + IMU altitude above ground in meters, expressed as * 1000 (millimeters) + barometeric altitude above ground in meters, expressed as * 1000 (millimeters) + Optical flow altitude above ground in meters, expressed as * 1000 (millimeters) + Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters) + Extra altitude above ground in meters, expressed as * 1000 (millimeters) + + + The airspeed measured by sensors and IMU + Timestamp (milliseconds since system boot) + Airspeed estimate from IMU, cm/s + Pitot measured forward airpseed, cm/s + Hot wire anenometer measured airspeed, cm/s + Ultrasonic measured airspeed, cm/s + Angle of attack sensor, degrees * 10 + Yaw angle sensor, degrees * 10 + + + + diff --git a/MAVLINK_msg/minimal.xml b/MAVLINK_msg/minimal.xml new file mode 100644 index 0000000..88985a5 --- /dev/null +++ b/MAVLINK_msg/minimal.xml @@ -0,0 +1,189 @@ + + + 2 + + + Micro air vehicle / autopilot classes. This identifies the individual model. + + Generic autopilot, full support for everything + + + PIXHAWK autopilot, http://pixhawk.ethz.ch + + + SLUGS autopilot, http://slugsuav.soe.ucsc.edu + + + ArduPilotMega / ArduCopter, http://diydrones.com + + + OpenPilot, http://openpilot.org + + + Generic autopilot only supporting simple waypoints + + + Generic autopilot supporting waypoints and other simple navigation commands + + + Generic autopilot supporting the full mission command set + + + No valid autopilot, e.g. a GCS or other MAVLink component + + + PPZ UAV - http://nongnu.org/paparazzi + + + UAV Dev Board + + + FlexiPilot + + + + + Generic micro air vehicle. + + + Fixed wing aircraft. + + + Quadrotor + + + Coaxial helicopter + + + Normal helicopter with tail rotor. + + + Ground installation + + + Operator control unit / ground control station + + + Airship, controlled + + + Free balloon, uncontrolled + + + Rocket + + + Ground rover + + + Surface vessel, boat, ship + + + Submarine + + + Hexarotor + + + Octorotor + + + Octorotor + + + Flapping wing + + + + These flags encode the MAV mode. + + 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. + + + 0b01000000 remote control input is enabled. + + + 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. + + + 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. + + + 0b00001000 guided mode enabled, system flies MISSIONs / mission items. + + + 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. + + + 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. + + + 0b00000001 Reserved for future use. + + + + These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. + + First bit: 10000000 + + + Second bit: 01000000 + + + Third bit: 00100000 + + + Fourth bit: 00010000 + + + Fifth bit: 00001000 + + + Sixt bit: 00000100 + + + Seventh bit: 00000010 + + + Eighth bit: 00000001 + + + + + Uninitialized system, state is unknown. + + + System is booting up. + + + System is calibrating and not flight-ready. + + + System is grounded and on standby. It can be launched any time. + + + System is active and might be already airborne. Motors are engaged. + + + System is in a non-normal flight mode. It can however still navigate. + + + System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. + + + System just initialized its power-down sequence, will shut down now. + + + + + + The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). + Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) + Autopilot type / class. defined in MAV_AUTOPILOT ENUM + System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h + A bitfield for use for autopilot-specific flags. + System status flag, see MAV_STATE ENUM + MAVLink version + + + diff --git a/MAVLINK_msg/oroca_bldc.xml b/MAVLINK_msg/oroca_bldc.xml new file mode 100644 index 0000000..f3d93bd --- /dev/null +++ b/MAVLINK_msg/oroca_bldc.xml @@ -0,0 +1,14 @@ + + + common.xml + 3 + + + + + + Message For set angular velocity + velocity value + + + diff --git a/MAVLINK_msg/paparazzi.xml b/MAVLINK_msg/paparazzi.xml new file mode 100644 index 0000000..2200075 --- /dev/null +++ b/MAVLINK_msg/paparazzi.xml @@ -0,0 +1,38 @@ + + + common.xml + 3 + + + + + + Message encoding a mission script item. This message is emitted upon a request for the next script item. + System ID + Component ID + Sequence + The name of the mission script, NULL terminated. + + + Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message. + System ID + Component ID + Sequence + + + Request the overall list of mission items from the system/component. + System ID + Component ID + + + This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts. + System ID + Component ID + Number of script items in the sequence + + + This message informs about the currently active SCRIPT. + Active Sequence + + + diff --git a/MAVLINK_msg/python_array_test.xml b/MAVLINK_msg/python_array_test.xml new file mode 100644 index 0000000..c015085 --- /dev/null +++ b/MAVLINK_msg/python_array_test.xml @@ -0,0 +1,67 @@ + + + +common.xml + + + Array test #0. + Stub field + Value array + Value array + Value array + Value array + + + Array test #1. + Value array + + + Array test #3. + Stub field + Value array + + + Array test #4. + Value array + Stub field + + + Array test #5. + Value array + Value array + + + Array test #6. + Stub field + Stub field + Stub field + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + + + Array test #7. + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + Value array + + + Array test #8. + Stub field + Value array + Value array + + + diff --git a/MAVLINK_msg/slugs.xml b/MAVLINK_msg/slugs.xml new file mode 100644 index 0000000..a985eab --- /dev/null +++ b/MAVLINK_msg/slugs.xml @@ -0,0 +1,339 @@ + + + common.xml + + + + + + Does nothing. + 1 to arm, 0 to disarm + + + + + + Return vehicle to base. + 0: return to base, 1: track mobile base + + + Stops the vehicle from returning to base and resumes flight. + + + Turns the vehicle's visible or infrared lights on or off. + 0: visible lights, 1: infrared lights + 0: turn on, 1: turn off + + + Requests vehicle to send current mid-level commands to ground station. + + + Requests storage of mid-level commands. + Mid-level command storage: 0: read from flash/EEPROM, 1: write to flash/EEPROM + + + + + + Slugs-specific navigation modes. + + No change to SLUGS mode. + + + Vehicle is in liftoff mode. + + + Vehicle is in passthrough mode, being controlled by a pilot. + + + Vehicle is in waypoint mode, navigating to waypoints. + + + Vehicle is executing mid-level commands. + + + Vehicle is returning to the home location. + + + Vehicle is landing. + + + Lost connection with vehicle. + + + Vehicle is in selective passthrough mode, where selected surfaces are being manually controlled. + + + Vehicle is in ISR mode, performing reconaissance at a point specified by ISR_LOCATION message. + + + Vehicle is patrolling along lines between waypoints. + + + Vehicle is grounded or an error has occurred. + + + + + These flags encode the control surfaces for selective passthrough mode. If a bit is set then the pilot console + has control of the surface, and if not then the autopilot has control of the surface. + + 0b10000000 Throttle control passes through to pilot console. + + + 0b01000000 Left aileron control passes through to pilot console. + + + 0b00100000 Right aileron control passes through to pilot console. + + + 0b00010000 Rudder control passes through to pilot console. + + + 0b00001000 Left elevator control passes through to pilot console. + + + 0b00000100 Right elevator control passes through to pilot console. + + + 0b00000010 Left flap control passes through to pilot console. + + + 0b00000001 Right flap control passes through to pilot console. + + + + + + + + Sensor and DSC control loads. + Sensor DSC Load + Control DSC Load + Battery Voltage in millivolts + + + + Accelerometer and gyro biases. + Accelerometer X bias (m/s) + Accelerometer Y bias (m/s) + Accelerometer Z bias (m/s) + Gyro X bias (rad/s) + Gyro Y bias (rad/s) + Gyro Z bias (rad/s) + + + + Configurable diagnostic messages. + Diagnostic float 1 + Diagnostic float 2 + Diagnostic float 3 + Diagnostic short 1 + Diagnostic short 2 + Diagnostic short 3 + + + + Data used in the navigation algorithm. + Measured Airspeed prior to the nav filter in m/s + Commanded Roll + Commanded Pitch + Commanded Turn rate + Y component of the body acceleration + Total Distance to Run on this leg of Navigation + Remaining distance to Run on this leg of Navigation + Origin WP + Destination WP + Commanded altitude in 0.1 m + + + + Configurable data log probes to be used inside Simulink + Log value 1 + Log value 2 + Log value 3 + Log value 4 + Log value 5 + Log value 6 + + + + Pilot console PWM messges. + Year reported by Gps + Month reported by Gps + Day reported by Gps + Hour reported by Gps + Min reported by Gps + Sec reported by Gps + Clock Status. See table 47 page 211 OEMStar Manual + Visible satellites reported by Gps + Used satellites in Solution + GPS+GLONASS satellites in Solution + GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?) + Percent used GPS + + + + Mid Level commands sent from the GS to the autopilot. These are only sent when being operated in mid-level commands mode from the ground. + The system setting the commands + Commanded Altitude in meters + Commanded Airspeed in m/s + Commanded Turnrate in rad/s + + + + This message sets the control surfaces for selective passthrough mode. + The system setting the commands + Bitfield containing the passthrough configuration, see CONTROL_SURFACE_FLAG ENUM. + + + + Orders generated to the SLUGS camera mount. + The system reporting the action + Order the mount to pan: -1 left, 0 No pan motion, +1 right + Order the mount to tilt: -1 down, 0 No tilt motion, +1 up + Order the zoom values 0 to 10 + Orders the camera mount to move home. The other fields are ignored when this field is set. 1: move home, 0 ignored + + + + Control for surface; pending and order to origin. + The system setting the commands + ID control surface send 0: throttle 1: aileron 2: elevator 3: rudder + Pending + Order to origin + + + + + + + Transmits the last known position of the mobile GS to the UAV. Very relevant when Track Mobile is enabled + The system reporting the action + Mobile Latitude + Mobile Longitude + + + + Control for camara. + The system setting the commands + ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight + 1: up/on 2: down/off 3: auto/reset/no action + + + + Transmits the position of watch + The system reporting the action + ISR Latitude + ISR Longitude + ISR Height + Option 1 + Option 2 + Option 3 + + + + + + + Transmits the readings from the voltage and current sensors + It is the value of reading 2: 0 - Current, 1 - Foreward Sonar, 2 - Back Sonar, 3 - RPM + Voltage in uS of PWM. 0 uS = 0V, 20 uS = 21.5V + Depends on the value of r2Type (0) Current consumption in uS of PWM, 20 uS = 90Amp (1) Distance in cm (2) Distance in cm (3) Absolute value + + + + Transmits the actual Pan, Tilt and Zoom values of the camera unit + The actual Zoom Value + The Pan value in 10ths of degree + The Tilt value in 10ths of degree + + + + Transmits the actual status values UAV in flight + The ID system reporting the action + Latitude UAV + Longitude UAV + Altitude UAV + Speed UAV + Course UAV + + + + This contains the status of the GPS readings + Number of times checksum has failed + The quality indicator, 0=fix not available or invalid, 1=GPS fix, 2=C/A differential GPS, 6=Dead reckoning mode, 7=Manual input mode (fixed position), 8=Simulator mode, 9= WAAS a + Indicates if GN, GL or GP messages are being received + A = data valid, V = data invalid + Magnetic variation, degrees + Magnetic variation direction E/W. Easterly variation (E) subtracts from True course and Westerly variation (W) adds to True course + Positioning system mode indicator. A - Autonomous;D-Differential; E-Estimated (dead reckoning) mode;M-Manual input; N-Data not valid + + + + Transmits the diagnostics data from the Novatel OEMStar GPS + The Time Status. See Table 8 page 27 Novatel OEMStar Manual + Status Bitfield. See table 69 page 350 Novatel OEMstar Manual + solution Status. See table 44 page 197 + position type. See table 43 page 196 + velocity type. See table 43 page 196 + Age of the position solution in seconds + Times the CRC has failed since boot + + + + Diagnostic data Sensor MCU + Float field 1 + Float field 2 + Int 16 field 1 + Int 8 field 1 + + + + + The boot message indicates that a system is starting. The onboard software version allows to keep track of onboard soft/firmware revisions. This message allows the sensor and control MCUs to communicate version numbers on startup. + The onboard software version + + + diff --git a/MAVLINK_msg/test.xml b/MAVLINK_msg/test.xml new file mode 100644 index 0000000..02bc032 --- /dev/null +++ b/MAVLINK_msg/test.xml @@ -0,0 +1,31 @@ + + + 3 + + + Test all field types + char + string + uint8_t + uint16_t + uint32_t + uint64_t + int8_t + int16_t + int32_t + int64_t + float + double + uint8_t_array + uint16_t_array + uint32_t_array + uint64_t_array + int8_t_array + int16_t_array + int32_t_array + int64_t_array + float_array + double_array + + + diff --git a/MAVLINK_msg/ualberta.xml b/MAVLINK_msg/ualberta.xml new file mode 100644 index 0000000..bb57e84 --- /dev/null +++ b/MAVLINK_msg/ualberta.xml @@ -0,0 +1,76 @@ + + + common.xml + + + Available autopilot modes for ualberta uav + + Raw input pulse widts sent to output + + + Inputs are normalized using calibration, the converted back to raw pulse widths for output + + + dfsdfs + + + dfsfds + + + dfsdfsdfs + + + + Navigation filter mode + + + AHRS mode + + + INS/GPS initialization mode + + + INS/GPS mode + + + + Mode currently commanded by pilot + + sdf + + + dfs + + + Rotomotion mode + + + + + + Accelerometer and Gyro biases from the navigation filter + Timestamp (microseconds) + b_f[0] + b_f[1] + b_f[2] + b_f[0] + b_f[1] + b_f[2] + + + Complete set of calibration parameters for the radio + Aileron setpoints: left, center, right + Elevator setpoints: nose down, center, nose up + Rudder setpoints: nose left, center, nose right + Tail gyro mode/gain setpoints: heading hold, rate mode + Pitch curve setpoints (every 25%) + Throttle curve setpoints (every 25%) + + + System status specific to ualberta uav + System mode, see UALBERTA_AUTOPILOT_MODE ENUM + Navigation mode, see UALBERTA_NAV_MODE ENUM + Pilot mode, see UALBERTA_PILOT_MODE + + + diff --git a/PSIM_simulation/05715872.pdf b/PSIM_simulation/05715872.pdf new file mode 100644 index 0000000..93ba7d7 Binary files /dev/null and b/PSIM_simulation/05715872.pdf differ diff --git a/PSIM_simulation/ANF_PLL.psimsch b/PSIM_simulation/ANF_PLL.psimsch new file mode 100644 index 0000000..36dedf5 Binary files /dev/null and b/PSIM_simulation/ANF_PLL.psimsch differ diff --git a/PSIM_simulation/hallsensor/code/Debug/PMSM.psimsch b/PSIM_simulation/hallsensor/code/Debug/PMSM.psimsch new file mode 100644 index 0000000..a5ffb46 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/PMSM.psimsch differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/param_file.txt" b/PSIM_simulation/hallsensor/code/Debug/param_file.txt similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/param_file.txt" rename to PSIM_simulation/hallsensor/code/Debug/param_file.txt diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.Build.CppClean.log b/PSIM_simulation/hallsensor/code/Debug/rms_dll.Build.CppClean.log new file mode 100644 index 0000000..e27081e --- /dev/null +++ b/PSIM_simulation/hallsensor/code/Debug/rms_dll.Build.CppClean.log @@ -0,0 +1,6 @@ +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\cl.command.1.tlog +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\CL.read.1.tlog +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\CL.write.1.tlog +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.write.1.tlog +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\vc100.idb +D:\GIT\OROCA_BLDC_DEV\PSIM_SIMULATION\HALLSENSOR\CODE\DEBUG\VC100.PDB diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.dll b/PSIM_simulation/hallsensor/code/Debug/rms_dll.dll new file mode 100644 index 0000000..f5f65c2 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/rms_dll.dll differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest" b/PSIM_simulation/hallsensor/code/Debug/rms_dll.dll.embed.manifest similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest" rename to PSIM_simulation/hallsensor/code/Debug/rms_dll.dll.embed.manifest diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest.res" b/PSIM_simulation/hallsensor/code/Debug/rms_dll.dll.embed.manifest.res similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest.res" rename to PSIM_simulation/hallsensor/code/Debug/rms_dll.dll.embed.manifest.res diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll.intermediate.manifest" b/PSIM_simulation/hallsensor/code/Debug/rms_dll.dll.intermediate.manifest similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll.intermediate.manifest" rename to PSIM_simulation/hallsensor/code/Debug/rms_dll.dll.intermediate.manifest diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.exp b/PSIM_simulation/hallsensor/code/Debug/rms_dll.exp new file mode 100644 index 0000000..68e4f7c Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/rms_dll.exp differ diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.ilk b/PSIM_simulation/hallsensor/code/Debug/rms_dll.ilk new file mode 100644 index 0000000..64b3ee0 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/rms_dll.ilk differ diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.lastbuildstate b/PSIM_simulation/hallsensor/code/Debug/rms_dll.lastbuildstate new file mode 100644 index 0000000..0cc41bc --- /dev/null +++ b/PSIM_simulation/hallsensor/code/Debug/rms_dll.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|Win32|D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\| diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.lib b/PSIM_simulation/hallsensor/code/Debug/rms_dll.lib new file mode 100644 index 0000000..0bb65fc Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/rms_dll.lib differ diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.log b/PSIM_simulation/hallsensor/code/Debug/rms_dll.log new file mode 100644 index 0000000..a86a34b --- /dev/null +++ b/PSIM_simulation/hallsensor/code/Debug/rms_dll.log @@ -0,0 +1,31 @@ +빌드 시작: 2016-07-02 오전 3:55:31 + 1>2 ë…¸ë“œì˜ "D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj" 프로ì íЏ(build 대ìƒ)입니다. + 1>InitializeBuildStatus: + "AlwaysCreate"ì´(ê°€) 지정ë˜ì—ˆê¸° ë•Œë¬¸ì— ".\Debug\rms_dll.unsuccessfulbuild"ì„(를) 만들고 있습니다. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDOWS /D _USRDLL /D RMS_DLL_EXPORTS /D _VC80_UPGRADE=0x0600 /D _WINDLL /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /Gy- /fp:precise /Zc:wchar_t /Zc:forScope /Fo".\Debug\\" /Fd".\Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt rms_dll.cpp + rms_dll.cpp + 1>d:\git\oroca_bldc_dev\psim_simulation\hallsensor\code\rms_dll.cpp(58): warning C4305: '초기화 중' : 'double'ì—서 'float'(으)로 잘립니다. + 1>d:\git\oroca_bldc_dev\psim_simulation\hallsensor\code\rms_dll.cpp(59): warning C4305: '초기화 중' : 'double'ì—서 'float'(으)로 잘립니다. + 1>d:\git\oroca_bldc_dev\psim_simulation\hallsensor\code\rms_dll.cpp(134): warning C4244: '=' : 'double'ì—서 'float'(으)로 변환하면서 ë°ì´í„°ê°€ ì†ì‹¤ë  수 있습니다. + 1>d:\git\oroca_bldc_dev\psim_simulation\hallsensor\code\rms_dll.cpp(135): warning C4244: '=' : 'double'ì—서 'float'(으)로 변환하면서 ë°ì´í„°ê°€ ì†ì‹¤ë  수 있습니다. + 1>d:\git\oroca_bldc_dev\psim_simulation\hallsensor\code\rms_dll.cpp(172): warning C4305: '=' : 'double'ì—서 'float'(으)로 잘립니다. + ManifestResourceCompile: + 모든 ì¶œë ¥ì´ ìµœì‹  ìƒíƒœìž…니다. + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:".\Debug\rms_dll.dll" /INCREMENTAL /NOLOGO odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DEF:".\rms_dll.def" /MANIFEST /ManifestFile:".\Debug\rms_dll.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Debug\rms_dll.lib" /MACHINE:X86 /DLL .\Debug\rms_dll.dll.embed.manifest.res + .\Debug\rms_dll.obj + Manifest: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:".\Debug\rms_dll.dll.embed.manifest" /manifest .\Debug\rms_dll.dll.intermediate.manifest + 모든 ì¶œë ¥ì´ ìµœì‹  ìƒíƒœìž…니다. + LinkEmbedManifest: + 모든 ì¶œë ¥ì´ ìµœì‹  ìƒíƒœìž…니다. + rms_dll.vcxproj -> D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\.\Debug\rms_dll.dll + FinalizeBuildStatus: + ".\Debug\rms_dll.unsuccessfulbuild" 파ì¼ì„ 삭제하고 있습니다. + ".\Debug\rms_dll.lastbuildstate"ì— ì—°ê²°(touching)하고 있습니다. + 1>"D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj" 프로ì íŠ¸ë¥¼ 빌드했습니다(build 대ìƒ). + +빌드했습니다. + +경과 시간: 00:00:01.56 diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.obj b/PSIM_simulation/hallsensor/code/Debug/rms_dll.obj new file mode 100644 index 0000000..1b7bb72 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/rms_dll.obj differ diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.pdb b/PSIM_simulation/hallsensor/code/Debug/rms_dll.pdb new file mode 100644 index 0000000..7a7ec18 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/rms_dll.pdb differ diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.vcxprojResolveAssemblyReference.cache b/PSIM_simulation/hallsensor/code/Debug/rms_dll.vcxprojResolveAssemblyReference.cache new file mode 100644 index 0000000..669517d Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/rms_dll.vcxprojResolveAssemblyReference.cache differ diff --git a/PSIM_simulation/hallsensor/code/Debug/rms_dll.write.1.tlog b/PSIM_simulation/hallsensor/code/Debug/rms_dll.write.1.tlog new file mode 100644 index 0000000..4ed9f1d --- /dev/null +++ b/PSIM_simulation/hallsensor/code/Debug/rms_dll.write.1.tlog @@ -0,0 +1,205 @@ +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +^D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\rms_dll.vcxproj +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.lib +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp +D:\git\oroca_bldc_dev\PSIM_simulation\hallsensor\code\Debug\rms_dll.exp diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll_manifest.rc" b/PSIM_simulation/hallsensor/code/Debug/rms_dll_manifest.rc similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll_manifest.rc" rename to PSIM_simulation/hallsensor/code/Debug/rms_dll_manifest.rc diff --git a/PSIM_simulation/hallsensor/code/Debug/vc100.idb b/PSIM_simulation/hallsensor/code/Debug/vc100.idb new file mode 100644 index 0000000..beb5ea3 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/vc100.idb differ diff --git a/PSIM_simulation/hallsensor/code/Debug/vc100.pdb b/PSIM_simulation/hallsensor/code/Debug/vc100.pdb new file mode 100644 index 0000000..ecc910d Binary files /dev/null and b/PSIM_simulation/hallsensor/code/Debug/vc100.pdb differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IAB" b/PSIM_simulation/hallsensor/code/Untitled Project.IAB similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IAB" rename to PSIM_simulation/hallsensor/code/Untitled Project.IAB diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IAD" b/PSIM_simulation/hallsensor/code/Untitled Project.IAD similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IAD" rename to PSIM_simulation/hallsensor/code/Untitled Project.IAD diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IMB" b/PSIM_simulation/hallsensor/code/Untitled Project.IMB similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IMB" rename to PSIM_simulation/hallsensor/code/Untitled Project.IMB diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IMD" b/PSIM_simulation/hallsensor/code/Untitled Project.IMD similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.IMD" rename to PSIM_simulation/hallsensor/code/Untitled Project.IMD diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PFI" b/PSIM_simulation/hallsensor/code/Untitled Project.PFI similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PFI" rename to PSIM_simulation/hallsensor/code/Untitled Project.PFI diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PO" b/PSIM_simulation/hallsensor/code/Untitled Project.PO similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PO" rename to PSIM_simulation/hallsensor/code/Untitled Project.PO diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PR" b/PSIM_simulation/hallsensor/code/Untitled Project.PR similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PR" rename to PSIM_simulation/hallsensor/code/Untitled Project.PR diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PRI" b/PSIM_simulation/hallsensor/code/Untitled Project.PRI similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PRI" rename to PSIM_simulation/hallsensor/code/Untitled Project.PRI diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PS" b/PSIM_simulation/hallsensor/code/Untitled Project.PS similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.PS" rename to PSIM_simulation/hallsensor/code/Untitled Project.PS diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.SearchResults" b/PSIM_simulation/hallsensor/code/Untitled Project.SearchResults similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.SearchResults" rename to PSIM_simulation/hallsensor/code/Untitled Project.SearchResults diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.WK3" b/PSIM_simulation/hallsensor/code/Untitled Project.WK3 similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Untitled Project.WK3" rename to PSIM_simulation/hallsensor/code/Untitled Project.WK3 diff --git a/PSIM_simulation/hallsensor/code/ipch/rms_dll-fe6b92ea/rms_dll-d33337a3.ipch b/PSIM_simulation/hallsensor/code/ipch/rms_dll-fe6b92ea/rms_dll-d33337a3.ipch new file mode 100644 index 0000000..4bd857c Binary files /dev/null and b/PSIM_simulation/hallsensor/code/ipch/rms_dll-fe6b92ea/rms_dll-d33337a3.ipch differ diff --git a/PSIM_simulation/hallsensor/code/rms_dll.cpp b/PSIM_simulation/hallsensor/code/rms_dll.cpp new file mode 100644 index 0000000..6164695 --- /dev/null +++ b/PSIM_simulation/hallsensor/code/rms_dll.cpp @@ -0,0 +1,213 @@ +// This is a sample C program for Microsoft C/C++ 6.0. +// The generated DLL is to be linked to PSIM. + +// To compile the program into DLL, you can open the workspace file "msvc_dll.dsw" +// as provided. + +// This sample program calculates the rms of a 60-Hz input in[0], and +// stores the output in out[0]. + +// Variables: +// t: Time, passed from PSIM by value +// delt: Time step, passed from PSIM by value +// in: input array, passed from PSIM by reference +// out: output array, sent back to PSIM (Note: the values of out[*] can +// be modified in PSIM) + +// The maximum length of the input and output array "in" and "out" is 30. + +// Because we used static/global variables in this example, the DLL +// can only be used once per schematic file. + +#include + +//Defines +typedef unsigned short WORD; +//typedef signed int SFRAC16; +typedef unsigned char BYTE; +//typedef unsigned char BOOL; +// Structs +#define Bound_limit(in,lim) ((in > (lim)) ? (lim) : ((in < -(lim)) ? -(lim) : in)) + +#define Fsamp 16000 +#define Tsamp 1./16000 + +#define PI 3.14159265358979f + +float HallPLLlead = 0.0; +float HallPLLlead1 = 0.0; +float HallPLLlead2 = 0.0; +float HallPLLqe = 0.0; +float HallPLLde = 0.0; +float HallPLLde1 = 0.0; +float HallPLLdef = 0.0; +float HallPLLdef1 = 0.0; +#define WMd 2.*3.141592654*180. +#define AMd (WMd-(2./Tsamp))/(WMd+(2./Tsamp)) +#define BMd WMd/(WMd+(2./Tsamp)) + +static volatile float Theta = 0.0; +static volatile float ThetaCal = 0.0; + +static volatile float Futi = 0.0; +float Wpll = 0.0; +float Wpll1 = 0.0; +float Wpllp = 0.0; +float Wplli = 0.0; + +float Kpll = 0.428; +float Ipll = 28.83; + + +static float Hall_KA = 0.0; +static float Hall_KB = 0.0; + +static float Hall_PIout = 0.0; +static float Hall_Err0 = 0.0; + +float HallPLLA = 0.0f; +float HallPLLA1 = 0.0f; +float HallPLLB = 0.0f; + +float HallPLLA_cos3th = 0.0f; +float HallPLLA_sin3th = 0.0f; +float HallPLLB_sin3th = 0.0f; +float HallPLLB_cos3th = 0.0f; + +float HallPLLA_cos3th_Integral = 0.0f; +float HallPLLA_sin3th_Integral = 0.0f; +float HallPLLB_sin3th_Integral = 0.0f; +float HallPLLB_cos3th_Integral = 0.0f; + +float HallPLLA_old = 0.0f; +float HallPLLB_old = 0.0f; + +float HallPLLA_filtered = 0.0f; +float HallPLLB_filtered = 0.0f; + +float Hall_SinCos; +float Hall_CosSin; + +float Gamma = 1.0f; + +float costh; +float sinth; + +float Asin3th = 0.0f; +float Acos3th = 0.0f; +float Bsin3th= 0.0f; +float Bcos3th= 0.0f; +float ANF_PLLA= 0.0f; +float ANF_PLLB= 0.0f; + +float cos3th; +float sin3th; + +float wt=0.0f; +float sinwt=0.0f; + +static double IN[12],OUT[12]; + +__declspec(dllexport) void simuser (double t, double delt, double *in, double *out) +{ +// Place your code here............begin +// Define "sum" as "static" in order to retain its value. + static double clk0=0.,clk1=0.; + + + IN[0] = in[0]; + IN[1] = in[1]; + IN[2] = in[2]; + IN[3] = in[3]; + + IN[10] = in[10]; + + + + clk0 = in[11]; + if(!clk0 && !clk1) //LOW + { + + } + else if(clk0 && !clk1)// raising edge + { + HallPLLA = in[0]; + HallPLLB = in[1]; + + cos3th = cosf(3.0f * Theta); + sin3th = sinf(3.0f * Theta); + + HallPLLA_sin3th = HallPLLA * sin3th * Gamma; + HallPLLA_cos3th = HallPLLA * cos3th * Gamma; + + HallPLLB_cos3th = HallPLLB* cos3th * Gamma; + HallPLLB_sin3th = HallPLLB * sin3th * Gamma; + + HallPLLA_cos3th_Integral += HallPLLA_cos3th; + HallPLLA_sin3th_Integral += HallPLLA_sin3th; + + HallPLLB_sin3th_Integral += HallPLLB_sin3th; + HallPLLB_cos3th_Integral += HallPLLB_cos3th; + + Asin3th= HallPLLA_sin3th_Integral * sin3th; + Acos3th= HallPLLA_cos3th_Integral * cos3th; + + Bsin3th= HallPLLB_sin3th_Integral * sin3th; + Bcos3th= HallPLLB_cos3th_Integral * cos3th; + + ANF_PLLA = HallPLLA - Asin3th - Acos3th; + ANF_PLLB = HallPLLB - Bsin3th - Bcos3th; + + costh = cosf(Theta); + sinth = sinf(Theta); + + //Hall_SinCos = ANF_PLLA * costh; + //Hall_CosSin = ANF_PLLB * sinth; + + Hall_SinCos = HallPLLA * costh; + Hall_CosSin = HallPLLB * sinth; + + float err, tmp_kp, tmp_kpi; + tmp_kp = 0.5f; + tmp_kpi = (1.0f + 2.01f * Tsamp); + err = Hall_SinCos - Hall_CosSin; + Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); + Hall_PIout = Bound_limit(Hall_PIout, 10.0f); + Hall_Err0= err; + + Theta += Hall_PIout ; + if((2.0f * PI) < Theta) Theta = Theta - (2.0f * PI); + else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; + + sinwt = sinf(wt); + wt = wt + 0.01f; + if(2*PI < wt)wt=0; + } + else if(!clk0 && clk1)// falling edge + { + + } + else if(clk0 && clk1)//HIGH + { + + } + clk1 = clk0; + + + out[0] = Theta; + out[1] = costh; + out[2] = sinth; + + out[3] =Hall_SinCos; + out[4] = Hall_CosSin; + out[5] = HallPLLA; + out[6] = HallPLLB; + out[7] = sinwt; + /*out[8] = ParkParm.qIq; + out[9] = ParkParm.qVd; + out[10] = ParkParm.qVq; + out[11] = ParkParm.qAngle ;*/ + + +// Place your code here............end +} diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.def" b/PSIM_simulation/hallsensor/code/rms_dll.def similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.def" rename to PSIM_simulation/hallsensor/code/rms_dll.def diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.dsp" b/PSIM_simulation/hallsensor/code/rms_dll.dsp similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.dsp" rename to PSIM_simulation/hallsensor/code/rms_dll.dsp diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.dsw" b/PSIM_simulation/hallsensor/code/rms_dll.dsw similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.dsw" rename to PSIM_simulation/hallsensor/code/rms_dll.dsw diff --git a/PSIM_simulation/hallsensor/code/rms_dll.sdf b/PSIM_simulation/hallsensor/code/rms_dll.sdf new file mode 100644 index 0000000..64c8109 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/rms_dll.sdf differ diff --git a/PSIM_simulation/hallsensor/code/rms_dll.sln b/PSIM_simulation/hallsensor/code/rms_dll.sln new file mode 100644 index 0000000..130f8d6 --- /dev/null +++ b/PSIM_simulation/hallsensor/code/rms_dll.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rms_dll", "rms_dll.vcxproj", "{04F6A1D9-7847-8EA3-5335-CC386F2F12DA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {04F6A1D9-7847-8EA3-5335-CC386F2F12DA}.Debug|Win32.ActiveCfg = Debug|Win32 + {04F6A1D9-7847-8EA3-5335-CC386F2F12DA}.Debug|Win32.Build.0 = Debug|Win32 + {04F6A1D9-7847-8EA3-5335-CC386F2F12DA}.Release|Win32.ActiveCfg = Release|Win32 + {04F6A1D9-7847-8EA3-5335-CC386F2F12DA}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PSIM_simulation/hallsensor/code/rms_dll.suo b/PSIM_simulation/hallsensor/code/rms_dll.suo new file mode 100644 index 0000000..031ef66 Binary files /dev/null and b/PSIM_simulation/hallsensor/code/rms_dll.suo differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.vcxproj" b/PSIM_simulation/hallsensor/code/rms_dll.vcxproj similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.vcxproj" rename to PSIM_simulation/hallsensor/code/rms_dll.vcxproj diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.vcxproj.filters" b/PSIM_simulation/hallsensor/code/rms_dll.vcxproj.filters similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.vcxproj.filters" rename to PSIM_simulation/hallsensor/code/rms_dll.vcxproj.filters diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.vcxproj.user" b/PSIM_simulation/hallsensor/code/rms_dll.vcxproj.user similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.vcxproj.user" rename to PSIM_simulation/hallsensor/code/rms_dll.vcxproj.user diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/PMSM.psimsch" b/PSIM_simulation/rms_dll_R150821/code/Debug/PMSM.psimsch similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/PMSM.psimsch" rename to PSIM_simulation/rms_dll_R150821/code/Debug/PMSM.psimsch diff --git a/PSIM_simulation/rms_dll_R150821/code/Debug/param_file.txt b/PSIM_simulation/rms_dll_R150821/code/Debug/param_file.txt new file mode 100644 index 0000000..4166837 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/Debug/param_file.txt @@ -0,0 +1,21 @@ +(Global_Iq0)START=0 // 0: Disable PWM, 1: Enable PWM +(Global_Iq0)LOOP_I=0 // 0: open loop, 1: close current loop. +(Global_Iq0)LOOP_SP=0 // 0: open loop, 1: close speed loop. + +SpeedRef1 = 0.25 // Speed reference at the start. 0.25 pu +IqRef1 = 0.15 // iq reference at the start 0.05 pu + +PI=3.14159265 +POLES=12 // Number of poles +BASE_VOLTAGE=31.76 // Base peak phase voltage (volt) +BASE_CURRENT=10 // Base peak phase current (amp) +BASE_FREQ=200 // Base electrical frequency (Hz) +BASE_RPM=120*(BASE_FREQ/POLES) //Base motor speed in rmp + +RS=0.79 // Stator resistance (ohm) +LS=0.0012 // Stator inductance (Hr) + +MotorFreq=10K // Motor PWM switching frequency, in Hz +T=1.0/MotorFreq +SpdFreq=1K // Speed loop frequency +MinDelta = 0.0000305 // Speed change step diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.Build.CppClean.log" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.Build.CppClean.log similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.Build.CppClean.log" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.Build.CppClean.log diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.dll" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll diff --git a/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest new file mode 100644 index 0000000..11bb704 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest.res b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest.res new file mode 100644 index 0000000..c933726 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.embed.manifest.res differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.intermediate.manifest b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.intermediate.manifest new file mode 100644 index 0000000..ecea6f7 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.dll.intermediate.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.exp" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.exp similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.exp" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.exp diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.ilk" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.ilk similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.ilk" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.ilk diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.lastbuildstate" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.lastbuildstate similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.lastbuildstate" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.lastbuildstate diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.lib" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.lib similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.lib" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.lib diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.log" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.log similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.log" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.log diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.obj" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.obj similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.obj" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.obj diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.pdb" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.pdb similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.pdb" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.pdb diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.vcxprojResolveAssemblyReference.cache" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.vcxprojResolveAssemblyReference.cache similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.vcxprojResolveAssemblyReference.cache" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.vcxprojResolveAssemblyReference.cache diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.write.1.tlog" b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.write.1.tlog similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rms_dll.write.1.tlog" rename to PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll.write.1.tlog diff --git a/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll_manifest.rc b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll_manifest.rc new file mode 100644 index 0000000..b399577 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Debug/rms_dll_manifest.rc differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/vc100.idb" b/PSIM_simulation/rms_dll_R150821/code/Debug/vc100.idb similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/vc100.idb" rename to PSIM_simulation/rms_dll_R150821/code/Debug/vc100.idb diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/vc100.pdb" b/PSIM_simulation/rms_dll_R150821/code/Debug/vc100.pdb similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/vc100.pdb" rename to PSIM_simulation/rms_dll_R150821/code/Debug/vc100.pdb diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IAB b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IAB new file mode 100644 index 0000000..91603d3 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IAB differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IAD b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IAD new file mode 100644 index 0000000..ce9ed03 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IAD differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IMB b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IMB new file mode 100644 index 0000000..4846b4e Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IMB differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IMD b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IMD new file mode 100644 index 0000000..8563878 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.IMD differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PFI b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PFI new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PFI differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PO b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PO new file mode 100644 index 0000000..c476933 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PO differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PR b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PR new file mode 100644 index 0000000..2f0b29b Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PR differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PRI b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PRI new file mode 100644 index 0000000..3543cac Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PRI differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PS b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PS new file mode 100644 index 0000000..c2c0286 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.PS differ diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.SearchResults b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.SearchResults new file mode 100644 index 0000000..f4b2561 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.SearchResults @@ -0,0 +1,10 @@ +---- CtrlParm.qVelRef Matches (9 in 1 files) ---- +Rms_dll.cpp: CtrlParm.qVelRef = 0; +Rms_dll.cpp: if (CtrlParm.qVelRef <= VelReq) +Rms_dll.cpp: CtrlParm.qVelRef += SPEEDDELAY; +Rms_dll.cpp: CtrlParm.qVelRef -= SPEEDDELAY; +Rms_dll.cpp: CtrlParm.qVelRef = OMEGA0; +Rms_dll.cpp: CtrlParm.qVelRef = OMEGA0; +Rms_dll.cpp: PIParmW.qInRef = CtrlParm.qVelRef; +Rms_dll.cpp: CtrlParm.qVqRef = CtrlParm.qVelRef; +Rms_dll.cpp: CtrlParm.qVdRef = FieldWeakening(fabsf(CtrlParm.qVelRef)); diff --git a/PSIM_simulation/rms_dll_R150821/code/Untitled Project.WK3 b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.WK3 new file mode 100644 index 0000000..fcaf622 Binary files /dev/null and b/PSIM_simulation/rms_dll_R150821/code/Untitled Project.WK3 differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/ipch/rms_dll-7ebee3c2/rms_dll-d33337a3.ipch" b/PSIM_simulation/rms_dll_R150821/code/ipch/rms_dll-7ebee3c2/rms_dll-d33337a3.ipch similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/ipch/rms_dll-7ebee3c2/rms_dll-d33337a3.ipch" rename to PSIM_simulation/rms_dll_R150821/code/ipch/rms_dll-7ebee3c2/rms_dll-d33337a3.ipch diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.cpp" b/PSIM_simulation/rms_dll_R150821/code/rms_dll.cpp similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.cpp" rename to PSIM_simulation/rms_dll_R150821/code/rms_dll.cpp diff --git a/PSIM_simulation/rms_dll_R150821/code/rms_dll.def b/PSIM_simulation/rms_dll_R150821/code/rms_dll.def new file mode 100644 index 0000000..e7c455d --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/rms_dll.def @@ -0,0 +1,8 @@ +; rms_dll.def : Declares the module parameters for the DLL. + +LIBRARY "rms_dll" +DESCRIPTION 'Test DLL Block For PSIM' + +EXPORTS + simuser + diff --git a/PSIM_simulation/rms_dll_R150821/code/rms_dll.dsp b/PSIM_simulation/rms_dll_R150821/code/rms_dll.dsp new file mode 100644 index 0000000..61e24c6 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/rms_dll.dsp @@ -0,0 +1,115 @@ +# Microsoft Developer Studio Project File - Name="rms_dll" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=rms_dll - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "rms_dll.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "rms_dll.mak" CFG="rms_dll - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "rms_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "rms_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +F90=df.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "rms_dll - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE F90 /compile_only /dll /nologo /warn:nofileopt +# ADD F90 /compile_only /dll /nologo /warn:nofileopt +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RMS_DLL_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RMS_DLL_EXPORTS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 + +!ELSEIF "$(CFG)" == "rms_dll - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /dll /nologo /traceback /warn:argument_checking /warn:nofileopt +# ADD F90 /check:bounds /compile_only /dbglibs /debug:full /dll /nologo /traceback /warn:argument_checking /warn:nofileopt +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RMS_DLL_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RMS_DLL_EXPORTS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "rms_dll - Win32 Release" +# Name "rms_dll - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" +# Begin Source File + +SOURCE=.\rms_dll.cpp +# End Source File +# Begin Source File + +SOURCE=.\rms_dll.def +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/PSIM_simulation/rms_dll_R150821/code/rms_dll.dsw b/PSIM_simulation/rms_dll_R150821/code/rms_dll.dsw new file mode 100644 index 0000000..9548663 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/rms_dll.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "rms_dll"=.\rms_dll.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.sdf" b/PSIM_simulation/rms_dll_R150821/code/rms_dll.sdf similarity index 97% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.sdf" rename to PSIM_simulation/rms_dll_R150821/code/rms_dll.sdf index 79dfca4..b3fd6c0 100644 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.sdf" and b/PSIM_simulation/rms_dll_R150821/code/rms_dll.sdf differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.sln" b/PSIM_simulation/rms_dll_R150821/code/rms_dll.sln similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.sln" rename to PSIM_simulation/rms_dll_R150821/code/rms_dll.sln diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.suo" b/PSIM_simulation/rms_dll_R150821/code/rms_dll.suo similarity index 71% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.suo" rename to PSIM_simulation/rms_dll_R150821/code/rms_dll.suo index 09a2ddd..f0f10fd 100644 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/rms_dll.suo" and b/PSIM_simulation/rms_dll_R150821/code/rms_dll.suo differ diff --git a/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj b/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj new file mode 100644 index 0000000..6742eae --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj @@ -0,0 +1,142 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + + + + + + + + + + + + + .\Debug\ + .\Debug\ + true + + + .\Release\ + .\Release\ + false + + + + MultiThreadedDebug + Default + false + Disabled + true + Level3 + true + EditAndContinue + WIN32;_DEBUG;_WINDOWS;_USRDLL;RMS_DLL_EXPORTS;%(PreprocessorDefinitions) + .\Debug\ + .\Debug\rms_dll.pch + .\Debug\ + .\Debug\ + EnableFastChecks + + + true + _DEBUG;%(PreprocessorDefinitions) + .\Debug\rms_dll.tlb + true + Win32 + + + 0x0409 + _DEBUG;%(PreprocessorDefinitions) + + + true + .\Debug\rms_dll.bsc + + + true + true + true + Console + .\Debug\rms_dll.dll + .\Debug\rms_dll.lib + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + .\rms_dll.def + + + + + MultiThreaded + OnlyExplicitInline + true + true + MaxSpeed + true + Level3 + WIN32;NDEBUG;_WINDOWS;_USRDLL;RMS_DLL_EXPORTS;%(PreprocessorDefinitions) + .\Release\ + .\Release\rms_dll.pch + .\Release\ + .\Release\ + + + true + NDEBUG;%(PreprocessorDefinitions) + .\Release\rms_dll.tlb + true + Win32 + + + 0x0409 + NDEBUG;%(PreprocessorDefinitions) + + + true + .\Release\rms_dll.bsc + + + true + true + Console + .\Release\rms_dll.dll + .\Release\rms_dll.lib + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + .\rms_dll.def + + + + + + + + + + + + \ No newline at end of file diff --git a/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj.filters b/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj.filters new file mode 100644 index 0000000..7c89943 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {62382388-8e7d-409b-ac01-1d6fca879d76} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp + + + {aeb23117-56b4-4d4a-a5d7-cbeaed2824b8} + h;hpp;hxx;hm;inl;fi;fd + + + {38bda88c-f52a-4863-9031-416f0e980cbc} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + + + Source Files + + + \ No newline at end of file diff --git a/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj.user b/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj.user new file mode 100644 index 0000000..ace9a86 --- /dev/null +++ b/PSIM_simulation/rms_dll_R150821/code/rms_dll.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/rms_dll.dll" b/PSIM_simulation/rms_dll_R150821/rms_dll.dll similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/rms_dll.dll" rename to PSIM_simulation/rms_dll_R150821/rms_dll.dll diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/rms_dll.sch" b/PSIM_simulation/rms_dll_R150821/rms_dll.sch similarity index 100% rename from "PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/rms_dll.sch" rename to PSIM_simulation/rms_dll_R150821/rms_dll.sch diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/CL.read.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/CL.read.1.tlog" deleted file mode 100644 index 550f129..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/CL.read.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/CL.write.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/CL.write.1.tlog" deleted file mode 100644 index 24e4bc6..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/CL.write.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/cl.command.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/cl.command.1.tlog" deleted file mode 100644 index fdfa9fe..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/cl.command.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link-cvtres.read.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link-cvtres.read.1.tlog" deleted file mode 100644 index 46b134b..0000000 --- "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link-cvtres.read.1.tlog" +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link-cvtres.write.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link-cvtres.write.1.tlog" deleted file mode 100644 index 46b134b..0000000 --- "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link-cvtres.write.1.tlog" +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324-cvtres.read.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324-cvtres.read.1.tlog" deleted file mode 100644 index 46b134b..0000000 --- "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324-cvtres.read.1.tlog" +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324-cvtres.write.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324-cvtres.write.1.tlog" deleted file mode 100644 index 46b134b..0000000 --- "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324-cvtres.write.1.tlog" +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324.read.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324.read.1.tlog" deleted file mode 100644 index 46b134b..0000000 --- "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324.read.1.tlog" +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324.write.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324.write.1.tlog" deleted file mode 100644 index 46b134b..0000000 --- "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.1324.write.1.tlog" +++ /dev/null @@ -1 +0,0 @@ -ÿþ \ No newline at end of file diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.command.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.command.1.tlog" deleted file mode 100644 index ea5ae54..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.command.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.read.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.read.1.tlog" deleted file mode 100644 index 9232eba..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.read.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.write.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.write.1.tlog" deleted file mode 100644 index 5d0a495..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/link.write.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.command.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.command.1.tlog" deleted file mode 100644 index 0ee4563..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.command.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.read.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.read.1.tlog" deleted file mode 100644 index 26aab82..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.read.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.write.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.write.1.tlog" deleted file mode 100644 index 2462f49..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/mt.write.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.command.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.command.1.tlog" deleted file mode 100644 index fa410bd..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.command.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.read.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.read.1.tlog" deleted file mode 100644 index 8c26eeb..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.read.1.tlog" and /dev/null differ diff --git "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.write.1.tlog" "b/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.write.1.tlog" deleted file mode 100644 index 8151f22..0000000 Binary files "a/PSIM\341\204\211\341\205\265\341\204\206\341\205\262\341\206\257\341\204\205\341\205\246\341\204\213\341\205\265\341\204\211\341\205\247\341\206\253/rms_dll_R150821/code/Debug/rc.write.1.tlog" and /dev/null differ diff --git a/README.md b/README.md index 63f6d4c..053db71 100755 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # oroca_bldc_dev BLDC Driver Development Version for OROCA BLDC +bldc-test \ No newline at end of file diff --git a/oroca_bldc_FW/.cproject b/oroca_bldc_FW/.cproject index 9fea6ce..be9dabb 100755 --- a/oroca_bldc_FW/.cproject +++ b/oroca_bldc_FW/.cproject @@ -1,8 +1,8 @@ - - + + @@ -14,110 +14,112 @@ - - - - - + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + - + - + + + + + + diff --git a/oroca_bldc_FW/.dep/chthreads.o.d b/oroca_bldc_FW/.dep/chthreads.o.d deleted file mode 100755 index fc17c02..0000000 --- a/oroca_bldc_FW/.dep/chthreads.o.d +++ /dev/null @@ -1,132 +0,0 @@ -build/obj/chthreads.o: lib/ChibiOS_3.0.2/os/rt/src/chthreads.c \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: diff --git a/oroca_bldc_FW/.dep/chvt.o.d b/oroca_bldc_FW/.dep/chvt.o.d deleted file mode 100755 index b2a78c6..0000000 --- a/oroca_bldc_FW/.dep/chvt.o.d +++ /dev/null @@ -1,132 +0,0 @@ -build/obj/chvt.o: lib/ChibiOS_3.0.2/os/rt/src/chvt.c \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: diff --git a/oroca_bldc_FW/.dep/comm_usb.o.d b/oroca_bldc_FW/.dep/comm_usb.o.d deleted file mode 100755 index e93aad9..0000000 --- a/oroca_bldc_FW/.dep/comm_usb.o.d +++ /dev/null @@ -1,282 +0,0 @@ -build/obj/comm_usb.o: src/core/comm_usb.c \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h src/core/comm_usb.h \ - src/core/conf_general.h src/core/datatypes.h src/core/usb_uart.h - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: - -src/core/comm_usb.h: - -src/core/conf_general.h: - -src/core/datatypes.h: - -src/core/usb_uart.h: diff --git a/oroca_bldc_FW/.dep/conf_general.o.d b/oroca_bldc_FW/.dep/conf_general.o.d deleted file mode 100755 index 7e8c5ca..0000000 --- a/oroca_bldc_FW/.dep/conf_general.o.d +++ /dev/null @@ -1,225 +0,0 @@ -build/obj/conf_general.o: src/core/conf_general.c src/core/conf_general.h \ - src/core/datatypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h src/core/eeprom.h \ - src/core/stm32f4xx_conf.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h \ - src/bldc/mcpwm.h src/core/conf_general.h src/core/datatypes.h \ - lib/hwconf/hw.h lib/hwconf/hw_oroca.h src/core/utils.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h \ - lib/mcconf/mcconf_outrunner2.h - -src/core/conf_general.h: - -src/core/datatypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -src/core/eeprom.h: - -src/core/stm32f4xx_conf.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h: - -src/bldc/mcpwm.h: - -src/core/conf_general.h: - -src/core/datatypes.h: - -lib/hwconf/hw.h: - -lib/hwconf/hw_oroca.h: - -src/core/utils.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h: - -lib/mcconf/mcconf_outrunner2.h: diff --git a/oroca_bldc_FW/.dep/eeprom.o.d b/oroca_bldc_FW/.dep/eeprom.o.d deleted file mode 100755 index e9630f4..0000000 --- a/oroca_bldc_FW/.dep/eeprom.o.d +++ /dev/null @@ -1,171 +0,0 @@ -build/obj/eeprom.o: src/core/eeprom.c src/core/eeprom.h \ - src/core/stm32f4xx_conf.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h \ - src/core/flash_helper.h src/core/conf_general.h src/core/datatypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h - -src/core/eeprom.h: - -src/core/stm32f4xx_conf.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h: - -src/core/flash_helper.h: - -src/core/conf_general.h: - -src/core/datatypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: diff --git a/oroca_bldc_FW/.dep/flash_helper.o.d b/oroca_bldc_FW/.dep/flash_helper.o.d deleted file mode 100755 index 8569dde..0000000 --- a/oroca_bldc_FW/.dep/flash_helper.o.d +++ /dev/null @@ -1,358 +0,0 @@ -build/obj/flash_helper.o: src/core/flash_helper.c src/core/flash_helper.h \ - src/core/conf_general.h src/core/datatypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h src/core/stm32f4xx_conf.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h \ - src/core/utils.h lib/hwconf/hw.h src/core/conf_general.h \ - lib/hwconf/hw_oroca.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h - -src/core/flash_helper.h: - -src/core/conf_general.h: - -src/core/datatypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: - -src/core/stm32f4xx_conf.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h: - -src/core/utils.h: - -lib/hwconf/hw.h: - -src/core/conf_general.h: - -lib/hwconf/hw_oroca.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h: diff --git a/oroca_bldc_FW/.dep/hal.o.d b/oroca_bldc_FW/.dep/hal.o.d deleted file mode 100755 index ddc3f77..0000000 --- a/oroca_bldc_FW/.dep/hal.o.d +++ /dev/null @@ -1,273 +0,0 @@ -build/obj/hal.o: lib/ChibiOS_3.0.2/os/hal/src/hal.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/hal_lld.o.d b/oroca_bldc_FW/.dep/hal_lld.o.d deleted file mode 100755 index a2cea84..0000000 --- a/oroca_bldc_FW/.dep/hal_lld.o.d +++ /dev/null @@ -1,274 +0,0 @@ -build/obj/hal_lld.o: \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/i2c.o.d b/oroca_bldc_FW/.dep/i2c.o.d deleted file mode 100755 index bd79842..0000000 --- a/oroca_bldc_FW/.dep/i2c.o.d +++ /dev/null @@ -1,273 +0,0 @@ -build/obj/i2c.o: lib/ChibiOS_3.0.2/os/hal/src/i2c.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/i2c_lld.o.d b/oroca_bldc_FW/.dep/i2c_lld.o.d deleted file mode 100755 index b9d8d01..0000000 --- a/oroca_bldc_FW/.dep/i2c_lld.o.d +++ /dev/null @@ -1,274 +0,0 @@ -build/obj/i2c_lld.o: \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/icu.o.d b/oroca_bldc_FW/.dep/icu.o.d deleted file mode 100755 index b173d00..0000000 --- a/oroca_bldc_FW/.dep/icu.o.d +++ /dev/null @@ -1,273 +0,0 @@ -build/obj/icu.o: lib/ChibiOS_3.0.2/os/hal/src/icu.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/icu_lld.o.d b/oroca_bldc_FW/.dep/icu_lld.o.d deleted file mode 100755 index e114d97..0000000 --- a/oroca_bldc_FW/.dep/icu_lld.o.d +++ /dev/null @@ -1,274 +0,0 @@ -build/obj/icu_lld.o: \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/misc.o.d b/oroca_bldc_FW/.dep/misc.o.d deleted file mode 100755 index 6ffa6c3..0000000 --- a/oroca_bldc_FW/.dep/misc.o.d +++ /dev/null @@ -1,40 +0,0 @@ -build/obj/misc.o: lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/misc.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: diff --git a/oroca_bldc_FW/.dep/nvic.o.d b/oroca_bldc_FW/.dep/nvic.o.d deleted file mode 100755 index 93249b8..0000000 --- a/oroca_bldc_FW/.dep/nvic.o.d +++ /dev/null @@ -1,273 +0,0 @@ -build/obj/nvic.o: lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/pal.o.d b/oroca_bldc_FW/.dep/pal.o.d deleted file mode 100755 index 462c543..0000000 --- a/oroca_bldc_FW/.dep/pal.o.d +++ /dev/null @@ -1,273 +0,0 @@ -build/obj/pal.o: lib/ChibiOS_3.0.2/os/hal/src/pal.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/pal_lld.o.d b/oroca_bldc_FW/.dep/pal_lld.o.d deleted file mode 100755 index 14a40a1..0000000 --- a/oroca_bldc_FW/.dep/pal_lld.o.d +++ /dev/null @@ -1,274 +0,0 @@ -build/obj/pal_lld.o: \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/serial_usb.o.d b/oroca_bldc_FW/.dep/serial_usb.o.d deleted file mode 100755 index 4250a7a..0000000 --- a/oroca_bldc_FW/.dep/serial_usb.o.d +++ /dev/null @@ -1,273 +0,0 @@ -build/obj/serial_usb.o: lib/ChibiOS_3.0.2/os/hal/src/serial_usb.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/servo_dec.o.d b/oroca_bldc_FW/.dep/servo_dec.o.d deleted file mode 100755 index c7bbcc8..0000000 --- a/oroca_bldc_FW/.dep/servo_dec.o.d +++ /dev/null @@ -1,319 +0,0 @@ -build/obj/servo_dec.o: src/core/servo_dec.c src/core/servo_dec.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - src/core/conf_general.h src/core/datatypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h src/core/stm32f4xx_conf.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h lib/hwconf/hw.h \ - lib/hwconf/hw_oroca.h src/core/utils.h - -src/core/servo_dec.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -src/core/conf_general.h: - -src/core/datatypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -src/core/stm32f4xx_conf.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/misc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4_gpio_af.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: - -lib/hwconf/hw.h: - -lib/hwconf/hw_oroca.h: - -src/core/utils.h: diff --git a/oroca_bldc_FW/.dep/stm32_dma.o.d b/oroca_bldc_FW/.dep/stm32_dma.o.d deleted file mode 100755 index f7d1793..0000000 --- a/oroca_bldc_FW/.dep/stm32_dma.o.d +++ /dev/null @@ -1,274 +0,0 @@ -build/obj/stm32_dma.o: \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_adc.o.d b/oroca_bldc_FW/.dep/stm32f4xx_adc.o.d deleted file mode 100755 index 1ab96df..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_adc.o.d +++ /dev/null @@ -1,44 +0,0 @@ -build/obj/stm32f4xx_adc.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_adc.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_adc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_dma.o.d b/oroca_bldc_FW/.dep/stm32f4xx_dma.o.d deleted file mode 100755 index 3efbf28..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_dma.o.d +++ /dev/null @@ -1,44 +0,0 @@ -build/obj/stm32f4xx_dma.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_dma.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_dma.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_exti.o.d b/oroca_bldc_FW/.dep/stm32f4xx_exti.o.d deleted file mode 100755 index 96353b4..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_exti.o.d +++ /dev/null @@ -1,41 +0,0 @@ -build/obj/stm32f4xx_exti.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_exti.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_exti.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_flash.o.d b/oroca_bldc_FW/.dep/stm32f4xx_flash.o.d deleted file mode 100755 index 72223af..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_flash.o.d +++ /dev/null @@ -1,41 +0,0 @@ -build/obj/stm32f4xx_flash.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_flash.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_flash.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_rcc.o.d b/oroca_bldc_FW/.dep/stm32f4xx_rcc.o.d deleted file mode 100755 index c523379..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_rcc.o.d +++ /dev/null @@ -1,41 +0,0 @@ -build/obj/stm32f4xx_rcc.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_rcc.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_syscfg.o.d b/oroca_bldc_FW/.dep/stm32f4xx_syscfg.o.d deleted file mode 100755 index ec48fc3..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_syscfg.o.d +++ /dev/null @@ -1,44 +0,0 @@ -build/obj/stm32f4xx_syscfg.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_syscfg.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_syscfg.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_tim.o.d b/oroca_bldc_FW/.dep/stm32f4xx_tim.o.d deleted file mode 100755 index 2b105f7..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_tim.o.d +++ /dev/null @@ -1,44 +0,0 @@ -build/obj/stm32f4xx_tim.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_tim.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_tim.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: diff --git a/oroca_bldc_FW/.dep/stm32f4xx_wwdg.o.d b/oroca_bldc_FW/.dep/stm32f4xx_wwdg.o.d deleted file mode 100755 index 56920f3..0000000 --- a/oroca_bldc_FW/.dep/stm32f4xx_wwdg.o.d +++ /dev/null @@ -1,44 +0,0 @@ -build/obj/stm32f4xx_wwdg.o: \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/src/stm32f4xx_wwdg.c \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_wwdg.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/ext/stdperiph_stm32f4/inc/stm32f4xx_rcc.h: diff --git a/oroca_bldc_FW/.dep/syscalls.o.d b/oroca_bldc_FW/.dep/syscalls.o.d deleted file mode 100755 index f24b7ef..0000000 --- a/oroca_bldc_FW/.dep/syscalls.o.d +++ /dev/null @@ -1,198 +0,0 @@ -build/obj/syscalls.o: lib/ChibiOS_3.0.2/os/various/syscalls.c \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/stdlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/alloca.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/errno.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/errno.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/stat.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/time.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/time.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/types.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/stdlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/alloca.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/errno.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/errno.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/stat.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/time.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/time.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/types.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: diff --git a/oroca_bldc_FW/.dep/uart.o.d b/oroca_bldc_FW/.dep/uart.o.d deleted file mode 100755 index 20267de..0000000 --- a/oroca_bldc_FW/.dep/uart.o.d +++ /dev/null @@ -1,273 +0,0 @@ -build/obj/uart.o: lib/ChibiOS_3.0.2/os/hal/src/uart.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/uart_lld.o.d b/oroca_bldc_FW/.dep/uart_lld.o.d deleted file mode 100755 index 2747683..0000000 --- a/oroca_bldc_FW/.dep/uart_lld.o.d +++ /dev/null @@ -1,274 +0,0 @@ -build/obj/uart_lld.o: \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.c \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/usb.o.d b/oroca_bldc_FW/.dep/usb.o.d deleted file mode 100755 index a447575..0000000 --- a/oroca_bldc_FW/.dep/usb.o.d +++ /dev/null @@ -1,309 +0,0 @@ -build/obj/usb.o: lib/ChibiOS_3.0.2/os/hal/src/usb.c \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/usb_lld.o.d b/oroca_bldc_FW/.dep/usb_lld.o.d deleted file mode 100755 index 445396f..0000000 --- a/oroca_bldc_FW/.dep/usb_lld.o.d +++ /dev/null @@ -1,310 +0,0 @@ -build/obj/usb_lld.o: \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.c \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h chconf.h \ - lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: diff --git a/oroca_bldc_FW/.dep/usb_uart.o.d b/oroca_bldc_FW/.dep/usb_uart.o.d deleted file mode 100755 index b74b6ab..0000000 --- a/oroca_bldc_FW/.dep/usb_uart.o.d +++ /dev/null @@ -1,327 +0,0 @@ -build/obj/usb_uart.o: src/core/usb_uart.c \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/math.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdarg.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdio.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/stdio.h - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/math.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/string.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/cdefs.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/string.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdarg.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdio.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/stdio.h: diff --git a/oroca_bldc_FW/.dep/utils.o.d b/oroca_bldc_FW/.dep/utils.o.d deleted file mode 100755 index bef4d42..0000000 --- a/oroca_bldc_FW/.dep/utils.o.d +++ /dev/null @@ -1,305 +0,0 @@ -build/obj/utils.o: src/core/utils.c src/core/utils.h \ - lib/ChibiOS_3.0.2/os/rt/include/ch.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - chconf.h lib/ChibiOS_3.0.2/os/rt/include/chlicense.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdebug.h \ - lib/ChibiOS_3.0.2/os/rt/include/chtm.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstats.h \ - lib/ChibiOS_3.0.2/os/rt/include/chschd.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsys.h \ - lib/ChibiOS_3.0.2/os/rt/include/chvt.h \ - lib/ChibiOS_3.0.2/os/rt/include/chthreads.h \ - lib/ChibiOS_3.0.2/os/rt/include/chregistry.h \ - lib/ChibiOS_3.0.2/os/rt/include/chsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chbsem.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmtx.h \ - lib/ChibiOS_3.0.2/os/rt/include/chcond.h \ - lib/ChibiOS_3.0.2/os/rt/include/chevents.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmsg.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h \ - lib/ChibiOS_3.0.2/os/rt/include/chheap.h \ - lib/ChibiOS_3.0.2/os/rt/include/chmempools.h \ - lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h \ - lib/ChibiOS_3.0.2/os/rt/include/chqueues.h \ - lib/ChibiOS_3.0.2/os/rt/include/chstreams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal.h \ - lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h halconf.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_files.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h \ - lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h \ - lib/ChibiOS_3.0.2/os/hal/include/pal.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/adc.h \ - lib/ChibiOS_3.0.2/os/hal/include/can.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/dac.h \ - lib/ChibiOS_3.0.2/os/hal/include/ext.h \ - lib/ChibiOS_3.0.2/os/hal/include/gpt.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2c.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/i2s.h \ - lib/ChibiOS_3.0.2/os/hal/include/icu.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h \ - lib/ChibiOS_3.0.2/os/hal/include/mac.h \ - lib/ChibiOS_3.0.2/os/hal/include/mii.h \ - lib/ChibiOS_3.0.2/os/hal/include/pwm.h \ - lib/ChibiOS_3.0.2/os/hal/include/rtc.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial.h \ - lib/ChibiOS_3.0.2/os/hal/include/sdc.h \ - lib/ChibiOS_3.0.2/os/hal/include/spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/uart.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h \ - lib/ChibiOS_3.0.2/os/hal/include/usb.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h \ - lib/ChibiOS_3.0.2/os/hal/include/st.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h mcuconf.h \ - lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h \ - lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h \ - lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/math.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h - -src/core/utils.h: - -lib/ChibiOS_3.0.2/os/rt/include/ch.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stddef.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -chconf.h: - -lib/ChibiOS_3.0.2/os/rt/include/chlicense.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsystypes.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/rt/ports/ARMCMx/chcore_v7m.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdebug.h: - -lib/ChibiOS_3.0.2/os/rt/include/chtm.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstats.h: - -lib/ChibiOS_3.0.2/os/rt/include/chschd.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsys.h: - -lib/ChibiOS_3.0.2/os/rt/include/chvt.h: - -lib/ChibiOS_3.0.2/os/rt/include/chthreads.h: - -lib/ChibiOS_3.0.2/os/rt/include/chregistry.h: - -lib/ChibiOS_3.0.2/os/rt/include/chsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chbsem.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmtx.h: - -lib/ChibiOS_3.0.2/os/rt/include/chcond.h: - -lib/ChibiOS_3.0.2/os/rt/include/chevents.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmsg.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmboxes.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmemcore.h: - -lib/ChibiOS_3.0.2/os/rt/include/chheap.h: - -lib/ChibiOS_3.0.2/os/rt/include/chmempools.h: - -lib/ChibiOS_3.0.2/os/rt/include/chdynamic.h: - -lib/ChibiOS_3.0.2/os/rt/include/chqueues.h: - -lib/ChibiOS_3.0.2/os/rt/include/chstreams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal.h: - -lib/ChibiOS_3.0.2/os/hal/osal/rt/osal.h: - -halconf.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/hal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/ports/common/ARMCMx/nvic.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_isr.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_dma.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_streams.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_channels.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_files.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_ioblock.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_mmcsd.h: - -lib/ChibiOS_3.0.2/os/hal/include/hal_queues.h: - -lib/ChibiOS_3.0.2/os/hal/include/pal.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/adc.h: - -lib/ChibiOS_3.0.2/os/hal/include/can.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/can_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/dac.h: - -lib/ChibiOS_3.0.2/os/hal/include/ext.h: - -lib/ChibiOS_3.0.2/os/hal/include/gpt.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2c.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/i2s.h: - -lib/ChibiOS_3.0.2/os/hal/include/icu.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/stm32_tim.h: - -lib/ChibiOS_3.0.2/os/hal/include/mac.h: - -lib/ChibiOS_3.0.2/os/hal/include/mii.h: - -lib/ChibiOS_3.0.2/os/hal/include/pwm.h: - -lib/ChibiOS_3.0.2/os/hal/include/rtc.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial.h: - -lib/ChibiOS_3.0.2/os/hal/include/sdc.h: - -lib/ChibiOS_3.0.2/os/hal/include/spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/uart.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/USARTv1/uart_lld.h: - -lib/ChibiOS_3.0.2/os/hal/include/usb.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h: - -lib/ChibiOS_3.0.2/os/hal/include/st.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.h: - -mcuconf.h: - -lib/ChibiOS_3.0.2/os/hal/ports/STM32/STM32F4xx/stm32_registry.h: - -lib/ChibiOS_3.0.2/os/hal/include/mmc_spi.h: - -lib/ChibiOS_3.0.2/os/hal/include/serial_usb.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/math.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/reent.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/newlib.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/config.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/lock.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/_ansi.h: diff --git a/oroca_bldc_FW/.dep/vectors.o.d b/oroca_bldc_FW/.dep/vectors.o.d deleted file mode 100755 index 91cc902..0000000 --- a/oroca_bldc_FW/.dep/vectors.o.d +++ /dev/null @@ -1,47 +0,0 @@ -build/obj/vectors.o: \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/compilers/GCC/vectors.c \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h \ - /Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h \ - /Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \ - lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h \ - lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h \ - lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdbool.h: - -/Users/Baram/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/stdint.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/machine/_default_types.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/features.h: - -/Users/Baram/gcc-arm-none-eabi/arm-none-eabi/include/sys/_intsup.h: - -lib/ChibiOS_3.0.2/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h: - -lib/ChibiOS_3.0.2/os/hal/boards/ST_STM32F4_DISCOVERY/board.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f4xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/stm32f407xx.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmInstr.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cmFunc.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/include/core_cm4_simd.h: - -lib/ChibiOS_3.0.2/os/ext/CMSIS/ST/system_stm32f4xx.h: diff --git a/oroca_bldc_FW/.settings/language.settings.xml b/oroca_bldc_FW/.settings/language.settings.xml index 7a42a07..2094b56 100755 --- a/oroca_bldc_FW/.settings/language.settings.xml +++ b/oroca_bldc_FW/.settings/language.settings.xml @@ -1,11 +1,11 @@ - + - + diff --git a/oroca_bldc_FW/Makefile b/oroca_bldc_FW/Makefile index 17c4d46..20721f9 100755 --- a/oroca_bldc_FW/Makefile +++ b/oroca_bldc_FW/Makefile @@ -95,7 +95,8 @@ CORESRC = src/core COREINC = src/core BLDCSRC = src/bldc BLDCINC = src/bldc - +APPSRC = src/app +APPINC = src/app MAVINC = lib/mavlink MAVINC += lib/mavlink/common @@ -119,8 +120,6 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk -include lib/hwconf/hwconf.mk - # Define linker script file here LDSCRIPT= ld_eeprom_emu.ld @@ -136,21 +135,26 @@ CSRC = $(STARTUPSRC) \ $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ - $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ $(CHIBIOS)/os/various/syscalls.c \ + $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ + $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ + $(LIBSRC)/hwconf/hw_oroca.c\ $(BLDCSRC)/bldc.c \ $(BLDCSRC)/mcpwm.c \ - $(CORESRC)/usb_uart.c \ - $(CORESRC)/irq_handlers.c \ - $(CORESRC)/comm_usb.c \ + $(BLDCSRC)/spi_dac.c \ $(CORESRC)/servo_dec.c \ - $(CORESRC)/utils.c \ - $(CORESRC)/conf_general.c \ - $(CORESRC)/eeprom.c \ - $(CORESRC)/flash_helper.c \ - $(HWSRC) + $(CORESRC)/uart3.c\ + $(CORESRC)/irq_handlers.c \ + $(CORESRC)/utils.c \ + $(CORESRC)/timeout.c \ + $(CORESRC)/buffer.c \ + $(APPSRC)/mavlink_can_proc.c \ + $(APPSRC)/mavlink_uart_proc.c \ + $(APPSRC)/local_ppm_proc.c \ + $(APPSRC)/user_interface_app.c + # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. CPPSRC = main.cpp @@ -182,16 +186,16 @@ ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) \ $(CHIBIOS)/os/various \ + $(CHIBIOS)/os/hal/lib/ports/STM32/LLD/TIMv1 \ $(CHIBIOS)/os/hal/lib/streams \ - $(LIBDIR)/mcconf \ + $(LIBDIR)/hwconf \ $(HWINC) \ - $(APPINC) \ $(NRFINC) \ $(COREINC) \ $(BLDCINC) \ + $(APPINC) \ $(MAVINC) - -# + #$(LIBDIR)/mcconf \ # Project, sources and paths ############################################################################## @@ -291,14 +295,15 @@ endif +build/$(PROJECT).bin: build/$(PROJECT).elf show_size + $(BIN) build/$(PROJECT).elf build/$(PROJECT).bin + # Print size show_size: $(SIZE) build/$(PROJECT).elf -build/$(PROJECT).bin: build/$(PROJECT).elf show_size - $(BIN) build/$(PROJECT).elf build/$(PROJECT).bin - + # Program upload: build/$(PROJECT).bin #qstlink2 --cli --erase --write build/$(PROJECT).bin diff --git a/oroca_bldc_FW/build/obj/bldc.o b/oroca_bldc_FW/build/obj/bldc.o deleted file mode 100755 index 06ae4d7..0000000 Binary files a/oroca_bldc_FW/build/obj/bldc.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/board.o b/oroca_bldc_FW/build/obj/board.o deleted file mode 100755 index 801044d..0000000 Binary files a/oroca_bldc_FW/build/obj/board.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/can.o b/oroca_bldc_FW/build/obj/can.o deleted file mode 100755 index 3375a95..0000000 Binary files a/oroca_bldc_FW/build/obj/can.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/can_lld.o b/oroca_bldc_FW/build/obj/can_lld.o deleted file mode 100755 index 9a63f2d..0000000 Binary files a/oroca_bldc_FW/build/obj/can_lld.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chcond.o b/oroca_bldc_FW/build/obj/chcond.o deleted file mode 100755 index 69b338f..0000000 Binary files a/oroca_bldc_FW/build/obj/chcond.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chcore.o b/oroca_bldc_FW/build/obj/chcore.o deleted file mode 100755 index 850b4f8..0000000 Binary files a/oroca_bldc_FW/build/obj/chcore.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chcore_v7m.o b/oroca_bldc_FW/build/obj/chcore_v7m.o deleted file mode 100755 index 2ce1f58..0000000 Binary files a/oroca_bldc_FW/build/obj/chcore_v7m.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chdebug.o b/oroca_bldc_FW/build/obj/chdebug.o deleted file mode 100755 index 47bf3ab..0000000 Binary files a/oroca_bldc_FW/build/obj/chdebug.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chdynamic.o b/oroca_bldc_FW/build/obj/chdynamic.o deleted file mode 100755 index 0844b43..0000000 Binary files a/oroca_bldc_FW/build/obj/chdynamic.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chevents.o b/oroca_bldc_FW/build/obj/chevents.o deleted file mode 100755 index 65b0dc0..0000000 Binary files a/oroca_bldc_FW/build/obj/chevents.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chheap.o b/oroca_bldc_FW/build/obj/chheap.o deleted file mode 100755 index 40308b2..0000000 Binary files a/oroca_bldc_FW/build/obj/chheap.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chmboxes.o b/oroca_bldc_FW/build/obj/chmboxes.o deleted file mode 100755 index 47d81dd..0000000 Binary files a/oroca_bldc_FW/build/obj/chmboxes.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chmemcore.o b/oroca_bldc_FW/build/obj/chmemcore.o deleted file mode 100755 index f26c8f6..0000000 Binary files a/oroca_bldc_FW/build/obj/chmemcore.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chmempools.o b/oroca_bldc_FW/build/obj/chmempools.o deleted file mode 100755 index 98d220d..0000000 Binary files a/oroca_bldc_FW/build/obj/chmempools.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chmsg.o b/oroca_bldc_FW/build/obj/chmsg.o deleted file mode 100755 index 169e38e..0000000 Binary files a/oroca_bldc_FW/build/obj/chmsg.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chmtx.o b/oroca_bldc_FW/build/obj/chmtx.o deleted file mode 100755 index 8c9d1ed..0000000 Binary files a/oroca_bldc_FW/build/obj/chmtx.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chprintf.o b/oroca_bldc_FW/build/obj/chprintf.o deleted file mode 100755 index 8ee55e9..0000000 Binary files a/oroca_bldc_FW/build/obj/chprintf.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chqueues.o b/oroca_bldc_FW/build/obj/chqueues.o deleted file mode 100755 index 5d033ed..0000000 Binary files a/oroca_bldc_FW/build/obj/chqueues.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chregistry.o b/oroca_bldc_FW/build/obj/chregistry.o deleted file mode 100755 index 645911d..0000000 Binary files a/oroca_bldc_FW/build/obj/chregistry.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chschd.o b/oroca_bldc_FW/build/obj/chschd.o deleted file mode 100755 index c13c38e..0000000 Binary files a/oroca_bldc_FW/build/obj/chschd.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chsem.o b/oroca_bldc_FW/build/obj/chsem.o deleted file mode 100755 index 6dd27ec..0000000 Binary files a/oroca_bldc_FW/build/obj/chsem.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chsys.o b/oroca_bldc_FW/build/obj/chsys.o deleted file mode 100755 index 9d6a8ec..0000000 Binary files a/oroca_bldc_FW/build/obj/chsys.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chthreads.o b/oroca_bldc_FW/build/obj/chthreads.o deleted file mode 100755 index b4f239d..0000000 Binary files a/oroca_bldc_FW/build/obj/chthreads.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/chvt.o b/oroca_bldc_FW/build/obj/chvt.o deleted file mode 100755 index 917f466..0000000 Binary files a/oroca_bldc_FW/build/obj/chvt.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/comm_usb.o b/oroca_bldc_FW/build/obj/comm_usb.o deleted file mode 100755 index 5d1b28a..0000000 Binary files a/oroca_bldc_FW/build/obj/comm_usb.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/conf_general.o b/oroca_bldc_FW/build/obj/conf_general.o deleted file mode 100755 index 1124a4d..0000000 Binary files a/oroca_bldc_FW/build/obj/conf_general.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/eeprom.o b/oroca_bldc_FW/build/obj/eeprom.o deleted file mode 100755 index 652978c..0000000 Binary files a/oroca_bldc_FW/build/obj/eeprom.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/flash_helper.o b/oroca_bldc_FW/build/obj/flash_helper.o deleted file mode 100755 index c496da7..0000000 Binary files a/oroca_bldc_FW/build/obj/flash_helper.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/hal.o b/oroca_bldc_FW/build/obj/hal.o deleted file mode 100755 index 4aa3277..0000000 Binary files a/oroca_bldc_FW/build/obj/hal.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/hal_lld.o b/oroca_bldc_FW/build/obj/hal_lld.o deleted file mode 100755 index 90f86f7..0000000 Binary files a/oroca_bldc_FW/build/obj/hal_lld.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/hw_oroca.o b/oroca_bldc_FW/build/obj/hw_oroca.o deleted file mode 100755 index 715c904..0000000 Binary files a/oroca_bldc_FW/build/obj/hw_oroca.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/i2c.o b/oroca_bldc_FW/build/obj/i2c.o deleted file mode 100755 index b43e0c6..0000000 Binary files a/oroca_bldc_FW/build/obj/i2c.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/i2c_lld.o b/oroca_bldc_FW/build/obj/i2c_lld.o deleted file mode 100755 index a02356b..0000000 Binary files a/oroca_bldc_FW/build/obj/i2c_lld.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/icu.o b/oroca_bldc_FW/build/obj/icu.o deleted file mode 100755 index 6e60972..0000000 Binary files a/oroca_bldc_FW/build/obj/icu.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/icu_lld.o b/oroca_bldc_FW/build/obj/icu_lld.o deleted file mode 100755 index fb8f6ef..0000000 Binary files a/oroca_bldc_FW/build/obj/icu_lld.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/irq_handlers.o b/oroca_bldc_FW/build/obj/irq_handlers.o deleted file mode 100755 index ac24c3e..0000000 Binary files a/oroca_bldc_FW/build/obj/irq_handlers.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/main.o b/oroca_bldc_FW/build/obj/main.o deleted file mode 100755 index 104267c..0000000 Binary files a/oroca_bldc_FW/build/obj/main.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/mcpwm.o b/oroca_bldc_FW/build/obj/mcpwm.o deleted file mode 100755 index 7f8be97..0000000 Binary files a/oroca_bldc_FW/build/obj/mcpwm.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/misc.o b/oroca_bldc_FW/build/obj/misc.o deleted file mode 100755 index 240cb75..0000000 Binary files a/oroca_bldc_FW/build/obj/misc.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/nvic.o b/oroca_bldc_FW/build/obj/nvic.o deleted file mode 100755 index 16c24c5..0000000 Binary files a/oroca_bldc_FW/build/obj/nvic.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/pal.o b/oroca_bldc_FW/build/obj/pal.o deleted file mode 100755 index 06363f7..0000000 Binary files a/oroca_bldc_FW/build/obj/pal.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/pal_lld.o b/oroca_bldc_FW/build/obj/pal_lld.o deleted file mode 100755 index ca640bf..0000000 Binary files a/oroca_bldc_FW/build/obj/pal_lld.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/serial_usb.o b/oroca_bldc_FW/build/obj/serial_usb.o deleted file mode 100755 index 38fa4e5..0000000 Binary files a/oroca_bldc_FW/build/obj/serial_usb.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/servo_dec.o b/oroca_bldc_FW/build/obj/servo_dec.o deleted file mode 100755 index 81d3905..0000000 Binary files a/oroca_bldc_FW/build/obj/servo_dec.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32_dma.o b/oroca_bldc_FW/build/obj/stm32_dma.o deleted file mode 100755 index d7de545..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32_dma.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_adc.o b/oroca_bldc_FW/build/obj/stm32f4xx_adc.o deleted file mode 100755 index 3abc4da..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_adc.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_dma.o b/oroca_bldc_FW/build/obj/stm32f4xx_dma.o deleted file mode 100755 index e1fb639..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_dma.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_exti.o b/oroca_bldc_FW/build/obj/stm32f4xx_exti.o deleted file mode 100755 index 044dec6..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_exti.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_flash.o b/oroca_bldc_FW/build/obj/stm32f4xx_flash.o deleted file mode 100755 index 50ab45a..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_flash.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_rcc.o b/oroca_bldc_FW/build/obj/stm32f4xx_rcc.o deleted file mode 100755 index d37c917..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_rcc.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_syscfg.o b/oroca_bldc_FW/build/obj/stm32f4xx_syscfg.o deleted file mode 100755 index fb30015..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_syscfg.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_tim.o b/oroca_bldc_FW/build/obj/stm32f4xx_tim.o deleted file mode 100755 index d409050..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_tim.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/stm32f4xx_wwdg.o b/oroca_bldc_FW/build/obj/stm32f4xx_wwdg.o deleted file mode 100755 index 7a292ee..0000000 Binary files a/oroca_bldc_FW/build/obj/stm32f4xx_wwdg.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/syscalls.o b/oroca_bldc_FW/build/obj/syscalls.o deleted file mode 100755 index ca3d507..0000000 Binary files a/oroca_bldc_FW/build/obj/syscalls.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/uart.o b/oroca_bldc_FW/build/obj/uart.o deleted file mode 100755 index b6758d5..0000000 Binary files a/oroca_bldc_FW/build/obj/uart.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/uart_lld.o b/oroca_bldc_FW/build/obj/uart_lld.o deleted file mode 100755 index 9151e4d..0000000 Binary files a/oroca_bldc_FW/build/obj/uart_lld.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/usb.o b/oroca_bldc_FW/build/obj/usb.o deleted file mode 100755 index 45305a6..0000000 Binary files a/oroca_bldc_FW/build/obj/usb.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/usb_lld.o b/oroca_bldc_FW/build/obj/usb_lld.o deleted file mode 100755 index 060ce8f..0000000 Binary files a/oroca_bldc_FW/build/obj/usb_lld.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/usb_uart.o b/oroca_bldc_FW/build/obj/usb_uart.o deleted file mode 100755 index f962414..0000000 Binary files a/oroca_bldc_FW/build/obj/usb_uart.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/utils.o b/oroca_bldc_FW/build/obj/utils.o deleted file mode 100755 index 06a98dd..0000000 Binary files a/oroca_bldc_FW/build/obj/utils.o and /dev/null differ diff --git a/oroca_bldc_FW/build/obj/vectors.o b/oroca_bldc_FW/build/obj/vectors.o deleted file mode 100755 index 285860a..0000000 Binary files a/oroca_bldc_FW/build/obj/vectors.o and /dev/null differ diff --git a/oroca_bldc_FW/build/oroca_bldc.bin b/oroca_bldc_FW/build/oroca_bldc.bin deleted file mode 100755 index 41c4b47..0000000 Binary files a/oroca_bldc_FW/build/oroca_bldc.bin and /dev/null differ diff --git a/oroca_bldc_FW/build/oroca_bldc.dmp b/oroca_bldc_FW/build/oroca_bldc.dmp deleted file mode 100755 index a368dcc..0000000 --- a/oroca_bldc_FW/build/oroca_bldc.dmp +++ /dev/null @@ -1,712 +0,0 @@ - -build/oroca_bldc.elf: file format elf32-littlearm -build/oroca_bldc.elf -architecture: arm, flags 0x00000112: -EXEC_P, HAS_SYMS, D_PAGED -start address 0x0800c001 - -Program Header: - LOAD off 0x00008000 vaddr 0x08000000 paddr 0x08000000 align 2**15 - filesz 0x000001c0 memsz 0x000001c0 flags rw- - LOAD off 0x0000c000 vaddr 0x0800c000 paddr 0x0800c000 align 2**15 - filesz 0x00007b44 memsz 0x00007b48 flags rwx - LOAD off 0x00018800 vaddr 0x20000800 paddr 0x08013b48 align 2**15 - filesz 0x0000043c memsz 0x0000043c flags rw- - LOAD off 0x00018c40 vaddr 0x20000c40 paddr 0x08013f84 align 2**15 - filesz 0x00000000 memsz 0x000021e8 flags rw- - LOAD off 0x00020000 vaddr 0x20000000 paddr 0x20000000 align 2**15 - filesz 0x00000000 memsz 0x00000800 flags rw- -private flags = 5000402: [Version5 EABI] [hard-float ABI] [has entry point] - -Sections: -Idx Name Size VMA LMA File off Algn - 0 startup 000001c0 08000000 08000000 00008000 2**4 - CONTENTS, ALLOC, LOAD, DATA - 1 .text 00007b44 0800c000 0800c000 0000c000 2**4 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .textalign 00000004 08013b44 08013b44 00013b44 2**0 - ALLOC - 3 .mstack 00000400 20000000 20000000 00020000 2**0 - ALLOC - 4 .pstack 00000400 20000400 20000400 00020000 2**0 - ALLOC - 5 .data 0000043c 20000800 08013b48 00018800 2**3 - CONTENTS, ALLOC, LOAD, DATA - 6 .bss 000021e8 20000c40 08013f84 00018c40 2**3 - ALLOC - 7 .ram0 00000000 20002e28 20002e28 00018c3c 2**2 - CONTENTS - 8 .ram1 00000000 20000000 20000000 00018c3c 2**2 - CONTENTS - 9 .ram2 00000000 2001c000 2001c000 00018c3c 2**2 - CONTENTS - 10 .ram3 00000000 00000000 00000000 00018c3c 2**2 - CONTENTS - 11 .ram4 00000000 10000000 10000000 00018c3c 2**2 - CONTENTS - 12 .ram5 00000000 40024000 40024000 00018c3c 2**2 - CONTENTS - 13 .ram6 00000000 00000000 00000000 00018c3c 2**2 - CONTENTS - 14 .ram7 00000000 00000000 00000000 00018c3c 2**2 - CONTENTS - 15 .ARM.attributes 00000035 00000000 00000000 00018c3c 2**0 - CONTENTS, READONLY - 16 .comment 00000070 00000000 00000000 00018c71 2**0 - CONTENTS, READONLY - 17 .debug_info 0003a757 00000000 00000000 00018ce1 2**0 - CONTENTS, READONLY, DEBUGGING - 18 .debug_abbrev 000094f6 00000000 00000000 00053438 2**0 - CONTENTS, READONLY, DEBUGGING - 19 .debug_aranges 000017b8 00000000 00000000 0005c92e 2**0 - CONTENTS, READONLY, DEBUGGING - 20 .debug_ranges 00002950 00000000 00000000 0005e0e6 2**0 - CONTENTS, READONLY, DEBUGGING - 21 .debug_line 0000e328 00000000 00000000 00060a36 2**0 - CONTENTS, READONLY, DEBUGGING - 22 .debug_str 000083e7 00000000 00000000 0006ed5e 2**0 - CONTENTS, READONLY, DEBUGGING - 23 .debug_frame 00004428 00000000 00000000 00077148 2**2 - CONTENTS, READONLY, DEBUGGING - 24 .debug_loc 0000e02b 00000000 00000000 0007b570 2**0 - CONTENTS, READONLY, DEBUGGING -SYMBOL TABLE: -08000000 l d startup 00000000 startup -0800c000 l d .text 00000000 .text -08013b44 l d .textalign 00000000 .textalign -20000000 l d .mstack 00000000 .mstack -20000400 l d .pstack 00000000 .pstack -20000800 l d .data 00000000 .data -20000c40 l d .bss 00000000 .bss -20002e28 l d .ram0 00000000 .ram0 -20000000 l d .ram1 00000000 .ram1 -2001c000 l d .ram2 00000000 .ram2 -00000000 l d .ram3 00000000 .ram3 -10000000 l d .ram4 00000000 .ram4 -40024000 l d .ram5 00000000 .ram5 -00000000 l d .ram6 00000000 .ram6 -00000000 l d .ram7 00000000 .ram7 -00000000 l d .ARM.attributes 00000000 .ARM.attributes -00000000 l d .comment 00000000 .comment -00000000 l d .debug_info 00000000 .debug_info -00000000 l d .debug_abbrev 00000000 .debug_abbrev -00000000 l d .debug_aranges 00000000 .debug_aranges -00000000 l d .debug_ranges 00000000 .debug_ranges -00000000 l d .debug_line 00000000 .debug_line -00000000 l d .debug_str 00000000 .debug_str -00000000 l d .debug_frame 00000000 .debug_frame -00000000 l d .debug_loc 00000000 .debug_loc -00000000 l df *ABS* 00000000 vectors.c -00000000 l df *ABS* 00000000 build/obj/crt0_v7m.o -0800c066 l .text 00000000 msloop -0800c074 l .text 00000000 psloop -0800c084 l .text 00000000 dloop -0800c098 l .text 00000000 bloop -0800c0aa l .text 00000000 initloop -0800c0b6 l .text 00000000 endinitloop -0800c0be l .text 00000000 finiloop -0800c0ca l .text 00000000 endfiniloop -00000000 l df *ABS* 00000000 build/obj/chcoreasm_v7m.o -0000000c l *ABS* 00000000 CONTEXT_OFFSET -e000ed04 l *ABS* 00000000 SCB_ICSR -10000000 l *ABS* 00000000 ICSR_PENDSVSET -00000000 l df *ABS* 00000000 _arm_addsubdf3.o -00000000 l df *ABS* 00000000 _arm_muldivdf3.o -00000000 l df *ABS* 00000000 _arm_truncdfsf2.o -00000000 l df *ABS* 00000000 lib_a-memcpy.o -00000000 l df *ABS* 00000000 crt1.c -00000000 l df *ABS* 00000000 chsys.c -0800cb00 l F .text 00000002 _idle_thread -00000000 l df *ABS* 00000000 chvt.c -00000000 l df *ABS* 00000000 chschd.c -0800ccd0 l F .text 00000070 wakeup -00000000 l df *ABS* 00000000 chthreads.c -00000000 l df *ABS* 00000000 chtm.c -00000000 l df *ABS* 00000000 chmtx.c -00000000 l df *ABS* 00000000 chevents.c -00000000 l df *ABS* 00000000 chqueues.c -00000000 l df *ABS* 00000000 chmemcore.c -20000e98 l O .bss 00000004 endmem -20000e9c l O .bss 00000004 nextmem -00000000 l df *ABS* 00000000 chheap.c -20000ea0 l O .bss 00000020 default_heap -00000000 l df *ABS* 00000000 chcore_v7m.c -00000000 l df *ABS* 00000000 hal.c -00000000 l df *ABS* 00000000 can.c -00000000 l df *ABS* 00000000 i2c.c -00000000 l df *ABS* 00000000 icu.c -00000000 l df *ABS* 00000000 serial_usb.c -0800d6f0 l F .text 0000005a onotify -0800d750 l F .text 0000006c inotify -0800d7c0 l F .text 00000006 readt -0800d7d0 l F .text 0000000a read -0800d7e0 l F .text 00000006 writet -0800d7f0 l F .text 0000000a write -0800d800 l F .text 00000006 gett -0800d810 l F .text 0000000a get -0800d820 l F .text 00000006 putt -0800d830 l F .text 0000000a put -080131b0 l O .text 00000020 vmt -20000800 l O .data 00000007 linecoding -00000000 l df *ABS* 00000000 st.c -00000000 l df *ABS* 00000000 uart.c -00000000 l df *ABS* 00000000 usb.c -080131d0 l O .text 00000002 zero_status -080131e0 l O .text 00000002 active_status -080131f0 l O .text 00000002 halted_status -00000000 l df *ABS* 00000000 nvic.c -00000000 l df *ABS* 00000000 stm32_dma.c -20000ec0 l O .bss 00000080 dma_isr_redir -20000f40 l O .bss 00000004 dma_streams_mask -00000000 l df *ABS* 00000000 hal_lld.c -00000000 l df *ABS* 00000000 can_lld.c -0800e620 l F .text 00000118 can_lld_set_filters -00000000 l df *ABS* 00000000 pal_lld.c -00000000 l df *ABS* 00000000 i2c_lld.c -00000000 l df *ABS* 00000000 usb_lld.c -0800f0d0 l F .text 00000072 otg_disable_ep.isra.0 -0800f570 l F .text 000000a4 otg_epout_handler.constprop.7 -0800f670 l F .text 000000d0 otg_epin_handler.constprop.8 -080132c0 l O .text 0000000c fsparams -080132e0 l O .text 00000024 ep0config -20001230 l O .bss 00000014 ep0_state -20001244 l O .bss 00000008 ep0setup_buffer -00000000 l df *ABS* 00000000 icu_lld.c -00000000 l df *ABS* 00000000 st_lld.c -00000000 l df *ABS* 00000000 uart_lld.c -0800fa10 l F .text 00000078 serve_usart_irq -00000000 l df *ABS* 00000000 board.c -00000000 l df *ABS* 00000000 bldc.c -0800fb40 l F .text 0000001c periodic_thread -0800fee0 l F .text 00000030 uart_process_thread -200012a0 l O .bss 00000440 m_mavlink_buffer.11151 -200016e0 l O .bss 00000218 uart_thread_wa -200018f8 l O .bss 00000030 m_mavlink_status.11147 -08013430 l O .text 00000100 mavlink_message_crcs.11197 -20001928 l O .bss 00000598 periodic_thread_wa -00000000 l df *ABS* 00000000 mcpwm.c -0800ff10 l F .text 0000001c SEQUENCE_thread -080105f0 l F .text 0000010c DoControl.part.1 -20001ec0 l O .bss 00000004 curr0_offset -20001f0c l O .bss 00000004 curr1_sum -20001f38 l O .bss 00000998 SEQUENCE_thread_wa -200028f8 l O .bss 00000004 curr_start_samples -20002900 l O .bss 00000001 dccal_done -20002904 l O .bss 00000004 Hall_Err0 -20002934 l O .bss 00000004 qVdSquared -20002938 l O .bss 00000004 DCbus -2000293c l O .bss 00000004 TargetDCbus -20002944 l O .bss 00000004 Theta -20002a14 l O .bss 00000004 curr1_offset -20002a18 l O .bss 00000004 curr0_sum -20002a1c l O .bss 00000004 Hall_PIout -20002a20 l O .bss 00000001 fault_now -20002a2c l O .bss 00000010 MeasCurrParm -00000000 l df *ABS* 00000000 usb_uart.c -08010c10 l F .text 00000030 get_descriptor -08010c40 l F .text 00000040 usb_event -08013540 l O .text 00000024 ep1config -20002ca8 l O .bss 00000014 ep1instate -20002cbc l O .bss 00000014 ep1outstate -20002a3c l O .bss 00000014 ep2instate -08013570 l O .text 00000008 vcom_configuration_descriptor -080135c0 l O .text 00000043 vcom_configuration_descriptor_data -08013580 l O .text 00000024 ep2config -080135b0 l O .text 00000010 usbcfg -08013610 l O .text 00000012 vcom_device_descriptor_data -08013630 l O .text 00000004 vcom_string0 -08013640 l O .text 00000026 vcom_string1 -08013670 l O .text 00000038 vcom_string2 -080136b0 l O .text 00000008 vcom_string3 -080136c0 l O .text 00000020 vcom_strings -080136f0 l O .text 00000008 vcom_device_descriptor -00000000 l df *ABS* 00000000 irq_handlers.c -00000000 l df *ABS* 00000000 comm_usb.c -20002cd0 l O .bss 00000010 send_mutex -00000000 l df *ABS* 00000000 utils.c -20002ce0 l O .bss 00000004 sys_lock_cnt -00000000 l df *ABS* 00000000 conf_general.c -00000000 l df *ABS* 00000000 eeprom.c -08011110 l F .text 0000007c EE_VerifyPageFullWriteVariable -08011190 l F .text 0000002e EE_EraseSectorIfNotEmpty.constprop.1 -080111c0 l F .text 0000002c EE_Format -00000000 l df *ABS* 00000000 flash_helper.c -08013700 l O .text 00000018 flash_sector -08013720 l O .text 00000030 flash_addr -00000000 l df *ABS* 00000000 hw_oroca.c -00000000 l df *ABS* 00000000 misc.c -00000000 l df *ABS* 00000000 stm32f4xx_adc.c -00000000 l df *ABS* 00000000 stm32f4xx_dma.c -00000000 l df *ABS* 00000000 stm32f4xx_exti.c -00000000 l df *ABS* 00000000 stm32f4xx_flash.c -00000000 l df *ABS* 00000000 stm32f4xx_rcc.c -00000000 l df *ABS* 00000000 stm32f4xx_tim.c -00000000 l df *ABS* 00000000 stm32f4xx_wwdg.c -00000000 l df *ABS* 00000000 main.cpp -00000000 l df *ABS* 00000000 sf_cos.c -00000000 l df *ABS* 00000000 sf_sin.c -00000000 l df *ABS* 00000000 wf_sqrt.c -00000000 l df *ABS* 00000000 ef_rem_pio2.c -08013760 l O .text 00000080 npio2_hw -080137e0 l O .text 00000318 two_over_pi -00000000 l df *ABS* 00000000 ef_sqrt.c -00000000 l df *ABS* 00000000 kf_cos.c -00000000 l df *ABS* 00000000 kf_rem_pio2.c -08013b00 l O .text 0000000c init_jk -08013b10 l O .text 0000002c PIo2 -00000000 l df *ABS* 00000000 kf_sin.c -00000000 l df *ABS* 00000000 s_matherr.c -00000000 l df *ABS* 00000000 sf_fabs.c -00000000 l df *ABS* 00000000 sf_floor.c -00000000 l df *ABS* 00000000 sf_fpclassify.c -00000000 l df *ABS* 00000000 sf_scalbn.c -00000000 l df *ABS* 00000000 sf_copysign.c -00000000 l df *ABS* 00000000 errno.c -00000000 l df *ABS* 00000000 memset.c -00000000 l df *ABS* 00000000 chregistry.c -00000000 l df *ABS* 00000000 impure.c -20000810 l O .data 00000428 impure_data -00000000 l df *ABS* 00000000 s_lib_ver.c -00000000 l df *ABS* 00000000 -10000000 l startup 00000000 __ram4_start__ -00000000 l startup 00000000 __ram6_start__ -20002e28 l .ram0 00000000 __ram0_free__ -08013b48 l .mstack 00000000 _etext -00000000 l *UND* 00000000 msObjectInit -40025000 l *ABS* 00000000 __ram5_end__ -00001000 l *ABS* 00000000 __ram5_size__ -0001c000 l *ABS* 00000000 __ram1_size__ -00010000 l *ABS* 00000000 __ram4_size__ -2001c000 l *ABS* 00000000 __ram1_end__ -10010000 l *ABS* 00000000 __ram4_end__ -00020000 l *ABS* 00000000 __ram0_size__ -00000000 l *ABS* 00000000 __ram6_end__ -00000000 l *UND* 00000000 utils_middle_of_3 -00000000 l *ABS* 00000000 __ram7_size__ -00000000 l startup 00000000 __ram7_start__ -00000000 l *UND* 00000000 mc_interface_release_motor -00000000 l *ABS* 00000000 __ram3_size__ -00000000 l startup 00000000 _text -00000000 l *ABS* 00000000 __ram3_end__ -00004000 l *ABS* 00000000 __ram2_size__ -20000000 l startup 00000000 __ram1_start__ -00000000 l *ABS* 00000000 __ram6_size__ -00000000 l *UND* 00000000 mc_interface_unlock -20020000 l *ABS* 00000000 __ram2_end__ -2001c000 l startup 00000000 __ram2_start__ -00000000 l *ABS* 00000000 __ram7_end__ -20000000 l startup 00000000 __ram0_start__ -40024000 l startup 00000000 __ram5_start__ -20020000 l *ABS* 00000000 __ram0_end__ -00000400 l *ABS* 00000000 __main_stack_size__ -00000000 l startup 00000000 __ram3_start__ -00000400 l *ABS* 00000000 __process_stack_size__ -08013310 g O .text 000000fc pal_default_config -0800caf0 w F .text 00000002 Vector58 -0800caf0 w F .text 00000002 VectorE8 -0800caf0 w F .text 00000002 Vector9C -0800e0b0 g F .text 00000032 nvicEnableVector -080119c0 g F .text 00000020 FLASH_Unlock -0800d8a0 g F .text 00000032 sduStart -0800caf0 w F .text 00000002 VectorAC -0800cbc0 g F .text 00000058 chSysTimerHandlerI -0800d100 g F .text 0000000a chThdExit -0800d290 g F .text 0000002a chEvtBroadcastFlagsI -0800cdc0 g F .text 00000044 chSchGoSleepTimeoutS -0800d6b0 g F .text 00000004 i2cInit -0800caf0 w F .text 00000002 DebugMon_Handler -08011930 g F .text 00000014 DMA_Cmd -0800caf0 w F .text 00000002 Vector1A0 -0800d3f0 g F .text 0000001a chOQResetI -0800caf0 w F .text 00000002 Vector5C -0800c454 g F .text 0000005a .hidden __floatdidf -0800ff50 g F .text 00000068 ClarkePark -08012140 g F .text 00000018 TIM_CCPreloadControl -08010d10 g F .text 00000018 Vector11C -20002ce4 g O .bss 00000140 VirtAddVarTab -0800fba0 g F .text 00000040 bldc_start -0800dba0 g F .text 00000022 usbStartTransmitI -0800caf0 w F .text 00000002 HardFault_Handler -0800caf0 w F .text 00000002 Vector1B8 -0800fcd0 g F .text 0000020c recv -0800e400 g F .text 0000004c dmaInit -0800caf0 w F .text 00000002 Vector19C -0800df50 g F .text 000000c4 _usb_ep0in -2000124c g O .bss 00000018 ICUD3 -080111f0 g F .text 00000070 EE_ReadVariable -0800d2c0 g F .text 0000001e chIQObjectInit -0800d1b0 g F .text 0000000c chTMStartMeasurementX -0800f520 g F .text 00000044 usb_lld_prepare_receive -08012090 g F .text 0000000e TIM_OC1PreloadConfig -0800e740 g F .text 0000003c Vector8C -0800f9d0 g F .text 0000001a SysTick_Handler -08011620 g F .text 00000070 NVIC_Init -20000000 g .ram1 00000000 __ram1_free__ -20000808 g O .data 00000004 switching_frequency_now -0800fa90 g F .text 00000014 VectorDC -0800caf0 w F .text 00000002 PendSV_Handler -0800caf0 w F .text 00000002 Vector168 -0800caf0 w F .text 00000002 NMI_Handler -08000000 g O startup 000001c0 _vectors -080107c0 g F .text 0000004c update_timer_Duty -08010da0 g F .text 00000018 utils_sys_lock_cnt -0800cd90 g F .text 00000028 chSchGoSleepS -0800caf0 w F .text 00000002 Vector110 -0800d970 g F .text 0000006a sduDataTransmitted -0800d150 g F .text 00000028 chThdEnqueueTimeoutS -080130d0 g F .text 0000000c __errno -08011ae0 g F .text 00000040 FLASH_ProgramHalfWord -08012420 g F .text 00000290 __ieee754_rem_pio2f -20002e28 g .ram0 00000000 __heap_base__ -20002a24 g O .bss 00000004 HallPLLA -080116e0 g F .text 00000028 ADC_CommonInit -0800e280 g F .text 00000028 Vector120 -0800cfb0 g F .text 00000070 chThdCreateI -0800f8d0 g F .text 00000014 usb_lld_clear_out -0800ec90 g F .text 000000dc VectorC8 -080118c0 g F .text 00000070 DMA_Init -0800ce10 g F .text 00000058 chSchWakeupS -2000129c g O .bss 00000001 Ch -08012360 g F .text 000000b8 sqrtf -0800cd40 g F .text 00000014 _scheduler_init -0800daa0 g F .text 0000001a usbObjectInit -0800cf20 g F .text 00000018 chSchRescheduleS -0800d020 g F .text 00000080 chThdCreateStatic -0800e7f0 g F .text 00000064 Vector94 -0800caf0 w F .text 00000002 VectorA8 -08012120 g F .text 00000014 TIM_CtrlPWMOutputs -0800c980 g F .text 00000134 memcpy -08011710 g F .text 00000014 ADC_Cmd -0800dc00 g F .text 0000034c _usb_ep0setup -0800f9f0 g F .text 0000001c st_lld_init -0800f910 g F .text 0000009c VectorB4 -200028fc g O .bss 00000004 Hall_CosSin -0800c3e4 g F .text 00000022 .hidden __floatsidf -0800d110 g F .text 0000001c chThdSuspendS -0800d3d0 g F .text 0000001c chOQObjectInit -08011e40 g F .text 00000018 TIM_Cmd -0800cd60 g F .text 0000002c chSchReadyI -080120d0 g F .text 00000012 TIM_OC4PreloadConfig -0800d1c0 g F .text 00000048 chTMStopMeasurementX -0800c000 g startup 00000000 __fini_array_end -20000800 g .pstack 00000000 __main_thread_stack_end__ -080118b0 g F .text 00000008 ADC_ClearITPendingBit -0800cc40 g F .text 0000001c _vt_init -0800d9e0 g F .text 0000006a sduDataReceived -0800d570 g F .text 0000001c _heap_init -0800e160 g F .text 0000002c Vector74 -20000f44 g O .bss 00000030 CAND1 -0800d610 g F .text 00000034 halInit -0800d650 g F .text 00000004 canInit -08012160 g F .text 00000008 TIM_ClearITPendingBit -0800caf0 w F .text 00000002 Vector160 -0800caf0 w F .text 00000002 Vector1B0 -0800caf0 w F .text 00000002 UsageFault_Handler -0800d210 g F .text 00000038 _tm_init -0800caf0 w F .text 00000002 VectorEC -08011b60 g F .text 00000018 RCC_APB2PeriphClockCmd -20000c40 g .bss 00000000 _bss_start -0800cea0 g F .text 00000040 chSchDoRescheduleBehind -0800fad0 g F .text 00000048 uart_lld_init -08012fa0 g F .text 00000038 __fpclassifyf -20020000 g *ABS* 00000000 __heap_end__ -0800c3c4 g F .text 0000001e .hidden __aeabi_ui2d -0800c140 g F .text 00000000 .hidden __aeabi_drsub -0800caf0 w F .text 00000002 Vector40 -0800caf0 w F .text 00000002 VectorF8 -0800caf0 w F .text 00000002 Vector108 -0800db70 g F .text 00000022 usbStartReceiveI -08010810 g F .text 00000104 CalcSVGen -0800d350 g F .text 00000076 chIQReadTimeout -0800caf0 w F .text 00000002 VectorBC -0800caf0 w F .text 00000002 Vector190 -0800e370 g F .text 0000002c Vector150 -0800f500 g F .text 00000012 usb_lld_read_setup -08012f00 g F .text 0000000e fabsf -08011f80 g F .text 00000090 TIM_OC3Init -0800e2b0 g F .text 0000002c Vector124 -080117e0 g F .text 00000056 ADC_InjectedChannelConfig -0800e4e0 g F .text 00000068 hal_lld_init -0800c408 g F .text 0000003a .hidden __extendsfdf2 -0800c704 g F .text 000001d0 .hidden __aeabi_ddiv -0800f840 g F .text 00000014 usb_lld_start_out -08011bc0 g F .text 000001b8 TIM_DeInit -00000000 g .ram7 00000000 __ram7_free__ -08011b40 g F .text 00000018 RCC_APB1PeriphClockCmd -0800c14c g F .text 00000276 .hidden __adddf3 -0800c4b0 g F .text 00000254 .hidden __aeabi_dmul -0800d0c0 g F .text 00000040 chThdExitS -2000080c g O .data 00000001 __fdlib_version -0800da50 g F .text 00000002 sduInterruptTransmitted -08012e60 g F .text 00000090 __kernel_sinf -08011730 g F .text 0000008c ADC_RegularChannelConfig -0800fbe0 g F .text 000000e4 send -0800caf0 w F .text 00000002 Vector148 -0800caf0 w F .text 00000002 Vector188 -0800c3c4 g F .text 0000001e .hidden __floatunsidf -0800f890 g F .text 00000014 usb_lld_stall_out -08012260 g F .text 00000078 cosf -0800caf0 w F .text 00000002 Vector198 -0800caf0 w F .text 00000002 Vector118 -0800c8e0 g F .text 0000009e .hidden __aeabi_d2f -0800caf0 w F .text 00000002 Vector64 -20002e28 g .bss 00000000 _bss_end -080119b0 g F .text 0000000c EXTI_ClearITPendingBit -0800eae0 g F .text 000000ac _pal_lld_setgroupmode -08011e60 g F .text 0000007c TIM_OC1Init -080120c0 g F .text 0000000e TIM_OC3PreloadConfig -0800c000 g F .text 00000000 Reset_Handler -0800da60 g F .text 00000004 stInit -0800caf0 w F .text 00000002 VectorCC -080117c0 g F .text 0000001c ADC_MultiModeDMARequestAfterLastTransferCmd -0800caf0 w F .text 00000002 Vector54 -08012760 g F .text 00000104 __kernel_cosf -20001ec4 g O .bss 00000018 ADC_Value -0800e860 g F .text 00000078 Vector98 -08011260 g F .text 00000140 EE_Init -40024000 g .ram5 00000000 __ram5_free__ -0800caf0 w F .text 00000002 VectorD8 -0800caf0 w F .text 00000002 Vector138 -0800c14c g F .text 00000276 .hidden __aeabi_dadd -08011850 g F .text 0000000c ADC_ExternalTrigInjectedConvConfig -0800caf0 w F .text 00000002 Vector24 -08011e20 g F .text 00000018 TIM_ARRPreloadConfig -0800cae0 w F .text 00000002 __default_exit -20002940 g O .bss 00000002 AccumThetaCnt -0800caf0 w F .text 00000002 Vector1AC -0800c444 g F .text 0000006a .hidden __aeabi_ul2d -0800f270 g F .text 000000c4 usb_lld_reset -0800cf40 g F .text 00000014 chSchDoReschedule -0800cb10 g F .text 000000a4 chSysInit -0800caf0 w F .text 00000002 Vector178 -0800db30 g F .text 0000001c usbPrepareQueuedReceive -00000000 g .ram6 00000000 __ram6_free__ -08012230 g F .text 00000010 WWDG_SetCounter -0800daf0 g F .text 00000032 usbInitEndpointI -0800d0a0 g F .text 00000018 chThdSleep -20002e24 g O .bss 00000002 DataVar -08013200 g O .text 000000c0 _stm32_dma_streams -0800e220 g F .text 0000002c Vector84 -0800f620 g F .text 00000050 usb_lld_prepare_transmit -0800f4e0 g F .text 0000001a usb_lld_get_status_in -0800e550 g F .text 000000c8 stm32_clock_init -0800caf0 w F .text 00000002 Vector1A4 -0800e910 g F .text 000001cc _pal_lld_init -08010e40 g F .text 00000124 conf_general_read_app_configuration -20002930 g O .bss 00000004 sinth -0800d250 g F .text 0000000a chMtxObjectInit -0800c148 g F .text 0000027a .hidden __aeabi_dsub -0800caf0 w F .text 00000002 VectorD0 -0800f8f0 g F .text 00000014 usb_lld_clear_in -080119f0 g F .text 00000040 FLASH_GetStatus -0800d180 g F .text 00000022 chThdDequeueAllI -0800f150 g F .text 00000024 usb_lld_init -0800d500 g F .text 00000028 _core_init -20001f10 g O .bss 00000024 PIParmW -080119e0 g F .text 0000000c FLASH_ClearFlag -0800caf0 w F .text 00000002 Vector1B4 -0800c444 g F .text 0000006a .hidden __floatundidf -08011a30 g F .text 00000026 FLASH_WaitForLastOperation -080120a0 g F .text 00000012 TIM_OC2PreloadConfig -08012170 g F .text 0000000e TIM_SelectInputTrigger -0800caf0 w F .text 00000002 Vector140 -0800caf0 w F .text 00000002 VectorE4 -0800e020 g F .text 00000088 _usb_ep0out -08011ee0 g F .text 00000098 TIM_OC2Init -0800caf0 w F .text 00000002 VectorC0 -0800e3d0 g F .text 0000002c Vector158 -0800e340 g F .text 00000028 Vector130 -0800da70 g F .text 00000004 uartInit -0800c110 g F .text 00000000 _port_switch -0800cac0 w F .text 00000002 __core_init -0800cad0 w F .text 00000002 __late_init -200028f4 g O .bss 00000004 uGF -08010020 g F .text 00000098 SetupControlParameters -0800d5b0 g F .text 00000060 _port_irq_epilogue -0800caf0 w F .text 00000002 Vector134 -08012180 g F .text 00000012 TIM_SelectOutputTrigger -2000290c g O .bss 00000024 PIParmPLL -0800d530 g F .text 00000038 chCoreAlloc -080113a0 g F .text 00000028 flash_helper_get_sector_address -0800f9b0 g F .text 00000018 icu_lld_init -0800c3e4 g F .text 00000022 .hidden __aeabi_i2d -0800ffc0 g F .text 00000060 CalcPI -0800caf0 w F .text 00000002 VectorF0 -080121e0 g F .text 00000014 WWDG_SetPrescaler -08012010 g F .text 00000074 TIM_OC4Init -0800e310 g F .text 0000002c Vector12C -0800caf0 w F .text 00000002 Vector13C -0800c704 g F .text 000001d0 .hidden __divdf3 -0800dbd0 g F .text 00000026 _usb_reset -0800caf0 w F .text 00000002 Vector100 -0800c4b0 g F .text 00000254 .hidden __muldf3 -08013b48 g .mstack 00000000 _textdata -08010d50 g F .text 00000024 VectorE0 -0800caf0 w F .text 00000002 VectorF4 -0800d660 g F .text 00000042 canObjectInit -0800c000 g startup 00000000 __fini_array_start -08012fe0 g F .text 000000d0 scalbnf -08012200 g F .text 00000028 WWDG_SetWindowValue -20002948 g O .bss 00000064 smc1 -08011990 g F .text 00000014 EXTI_GetITStatus -080130e0 g F .text 0000009a memset -080126b0 g F .text 000000a2 __ieee754_sqrtf -0800caf0 w F .text 00000002 MemManage_Handler -08012250 g F .text 0000000e main -0800e100 g F .text 00000028 Vector6C -20001280 g O .bss 0000001c UARTD6 -08011a60 g F .text 00000074 FLASH_EraseSector -0800d6d0 g F .text 00000004 icuInit -0800caf0 w F .text 00000002 VectorA0 -0800eda0 g F .text 00000328 usb_lld_pump -0800ff30 g F .text 0000001c mcpwm_adc_int_handler -20001ee8 g O .bss 00000024 PIParmD -0800d6e0 g F .text 0000000a icuObjectInit -0800d590 g F .text 00000020 SVC_Handler -08012ef0 g F .text 00000004 matherr -20000fb0 g O .bss 00000280 USBD1 -0800c8e0 g F .text 0000009e .hidden __truncdfsf2 -00000000 g .ram3 00000000 __ram3_free__ -0800c000 g startup 00000000 __init_array_end -20001264 g O .bss 0000001c UARTD3 -0800c454 g F .text 0000005a .hidden __aeabi_l2d -0800eb90 g F .text 000000f8 VectorC4 -0800e1c0 g F .text 00000028 Vector7C -0800caf0 w F .text 00000002 Vector180 -08010590 g F .text 0000005c VoltRippleComp -0800d470 g F .text 00000082 chOQWriteTimeout -0800caf0 w F .text 00000002 VectorB0 -08013190 g O .text 00000016 ch_debug -0800dac0 g F .text 00000024 usbStart -08010750 g F .text 0000006c CalcTimes -0800e780 g F .text 00000064 Vector90 -0800d260 g F .text 0000002a chEvtSignalI -0800d930 g F .text 00000040 sduRequestsHook -0800caf0 w F .text 00000002 Vector114 -08010d80 g F .text 00000014 comm_usb_init -0800c128 g F .text 00000000 _port_thread_start -0800caf0 w F .text 00000002 Vector164 -0800caf0 w F .text 00000002 Vector60 -0800caf0 w F .text 00000002 Vector1C -0800cee0 g F .text 0000003c chSchDoRescheduleAhead -0800caf0 w F .text 00000002 Vector1BC -08011840 g F .text 00000010 ADC_InjectedSequencerLengthConfig -080100c0 g F .text 000004c4 mcpwm_init -080130b0 g F .text 00000018 copysignf -0800caf0 w F .text 00000002 Vector17C -20002908 g O .bss 00000004 Hall_SinCos -0800caf0 w F .text 00000002 Vector48 -0800ed70 g F .text 0000002c i2c_lld_init -0800f8b0 g F .text 00000014 usb_lld_stall_in -20000400 g .pstack 00000000 __process_stack_base__ -0800caf0 w F .text 00000002 Vector1A8 -080136e0 g O .text 00000008 serusbcfg -0800caf0 w F .text 00000002 Vector16C -200029ec g O .bss 00000004 costh -0800e8e0 g F .text 00000024 can_lld_init -08010dc0 g F .text 0000001c utils_sys_unlock_cnt -08010cf0 g F .text 00000020 usb_uart_getch -08011890 g F .text 0000001a ADC_ITConfig -20000c38 g O .data 00000004 _impure_ptr -0800e130 g F .text 0000002c Vector70 -0800caf0 w F .text 00000002 VectorD4 -0800d8e0 g F .text 0000004a sduConfigureHookI -0800e0f0 g F .text 00000010 nvicSetSystemHandlerPriority -0800cc20 g F .text 00000014 chSysPolledDelayX -0800d6c0 g F .text 0000000e i2cObjectInit -0800cca0 g F .text 00000028 chVTDoResetI -20002a28 g O .bss 00000004 HallPLLB -08011b80 g F .text 00000018 RCC_APB1PeriphResetCmd -0800d300 g F .text 0000004e chIQGetTimeout -20000800 g .data 00000000 _data -08011950 g F .text 00000040 DMA_ITConfig -0800caf0 w F .text 00000002 Vector4C -0800da80 g F .text 0000000e uartObjectInit -0800caf0 w F .text 00000002 Vector144 -080122e0 g F .text 0000007c sinf -0800e1f0 g F .text 0000002c Vector80 -0800d130 g F .text 00000012 chThdResumeI -0800c138 g F .text 00000000 _port_switch_from_isr -0800f340 g F .text 00000018 usb_lld_set_address -0800fab0 g F .text 00000014 Vector15C -08010920 g F .text 00000194 SMC_HallSensor_Estimation -0800caf0 w F .text 00000002 Vector68 -08011690 g F .text 00000050 ADC_Init -20000400 g .mstack 00000000 __main_stack_end__ -0800e190 g F .text 0000002c Vector78 -080121c0 g F .text 00000012 TIM_SelectMasterSlaveMode -20000c3c g .data 00000000 _edata -08012240 g F .text 00000010 WWDG_Enable -0800db50 g F .text 0000001c usbPrepareQueuedTransmit -08011d80 g F .text 00000098 TIM_TimeBaseInit -0800caf0 g F .text 00000002 _unhandled_exception -08011870 g F .text 0000001a ADC_GetInjectedConversionValue -20000f74 g O .bss 00000038 I2CD2 -0800caf0 w F .text 00000002 Vector170 -200029f0 g O .bss 00000024 SVGenParm -08010d30 g F .text 0000001c Vector88 -08011860 g F .text 0000000c ADC_ExternalTrigInjectedConvEdgeConfig -08010700 g F .text 0000004c InvPark -200029ac g O .bss 00000040 ParkParm -20000400 g .pstack 00000000 __main_thread_stack_base__ -0800cc60 g F .text 0000003c chVTDoSetI -08010de0 g F .text 00000058 conf_general_init -0800da90 g F .text 00000004 usbInit -0800caf0 w F .text 00000002 Vector104 -0800f180 g F .text 000000e8 usb_lld_start -0800caf0 w F .text 00000002 Vector184 -0800d850 g F .text 0000004c sduObjectInit -0800caf0 w F .text 00000002 Vector10C -0800fb60 g F .text 0000003a bldc_init -0800c13c g .text 00000000 _port_exit_from_isr -20001edc g O .bss 0000000c CtrlParm -0800c000 g startup 00000000 __init_array_start -080120f0 g F .text 00000026 TIM_BDTRConfig -08011560 g F .text 000000c0 hw_setup_adc_channels -0800ce70 g F .text 00000028 chSchIsPreemptionRequired -0800f860 g F .text 00000028 usb_lld_start_in -08012870 g F .text 000005e2 __kernel_rem_pio2f -0800f4c0 g F .text 0000001a usb_lld_get_status_out -0800f740 g F .text 000000f4 Vector14C -08011b20 g F .text 00000018 RCC_AHB1PeriphClockCmd -0800cf60 g F .text 00000050 _thread_init -0800caf0 w F .text 00000002 BusFault_Handler -0800caf0 w F .text 00000002 Vector50 -20000c40 g O .bss 00000258 ch -0800e450 g F .text 0000008c dmaStreamAllocate -2001c000 g .ram2 00000000 __ram2_free__ -0800caf0 w F .text 00000002 Vector194 -0800e3a0 g F .text 0000002c Vector154 -10000000 g .ram4 00000000 __ram4_free__ -08011ba0 g F .text 00000018 RCC_APB2PeriphResetCmd -08010cd0 g F .text 0000001c usb_uart_write -080121a0 g F .text 00000012 TIM_SelectSlaveMode -20002a50 g O .bss 00000258 SDU1 -08012f10 g F .text 00000090 floorf -0800d410 g F .text 00000052 chOQPutTimeout -20000000 g .mstack 00000000 __main_stack_base__ -0800caf0 w F .text 00000002 Vector44 -0800c408 g F .text 0000003a .hidden __aeabi_f2d -0800caf0 w F .text 00000002 Vector28 -0800fb30 g F .text 00000002 boardInit -0800caf0 w F .text 00000002 VectorB8 -080113d0 g F .text 00000190 hw_init_gpio -0800e250 g F .text 0000002c VectorFC -200028d0 g O .bss 00000024 PIParmQ -08010c80 g F .text 0000004c usb_uart_init -0800c148 g F .text 0000027a .hidden __subdf3 -08010f70 g F .text 000001a0 conf_general_read_mc_configuration -20000800 g .pstack 00000000 __process_stack_end__ -0800d840 g F .text 00000002 sduInit -0800caf0 w F .text 00000002 Vector34 -0800d2e0 g F .text 00000012 chIQResetI -0800fb20 g F .text 00000004 __early_init -0800e2e0 g F .text 0000002c Vector128 -0800caf0 w F .text 00000002 VectorA4 -0800f360 g F .text 00000160 usb_lld_init_endpoint -08010ac0 g F .text 00000148 mcpwm_adc_inj_int_handler -0800caf0 w F .text 00000002 Vector20 -0800caf0 w F .text 00000002 Vector18C -0800caf0 w F .text 00000002 Vector174 - - diff --git a/oroca_bldc_FW/build/oroca_bldc.elf b/oroca_bldc_FW/build/oroca_bldc.elf deleted file mode 100755 index 0f5f535..0000000 Binary files a/oroca_bldc_FW/build/oroca_bldc.elf and /dev/null differ diff --git a/oroca_bldc_FW/build/oroca_bldc.hex b/oroca_bldc_FW/build/oroca_bldc.hex deleted file mode 100755 index 3a5b3d8..0000000 --- a/oroca_bldc_FW/build/oroca_bldc.hex +++ /dev/null @@ -1,2073 +0,0 @@ -:020000040800F2 -:100000000004002001C00008F1CA0008F1CA00087D -:10001000F1CA0008F1CA0008F1CA0008F1CA0008D4 -:10002000F1CA0008F1CA0008F1CA000891D5000819 -:10003000F1CA0008F1CA0008F1CA0008D1F90008A5 -:10004000F1CA0008F1CA0008F1CA0008F1CA0008A4 -:10005000F1CA0008F1CA0008F1CA0008F1CA000894 -:10006000F1CA0008F1CA0008F1CA000801E100085D -:1000700031E1000861E1000891E10008C1E10008F8 -:10008000F1E1000821E20008310D010841E7000814 -:1000900081E70008F1E7000861E80008F1CA0008FC -:1000A000F1CA0008F1CA0008F1CA0008F1CA000844 -:1000B000F1CA000811F90008F1CA0008F1CA0008E5 -:1000C000F1CA000891EB000891EC0008F1CA0008A1 -:1000D000F1CA0008F1CA0008F1CA000891FA000844 -:1000E000510D0108F1CA0008F1CA0008F1CA000860 -:1000F000F1CA0008F1CA0008F1CA000851E200087C -:10010000F1CA0008F1CA0008F1CA0008F1CA0008E3 -:10011000F1CA0008F1CA0008F1CA0008110D01086F -:1001200081E20008B1E20008E1E2000811E3000802 -:1001300041E30008F1CA0008F1CA0008F1CA00084A -:10014000F1CA0008F1CA0008F1CA000841F7000826 -:1001500071E30008A1E30008D1E30008B1FA000848 -:10016000F1CA0008F1CA0008F1CA0008F1CA000883 -:10017000F1CA0008F1CA0008F1CA0008F1CA000873 -:10018000F1CA0008F1CA0008F1CA0008F1CA000863 -:10019000F1CA0008F1CA0008F1CA0008F1CA000853 -:1001A000F1CA0008F1CA0008F1CA0008F1CA000843 -:1001B000F1CA0008F1CA0008F1CA0008F1CA000833 -:10C0000072B6334880F3098840F20000CCF2000099 -:10C010004EF63471CEF200010860BFF34F8FBFF3CC -:10C020006F8F40F20000C0F2F0004EF68851CEF261 -:10C0300000010860BFF34F8FBFF36F8F4FF0000018 -:10C04000E1EE100A4EF63C71CEF2000108600620C7 -:10C0500080F31488BFF36F8F00F032FD03F060FDB2 -:10C060001C481D491D4A91423CBF41F8040BFAE7A8 -:10C070001B49174A91423CBF41F8040BFAE71949A2 -:10C08000194A1A4B9A423EBF51F8040B42F8040B6E -:10C09000F8E700201649174A91423CBF41F8040BCB -:10C0A000FAE700F015FD144C144DAC4203DA54F8D5 -:10C0B000041B8847F9E706F0CBF8114C114DAC4250 -:10C0C00003DA54F8041B8847F9E700F009BD0000C3 -:10C0D00000080020555555550000002000040020A0 -:10C0E00000040020483B0108000800203C0C002010 -:10C0F000400C0020282E002000C0000800C00008CE -:10C1000000C0000800C0000800000000000000009F -:10C110002DE9F04F2DED108AC1F80CD0D0F80CD0DD -:10C12000BDEC108ABDE8F08F002383F31188284608 -:10C13000A047002000F0E4FF00F002FF00DFFEE770 -:10C1400081F0004102E000BF83F0004330B54FEAC8 -:10C1500041044FEA430594EA050F08BF90EA020F35 -:10C160001FBF54EA000C55EA020C7FEA645C7FEAC8 -:10C17000655C00F0E2804FEA5454D4EB5555B8BFEB -:10C180006D420CDD2C4480EA020281EA030382EA5C -:10C19000000083EA010180EA020281EA0303362DEE -:10C1A00088BF30BD11F0004F4FEA01314FF4801CC1 -:10C1B0004CEA113102D0404261EB410113F0004FD3 -:10C1C0004FEA03334CEA133302D0524263EB43038A -:10C1D00094EA050F00F0A780A4F10104D5F1200E28 -:10C1E0000DDB02FA0EFC22FA05F2801841F1000183 -:10C1F00003FA0EF2801843FA05F359410EE0A5F157 -:10C2000020050EF1200E012A03FA0EFC28BF4CF087 -:10C21000020C43FA05F3C01851EBE37101F000453D -:10C2200007D54FF0000EDCF1000C7EEB00006EEB4A -:10C230000101B1F5801F1BD3B1F5001F0CD34908D4 -:10C240005FEA30004FEA3C0C04F101044FEA44522B -:10C2500012F5800F80F09A80BCF1004F08BF5FEAB2 -:10C26000500C50F1000041EB045141EA050130BD92 -:10C270005FEA4C0C404141EB010111F4801FA4F135 -:10C280000104E9D191F0000F04BF01460020B1FA8A -:10C2900081F308BF2033A3F10B03B3F120020CDAC2 -:10C2A0000C3208DD02F1140CC2F10C0201FA0CF0A0 -:10C2B00021FA02F10CE002F11402D8BFC2F1200C05 -:10C2C00001FA02F120FA0CFCDCBF41EA0C019040BB -:10C2D000E41AA2BF01EB0451294330BD6FEA040404 -:10C2E0001F3C1CDA0C340EDC04F11404C4F12002EF -:10C2F00020FA04F001FA02F340EA030021FA04F301 -:10C3000045EA030130BDC4F10C04C4F1200220FA57 -:10C3100002F001FA04F340EA0300294630BD21FA95 -:10C3200004F0294630BD94F0000F83F4801306BF5B -:10C3300081F480110134013D4EE77FEA645C18BF4F -:10C340007FEA655C29D094EA050F08BF90EA020FE6 -:10C3500005D054EA000C04BF1946104630BD91EADE -:10C36000030F1EBF0021002030BD5FEA545C05D1E1 -:10C370004000494128BF41F0004130BD14F5800420 -:10C380003CBF01F5801130BD01F0004545F0FE4194 -:10C3900041F470014FF0000030BD7FEA645C1ABFC9 -:10C3A000194610467FEA655C1CBF0B46024650EA00 -:10C3B000013406BF52EA033591EA030F41F400212C -:10C3C00030BD00BF90F0000F04BF0021704730B5B2 -:10C3D0004FF4806404F132044FF000054FF0000187 -:10C3E00050E700BF90F0000F04BF0021704730B548 -:10C3F0004FF4806404F1320410F0004548BF40421D -:10C400004FF000013EE700BF42004FEAE2014FEA71 -:10C4100031014FEA02701FBF12F07F4393F07F4F4C -:10C4200081F06051704792F0000F14BF93F07F4F7E -:10C43000704730B54FF4607401F0004521F00041C1 -:10C4400020E700BF50EA010208BF704730B54FF047 -:10C4500000050AE050EA010208BF704730B511F04C -:10C46000004502D5404261EB41014FF4806404F184 -:10C4700032045FEA915C3FF4DCAE4FF003025FEA06 -:10C48000DC0C18BF03325FEADC0C18BF033202EB8E -:10C49000DC02C2F1200300FA03FC20FA02F001FAE8 -:10C4A00003FE40EA0E0021FA02F11444C1E600BF87 -:10C4B00070B54FF0FF0C4CF4E06C1CEA11541DBF3A -:10C4C0001CEA135594EA0C0F95EA0C0F00F0DEF805 -:10C4D0002C4481EA030621EA4C5123EA4C5350EAEA -:10C4E000013518BF52EA033541F4801143F480133B -:10C4F00038D0A0FB02CE4FF00005E1FB02E506F0CC -:10C500000042E0FB03E54FF00006E1FB03569CF020 -:10C51000000F18BF4EF0010EA4F1FF04B6F5007F26 -:10C5200064F5407404D25FEA4E0E6D4146EB060698 -:10C5300042EAC62141EA55514FEAC52040EA5E5021 -:10C540004FEACE2EB4F1FD0C88BFBCF5E06F1ED8CB -:10C55000BEF1004F08BF5FEA500E50F1000041EB02 -:10C56000045170BD06F0004646EA010140EA0200AF -:10C5700081EA0301B4EB5C04C2BFD4EB0C0541EAD1 -:10C58000045170BD41F480114FF0000E013C00F3E6 -:10C59000AB8014F1360FDEBF002001F0004170BD0A -:10C5A000C4F10004203C35DA0C341BDC04F1140423 -:10C5B000C4F1200500FA05F320FA04F001FA05F2AF -:10C5C00040EA020001F0004221F0004110EBD3707C -:10C5D00021FA04F642EB06015EEA430E08BF20EAA8 -:10C5E000D37070BDC4F10C04C4F1200500FA04F34B -:10C5F00020FA05F001FA04F240EA020001F00041DD -:10C6000010EBD37041F100015EEA430E08BF20EA4F -:10C61000D37070BDC4F1200500FA05F24EEA020E97 -:10C6200020FA04F301FA05F243EA020321FA04F0C6 -:10C6300001F0004121FA04F220EA020000EBD3707D -:10C640005EEA430E08BF20EAD37070BD94F0000F7D -:10C650000FD101F00046400041EB010111F4801FB1 -:10C6600008BF013CF7D041EA060195F0000F18BF62 -:10C67000704703F00046520043EB030313F4801F9E -:10C6800008BF013DF7D043EA0603704794EA0C0F58 -:10C690000CEA135518BF95EA0C0F0CD050EA41066E -:10C6A00018BF52EA4306D1D181EA030101F00041EB -:10C6B0004FF0000070BD50EA410606BF1046194613 -:10C6C00052EA430619D094EA0C0F02D150EA01361F -:10C6D00013D195EA0C0F05D152EA03361CBF104660 -:10C6E00019460AD181EA030101F0004141F0FE41FF -:10C6F00041F470014FF0000070BD41F0FE4141F483 -:10C70000780170BD70B54FF0FF0C4CF4E06C1CEA82 -:10C7100011541DBF1CEA135594EA0C0F95EA0C0F37 -:10C7200000F0A7F8A4EB050481EA030E52EA0335F2 -:10C730004FEA013100F088804FEA03334FF0805513 -:10C7400045EA131343EA12634FEA022245EA111540 -:10C7500045EA10654FEA00260EF000419D4208BFF1 -:10C76000964244F1FD0404F5407402D25B084FEA9E -:10C770003202B61A65EB03055B084FEA32024FF44A -:10C7800080104FF4002CB6EB020E75EB030E22BFA7 -:10C79000B61A754640EA0C005B084FEA3202B6EB67 -:10C7A000020E75EB030E22BFB61A754640EA5C0016 -:10C7B0005B084FEA3202B6EB020E75EB030E22BFA6 -:10C7C000B61A754640EA9C005B084FEA3202B6EBA7 -:10C7D000020E75EB030E22BFB61A754640EADC0066 -:10C7E00055EA060E18D04FEA051545EA16754FEAC8 -:10C7F00006164FEAC30343EA52734FEAC2025FEAE6 -:10C800001C1CC0D111F4801F0BD141EA00014FF074 -:10C8100000004FF0004CB6E711F4801F04BF014345 -:10C820000020B4F1FD0C88BFBCF5E06F3FF6AFAE61 -:10C83000B5EB030C04BFB6EB020C5FEA500C50F1F1 -:10C84000000041EB045170BD0EF0004E4EEA113174 -:10C8500014EB5C04C2BFD4EB0C0541EA045170BD7B -:10C8600041F480114FF0000E013C90E645EA060EBF -:10C870008DE60CEA135594EA0C0F08BF95EA0C0FED -:10C880003FF43BAF94EA0C0F0AD150EA01347FF435 -:10C8900034AF95EA0C0F7FF425AF104619462CE70C -:10C8A00095EA0C0F06D152EA03353FF4FDAE10466F -:10C8B000194622E750EA410618BF52EA43067FF4C0 -:10C8C000C5AE50EA41047FF40DAF52EA43057FF450 -:10C8D000EBAE12E7000000000000000000000000C6 -:10C8E0004FEA4102B2F1E04324BFB3F5001CDCF192 -:10C8F000FE5C0DD901F0004C4FEAC0024CEA5070CA -:10C90000B2F1004F40EB830008BF20F001007047F8 -:10C9100011F0804F21D113F13872BCBF01F00040FB -:10C92000704741F480114FEA5252C2F11802C2F12D -:10C93000200C10FA0CF320FA02F018BF40F00100AE -:10C940004FEAC1234FEAD32303FA0CFC40EA0C0060 -:10C9500023FA02F34FEA4303CCE77FEA625307D19D -:10C9600050EA01331EBF4FF0FE4040F440007047D4 -:10C9700001F0004040F0FE4040F40000704700BF6E -:10C98000844641EA000313F003036DD1403A41D3DA -:10C9900051F8043B40F8043B51F8043B40F8043B99 -:10C9A00051F8043B40F8043B51F8043B40F8043B89 -:10C9B00051F8043B40F8043B51F8043B40F8043B79 -:10C9C00051F8043B40F8043B51F8043B40F8043B69 -:10C9D00051F8043B40F8043B51F8043B40F8043B59 -:10C9E00051F8043B40F8043B51F8043B40F8043B49 -:10C9F00051F8043B40F8043B51F8043B40F8043B39 -:10CA000051F8043B40F8043B51F8043B40F8043B28 -:10CA1000403ABDD2303211D351F8043B40F8043BC8 -:10CA200051F8043B40F8043B51F8043B40F8043B08 -:10CA300051F8043B40F8043B103AEDD20C3205D3D8 -:10CA400051F8043B40F8043B043AF9D2043208D0D0 -:10CA5000D2071CBF11F8013B00F8013B01D30B8842 -:10CA600003806046704700BF082A13D38B078DD020 -:10CA700010F003038AD0C3F10403D21ADB071CBFF2 -:10CA800011F8013B00F8013B80D331F8023B20F85C -:10CA9000023B7BE7043AD9D3013A11F8013B00F895 -:10CAA000013BF9D20B7803704B7843708B7883701D -:10CAB0006046704700000000000000000000000019 -:10CAC000704700BFAFF30080AFF30080AFF300808A -:10CAD000704700BFAFF30080AFF30080AFF300807A -:10CAE000FEE700BFAFF30080AFF30080AFF300803C -:10CAF000FEE700BFAFF30080AFF30080AFF300802C -:10CB0000FEE700BFAFF30080AFF30080AFF300801B -:10CB1000204B214A2148F0B500249C60DF68204E5C -:10CB2000204D4FF6FF0139400A43DA60F26842F0C7 -:10CB30008072F2600268202142F001021026026039 -:10CB400083B0DE7783F8221000F0FAF800F078F86E -:10CB500000F05EFB00F0D4FC00F00AFD2846402106 -:10CB600000F0FEF9A5F1300301229861027784F309 -:10CB7000118862B69B690C49996105F150000094D7 -:10CB80004FF4EC71094B00F04BFA094B836103B091 -:10CB9000F0BD00BF00ED00E00003FA05001000E06A -:10CBA000F0ED00E0700C00209031010801CB00088E -:10CBB00080310108AFF30080AFF30080AFF3008055 -:10CBC000F8B5134DAA69D37F0BB1013BD377116A36 -:10CBD000EB69104E01311162AA6AB34202F10102FF -:10CBE000AA6213D09C68013C9C607CB920271A681B -:10CBF000D968DC605660EA6184F311881869884757 -:10CC000087F31188EB699A68002AF0D0F8BD00BF5D -:10CC1000400C00205C0C0020AFF30080AFF30080DC -:10CC2000034A516853685B1A9842FBD8704700BFAB -:10CC3000001000E0AFF30080AFF30080AFF300809E -:10CC4000054B4FF0FF3003F11C020021586299623E -:10CC5000DA611A62704700BF400C0020AFF3008019 -:10CC600070B40D4EF469A5680361A942C26004D98D -:10CC70002468491BA5688D42FAD363684360046049 -:10CC8000186060608160A3684FF0FF32591AA1609C -:10CC9000726270BC704700BF400C0020AFF3008090 -:10CCA00003688268416830B49D68064C2A449A60E3 -:10CCB0000B60056800224FF0FF336960C260636259 -:10CCC00030BC7047400C0020AFF30080AFF3008011 -:10CCD00010B4202383F31188037F072B0ED8DFE8DD -:10CCE00003F0270D0D2308040D08426A93680133F1 -:10CCF000936090E80C001A60026853604FF0FF34B4 -:10CD0000002281680D4B446202771B689A688A4250 -:10CD1000FBD25A684260036000211060586081F3C2 -:10CD200011885DF8044B7047436A00221A60E5E7FA -:10CD3000002383F311885DF8044B7047400C0020FA -:10CD4000034B00221B605B601B615B619A60704754 -:10CD5000400C0020AFF30080AFF30080AFF3008001 -:10CD600000228168084B10B4044602771B689A6859 -:10CD70008A42FBD25A6862602360204614605C607D -:10CD80005DF8044B704700BF400C0020AFF30080FB -:10CD9000084B30B41A689969146808770125042093 -:10CDA000C877636015771C60104630BC9A61FFF746 -:10CDB000AFB900BF400C0020AFF30080AFF300809C -:10CDC00030B54B1C87B012D00C4C0D4AA3690546F8 -:10CDD00001A8FFF745FF2846FFF7DAFF049B13B1D0 -:10CDE00001A8FFF75DFFA369586A07B030BD034C87 -:10CDF000FFF7CEFFA369586A07B030BD400C002092 -:10CE0000D1CC0008AFF30080AFF30080AFF3008017 -:10CE1000144B70B49E6984680546B06869628442A8 -:10CE20004FF000020BD82A771B689A689442FBD90E -:10CE30005A686A602B6015605D6070BC704732771D -:10CE40001A46126891688842FBD9506870600124C4 -:10CE50003260066056602C77314628469D6170BC72 -:10CE6000FFF756B9400C0020AFF30080AFF300800D -:10CE7000084B9A691B68D17F9B68906821B98342EF -:10CE800034BF002001207047834294BF002001205E -:10CE9000704700BF400C0020AFF30080AFF300806C -:10CEA0000E4A1068F0B403689469136001270426E1 -:10CEB0000025A1685A6007779061E677257700E042 -:10CEC0001B689A688A42FBD25A68626023602146D6 -:10CED00014605C60F0BCFFF71BB900BF400C002081 -:10CEE0000D4A106870B40368946913600126002528 -:10CEF000A1685A6006779061257700E01B689A6800 -:10CF00008A42FBD85A6862602360214614605C60E4 -:10CF100070BCFFF7FDB800BF400C0020AFF30080ED -:10CF2000044B1A689B6992689B689A4200D87047C4 -:10CF3000FFF7D6BF400C0020AFF30080AFF30080B6 -:10CF4000034B9B69DB7F0BB1FFF7CABFFFF7A8BF9D -:10CF5000400C0020AFF30080AFF30080AFF30080FF -:10CF60002DE9F041114C016466694661002200F12F -:10CF70002C054FF002084FF0040C4FF0010E00F1A9 -:10CF800028078160046180F81C8080F81FC080F849 -:10CF90001EE04277C2638263026282613061606137 -:10CFA0008762C5620563BDE8F08100BF400C0020C8 -:10CFB0002DE9F04F6439184FDFF86090D7F814E08E -:10CFC000099E01440025C1604FF0020B0B644FF035 -:10CFD000040A00F12C034FF0010800F1280C4E6404 -:10CFE000C1F8609082600761C0F814E0026480F8C4 -:10CFF0001CB080F81FA080F81E804577C56385634C -:10D0000005628561CEF81000C0F828C07861C3625F -:10D010000363BDE8F08F00BF400C002029C1000869 -:10D020002DE9F84F0446202585F311881A4EDFF8C4 -:10D030006CA0776964390144C16000250B6400F17C -:10D040002C0B4FF0010C00F1280E0A9B4B644FF0A3 -:10D0500002094FF00408C1F860A0826006614761D0 -:10D06000026480F81C9080F81F8080F81EC045770D -:10D07000C56385630562856129463861C0F828E08B -:10D08000C0F82CB0C0F830B07061FFF7C1FE85F376 -:10D0900011882046BDE8F88F400C002029C1000807 -:10D0A00008B50146202383F311880820FFF788FE86 -:10D0B000002383F3118808BDAFF30080AFF3008035 -:10D0C00038B50E4B9C69A36A606204F128059D4245 -:10D0D00007D01A68A2621846FFF742FEA36AAB4265 -:10D0E000F7D1637F9B0704D1636922691A612269C2 -:10D0F00053610F20BDE83840FFF74ABE400C0020C6 -:10D10000202383F31188FFF7DBBF00BFAFF300805C -:10D1100010B5054CA369036002465A620320FFF76D -:10D1200037FEA369586A10BD400C0020AFF30080A1 -:10D1300003682BB10022026018465962FFF710BE47 -:10D14000704700BFAFF30080AFF30080AFF3008003 -:10D1500069B1084B10B4024644689B69042083E817 -:10D160001400236053605DF8044BFFF729BE4FF0B5 -:10D17000FF307047400C0020AFF30080AFF3008019 -:10D1800038B50368984204460D4609D01A682260F3 -:10D19000184654605D62FFF7E3FD23689C42F5D1B9 -:10D1A00038BD00BFAFF30080AFF30080AFF3008065 -:10D1B000014B5B6883607047001000E0AFF30080B4 -:10D1C0000F4B10495A688368F0B48F6FC668416886 -:10D1D000D0E90445D31ADB1BE41845F100050136FC -:10D1E0008B42C6608360C0E9044505D8026893425B -:10D1F00038BF0360F0BC70474360F0BC704700BFAD -:10D20000001000E0400C0020AFF30080AFF300807E -:10D21000D0B50C4C86B000234FF0FF326846002694 -:10D220000027A3670193029303930092CDE904675B -:10D23000FFF7BEFF6846FFF7C3FF029BA36706B078 -:10D24000D0BD00BF400C0020AFF30080AFF30080E2 -:10D250000023006040608360704700BFAFF3008030 -:10D26000836B027F19430A2A81630AD00B2A00D0FC -:10D270007047436A19408B42FAD100234362FFF79B -:10D280006FBD436A1942F8D1704700BFAFF3008009 -:10D2900070B50468A04206460D460DD0E3682B43E6 -:10D2A000E36015B12269134203D06068A168FFF7FB -:10D2B000D7FF2468A642F1D170BD00BFAFF3008054 -:10D2C00030B4029C046200250A448560026100605B -:10D2D0004060C16081614161C36130BC704700BF83 -:10D2E0000021C2688160826142616FF00101FFF735 -:10D2F00047BF00BFAFF30080AFF30080AFF3008003 -:10D3000070B520230E46044683F31188C3692BB100 -:10D31000984703E0FFF71CFF002815DBA5682046AF -:10D320003146002DF6D0A169A36825694A1C013B4E -:10D33000AA42A360A26128BFE368087828BFA3615E -:10D34000002383F3118870BD85F3118870BD00BF81 -:10D350002DE9F04F044683B0894693461D46D0F828 -:10D360001C80202787F3118800260197B246B8F168 -:10D37000000F05D02046C04702E0FFF7E9FEE0B904 -:10D38000A76820462946002FF7D0A269A368511C40 -:10D39000013BA161A360137809F8013B2369A269ED -:10D3A0009A4224BFE368A3618AF311880136B3452A -:10D3B00005D0019B83F31188D9E787F311883046A4 -:10D3C00003B0BDE8F08F00BFAFF30080AFF3008083 -:10D3D00030B4029C04628D18056100604060826078 -:10D3E000C16081614161C36130BC7047AFF30080AF -:10D3F00010B40269C4688461121B44616FF00101BA -:10D4000082605DF8044BFFF7BBBE00BFAFF3008046 -:10D41000F8B504460F461646202383F3118803E02F -:10D42000FFF796FE002819DBA56820463146002D3F -:10D43000F6D06269A368511C013B6161A36017705B -:10D44000236962699A4224BFE3686361E3690BB1AF -:10D4500020469847002080F31188F8BD85F3118895 -:10D46000F8BD00BFAFF30080AFF30080AFF30080E2 -:10D470002DE9F04F83B004468B4615460193C769EA -:10D480004FF0200888F311880026B146A3680BF1FD -:10D49000010A2046FBB16269A368511C013B61612E -:10D4A000A3609BF800301370236962699A4224BF1D -:10D4B000E368636107B1B84789F31188013D06F15C -:10D4C000010612D088F31188A368D3460BF1010A34 -:10D4D0002046002BDFD1204601990093FFF738FE4C -:10D4E000009B0028D2D083F31188304603B0BDE8FA -:10D4F000F08F00BFAFF30080AFF30080AFF3008088 -:10D50000054A064B0648074922F0070223F00703A5 -:10D5100002600B60704700BF2F2E00200000022029 -:10D520009C0E0020980E0020AFF30080AFF3008027 -:10D5300010B4202383F31188094C0A4B2268196820 -:10D54000C31D23F00703891A8B429DBF9B182360DC -:10D5500010460020002383F311885DF8044B7047C8 -:10D560009C0E0020980E0020AFF30080AFF30080E7 -:10D57000044B054A1A6003F1100000229A60DA6039 -:10D58000FFF766BEA00E002031D50008AFF3008083 -:10D59000064A536823F001035360EFF309836833AD -:10D5A00083F30988002383F31188704730EF00E08C -:10D5B000202383F31188124B5B6813F4006302D1BC -:10D5C00083F31188704710B5F1EE103AEFF3098438 -:10D5D0000C4B4FF08072DB6844F8083C44F84C2C4C -:10D5E000A4F1680383F30988FFF742FC18B1064BE6 -:10D5F00044F8503C10BD054B44F8503C10BD00BFF2 -:10D6000000ED00E030EF00E039C100083CC1000847 -:10D6100008B500F065FF0A4801F07AF900F018F843 -:10D6200000F046F800F054F800F022FA00F030FA6A -:10D6300000F006F902F07CFABDE8084000F010BAEC -:10D6400010330108AFF30080AFF30080AFF3008028 -:10D6500001F046B9AFF30080AFF30080AFF3008074 -:10D66000F0B500F1080200F110034FF0010C4FF08B -:10D67000000E00F1180700F11C0600F1200500F172 -:10D68000240400F1280180F800C0C0F804E087619C -:10D69000C6610562446281628260C2600361436167 -:10D6A000F0BD00BFAFF30080AFF30080AFF30080A8 -:10D6B00001F05EBBAFF30080AFF30080AFF30080FA -:10D6C00001220023027043600C30FFF7C1BD00BF90 -:10D6D00002F06EB9AFF30080AFF30080AFF30080CB -:10D6E0000122002302704360704700BFAFF3008047 -:10D6F00010B5046AD4F8542213681978042900D0AC -:10D7000010BD217A0229FBD111791A8901238B409E -:10D710001A40F5D1216CE36BA06BCB1A1B1AEFD02A -:10D7200082F31188D4F854221068117904F1300280 -:10D7300000F00EFA202383F31188D4F85432BDE8A8 -:10D7400010401868197900F02BBA00BFAFF30080C1 -:10D7500038B5046AD4F8542213681978042900D023 -:10D7600038BD217A0229FBD15079598903EB800316 -:10D770000122DB6882400A405B8AF1D1A169E0693D -:10D780006569401A411B8B42EAD882F31188B1FBCC -:10D79000F3F1D4F8542203FB01F31068517904F13A -:10D7A0000C0200F0C5F9202383F31188D4F8543219 -:10D7B00018685979BDE8384000F0DAB9AFF3008055 -:10D7C0000C30FFF7C5BD00BFAFF30080AFF30080A2 -:10D7D0000C304FF0FF33FFF7BBBD00BFAFF300804D -:10D7E0003030FFF745BE00BFAFF30080AFF30080DD -:10D7F00030304FF0FF33FFF73BBE00BFAFF3008088 -:10D800000C30FFF77DBD00BFAFF30080AFF30080A9 -:10D810000C304FF0FF31FFF773BD00BFAFF3008056 -:10D820003030FFF7F5BD00BFAFF30080AFF30080ED -:10D8300030304FF0FF32FFF7EBBD00BFAFF3008099 -:10D84000704700BFAFF30080AFF30080AFF30080FC -:10D8500010B503460E4A43F8042B82B00446012259 -:10D86000009004F15401436002720A4B0C304FF4F3 -:10D870008072FFF725FD009404F1300004F5AA71D1 -:10D880004FF48072044BFFF7A3FD02B010BD00BF40 -:10D89000B031010851D70008F1D60008AFF300807D -:10D8A0000B68202282F311880A7903EB82029061CF -:10D8B0004A79093243F822008A7912B103EB8203D4 -:10D8C000986102230372C0F85412002383F3118875 -:10D8D000704700BFAFF30080AFF30080AFF300806C -:10D8E00070B5D0F8543200F10C06044630461D687D -:10D8F000FFF7F6FC04F13000FFF77AFD201D01214F -:10D90000FFF7C6FCD4F85432597905EB8103284659 -:10D91000DB6832465B8A00F00BF9D4F854322846B3 -:10D920005979BDE8704000F023B900BFAFF3008023 -:10D9300090F8443003F06003202B01D000207047A2 -:10D9400090F84530212B03D0222B09D0202BF5D184 -:10D95000064B836307220023C263036401207047E0 -:10D9600000238363C3630364012070470008002021 -:10D97000F8B500EB81039C69BCB10E460546202733 -:10D9800087F311880821201DFFF782FC226CE36BCE -:10D99000A16BD31A5B1A10D105EB8603DB685A69B9 -:10D9A00052681AB9002383F31188F8BD1B8A013B22 -:10D9B0001340F7D183F3118802E0002282F311882B -:10D9C00004F130022846314600F0C2F887F311888E -:10D9D0002846314600F0E4F8E4E700BFAFF30080EA -:10D9E0002DE9F84301F1090350F82360BEB18046E8 -:10D9F0000F464FF0200989F3118804217018FFF7B2 -:10DA000047FC08EB8703B469DA68F5697369518AE2 -:10DA10002D1BEC1AA14204D9002383F31188BDE821 -:10DA2000F883002383F31188B4FBF1F306F10C02B1 -:10DA300001FB03F34046394600F07AF889F3118878 -:10DA40004046394600F094F8E6E700BFAFF30080A7 -:10DA5000704700BFAFF30080AFF30080AFF30080EA -:10DA600001F0C6BFAFF30080AFF30080AFF30080DA -:10DA700002F02EB8AFF30080AFF30080AFF3008068 -:10DA8000002301220270437083704360704700BF1F -:10DA900001F05EBBAFF30080AFF30080AFF3008016 -:10DAA0000023012202704360C36183620362C36288 -:10DAB0004362036303814381704700BFAFF300807B -:10DAC00038B50446202383F3118800254160C560E2 -:10DAD00005614561856101F053FB0223237085F3E5 -:10DAE000118838BDAFF30080AFF30080AFF3008042 -:10DAF00070B50646506914460D4618B1002114222F -:10DB000005F0EEFAA06918B10021142205F0E8FA38 -:10DB100006EB85033046DC602946BDE8704001F025 -:10DB20001FBC00BFAFF30080AFF30080AFF30080F5 -:10DB300070B400EB81040126E468A4690025E2606A -:10DB400063602670A56070BC01F0EABCAFF3008092 -:10DB500070B400EB81040126E46864690025E2608A -:10DB600063602670A56070BC01F05ABDAFF3008001 -:10DB7000012270B502FA01F344899BB213EA04064C -:10DB800001D0104670BD2343438101F059FE304659 -:10DB900070BD00BFAFF30080AFF30080AFF3008033 -:10DBA000012270B502FA01F304899BB213EA04065C -:10DBB00001D0104670BD2343038101F051FE304671 -:10DBC00070BD00BFAFF30080AFF30080AFF3008003 -:10DBD000002202210170A0F84C2080F84E2080F82D -:10DBE0004F2002814281C26002614261826180F8FD -:10DBF000342001F03DBB00BFAFF30080AFF30080E5 -:10DC0000F8B50023044680F8343000F1440201F0F6 -:10DC100077FC63689B6863B32046984748B3E56B1D -:10DC200094F8443094F84B1094F84A2042EA0122C8 -:10DC3000AA423CBFE263154613F0800FE36840F050 -:10DC40008880002D6DD15B69052284F83420204640 -:10DC50001D70DD605D609D60294601F0E1FC2023C0 -:10DC600083F3118820462946FFF79AFF85F3118830 -:10DC7000F8BD94F8443013F0600711D0204600211D -:10DC800001F016FE2046002101F002FE63681B68C9 -:10DC900013B1204605219847062384F83430F8BD97 -:10DCA00094F8455003F07F0242EA0526B6F5407F1E -:10DCB00000F0008117D9B6F5C06F00F0E28077D987 -:10DCC000B6F5106F00F0878040F60242964200F0F1 -:10DCD0000481B6F5006FD1D104F14F02012527640C -:10DCE000A263E5639EE7022E00F0B48040F2A980B3 -:10DCF000B6F5807F00F09580B6F5817FBED194F8AF -:10DD00004620002ABAD194F8482012F00F015DD0C5 -:10DD10001206204600F1098101F0DAFD94F8443042 -:10DD200054E09B69A26B0026042184F8341020463D -:10DD3000DA605D601E709E60314601F0F1FB2023C9 -:10DD400083F3118820463146FFF712FF86F31188CE -:10DD5000F8BDBDB15B69A26B0026012184F83410C7 -:10DD60002046DA605D601E709E60314601F058FC0E -:10DD7000202383F3118820463146FFF711FF86F3F5 -:10DD80001188F8BD9B69032284F8342020461D7059 -:10DD9000DD605D609D60294601F0C2FB202383F3B6 -:10DDA000118820462946FFF7E3FE85F31188F8BD68 -:10DDB00040F20232964221D0B6F5A06F7FF45EAFFA -:10DDC000B4F84420B2F5A06F00F09D800025A56353 -:10DDD000E563256426E794F8462084F84F20002A5E -:10DDE00040F082800322227062681268002AEDD01F -:10DDF00020460221904794F84430E7E794F8462003 -:10DE0000002A7FF43BAF94F8482012F00F01DDD0D8 -:10DE10001306204600F18E8001F03AFD94F844305C -:10DE2000D4E794F84620012A7FF428AFB4F84C20B8 -:10DE3000A76322F00202E76327643D46A4F84C2062 -:10DE4000F0E6002E46D104F14C0202252664A263BE -:10DE5000E563E7E694F8481011F0800F204601F0E2 -:10DE60000F0144D101F02CFB012844D002287FF49B -:10DE700005AF334BA363E0632764054694F8443051 -:10DE8000D0E6626894F8490094F84830556894F8F0 -:10DE9000471094F8462043EA00232046A84700286C -:10DEA0003FF4ECAE43680568E563A363276494F828 -:10DEB0004430B7E694F84620012A7FF4DFAEB4F888 -:10DEC0004C20A76342F00202E76327643D46A4F8B2 -:10DED0004C20A7E6012E7FF4D1AE1A4AA263022598 -:10DEE0000022E56322649DE6042222707CE701F0B3 -:10DEF000F7FA0128BAD1144BA363E66327643546C9 -:10DF000094F844308EE694F8463084F84E3020463B -:10DF100001F016FA63681B6813B120460121984787 -:10DF2000032294F84430227050E701F0E1FC94F8A9 -:10DF300044304BE701F0BCFC94F8443046E700BFA6 -:10DF4000E0310108D0310108F0310108AFF3008061 -:10DF500038B590F834300446062B15D8DFE803F0C6 -:10DF600004341C0404150400002101F0A1FC204627 -:10DF7000002101F08DFC63681B6813B12046052168 -:10DF80009847062384F8343038BD036C03B19847B2 -:10DF9000002384F8343038BDC3689B690025032210 -:10DFA00084F8342029461D70DD605D609D60204648 -:10DFB00001F0B6FA202383F3118820462946FFF7A3 -:10DFC000D7FD85F3118838BD90F84B2090F84A3082 -:10DFD000C16B43EA02238B42C368DED91D8AB1FBC1 -:10DFE000F5F205FB1215002DD7D15B6929461D708E -:10DFF000DD605D609D6001F013FB202383F31188D9 -:10E0000020462946FFF7CCFD85F31188022384F8CA -:10E01000343038BDAFF30080AFF30080AFF3008041 -:10E0200090F83420062A38B50AD80123934013F01B -:10E03000670F044611D113F0080502D1DB061DD489 -:10E0400038BDC3689B699B68002BF9D1036C03B191 -:10E050009847002384F8343038BD002101F028FCB3 -:10E060002046002101F014FC63681B6813B12046B0 -:10E0700005219847062384F8343038BDC3685B69AE -:10E08000052280F8342029461D70DD605D609D60AA -:10E0900001F0C6FA202383F3118820462946FFF7B2 -:10E0A0007FFD85F3118838BDAFF30080AFF30080AA -:10E0B00043099B0010B403F1604300F1604404F590 -:10E0C000614403F56143090100F01F000122824011 -:10E0D000C9B284F80013C3F880211A605DF8044BBC -:10E0E000704700BFAFF30080AFF30080AFF3008054 -:10E0F00000F1604000F56D400901C9B2017670473A -:10E1000008B5074B074A196801F03D01996013688B -:10E110000BB150689847BDE80840FFF749BA00BF07 -:10E1200000600240C00E0020AFF30080AFF300801B -:10E13000084B094819688268890901F03D0110B54A -:10E140008C019C600AB1C0689047BDE81040FFF7A1 -:10E150002FBA00BF00600240C00E0020AFF3008065 -:10E16000084B094819680269090C01F03D0110B516 -:10E170000C049C600AB140699047BDE81040FFF76D -:10E1800017BA00BF00600240C00E0020AFF300804D -:10E19000084B094819688269890D01F03D0110B5E5 -:10E1A0008C059C600AB1C0699047BDE81040FFF73C -:10E1B000FFB900BF00600240C00E0020AFF3008036 -:10E1C00008B5074B07485968026A01F03D01D9605C -:10E1D0000AB1406A9047BDE80840FFF7E9B900BFBF -:10E1E00000600240C00E0020AFF30080AFF300805B -:10E1F000084B09485968826A890901F03D0110B548 -:10E200008C01DC600AB1C06A9047BDE81040FFF79E -:10E21000CFB900BF00600240C00E0020AFF3008005 -:10E22000084B09485968026B090C01F03D0110B513 -:10E230000C04DC600AB1406B9047BDE81040FFF76A -:10E24000B7B900BF00600240C00E0020AFF30080ED -:10E25000084B09485968826B890D01F03D0110B5E2 -:10E260008C05DC600AB1C06B9047BDE81040FFF739 -:10E270009FB900BF00600240C00E0020AFF30080D5 -:10E2800008B5074B07481968026C01F03D01996019 -:10E290000AB1406C9047BDE80840FFF789B900BF5C -:10E2A00000640240C00E0020AFF30080AFF3008096 -:10E2B000084B09481968826C890901F03D0110B5C5 -:10E2C0008C019C600AB1C06C9047BDE81040FFF71C -:10E2D0006FB900BF00640240C00E0020AFF30080A1 -:10E2E000084B09481968026D090C01F03D0110B591 -:10E2F0000C049C600AB1406D9047BDE81040FFF7E8 -:10E3000057B900BF00640240C00E0020AFF3008088 -:10E31000084B09481968826D890D01F03D0110B55F -:10E320008C059C600AB1C06D9047BDE81040FFF7B6 -:10E330003FB900BF00640240C00E0020AFF3008070 -:10E3400008B5074B07485968026E01F03D01D960D6 -:10E350000AB1406E9047BDE80840FFF729B900BFF9 -:10E3600000640240C00E0020AFF30080AFF30080D5 -:10E37000084B09485968826E890901F03D0110B5C2 -:10E380008C01DC600AB1C06E9047BDE81040FFF719 -:10E390000FB900BF00640240C00E0020AFF3008040 -:10E3A000084B09485968026F090C01F03D0110B58E -:10E3B0000C04DC600AB1406F9047BDE81040FFF7E5 -:10E3C000F7B800BF00640240C00E0020AFF3008029 -:10E3D000084B09485968826F890D01F03D0110B55D -:10E3E0008C05DC600AB1C06F9047BDE81040FFF7B4 -:10E3F000DFB800BF00640240C00E0020AFF3008011 -:10E400000D4B30B400220D4D0D4C1A6011461346D1 -:10E41000A858016044F833100133102B02F10C02AC -:10E42000F6D10849084A4FF0FF338B6030BCCB600F -:10E430009360D360704700BF400F00200032010896 -:10E44000C00E00200060024000640240AFF3008074 -:10E45000F8B51F4F467A3D68012404FA06FE1EEA0D -:10E46000050F31D11B4C4EEA050504EBC60C15F027 -:10E47000FF0F3D6044F83620CCF8043004D0164C31 -:10E48000236B43F40013236315F47F4F16D1056803 -:10E490002B6823F01F032B602B6813F00104FBD1C2 -:10E4A000077A46683D23BB40212733602C606F61AB -:10E4B00062B1807AFFF7FCFD2046F8BD064C236B65 -:10E4C00043F480032363E2E72046F8BD1046F8BD1D -:10E4D000400F0020C00E002000380240AFF3008043 -:10E4E000174B4FF0FF311A69002210B419611A61FD -:10E4F000586959615A61186A124C60F0805018626C -:10E500001A62586A59625A62196C41F08051196452 -:10E51000216841F480712160196F01F44071B1F5F7 -:10E52000007F03D04FF4803119671A67054A5DF800 -:10E53000044B536823F400735360FFF761BF00BFBF -:10E540000038024000700040AFF30080AFF300805D -:10E550002C492D4B4FF080504FF4404208641A6014 -:10E560000B6843F001030B600A68264B9007FBD54C -:10E570009A6822F003029A609A689A6019468B683A -:10E58000204A13F00C03FAD1116801F0F90111606F -:10E590009360136843F4803313601168194B890347 -:10E5A000FBD55A6F42F001025A675A6F154990071E -:10E5B000FBD5164B4B600B68134A43F080730B601E -:10E5C00053685904FCD50F490A680E4B9201FBD5DC -:10E5D0000F4A1049996040F2057111609A6842F043 -:10E5E00002029A601A469368064903F00C03082B4E -:10E5F000F9D14B6C43F480434B644B6E43F480433E -:10E600004B667047003802400070004008544007D5 -:10E61000003C024000940838AFF30080AFF3008064 -:10E62000F0B5434C434D236C43F000732364D5F89D -:10E6300000321B0C1B0443F0010343EA0023C5F81E -:10E64000003200294ED00023C5F81C321846C5F808 -:10E6500004321C46C5F80C32C5F81432C30003F16D -:10E66000804303F5C84301301C28C3F84042C3F877 -:10E670004442F3D12F480026012715681479EB0096 -:10E6800003F1804314F0010F03F5C84306F10106BE -:10E6900007FA05F505D0D0F804E245EA0E0EC0F8F9 -:10E6A00004E214F0020F05D0D0F80CE245EA0E0E99 -:10E6B000C0F80CE2640704D5D0F814422C43C0F82B -:10E6C00014429468C3F84042D468C3F84442D0F876 -:10E6D0001C328E4243EA050302F11002C0F81C32DC -:10E6E000CBD118E0C20002F18042012302F5C842FA -:10E6F000834043F00103C5F84012C5F84412C2F844 -:10E700004012C2F84412C5F80412C5F81412C5F834 -:10E710000C32C5F81C320749054AD1F8003223F003 -:10E720000103C1F80032136C23F000731364F0BDD1 -:10E730000038024000640040AFF30080AFF3008077 -:10E7400010B50C4C0C49E26A2023916083F31188C8 -:10E75000002104F10800FEF713FD04F11C00012163 -:10E76000FEF796FD002383F31188BDE81040FEF705 -:10E770001FBF00BF440F002001010100AFF3008064 -:10E7800038B5164DEB6ADC68A20711D1E3060BD54C -:10E79000EB6A1021D960202383F311881048FEF71B -:10E7A00077FD002383F31188BDE83840FEF700BFF2 -:10E7B0005A6922F002025A61202383F31188002152 -:10E7C00005F11000FEF7DCFC05F118000121FEF751 -:10E7D0005FFD002383F31188D8E700BF440F0020BA -:10E7E000640F0020AFF30080AFF30080AFF3008030 -:10E7F00038B5164DEB6A1C69A20711D1E3060BD59B -:10E80000EB6A10211961202383F311881048FEF769 -:10E810003FFD002383F31188BDE83840FEF7C8BEF2 -:10E820005A6922F010025A61202383F311880021D3 -:10E8300005F11000FEF7A4FC05F118000221FEF717 -:10E8400027FD002383F31188D8E700BF440F002081 -:10E85000640F0020AFF30080AFF30080AFF30080BF -:10E8600038B51B4DEB6A5C681C225A6022071DD428 -:10E87000630717D5EA6A9369916921F07001916184 -:10E8800013F0700F03F0070118BF41F008012022B8 -:10E8900082F311880F4841EA0341FEF7F9FC002397 -:10E8A00083F31188BDE83840FEF782BE1A68284617 -:10E8B00022F00202032100F8281B20211A6081F3B4 -:10E8C00011880021FEF7E4FC002383F31188CFE7D1 -:10E8D000440F0020640F0020AFF30080AFF30080EE -:10E8E00010B5064C2046FEF7BBFE0021044BE36248 -:10E8F0000A460E20BDE81040FFF792BE440F0020EC -:10E9000000640040AFF30080AFF30080AFF30080FD -:10E910002DE9F04FDFF8B481DFF8B4C1D8F830A0AA -:10E92000DFF8B0E1634F644E644D654C6549664A5B -:10E93000DFF8A4B140F2FF194AEA090AC8F830A08A -:10E94000D8F850A04AEA0909C8F850904368CCF8B2 -:10E9500004308368CCF80830C368CCF80C30036905 -:10E96000CCF814304369CCF820308369CCF82430DB -:10E970000368CCF80030036ACEF80430436ACEF85E -:10E980000830836ACEF80C30C36ACEF81430036BBB -:10E99000CEF82030436BCEF82430C369CEF8003077 -:10E9A000C36B7B60036CBB60436CFB60836C7B61FF -:10E9B000C36C3B62036D7B62836B3B60876D7760EA -:10E9C000C76DB760076EF760476E7761876E376215 -:10E9D000C76E7762476D3760466F6E60866FAE6058 -:10E9E000C66FEE60D0F880606E61D0F884602E62F1 -:10E9F000D0F888606E62066F2E60D0F89050656027 -:10EA0000D0F89450A560D0F89850E560D0F89C50AC -:10EA10006561D0F8A0502562D0F8A4506562D0F8A6 -:10EA20008C502560D0F8AC404C60D0F8B0408C6081 -:10EA3000D0F8B440CC60D0F8B8404C61D0F8BC40BD -:10EA40000C62D0F8C0404C62D0F8A8400C60D0F8FE -:10EA5000C8105160D0F8CC109160D0F8D010D160BF -:10EA6000D0F8D4105161D0F8D8101162D0F8DC1071 -:10EA70005162D0F8C4101160D0F8E420CBF8042023 -:10EA8000D0F8E820CBF80820D0F8EC20CBF80C2008 -:10EA9000D0F8F020CBF81420D0F8F420CBF82020C8 -:10EAA000D0F8F820CBF82420D0F8E020CBF80020D4 -:10EAB000BDE8F08F00080240000C02400010024048 -:10EAC0000014024000180240001C024000380240BE -:10EAD000000002400004024000200240AFF300802A -:10EAE0002DE9F04F4FF00F0C02F0030EC2F3800738 -:10EAF000C2F3C106C2F341150024C2F3C3124FF0A2 -:10EB000001094FF003082BE0D0F820B02BEA0303F3 -:10EB100043EA0A030362436809FA04FA23EA0A0390 -:10EB20003B4343604FEA440A836808FA0AFA6FEAF3 -:10EB30000A0A0AEA030333438360C3680AEA030349 -:10EB40002B43C36003680AEA030343EA0E0303602E -:10EB5000490819D07F00B600AD004FEA8E0E01348F -:10EB600004F007039B0011F0010F02FA03FA0CFAFC -:10EB700003F3EDD0072CC7D9D0F824B02BEA030358 -:10EB800043EA0A034362C6E7BDE8F08FAFF30080B3 -:10EB90003A483B4A70B5446BA369656945EA03434B -:10EBA00023F07F4393424CD01ED8073A93423CD087 -:10EBB0000132934210D16268C36A22F400721B686A -:10EBC00062601A6842F001021A60626842F4805280 -:10EBD00062605B68012B4BD915F00A0F18BFA3695F -:10EBE000BDE87040FEF7E4BC264A934212D00232E0 -:10EBF0009342F1D1C36A1B685E683EB32368028CFE -:10EC000043F4A06342F0010202842360BDE8704037 -:10EC1000FEF7CEBC6368026B23F400731268636076 -:10EC2000136843F001031360D6E7038C1A0A0BD074 -:10EC300003F0010343F0F00302F0060213432361E3 -:10EC4000CAE7038CC3F347032361C5E7636823F472 -:10EC500000736360236843F400732360202383F30D -:10EC600011881C303146FEF763FA86F31188B3E74A -:10EC7000236823F480632360AEE700BF740F002095 -:10EC80000800030082000700AFF30080AFF30080AC -:10EC90003448F8B5446B076B66693A68B1B201F461 -:10ECA0005F43DB436361136823F01F031360136842 -:10ECB000DB07FCD497F808E0C56A7F682A683D2323 -:10ECC00003FA0EF33B60136823F01F03136013680D -:10ECD00013F00103FBD12F7A6D683D22BA40CF05B6 -:10ECE0002A6048BF01238D05836044BF43F00203BF -:10ECF00083604A050AD5626822F400726260226865 -:10ED000043F0040342F40072226083600F0544BFA5 -:10ED100043F0080383604D0444BF43F02003836045 -:10ED2000CC0413D543F010033104836016D42023A0 -:10ED300083F311880C486FF00101FEF7F9F9002305 -:10ED400083F31188BDE8F840FEF732BC320405D4E5 -:10ED5000002BECD1BDE8F840FEF72ABC43F040039D -:10ED60008360E4E7740F0020900F0020AFF3008071 -:10ED700010B5074C2046FEF7A3FC064B064A62631B -:10ED8000002103F13C02E161E362226310BD00BF98 -:10ED9000740F00201832010800580040AFF30080C3 -:10EDA0002DE9F04FB24BB3499A69D0F850A0916168 -:10EDB00085B0202383F3118800F16003D3460393C9 -:10EDC00082469AF80030012B06D0DAF85C3063B93D -:10EDD000DBF81430DB0608D4DBF81830039843F076 -:10EDE0001003CBF81830FEF793F9002383F3118852 -:10EDF0009846DBF8143013F0100324D0DAF85020D2 -:10EE0000136A03F4F011B1F5802F31D0B1F5402F22 -:10EE1000EFD103F00F010AEB8101C3F30A13C968B4 -:10EE200003339B080C6AE4D002F58052022110687B -:10EE300011B144F8040B0139013BF8D1DBF814306F -:10EE400013F01003DAD10121DAF85C2001FA08F19D -:10EE50001142019168D108F10108DAF854309B6839 -:10EE60005FFA88F89845C4D9202383F31188A8E76E -:10EE700003F00F050AEB8505C3F30A14EB689869E4 -:10EE80000378DBB943688168C6680333591AE31C09 -:10EE90009B084FEA910109D002F58052B6461768E7 -:10EEA00011B14EF8047B0139013BF8D12644C6600C -:10EEB000EB689A699368234493609AE7C06824B327 -:10EEC00002F580522646032E416907D9036999420B -:10EED00004D3C3684361032E4169F7D8D2F800E038 -:10EEE000002701F1010C2EFA07F3C0F814C00B70D3 -:10EEF00003694169994224BFC3684361013E04D05C -:10EF0000182FE0D008374169EBE7202383F31188FD -:10EF10008368234483600021FEF732F9FEF700F88E -:10EF2000002383F31188C3E7202282F31188DBF8E2 -:10EF30000810DAF85C20019821F0010122EA0002B1 -:10EF4000CBF80810CAF85C2083F311880AEB880913 -:10EF5000D9F80C0041698A684B689A4280F0B18008 -:10EF6000DAF85060078A4FEA4810044630189B1AB6 -:10EF7000D0F818299F4228BF1F4693B2B7EB830FE2 -:10EF800008F101082ED8CDF808B0A3460B78002B65 -:10EF90003DD1FB1CCC689B0806EB083618BF224607 -:10EFA00004D052F8040B3060013BFAD13C44CC60F1 -:10EFB000D9F80C0041698B684A683B449A428B60DF -:10EFC0007BD9DAF85060008A06EB0B04D71AD4F824 -:10EFD0001839874228BF07469BB2B7EB830FD5D9B4 -:10EFE000DDF808B00022202383F31188DBF8083015 -:10EFF00043F00103CBF808302AB9DBF83438019A22 -:10F000001A43CBF83428002383F3118825E706EB55 -:10F010000836C868E7B1D0F810E03A4693082BD11B -:10F02000836900210C465D1C85611B78754503FAD8 -:10F0300001F344EA030424BFC3688361013A04D0A6 -:10F04000182902D008318369EDE73460002AE5D140 -:10F05000202383F3118883683B4483600021FEF7FB -:10F060008FF8FDF75DFF002383F31188A0E700BF51 -:10F07000400C0020D03201088469BEEB040148BF77 -:10F08000033189108B4228BF0B464FEA830CCCEB2F -:10F09000020233B1214651F8045B3560013BFAD1DD -:10F0A0006444A645846104D8C3688361002AB5D14D -:10F0B000CEE7002ACCD02346B3E7DDF808B0012222 -:10F0C00091E708F10108FAE7AFF30080AFF30080A1 -:10F0D000F0B50024D1F808E025464FF0804C4FF001 -:10F0E000FF3714E0C1F80059C218C2F81059C2F82D -:10F0F0000879D1F8006B002E17DBC1F8005B0344E0 -:10F100000134A645C3F8105BC3F8087B14D3630130 -:10F11000C118D1F80029002AE4DAC1F800C90E4666 -:10F12000D6F808299207FBD5DEE7C1F800CBD2F864 -:10F13000081BC906FBD5E2E74FF00113C0F81C38E5 -:10F14000F0BD00BFAFF30080AFF30080AFF30080ED -:10F1500010B5064C2046FEF7A3FC4FF0A043044A2E -:10F160002365002362652366636610BDB00F00202F -:10F17000C0320108AFF30080AFF30080AFF300802E -:10F1800070B50378066D012B82B001D002B070BD5E -:10F19000304B9842054618BF34463AD000232E48DB -:10F1A0002E49EB654FF43412F060C6F800182020A9 -:10F1B000C6F8003EB263FDF733FD012323612369E6 -:10F1C000DB07FCD40C20FDF72BFD2369002BFCDAB8 -:10F1D0000024B460286D696DFFF77AFF6B68C6F88C -:10F1E0001048DB68C6F81448C6F81C486BB143F2F7 -:10F1F0000803B3616B6E4FF0FF327261D3B1B36835 -:10F2000043F00103B36002B070BD4FF44053B361EB -:10F21000F0E7134B5A6B42F080025A635A6900219F -:10F2200042F080025A61432059610E21FEF740FFEF -:10F230002C6DB3E74FF4067102220A4B009505F1DD -:10F240006800FDF7B5FE6866FDF78AFDFDF768FE0C -:10F25000D5E700BFB00F002040140040030020029B -:10F2600000380240A1ED0008AFF30080AFF300804A -:10F27000F8B5056D202307462B612B6913F0200498 -:10F28000FBD10C20FDF7CCFCD7F854E0DEF8086089 -:10F2900023464FF00060FF2105EB43120133B342D8 -:10F2A000C2F80009C2F8000BC2F80819C2F8081B1E -:10F2B000F2D9DEF800304FF0FF324FF00111C5F8FF -:10F2C00018283A6DC5F81C18BB65DEF800306B6273 -:10F2D00010231361136913F01004FBD10C20FDF708 -:10F2E0009FFCD5F80038114A114823F4FE63C5F895 -:10F2F0000038AB6943F4402343F010030921AB61AC -:10F30000C5F81018C5F81418F860C5F8104BC5F802 -:10F31000002BC5F81049C5F80029BB6D03F1100298 -:10F3200043F48013BA65AB62F8BD00BF40800010A3 -:10F33000E0320108AFF30080AFF30080AFF300804C -:10F34000026D90F84E10D2F8003823F4FE6343EAC1 -:10F350000113C2F800387047AFF30080AFF30080AC -:10F360002DE9F0410FFA81F800EB88070D46FB68A4 -:10F37000046D1A6802F00302022A5CD0032A5CD0F2 -:10F380004A4E4B49012A18BF0E466A01D96804EB60 -:10F39000020E4FF0000CCEF810CB002971D0B3F85C -:10F3A00012E005F15801490146EA0E0E44F801E069 -:10F3B00005F1100CD4F81C184FF0010E0EFA0CFEDB -:10F3C0004EEA0101C4F81C18224499684FF0000E5F -:10F3D000C2F810E999B3998B1A8A01294FEA92036E -:10F3E00088BF4B4305F13F0E816D04EB8E0EAA01E1 -:10F3F00003EB010C42F0200241EA0343C0F858C07D -:10F40000CEF80430226123699A06FCD40C20FDF763 -:10F4100007FCFB681A8A05F148035B0142EA855242 -:10F420003243E2500123D4F81C28AB401343C4F804 -:10F430001C38BDE8F0811F4EA7E71F4EA5E705F178 -:10F440003F0204EB8202AB011C49516043F02003F0 -:10F45000236123699B06FCD404EB48180C20FDF7BC -:10F46000DFFBD8F8002922F40042C8F80029D4F8BC -:10F470001C280123AB4022EA0303C4F81C38BDE872 -:10F48000F08104EB481105F1100CD1F800EB2EF4DB -:10F49000004EC1F800EBD4F81C184FF0010E0EFA24 -:10F4A0000CFE21EA0E01C4F81C188DE70080041040 -:10F4B000008000100080081000800C100004000282 -:10F4C0005831036D49015B5813F4004004D013F424 -:10F4D000001F14BF01200220704700BFAFF300805F -:10F4E0004831036D49015B5813F4004004D013F414 -:10F4F000001F14BF01200220704700BFAFF300803F -:10F5000000EB8101CB681B6A19685B68536011606E -:10F51000704700BFAFF30080AFF30080AFF300800F -:10F5200000EB810330B4DD68AC696368236131B9F5 -:10F53000402B04D940236360094A3F2402E05C1E4B -:10F5400043F0C042006D6D8A00EB41116319B3FBBB -:10F55000F5F342EAC343C1F8103B30BC704700BF2B -:10F5600040000060AFF30080AFF30080AFF3008095 -:10F570002DE9F041264E376D07EB40130546D3F8D1 -:10F58000084BC3F8084B200703D5D7F814381907E0 -:10F590001DD4E20719D5D7F81438DB0715D506EBCB -:10F5A00085061B4CF1688B6958681A69904216D31E -:10F5B0006289CE680123AB4022EA030363812946B6 -:10F5C00020463346BDE8F0411847BDE8F08106EB20 -:10F5D00085033046DB6829465B689847D9E7121AED -:10F5E00000265A609E6020462946FFF799FF202397 -:10F5F00083F31188236D03EB4515D5F8003B43F0E9 -:10F600008063C5F8003B86F31188BDE8F08100BF38 -:10F61000B00F0020AFF30080AFF30080AFF30080A5 -:10F6200000EB810310B4DC68626953681361ABB10D -:10F6300071B15A1E006D248A00EB41112244B2FBC5 -:10F64000F4F243EAC243C1F810395DF8044B704745 -:10F65000402BEED9402353603F22EBE7036D5DF86A -:10F66000044B03EB41114FF40023C1F810397047EC -:10F670002DE9F041304F3D6D05EB40130646D3F8C0 -:10F680000849C3F80849E10703D5D5F81038DA0767 -:10F6900009D4230605D50123D5F83428B3401342F5 -:10F6A00029D1BDE8F08107EB8003D9684B69586820 -:10F6B0001A69904234D2121A4FF000085A60C3F807 -:10F6C000088038463146FFF7ABFF202383F31188CB -:10F6D0003B6D03EB46100122D0F8001941F00441C4 -:10F6E000C0F80019D3F83418B2400A43C3F83428DC -:10F6F00088F31188CDE7202282F31188D5F83418D9 -:10F70000FA6D0E4821EA0301C5F8341813430021AD -:10F71000FB65FDF70DFD002383F31188BDE8F08143 -:10F720003A89D1F808C00123B34022EA03033B81A0 -:10F7300038463146E047ACE7B00F002010100020FB -:10F7400070B53A4D2E6D7369B4691C40E104746163 -:10F750002DD4A20448BFD6F80838230704D56B6817 -:10F76000DB680BB131489847E5062BD46003D6F827 -:10F77000185807D5E90745D4AA0748D46B074BD4D6 -:10F780002E074ED4240307D5E80330D4A90333D47D -:10F790006A0326D42B0303D4BDE87040FDF708BFED -:10F7A0000320FFF7E5FEBDE87040FDF701BF2846E6 -:10F7B000FEF70EFA6B681B68002BCAD028460021A2 -:10F7C0009847C6E7202383F31188B369184823F0CC -:10F7D0001003B3610021FDF7ABFC002383F3118814 -:10F7E000C4E70220FFF7C4FE2B03D5D5D8E70020DD -:10F7F000FFF7BEFEA903CBD50120FFF7B9FE6A03D0 -:10F80000C8D5EEE70020FFF733FFAA07B6D50120E1 -:10F81000FFF72EFF6B07B3D50220FFF729FF2E0756 -:10F82000B0D50320FFF724FFACE700BFB00F0020E6 -:10F8300010100020AFF30080AFF30080AFF3008022 -:10F84000036D03EB4111D1F8003B43F08063C1F835 -:10F85000003B7047AFF30080AFF30080AFF3008050 -:10F86000036D10B403EB41140122D4F8000940F0F9 -:10F870000440C4F80009D3F834085DF8044B8A400A -:10F880000243C3F834287047AFF30080AFF3008021 -:10F89000036D03EB4111D1F8003B43F40013C1F8B1 -:10F8A000003B7047AFF30080AFF30080AFF3008000 -:10F8B000036D03EB4111D1F8003943F40013C1F893 -:10F8C00000397047AFF30080AFF30080AFF30080E2 -:10F8D000036D03EB4111D1F8003B23F40013C1F891 -:10F8E000003B7047AFF30080AFF30080AFF30080C0 -:10F8F000036D03EB4111D1F8003923F40013C1F873 -:10F9000000397047AFF30080AFF30080AFF30080A1 -:10F9100038B5254DEB6869681A69DC68087D1440C4 -:10F92000E2B2D2431A61F8B9600714D52B78042BE0 -:10F930000DD0A10715D4E40705D56B681A481B69DB -:10F94000984703232B70BDE83840FDF731BE8B6824 -:10F950001BB328469847A107EDD52B78124A042BF4 -:10F9600014D004232B70E6E7A20709D52B78042BCB -:10F9700002D06307F5D4DEE78B688BB12846984741 -:10F980006307D8D52B78084A042BEAD15168CB6895 -:10F99000002BE6D004489847E3E7A007F7D4CAE76E -:10F9A0006207F4D4C7E700BF4C120020AFF3008019 -:10F9B00010B5034C2046FDF793FE024BE36010BDEB -:10F9C0004C12002000040040AFF30080AFF3008031 -:10F9D00008B5202383F31188FDF7F2F8002383F3A1 -:10F9E0001188BDE80840FDF7E3BD00BFAFF300801C -:10F9F000054B44F29F1000210722586099600B20AC -:10FA000008211A60FEF774BB10E000E0AFF300803D -:10FA10002DE9F0418468E7682668626840F20F13B8 -:10FA200033400546EBB143681A696FF48073236075 -:10FA3000BAB1B3B213F0080F0CBF00211021D807E0 -:10FA400048BF41F00401980748BF41F0080158073A -:10FA500048BF41F02001D80548BF41F04001284689 -:10FA6000904772060ED57B060CD56B685B6827F055 -:10FA700040076FF040022260E7601BB12846BDE8F6 -:10FA8000F0411847BDE8F081AFF30080AFF300808C -:10FA900008B50348FFF7BCFFBDE80840FDF788BD87 -:10FAA00064120020AFF30080AFF30080AFF300805A -:10FAB00008B50348FFF7ACFFBDE80840FDF778BD87 -:10FAC00080120020AFF30080AFF30080AFF300801E -:10FAD00070B50C4D0C4C0D4E2846FDF7D1FF0C4B6C -:10FAE000AB60062204F1180330462C616B61EA60BA -:10FAF000FDF7C6FF074BB36004F16C03A834336114 -:10FB0000746170BD641200200C3201088012002064 -:10FB10000048004000140140AFF30080AFF30080C4 -:10FB2000FEF716BDAFF30080AFF30080AFF30080A7 -:10FB3000704700BFAFF30080AFF30080AFF30080E9 -:10FB400008B5044B044A9B699A616420FDF7A8FA42 -:10FB5000FBE700BF400C002010340108AFF3008029 -:10FB600000B5D1B0FDF754FDFCF7D2FF42F21070A2 -:10FB7000FDF796FA01F034F901F02AFC24A801F00F -:10FB8000F7F924A800F09CFA01F0FAF801A801F0B6 -:10FB900057F9002051B05DF804FB00BFAFF30080BF -:10FBA00000B583B000240A4B00944FF4B3614022A7 -:10FBB0000848FDF735FA00940748084B4FF40671E2 -:10FBC0004022FDF72DFA0A20FDF76AFAFBE700BF95 -:10FBD00041FB000828190020E0160020E1FE000883 -:10FBE000F0B5374AADF2145D93798DF812015C21BE -:10FBF0005D20ADF810015F1C8DF813117920449938 -:10FC00009771DC26FE25092404228DF804308DF836 -:10FC1000060002918DF807608DF802508DF80540BE -:10FC20008DF803200DF103010DF107004FF6FF736E -:10FC300001E011F8012F5A4082EA0212D2B21B0AE7 -:10FC400083EA121343EA0223814283EAC203F0D11A -:10FC5000ADF8003002A903A811F8012B5A4082EA3E -:10FC60000212D2B21B0A83EA121383EA022383EA46 -:10FC7000C2039BB28142ADF80030EDD183F0250282 -:10FC800082EA0212D2B2DDF80200DDF80610BDF8F9 -:10FC90000A501B0A83EA121344AC03C483EA02230A -:10FCA00083EAC2039BB225801A0A44A80C218DF86E -:10FCB0001B218DF81A3101F00BF80DF2145DF0BD27 -:10FCC000F8180020AFF30080AFF30080AFF300809E -:10FCD0002DE9F0417E4DEB780022C6B004462A7033 -:10FCE0000A2B00F2D180DFE803F03636BB97A93C3F -:10FCF0004E627C0606000A2B764904D00B88B0EBD6 -:10FD0000132F00F0E28002272F702B79DFF8C481D7 -:10FD10006F4E0B444FF0010E414602A84FF488721B -:10FD20005C7285F803E0FCF72BFE012F40F0AD80FC -:10FD3000338998F80420727103B973819DF80F20FC -:10FD400001330021DC2A2B81A97000F0B280002051 -:10FD500046B0BDE8F081FE2800F0AD800023AB7016 -:10FD6000F5E75C4A138890715C4084EA0414E4B2BD -:10FD70001B0A83EA141343EA042383EAC40306211B -:10FD80001380E970EAE7534A1388D178D0715C4058 -:10FD900084EA0414E4B21B0A83EA141343EA04233A -:10FDA00083EAC4031380C9B10723EB70D6E749493E -:10FDB0002A798B18013218720B88C8785C4084EA63 -:10FDC0000414E4B21B0A83EA1413D2B243EA0423F4 -:10FDD00083EAC40390422A710B80BFD10823EB70E1 -:10FDE000BCE73C493C48CB790A88C35C534083EA72 -:10FDF0000313DBB2120A82EA131242EA032282EAF6 -:10FE0000C303DAB294420B8014BF0A230923EB70B8 -:10FE10002B7919440C72A1E72E4A138850715C406B -:10FE200084EA0414E4B21B0A83EA141343EA0423A9 -:10FE300083EAC40305211380E9708FE7254A1388FC -:10FE400010715C4084EA0414E4B21B0A83EA1413C0 -:10FE500043EA042383EAC40303211380E9707DE7A6 -:10FE60001C4A1388D0705C4084EA0414E4B21B0A74 -:10FE700083EA141343EA042383EAC4030020042121 -:10FE800013802871E97069E700270021022FA9700B -:10FE90000F4B7FF45CAF0122FE2C19709A7001D0D9 -:10FEA000DA7054E70B4ADF704FF6FF73D17013809E -:10FEB0004DE701204CE7074B00204FF6FF7102226F -:10FEC0009C70D8701980EA7048E701272F701CE7F2 -:10FED000F8180020A012002030340108AFF3008091 -:10FEE00008B5084B084A9B69084C9A6100F000FF6E -:10FEF0002070FFF7EDFE0028F8D00120FFF770FE1C -:10FF0000F4E700BF400C0020203401089C120020C0 -:10FF100008B5044B044A9B690A209A61FDF7C0F8B2 -:10FF2000002008BD400C002030350108AFF30080F0 -:10FF3000044B05490020402248621A8364205A83FA -:10FF400002F076B90004024000180040AFF30080D0 -:10FF500010B5174CDFED177A2DED048B94ED048A64 -:10FF6000D4ED038AD4ED009AC4ED058A38EE088AF0 -:10FF7000B0EE690A28EE278AA8EEA78A84ED068AE1 -:10FF800002F06EF9B0EE409AB0EE690A02F0A8F9FC -:10FF900068EE097A28EE008AE8EEC07AA8EE898A2F -:10FFA000C4ED087A84ED078ABDEC048B10BD00BF58 -:10FFB000AC2900203ACD133FAFF30080AFF30080AF -:10FFC00090ED067A90ED076AD0ED007AD0ED015AF7 -:10FFD000D0ED046A37EE466AB0EE677AA5EE867A0F -:10FFE000B4EEE67AF1EE10FA0BDCD0ED056AB4EE71 -:10FFF000E67AF1EE10FA04D4F0EE476A80ED087A62 -:020000040801F1 -:1000000001E0C0ED086A90ED025AD0ED035AE5EE2A -:10001000067A37EE667AE5EEC77AC0ED007A704769 -:100020002DE9F0431A481B4C1B491C4A1C4D1D4E20 -:10003000DFF87890DFF87880DFF878E01A4FC4F8BE -:10004000049000234FF0804CC0F80490A6608660B6 -:10005000E5602561C5600561C4F81480C0F81480AE -:1000600023602362036003628E60CD600B600B62CD -:100070009660D56013601362C1F804C0C2F804C072 -:10008000C1F810E0C2F810E04F615761BDE8F0839D -:10009000D0280020E81E0020101F00200C2900207E -:1000A00058FF7F3F0AD7233C333373BFCDCC4C3D41 -:1000B00058FF7FBF3333733FAFF30080AFF300804F -:1000C0002DE9F04FA9B000F06BFED94BD94EDA4FB5 -:1000D000DFF890B300241C70D84B30461C7001F040 -:1000E0006FFD384601F06CFD0120014674627C62B0 -:1000F000012501F035FD4FF0200E304603A9DBF855 -:100100000020ADF80EE0ADF80C40ADF81440CC4B3B -:100110008DF8165093FBF2F3049301F031FEF36A6D -:10012000ADF83A50EB40109360234FF480784FF0D5 -:10013000040930460EA9ADF838304FF40073ADF81D -:100140004A30ADF84440ADF84640ADF83C90ADF8CB -:10015000488001F085FE30460EA901F0C1FE304610 -:100160000EA901F00DFF30460EA901F051FF3046F7 -:10017000082101F08DFF3046082101F091FF304643 -:10018000082101F09DFF3046082101F0A1FF502316 -:100190004FF4006A304606A9ADF81E304FF4005304 -:1001A000ADF82230ADF818A0ADF81AA0ADF81C409B -:1001B000ADF82040ADF8244001F09AFF30462946C2 -:1001C00001F0BEFF3046294601F02AFE29469D482F -:1001D00001F0A6FC29464FF4E06001F0C1FC234683 -:1001E000994A9A480321FEF733F94FF40051DFF89A -:1001F00078C2DFF878E29648CDF880A04FF400335B -:100200004FF480624FF00C0A219119A9CDF86CC00F -:10021000CDF868E023931F9219941C941E94CDF896 -:1002200088802494259426942794CDF874A001F016 -:1002300047FB2946864801F07BFB10212A4684486B -:1002400001F086FB16224FF480430AA80A920C9311 -:100250000B940D9401F044FA4FF050634FF00052AC -:1002600013A97C481693159213948DF850508DF86D -:10027000514017948DF8609001F00AFA13A976485E -:100280001594169401F004FA13A9744801F000FAC9 -:1002900001F066F9284601F093FA6E484FF44021C8 -:1002A00001F0D6FA6C484FF4502101F0D1FA6948B8 -:1002B0004FF4001101F0D4FA67484FF4001101F037 -:1002C000CFFA2946634801F0BBFA2946624801F09B -:1002D000B7FA40F207412A465E4801F0D9FA0323F3 -:1002E000122202A88DF808208DF809308DF80A3006 -:1002F0008DF80B5001F094F92946564801F008FAA0 -:100300002946554801F004FA2946544801F000FAFC -:100310002946022001F024FC38460DEB0A01DBF8E7 -:100320000020ADF80C40ADF80E40ADF814408DF84B -:1003300016404B4B93FBF2F3049301F021FD602236 -:10034000F36AADF8382038464FF400720EA9ADF8C4 -:100350004A201093ADF83A50ADF84440ADF846400D -:10036000ADF8488001F07CFD3846082101F090FE90 -:1003700038460EA901F0B4FD3846082101F090FE80 -:1003800038460EA901F0FCFD3846082101F098FE20 -:100390003846294601F044FD3846294601F0D0FE92 -:1003A0003846294601F0BCFE3046202101F0E8FE27 -:1003B0003046802101F004FF3846214601F0D8FE86 -:1003C0003846494601F0ECFE3846294601F038FD32 -:1003D0003046294601F034FD3046294601F0A0FEA2 -:1003E0002846294601F0ACFB4FF0FF3253230DEBBA -:1003F0000A014FF080400492ADF80C30ADF8144083 -:10040000ADF80E4001F0BCFC29464FF0804001F0F1 -:1004100017FD00F0C5FC336843F0020333603B680E -:100420004FF4FA7243F002033B607A6320E000BFAE -:10043000202A002000000140000401400029002083 -:1004400000BD01050500400031FF000890320108A1 -:100450007064024000200140002101400022014060 -:10046000007A030A08080020C41E00200823014067 -:10047000F36ABB63F36AFB63336823F00203336000 -:100480003B6823F002033B6000F09AFC314B324A98 -:100490008021402018835983A3F81A801983136997 -:1004A000DB04FCD542F21070FCF7FAFD2B4C2C4813 -:1004B0002C490023236003600B600B68294AB3F5C5 -:1004C0007A6FFADB2849294F2368224E146893FB80 -:1004D000F4F30B600368126893FBF2F301253B60B1 -:1004E0008024234B74832946402000241D7001F092 -:1004F00027FB4FF0FF32072303A91E480492ADF8F3 -:100500000C30ADF81440ADF80E4001F039FC29462E -:10051000184801F095FC184B0094402240F69811C1 -:100520001648FCF77DFD29464FF4006001F008FBFA -:10053000204601F055FEFF2001F062FE642001F02C -:100540007FFEFFF76DFD0E4B02221C801A7029B052 -:10055000BDE8F08F0008024000040240182A002085 -:100560000C1F0020F8280020C01E0020142A0020A4 -:10057000002900200018004011FF0008381F00204B -:10058000F4280020AFF30080AFF30080AFF30080C9 -:10059000144A154B92ED007AD3ED007AB4EEE77A67 -:1005A000F1EE10FA11DC93ED007AD2ED007AB4EEA0 -:1005B000E77AF1EE10FA07DDD2ED007A93ED007ADA -:1005C000C7EE877A20EE270A704792ED007AD3EDC6 -:1005D000007AD3ED006A77EE677AC7EEA67AA7EEC7 -:1005E000800A70473C29002038290020AFF30080A2 -:1005F000374B1B882DE9F041DFF8FC80002B55D0EC -:10060000344F354D354C2B78354E590744BF3B6838 -:10061000BB60F269E26100232046A361FFF7D0FCD2 -:100620002B7894ED080A1A073BD486ED090A20EED0 -:10063000000A2C4BDFED2C7A83ED000A93ED000AC3 -:1006400037EEC00AF1EEC07AF4EE677AF1EE10FAF6 -:1006500039D1264C326ABB68A361B1EE677A204675 -:10066000E261C4ED047A84ED057AFFF7A9FC2B78EA -:100670001B4E1B070ED4236AB362D8ED187AF5EE31 -:10068000C07AF1EE10FA03D52B786FF341032B708B -:10069000BDE8F08194ED080AFFF77AFF86ED0A0ABB -:1006A000EBE7FFF775FF86ED090AC0E7104C114B29 -:1006B000D8F85C20074FA3612046E261FFF780FC79 -:1006C000236ABB609DE701F04BFEF0EE407AC0E785 -:1006D00040290020DC1E0020F4280020E81E002015 -:1006E000AC290020342900203D0A673FD028002093 -:1006F000101F00200AD723BC48290020AFF3008038 -:1007000010B5114C2DED048B94ED009A94ED098AEF -:10071000B0EE490A01F0A4FDF0EE408AB0EE490ABD -:1007200001F0DEFDD4ED0A7A20EE677A68EEA77A52 -:10073000A8EE287AE8EE007ABDEC048B84ED0B7A03 -:10074000C4ED0C7A10BD00BFAC290020AFF30080CF -:10075000184B194ADB6A92ED047AD2ED056A1360F0 -:1007600007EE903AF8EE677AB6EE006A27EE877ADF -:1007700067EEA66A77EEC77A82ED047A77EEE67ABC -:10078000C2ED056A67EE867AFCEEE77AB8EE676A34 -:10079000C2ED087A37EE067ABCEEC77AF8EE477AF1 -:1007A00082ED077A76EEA76AFCEEE66AC2ED066A8B -:1007B000704700BF00000140F0290020AFF3008027 -:1007C0002DE9F041164680460F4600F0E9FA0D4B40 -:1007D0000D4C1D6845F002051D60256845F00205B9 -:1007E0002560C3F834809F63DE631A6822F002023A -:1007F0001A60236823F002032360BDE8F04100F093 -:10080000DFBA00BF0000014000040140AFF30080E8 -:1008100010B53F4CD4ED017AF5EEC07AF1EE10FA46 -:1008200027DB94ED027AB5EEC07AF1EE10FA13DA16 -:10083000D4ED036AF5EEC06AF1EE10FA45DBC4EDC3 -:10084000057AC4ED046AFFF783FF206AA169E269B3 -:10085000BDE81040FFF7B4BF84ED057AC4ED047A1B -:10086000FFF776FF04F1180007C8BDE81040FFF756 -:10087000A7BFD4ED026AF5EEC06AF1EE10FA35DBDF -:1008800094ED037AB5EEC07AF1EE10FA0CDB84ED4C -:10089000057AC4ED046AFFF75BFFE069216AA2698B -:1008A000BDE81040FFF78CBFB1EE477AF1EE677AF2 -:1008B00084ED057AC4ED047AFFF74AFFA069216A46 -:1008C000E269BDE81040FFF77BBFB1EE477AF1EE79 -:1008D000666A84ED057AC4ED046AFFF739FFE069C2 -:1008E000A169226ABDE81040FFF76ABFF1EE677A9E -:1008F000F1EE666AC4ED057AC4ED046AFFF728FFDD -:10090000206AE169A269BDE81040FFF759BF00BF46 -:10091000F0290020AFF30080AFF30080AFF3008038 -:1009200070B5554B9FED557A9A885B88544C554E5F -:1009300094ED000A2DED048B07EE903A08EE102A94 -:10094000DFED518A514A524BB8EE488AF8EE677A89 -:1009500038EE688A77EEE87A88EE078A0546C7EEB1 -:10096000878A82ED008AC3ED008A01F079FC494B49 -:10097000B0EE409A94ED000A83ED009A01F0B0FCCD -:1009800028EE098A68EE808A434A9FED446AD2EDD8 -:10099000007A86ED008A38EE688A414B4148D3EDF3 -:1009A000006A4149C0ED008AD8EE067AB2EE047AB8 -:1009B00077EEA67A81ED000AC3ED007AD3ED007AD6 -:1009C000F4EEC77AF1EE10FA0ADCD3ED007ABAEE53 -:1009D000047AF4EEC77AF1EE10FA58BF93ED007A7C -:1009E00083ED007A82ED008AD3ED007AD4ED006ABF -:1009F0009FED2E7A224A77EEA67AC4ED007AD4EDE6 -:100A0000007AF4EEC77AF1EE10FAD2ED007A1EDD2C -:100A100037EEC77A82ED007A94ED007ADFED247A22 -:100A2000DFED226A77EE277AF4EEE67AF1EE10FA3D -:100A300019DCBDEC048BF5EEC07AF1EE10FA48BF7C -:100A400077EEA67A1B68C5ED167AEB6570BDF5EEFC -:100A5000C07AF1EE10FADFD5D2ED007A37EE877A60 -:100A600082ED007AD8E7BDEC048B77EEE67A1B685E -:100A7000C5ED167AEB6570BDC41E002000F07F4501 -:100A8000442900200829002000209B44242A00201B -:100A9000282A0020EC290020042900200C02803F95 -:100AA0001C2A0020FC28002030290020DB0FC94030 -:100AB0009A99993EAFF30080AFF30080AFF30080C6 -:100AC0002DE9F843414B4248DFF83081414E002781 -:100AD0005F62142100F0CCFE142105463E4800F070 -:100AE000C7FE04463D483E4903683E4A2B44036026 -:100AF0000B6823440B601368404601331360FFF713 -:100B00000FFF33789A075BD5DFF8F4E0364B374AAE -:100B1000D8F858C03649DFF8EC8080204FF0400903 -:100B2000AEF818901883B2F804E0908992ED006A4C -:100B3000D2ED026A0B88C8F800C00FFA8EFECEEB29 -:100B4000050502B207EE905AA41AB8EEE77A07EE4E -:100B5000904AF8EEE77A01339BB226EE077A66EE0A -:100B6000A77A102B14BF0B800F8088ED037AC8ED95 -:100B7000047AFFF7EDF93378DB0723D5FFF7C0FDE3 -:100B8000D8ED0C6AD8ED0B5A9FED1A6A1A4BF1EEAC -:100B9000667AB0EE677AA5EE867AE5EEC67AB6EEAC -:100BA000006A27EE067A67EE867AC3ED016A83ED66 -:100BB000027AC3ED037AFFF72BFE0B4B80225A8398 -:100BC000BDE8F883FFF714FDD8E700BF0018004028 -:100BD00000200140F428002000210140182A0020B4 -:100BE0000C1F0020F8280020000402402C2A0020BE -:100BF00040290020D7B3DD3FF029002048290020FC -:100C000000080240AC290020AFF30080AFF3008061 -:100C1000022906D0032906D00129064818BF002062 -:100C2000704705487047032A9ABF044B03EBC20084 -:100C300000207047F036010870350108C036010801 -:100C4000022915D138B505460C46202383F31188B7 -:100C50000121084AFCF74CFF28462146064AFCF7CA -:100C600047FF0648FCF73CFE002383F3118838BD9C -:100C7000704700BF4035010880350108502A002028 -:100C800038B50E4D0E4C2846FCF7E2FD0D492846BE -:100C9000FCF706FE226D936B23F40023936343F667 -:100CA0009820FCF7FDF920460749FCF709FF226D63 -:100CB000936B43F40023936338BD00BF502A002098 -:100CC000B00F0020E0360108B0350108AFF3008016 -:100CD000054B10B41C6824680A4601461846234692 -:100CE0005DF8044B184700BF502A0020AFF3008086 -:100CF00000B506480368A1B05B68694601229847C1 -:100D00009DF8000021B05DF804FB00BF502A0020D0 -:100D100008B50448012101F023FABDE80840FCF7BA -:100D200047BC00BF00140040AFF30080AFF3008069 -:100D300008B5054840F2074100F0BAFDFFF7C0FED4 -:100D4000BDE80840FCF734BC00200140AFF3008050 -:100D500008B54FF4006000F01BFE00B908BD044B5D -:100D600000225A624FF40060BDE8084000F020BE47 -:100D700000080040AFF30080AFF30080AFF30080C5 -:100D800008B5FFF77DFF0248BDE80840FCF760BAF0 -:100D9000D02C0020AFF30080AFF30080AFF30080D1 -:100DA000044B1A6812B9202282F311881A680132A2 -:100DB0001A607047E02C0020AFF30080AFF3008092 -:100DC000054B1A6832B11A68013A1A601B680BB9F0 -:100DD00083F31188704700BFE02C0020AFF3008040 -:100DE00008B500214FF4A072104802F079F9104ABA -:100DF0004FF47A7302F18C0122F8023F01338A42E8 -:100E00009BB2F9D10B4A4FF4FA6302F18C0122F83C -:100E1000023F01338A429BB2F9D100F0D1FDF220AA -:100E200000F0DEFDBDE8084000F01ABAE42C002016 -:100E3000E22C00206E2D0020AFF30080AFF3008085 -:100E40002DE9F04F054683B0064600240AE0BDF8C0 -:100E500006301A0A05F814200134462C737006F186 -:100E600002066BD004F5FA6080B20DF1060100F0C5 -:100E7000BFF90028EBD000218C22284602F030F97F -:100E8000304F314BDFF8D0C0304C31483149EB6145 -:100E90004FF4FA76002301226F63AF65C5F848C0AE -:100EA0002E616E66DFF8B4E0DFF8B4802C624FF498 -:100EB0007A7B4FF00309F7EE007A4FF0804A4FF447 -:100EC000E13C4FF07C574FF07A566C6428636865BC -:100ED000E96329662B702B732B7685F82C3085F807 -:100EE000383085F8393085F8403085F8523085F84B -:100EF000533085F85C3085F85D30C5F804B085F86E -:100F00001490C5ED097AC5F828A085F82D2085F83C -:100F1000502085F8512085F86C20C5F84C80C5F824 -:100F200068C02C67686785F8842085F88530C5F827 -:100F30008810C5F878E0EF67C5F8806003B0BDE8B9 -:100F4000F08F00BF0050434800606A469A99193EEE -:100F5000007C124800803B456666663F002474486A -:100F600000004040AFF30080AFF30080AFF300809B -:100F70002DE9F04F054683B0064600240BE0BDF88E -:100F800006301A0A05F814200134582C737006F143 -:100F9000020600F0888004F57A7080B20DF1060137 -:100FA00000F026F90028EAD0404B414ADFF830E152 -:100FB000DFED407A4049414FDFF828A1DFF8289162 -:100FC0003F4C4048DFF82481DFF824C16B60EB60C0 -:100FD000EB646B65DFF81CB13B4BC5F818E0AA6306 -:100FE000DFF814E12A649FED397A394EA9600122B5 -:100FF0002965C5F814A0C5F81C902C626862354CB0 -:101000003548C5F82C8000216F63EF63C5F848C0F0 -:101010006B66C5ED1B7A0023304FC5F870B0C5F87C -:1010200074E02A7085F8302085F8312085F85C203E -:10103000DFF8C8A0DFF8C890DFF8C880DFF8C8C0C4 -:10104000DFF8C8B06E64F2EE007A4FF07E5E40F6D4 -:10105000B83285ED187A6B70AB702F61AF65C5ED56 -:101060000A7AC5F868B0C5F878A0C5F89C6085F81C -:101070007C3085F87D3085F87E30C5F88040C5F835 -:101080009040C5F88400C5F89400C5F88810C5F8EC -:101090009810C5F88C90C5F8A480C5F8A8C0C5F80C -:1010A000A0E0C5F8AC2003B0BDE8F08F00007042AE -:1010B0000000C84200007842000070C20000A04258 -:1010C000000096430080BB44008089440000164322 -:1010D0000AD7233C17B7D1386F12033B0000A0C1D9 -:1010E0000050C3C7000002430050C34700004842FD -:1010F0003333733FCDCC4C3F00409C470000164437 -:101100000000614499BB963B0AD7233D0000204173 -:1011100038B51B4A1B4B1B88128892B29BB2EAB9A6 -:101120004EF6EE629B1A18BF012303F50054164ACF -:10113000013301349B03A4031A44944203D310E007 -:101140000434A2420DD923680133F9D10546204663 -:1011500000F0C6FC09280DD080B238BD1BB1AB2011 -:1011600038BD802038BD4EF6EE63D31AB3FA83F350 -:101170005B09DAE7A01C294600F0B2FCECE700BFEF -:101180000080000800400008FE3F0008AFF3008028 -:1011900010B5044600F004F900F57F523F320138E3 -:1011A00001E0904209D010F8013FFF2BF9D0204612 -:1011B000022100F055FC80B210BD092010BD00BF17 -:1011C00008B50820FFF7E4FFC0B2092800D008BD29 -:1011D0000548002100F084FC0928F8D11020FFF711 -:1011E000D7FFC0B2F3E700BF00400008AFF30080B4 -:1011F000154B164A1B8812889BB210B492B2BBB131 -:101200001AB1AB205DF8044B7047114B114C1A46D4 -:10121000128892B2824204D10EE01A8892B28242BF -:101220000AD0043B9C42F8D301205DF8044B704780 -:10123000094B0A4C1A46EBE733F8023C0B800020BE -:101240005DF8044B704700BF0040000800800008B4 -:10125000FEBF000802800008FE7F00080240000870 -:101260002DE9F041484D494E2C883388A4B24EF602 -:10127000EE6294429BB248D04FF6FF78444534D09A -:1012800024B1FFF79DFF80B2BDE8F081002BF8D0BC -:10129000434564D03E4D3F4E3F4F338835F8022FD3 -:1012A0003D499BB2934208BF1FFA84F80FFA88F3B6 -:1012B0009C42104604F1010409D0FFF799FF012870 -:1012C00005D028883988FFF723FF0928DCD1A02C16 -:1012D000E3D12E48002100F003FC80B20928D3D1CD -:1012E0000820BDE8F041FFF753BF002BF8D0934230 -:1012F000C7D10820FFF74CFF0928C5D1304600218F -:1013000000F0EEFB80B2BDE8F0816BBB204D234EB8 -:10131000214F1C464FF6FF78338835F8022F1E49BF -:101320009BB2934208BF1FFA84F80FFA88F39C42DD -:10133000104604F1010409D0FFF75AFF012805D037 -:1013400028883988FFF7E4FE09289DD1A02CE3D135 -:101350000D48002100F0C4FB80B2092894D1102070 -:10136000BDE8F041FFF714BF4FF6FF72934288D1FA -:101370001020FFF70DFF092886D12846002100F034 -:10138000AFFB80B2BDE8F08100400008008000089B -:10139000E22C002006800008242E002006400008D1 -:1013A000074A002332F8021B814204D001330C2B80 -:1013B000F8D100207047034A52F82300704700BF5D -:1013C0000037010820370108AFF30080AFF3008039 -:1013D00001202DE9F84301465E4E5F4C5F4D00F061 -:1013E0009FFB0220012100F09BFB0420012100F063 -:1013F00097FB304640211922FDF772FB8021884679 -:10140000402730461922FDF76BFB7783394620468B -:10141000A6F81A801922FDF763FB20464146678330 -:101420001922FDF75DFB4FF4807189462046192291 -:10143000FDF756FB3046A4F81A904FF48051202255 -:10144000FDF74EFB494628469A22FDF749FB284600 -:101450004FF400719A22FDF743FB28464FF4806158 -:101460009A22FDF73DFB30464FF400519A22FDF7DA -:1014700037FB30464FF480419A22FDF731FB30466E -:101480004FF400419A22FDF72BFB20464FF4005108 -:101490002022FDF725FB20464FF480412022FDF756 -:1014A0001FFB20464FF400412022FDF719FB284680 -:1014B00001210322FDF714FB284602210322FDF738 -:1014C0000FFB284604210322FDF70AFB28460821CA -:1014D0000322FDF705FB284610210322FDF700FB40 -:1014E000284620210322FDF7FBFA2846394603222D -:1014F000FDF7F6FA284641460322FDF7F1FA304699 -:1015000001210322FDF7ECFA304602210322FDF708 -:10151000E7FA204601210322FDF7E2FA20460221E4 -:101520000322FDF7DDFA204604210322FDF7D8FA55 -:10153000204608210322FDF7D3FA2046102103227A -:10154000FDF7CEFA204620210322BDE8F843FDF73F -:10155000C7BA00BF00040240000802400000024079 -:1015600070B52C4D2C4C2D4E0122284613460021DF -:1015700000F0DEF8284607210222012300F0D8F807 -:1015800028460A210322012300F0D2F8042128462C -:101590000A46012300F0CCF8012120460A460B46FA -:1015A00000F0C6F8204608210222012300F0C0F80E -:1015B00020460B210322012300F0BAF820460F2118 -:1015C0000422012300F0B4F8012230461346022120 -:1015D00000F0AEF8304603210222012300F0A8F803 -:1015E00030460C210322012300F0A2F830460521E9 -:1015F0000422012300F09CF801222846134608210A -:1016000000F0EEF80122204613460921BDE87040A3 -:1016100000F0E6B800200140002101400022014016 -:10162000C3785BB9037818485A09203203F01F03C6 -:10163000012101FA03F340F822307047134BF0B454 -:10164000D9684578827804780F4EC943C1F30221E6 -:10165000C1F10407FFB20F23BD400B411340E9B2B3 -:101660000B4304F1604202F561421B01DBB282F8D8 -:1016700000330378012203F01F015B098A4046F81A -:101680002320F0BC704700BF00E100E000ED00E067 -:10169000F0B544680A6891F804C0D1F80CE00E690E -:1016A0008D684F790D4B24F0407424F480742243EC -:1016B00042EA0C22426084684EEA06022A43234032 -:1016C000134343EA470383600A7DC36A013AD2B2F7 -:1016D00023F4700343EA0253C362F0BDFDF7FFC079 -:1016E00070B490E84400064D8468C168054B686892 -:1016F000324322430A43034013436B6070BC70477C -:1017000000230140E030FCFFAFF30080AFF3008026 -:10171000836819B923F001038360704743F0010324 -:1017200083607047AFF30080AFF30080AFF30080B9 -:10173000092970B41CD9A1F10A0404EB4404C5685A -:101740000726A640A34025EA06042343062AC360D1 -:101750001AD90C2A25D90D3AC46A02EB82021F233A -:10176000934024EA030391401943C16270BC70475F -:1017700001EB410605690724B440B34025EA04049F -:101780002343062A0361E4D8013A446B02EB820248 -:101790001F23934024EA030391401943416370BC23 -:1017A0007047073A046B02EB82021F23934024EA3E -:1017B000030391401943016370BC7047AFF300808D -:1017C000054A536818B923F400535360704743F433 -:1017D00000535360704700BF00230140AFF3008007 -:1017E000092970B41AD801EB410605690724B440F1 -:1017F000B34025EA040423430361836B0232C3F33D -:101800000154121BD2B202EB82021F24944023EA3D -:10181000040391401943816370BC7047A1F10A042D -:1018200004EB4404C5680726A640A34025EA060445 -:101830002343C360E1E700BFAFF30080AFF3008054 -:10184000836B013923F4401343EA015181637047EC -:10185000836823F47023194381607047AFF30080DD -:10186000836823F44013194381607047AFF300800D -:1018700082B0002301930190019B28331944019108 -:10188000019B186880B202B0704700BFAFF30080C0 -:10189000C9B201238B4022B9426822EA03034360A4 -:1018A0007047426813434360704700BFAFF3008046 -:1018B0006FEA112101607047AFF30080AFF3008041 -:1018C0002DE9F04182B08B6A0193CB684F698E6934 -:1018D000CD690C6A4A6AD0F800C0DFF850E098463B -:1018E0000B6848EA030848EA07073E4335432C43A0 -:1018F000019B0E6B0D69224313434A6B4C681343E3 -:101900008A6B0CEA0E0E134343EA0E03036042692E -:10191000CB6A896822F00702334313434361456071 -:101920008460C16002B0BDE8F08100BF3F801CF060 -:10193000036819B923F001030360704743F0010302 -:1019400003607047AFF30080AFF30080AFF3008017 -:101950000B060CD54369AAB143F08003802943618B -:101960000FD0036801F01E01194301607047802900 -:1019700007D0002AF5D1036801F01E0123EA010116 -:101980000160704723F0800380294361F3D17047E1 -:10199000034B5B69184214BF01200020704700BF51 -:1019A000003C0140AFF30080AFF30080AFF3008054 -:1019B000014B5861704700BF003C0140AFF300800D -:1019C000044B1A69002A03DA0349044A59605A6031 -:1019D000704700BF003C024023016745AB89EFCD53 -:1019E000014BD860704700BF003C0240AFF300805D -:1019F0000E4BDA68D20309D4DA68D10601D5062085 -:101A00007047DA68D20503D502207047012070477D -:101A1000DA6812F0E00F01D007207047DB6813F09E -:101A2000020F14BF08200920704700BF003C02408D -:101A300000B583B009238DF80730FFF7D9FF8DF883 -:101A400007009DF80730012BF7D09DF80700C0B2C2 -:101A500003B05DF804FB00BFAFF30080AFF300807C -:101A600070B5064659B301292FD002290CBF4FF497 -:101A700000744FF44074FFF7DBFF092824D1144DA4 -:101A80002B6923F440732B612969214329612B6958 -:101A900023F0F8032B612B6943F002031E432E61F0 -:101AA0002B6943F480332B61FFF7C2FF2B6923F0CE -:101AB00002032B612B6923F0F8032B6170BD0C46E8 -:101AC000FFF7B6FF0928DAD070BD4FF48074F7E74E -:101AD000003C0240AFF30080AFF30080AFF3008022 -:101AE00070B505460E46FFF7A3FF092800D070BD6C -:101AF0000A4C236923F440732361236943F4807300 -:101B00002361236943F0010323612E80FFF790FFD7 -:101B1000236923F00103236170BD00BF003C024034 -:101B2000044A136B19B923EA000010637047184385 -:101B30001063704700380240AFF30080AFF30080BD -:101B4000044A136C19B923EA000010647047184363 -:101B50001064704700380240AFF30080AFF300809C -:101B6000044A536C19B923EA0000506470471843C3 -:101B70005064704700380240AFF30080AFF300803C -:101B8000044A136A19B923EA000010627047184327 -:101B90001062704700380240AFF30080AFF300805E -:101BA000044A536A19B923EA000050627047184387 -:101BB0005062704700380240AFF30080AFF30080FE -:101BC00008B5604B984235D0B0F1804F3CD05E4BA9 -:101BD000984243D05D4B98424AD05D4B984251D0D9 -:101BE0005C4B984258D05C4B98425FD05B4B98421C -:101BF00066D05B4B98426DD05A4B984276D05A4B88 -:101C000098427FD0594B984200F08880584B9842B8 -:101C100000F08E80574B984200D008BD4FF4807082 -:101C20000121FFF7ADFF4FF480700021BDE80840AF -:101C3000FFF7A6BF01200146FFF7B2FF01200021F8 -:101C4000BDE80840FFF7ACBF01200146FFF798FF51 -:101C500001200021BDE80840FFF792BF02200121CA -:101C6000FFF78EFF02200021BDE80840FFF788BF84 -:101C700004200121FFF784FF04200021BDE8084073 -:101C8000FFF77EBF08200121FFF77AFF082000211F -:101C9000BDE80840FFF774BF10200121FFF770FF77 -:101CA00010200021BDE80840FFF76ABF2020012175 -:101CB000FFF766FF20200021BDE80840FFF760BF66 -:101CC00002200121FFF76CFF02200021BDE808403F -:101CD000FFF766BF4FF480300121FFF761FF4FF43B -:101CE00080300021BDE80840FFF75ABF4FF40030B4 -:101CF0000121FFF755FF4FF400300021BDE80840F7 -:101D0000FFF74EBF4FF480200121FFF749FF4FF44A -:101D100080200021BDE80840FFF742BF402001219C -:101D2000FFF72EFF40200021BDE80840FFF728BF45 -:101D300080200121FFF724FF80200021BDE808401A -:101D4000FFF71EBF000001400004004000080040F3 -:101D5000000C00400010004000140040000401404E -:101D6000004001400044014000480140001800408C -:101D7000001C004000200040AFF30080AFF3008063 -:101D8000224A036890429BB212D002F580629042D0 -:101D90000ED0B0F1804F0BD0A2F58032904207D028 -:101DA00002F58062904203D002F58062904203D136 -:101DB0004A8823F070031343154A90421ED002F55F -:101DC000806290421AD00A8970B423F440730F4C99 -:101DD0004E680D889BB21343A0420360C6628562C1 -:101DE00006D00C4B984203D00123436170BC70476E -:101DF0008B7A03630123436170BC704703604A68B8 -:101E00000B88C26283620123436170470000014076 -:101E10000010004000040140AFF30080AFF30080E9 -:101E200029B902684FF67F73134003607047036857 -:101E300043F0800303607047AFF30080AFF300808E -:101E400029B902684FF6FE731340036070470368B8 -:101E500043F0010303607047AFF30080AFF30080ED -:101E6000026A4FF6FE7313400362F0B58A89046A72 -:101E70004B884668174FD0F818C0B1F800E04FF60D -:101E8000FD75254013434FF68C742B430CEA040474 -:101E9000B8429BB2B2B244EA0E0408D00E4DA8423A -:101EA00005D089684260846141630362F0BDCE89D8 -:101EB000B1F812E00D8A8F8823F0080322F44072F3 -:101EC00033434EEA050523F004032A433B4392B211 -:101ED000E7E700BF0000014000040140AFF30080CD -:101EE000026AB1F802C04FF6EF73134003622DE9A6 -:101EF000F041D0F820808D894468D0F818E01C4E5D -:101F00000F884FF6DF7248F6FF4308EA02024CEAF8 -:101F100005050EEA030342EA051243EA0723B0422D -:101F200092B2A4B29BB209D0124DA84206D08968E1 -:101F30004460836181630262BDE8F081CD89B1F8BC -:101F400012800F8AB1F804C022F0800E4EEA051EFE -:101F50004FF6BF7524F440660EEA050548EA07040B -:101F600045EA0C1246EA840492B2A4B2DFE700BF4D -:101F70000000014000040140AFF30080AFF3008097 -:101F8000026AB1F800C04FF6FF63134003622DE907 -:101F9000F041026AB1F802E08C8945681A4EC769BF -:101FA0004FF6FF5313404EEA04044FF68C7243EA97 -:101FB00004233A40B0429BB2ADB242EA0C0209D0CF -:101FC000124CA04206D089684560C261C1630362B9 -:101FD000BDE8F081CC89B1F812800F8AB1F804C055 -:101FE00023F4006E4EEA042E4FF6FF3425F44056DB -:101FF0000EEA040448EA070544EA0C2346EA0515FC -:102000009BB2ADB2DFE700BF000001400004014019 -:10201000026AB1F802C04EF6FF73134003622DE965 -:10202000F041D0F820808D894468D0F81CE0134E30 -:102030000F884DF6FF7348F6FF4208EA03034CEAA7 -:1020400005050EEA020243EA053342EA0722B042DE -:102050009BB2A4B292B209D0094DA84206D08968B9 -:102060004460C26101640362BDE8F0810D8A24F41A -:10207000804444EA8514A4B2F1E700BF00000140A7 -:1020800000040140AFF30080AFF30080AFF30080A5 -:1020900082694FF6F773134019438161704700BF9F -:1020A00082694FF2FF73134043EA012189B28161D3 -:1020B000704700BFAFF30080AFF30080AFF3008044 -:1020C000C2694FF6F77313401943C161704700BFEF -:1020D000C2694FF2FF73134043EA012189B2C16123 -:1020E000704700BFAFF30080AFF30080AFF3008014 -:1020F000F0B50B88B1F802E08F88CE880D894C8945 -:102100008A894EEA03033B4333432B432343134360 -:102110009BB24364F0BD00BFAFF30080AFF300801B -:10212000436C19B9C3F30E034364704743F400438F -:1021300043647047AFF30080AFF30080AFF30080DB -:1021400029B942684FF6FE731340436070474368F5 -:1021500043F0010343607047AFF30080AFF30080AA -:10216000C94389B201617047AFF30080AFF30080CB -:1021700082684FF68F73134019438160704700BF28 -:1021800042684FF68F7313404360436819434160C0 -:10219000704700BFAFF30080AFF30080AFF3008063 -:1021A00082684FF6F8731340836083681943816037 -:1021B000704700BFAFF30080AFF30080AFF3008043 -:1021C00082684FF67F731340836083681943816090 -:1021D000704700BFAFF30080AFF30080AFF3008023 -:1021E000034A536823F4C07318435060704700BF1C -:1021F000002C0040AFF30080AFF30080AFF300800D -:1022000082B0084A00230193536823F07F030193AF -:10221000019B00F07F0003430193019B536002B0D8 -:10222000704700BF002C0040AFF30080AFF3008088 -:10223000024B00F07F001860704700BF002C004088 -:10224000024B40F080001860704700BF002C004037 -:1022500008B5FDF785FCFDF7A3FC002008BD00BF15 -:1022600000B510EE103A1A4A23F00043934283B0AF -:1022700019DDB3F1FF4F04DB30EE400A03B05DF827 -:1022800004FB684600F0CCF800F0030001289DED47 -:10229000000ADDED010A12D002280BD0A0B1012006 -:1022A00000F0DEFDEAE7DFED0B0A00F059FA03B0BB -:1022B0005DF804FB00F054FAB1EE400ADEE700F0EE -:1022C000CFFDB1EE400AD9E700F04AFAD6E700BFE9 -:1022D000D80F493F0000000000000000000000008F -:1022E00000B510EE103A1B4A23F00043934283B02E -:1022F0001ADDB3F1FF4F04DB30EE400A03B05DF8A6 -:1023000004FB684600F08CF800F0030001289DED06 -:10231000000ADDED010A15D002280DD0A8B100F0A9 -:102320001FFAB1EE400AE9E7DFED0B0A002000F0EA -:1023300097FD03B05DF804FB012000F091FDB1EEC4 -:10234000400ADBE700F00CFAD8E7012000F088FD36 -:10235000D4E700BFD80F493F000000000000000094 -:1023600010B52DED028B2A4C8AB0F0EE408A00F0B9 -:102370009FF994F900300133B0EE408A09D0B0EEF5 -:10238000680A00F00DFE20B1F5EEC08AF1EE10FAF9 -:1023900005D4B0EE480A0AB0BDEC028B10BD012393 -:1023A0001C4A009318EE900A002301920893FAF752 -:1023B0002BF82478CDE90401CDE902019CB9002273 -:1023C0000023CDE90623684600F092FDA8B1089BE2 -:1023D000C3B9DDE90601FAF783FA00EE100A0AB084 -:1023E000BDEC028B10BD0020002102460B46FAF71F -:1023F00089F9022CCDE90601E5D100F069FE21231F -:102400000360E4E700F064FE089B0360E1E700BFBF -:102410000C080020503701080000000000000000F8 -:1024200070B510EE103A944A23F00044944286B0FE -:1024300010EE106A054666DD904A94421ADC002BC5 -:10244000DFED8F7A8F4A24F00F0440F3DD80944251 -:1024500070EE677A66D09FED8C7A77EEC76A0120BE -:1024600077EEE67AC5ED006A77EEC77AC5ED017AB8 -:1024700006B070BD854A944266DDB4F1FF4F49DA7B -:10248000E215863AA4EBC25307EE103AFDEEC76A96 -:10249000DFED7F7AF8EEE66A37EE667ACDED036A15 -:1024A00027EE277AFDEEC76AF8EEE66A37EE667A1F -:1024B000CDED046A67EE277AF5EE407AF1EE10FA78 -:1024C000CDED057A40F0B380F5EE406AF1EE10FAFA -:1024D00014BF022301236F4902208DE8030003A8E3 -:1024E000294600F0C5F9002E12DA95ED007AD5EDF7 -:1024F000017AB1EE477AF1EE677A404285ED007AD3 -:10250000C5ED017A04E0002285ED000A426000205A -:1025100006B070BD70EE407A0020C5ED017AC5EDC1 -:10252000007AF5E7DFED5C6A9FED5C7A77EEE67A9C -:10253000012077EEC76A77EEE67AC5ED006A77EE9E -:10254000C77AC5ED017AE3E700F0DAFCDFED546A03 -:10255000DFED4B5A9FED4C7AF6EE007AE0EE267AEC -:10256000FDEEE77A17EE900AF8EEE76A1F28B1EE63 -:10257000666AA6EE250A66EE877A1DDC494A411E88 -:1025800024F0FF0352F82120934215D030EE677AF1 -:1025900085ED007A30EE470A002E30EE670A85EDB1 -:1025A000010AB5DAB1EE477AB1EE400A85ED007A5C -:1025B00085ED010A4042ABE730EE677AE41517EE8D -:1025C000103AC3F3C753E31A082BE1DDDFED327A8B -:1025D0009FED327AF0EE405AE6EE275A30EE650A69 -:1025E000A6EE270AF0EE407AD6EE877A35EEE77A45 -:1025F00017EE103AC3F3C753E41A192C2CDC85EDFF -:10260000007AB0EE650AC5E7944270EE277A10D0E2 -:102610009FED1D7A77EE876A4FF0FF3077EEE67A0E -:10262000C5ED006A77EE877AC5ED017A70E703237E -:1026300051E7DFED196A9FED197A77EEA67A4FF030 -:10264000FF3077EE876A77EEE67AC5ED006A77EEBF -:10265000877AC5ED017A5BE79FED137A9FED135AF8 -:10266000B0EE650AA6EE070A75EEC07AE6EE077AC6 -:10267000D6EE857A8AE700BFD80F493FE3CB1640F4 -:10268000800FC93FD00FC93F43443537800F4943BE -:1026900000008043E03701080044353708A3852E49 -:1026A00084F9223F6037010800A3852E32318D2442 -:1026B00010EE103A23F00042B2F1FF4F70B430D266 -:1026C0006AB3002B3DDBB2F5000F4FEAE3512CD388 -:1026D000A1F17F02C3F31603D10743F4000348BFFF -:1026E0005B00002456105B00254619214FF08072D4 -:1026F000A818984202DC1B1A8518144401394FEAC5 -:1027000043034FEA5202F3D113B104F001031C4416 -:10271000641004F17C5404EBC65300EE103A70BC14 -:102720007047A0EE000A70BC704713F400020DD190 -:102730005B00180202F10102FAD5C2F10102114454 -:10274000C6E730EE400A80EE000AE8E701221144B5 -:10275000BEE700BF00000000000000000000000015 -:1027600010EE103A23F00043B3F1485F2CDAFDEE8F -:10277000C07A17EE903A002B60D020EE007ADFEDA1 -:10278000314A9FED315ADFED315A9FED316ADFED6D -:10279000317ADFED316AA7EE245AE5EE075AA5EE4D -:1027A000876AE6EE077AE7EE876A66EE876A60EE8A -:1027B000C00AB6EE006AE7EE260AF7EE007AD7EE18 -:1027C000060A37EEE00A704720EE007ADFED1D4A78 -:1027D0009FED1D5ADFED1D5A9FED1D6ADFED1D7A3D -:1027E000DFED1D6A1D4AA7EE245A9342E5EE075A13 -:1027F000A5EE876AE6EE077AE7EE876A66EE876AF5 -:10280000D5DD174A934214DC03F17F4307EE903A7B -:10281000B7EE006A36EE676A60EEC00AF6EE005A5E -:10282000E7EE260AD7EE257A77EEE07A36EE670AEB -:102830007047B6EE076AF5EE027AEDE7B7EE000AEA -:10284000704700BF4ED747ADF6740F317CF293B49A -:10285000010DD037610BB6BAABAA2A3D9999993EC2 -:102860000000483F000000000000000000000000E1 -:102870002DE9F04F2DED048BD7B05F1ED74C649D32 -:102880000293D31E48BF131D54F825600191DB103D -:1028900023EAE3736FEA030BB9190393824602EB51 -:1028A000CB0BA3EB070314D41944659801311AAA82 -:1028B000002BAABF50F82340DFEDCC7A07EE904AF8 -:1028C00003F10103A8BFF8EEE77A8B42E2EC017A4C -:1028D000EED1002E1ADB029B1AA9741C01EB8404B2 -:1028E00042A89D00002FC0F2BA81DFEDC07A5246A7 -:1028F0004B1933ED017AF2EC016A9942E6EE877AE0 -:10290000F7D10431A142E0EC017AEBD1029ADFED7C -:10291000B48A9FEDB48A06F18043013B9B00C2EB71 -:10292000827906AA03F104081344904404934FEA01 -:1029300089093446A50056AB2B44002C13ED140A2C -:1029400018DD42A94B1905AA60EE287AB0EE407A4C -:10295000FDEEE77A73ED016AF8EEE77A8B42A7EEB7 -:10296000C87A37EEA60ABDEEC77A17EE100A42F80B -:10297000040FE9D1584600F033FBB0EE409AB4EEB4 -:10298000000A29EE000A00F0C3FAF2EE007AA0EE87 -:10299000679ABBF1000FFDEEC99AF8EEE97A39EEBD -:1029A000679A40F34181601E06AACBF1080352F8F2 -:1029B000201041FA03F202FA03F30DF1180EC91ABE -:1029C0004EF8201019EE900A1044CBF1070309EEDF -:1029D000900A1941002939DD19EE903A002C03F1D3 -:1029E000010309EE903A40F3CB81002210460DF12D -:1029F000140E08E0C3F5807C13B1CEF800C00120AE -:102A0000013294420CDD5EF8043F0028F2D001321E -:102A1000C3F1FF039442CEF800304FF00100F2DC26 -:102A2000BBF1000F10DDBBF1010F00F00481BBF121 -:102A3000020F09D1621E06AB0DF1180E53F82230B9 -:102A400003F03F034EF82230022959D0B5EE409AE8 -:102A5000F1EE10FA66D1631E9E420BDC06AA154405 -:102A6000002255F8040D454542EA0002F9D1002A3A -:102A700040F07081731E06AA52F82330002B40F0FC -:102A80007C81049B4FF0010E53F8042D0EF1010ED2 -:102A9000002AF9D0A644631C73452FDC039A9D18C5 -:102AA000029A05F18045A0180EEB020C659A013DD3 -:102AB00002EB85051AAA02EB800002EB8C0C42AAFD -:102AC00002EB830455F8043F07EE903AF8EEE77AFC -:102AD000002FE0EC017ADFED457A0BDB524600EB8C -:102AE0000901034633ED017AF2EC016A8B42E6EE0E -:102AF000877AF7D16045E4EC017AE3D1744619E7AF -:102B0000B7EE000A30EE499A00289FD0584605914A -:102B100000F066FA39EE409A0599B5EE409AF1EE6A -:102B200010FA98D0B0EE490ACBF10000029100F003 -:102B300057FA9FED2C7A0299B4EEC70AF1EE10FA1B -:102B4000C0F27E81DFED267A60EE277A06A8FDEEE0 -:102B5000E77A631CF8EEE77A0BF1080BA7EEC70AD9 -:102B6000FDEEE77ABDEEC00A10EE102A40F82420F0 -:102B700017EE902A40F823205846B7EE000A039338 -:102B8000029100F02DFA039B0299002BC0F2C7803E -:102B900003F1010E4FEA8E0242AC06A89FED107AB7 -:102BA0001044A71870ED017AF8EEE77A67EE807AA4 -:102BB00020EE070A67ED017AA742F3D1043A1744E1 -:102BC0000025002EC0F2A880002DC0F2A580064C82 -:102BD000DFED067A384600220CE000BF003B01081A -:102BE0000000803B00008043103B01080000000013 -:102BF000AA4208DCF4EC016AB0EC017A0132964298 -:102C0000E6EE877AF4DA56AA02EB850201357545BD -:102C1000A7F1040742ED287AD3D1649A032A5FD83A -:102C2000DFE802F0673737B010D1631E06AA52F80A -:102C300023100912CEE6621E06AB0DF1180E53F8F2 -:102C4000223003F07F034EF82230FDE6F6EE007AE4 -:102C5000B4EEE79AF1EE10FA0ADA0021F6E65FED3B -:102C60001D7A0431A142E0EC017A7FF43BAE4DE6DF -:102C700019EE903A002C03F1010309EE903AC8BF17 -:102C800002213FF7B2AEF7EE007A37EEC99A022181 -:102C9000DCE62EAA5FED2B7A02EB8E0E3EED017A7A -:102CA000964577EE877AF9D1002943D0DDED2E6A7B -:102CB000019AB1EE677A002B76EEE77A82ED007A20 -:102CC00009DD2FA80122B0EC017A0132934277EEA0 -:102CD000877AF8DA09B1F1EE677A019BC3ED017AE0 -:102CE00019EE903A03F0070057B0BDEC048BBDE835 -:102CF000F08F2EAA5FED437A02EB8E0E3EED017A45 -:102D0000013B5A1C77EE877AF8D109B1F1EE677A68 -:102D1000019BC3ED007AE3E75FED4C7A73E7649AB9 -:102D2000032ADDD8DFE802F0130202805FED517A5A -:102D30000029BBD19DED2E7A019A002BC2ED007ABD -:102D400077EE677ABDDC019BC3ED017AC8E75FEDE2 -:102D5000597ADAE706AAABF1080B52F82320002AC9 -:102D60007FF40AAF06AA02EB830252F8040D013B7E -:102D7000ABF1080B0028F8D0FEE64FF0010E89E613 -:102D800000204DE6002B4FDD9A0056A810442EADD2 -:102D9000141D10ED287A2C44A81870ED017A77EEF6 -:102DA000276AA84277EEE67A77EE277AB0EE667A5F -:102DB00064ED017AC0ED006AEFD1012B34DD131D03 -:102DC00056AC1444034414ED287A02442FAC184640 -:102DD00072ED017A77EE876AA24277EEE67A77EEB5 -:102DE000877AB0EE667A60ED017AC2ED006AEFD1C3 -:102DF0005FED827A30AA33ED017A934277EE877ADB -:102E0000F9D1A9B1DDED2E6A9DED2F7A019AF1EE8F -:102E1000677AF1EE666AB1EE477AC2ED027AC2EDE8 -:102E2000006A82ED017A5BE75FED907A0029E9D1D3 -:102E300001982E9A2F9BC0ED027A026043604FE703 -:102E4000BDEEC00A06A810EE102A234640F8242042 -:102E500092E600BF0000000000000000000000003B -:102E600010EE103A23F00043B3F1485F04DAFDEEB0 -:102E7000C07A17EE903A23B360EE007A9FED155AB0 -:102E8000DFED155A9FED156ADFED156A9FED157A96 -:102E9000E7EE855A27EE805AA5EEA76AE6EE276A86 -:102EA000A6EEA77A70B127EE457AF6EE006AA0EE9C -:102EB000A67ADFED0D6AD7EE270AE5EE260A30EE98 -:102EC000600A7047DFED096AE7EE876AA6EE850AB9 -:102ED000704700BFD3C92E2F342FD7B21BEF38361F -:102EE000010D50B98988083CABAA2A3EABAA2ABE7C -:102EF00000207047000000000000000000000000FB -:102F000010EE103A23F0004300EE103A704700BF75 -:102F100010EE102A22F00041CB0D7F3B162B17DC60 -:102F2000002B10EE100A19DB1A491941114222D068 -:102F3000DFED197A70EE277AF5EEC07AF1EE10FA2D -:102F400019DD002A18DB20EA010300EE103A704771 -:102F5000B1F1FF4F0FD330EE000A7047DFED0E7A6C -:102F600070EE277AF5EEC07AF1EE10FA03DD002A52 -:102F700008DB9FED0A0A70474FF4000242FA03F3A0 -:102F80001844E0E70029FFEE007A18BFB0EE670AA8 -:102F9000704700BFFFFF7F00CAF2497100000000C8 -:102FA00010EE103A33F0004001D102207047A0F536 -:102FB0000003B3F1FE4F01D204207047054B421EBF -:102FC0009A4201D803207047A0F1FF40B0FA80F088 -:102FD00040097047FEFF7F00000000000000000075 -:102FE00008B510EE103A33F000422DED028B11D0EF -:102FF000B2F1FF4F11D2B2F5000F13D3D20D02443C -:10300000FE2A2EDC002A1ADD23F0FF4343EAC253D6 -:1030100000EE103ABDEC028B08BDBDEC028B30EE29 -:10302000000A08BD1D4BDFED1E7A984220EE270AEC -:1030300022DB10EE103AC3F3C752193ADFE712F160 -:10304000160F1EDA4CF2503398420ADC9FED158AB7 -:10305000F0EE400AB0EE480A00F02AF820EE080A26 -:10306000D8E79FED118AF0EE400AB0EE480A00F072 -:103070001FF820EE080ACDE7DFED0A0A20EE200A4D -:10308000C8E7193223F0FF4343EAC253DFED077A62 -:1030900000EE103A20EE270ABCE700BFB03CFFFF6D -:1030A0000000004C6042A20DCAF2497100000033DA -:1030B00010EE103A23F0004210EE903A03F0004375 -:1030C000134300EE103A70470000000000000000BB -:1030D000014B1868704700BF380C0020000000004A -:1030E00070B4840746D0541E002A41D0CDB20346A6 -:1030F00002E0621EE4B3144603F8015B9A07F8D1BC -:10310000032C2ED9CDB245EA05250F2C45EA0545FD -:1031100019D903F110022646103E0F2E42F8105C1A -:1031200042F80C5C42F8085C42F8045C02F11002C0 -:10313000F2D8A4F1100222F00F0204F00F041032B2 -:10314000032C13440DD91E462246043A032A46F89E -:10315000045BFAD8221F22F003020432134404F065 -:1031600003042CB1C9B21C4403F8011BA342FBD1D8 -:1031700070BC704714460346C2E700BF0000000061 -:1031800069646C65000000000000000000000000A1 -:103190006D61696E00160118040448080C101418BB -:1031A000001C1D1E1F200000000000000000000089 -:1031B000F1D70008D1D7000831D8000811D800088D -:1031C00021D8000801D80008E1D70008C1D70008BD -:1031D00000000000000000000000000000000000EF -:1031E00000000000000000000000000000000000DF -:1031F00001000000000000000000000000000000CE -:10320000106002400860024000000B00286002408D -:103210000860024006010C00406002400860024065 -:1032200010020D00586002400860024016030E00B4 -:10323000706002400C60024000040F008860024091 -:103240000C60024006051000A06002400C600240C5 -:1032500010061100B86002400C60024016072F00F3 -:1032600010640240086402400008380028640240EC -:1032700008640240060939004064024008640240C4 -:10328000100A3A005864024008640240160B3B00E2 -:10329000706402400C640240000C3C0088640240F0 -:1032A0000C640240060D4400A06402400C6402401D -:1032B000100E4500B86402400C640240160F460030 -:1032C000800000004001000003000000000000003A -:1032D0007573625F6C6C645F70756D7000000000E8 -:1032E0000000000001DC000851DF000821E00008B8 -:1032F0004000400030120020301200200100000089 -:103300004412002000000000000000000000000047 -:1033100000AAA02A00000000FFABFFFF54000140FC -:10332000FFFF00000000565500AA0A008020080098 -:1033300040020000FFFFFFFF15455155FFFF000051 -:103340000000000440000000018020020000000096 -:10335000FFFFFFFF54154554FFFF00000000006011 -:10336000000606000001005500000000FFFFFFFFFF -:1033700055505500FF0F0000000000000000000045 -:103380004000000000000000FFFFFFFF0000000001 -:10339000FFFF00000000000000000000000000002F -:1033A00000000000FFFFFFFF00000000FFFF000023 -:1033B000000000000000000000000000000000000D -:1033C000FFFFFFFF00000000FFFF00000000000003 -:1033D000000000000000000000000000FFFFFFFFF1 -:1033E00000000000FFFF00000000000000000000DF -:1033F0000000000000000000FFFFFFFF00000000D1 -:10340000FFFF0000000000000000000000000000BE -:103410004D61696E20706572696F646963000000B8 -:10342000756172742072782070726F6365737300B7 -:10343000327C8900EDD96877000000590000000057 -:1034400000000000D69FDCA81817AA90437327F647 -:10345000B968EDF4DED409FEE61C1C84DDE80B99A6 -:1034600029274EC400000F03000000000099B73365 -:103470003B76941500F37C000026149E988F000084 -:10348000006A31168F8C059600E7B73F36000000C2 -:1034900000000000AF669ED0385D8A6C20B95422CF -:1034A000AE7CED044C80387486EDCBFA57CBDC193A -:1034B000E22E1DDF5506E5CB01C36DA8B52F48836D -:1034C0007F00679AB2C80000000000000000000002 -:1034D00000000000000000000000000000000000EC -:1034E00000000000000000000000000000000000DC -:1034F00000000000000000000000000000000000CC -:1035000000000000000000000000000025B10000E5 -:10351000000000000000A36900000000000000009F -:10352000005A68555F82B80008CC31AA2C532E008F -:103530006D6370776D2074696D6572000000000026 -:10354000020000000000000071D90008E1D9000865 -:1035500040004000A82C0020BC2C002002000000ED -:10356000000000000000000000000000000000005B -:1035700043000000C035010800000000000000000A -:10358000030000000000000051DA00080000000005 -:10359000100000003C2A0020000000000100000094 -:1035A000000000000000000000000000000000001B -:1035B000410C0108110C010831D90008000000007D -:1035C00009024300020100C03209040000010202A6 -:1035D0000100052400100105240100010424020259 -:1035E0000524060001070582030800FF0904010005 -:1035F000020A0000000705010240000007058102E1 -:10360000400000000000000000000000000000007A -:103610001201100102000040830440570002010221 -:103620000301000000000000000000000000000096 -:103630000403090400000000000000000000000076 -:103640002603530054004D006900630072006F00B0 -:1036500065006C0065006300740072006F006E000E -:10366000690063007300000000000000000000001B -:103670003803430068006900620069004F0053008E -:103680002F005200540020005600690072007400A0 -:10369000750061006C00200043004F004D002000C9 -:1036A00050006F0072007400000000000000000075 -:1036B000080333003000310000000000000000006B -:1036C00004000000303601082600000040360108E2 -:1036D000380000007036010808000000B03601080C -:1036E000B00F0020010102000000000000000000F7 -:1036F0001200000010360108000000000000000069 -:1037000000000800100018002000280030003800D9 -:103710004000480050005800000000000000000079 -:1037200000000008004000080080000800C00008F9 -:10373000000001080000020800000408000006085C -:103740000000080800000A0800000C0800000E082D -:103750007371727466000000000000000000000039 -:10376000000FC93F000F494000CB9640000FC940F1 -:103770000053FB4000CB164100ED2F41000F4941A3 -:103780000031624100537B41003A8A4100CB9641AF -:10379000005CA34100EDAF41007EBC41000FC94178 -:1037A00000A0D5410031E24100C2EE410053FB418F -:1037B00000F20342003A0A420083104200CB164254 -:1037C00000141D42005C234200A5294200ED2F4257 -:1037D00000363642007E3C4200C74242000F49425A -:1037E000A2000000F9000000830000006E0000004D -:1037F0004E000000440000001500000029000000F9 -:10380000FC0000002700000057000000D10000006D -:10381000F500000034000000DD000000C0000000E2 -:10382000DB0000006200000095000000990000002D -:103830003C00000043000000900000004100000038 -:10384000FE0000005100000063000000AB0000001B -:10385000DE000000BB000000C500000061000000A9 -:10386000B7000000240000006E0000003A000000D5 -:10387000420000004D000000D2000000E000000007 -:1038800006000000490000002E000000EA000000D1 -:1038900009000000D1000000920000001C000000A0 -:1038A000FE0000001D000000EB0000001C000000F6 -:1038B000B100000029000000A70000003E00000049 -:1038C000E80000008200000035000000F500000064 -:1038D0002E000000BB000000440000008400000037 -:1038E000E90000009C0000007000000026000000BD -:1038F000B40000005F0000007E00000041000000F6 -:103900003900000091000000D600000039000000DE -:10391000830000005300000039000000F4000000A4 -:103920009C000000840000005F0000008B0000008D -:10393000BD000000F9000000280000003B0000006E -:103940001F000000F800000097000000FF000000CA -:10395000DE00000005000000980000000F000000DD -:10396000EF0000002F000000110000008B0000009D -:103970005A0000000A0000006D0000001F00000057 -:103980006D000000360000007E000000CF00000047 -:1039900027000000CB00000009000000B700000075 -:1039A0004F000000460000003F00000066000000DD -:1039B0009E0000005F000000EA0000002D000000F3 -:1039C0007500000027000000BA000000C7000000DA -:1039D000EB000000E5000000F10000007B000000AB -:1039E0003D0000000700000039000000F700000063 -:1039F0008A0000005200000092000000EA0000006F -:103A00006B000000FB0000005F000000B100000040 -:103A10001F0000008D0000005D0000000800000095 -:103A200056000000030000003000000046000000C7 -:103A3000FC0000007B0000006B000000AB000000F9 -:103A4000F0000000CF000000BC00000020000000DB -:103A50009A000000F4000000360000001D00000085 -:103A6000A9000000E30000009100000061000000D8 -:103A70005E000000E60000001B00000008000000DF -:103A80006500000099000000850000005F00000054 -:103A900014000000A00000006800000040000000CA -:103AA0008D000000FF000000D80000008000000032 -:103AB0004D000000730000002700000031000000EE -:103AC000060000000600000015000000560000007F -:103AD000CA00000073000000A8000000C900000038 -:103AE00060000000E20000007B000000C000000059 -:103AF0008C0000006B0000000000000000000000CF -:103B000004000000070000000900000000000000A1 -:103B10000000C93F0000F0390000DA370000A2338E -:103B20000000842E0000502B0000C2270000D0228D -:103B30000000C41F0000C61B000044170000000066 -:043B4000430000003E -:103B48000096000000000800803E00000100000010 -:103B580000000000FC0A0020640B0020CC0B0020B1 -:103B6800000000000000000000000000000000004D -:103B7800000000000000000000000000000000003D -:103B880000000000403B01080000000000000000A9 -:103B9800000000000000000000000000000000001D -:103BA800000000000000000000000000000000000D -:103BB80000000000000000000000000000000000FD -:103BC80000000000000000000000000000000000ED -:103BD80000000000000000000000000000000000DD -:103BE80000000000000000000000000000000000CD -:103BF80000000000000000000100000000000000BC -:103C08000E33CDAB34126DE6ECDE05000B00000080 -:103C1800000000000000000000000000000000009C -:103C2800000000000000000000000000000000008C -:103C3800000000000000000000000000000000007C -:103C4800000000000000000000000000000000006C -:103C5800000000000000000000000000000000005C -:103C6800000000000000000000000000000000004C -:103C7800000000000000000000000000000000003C -:103C8800000000000000000000000000000000002C -:103C9800000000000000000000000000000000001C -:103CA800000000000000000000000000000000000C -:103CB80000000000000000000000000000000000FC -:103CC80000000000000000000000000000000000EC -:103CD80000000000000000000000000000000000DC -:103CE80000000000000000000000000000000000CC -:103CF80000000000000000000000000000000000BC -:103D080000000000000000000000000000000000AB -:103D1800000000000000000000000000000000009B -:103D2800000000000000000000000000000000008B -:103D3800000000000000000000000000000000007B -:103D4800000000000000000000000000000000006B -:103D5800000000000000000000000000000000005B -:103D6800000000000000000000000000000000004B -:103D7800000000000000000000000000000000003B -:103D8800000000000000000000000000000000002B -:103D9800000000000000000000000000000000001B -:103DA800000000000000000000000000000000000B -:103DB80000000000000000000000000000000000FB -:103DC80000000000000000000000000000000000EB -:103DD80000000000000000000000000000000000DB -:103DE80000000000000000000000000000000000CB -:103DF80000000000000000000000000000000000BB -:103E080000000000000000000000000000000000AA -:103E1800000000000000000000000000000000009A -:103E2800000000000000000000000000000000008A -:103E3800000000000000000000000000000000007A -:103E4800000000000000000000000000000000006A -:103E5800000000000000000000000000000000005A -:103E6800000000000000000000000000000000004A -:103E7800000000000000000000000000000000003A -:103E8800000000000000000000000000000000002A -:103E9800000000000000000000000000000000001A -:103EA800000000000000000000000000000000000A -:103EB80000000000000000000000000000000000FA -:103EC80000000000000000000000000000000000EA -:103ED80000000000000000000000000000000000DA -:103EE80000000000000000000000000000000000CA -:103EF80000000000000000000000000000000000BA -:103F080000000000000000000000000000000000A9 -:103F18000000000000000000000000000000000099 -:103F28000000000000000000000000000000000089 -:103F38000000000000000000000000000000000079 -:103F48000000000000000000000000000000000069 -:103F58000000000000000000000000000000000059 -:103F68000000000000000000000000000000000049 -:0C3F780000000000000000001008002005 -:040000050800C0012E -:00000001FF diff --git a/oroca_bldc_FW/build/oroca_bldc.list b/oroca_bldc_FW/build/oroca_bldc.list deleted file mode 100755 index e386dfb..0000000 --- a/oroca_bldc_FW/build/oroca_bldc.list +++ /dev/null @@ -1,27117 +0,0 @@ - -build/oroca_bldc.elf: file format elf32-littlearm - - -Disassembly of section .text: - -0800c000 : - 800c000: b672 cpsid i - 800c002: 4833 ldr r0, [pc, #204] ; (800c0d0 ) - 800c004: f380 8809 msr PSP, r0 - 800c008: f240 0000 movw r0, #0 - 800c00c: f2cc 0000 movt r0, #49152 ; 0xc000 - 800c010: f64e 7134 movw r1, #61236 ; 0xef34 - 800c014: f2ce 0100 movt r1, #57344 ; 0xe000 - 800c018: 6008 str r0, [r1, #0] - 800c01a: f3bf 8f4f dsb sy - 800c01e: f3bf 8f6f isb sy - 800c022: f240 0000 movw r0, #0 - 800c026: f2c0 00f0 movt r0, #240 ; 0xf0 - 800c02a: f64e 5188 movw r1, #60808 ; 0xed88 - 800c02e: f2ce 0100 movt r1, #57344 ; 0xe000 - 800c032: 6008 str r0, [r1, #0] - 800c034: f3bf 8f4f dsb sy - 800c038: f3bf 8f6f isb sy - 800c03c: f04f 0000 mov.w r0, #0 - 800c040: eee1 0a10 vmsr fpscr, r0 - 800c044: f64e 713c movw r1, #61244 ; 0xef3c - 800c048: f2ce 0100 movt r1, #57344 ; 0xe000 - 800c04c: 6008 str r0, [r1, #0] - 800c04e: 2006 movs r0, #6 - 800c050: f380 8814 msr CONTROL, r0 - 800c054: f3bf 8f6f isb sy - 800c058: f000 fd32 bl 800cac0 <__core_init> - 800c05c: f003 fd60 bl 800fb20 <__early_init> - 800c060: 481c ldr r0, [pc, #112] ; (800c0d4 ) - 800c062: 491d ldr r1, [pc, #116] ; (800c0d8 ) - 800c064: 4a1d ldr r2, [pc, #116] ; (800c0dc ) - -0800c066 : - 800c066: 4291 cmp r1, r2 - 800c068: bf3c itt cc - 800c06a: f841 0b04 strcc.w r0, [r1], #4 - 800c06e: e7fa bcc.n 800c066 - 800c070: 491b ldr r1, [pc, #108] ; (800c0e0 ) - 800c072: 4a17 ldr r2, [pc, #92] ; (800c0d0 ) - -0800c074 : - 800c074: 4291 cmp r1, r2 - 800c076: bf3c itt cc - 800c078: f841 0b04 strcc.w r0, [r1], #4 - 800c07c: e7fa bcc.n 800c074 - 800c07e: 4919 ldr r1, [pc, #100] ; (800c0e4 ) - 800c080: 4a19 ldr r2, [pc, #100] ; (800c0e8 ) - 800c082: 4b1a ldr r3, [pc, #104] ; (800c0ec ) - -0800c084 : - 800c084: 429a cmp r2, r3 - 800c086: bf3e ittt cc - 800c088: f851 0b04 ldrcc.w r0, [r1], #4 - 800c08c: f842 0b04 strcc.w r0, [r2], #4 - 800c090: e7f8 bcc.n 800c084 - 800c092: 2000 movs r0, #0 - 800c094: 4916 ldr r1, [pc, #88] ; (800c0f0 ) - 800c096: 4a17 ldr r2, [pc, #92] ; (800c0f4 ) - -0800c098 : - 800c098: 4291 cmp r1, r2 - 800c09a: bf3c itt cc - 800c09c: f841 0b04 strcc.w r0, [r1], #4 - 800c0a0: e7fa bcc.n 800c098 - 800c0a2: f000 fd15 bl 800cad0 <__late_init> - 800c0a6: 4c14 ldr r4, [pc, #80] ; (800c0f8 ) - 800c0a8: 4d14 ldr r5, [pc, #80] ; (800c0fc ) - -0800c0aa : - 800c0aa: 42ac cmp r4, r5 - 800c0ac: da03 bge.n 800c0b6 - 800c0ae: f854 1b04 ldr.w r1, [r4], #4 - 800c0b2: 4788 blx r1 - 800c0b4: e7f9 b.n 800c0aa - -0800c0b6 : - 800c0b6: f006 f8cb bl 8012250
- 800c0ba: 4c11 ldr r4, [pc, #68] ; (800c100 ) - 800c0bc: 4d11 ldr r5, [pc, #68] ; (800c104 ) - -0800c0be : - 800c0be: 42ac cmp r4, r5 - 800c0c0: da03 bge.n 800c0ca - 800c0c2: f854 1b04 ldr.w r1, [r4], #4 - 800c0c6: 4788 blx r1 - 800c0c8: e7f9 b.n 800c0be - -0800c0ca : - 800c0ca: f000 bd09 b.w 800cae0 <__default_exit> - 800c0ce: 0000 .short 0x0000 - 800c0d0: 20000800 .word 0x20000800 - 800c0d4: 55555555 .word 0x55555555 - 800c0d8: 20000000 .word 0x20000000 - 800c0dc: 20000400 .word 0x20000400 - 800c0e0: 20000400 .word 0x20000400 - 800c0e4: 08013b48 .word 0x08013b48 - 800c0e8: 20000800 .word 0x20000800 - 800c0ec: 20000c3c .word 0x20000c3c - 800c0f0: 20000c40 .word 0x20000c40 - 800c0f4: 20002e28 .word 0x20002e28 - 800c0f8: 0800c000 .word 0x0800c000 - 800c0fc: 0800c000 .word 0x0800c000 - 800c100: 0800c000 .word 0x0800c000 - 800c104: 0800c000 .word 0x0800c000 - ... - -0800c110 <_port_switch>: - 800c110: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - 800c114: ed2d 8a10 vpush {s16-s31} - 800c118: f8c1 d00c str.w sp, [r1, #12] - 800c11c: f8d0 d00c ldr.w sp, [r0, #12] - 800c120: ecbd 8a10 vpop {s16-s31} - 800c124: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - -0800c128 <_port_thread_start>: - 800c128: 2300 movs r3, #0 - 800c12a: f383 8811 msr BASEPRI, r3 - 800c12e: 4628 mov r0, r5 - 800c130: 47a0 blx r4 - 800c132: 2000 movs r0, #0 - 800c134: f000 ffe4 bl 800d100 - -0800c138 <_port_switch_from_isr>: - 800c138: f000 ff02 bl 800cf40 - -0800c13c <_port_exit_from_isr>: - 800c13c: df00 svc 0 - 800c13e: e7fe b.n 800c13e <_port_exit_from_isr+0x2> - -0800c140 <__aeabi_drsub>: - 800c140: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000 - 800c144: e002 b.n 800c14c <__adddf3> - 800c146: bf00 nop - -0800c148 <__aeabi_dsub>: - 800c148: f083 4300 eor.w r3, r3, #2147483648 ; 0x80000000 - -0800c14c <__adddf3>: - 800c14c: b530 push {r4, r5, lr} - 800c14e: ea4f 0441 mov.w r4, r1, lsl #1 - 800c152: ea4f 0543 mov.w r5, r3, lsl #1 - 800c156: ea94 0f05 teq r4, r5 - 800c15a: bf08 it eq - 800c15c: ea90 0f02 teqeq r0, r2 - 800c160: bf1f itttt ne - 800c162: ea54 0c00 orrsne.w ip, r4, r0 - 800c166: ea55 0c02 orrsne.w ip, r5, r2 - 800c16a: ea7f 5c64 mvnsne.w ip, r4, asr #21 - 800c16e: ea7f 5c65 mvnsne.w ip, r5, asr #21 - 800c172: f000 80e2 beq.w 800c33a <__adddf3+0x1ee> - 800c176: ea4f 5454 mov.w r4, r4, lsr #21 - 800c17a: ebd4 5555 rsbs r5, r4, r5, lsr #21 - 800c17e: bfb8 it lt - 800c180: 426d neglt r5, r5 - 800c182: dd0c ble.n 800c19e <__adddf3+0x52> - 800c184: 442c add r4, r5 - 800c186: ea80 0202 eor.w r2, r0, r2 - 800c18a: ea81 0303 eor.w r3, r1, r3 - 800c18e: ea82 0000 eor.w r0, r2, r0 - 800c192: ea83 0101 eor.w r1, r3, r1 - 800c196: ea80 0202 eor.w r2, r0, r2 - 800c19a: ea81 0303 eor.w r3, r1, r3 - 800c19e: 2d36 cmp r5, #54 ; 0x36 - 800c1a0: bf88 it hi - 800c1a2: bd30 pophi {r4, r5, pc} - 800c1a4: f011 4f00 tst.w r1, #2147483648 ; 0x80000000 - 800c1a8: ea4f 3101 mov.w r1, r1, lsl #12 - 800c1ac: f44f 1c80 mov.w ip, #1048576 ; 0x100000 - 800c1b0: ea4c 3111 orr.w r1, ip, r1, lsr #12 - 800c1b4: d002 beq.n 800c1bc <__adddf3+0x70> - 800c1b6: 4240 negs r0, r0 - 800c1b8: eb61 0141 sbc.w r1, r1, r1, lsl #1 - 800c1bc: f013 4f00 tst.w r3, #2147483648 ; 0x80000000 - 800c1c0: ea4f 3303 mov.w r3, r3, lsl #12 - 800c1c4: ea4c 3313 orr.w r3, ip, r3, lsr #12 - 800c1c8: d002 beq.n 800c1d0 <__adddf3+0x84> - 800c1ca: 4252 negs r2, r2 - 800c1cc: eb63 0343 sbc.w r3, r3, r3, lsl #1 - 800c1d0: ea94 0f05 teq r4, r5 - 800c1d4: f000 80a7 beq.w 800c326 <__adddf3+0x1da> - 800c1d8: f1a4 0401 sub.w r4, r4, #1 - 800c1dc: f1d5 0e20 rsbs lr, r5, #32 - 800c1e0: db0d blt.n 800c1fe <__adddf3+0xb2> - 800c1e2: fa02 fc0e lsl.w ip, r2, lr - 800c1e6: fa22 f205 lsr.w r2, r2, r5 - 800c1ea: 1880 adds r0, r0, r2 - 800c1ec: f141 0100 adc.w r1, r1, #0 - 800c1f0: fa03 f20e lsl.w r2, r3, lr - 800c1f4: 1880 adds r0, r0, r2 - 800c1f6: fa43 f305 asr.w r3, r3, r5 - 800c1fa: 4159 adcs r1, r3 - 800c1fc: e00e b.n 800c21c <__adddf3+0xd0> - 800c1fe: f1a5 0520 sub.w r5, r5, #32 - 800c202: f10e 0e20 add.w lr, lr, #32 - 800c206: 2a01 cmp r2, #1 - 800c208: fa03 fc0e lsl.w ip, r3, lr - 800c20c: bf28 it cs - 800c20e: f04c 0c02 orrcs.w ip, ip, #2 - 800c212: fa43 f305 asr.w r3, r3, r5 - 800c216: 18c0 adds r0, r0, r3 - 800c218: eb51 71e3 adcs.w r1, r1, r3, asr #31 - 800c21c: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000 - 800c220: d507 bpl.n 800c232 <__adddf3+0xe6> - 800c222: f04f 0e00 mov.w lr, #0 - 800c226: f1dc 0c00 rsbs ip, ip, #0 - 800c22a: eb7e 0000 sbcs.w r0, lr, r0 - 800c22e: eb6e 0101 sbc.w r1, lr, r1 - 800c232: f5b1 1f80 cmp.w r1, #1048576 ; 0x100000 - 800c236: d31b bcc.n 800c270 <__adddf3+0x124> - 800c238: f5b1 1f00 cmp.w r1, #2097152 ; 0x200000 - 800c23c: d30c bcc.n 800c258 <__adddf3+0x10c> - 800c23e: 0849 lsrs r1, r1, #1 - 800c240: ea5f 0030 movs.w r0, r0, rrx - 800c244: ea4f 0c3c mov.w ip, ip, rrx - 800c248: f104 0401 add.w r4, r4, #1 - 800c24c: ea4f 5244 mov.w r2, r4, lsl #21 - 800c250: f512 0f80 cmn.w r2, #4194304 ; 0x400000 - 800c254: f080 809a bcs.w 800c38c <__adddf3+0x240> - 800c258: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000 - 800c25c: bf08 it eq - 800c25e: ea5f 0c50 movseq.w ip, r0, lsr #1 - 800c262: f150 0000 adcs.w r0, r0, #0 - 800c266: eb41 5104 adc.w r1, r1, r4, lsl #20 - 800c26a: ea41 0105 orr.w r1, r1, r5 - 800c26e: bd30 pop {r4, r5, pc} - 800c270: ea5f 0c4c movs.w ip, ip, lsl #1 - 800c274: 4140 adcs r0, r0 - 800c276: eb41 0101 adc.w r1, r1, r1 - 800c27a: f411 1f80 tst.w r1, #1048576 ; 0x100000 - 800c27e: f1a4 0401 sub.w r4, r4, #1 - 800c282: d1e9 bne.n 800c258 <__adddf3+0x10c> - 800c284: f091 0f00 teq r1, #0 - 800c288: bf04 itt eq - 800c28a: 4601 moveq r1, r0 - 800c28c: 2000 moveq r0, #0 - 800c28e: fab1 f381 clz r3, r1 - 800c292: bf08 it eq - 800c294: 3320 addeq r3, #32 - 800c296: f1a3 030b sub.w r3, r3, #11 - 800c29a: f1b3 0220 subs.w r2, r3, #32 - 800c29e: da0c bge.n 800c2ba <__adddf3+0x16e> - 800c2a0: 320c adds r2, #12 - 800c2a2: dd08 ble.n 800c2b6 <__adddf3+0x16a> - 800c2a4: f102 0c14 add.w ip, r2, #20 - 800c2a8: f1c2 020c rsb r2, r2, #12 - 800c2ac: fa01 f00c lsl.w r0, r1, ip - 800c2b0: fa21 f102 lsr.w r1, r1, r2 - 800c2b4: e00c b.n 800c2d0 <__adddf3+0x184> - 800c2b6: f102 0214 add.w r2, r2, #20 - 800c2ba: bfd8 it le - 800c2bc: f1c2 0c20 rsble ip, r2, #32 - 800c2c0: fa01 f102 lsl.w r1, r1, r2 - 800c2c4: fa20 fc0c lsr.w ip, r0, ip - 800c2c8: bfdc itt le - 800c2ca: ea41 010c orrle.w r1, r1, ip - 800c2ce: 4090 lslle r0, r2 - 800c2d0: 1ae4 subs r4, r4, r3 - 800c2d2: bfa2 ittt ge - 800c2d4: eb01 5104 addge.w r1, r1, r4, lsl #20 - 800c2d8: 4329 orrge r1, r5 - 800c2da: bd30 popge {r4, r5, pc} - 800c2dc: ea6f 0404 mvn.w r4, r4 - 800c2e0: 3c1f subs r4, #31 - 800c2e2: da1c bge.n 800c31e <__adddf3+0x1d2> - 800c2e4: 340c adds r4, #12 - 800c2e6: dc0e bgt.n 800c306 <__adddf3+0x1ba> - 800c2e8: f104 0414 add.w r4, r4, #20 - 800c2ec: f1c4 0220 rsb r2, r4, #32 - 800c2f0: fa20 f004 lsr.w r0, r0, r4 - 800c2f4: fa01 f302 lsl.w r3, r1, r2 - 800c2f8: ea40 0003 orr.w r0, r0, r3 - 800c2fc: fa21 f304 lsr.w r3, r1, r4 - 800c300: ea45 0103 orr.w r1, r5, r3 - 800c304: bd30 pop {r4, r5, pc} - 800c306: f1c4 040c rsb r4, r4, #12 - 800c30a: f1c4 0220 rsb r2, r4, #32 - 800c30e: fa20 f002 lsr.w r0, r0, r2 - 800c312: fa01 f304 lsl.w r3, r1, r4 - 800c316: ea40 0003 orr.w r0, r0, r3 - 800c31a: 4629 mov r1, r5 - 800c31c: bd30 pop {r4, r5, pc} - 800c31e: fa21 f004 lsr.w r0, r1, r4 - 800c322: 4629 mov r1, r5 - 800c324: bd30 pop {r4, r5, pc} - 800c326: f094 0f00 teq r4, #0 - 800c32a: f483 1380 eor.w r3, r3, #1048576 ; 0x100000 - 800c32e: bf06 itte eq - 800c330: f481 1180 eoreq.w r1, r1, #1048576 ; 0x100000 - 800c334: 3401 addeq r4, #1 - 800c336: 3d01 subne r5, #1 - 800c338: e74e b.n 800c1d8 <__adddf3+0x8c> - 800c33a: ea7f 5c64 mvns.w ip, r4, asr #21 - 800c33e: bf18 it ne - 800c340: ea7f 5c65 mvnsne.w ip, r5, asr #21 - 800c344: d029 beq.n 800c39a <__adddf3+0x24e> - 800c346: ea94 0f05 teq r4, r5 - 800c34a: bf08 it eq - 800c34c: ea90 0f02 teqeq r0, r2 - 800c350: d005 beq.n 800c35e <__adddf3+0x212> - 800c352: ea54 0c00 orrs.w ip, r4, r0 - 800c356: bf04 itt eq - 800c358: 4619 moveq r1, r3 - 800c35a: 4610 moveq r0, r2 - 800c35c: bd30 pop {r4, r5, pc} - 800c35e: ea91 0f03 teq r1, r3 - 800c362: bf1e ittt ne - 800c364: 2100 movne r1, #0 - 800c366: 2000 movne r0, #0 - 800c368: bd30 popne {r4, r5, pc} - 800c36a: ea5f 5c54 movs.w ip, r4, lsr #21 - 800c36e: d105 bne.n 800c37c <__adddf3+0x230> - 800c370: 0040 lsls r0, r0, #1 - 800c372: 4149 adcs r1, r1 - 800c374: bf28 it cs - 800c376: f041 4100 orrcs.w r1, r1, #2147483648 ; 0x80000000 - 800c37a: bd30 pop {r4, r5, pc} - 800c37c: f514 0480 adds.w r4, r4, #4194304 ; 0x400000 - 800c380: bf3c itt cc - 800c382: f501 1180 addcc.w r1, r1, #1048576 ; 0x100000 - 800c386: bd30 popcc {r4, r5, pc} - 800c388: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000 - 800c38c: f045 41fe orr.w r1, r5, #2130706432 ; 0x7f000000 - 800c390: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000 - 800c394: f04f 0000 mov.w r0, #0 - 800c398: bd30 pop {r4, r5, pc} - 800c39a: ea7f 5c64 mvns.w ip, r4, asr #21 - 800c39e: bf1a itte ne - 800c3a0: 4619 movne r1, r3 - 800c3a2: 4610 movne r0, r2 - 800c3a4: ea7f 5c65 mvnseq.w ip, r5, asr #21 - 800c3a8: bf1c itt ne - 800c3aa: 460b movne r3, r1 - 800c3ac: 4602 movne r2, r0 - 800c3ae: ea50 3401 orrs.w r4, r0, r1, lsl #12 - 800c3b2: bf06 itte eq - 800c3b4: ea52 3503 orrseq.w r5, r2, r3, lsl #12 - 800c3b8: ea91 0f03 teqeq r1, r3 - 800c3bc: f441 2100 orrne.w r1, r1, #524288 ; 0x80000 - 800c3c0: bd30 pop {r4, r5, pc} - 800c3c2: bf00 nop - -0800c3c4 <__aeabi_ui2d>: - 800c3c4: f090 0f00 teq r0, #0 - 800c3c8: bf04 itt eq - 800c3ca: 2100 moveq r1, #0 - 800c3cc: 4770 bxeq lr - 800c3ce: b530 push {r4, r5, lr} - 800c3d0: f44f 6480 mov.w r4, #1024 ; 0x400 - 800c3d4: f104 0432 add.w r4, r4, #50 ; 0x32 - 800c3d8: f04f 0500 mov.w r5, #0 - 800c3dc: f04f 0100 mov.w r1, #0 - 800c3e0: e750 b.n 800c284 <__adddf3+0x138> - 800c3e2: bf00 nop - -0800c3e4 <__aeabi_i2d>: - 800c3e4: f090 0f00 teq r0, #0 - 800c3e8: bf04 itt eq - 800c3ea: 2100 moveq r1, #0 - 800c3ec: 4770 bxeq lr - 800c3ee: b530 push {r4, r5, lr} - 800c3f0: f44f 6480 mov.w r4, #1024 ; 0x400 - 800c3f4: f104 0432 add.w r4, r4, #50 ; 0x32 - 800c3f8: f010 4500 ands.w r5, r0, #2147483648 ; 0x80000000 - 800c3fc: bf48 it mi - 800c3fe: 4240 negmi r0, r0 - 800c400: f04f 0100 mov.w r1, #0 - 800c404: e73e b.n 800c284 <__adddf3+0x138> - 800c406: bf00 nop - -0800c408 <__aeabi_f2d>: - 800c408: 0042 lsls r2, r0, #1 - 800c40a: ea4f 01e2 mov.w r1, r2, asr #3 - 800c40e: ea4f 0131 mov.w r1, r1, rrx - 800c412: ea4f 7002 mov.w r0, r2, lsl #28 - 800c416: bf1f itttt ne - 800c418: f012 437f andsne.w r3, r2, #4278190080 ; 0xff000000 - 800c41c: f093 4f7f teqne r3, #4278190080 ; 0xff000000 - 800c420: f081 5160 eorne.w r1, r1, #939524096 ; 0x38000000 - 800c424: 4770 bxne lr - 800c426: f092 0f00 teq r2, #0 - 800c42a: bf14 ite ne - 800c42c: f093 4f7f teqne r3, #4278190080 ; 0xff000000 - 800c430: 4770 bxeq lr - 800c432: b530 push {r4, r5, lr} - 800c434: f44f 7460 mov.w r4, #896 ; 0x380 - 800c438: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000 - 800c43c: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000 - 800c440: e720 b.n 800c284 <__adddf3+0x138> - 800c442: bf00 nop - -0800c444 <__aeabi_ul2d>: - 800c444: ea50 0201 orrs.w r2, r0, r1 - 800c448: bf08 it eq - 800c44a: 4770 bxeq lr - 800c44c: b530 push {r4, r5, lr} - 800c44e: f04f 0500 mov.w r5, #0 - 800c452: e00a b.n 800c46a <__aeabi_l2d+0x16> - -0800c454 <__aeabi_l2d>: - 800c454: ea50 0201 orrs.w r2, r0, r1 - 800c458: bf08 it eq - 800c45a: 4770 bxeq lr - 800c45c: b530 push {r4, r5, lr} - 800c45e: f011 4500 ands.w r5, r1, #2147483648 ; 0x80000000 - 800c462: d502 bpl.n 800c46a <__aeabi_l2d+0x16> - 800c464: 4240 negs r0, r0 - 800c466: eb61 0141 sbc.w r1, r1, r1, lsl #1 - 800c46a: f44f 6480 mov.w r4, #1024 ; 0x400 - 800c46e: f104 0432 add.w r4, r4, #50 ; 0x32 - 800c472: ea5f 5c91 movs.w ip, r1, lsr #22 - 800c476: f43f aedc beq.w 800c232 <__adddf3+0xe6> - 800c47a: f04f 0203 mov.w r2, #3 - 800c47e: ea5f 0cdc movs.w ip, ip, lsr #3 - 800c482: bf18 it ne - 800c484: 3203 addne r2, #3 - 800c486: ea5f 0cdc movs.w ip, ip, lsr #3 - 800c48a: bf18 it ne - 800c48c: 3203 addne r2, #3 - 800c48e: eb02 02dc add.w r2, r2, ip, lsr #3 - 800c492: f1c2 0320 rsb r3, r2, #32 - 800c496: fa00 fc03 lsl.w ip, r0, r3 - 800c49a: fa20 f002 lsr.w r0, r0, r2 - 800c49e: fa01 fe03 lsl.w lr, r1, r3 - 800c4a2: ea40 000e orr.w r0, r0, lr - 800c4a6: fa21 f102 lsr.w r1, r1, r2 - 800c4aa: 4414 add r4, r2 - 800c4ac: e6c1 b.n 800c232 <__adddf3+0xe6> - 800c4ae: bf00 nop - -0800c4b0 <__aeabi_dmul>: - 800c4b0: b570 push {r4, r5, r6, lr} - 800c4b2: f04f 0cff mov.w ip, #255 ; 0xff - 800c4b6: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700 - 800c4ba: ea1c 5411 ands.w r4, ip, r1, lsr #20 - 800c4be: bf1d ittte ne - 800c4c0: ea1c 5513 andsne.w r5, ip, r3, lsr #20 - 800c4c4: ea94 0f0c teqne r4, ip - 800c4c8: ea95 0f0c teqne r5, ip - 800c4cc: f000 f8de bleq 800c68c <__aeabi_dmul+0x1dc> - 800c4d0: 442c add r4, r5 - 800c4d2: ea81 0603 eor.w r6, r1, r3 - 800c4d6: ea21 514c bic.w r1, r1, ip, lsl #21 - 800c4da: ea23 534c bic.w r3, r3, ip, lsl #21 - 800c4de: ea50 3501 orrs.w r5, r0, r1, lsl #12 - 800c4e2: bf18 it ne - 800c4e4: ea52 3503 orrsne.w r5, r2, r3, lsl #12 - 800c4e8: f441 1180 orr.w r1, r1, #1048576 ; 0x100000 - 800c4ec: f443 1380 orr.w r3, r3, #1048576 ; 0x100000 - 800c4f0: d038 beq.n 800c564 <__aeabi_dmul+0xb4> - 800c4f2: fba0 ce02 umull ip, lr, r0, r2 - 800c4f6: f04f 0500 mov.w r5, #0 - 800c4fa: fbe1 e502 umlal lr, r5, r1, r2 - 800c4fe: f006 4200 and.w r2, r6, #2147483648 ; 0x80000000 - 800c502: fbe0 e503 umlal lr, r5, r0, r3 - 800c506: f04f 0600 mov.w r6, #0 - 800c50a: fbe1 5603 umlal r5, r6, r1, r3 - 800c50e: f09c 0f00 teq ip, #0 - 800c512: bf18 it ne - 800c514: f04e 0e01 orrne.w lr, lr, #1 - 800c518: f1a4 04ff sub.w r4, r4, #255 ; 0xff - 800c51c: f5b6 7f00 cmp.w r6, #512 ; 0x200 - 800c520: f564 7440 sbc.w r4, r4, #768 ; 0x300 - 800c524: d204 bcs.n 800c530 <__aeabi_dmul+0x80> - 800c526: ea5f 0e4e movs.w lr, lr, lsl #1 - 800c52a: 416d adcs r5, r5 - 800c52c: eb46 0606 adc.w r6, r6, r6 - 800c530: ea42 21c6 orr.w r1, r2, r6, lsl #11 - 800c534: ea41 5155 orr.w r1, r1, r5, lsr #21 - 800c538: ea4f 20c5 mov.w r0, r5, lsl #11 - 800c53c: ea40 505e orr.w r0, r0, lr, lsr #21 - 800c540: ea4f 2ece mov.w lr, lr, lsl #11 - 800c544: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd - 800c548: bf88 it hi - 800c54a: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700 - 800c54e: d81e bhi.n 800c58e <__aeabi_dmul+0xde> - 800c550: f1be 4f00 cmp.w lr, #2147483648 ; 0x80000000 - 800c554: bf08 it eq - 800c556: ea5f 0e50 movseq.w lr, r0, lsr #1 - 800c55a: f150 0000 adcs.w r0, r0, #0 - 800c55e: eb41 5104 adc.w r1, r1, r4, lsl #20 - 800c562: bd70 pop {r4, r5, r6, pc} - 800c564: f006 4600 and.w r6, r6, #2147483648 ; 0x80000000 - 800c568: ea46 0101 orr.w r1, r6, r1 - 800c56c: ea40 0002 orr.w r0, r0, r2 - 800c570: ea81 0103 eor.w r1, r1, r3 - 800c574: ebb4 045c subs.w r4, r4, ip, lsr #1 - 800c578: bfc2 ittt gt - 800c57a: ebd4 050c rsbsgt r5, r4, ip - 800c57e: ea41 5104 orrgt.w r1, r1, r4, lsl #20 - 800c582: bd70 popgt {r4, r5, r6, pc} - 800c584: f441 1180 orr.w r1, r1, #1048576 ; 0x100000 - 800c588: f04f 0e00 mov.w lr, #0 - 800c58c: 3c01 subs r4, #1 - 800c58e: f300 80ab bgt.w 800c6e8 <__aeabi_dmul+0x238> - 800c592: f114 0f36 cmn.w r4, #54 ; 0x36 - 800c596: bfde ittt le - 800c598: 2000 movle r0, #0 - 800c59a: f001 4100 andle.w r1, r1, #2147483648 ; 0x80000000 - 800c59e: bd70 pople {r4, r5, r6, pc} - 800c5a0: f1c4 0400 rsb r4, r4, #0 - 800c5a4: 3c20 subs r4, #32 - 800c5a6: da35 bge.n 800c614 <__aeabi_dmul+0x164> - 800c5a8: 340c adds r4, #12 - 800c5aa: dc1b bgt.n 800c5e4 <__aeabi_dmul+0x134> - 800c5ac: f104 0414 add.w r4, r4, #20 - 800c5b0: f1c4 0520 rsb r5, r4, #32 - 800c5b4: fa00 f305 lsl.w r3, r0, r5 - 800c5b8: fa20 f004 lsr.w r0, r0, r4 - 800c5bc: fa01 f205 lsl.w r2, r1, r5 - 800c5c0: ea40 0002 orr.w r0, r0, r2 - 800c5c4: f001 4200 and.w r2, r1, #2147483648 ; 0x80000000 - 800c5c8: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000 - 800c5cc: eb10 70d3 adds.w r0, r0, r3, lsr #31 - 800c5d0: fa21 f604 lsr.w r6, r1, r4 - 800c5d4: eb42 0106 adc.w r1, r2, r6 - 800c5d8: ea5e 0e43 orrs.w lr, lr, r3, lsl #1 - 800c5dc: bf08 it eq - 800c5de: ea20 70d3 biceq.w r0, r0, r3, lsr #31 - 800c5e2: bd70 pop {r4, r5, r6, pc} - 800c5e4: f1c4 040c rsb r4, r4, #12 - 800c5e8: f1c4 0520 rsb r5, r4, #32 - 800c5ec: fa00 f304 lsl.w r3, r0, r4 - 800c5f0: fa20 f005 lsr.w r0, r0, r5 - 800c5f4: fa01 f204 lsl.w r2, r1, r4 - 800c5f8: ea40 0002 orr.w r0, r0, r2 - 800c5fc: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000 - 800c600: eb10 70d3 adds.w r0, r0, r3, lsr #31 - 800c604: f141 0100 adc.w r1, r1, #0 - 800c608: ea5e 0e43 orrs.w lr, lr, r3, lsl #1 - 800c60c: bf08 it eq - 800c60e: ea20 70d3 biceq.w r0, r0, r3, lsr #31 - 800c612: bd70 pop {r4, r5, r6, pc} - 800c614: f1c4 0520 rsb r5, r4, #32 - 800c618: fa00 f205 lsl.w r2, r0, r5 - 800c61c: ea4e 0e02 orr.w lr, lr, r2 - 800c620: fa20 f304 lsr.w r3, r0, r4 - 800c624: fa01 f205 lsl.w r2, r1, r5 - 800c628: ea43 0302 orr.w r3, r3, r2 - 800c62c: fa21 f004 lsr.w r0, r1, r4 - 800c630: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000 - 800c634: fa21 f204 lsr.w r2, r1, r4 - 800c638: ea20 0002 bic.w r0, r0, r2 - 800c63c: eb00 70d3 add.w r0, r0, r3, lsr #31 - 800c640: ea5e 0e43 orrs.w lr, lr, r3, lsl #1 - 800c644: bf08 it eq - 800c646: ea20 70d3 biceq.w r0, r0, r3, lsr #31 - 800c64a: bd70 pop {r4, r5, r6, pc} - 800c64c: f094 0f00 teq r4, #0 - 800c650: d10f bne.n 800c672 <__aeabi_dmul+0x1c2> - 800c652: f001 4600 and.w r6, r1, #2147483648 ; 0x80000000 - 800c656: 0040 lsls r0, r0, #1 - 800c658: eb41 0101 adc.w r1, r1, r1 - 800c65c: f411 1f80 tst.w r1, #1048576 ; 0x100000 - 800c660: bf08 it eq - 800c662: 3c01 subeq r4, #1 - 800c664: d0f7 beq.n 800c656 <__aeabi_dmul+0x1a6> - 800c666: ea41 0106 orr.w r1, r1, r6 - 800c66a: f095 0f00 teq r5, #0 - 800c66e: bf18 it ne - 800c670: 4770 bxne lr - 800c672: f003 4600 and.w r6, r3, #2147483648 ; 0x80000000 - 800c676: 0052 lsls r2, r2, #1 - 800c678: eb43 0303 adc.w r3, r3, r3 - 800c67c: f413 1f80 tst.w r3, #1048576 ; 0x100000 - 800c680: bf08 it eq - 800c682: 3d01 subeq r5, #1 - 800c684: d0f7 beq.n 800c676 <__aeabi_dmul+0x1c6> - 800c686: ea43 0306 orr.w r3, r3, r6 - 800c68a: 4770 bx lr - 800c68c: ea94 0f0c teq r4, ip - 800c690: ea0c 5513 and.w r5, ip, r3, lsr #20 - 800c694: bf18 it ne - 800c696: ea95 0f0c teqne r5, ip - 800c69a: d00c beq.n 800c6b6 <__aeabi_dmul+0x206> - 800c69c: ea50 0641 orrs.w r6, r0, r1, lsl #1 - 800c6a0: bf18 it ne - 800c6a2: ea52 0643 orrsne.w r6, r2, r3, lsl #1 - 800c6a6: d1d1 bne.n 800c64c <__aeabi_dmul+0x19c> - 800c6a8: ea81 0103 eor.w r1, r1, r3 - 800c6ac: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000 - 800c6b0: f04f 0000 mov.w r0, #0 - 800c6b4: bd70 pop {r4, r5, r6, pc} - 800c6b6: ea50 0641 orrs.w r6, r0, r1, lsl #1 - 800c6ba: bf06 itte eq - 800c6bc: 4610 moveq r0, r2 - 800c6be: 4619 moveq r1, r3 - 800c6c0: ea52 0643 orrsne.w r6, r2, r3, lsl #1 - 800c6c4: d019 beq.n 800c6fa <__aeabi_dmul+0x24a> - 800c6c6: ea94 0f0c teq r4, ip - 800c6ca: d102 bne.n 800c6d2 <__aeabi_dmul+0x222> - 800c6cc: ea50 3601 orrs.w r6, r0, r1, lsl #12 - 800c6d0: d113 bne.n 800c6fa <__aeabi_dmul+0x24a> - 800c6d2: ea95 0f0c teq r5, ip - 800c6d6: d105 bne.n 800c6e4 <__aeabi_dmul+0x234> - 800c6d8: ea52 3603 orrs.w r6, r2, r3, lsl #12 - 800c6dc: bf1c itt ne - 800c6de: 4610 movne r0, r2 - 800c6e0: 4619 movne r1, r3 - 800c6e2: d10a bne.n 800c6fa <__aeabi_dmul+0x24a> - 800c6e4: ea81 0103 eor.w r1, r1, r3 - 800c6e8: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000 - 800c6ec: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000 - 800c6f0: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000 - 800c6f4: f04f 0000 mov.w r0, #0 - 800c6f8: bd70 pop {r4, r5, r6, pc} - 800c6fa: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000 - 800c6fe: f441 0178 orr.w r1, r1, #16252928 ; 0xf80000 - 800c702: bd70 pop {r4, r5, r6, pc} - -0800c704 <__aeabi_ddiv>: - 800c704: b570 push {r4, r5, r6, lr} - 800c706: f04f 0cff mov.w ip, #255 ; 0xff - 800c70a: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700 - 800c70e: ea1c 5411 ands.w r4, ip, r1, lsr #20 - 800c712: bf1d ittte ne - 800c714: ea1c 5513 andsne.w r5, ip, r3, lsr #20 - 800c718: ea94 0f0c teqne r4, ip - 800c71c: ea95 0f0c teqne r5, ip - 800c720: f000 f8a7 bleq 800c872 <__aeabi_ddiv+0x16e> - 800c724: eba4 0405 sub.w r4, r4, r5 - 800c728: ea81 0e03 eor.w lr, r1, r3 - 800c72c: ea52 3503 orrs.w r5, r2, r3, lsl #12 - 800c730: ea4f 3101 mov.w r1, r1, lsl #12 - 800c734: f000 8088 beq.w 800c848 <__aeabi_ddiv+0x144> - 800c738: ea4f 3303 mov.w r3, r3, lsl #12 - 800c73c: f04f 5580 mov.w r5, #268435456 ; 0x10000000 - 800c740: ea45 1313 orr.w r3, r5, r3, lsr #4 - 800c744: ea43 6312 orr.w r3, r3, r2, lsr #24 - 800c748: ea4f 2202 mov.w r2, r2, lsl #8 - 800c74c: ea45 1511 orr.w r5, r5, r1, lsr #4 - 800c750: ea45 6510 orr.w r5, r5, r0, lsr #24 - 800c754: ea4f 2600 mov.w r6, r0, lsl #8 - 800c758: f00e 4100 and.w r1, lr, #2147483648 ; 0x80000000 - 800c75c: 429d cmp r5, r3 - 800c75e: bf08 it eq - 800c760: 4296 cmpeq r6, r2 - 800c762: f144 04fd adc.w r4, r4, #253 ; 0xfd - 800c766: f504 7440 add.w r4, r4, #768 ; 0x300 - 800c76a: d202 bcs.n 800c772 <__aeabi_ddiv+0x6e> - 800c76c: 085b lsrs r3, r3, #1 - 800c76e: ea4f 0232 mov.w r2, r2, rrx - 800c772: 1ab6 subs r6, r6, r2 - 800c774: eb65 0503 sbc.w r5, r5, r3 - 800c778: 085b lsrs r3, r3, #1 - 800c77a: ea4f 0232 mov.w r2, r2, rrx - 800c77e: f44f 1080 mov.w r0, #1048576 ; 0x100000 - 800c782: f44f 2c00 mov.w ip, #524288 ; 0x80000 - 800c786: ebb6 0e02 subs.w lr, r6, r2 - 800c78a: eb75 0e03 sbcs.w lr, r5, r3 - 800c78e: bf22 ittt cs - 800c790: 1ab6 subcs r6, r6, r2 - 800c792: 4675 movcs r5, lr - 800c794: ea40 000c orrcs.w r0, r0, ip - 800c798: 085b lsrs r3, r3, #1 - 800c79a: ea4f 0232 mov.w r2, r2, rrx - 800c79e: ebb6 0e02 subs.w lr, r6, r2 - 800c7a2: eb75 0e03 sbcs.w lr, r5, r3 - 800c7a6: bf22 ittt cs - 800c7a8: 1ab6 subcs r6, r6, r2 - 800c7aa: 4675 movcs r5, lr - 800c7ac: ea40 005c orrcs.w r0, r0, ip, lsr #1 - 800c7b0: 085b lsrs r3, r3, #1 - 800c7b2: ea4f 0232 mov.w r2, r2, rrx - 800c7b6: ebb6 0e02 subs.w lr, r6, r2 - 800c7ba: eb75 0e03 sbcs.w lr, r5, r3 - 800c7be: bf22 ittt cs - 800c7c0: 1ab6 subcs r6, r6, r2 - 800c7c2: 4675 movcs r5, lr - 800c7c4: ea40 009c orrcs.w r0, r0, ip, lsr #2 - 800c7c8: 085b lsrs r3, r3, #1 - 800c7ca: ea4f 0232 mov.w r2, r2, rrx - 800c7ce: ebb6 0e02 subs.w lr, r6, r2 - 800c7d2: eb75 0e03 sbcs.w lr, r5, r3 - 800c7d6: bf22 ittt cs - 800c7d8: 1ab6 subcs r6, r6, r2 - 800c7da: 4675 movcs r5, lr - 800c7dc: ea40 00dc orrcs.w r0, r0, ip, lsr #3 - 800c7e0: ea55 0e06 orrs.w lr, r5, r6 - 800c7e4: d018 beq.n 800c818 <__aeabi_ddiv+0x114> - 800c7e6: ea4f 1505 mov.w r5, r5, lsl #4 - 800c7ea: ea45 7516 orr.w r5, r5, r6, lsr #28 - 800c7ee: ea4f 1606 mov.w r6, r6, lsl #4 - 800c7f2: ea4f 03c3 mov.w r3, r3, lsl #3 - 800c7f6: ea43 7352 orr.w r3, r3, r2, lsr #29 - 800c7fa: ea4f 02c2 mov.w r2, r2, lsl #3 - 800c7fe: ea5f 1c1c movs.w ip, ip, lsr #4 - 800c802: d1c0 bne.n 800c786 <__aeabi_ddiv+0x82> - 800c804: f411 1f80 tst.w r1, #1048576 ; 0x100000 - 800c808: d10b bne.n 800c822 <__aeabi_ddiv+0x11e> - 800c80a: ea41 0100 orr.w r1, r1, r0 - 800c80e: f04f 0000 mov.w r0, #0 - 800c812: f04f 4c00 mov.w ip, #2147483648 ; 0x80000000 - 800c816: e7b6 b.n 800c786 <__aeabi_ddiv+0x82> - 800c818: f411 1f80 tst.w r1, #1048576 ; 0x100000 - 800c81c: bf04 itt eq - 800c81e: 4301 orreq r1, r0 - 800c820: 2000 moveq r0, #0 - 800c822: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd - 800c826: bf88 it hi - 800c828: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700 - 800c82c: f63f aeaf bhi.w 800c58e <__aeabi_dmul+0xde> - 800c830: ebb5 0c03 subs.w ip, r5, r3 - 800c834: bf04 itt eq - 800c836: ebb6 0c02 subseq.w ip, r6, r2 - 800c83a: ea5f 0c50 movseq.w ip, r0, lsr #1 - 800c83e: f150 0000 adcs.w r0, r0, #0 - 800c842: eb41 5104 adc.w r1, r1, r4, lsl #20 - 800c846: bd70 pop {r4, r5, r6, pc} - 800c848: f00e 4e00 and.w lr, lr, #2147483648 ; 0x80000000 - 800c84c: ea4e 3111 orr.w r1, lr, r1, lsr #12 - 800c850: eb14 045c adds.w r4, r4, ip, lsr #1 - 800c854: bfc2 ittt gt - 800c856: ebd4 050c rsbsgt r5, r4, ip - 800c85a: ea41 5104 orrgt.w r1, r1, r4, lsl #20 - 800c85e: bd70 popgt {r4, r5, r6, pc} - 800c860: f441 1180 orr.w r1, r1, #1048576 ; 0x100000 - 800c864: f04f 0e00 mov.w lr, #0 - 800c868: 3c01 subs r4, #1 - 800c86a: e690 b.n 800c58e <__aeabi_dmul+0xde> - 800c86c: ea45 0e06 orr.w lr, r5, r6 - 800c870: e68d b.n 800c58e <__aeabi_dmul+0xde> - 800c872: ea0c 5513 and.w r5, ip, r3, lsr #20 - 800c876: ea94 0f0c teq r4, ip - 800c87a: bf08 it eq - 800c87c: ea95 0f0c teqeq r5, ip - 800c880: f43f af3b beq.w 800c6fa <__aeabi_dmul+0x24a> - 800c884: ea94 0f0c teq r4, ip - 800c888: d10a bne.n 800c8a0 <__aeabi_ddiv+0x19c> - 800c88a: ea50 3401 orrs.w r4, r0, r1, lsl #12 - 800c88e: f47f af34 bne.w 800c6fa <__aeabi_dmul+0x24a> - 800c892: ea95 0f0c teq r5, ip - 800c896: f47f af25 bne.w 800c6e4 <__aeabi_dmul+0x234> - 800c89a: 4610 mov r0, r2 - 800c89c: 4619 mov r1, r3 - 800c89e: e72c b.n 800c6fa <__aeabi_dmul+0x24a> - 800c8a0: ea95 0f0c teq r5, ip - 800c8a4: d106 bne.n 800c8b4 <__aeabi_ddiv+0x1b0> - 800c8a6: ea52 3503 orrs.w r5, r2, r3, lsl #12 - 800c8aa: f43f aefd beq.w 800c6a8 <__aeabi_dmul+0x1f8> - 800c8ae: 4610 mov r0, r2 - 800c8b0: 4619 mov r1, r3 - 800c8b2: e722 b.n 800c6fa <__aeabi_dmul+0x24a> - 800c8b4: ea50 0641 orrs.w r6, r0, r1, lsl #1 - 800c8b8: bf18 it ne - 800c8ba: ea52 0643 orrsne.w r6, r2, r3, lsl #1 - 800c8be: f47f aec5 bne.w 800c64c <__aeabi_dmul+0x19c> - 800c8c2: ea50 0441 orrs.w r4, r0, r1, lsl #1 - 800c8c6: f47f af0d bne.w 800c6e4 <__aeabi_dmul+0x234> - 800c8ca: ea52 0543 orrs.w r5, r2, r3, lsl #1 - 800c8ce: f47f aeeb bne.w 800c6a8 <__aeabi_dmul+0x1f8> - 800c8d2: e712 b.n 800c6fa <__aeabi_dmul+0x24a> - ... - -0800c8e0 <__aeabi_d2f>: - 800c8e0: ea4f 0241 mov.w r2, r1, lsl #1 - 800c8e4: f1b2 43e0 subs.w r3, r2, #1879048192 ; 0x70000000 - 800c8e8: bf24 itt cs - 800c8ea: f5b3 1c00 subscs.w ip, r3, #2097152 ; 0x200000 - 800c8ee: f1dc 5cfe rsbscs ip, ip, #532676608 ; 0x1fc00000 - 800c8f2: d90d bls.n 800c910 <__aeabi_d2f+0x30> - 800c8f4: f001 4c00 and.w ip, r1, #2147483648 ; 0x80000000 - 800c8f8: ea4f 02c0 mov.w r2, r0, lsl #3 - 800c8fc: ea4c 7050 orr.w r0, ip, r0, lsr #29 - 800c900: f1b2 4f00 cmp.w r2, #2147483648 ; 0x80000000 - 800c904: eb40 0083 adc.w r0, r0, r3, lsl #2 - 800c908: bf08 it eq - 800c90a: f020 0001 biceq.w r0, r0, #1 - 800c90e: 4770 bx lr - 800c910: f011 4f80 tst.w r1, #1073741824 ; 0x40000000 - 800c914: d121 bne.n 800c95a <__aeabi_d2f+0x7a> - 800c916: f113 7238 adds.w r2, r3, #48234496 ; 0x2e00000 - 800c91a: bfbc itt lt - 800c91c: f001 4000 andlt.w r0, r1, #2147483648 ; 0x80000000 - 800c920: 4770 bxlt lr - 800c922: f441 1180 orr.w r1, r1, #1048576 ; 0x100000 - 800c926: ea4f 5252 mov.w r2, r2, lsr #21 - 800c92a: f1c2 0218 rsb r2, r2, #24 - 800c92e: f1c2 0c20 rsb ip, r2, #32 - 800c932: fa10 f30c lsls.w r3, r0, ip - 800c936: fa20 f002 lsr.w r0, r0, r2 - 800c93a: bf18 it ne - 800c93c: f040 0001 orrne.w r0, r0, #1 - 800c940: ea4f 23c1 mov.w r3, r1, lsl #11 - 800c944: ea4f 23d3 mov.w r3, r3, lsr #11 - 800c948: fa03 fc0c lsl.w ip, r3, ip - 800c94c: ea40 000c orr.w r0, r0, ip - 800c950: fa23 f302 lsr.w r3, r3, r2 - 800c954: ea4f 0343 mov.w r3, r3, lsl #1 - 800c958: e7cc b.n 800c8f4 <__aeabi_d2f+0x14> - 800c95a: ea7f 5362 mvns.w r3, r2, asr #21 - 800c95e: d107 bne.n 800c970 <__aeabi_d2f+0x90> - 800c960: ea50 3301 orrs.w r3, r0, r1, lsl #12 - 800c964: bf1e ittt ne - 800c966: f04f 40fe movne.w r0, #2130706432 ; 0x7f000000 - 800c96a: f440 0040 orrne.w r0, r0, #12582912 ; 0xc00000 - 800c96e: 4770 bxne lr - 800c970: f001 4000 and.w r0, r1, #2147483648 ; 0x80000000 - 800c974: f040 40fe orr.w r0, r0, #2130706432 ; 0x7f000000 - 800c978: f440 0000 orr.w r0, r0, #8388608 ; 0x800000 - 800c97c: 4770 bx lr - 800c97e: bf00 nop - -0800c980 : - 800c980: 4684 mov ip, r0 - 800c982: ea41 0300 orr.w r3, r1, r0 - 800c986: f013 0303 ands.w r3, r3, #3 - 800c98a: d16d bne.n 800ca68 - 800c98c: 3a40 subs r2, #64 ; 0x40 - 800c98e: d341 bcc.n 800ca14 - 800c990: f851 3b04 ldr.w r3, [r1], #4 - 800c994: f840 3b04 str.w r3, [r0], #4 - 800c998: f851 3b04 ldr.w r3, [r1], #4 - 800c99c: f840 3b04 str.w r3, [r0], #4 - 800c9a0: f851 3b04 ldr.w r3, [r1], #4 - 800c9a4: f840 3b04 str.w r3, [r0], #4 - 800c9a8: f851 3b04 ldr.w r3, [r1], #4 - 800c9ac: f840 3b04 str.w r3, [r0], #4 - 800c9b0: f851 3b04 ldr.w r3, [r1], #4 - 800c9b4: f840 3b04 str.w r3, [r0], #4 - 800c9b8: f851 3b04 ldr.w r3, [r1], #4 - 800c9bc: f840 3b04 str.w r3, [r0], #4 - 800c9c0: f851 3b04 ldr.w r3, [r1], #4 - 800c9c4: f840 3b04 str.w r3, [r0], #4 - 800c9c8: f851 3b04 ldr.w r3, [r1], #4 - 800c9cc: f840 3b04 str.w r3, [r0], #4 - 800c9d0: f851 3b04 ldr.w r3, [r1], #4 - 800c9d4: f840 3b04 str.w r3, [r0], #4 - 800c9d8: f851 3b04 ldr.w r3, [r1], #4 - 800c9dc: f840 3b04 str.w r3, [r0], #4 - 800c9e0: f851 3b04 ldr.w r3, [r1], #4 - 800c9e4: f840 3b04 str.w r3, [r0], #4 - 800c9e8: f851 3b04 ldr.w r3, [r1], #4 - 800c9ec: f840 3b04 str.w r3, [r0], #4 - 800c9f0: f851 3b04 ldr.w r3, [r1], #4 - 800c9f4: f840 3b04 str.w r3, [r0], #4 - 800c9f8: f851 3b04 ldr.w r3, [r1], #4 - 800c9fc: f840 3b04 str.w r3, [r0], #4 - 800ca00: f851 3b04 ldr.w r3, [r1], #4 - 800ca04: f840 3b04 str.w r3, [r0], #4 - 800ca08: f851 3b04 ldr.w r3, [r1], #4 - 800ca0c: f840 3b04 str.w r3, [r0], #4 - 800ca10: 3a40 subs r2, #64 ; 0x40 - 800ca12: d2bd bcs.n 800c990 - 800ca14: 3230 adds r2, #48 ; 0x30 - 800ca16: d311 bcc.n 800ca3c - 800ca18: f851 3b04 ldr.w r3, [r1], #4 - 800ca1c: f840 3b04 str.w r3, [r0], #4 - 800ca20: f851 3b04 ldr.w r3, [r1], #4 - 800ca24: f840 3b04 str.w r3, [r0], #4 - 800ca28: f851 3b04 ldr.w r3, [r1], #4 - 800ca2c: f840 3b04 str.w r3, [r0], #4 - 800ca30: f851 3b04 ldr.w r3, [r1], #4 - 800ca34: f840 3b04 str.w r3, [r0], #4 - 800ca38: 3a10 subs r2, #16 - 800ca3a: d2ed bcs.n 800ca18 - 800ca3c: 320c adds r2, #12 - 800ca3e: d305 bcc.n 800ca4c - 800ca40: f851 3b04 ldr.w r3, [r1], #4 - 800ca44: f840 3b04 str.w r3, [r0], #4 - 800ca48: 3a04 subs r2, #4 - 800ca4a: d2f9 bcs.n 800ca40 - 800ca4c: 3204 adds r2, #4 - 800ca4e: d008 beq.n 800ca62 - 800ca50: 07d2 lsls r2, r2, #31 - 800ca52: bf1c itt ne - 800ca54: f811 3b01 ldrbne.w r3, [r1], #1 - 800ca58: f800 3b01 strbne.w r3, [r0], #1 - 800ca5c: d301 bcc.n 800ca62 - 800ca5e: 880b ldrh r3, [r1, #0] - 800ca60: 8003 strh r3, [r0, #0] - 800ca62: 4660 mov r0, ip - 800ca64: 4770 bx lr - 800ca66: bf00 nop - 800ca68: 2a08 cmp r2, #8 - 800ca6a: d313 bcc.n 800ca94 - 800ca6c: 078b lsls r3, r1, #30 - 800ca6e: d08d beq.n 800c98c - 800ca70: f010 0303 ands.w r3, r0, #3 - 800ca74: d08a beq.n 800c98c - 800ca76: f1c3 0304 rsb r3, r3, #4 - 800ca7a: 1ad2 subs r2, r2, r3 - 800ca7c: 07db lsls r3, r3, #31 - 800ca7e: bf1c itt ne - 800ca80: f811 3b01 ldrbne.w r3, [r1], #1 - 800ca84: f800 3b01 strbne.w r3, [r0], #1 - 800ca88: d380 bcc.n 800c98c - 800ca8a: f831 3b02 ldrh.w r3, [r1], #2 - 800ca8e: f820 3b02 strh.w r3, [r0], #2 - 800ca92: e77b b.n 800c98c - 800ca94: 3a04 subs r2, #4 - 800ca96: d3d9 bcc.n 800ca4c - 800ca98: 3a01 subs r2, #1 - 800ca9a: f811 3b01 ldrb.w r3, [r1], #1 - 800ca9e: f800 3b01 strb.w r3, [r0], #1 - 800caa2: d2f9 bcs.n 800ca98 - 800caa4: 780b ldrb r3, [r1, #0] - 800caa6: 7003 strb r3, [r0, #0] - 800caa8: 784b ldrb r3, [r1, #1] - 800caaa: 7043 strb r3, [r0, #1] - 800caac: 788b ldrb r3, [r1, #2] - 800caae: 7083 strb r3, [r0, #2] - 800cab0: 4660 mov r0, ip - 800cab2: 4770 bx lr - ... - -0800cac0 <__core_init>: - */ -#if !defined(__DOXYGEN__) -__attribute__((weak)) -#endif -/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/ -void __core_init(void) { - 800cac0: 4770 bx lr - 800cac2: bf00 nop - 800cac4: f3af 8000 nop.w - 800cac8: f3af 8000 nop.w - 800cacc: f3af 8000 nop.w - -0800cad0 <__late_init>: - */ -#if !defined(__DOXYGEN__) -__attribute__((weak)) -#endif -/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/ -void __late_init(void) {} - 800cad0: 4770 bx lr - 800cad2: bf00 nop - 800cad4: f3af 8000 nop.w - 800cad8: f3af 8000 nop.w - 800cadc: f3af 8000 nop.w - -0800cae0 <__default_exit>: -/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/ -void __default_exit(void) { -/*lint -restore*/ - - while (true) { - } - 800cae0: e7fe b.n 800cae0 <__default_exit> - 800cae2: bf00 nop - 800cae4: f3af 8000 nop.w - 800cae8: f3af 8000 nop.w - 800caec: f3af 8000 nop.w - -0800caf0 <_unhandled_exception>: -/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/ -void _unhandled_exception(void) { -/*lint -restore*/ - - while (true) { - } - 800caf0: e7fe b.n 800caf0 <_unhandled_exception> - 800caf2: bf00 nop - 800caf4: f3af 8000 nop.w - 800caf8: f3af 8000 nop.w - 800cafc: f3af 8000 nop.w - -0800cb00 <_idle_thread>: - * that this thread is executed only if there are no other ready - * threads in the system. - * - * @param[in] p the thread parameter, unused in this scenario - */ -static void _idle_thread(void *p) { - 800cb00: e7fe b.n 800cb00 <_idle_thread> - 800cb02: bf00 nop - 800cb04: f3af 8000 nop.w - 800cb08: f3af 8000 nop.w - 800cb0c: f3af 8000 nop.w - -0800cb10 : - * @brief Port-related initialization code. - */ -static inline void port_init(void) { - - /* Initialization of the vector table and priority related settings.*/ - SCB->VTOR = CORTEX_VTOR_INIT; - 800cb10: 4b20 ldr r3, [pc, #128] ; (800cb94 ) - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */ - reg_value = (reg_value | - 800cb12: 4a21 ldr r2, [pc, #132] ; (800cb98 ) - /* Initializing priority grouping.*/ - NVIC_SetPriorityGrouping(CORTEX_PRIGROUP_INIT); - - /* DWT cycle counter enable.*/ - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - 800cb14: 4821 ldr r0, [pc, #132] ; (800cb9c ) - * @post The main thread is created with priority @p NORMALPRIO and - * interrupts are enabled. - * - * @special - */ -void chSysInit(void) { - 800cb16: b5f0 push {r4, r5, r6, r7, lr} - * @brief Port-related initialization code. - */ -static inline void port_init(void) { - - /* Initialization of the vector table and priority related settings.*/ - SCB->VTOR = CORTEX_VTOR_INIT; - 800cb18: 2400 movs r4, #0 - 800cb1a: 609c str r4, [r3, #8] -__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - 800cb1c: 68df ldr r7, [r3, #12] - - /* Initializing priority grouping.*/ - NVIC_SetPriorityGrouping(CORTEX_PRIGROUP_INIT); - - /* DWT cycle counter enable.*/ - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - 800cb1e: 4e20 ldr r6, [pc, #128] ; (800cba0 ) - _dbg_trace_init(); -#endif - -#if CH_CFG_NO_IDLE_THREAD == FALSE - /* Now this instructions flow becomes the main thread.*/ - setcurrp(_thread_init(&ch.mainthread, NORMALPRIO)); - 800cb20: 4d20 ldr r5, [pc, #128] ; (800cba4 ) - reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */ - 800cb22: f64f 01ff movw r1, #63743 ; 0xf8ff - 800cb26: 4039 ands r1, r7 - reg_value = (reg_value | - 800cb28: 430a orrs r2, r1 - ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8)); /* Insert write key and priorty group */ - SCB->AIRCR = reg_value; - 800cb2a: 60da str r2, [r3, #12] - 800cb2c: 68f2 ldr r2, [r6, #12] - 800cb2e: f042 7280 orr.w r2, r2, #16777216 ; 0x1000000 - 800cb32: 60f2 str r2, [r6, #12] - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - 800cb34: 6802 ldr r2, [r0, #0] - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if(IRQn < 0) { - SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */ - 800cb36: 2120 movs r1, #32 - 800cb38: f042 0201 orr.w r2, r2, #1 - 800cb3c: 2610 movs r6, #16 - 800cb3e: 6002 str r2, [r0, #0] - * @post The main thread is created with priority @p NORMALPRIO and - * interrupts are enabled. - * - * @special - */ -void chSysInit(void) { - 800cb40: b083 sub sp, #12 - 800cb42: 77de strb r6, [r3, #31] - 800cb44: f883 1022 strb.w r1, [r3, #34] ; 0x22 -#if CH_DBG_ENABLE_STACK_CHECK == TRUE - extern stkalign_t __main_thread_stack_base__; -#endif - - port_init(); - _scheduler_init(); - 800cb48: f000 f8fa bl 800cd40 <_scheduler_init> - _vt_init(); - 800cb4c: f000 f878 bl 800cc40 <_vt_init> -#if CH_CFG_USE_TM == TRUE - _tm_init(); - 800cb50: f000 fb5e bl 800d210 <_tm_init> -#endif -#if CH_CFG_USE_MEMCORE == TRUE - _core_init(); - 800cb54: f000 fcd4 bl 800d500 <_core_init> -#endif -#if CH_CFG_USE_HEAP == TRUE - _heap_init(); - 800cb58: f000 fd0a bl 800d570 <_heap_init> - _dbg_trace_init(); -#endif - -#if CH_CFG_NO_IDLE_THREAD == FALSE - /* Now this instructions flow becomes the main thread.*/ - setcurrp(_thread_init(&ch.mainthread, NORMALPRIO)); - 800cb5c: 4628 mov r0, r5 - 800cb5e: 2140 movs r1, #64 ; 0x40 - 800cb60: f000 f9fe bl 800cf60 <_thread_init> - 800cb64: f1a5 0330 sub.w r3, r5, #48 ; 0x30 -#else - /* Now this instructions flow becomes the idle thread.*/ - setcurrp(_thread_init(&ch.mainthread, IDLEPRIO)); -#endif - - currp->p_state = CH_STATE_CURRENT; - 800cb68: 2201 movs r2, #1 - _dbg_trace_init(); -#endif - -#if CH_CFG_NO_IDLE_THREAD == FALSE - /* Now this instructions flow becomes the main thread.*/ - setcurrp(_thread_init(&ch.mainthread, NORMALPRIO)); - 800cb6a: 6198 str r0, [r3, #24] -#else - /* Now this instructions flow becomes the idle thread.*/ - setcurrp(_thread_init(&ch.mainthread, IDLEPRIO)); -#endif - - currp->p_state = CH_STATE_CURRENT; - 800cb6c: 7702 strb r2, [r0, #28] - - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); - 800cb6e: f384 8811 msr BASEPRI, r4 - This function enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); - 800cb72: b662 cpsie i - * @api - */ -static inline void chRegSetThreadName(const char *name) { - -#if CH_CFG_USE_REGISTRY == TRUE - ch.rlist.r_current->p_name = name; - 800cb74: 699b ldr r3, [r3, #24] - 800cb76: 490c ldr r1, [pc, #48] ; (800cba8 ) - 800cb78: 6199 str r1, [r3, #24] -#if CH_CFG_NO_IDLE_THREAD == FALSE - { - /* This thread has the lowest priority in the system, its role is just to - serve interrupts in its context while keeping the lowest energy saving - mode compatible with the system status.*/ - thread_t *tp = chThdCreateStatic(ch.idle_thread_wa, - 800cb7a: f105 0050 add.w r0, r5, #80 ; 0x50 - 800cb7e: 9400 str r4, [sp, #0] - 800cb80: f44f 71ec mov.w r1, #472 ; 0x1d8 - 800cb84: 4b09 ldr r3, [pc, #36] ; (800cbac ) - 800cb86: f000 fa4b bl 800d020 - * @xclass - */ -static inline void chRegSetThreadNameX(thread_t *tp, const char *name) { - -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = name; - 800cb8a: 4b09 ldr r3, [pc, #36] ; (800cbb0 ) - 800cb8c: 6183 str r3, [r0, #24] - (tfunc_t)_idle_thread, - NULL); - chRegSetThreadNameX(tp, "idle"); - } -#endif -} - 800cb8e: b003 add sp, #12 - 800cb90: bdf0 pop {r4, r5, r6, r7, pc} - 800cb92: bf00 nop - 800cb94: e000ed00 .word 0xe000ed00 - 800cb98: 05fa0300 .word 0x05fa0300 - 800cb9c: e0001000 .word 0xe0001000 - 800cba0: e000edf0 .word 0xe000edf0 - 800cba4: 20000c70 .word 0x20000c70 - 800cba8: 08013190 .word 0x08013190 - 800cbac: 0800cb01 .word 0x0800cb01 - 800cbb0: 08013180 .word 0x08013180 - 800cbb4: f3af 8000 nop.w - 800cbb8: f3af 8000 nop.w - 800cbbc: f3af 8000 nop.w - -0800cbc0 : - * and, together with the @p CH_CFG_TIME_QUANTUM macro, the round robin - * interval. - * - * @iclass - */ -void chSysTimerHandlerI(void) { - 800cbc0: b5f8 push {r3, r4, r5, r6, r7, lr} - - chDbgCheckClassI(); - -#if CH_CFG_TIME_QUANTUM > 0 - /* Running thread has not used up quantum yet? */ - if (currp->p_preempt > (tslices_t)0) { - 800cbc2: 4d13 ldr r5, [pc, #76] ; (800cc10 ) - 800cbc4: 69aa ldr r2, [r5, #24] - 800cbc6: 7fd3 ldrb r3, [r2, #31] - 800cbc8: b10b cbz r3, 800cbce - /* Decrement remaining quantum.*/ - currp->p_preempt--; - 800cbca: 3b01 subs r3, #1 - 800cbcc: 77d3 strb r3, [r2, #31] - } -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - currp->p_time++; - 800cbce: 6a11 ldr r1, [r2, #32] - - chDbgCheckClassI(); - -#if CH_CFG_ST_TIMEDELTA == 0 - ch.vtlist.vt_systime++; - if (&ch.vtlist != (virtual_timers_list_t *)ch.vtlist.vt_next) { - 800cbd0: 69eb ldr r3, [r5, #28] - 800cbd2: 4e10 ldr r6, [pc, #64] ; (800cc14 ) - 800cbd4: 3101 adds r1, #1 - 800cbd6: 6211 str r1, [r2, #32] -static inline void chVTDoTickI(void) { - - chDbgCheckClassI(); - -#if CH_CFG_ST_TIMEDELTA == 0 - ch.vtlist.vt_systime++; - 800cbd8: 6aaa ldr r2, [r5, #40] ; 0x28 - if (&ch.vtlist != (virtual_timers_list_t *)ch.vtlist.vt_next) { - 800cbda: 42b3 cmp r3, r6 -static inline void chVTDoTickI(void) { - - chDbgCheckClassI(); - -#if CH_CFG_ST_TIMEDELTA == 0 - ch.vtlist.vt_systime++; - 800cbdc: f102 0201 add.w r2, r2, #1 - 800cbe0: 62aa str r2, [r5, #40] ; 0x28 - if (&ch.vtlist != (virtual_timers_list_t *)ch.vtlist.vt_next) { - 800cbe2: d013 beq.n 800cc0c - /* The list is not empty, processing elements on top.*/ - --ch.vtlist.vt_next->vt_delta; - 800cbe4: 689c ldr r4, [r3, #8] - 800cbe6: 3c01 subs r4, #1 - 800cbe8: 609c str r4, [r3, #8] - while (ch.vtlist.vt_next->vt_delta == (systime_t)0) { - 800cbea: b97c cbnz r4, 800cc0c - - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); - 800cbec: 2720 movs r7, #32 - vtfunc_t fn; - - vtp = ch.vtlist.vt_next; - fn = vtp->vt_func; - vtp->vt_func = NULL; - vtp->vt_next->vt_prev = (virtual_timer_t *)&ch.vtlist; - 800cbee: 681a ldr r2, [r3, #0] - while (ch.vtlist.vt_next->vt_delta == (systime_t)0) { - virtual_timer_t *vtp; - vtfunc_t fn; - - vtp = ch.vtlist.vt_next; - fn = vtp->vt_func; - 800cbf0: 68d9 ldr r1, [r3, #12] - vtp->vt_func = NULL; - 800cbf2: 60dc str r4, [r3, #12] - vtp->vt_next->vt_prev = (virtual_timer_t *)&ch.vtlist; - 800cbf4: 6056 str r6, [r2, #4] - ch.vtlist.vt_next = vtp->vt_next; - 800cbf6: 61ea str r2, [r5, #28] - 800cbf8: f384 8811 msr BASEPRI, r4 - chSysUnlockFromISR(); - fn(vtp->vt_par); - 800cbfc: 6918 ldr r0, [r3, #16] - 800cbfe: 4788 blx r1 - 800cc00: f387 8811 msr BASEPRI, r7 -#if CH_CFG_ST_TIMEDELTA == 0 - ch.vtlist.vt_systime++; - if (&ch.vtlist != (virtual_timers_list_t *)ch.vtlist.vt_next) { - /* The list is not empty, processing elements on top.*/ - --ch.vtlist.vt_next->vt_delta; - while (ch.vtlist.vt_next->vt_delta == (systime_t)0) { - 800cc04: 69eb ldr r3, [r5, #28] - 800cc06: 689a ldr r2, [r3, #8] - 800cc08: 2a00 cmp r2, #0 - 800cc0a: d0f0 beq.n 800cbee - 800cc0c: bdf8 pop {r3, r4, r5, r6, r7, pc} - 800cc0e: bf00 nop - 800cc10: 20000c40 .word 0x20000c40 - 800cc14: 20000c5c .word 0x20000c5c - 800cc18: f3af 8000 nop.w - 800cc1c: f3af 8000 nop.w - -0800cc20 : - * - * @return The realtime counter value. - */ -static inline rtcnt_t port_rt_get_counter_value(void) { - - return DWT->CYCCNT; - 800cc20: 4a03 ldr r2, [pc, #12] ; (800cc30 ) - 800cc22: 6851 ldr r1, [r2, #4] - 800cc24: 6853 ldr r3, [r2, #4] - * - * @xclass - */ -bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end) { - - return (bool)((cnt - start) < (end - start)); - 800cc26: 1a5b subs r3, r3, r1 - */ -void chSysPolledDelayX(rtcnt_t cycles) { - rtcnt_t start = chSysGetRealtimeCounterX(); - rtcnt_t end = start + cycles; - - while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) { - 800cc28: 4298 cmp r0, r3 - 800cc2a: d8fb bhi.n 800cc24 - } -} - 800cc2c: 4770 bx lr - 800cc2e: bf00 nop - 800cc30: e0001000 .word 0xe0001000 - 800cc34: f3af 8000 nop.w - 800cc38: f3af 8000 nop.w - 800cc3c: f3af 8000 nop.w - -0800cc40 <_vt_init>: - * - * @notapi - */ -void _vt_init(void) { - - ch.vtlist.vt_next = (virtual_timer_t *)&ch.vtlist; - 800cc40: 4b05 ldr r3, [pc, #20] ; (800cc58 <_vt_init+0x18>) - ch.vtlist.vt_prev = (virtual_timer_t *)&ch.vtlist; - ch.vtlist.vt_delta = (systime_t)-1; - 800cc42: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff - * - * @notapi - */ -void _vt_init(void) { - - ch.vtlist.vt_next = (virtual_timer_t *)&ch.vtlist; - 800cc46: f103 021c add.w r2, r3, #28 - ch.vtlist.vt_prev = (virtual_timer_t *)&ch.vtlist; - ch.vtlist.vt_delta = (systime_t)-1; -#if CH_CFG_ST_TIMEDELTA == 0 - ch.vtlist.vt_systime = (systime_t)0; - 800cc4a: 2100 movs r1, #0 - */ -void _vt_init(void) { - - ch.vtlist.vt_next = (virtual_timer_t *)&ch.vtlist; - ch.vtlist.vt_prev = (virtual_timer_t *)&ch.vtlist; - ch.vtlist.vt_delta = (systime_t)-1; - 800cc4c: 6258 str r0, [r3, #36] ; 0x24 -#if CH_CFG_ST_TIMEDELTA == 0 - ch.vtlist.vt_systime = (systime_t)0; - 800cc4e: 6299 str r1, [r3, #40] ; 0x28 - * - * @notapi - */ -void _vt_init(void) { - - ch.vtlist.vt_next = (virtual_timer_t *)&ch.vtlist; - 800cc50: 61da str r2, [r3, #28] - ch.vtlist.vt_prev = (virtual_timer_t *)&ch.vtlist; - 800cc52: 621a str r2, [r3, #32] - 800cc54: 4770 bx lr - 800cc56: bf00 nop - 800cc58: 20000c40 .word 0x20000c40 - 800cc5c: f3af 8000 nop.w - -0800cc60 : - * function - * - * @iclass - */ -void chVTDoSetI(virtual_timer_t *vtp, systime_t delay, - vtfunc_t vtfunc, void *par) { - 800cc60: b470 push {r4, r5, r6} - delta = delay; -#endif /* CH_CFG_ST_TIMEDELTA == 0 */ - - /* The delta list is scanned in order to find the correct position for - this timer. */ - p = ch.vtlist.vt_next; - 800cc62: 4e0d ldr r6, [pc, #52] ; (800cc98 ) - 800cc64: 69f4 ldr r4, [r6, #28] - while (p->vt_delta < delta) { - 800cc66: 68a5 ldr r5, [r4, #8] - systime_t delta; - - chDbgCheckClassI(); - chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (delay != TIME_IMMEDIATE)); - - vtp->vt_par = par; - 800cc68: 6103 str r3, [r0, #16] -#endif /* CH_CFG_ST_TIMEDELTA == 0 */ - - /* The delta list is scanned in order to find the correct position for - this timer. */ - p = ch.vtlist.vt_next; - while (p->vt_delta < delta) { - 800cc6a: 42a9 cmp r1, r5 - - chDbgCheckClassI(); - chDbgCheck((vtp != NULL) && (vtfunc != NULL) && (delay != TIME_IMMEDIATE)); - - vtp->vt_par = par; - vtp->vt_func = vtfunc; - 800cc6c: 60c2 str r2, [r0, #12] -#endif /* CH_CFG_ST_TIMEDELTA == 0 */ - - /* The delta list is scanned in order to find the correct position for - this timer. */ - p = ch.vtlist.vt_next; - while (p->vt_delta < delta) { - 800cc6e: d904 bls.n 800cc7a - delta -= p->vt_delta; - p = p->vt_next; - 800cc70: 6824 ldr r4, [r4, #0] - - /* The delta list is scanned in order to find the correct position for - this timer. */ - p = ch.vtlist.vt_next; - while (p->vt_delta < delta) { - delta -= p->vt_delta; - 800cc72: 1b49 subs r1, r1, r5 -#endif /* CH_CFG_ST_TIMEDELTA == 0 */ - - /* The delta list is scanned in order to find the correct position for - this timer. */ - p = ch.vtlist.vt_next; - while (p->vt_delta < delta) { - 800cc74: 68a5 ldr r5, [r4, #8] - 800cc76: 428d cmp r5, r1 - 800cc78: d3fa bcc.n 800cc70 - p = p->vt_next; - } - - /* The timer is inserted in the delta list.*/ - vtp->vt_next = p; - vtp->vt_prev = vtp->vt_next->vt_prev; - 800cc7a: 6863 ldr r3, [r4, #4] - 800cc7c: 6043 str r3, [r0, #4] - delta -= p->vt_delta; - p = p->vt_next; - } - - /* The timer is inserted in the delta list.*/ - vtp->vt_next = p; - 800cc7e: 6004 str r4, [r0, #0] - vtp->vt_prev = vtp->vt_next->vt_prev; - vtp->vt_prev->vt_next = vtp; - 800cc80: 6018 str r0, [r3, #0] - p->vt_prev = vtp; - 800cc82: 6060 str r0, [r4, #4] - vtp->vt_delta = delta - 800cc84: 6081 str r1, [r0, #8] - - /* Special case when the timer is in last position in the list, the - value in the header must be restored.*/; - p->vt_delta -= delta; - 800cc86: 68a3 ldr r3, [r4, #8] - ch.vtlist.vt_delta = (systime_t)-1; - 800cc88: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff - p->vt_prev = vtp; - vtp->vt_delta = delta - - /* Special case when the timer is in last position in the list, the - value in the header must be restored.*/; - p->vt_delta -= delta; - 800cc8c: 1a59 subs r1, r3, r1 - 800cc8e: 60a1 str r1, [r4, #8] - ch.vtlist.vt_delta = (systime_t)-1; - 800cc90: 6272 str r2, [r6, #36] ; 0x24 -} - 800cc92: bc70 pop {r4, r5, r6} - 800cc94: 4770 bx lr - 800cc96: bf00 nop - 800cc98: 20000c40 .word 0x20000c40 - 800cc9c: f3af 8000 nop.w - -0800cca0 : - chDbgAssert(vtp->vt_func != NULL, "timer not set or already triggered"); - -#if CH_CFG_ST_TIMEDELTA == 0 - - /* The delta of the timer is added to the next timer.*/ - vtp->vt_next->vt_delta += vtp->vt_delta; - 800cca0: 6803 ldr r3, [r0, #0] - 800cca2: 6882 ldr r2, [r0, #8] - - /* Removing the element from the delta list.*/ - vtp->vt_prev->vt_next = vtp->vt_next; - 800cca4: 6841 ldr r1, [r0, #4] - * - * @param[in] vtp the @p virtual_timer_t structure pointer - * - * @iclass - */ -void chVTDoResetI(virtual_timer_t *vtp) { - 800cca6: b430 push {r4, r5} - chDbgAssert(vtp->vt_func != NULL, "timer not set or already triggered"); - -#if CH_CFG_ST_TIMEDELTA == 0 - - /* The delta of the timer is added to the next timer.*/ - vtp->vt_next->vt_delta += vtp->vt_delta; - 800cca8: 689d ldr r5, [r3, #8] - vtp->vt_next->vt_prev = vtp->vt_prev; - vtp->vt_func = NULL; - - /* The above code changes the value in the header when the removed element - is the last of the list, restoring it.*/ - ch.vtlist.vt_delta = (systime_t)-1; - 800ccaa: 4c06 ldr r4, [pc, #24] ; (800ccc4 ) - chDbgAssert(vtp->vt_func != NULL, "timer not set or already triggered"); - -#if CH_CFG_ST_TIMEDELTA == 0 - - /* The delta of the timer is added to the next timer.*/ - vtp->vt_next->vt_delta += vtp->vt_delta; - 800ccac: 442a add r2, r5 - 800ccae: 609a str r2, [r3, #8] - - /* Removing the element from the delta list.*/ - vtp->vt_prev->vt_next = vtp->vt_next; - 800ccb0: 600b str r3, [r1, #0] - vtp->vt_next->vt_prev = vtp->vt_prev; - 800ccb2: 6805 ldr r5, [r0, #0] - vtp->vt_func = NULL; - 800ccb4: 2200 movs r2, #0 - - /* The above code changes the value in the header when the removed element - is the last of the list, restoring it.*/ - ch.vtlist.vt_delta = (systime_t)-1; - 800ccb6: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff - /* The delta of the timer is added to the next timer.*/ - vtp->vt_next->vt_delta += vtp->vt_delta; - - /* Removing the element from the delta list.*/ - vtp->vt_prev->vt_next = vtp->vt_next; - vtp->vt_next->vt_prev = vtp->vt_prev; - 800ccba: 6069 str r1, [r5, #4] - vtp->vt_func = NULL; - 800ccbc: 60c2 str r2, [r0, #12] - - /* The above code changes the value in the header when the removed element - is the last of the list, restoring it.*/ - ch.vtlist.vt_delta = (systime_t)-1; - 800ccbe: 6263 str r3, [r4, #36] ; 0x24 - delta = (systime_t)CH_CFG_ST_TIMEDELTA; - } - - port_timer_set_alarm(ch.vtlist.vt_lasttime + nowdelta + delta); -#endif /* CH_CFG_ST_TIMEDELTA > 0 */ -} - 800ccc0: bc30 pop {r4, r5} - 800ccc2: 4770 bx lr - 800ccc4: 20000c40 .word 0x20000c40 - 800ccc8: f3af 8000 nop.w - 800cccc: f3af 8000 nop.w - -0800ccd0 : -} - -/* - * Timeout wakeup callback. - */ -static void wakeup(void *p) { - 800ccd0: b410 push {r4} - 800ccd2: 2320 movs r3, #32 - 800ccd4: f383 8811 msr BASEPRI, r3 - thread_t *tp = (thread_t *)p; - - chSysLockFromISR(); - switch (tp->p_state) { - 800ccd8: 7f03 ldrb r3, [r0, #28] - 800ccda: 2b07 cmp r3, #7 - 800ccdc: d80e bhi.n 800ccfc - 800ccde: e8df f003 tbb [pc, r3] - 800cce2: 0d27 .short 0x0d27 - 800cce4: 0408230d .word 0x0408230d - 800cce8: 080d .short 0x080d - case CH_STATE_SUSPENDED: - *tp->p_u.wttrp = NULL; - break; -#if CH_CFG_USE_SEMAPHORES == TRUE - case CH_STATE_WTSEM: - chSemFastSignalI(tp->p_u.wtsemp); - 800ccea: 6a42 ldr r2, [r0, #36] ; 0x24 - */ -static inline void chSemFastSignalI(semaphore_t *sp) { - - chDbgCheckClassI(); - - sp->s_cnt++; - 800ccec: 6893 ldr r3, [r2, #8] - 800ccee: 3301 adds r3, #1 - 800ccf0: 6093 str r3, [r2, #8] - return tp; -} - -static inline thread_t *queue_dequeue(thread_t *tp) { - - tp->p_prev->p_next = tp->p_next; - 800ccf2: e890 000c ldmia.w r0, {r2, r3} - 800ccf6: 601a str r2, [r3, #0] - tp->p_next->p_prev = tp->p_prev; - 800ccf8: 6802 ldr r2, [r0, #0] - 800ccfa: 6053 str r3, [r2, #4] - break; - default: - /* Any other state, nothing to do.*/ - break; - } - tp->p_u.rdymsg = MSG_TIMEOUT; - 800ccfc: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800cd00: 2200 movs r2, #0 - 800cd02: 6881 ldr r1, [r0, #8] - cp = (thread_t *)&ch.rlist.r_queue; - 800cd04: 4b0d ldr r3, [pc, #52] ; (800cd3c ) - break; - default: - /* Any other state, nothing to do.*/ - break; - } - tp->p_u.rdymsg = MSG_TIMEOUT; - 800cd06: 6244 str r4, [r0, #36] ; 0x24 - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800cd08: 7702 strb r2, [r0, #28] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - 800cd0a: 681b ldr r3, [r3, #0] - } while (cp->p_prio >= tp->p_prio); - 800cd0c: 689a ldr r2, [r3, #8] - 800cd0e: 428a cmp r2, r1 - 800cd10: d2fb bcs.n 800cd0a - /* Insertion on p_prev.*/ - tp->p_next = cp; - tp->p_prev = cp->p_prev; - 800cd12: 685a ldr r2, [r3, #4] - 800cd14: 6042 str r2, [r0, #4] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - /* Insertion on p_prev.*/ - tp->p_next = cp; - 800cd16: 6003 str r3, [r0, #0] - 800cd18: 2100 movs r1, #0 - tp->p_prev = cp->p_prev; - tp->p_prev->p_next = tp; - 800cd1a: 6010 str r0, [r2, #0] - cp->p_prev = tp; - 800cd1c: 6058 str r0, [r3, #4] - 800cd1e: f381 8811 msr BASEPRI, r1 - break; - } - tp->p_u.rdymsg = MSG_TIMEOUT; - (void) chSchReadyI(tp); - chSysUnlockFromISR(); -} - 800cd22: f85d 4b04 ldr.w r4, [sp], #4 - 800cd26: 4770 bx lr - /* Handling the special case where the thread has been made ready by - another thread with higher priority.*/ - chSysUnlockFromISR(); - return; - case CH_STATE_SUSPENDED: - *tp->p_u.wttrp = NULL; - 800cd28: 6a43 ldr r3, [r0, #36] ; 0x24 - 800cd2a: 2200 movs r2, #0 - 800cd2c: 601a str r2, [r3, #0] - break; - 800cd2e: e7e5 b.n 800ccfc - 800cd30: 2300 movs r3, #0 - 800cd32: f383 8811 msr BASEPRI, r3 - break; - } - tp->p_u.rdymsg = MSG_TIMEOUT; - (void) chSchReadyI(tp); - chSysUnlockFromISR(); -} - 800cd36: f85d 4b04 ldr.w r4, [sp], #4 - 800cd3a: 4770 bx lr - 800cd3c: 20000c40 .word 0x20000c40 - -0800cd40 <_scheduler_init>: - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800cd40: 4b03 ldr r3, [pc, #12] ; (800cd50 <_scheduler_init+0x10>) - * @notapi - */ -void _scheduler_init(void) { - - queue_init(&ch.rlist.r_queue); - ch.rlist.r_prio = NOPRIO; - 800cd42: 2200 movs r2, #0 - 800cd44: 601b str r3, [r3, #0] - tqp->p_prev = (thread_t *)tqp; - 800cd46: 605b str r3, [r3, #4] -#if CH_CFG_USE_REGISTRY == TRUE - ch.rlist.r_newer = (thread_t *)&ch.rlist; - 800cd48: 611b str r3, [r3, #16] - ch.rlist.r_older = (thread_t *)&ch.rlist; - 800cd4a: 615b str r3, [r3, #20] - * @notapi - */ -void _scheduler_init(void) { - - queue_init(&ch.rlist.r_queue); - ch.rlist.r_prio = NOPRIO; - 800cd4c: 609a str r2, [r3, #8] - 800cd4e: 4770 bx lr - 800cd50: 20000c40 .word 0x20000c40 - 800cd54: f3af 8000 nop.w - 800cd58: f3af 8000 nop.w - 800cd5c: f3af 8000 nop.w - -0800cd60 : - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800cd60: 2200 movs r2, #0 - 800cd62: 6881 ldr r1, [r0, #8] - cp = (thread_t *)&ch.rlist.r_queue; - 800cd64: 4b08 ldr r3, [pc, #32] ; (800cd88 ) - * @param[in] tp the thread to be made ready - * @return The thread pointer. - * - * @iclass - */ -thread_t *chSchReadyI(thread_t *tp) { - 800cd66: b410 push {r4} - 800cd68: 4604 mov r4, r0 - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800cd6a: 7702 strb r2, [r0, #28] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - 800cd6c: 681b ldr r3, [r3, #0] - } while (cp->p_prio >= tp->p_prio); - 800cd6e: 689a ldr r2, [r3, #8] - 800cd70: 428a cmp r2, r1 - 800cd72: d2fb bcs.n 800cd6c - /* Insertion on p_prev.*/ - tp->p_next = cp; - tp->p_prev = cp->p_prev; - 800cd74: 685a ldr r2, [r3, #4] - 800cd76: 6062 str r2, [r4, #4] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - /* Insertion on p_prev.*/ - tp->p_next = cp; - 800cd78: 6023 str r3, [r4, #0] - tp->p_prev = cp->p_prev; - tp->p_prev->p_next = tp; - cp->p_prev = tp; - - return tp; -} - 800cd7a: 4620 mov r0, r4 - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - /* Insertion on p_prev.*/ - tp->p_next = cp; - tp->p_prev = cp->p_prev; - tp->p_prev->p_next = tp; - 800cd7c: 6014 str r4, [r2, #0] - cp->p_prev = tp; - 800cd7e: 605c str r4, [r3, #4] - - return tp; -} - 800cd80: f85d 4b04 ldr.w r4, [sp], #4 - 800cd84: 4770 bx lr - 800cd86: bf00 nop - 800cd88: 20000c40 .word 0x20000c40 - 800cd8c: f3af 8000 nop.w - -0800cd90 : -void chSchGoSleepS(tstate_t newstate) { - thread_t *otp; - - chDbgCheckClassS(); - - otp = currp; - 800cd90: 4b08 ldr r3, [pc, #32] ; (800cdb4 ) - * - * @param[in] newstate the new thread state - * - * @sclass - */ -void chSchGoSleepS(tstate_t newstate) { - 800cd92: b430 push {r4, r5} - tp->p_prev->p_next = tp; - tqp->p_prev = tp; -} - -static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) { - thread_t *tp = tqp->p_next; - 800cd94: 681a ldr r2, [r3, #0] - thread_t *otp; - - chDbgCheckClassS(); - - otp = currp; - 800cd96: 6999 ldr r1, [r3, #24] - - tqp->p_next = tp->p_next; - 800cd98: 6814 ldr r4, [r2, #0] - otp->p_state = newstate; - 800cd9a: 7708 strb r0, [r1, #28] -#if defined(CH_CFG_IDLE_ENTER_HOOK) - if (currp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_ENTER_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - 800cd9c: 2501 movs r5, #1 - otp = currp; - otp->p_state = newstate; -#if CH_CFG_TIME_QUANTUM > 0 - /* The thread is renouncing its remaining time slices so it will have a new - time quantum when it will wakeup.*/ - otp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800cd9e: 2004 movs r0, #4 - 800cda0: 77c8 strb r0, [r1, #31] - tqp->p_next->p_prev = (thread_t *)tqp; - 800cda2: 6063 str r3, [r4, #4] -#if defined(CH_CFG_IDLE_ENTER_HOOK) - if (currp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_ENTER_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - 800cda4: 7715 strb r5, [r2, #28] -} - -static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) { - thread_t *tp = tqp->p_next; - - tqp->p_next = tp->p_next; - 800cda6: 601c str r4, [r3, #0] - chSysSwitch(currp, otp); - 800cda8: 4610 mov r0, r2 -} - 800cdaa: bc30 pop {r4, r5} -#if CH_CFG_TIME_QUANTUM > 0 - /* The thread is renouncing its remaining time slices so it will have a new - time quantum when it will wakeup.*/ - otp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif - setcurrp(queue_fifo_remove(&ch.rlist.r_queue)); - 800cdac: 619a str r2, [r3, #24] - if (currp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_ENTER_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - chSysSwitch(currp, otp); - 800cdae: f7ff b9af b.w 800c110 <_port_switch> - 800cdb2: bf00 nop - 800cdb4: 20000c40 .word 0x20000c40 - 800cdb8: f3af 8000 nop.w - 800cdbc: f3af 8000 nop.w - -0800cdc0 : - * @return The wakeup message. - * @retval MSG_TIMEOUT if a timeout occurs. - * - * @sclass - */ -msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { - 800cdc0: b530 push {r4, r5, lr} - - chDbgCheckClassS(); - - if (TIME_INFINITE != time) { - 800cdc2: 1c4b adds r3, r1, #1 - * @return The wakeup message. - * @retval MSG_TIMEOUT if a timeout occurs. - * - * @sclass - */ -msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { - 800cdc4: b087 sub sp, #28 - - chDbgCheckClassS(); - - if (TIME_INFINITE != time) { - 800cdc6: d012 beq.n 800cdee - virtual_timer_t vt; - - chVTDoSetI(&vt, time, wakeup, currp); - 800cdc8: 4c0c ldr r4, [pc, #48] ; (800cdfc ) - 800cdca: 4a0d ldr r2, [pc, #52] ; (800ce00 ) - 800cdcc: 69a3 ldr r3, [r4, #24] - 800cdce: 4605 mov r5, r0 - 800cdd0: a801 add r0, sp, #4 - 800cdd2: f7ff ff45 bl 800cc60 - chSchGoSleepS(newstate); - 800cdd6: 4628 mov r0, r5 - 800cdd8: f7ff ffda bl 800cd90 - if (chVTIsArmedI(&vt)) { - 800cddc: 9b04 ldr r3, [sp, #16] - 800cdde: b113 cbz r3, 800cde6 - chVTDoResetI(&vt); - 800cde0: a801 add r0, sp, #4 - 800cde2: f7ff ff5d bl 800cca0 - } - else { - chSchGoSleepS(newstate); - } - - return currp->p_u.rdymsg; - 800cde6: 69a3 ldr r3, [r4, #24] -} - 800cde8: 6a58 ldr r0, [r3, #36] ; 0x24 - 800cdea: b007 add sp, #28 - 800cdec: bd30 pop {r4, r5, pc} - 800cdee: 4c03 ldr r4, [pc, #12] ; (800cdfc ) - if (chVTIsArmedI(&vt)) { - chVTDoResetI(&vt); - } - } - else { - chSchGoSleepS(newstate); - 800cdf0: f7ff ffce bl 800cd90 - } - - return currp->p_u.rdymsg; - 800cdf4: 69a3 ldr r3, [r4, #24] -} - 800cdf6: 6a58 ldr r0, [r3, #36] ; 0x24 - 800cdf8: b007 add sp, #28 - 800cdfa: bd30 pop {r4, r5, pc} - 800cdfc: 20000c40 .word 0x20000c40 - 800ce00: 0800ccd1 .word 0x0800ccd1 - 800ce04: f3af 8000 nop.w - 800ce08: f3af 8000 nop.w - 800ce0c: f3af 8000 nop.w - -0800ce10 : - - /* If the waken thread has a not-greater priority than the current - one then it is just inserted in the ready list else it made - running immediately and the invoking thread goes in the ready - list instead.*/ - if (ntp->p_prio <= currp->p_prio) { - 800ce10: 4b14 ldr r3, [pc, #80] ; (800ce64 ) - * @param[in] ntp the thread to be made ready - * @param[in] msg the wakeup message - * - * @sclass - */ -void chSchWakeupS(thread_t *ntp, msg_t msg) { - 800ce12: b470 push {r4, r5, r6} - - /* If the waken thread has a not-greater priority than the current - one then it is just inserted in the ready list else it made - running immediately and the invoking thread goes in the ready - list instead.*/ - if (ntp->p_prio <= currp->p_prio) { - 800ce14: 699e ldr r6, [r3, #24] - 800ce16: 6884 ldr r4, [r0, #8] - * @param[in] ntp the thread to be made ready - * @param[in] msg the wakeup message - * - * @sclass - */ -void chSchWakeupS(thread_t *ntp, msg_t msg) { - 800ce18: 4605 mov r5, r0 - - /* If the waken thread has a not-greater priority than the current - one then it is just inserted in the ready list else it made - running immediately and the invoking thread goes in the ready - list instead.*/ - if (ntp->p_prio <= currp->p_prio) { - 800ce1a: 68b0 ldr r0, [r6, #8] - - chDbgCheckClassS(); - - /* Storing the message to be retrieved by the target thread when it will - restart execution.*/ - ntp->p_u.rdymsg = msg; - 800ce1c: 6269 str r1, [r5, #36] ; 0x24 - - /* If the waken thread has a not-greater priority than the current - one then it is just inserted in the ready list else it made - running immediately and the invoking thread goes in the ready - list instead.*/ - if (ntp->p_prio <= currp->p_prio) { - 800ce1e: 4284 cmp r4, r0 - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800ce20: f04f 0200 mov.w r2, #0 - - /* If the waken thread has a not-greater priority than the current - one then it is just inserted in the ready list else it made - running immediately and the invoking thread goes in the ready - list instead.*/ - if (ntp->p_prio <= currp->p_prio) { - 800ce24: d80b bhi.n 800ce3e - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800ce26: 772a strb r2, [r5, #28] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - 800ce28: 681b ldr r3, [r3, #0] - } while (cp->p_prio >= tp->p_prio); - 800ce2a: 689a ldr r2, [r3, #8] - 800ce2c: 4294 cmp r4, r2 - 800ce2e: d9fb bls.n 800ce28 - /* Insertion on p_prev.*/ - tp->p_next = cp; - tp->p_prev = cp->p_prev; - 800ce30: 685a ldr r2, [r3, #4] - 800ce32: 606a str r2, [r5, #4] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - /* Insertion on p_prev.*/ - tp->p_next = cp; - 800ce34: 602b str r3, [r5, #0] - tp->p_prev = cp->p_prev; - tp->p_prev->p_next = tp; - 800ce36: 6015 str r5, [r2, #0] - cp->p_prev = tp; - 800ce38: 605d str r5, [r3, #4] - } -#endif - ntp->p_state = CH_STATE_CURRENT; - chSysSwitch(ntp, otp); - } -} - 800ce3a: bc70 pop {r4, r5, r6} - 800ce3c: 4770 bx lr - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800ce3e: 7732 strb r2, [r6, #28] - cp = (thread_t *)&ch.rlist.r_queue; - 800ce40: 461a mov r2, r3 - do { - cp = cp->p_next; - 800ce42: 6812 ldr r2, [r2, #0] - } while (cp->p_prio >= tp->p_prio); - 800ce44: 6891 ldr r1, [r2, #8] - 800ce46: 4288 cmp r0, r1 - 800ce48: d9fb bls.n 800ce42 - /* Insertion on p_prev.*/ - tp->p_next = cp; - tp->p_prev = cp->p_prev; - 800ce4a: 6850 ldr r0, [r2, #4] - 800ce4c: 6070 str r0, [r6, #4] -#if defined(CH_CFG_IDLE_LEAVE_HOOK) - if (otp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - ntp->p_state = CH_STATE_CURRENT; - 800ce4e: 2401 movs r4, #1 - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - /* Insertion on p_prev.*/ - tp->p_next = cp; - 800ce50: 6032 str r2, [r6, #0] - tp->p_prev = cp->p_prev; - tp->p_prev->p_next = tp; - 800ce52: 6006 str r6, [r0, #0] - cp->p_prev = tp; - 800ce54: 6056 str r6, [r2, #4] -#if defined(CH_CFG_IDLE_LEAVE_HOOK) - if (otp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - ntp->p_state = CH_STATE_CURRENT; - 800ce56: 772c strb r4, [r5, #28] - chSysSwitch(ntp, otp); - 800ce58: 4631 mov r1, r6 - 800ce5a: 4628 mov r0, r5 - if (ntp->p_prio <= currp->p_prio) { - (void) chSchReadyI(ntp); - } - else { - thread_t *otp = chSchReadyI(currp); - setcurrp(ntp); - 800ce5c: 619d str r5, [r3, #24] - } -#endif - ntp->p_state = CH_STATE_CURRENT; - chSysSwitch(ntp, otp); - } -} - 800ce5e: bc70 pop {r4, r5, r6} - if (otp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - ntp->p_state = CH_STATE_CURRENT; - chSysSwitch(ntp, otp); - 800ce60: f7ff b956 b.w 800c110 <_port_switch> - 800ce64: 20000c40 .word 0x20000c40 - 800ce68: f3af 8000 nop.w - 800ce6c: f3af 8000 nop.w - -0800ce70 : - * @retval false if preemption is not required. - * - * @special - */ -bool chSchIsPreemptionRequired(void) { - tprio_t p1 = firstprio(&ch.rlist.r_queue); - 800ce70: 4b08 ldr r3, [pc, #32] ; (800ce94 ) - tprio_t p2 = currp->p_prio; - 800ce72: 699a ldr r2, [r3, #24] - * @retval false if preemption is not required. - * - * @special - */ -bool chSchIsPreemptionRequired(void) { - tprio_t p1 = firstprio(&ch.rlist.r_queue); - 800ce74: 681b ldr r3, [r3, #0] -#if CH_CFG_TIME_QUANTUM > 0 - /* If the running thread has not reached its time quantum, reschedule only - if the first thread on the ready queue has a higher priority. - Otherwise, if the running thread has used up its time quantum, reschedule - if the first thread on the ready queue has equal or higher priority.*/ - return (currp->p_preempt > (tslices_t)0) ? (p1 > p2) : (p1 >= p2); - 800ce76: 7fd1 ldrb r1, [r2, #31] - * @retval false if preemption is not required. - * - * @special - */ -bool chSchIsPreemptionRequired(void) { - tprio_t p1 = firstprio(&ch.rlist.r_queue); - 800ce78: 689b ldr r3, [r3, #8] - tprio_t p2 = currp->p_prio; - 800ce7a: 6890 ldr r0, [r2, #8] -#if CH_CFG_TIME_QUANTUM > 0 - /* If the running thread has not reached its time quantum, reschedule only - if the first thread on the ready queue has a higher priority. - Otherwise, if the running thread has used up its time quantum, reschedule - if the first thread on the ready queue has equal or higher priority.*/ - return (currp->p_preempt > (tslices_t)0) ? (p1 > p2) : (p1 >= p2); - 800ce7c: b921 cbnz r1, 800ce88 - 800ce7e: 4283 cmp r3, r0 - 800ce80: bf34 ite cc - 800ce82: 2000 movcc r0, #0 - 800ce84: 2001 movcs r0, #1 -#else - /* If the round robin preemption feature is not enabled then performs a - simpler comparison.*/ - return p1 > p2; -#endif -} - 800ce86: 4770 bx lr -#if CH_CFG_TIME_QUANTUM > 0 - /* If the running thread has not reached its time quantum, reschedule only - if the first thread on the ready queue has a higher priority. - Otherwise, if the running thread has used up its time quantum, reschedule - if the first thread on the ready queue has equal or higher priority.*/ - return (currp->p_preempt > (tslices_t)0) ? (p1 > p2) : (p1 >= p2); - 800ce88: 4283 cmp r3, r0 - 800ce8a: bf94 ite ls - 800ce8c: 2000 movls r0, #0 - 800ce8e: 2001 movhi r0, #1 - 800ce90: 4770 bx lr - 800ce92: bf00 nop - 800ce94: 20000c40 .word 0x20000c40 - 800ce98: f3af 8000 nop.w - 800ce9c: f3af 8000 nop.w - -0800cea0 : - * @special - */ -void chSchDoRescheduleBehind(void) { - thread_t *otp; - - otp = currp; - 800cea0: 4a0e ldr r2, [pc, #56] ; (800cedc ) - tp->p_prev->p_next = tp; - tqp->p_prev = tp; -} - -static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) { - thread_t *tp = tqp->p_next; - 800cea2: 6810 ldr r0, [r2, #0] - * @note Not a user function, it is meant to be invoked by the scheduler - * itself or from within the port layer. - * - * @special - */ -void chSchDoRescheduleBehind(void) { - 800cea4: b4f0 push {r4, r5, r6, r7} - - tqp->p_next = tp->p_next; - 800cea6: 6803 ldr r3, [r0, #0] - thread_t *otp; - - otp = currp; - 800cea8: 6994 ldr r4, [r2, #24] - 800ceaa: 6013 str r3, [r2, #0] -#if defined(CH_CFG_IDLE_LEAVE_HOOK) - if (otp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - 800ceac: 2701 movs r7, #1 -#if CH_CFG_TIME_QUANTUM > 0 - otp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800ceae: 2604 movs r6, #4 - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800ceb0: 2500 movs r5, #0 - 800ceb2: 68a1 ldr r1, [r4, #8] - tqp->p_next->p_prev = (thread_t *)tqp; - 800ceb4: 605a str r2, [r3, #4] -#if defined(CH_CFG_IDLE_LEAVE_HOOK) - if (otp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - 800ceb6: 7707 strb r7, [r0, #28] -void chSchDoRescheduleBehind(void) { - thread_t *otp; - - otp = currp; - /* Picks the first thread from the ready queue and makes it current.*/ - setcurrp(queue_fifo_remove(&ch.rlist.r_queue)); - 800ceb8: 6190 str r0, [r2, #24] - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; -#if CH_CFG_TIME_QUANTUM > 0 - otp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800ceba: 77e6 strb r6, [r4, #31] - chDbgCheck(tp != NULL); - chDbgAssert((tp->p_state != CH_STATE_READY) && - (tp->p_state != CH_STATE_FINAL), - "invalid state"); - - tp->p_state = CH_STATE_READY; - 800cebc: 7725 strb r5, [r4, #28] - 800cebe: e000 b.n 800cec2 - 800cec0: 681b ldr r3, [r3, #0] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - 800cec2: 689a ldr r2, [r3, #8] - 800cec4: 428a cmp r2, r1 - 800cec6: d2fb bcs.n 800cec0 - /* Insertion on p_prev.*/ - tp->p_next = cp; - tp->p_prev = cp->p_prev; - 800cec8: 685a ldr r2, [r3, #4] - 800ceca: 6062 str r2, [r4, #4] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - /* Insertion on p_prev.*/ - tp->p_next = cp; - 800cecc: 6023 str r3, [r4, #0] - currp->p_state = CH_STATE_CURRENT; -#if CH_CFG_TIME_QUANTUM > 0 - otp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif - (void) chSchReadyI(otp); - chSysSwitch(currp, otp); - 800cece: 4621 mov r1, r4 - cp = cp->p_next; - } while (cp->p_prio >= tp->p_prio); - /* Insertion on p_prev.*/ - tp->p_next = cp; - tp->p_prev = cp->p_prev; - tp->p_prev->p_next = tp; - 800ced0: 6014 str r4, [r2, #0] - cp->p_prev = tp; - 800ced2: 605c str r4, [r3, #4] -#if CH_CFG_TIME_QUANTUM > 0 - otp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif - (void) chSchReadyI(otp); - chSysSwitch(currp, otp); -} - 800ced4: bcf0 pop {r4, r5, r6, r7} - currp->p_state = CH_STATE_CURRENT; -#if CH_CFG_TIME_QUANTUM > 0 - otp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif - (void) chSchReadyI(otp); - chSysSwitch(currp, otp); - 800ced6: f7ff b91b b.w 800c110 <_port_switch> - 800ceda: bf00 nop - 800cedc: 20000c40 .word 0x20000c40 - -0800cee0 : - * @special - */ -void chSchDoRescheduleAhead(void) { - thread_t *otp, *cp; - - otp = currp; - 800cee0: 4a0d ldr r2, [pc, #52] ; (800cf18 ) - tp->p_prev->p_next = tp; - tqp->p_prev = tp; -} - -static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) { - thread_t *tp = tqp->p_next; - 800cee2: 6810 ldr r0, [r2, #0] - * @note Not a user function, it is meant to be invoked by the scheduler - * itself or from within the port layer. - * - * @special - */ -void chSchDoRescheduleAhead(void) { - 800cee4: b470 push {r4, r5, r6} - - tqp->p_next = tp->p_next; - 800cee6: 6803 ldr r3, [r0, #0] - thread_t *otp, *cp; - - otp = currp; - 800cee8: 6994 ldr r4, [r2, #24] - 800ceea: 6013 str r3, [r2, #0] -#if defined(CH_CFG_IDLE_LEAVE_HOOK) - if (otp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - 800ceec: 2601 movs r6, #1 - - otp->p_state = CH_STATE_READY; - 800ceee: 2500 movs r5, #0 - 800cef0: 68a1 ldr r1, [r4, #8] - tqp->p_next->p_prev = (thread_t *)tqp; - 800cef2: 605a str r2, [r3, #4] -#if defined(CH_CFG_IDLE_LEAVE_HOOK) - if (otp->p_prio == IDLEPRIO) { - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - 800cef4: 7706 strb r6, [r0, #28] -void chSchDoRescheduleAhead(void) { - thread_t *otp, *cp; - - otp = currp; - /* Picks the first thread from the ready queue and makes it current.*/ - setcurrp(queue_fifo_remove(&ch.rlist.r_queue)); - 800cef6: 6190 str r0, [r2, #24] - CH_CFG_IDLE_LEAVE_HOOK(); - } -#endif - currp->p_state = CH_STATE_CURRENT; - - otp->p_state = CH_STATE_READY; - 800cef8: 7725 strb r5, [r4, #28] - 800cefa: e000 b.n 800cefe - 800cefc: 681b ldr r3, [r3, #0] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio > otp->p_prio); - 800cefe: 689a ldr r2, [r3, #8] - 800cf00: 428a cmp r2, r1 - 800cf02: d8fb bhi.n 800cefc - /* Insertion on p_prev.*/ - otp->p_next = cp; - otp->p_prev = cp->p_prev; - 800cf04: 685a ldr r2, [r3, #4] - 800cf06: 6062 str r2, [r4, #4] - cp = (thread_t *)&ch.rlist.r_queue; - do { - cp = cp->p_next; - } while (cp->p_prio > otp->p_prio); - /* Insertion on p_prev.*/ - otp->p_next = cp; - 800cf08: 6023 str r3, [r4, #0] - otp->p_prev = cp->p_prev; - otp->p_prev->p_next = otp; - cp->p_prev = otp; - - chSysSwitch(currp, otp); - 800cf0a: 4621 mov r1, r4 - cp = cp->p_next; - } while (cp->p_prio > otp->p_prio); - /* Insertion on p_prev.*/ - otp->p_next = cp; - otp->p_prev = cp->p_prev; - otp->p_prev->p_next = otp; - 800cf0c: 6014 str r4, [r2, #0] - cp->p_prev = otp; - 800cf0e: 605c str r4, [r3, #4] - - chSysSwitch(currp, otp); -} - 800cf10: bc70 pop {r4, r5, r6} - otp->p_next = cp; - otp->p_prev = cp->p_prev; - otp->p_prev->p_next = otp; - cp->p_prev = otp; - - chSysSwitch(currp, otp); - 800cf12: f7ff b8fd b.w 800c110 <_port_switch> - 800cf16: bf00 nop - 800cf18: 20000c40 .word 0x20000c40 - 800cf1c: f3af 8000 nop.w - -0800cf20 : - */ -static inline bool chSchIsRescRequiredI(void) { - - chDbgCheckClassI(); - - return firstprio(&ch.rlist.r_queue) > currp->p_prio; - 800cf20: 4b04 ldr r3, [pc, #16] ; (800cf34 ) - 800cf22: 681a ldr r2, [r3, #0] - 800cf24: 699b ldr r3, [r3, #24] - */ -void chSchRescheduleS(void) { - - chDbgCheckClassS(); - - if (chSchIsRescRequiredI()) { - 800cf26: 6892 ldr r2, [r2, #8] - 800cf28: 689b ldr r3, [r3, #8] - 800cf2a: 429a cmp r2, r3 - 800cf2c: d800 bhi.n 800cf30 - 800cf2e: 4770 bx lr - chSchDoRescheduleAhead(); - 800cf30: f7ff bfd6 b.w 800cee0 - 800cf34: 20000c40 .word 0x20000c40 - 800cf38: f3af 8000 nop.w - 800cf3c: f3af 8000 nop.w - -0800cf40 : -void chSchDoReschedule(void) { - -#if CH_CFG_TIME_QUANTUM > 0 - /* If CH_CFG_TIME_QUANTUM is enabled then there are two different scenarios - to handle on preemption: time quantum elapsed or not.*/ - if (currp->p_preempt == (tslices_t)0) { - 800cf40: 4b03 ldr r3, [pc, #12] ; (800cf50 ) - 800cf42: 699b ldr r3, [r3, #24] - 800cf44: 7fdb ldrb r3, [r3, #31] - 800cf46: b10b cbz r3, 800cf4c - chSchDoRescheduleBehind(); - } - else { - /* The thread didn't consume all its time quantum so it is put ahead of - threads with equal priority and does not acquire a new time quantum.*/ - chSchDoRescheduleAhead(); - 800cf48: f7ff bfca b.w 800cee0 - /* If CH_CFG_TIME_QUANTUM is enabled then there are two different scenarios - to handle on preemption: time quantum elapsed or not.*/ - if (currp->p_preempt == (tslices_t)0) { - /* The thread consumed its time quantum so it is enqueued behind threads - with same priority level, however, it acquires a new time quantum.*/ - chSchDoRescheduleBehind(); - 800cf4c: f7ff bfa8 b.w 800cea0 - 800cf50: 20000c40 .word 0x20000c40 - 800cf54: f3af 8000 nop.w - 800cf58: f3af 8000 nop.w - 800cf5c: f3af 8000 nop.w - -0800cf60 <_thread_init>: - * @param[in] prio the priority level for the new thread - * @return The same thread pointer passed as parameter. - * - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - 800cf60: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800cf64: 4c11 ldr r4, [pc, #68] ; (800cfac <_thread_init+0x4c>) - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif -#if CH_CFG_USE_MUTEXES == TRUE - tp->p_realprio = prio; - 800cf66: 6401 str r1, [r0, #64] ; 0x40 -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800cf68: 6966 ldr r6, [r4, #20] - 800cf6a: 6146 str r6, [r0, #20] - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - tp->p_flags = CH_FLAG_MODE_STATIC; - 800cf6c: 2200 movs r2, #0 -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - list_init(&tp->p_waiting); -#endif -#if CH_CFG_USE_MESSAGES == TRUE - queue_init(&tp->p_msgqueue); - 800cf6e: f100 052c add.w r5, r0, #44 ; 0x2c - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - 800cf72: f04f 0802 mov.w r8, #2 - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800cf76: f04f 0c04 mov.w ip, #4 -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; - 800cf7a: f04f 0e01 mov.w lr, #1 -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - list_init(&tp->p_waiting); - 800cf7e: f100 0728 add.w r7, r0, #40 ; 0x28 - * - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - 800cf82: 6081 str r1, [r0, #8] -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800cf84: 6104 str r4, [r0, #16] - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - 800cf86: f880 801c strb.w r8, [r0, #28] - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800cf8a: f880 c01f strb.w ip, [r0, #31] -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; - 800cf8e: f880 e01e strb.w lr, [r0, #30] - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - tp->p_flags = CH_FLAG_MODE_STATIC; - 800cf92: 7742 strb r2, [r0, #29] -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif -#if CH_CFG_USE_MUTEXES == TRUE - tp->p_realprio = prio; - tp->p_mtxlist = NULL; - 800cf94: 63c2 str r2, [r0, #60] ; 0x3c -#endif -#if CH_CFG_USE_EVENTS == TRUE - tp->p_epending = (eventmask_t)0; - 800cf96: 6382 str r2, [r0, #56] ; 0x38 -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; - 800cf98: 6202 str r2, [r0, #32] -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - 800cf9a: 6182 str r2, [r0, #24] - REG_INSERT(tp); - 800cf9c: 6130 str r0, [r6, #16] - 800cf9e: 6160 str r0, [r4, #20] - * - * @notapi - */ -static inline void list_init(threads_list_t *tlp) { - - tlp->p_next = (thread_t *)tlp; - 800cfa0: 6287 str r7, [r0, #40] ; 0x28 - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800cfa2: 62c5 str r5, [r0, #44] ; 0x2c - tqp->p_prev = (thread_t *)tqp; - 800cfa4: 6305 str r5, [r0, #48] ; 0x30 -#endif -#if defined(CH_CFG_THREAD_INIT_HOOK) - CH_CFG_THREAD_INIT_HOOK(tp); -#endif - return tp; -} - 800cfa6: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - 800cfaa: bf00 nop - 800cfac: 20000c40 .word 0x20000c40 - -0800cfb0 : - * the thread into the working space area. - * - * @iclass - */ -thread_t *chThdCreateI(void *wsp, size_t size, - tprio_t prio, tfunc_t pf, void *arg) { - 800cfb0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800cfb4: 3964 subs r1, #100 ; 0x64 -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800cfb6: 4f18 ldr r7, [pc, #96] ; (800d018 ) - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800cfb8: f8df 9060 ldr.w r9, [pc, #96] ; 800d01c -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800cfbc: f8d7 e014 ldr.w lr, [r7, #20] - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800cfc0: 9e09 ldr r6, [sp, #36] ; 0x24 - 800cfc2: 4401 add r1, r0 - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - tp->p_flags = CH_FLAG_MODE_STATIC; - 800cfc4: 2500 movs r5, #0 - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800cfc6: 60c1 str r1, [r0, #12] - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - 800cfc8: f04f 0b02 mov.w fp, #2 - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800cfcc: 640b str r3, [r1, #64] ; 0x40 - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800cfce: f04f 0a04 mov.w sl, #4 -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - list_init(&tp->p_waiting); -#endif -#if CH_CFG_USE_MESSAGES == TRUE - queue_init(&tp->p_msgqueue); - 800cfd2: f100 032c add.w r3, r0, #44 ; 0x2c -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; - 800cfd6: f04f 0801 mov.w r8, #1 -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - list_init(&tp->p_waiting); - 800cfda: f100 0c28 add.w ip, r0, #40 ; 0x28 - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800cfde: 644e str r6, [r1, #68] ; 0x44 - 800cfe0: f8c1 9060 str.w r9, [r1, #96] ; 0x60 - * - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - 800cfe4: 6082 str r2, [r0, #8] -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800cfe6: 6107 str r7, [r0, #16] - 800cfe8: f8c0 e014 str.w lr, [r0, #20] - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif -#if CH_CFG_USE_MUTEXES == TRUE - tp->p_realprio = prio; - 800cfec: 6402 str r2, [r0, #64] ; 0x40 - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - 800cfee: f880 b01c strb.w fp, [r0, #28] - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800cff2: f880 a01f strb.w sl, [r0, #31] -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; - 800cff6: f880 801e strb.w r8, [r0, #30] - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - tp->p_flags = CH_FLAG_MODE_STATIC; - 800cffa: 7745 strb r5, [r0, #29] -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif -#if CH_CFG_USE_MUTEXES == TRUE - tp->p_realprio = prio; - tp->p_mtxlist = NULL; - 800cffc: 63c5 str r5, [r0, #60] ; 0x3c -#endif -#if CH_CFG_USE_EVENTS == TRUE - tp->p_epending = (eventmask_t)0; - 800cffe: 6385 str r5, [r0, #56] ; 0x38 -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; - 800d000: 6205 str r5, [r0, #32] -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - 800d002: 6185 str r5, [r0, #24] - REG_INSERT(tp); - 800d004: f8ce 0010 str.w r0, [lr, #16] - * - * @notapi - */ -static inline void list_init(threads_list_t *tlp) { - - tlp->p_next = (thread_t *)tlp; - 800d008: f8c0 c028 str.w ip, [r0, #40] ; 0x28 - 800d00c: 6178 str r0, [r7, #20] - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800d00e: 62c3 str r3, [r0, #44] ; 0x2c - tqp->p_prev = (thread_t *)tqp; - 800d010: 6303 str r3, [r0, #48] ; 0x30 - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - - return _thread_init(tp, prio); -} - 800d012: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 800d016: bf00 nop - 800d018: 20000c40 .word 0x20000c40 - 800d01c: 0800c129 .word 0x0800c129 - -0800d020 : - * the thread into the working space area. - * - * @api - */ -thread_t *chThdCreateStatic(void *wsp, size_t size, - tprio_t prio, tfunc_t pf, void *arg) { - 800d020: e92d 4ff8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, lr} - 800d024: 4604 mov r4, r0 - 800d026: 2520 movs r5, #32 - 800d028: f385 8811 msr BASEPRI, r5 -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800d02c: 4e1a ldr r6, [pc, #104] ; (800d098 ) - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800d02e: f8df a06c ldr.w sl, [pc, #108] ; 800d09c -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800d032: 6977 ldr r7, [r6, #20] - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800d034: 3964 subs r1, #100 ; 0x64 - 800d036: 4401 add r1, r0 - 800d038: 60c1 str r1, [r0, #12] - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - tp->p_flags = CH_FLAG_MODE_STATIC; - 800d03a: 2500 movs r5, #0 - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800d03c: 640b str r3, [r1, #64] ; 0x40 -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - list_init(&tp->p_waiting); -#endif -#if CH_CFG_USE_MESSAGES == TRUE - queue_init(&tp->p_msgqueue); - 800d03e: f100 0b2c add.w fp, r0, #44 ; 0x2c -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; - 800d042: f04f 0c01 mov.w ip, #1 -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - list_init(&tp->p_waiting); - 800d046: f100 0e28 add.w lr, r0, #40 ; 0x28 - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800d04a: 9b0a ldr r3, [sp, #40] ; 0x28 - 800d04c: 644b str r3, [r1, #68] ; 0x44 - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - 800d04e: f04f 0902 mov.w r9, #2 - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800d052: f04f 0804 mov.w r8, #4 - - chDbgCheckClassI(); - chDbgCheck((wsp != NULL) && (size >= THD_WORKING_AREA_SIZE(0)) && - (prio <= HIGHPRIO) && (pf != NULL)); - - PORT_SETUP_CONTEXT(tp, wsp, size, pf, arg); - 800d056: f8c1 a060 str.w sl, [r1, #96] ; 0x60 - * - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - 800d05a: 6082 str r2, [r0, #8] -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800d05c: 6106 str r6, [r0, #16] - 800d05e: 6147 str r7, [r0, #20] - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif -#if CH_CFG_USE_MUTEXES == TRUE - tp->p_realprio = prio; - 800d060: 6402 str r2, [r0, #64] ; 0x40 - * @notapi - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - 800d062: f880 901c strb.w r9, [r0, #28] - tp->p_flags = CH_FLAG_MODE_STATIC; -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; - 800d066: f880 801f strb.w r8, [r0, #31] -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; - 800d06a: f880 c01e strb.w ip, [r0, #30] - */ -thread_t *_thread_init(thread_t *tp, tprio_t prio) { - - tp->p_prio = prio; - tp->p_state = CH_STATE_WTSTART; - tp->p_flags = CH_FLAG_MODE_STATIC; - 800d06e: 7745 strb r5, [r0, #29] -#if CH_CFG_TIME_QUANTUM > 0 - tp->p_preempt = (tslices_t)CH_CFG_TIME_QUANTUM; -#endif -#if CH_CFG_USE_MUTEXES == TRUE - tp->p_realprio = prio; - tp->p_mtxlist = NULL; - 800d070: 63c5 str r5, [r0, #60] ; 0x3c -#endif -#if CH_CFG_USE_EVENTS == TRUE - tp->p_epending = (eventmask_t)0; - 800d072: 6385 str r5, [r0, #56] ; 0x38 -#endif -#if CH_DBG_THREADS_PROFILING == TRUE - tp->p_time = (systime_t)0; - 800d074: 6205 str r5, [r0, #32] -#endif -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - 800d076: 6185 str r5, [r0, #24] - CH_DBG_STACK_FILL_VALUE); -#endif - - chSysLock(); - tp = chThdCreateI(wsp, size, prio, pf, arg); - chSchWakeupS(tp, MSG_OK); - 800d078: 4629 mov r1, r5 -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs = (trefs_t)1; -#endif -#if CH_CFG_USE_REGISTRY == TRUE - tp->p_name = NULL; - REG_INSERT(tp); - 800d07a: 6138 str r0, [r7, #16] - * - * @notapi - */ -static inline void list_init(threads_list_t *tlp) { - - tlp->p_next = (thread_t *)tlp; - 800d07c: f8c0 e028 str.w lr, [r0, #40] ; 0x28 - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800d080: f8c0 b02c str.w fp, [r0, #44] ; 0x2c - tqp->p_prev = (thread_t *)tqp; - 800d084: f8c0 b030 str.w fp, [r0, #48] ; 0x30 - 800d088: 6170 str r0, [r6, #20] - CH_DBG_STACK_FILL_VALUE); -#endif - - chSysLock(); - tp = chThdCreateI(wsp, size, prio, pf, arg); - chSchWakeupS(tp, MSG_OK); - 800d08a: f7ff fec1 bl 800ce10 - 800d08e: f385 8811 msr BASEPRI, r5 - chSysUnlock(); - - return tp; -} - 800d092: 4620 mov r0, r4 - 800d094: e8bd 8ff8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} - 800d098: 20000c40 .word 0x20000c40 - 800d09c: 0800c129 .word 0x0800c129 - -0800d0a0 : - * - @a TIME_IMMEDIATE this value is not allowed. - * . - * - * @api - */ -void chThdSleep(systime_t time) { - 800d0a0: b508 push {r3, lr} - 800d0a2: 4601 mov r1, r0 - 800d0a4: 2320 movs r3, #32 - 800d0a6: f383 8811 msr BASEPRI, r3 - */ -static inline void chThdSleepS(systime_t time) { - - chDbgCheck(time != TIME_IMMEDIATE); - - (void) chSchGoSleepTimeoutS(CH_STATE_SLEEPING, time); - 800d0aa: 2008 movs r0, #8 - 800d0ac: f7ff fe88 bl 800cdc0 - 800d0b0: 2300 movs r3, #0 - 800d0b2: f383 8811 msr BASEPRI, r3 - 800d0b6: bd08 pop {r3, pc} - 800d0b8: f3af 8000 nop.w - 800d0bc: f3af 8000 nop.w - -0800d0c0 : - * - * @param[in] msg thread exit code - * - * @sclass - */ -void chThdExitS(msg_t msg) { - 800d0c0: b538 push {r3, r4, r5, lr} - thread_t *tp = currp; - 800d0c2: 4b0e ldr r3, [pc, #56] ; (800d0fc ) - 800d0c4: 699c ldr r4, [r3, #24] - * - * @notapi - */ -static inline bool list_notempty(threads_list_t *tlp) { - - return (bool)(tlp->p_next != (thread_t *)tlp); - 800d0c6: 6aa3 ldr r3, [r4, #40] ; 0x28 - - tp->p_u.exitcode = msg; - 800d0c8: 6260 str r0, [r4, #36] ; 0x24 -#if defined(CH_CFG_THREAD_EXIT_HOOK) - CH_CFG_THREAD_EXIT_HOOK(tp); -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - while (list_notempty(&tp->p_waiting)) { - 800d0ca: f104 0528 add.w r5, r4, #40 ; 0x28 - 800d0ce: 429d cmp r5, r3 - 800d0d0: d007 beq.n 800d0e2 -} - -static inline thread_t *list_remove(threads_list_t *tlp) { - - thread_t *tp = tlp->p_next; - tlp->p_next = tp->p_next; - 800d0d2: 681a ldr r2, [r3, #0] - 800d0d4: 62a2 str r2, [r4, #40] ; 0x28 - (void) chSchReadyI(list_remove(&tp->p_waiting)); - 800d0d6: 4618 mov r0, r3 - 800d0d8: f7ff fe42 bl 800cd60 - * - * @notapi - */ -static inline bool list_notempty(threads_list_t *tlp) { - - return (bool)(tlp->p_next != (thread_t *)tlp); - 800d0dc: 6aa3 ldr r3, [r4, #40] ; 0x28 - tp->p_u.exitcode = msg; -#if defined(CH_CFG_THREAD_EXIT_HOOK) - CH_CFG_THREAD_EXIT_HOOK(tp); -#endif -#if CH_CFG_USE_WAITEXIT == TRUE - while (list_notempty(&tp->p_waiting)) { - 800d0de: 42ab cmp r3, r5 - 800d0e0: d1f7 bne.n 800d0d2 - } -#endif -#if CH_CFG_USE_REGISTRY == TRUE - /* Static threads are immediately removed from the registry because - there is no memory to recover.*/ - if ((tp->p_flags & CH_FLAG_MODE_MASK) == CH_FLAG_MODE_STATIC) { - 800d0e2: 7f63 ldrb r3, [r4, #29] - 800d0e4: 079b lsls r3, r3, #30 - 800d0e6: d104 bne.n 800d0f2 - REG_REMOVE(tp); - 800d0e8: 6963 ldr r3, [r4, #20] - 800d0ea: 6922 ldr r2, [r4, #16] - 800d0ec: 611a str r2, [r3, #16] - 800d0ee: 6922 ldr r2, [r4, #16] - 800d0f0: 6153 str r3, [r2, #20] - } -#endif - chSchGoSleepS(CH_STATE_FINAL); - 800d0f2: 200f movs r0, #15 - - /* The thread never returns here.*/ - chDbgAssert(false, "zombies apocalypse"); -} - 800d0f4: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} - there is no memory to recover.*/ - if ((tp->p_flags & CH_FLAG_MODE_MASK) == CH_FLAG_MODE_STATIC) { - REG_REMOVE(tp); - } -#endif - chSchGoSleepS(CH_STATE_FINAL); - 800d0f8: f7ff be4a b.w 800cd90 - 800d0fc: 20000c40 .word 0x20000c40 - -0800d100 : - 800d100: 2320 movs r3, #32 - 800d102: f383 8811 msr BASEPRI, r3 - * @api - */ -void chThdExit(msg_t msg) { - - chSysLock(); - chThdExitS(msg); - 800d106: f7ff bfdb b.w 800d0c0 - 800d10a: bf00 nop - 800d10c: f3af 8000 nop.w - -0800d110 : - * @param[in] trp a pointer to a thread reference object - * @return The wake up message. - * - * @sclass - */ -msg_t chThdSuspendS(thread_reference_t *trp) { - 800d110: b510 push {r4, lr} - * - * @xclass - */ -static inline thread_t *chThdGetSelfX(void) { - - return ch.rlist.r_current; - 800d112: 4c05 ldr r4, [pc, #20] ; (800d128 ) - 800d114: 69a3 ldr r3, [r4, #24] - thread_t *tp = chThdGetSelfX(); - - chDbgAssert(*trp == NULL, "not NULL"); - - *trp = tp; - 800d116: 6003 str r3, [r0, #0] - * @param[in] trp a pointer to a thread reference object - * @return The wake up message. - * - * @sclass - */ -msg_t chThdSuspendS(thread_reference_t *trp) { - 800d118: 4602 mov r2, r0 - thread_t *tp = chThdGetSelfX(); - - chDbgAssert(*trp == NULL, "not NULL"); - - *trp = tp; - tp->p_u.wttrp = trp; - 800d11a: 625a str r2, [r3, #36] ; 0x24 - chSchGoSleepS(CH_STATE_SUSPENDED); - 800d11c: 2003 movs r0, #3 - 800d11e: f7ff fe37 bl 800cd90 - - return chThdGetSelfX()->p_u.rdymsg; - 800d122: 69a3 ldr r3, [r4, #24] -} - 800d124: 6a58 ldr r0, [r3, #36] ; 0x24 - 800d126: bd10 pop {r4, pc} - 800d128: 20000c40 .word 0x20000c40 - 800d12c: f3af 8000 nop.w - -0800d130 : - * - * @iclass - */ -void chThdResumeI(thread_reference_t *trp, msg_t msg) { - - if (*trp != NULL) { - 800d130: 6803 ldr r3, [r0, #0] - 800d132: b12b cbz r3, 800d140 - thread_t *tp = *trp; - - chDbgAssert(tp->p_state == CH_STATE_SUSPENDED, - "not THD_STATE_SUSPENDED"); - - *trp = NULL; - 800d134: 2200 movs r2, #0 - 800d136: 6002 str r2, [r0, #0] - tp->p_u.rdymsg = msg; - (void) chSchReadyI(tp); - 800d138: 4618 mov r0, r3 - - chDbgAssert(tp->p_state == CH_STATE_SUSPENDED, - "not THD_STATE_SUSPENDED"); - - *trp = NULL; - tp->p_u.rdymsg = msg; - 800d13a: 6259 str r1, [r3, #36] ; 0x24 - (void) chSchReadyI(tp); - 800d13c: f7ff be10 b.w 800cd60 - 800d140: 4770 bx lr - 800d142: bf00 nop - 800d144: f3af 8000 nop.w - 800d148: f3af 8000 nop.w - 800d14c: f3af 8000 nop.w - -0800d150 : - * - * @sclass - */ -msg_t chThdEnqueueTimeoutS(threads_queue_t *tqp, systime_t timeout) { - - if (TIME_IMMEDIATE == timeout) { - 800d150: b169 cbz r1, 800d16e - return MSG_TIMEOUT; - } - - queue_insert(currp, tqp); - 800d152: 4b08 ldr r3, [pc, #32] ; (800d174 ) - * invoked with @p TIME_IMMEDIATE as timeout - * specification. - * - * @sclass - */ -msg_t chThdEnqueueTimeoutS(threads_queue_t *tqp, systime_t timeout) { - 800d154: b410 push {r4} - 800d156: 4602 mov r2, r0 -} - -static inline void queue_insert(thread_t *tp, threads_queue_t *tqp) { - - tp->p_next = (thread_t *)tqp; - tp->p_prev = tqp->p_prev; - 800d158: 6844 ldr r4, [r0, #4] - - if (TIME_IMMEDIATE == timeout) { - return MSG_TIMEOUT; - } - - queue_insert(currp, tqp); - 800d15a: 699b ldr r3, [r3, #24] - - return chSchGoSleepTimeoutS(CH_STATE_QUEUED, timeout); - 800d15c: 2004 movs r0, #4 - 800d15e: e883 0014 stmia.w r3, {r2, r4} - tp->p_prev->p_next = tp; - 800d162: 6023 str r3, [r4, #0] - tqp->p_prev = tp; - 800d164: 6053 str r3, [r2, #4] -} - 800d166: f85d 4b04 ldr.w r4, [sp], #4 - return MSG_TIMEOUT; - } - - queue_insert(currp, tqp); - - return chSchGoSleepTimeoutS(CH_STATE_QUEUED, timeout); - 800d16a: f7ff be29 b.w 800cdc0 -} - 800d16e: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff - 800d172: 4770 bx lr - 800d174: 20000c40 .word 0x20000c40 - 800d178: f3af 8000 nop.w - 800d17c: f3af 8000 nop.w - -0800d180 : - * @param[in] tqp pointer to the threads queue object - * @param[in] msg the message code - * - * @iclass - */ -void chThdDequeueAllI(threads_queue_t *tqp, msg_t msg) { - 800d180: b538 push {r3, r4, r5, lr} - * - * @notapi - */ -static inline bool queue_notempty(const threads_queue_t *tqp) { - - return (bool)(tqp->p_next != (const thread_t *)tqp); - 800d182: 6803 ldr r3, [r0, #0] - - while (queue_notempty(tqp)) { - 800d184: 4298 cmp r0, r3 - * @param[in] tqp pointer to the threads queue object - * @param[in] msg the message code - * - * @iclass - */ -void chThdDequeueAllI(threads_queue_t *tqp, msg_t msg) { - 800d186: 4604 mov r4, r0 - 800d188: 460d mov r5, r1 - - while (queue_notempty(tqp)) { - 800d18a: d009 beq.n 800d1a0 -} - -static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) { - thread_t *tp = tqp->p_next; - - tqp->p_next = tp->p_next; - 800d18c: 681a ldr r2, [r3, #0] - 800d18e: 6022 str r2, [r4, #0] - tp = queue_fifo_remove(tqp); - - chDbgAssert(tp->p_state == CH_STATE_QUEUED, "invalid state"); - - tp->p_u.rdymsg = msg; - (void) chSchReadyI(tp); - 800d190: 4618 mov r0, r3 - tqp->p_next->p_prev = (thread_t *)tqp; - 800d192: 6054 str r4, [r2, #4] - - tp = queue_fifo_remove(tqp); - - chDbgAssert(tp->p_state == CH_STATE_QUEUED, "invalid state"); - - tp->p_u.rdymsg = msg; - 800d194: 625d str r5, [r3, #36] ; 0x24 - (void) chSchReadyI(tp); - 800d196: f7ff fde3 bl 800cd60 - * - * @notapi - */ -static inline bool queue_notempty(const threads_queue_t *tqp) { - - return (bool)(tqp->p_next != (const thread_t *)tqp); - 800d19a: 6823 ldr r3, [r4, #0] - 800d19c: 429c cmp r4, r3 - 800d19e: d1f5 bne.n 800d18c - 800d1a0: bd38 pop {r3, r4, r5, pc} - 800d1a2: bf00 nop - 800d1a4: f3af 8000 nop.w - 800d1a8: f3af 8000 nop.w - 800d1ac: f3af 8000 nop.w - -0800d1b0 : - 800d1b0: 4b01 ldr r3, [pc, #4] ; (800d1b8 ) - 800d1b2: 685b ldr r3, [r3, #4] - * - * @xclass - */ -NOINLINE void chTMStartMeasurementX(time_measurement_t *tmp) { - - tmp->last = chSysGetRealtimeCounterX(); - 800d1b4: 6083 str r3, [r0, #8] - 800d1b6: 4770 bx lr - 800d1b8: e0001000 .word 0xe0001000 - 800d1bc: f3af 8000 nop.w - -0800d1c0 : - 800d1c0: 4b0f ldr r3, [pc, #60] ; (800d200 ) - * - * @xclass - */ -NOINLINE void chTMStopMeasurementX(time_measurement_t *tmp) { - - tm_stop(tmp, chSysGetRealtimeCounterX(), ch.tm.offset); - 800d1c2: 4910 ldr r1, [pc, #64] ; (800d204 ) - 800d1c4: 685a ldr r2, [r3, #4] -static inline void tm_stop(time_measurement_t *tmp, - rtcnt_t now, - rtcnt_t offset) { - - tmp->n++; - tmp->last = (now - tmp->last) - offset; - 800d1c6: 6883 ldr r3, [r0, #8] - * - * @param[in,out] tmp pointer to a @p time_measurement_t structure - * - * @xclass - */ -NOINLINE void chTMStopMeasurementX(time_measurement_t *tmp) { - 800d1c8: b4f0 push {r4, r5, r6, r7} - - tm_stop(tmp, chSysGetRealtimeCounterX(), ch.tm.offset); - 800d1ca: 6f8f ldr r7, [r1, #120] ; 0x78 - -static inline void tm_stop(time_measurement_t *tmp, - rtcnt_t now, - rtcnt_t offset) { - - tmp->n++; - 800d1cc: 68c6 ldr r6, [r0, #12] - tmp->last = (now - tmp->last) - offset; - tmp->cumulative += (rttime_t)tmp->last; - /*lint -save -e9013 [15.7] There is no else because it is not needed.*/ - if (tmp->last > tmp->worst) { - 800d1ce: 6841 ldr r1, [r0, #4] - rtcnt_t now, - rtcnt_t offset) { - - tmp->n++; - tmp->last = (now - tmp->last) - offset; - tmp->cumulative += (rttime_t)tmp->last; - 800d1d0: e9d0 4504 ldrd r4, r5, [r0, #16] -static inline void tm_stop(time_measurement_t *tmp, - rtcnt_t now, - rtcnt_t offset) { - - tmp->n++; - tmp->last = (now - tmp->last) - offset; - 800d1d4: 1ad3 subs r3, r2, r3 - 800d1d6: 1bdb subs r3, r3, r7 - tmp->cumulative += (rttime_t)tmp->last; - 800d1d8: 18e4 adds r4, r4, r3 - 800d1da: f145 0500 adc.w r5, r5, #0 - -static inline void tm_stop(time_measurement_t *tmp, - rtcnt_t now, - rtcnt_t offset) { - - tmp->n++; - 800d1de: 3601 adds r6, #1 - tmp->last = (now - tmp->last) - offset; - tmp->cumulative += (rttime_t)tmp->last; - /*lint -save -e9013 [15.7] There is no else because it is not needed.*/ - if (tmp->last > tmp->worst) { - 800d1e0: 428b cmp r3, r1 - -static inline void tm_stop(time_measurement_t *tmp, - rtcnt_t now, - rtcnt_t offset) { - - tmp->n++; - 800d1e2: 60c6 str r6, [r0, #12] - tmp->last = (now - tmp->last) - offset; - 800d1e4: 6083 str r3, [r0, #8] - tmp->cumulative += (rttime_t)tmp->last; - 800d1e6: e9c0 4504 strd r4, r5, [r0, #16] - /*lint -save -e9013 [15.7] There is no else because it is not needed.*/ - if (tmp->last > tmp->worst) { - 800d1ea: d805 bhi.n 800d1f8 - tmp->worst = tmp->last; - } - else if (tmp->last < tmp->best) { - 800d1ec: 6802 ldr r2, [r0, #0] - 800d1ee: 4293 cmp r3, r2 - tmp->best = tmp->last; - 800d1f0: bf38 it cc - 800d1f2: 6003 strcc r3, [r0, #0] - * @xclass - */ -NOINLINE void chTMStopMeasurementX(time_measurement_t *tmp) { - - tm_stop(tmp, chSysGetRealtimeCounterX(), ch.tm.offset); -} - 800d1f4: bcf0 pop {r4, r5, r6, r7} - 800d1f6: 4770 bx lr - tmp->n++; - tmp->last = (now - tmp->last) - offset; - tmp->cumulative += (rttime_t)tmp->last; - /*lint -save -e9013 [15.7] There is no else because it is not needed.*/ - if (tmp->last > tmp->worst) { - tmp->worst = tmp->last; - 800d1f8: 6043 str r3, [r0, #4] - * @xclass - */ -NOINLINE void chTMStopMeasurementX(time_measurement_t *tmp) { - - tm_stop(tmp, chSysGetRealtimeCounterX(), ch.tm.offset); -} - 800d1fa: bcf0 pop {r4, r5, r6, r7} - 800d1fc: 4770 bx lr - 800d1fe: bf00 nop - 800d200: e0001000 .word 0xe0001000 - 800d204: 20000c40 .word 0x20000c40 - 800d208: f3af 8000 nop.w - 800d20c: f3af 8000 nop.w - -0800d210 <_tm_init>: -/** - * @brief Initializes the time measurement unit. - * - * @init - */ -void _tm_init(void) { - 800d210: b5d0 push {r4, r6, r7, lr} - time_measurement_t tm; - - /* Time Measurement subsystem calibration, it does a null measurement - and calculates the call overhead which is subtracted to real - measurements.*/ - ch.tm.offset = (rtcnt_t)0; - 800d212: 4c0c ldr r4, [pc, #48] ; (800d244 <_tm_init+0x34>) -/** - * @brief Initializes the time measurement unit. - * - * @init - */ -void _tm_init(void) { - 800d214: b086 sub sp, #24 - time_measurement_t tm; - - /* Time Measurement subsystem calibration, it does a null measurement - and calculates the call overhead which is subtracted to real - measurements.*/ - ch.tm.offset = (rtcnt_t)0; - 800d216: 2300 movs r3, #0 - * - * @init - */ -void chTMObjectInit(time_measurement_t *tmp) { - - tmp->best = (rtcnt_t)-1; - 800d218: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff - /* Time Measurement subsystem calibration, it does a null measurement - and calculates the call overhead which is subtracted to real - measurements.*/ - ch.tm.offset = (rtcnt_t)0; - chTMObjectInit(&tm); - chTMStartMeasurementX(&tm); - 800d21c: 4668 mov r0, sp - - tmp->best = (rtcnt_t)-1; - tmp->worst = (rtcnt_t)0; - tmp->last = (rtcnt_t)0; - tmp->n = (ucnt_t)0; - tmp->cumulative = (rttime_t)0; - 800d21e: 2600 movs r6, #0 - 800d220: 2700 movs r7, #0 - time_measurement_t tm; - - /* Time Measurement subsystem calibration, it does a null measurement - and calculates the call overhead which is subtracted to real - measurements.*/ - ch.tm.offset = (rtcnt_t)0; - 800d222: 67a3 str r3, [r4, #120] ; 0x78 - * @init - */ -void chTMObjectInit(time_measurement_t *tmp) { - - tmp->best = (rtcnt_t)-1; - tmp->worst = (rtcnt_t)0; - 800d224: 9301 str r3, [sp, #4] - tmp->last = (rtcnt_t)0; - 800d226: 9302 str r3, [sp, #8] - tmp->n = (ucnt_t)0; - 800d228: 9303 str r3, [sp, #12] - * - * @init - */ -void chTMObjectInit(time_measurement_t *tmp) { - - tmp->best = (rtcnt_t)-1; - 800d22a: 9200 str r2, [sp, #0] - tmp->worst = (rtcnt_t)0; - tmp->last = (rtcnt_t)0; - tmp->n = (ucnt_t)0; - tmp->cumulative = (rttime_t)0; - 800d22c: e9cd 6704 strd r6, r7, [sp, #16] - /* Time Measurement subsystem calibration, it does a null measurement - and calculates the call overhead which is subtracted to real - measurements.*/ - ch.tm.offset = (rtcnt_t)0; - chTMObjectInit(&tm); - chTMStartMeasurementX(&tm); - 800d230: f7ff ffbe bl 800d1b0 - chTMStopMeasurementX(&tm); - 800d234: 4668 mov r0, sp - 800d236: f7ff ffc3 bl 800d1c0 - ch.tm.offset = tm.last; - 800d23a: 9b02 ldr r3, [sp, #8] - 800d23c: 67a3 str r3, [r4, #120] ; 0x78 -} - 800d23e: b006 add sp, #24 - 800d240: bdd0 pop {r4, r6, r7, pc} - 800d242: bf00 nop - 800d244: 20000c40 .word 0x20000c40 - 800d248: f3af 8000 nop.w - 800d24c: f3af 8000 nop.w - -0800d250 : -void chMtxObjectInit(mutex_t *mp) { - - chDbgCheck(mp != NULL); - - queue_init(&mp->m_queue); - mp->m_owner = NULL; - 800d250: 2300 movs r3, #0 - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800d252: 6000 str r0, [r0, #0] - tqp->p_prev = (thread_t *)tqp; - 800d254: 6040 str r0, [r0, #4] - 800d256: 6083 str r3, [r0, #8] - 800d258: 4770 bx lr - 800d25a: bf00 nop - 800d25c: f3af 8000 nop.w - -0800d260 : -void chEvtSignalI(thread_t *tp, eventmask_t events) { - - chDbgCheckClassI(); - chDbgCheck(tp != NULL); - - tp->p_epending |= events; - 800d260: 6b83 ldr r3, [r0, #56] ; 0x38 - /* Test on the AND/OR conditions wait states.*/ - if (((tp->p_state == CH_STATE_WTOREVT) && - 800d262: 7f02 ldrb r2, [r0, #28] -void chEvtSignalI(thread_t *tp, eventmask_t events) { - - chDbgCheckClassI(); - chDbgCheck(tp != NULL); - - tp->p_epending |= events; - 800d264: 4319 orrs r1, r3 - /* Test on the AND/OR conditions wait states.*/ - if (((tp->p_state == CH_STATE_WTOREVT) && - 800d266: 2a0a cmp r2, #10 -void chEvtSignalI(thread_t *tp, eventmask_t events) { - - chDbgCheckClassI(); - chDbgCheck(tp != NULL); - - tp->p_epending |= events; - 800d268: 6381 str r1, [r0, #56] ; 0x38 - /* Test on the AND/OR conditions wait states.*/ - if (((tp->p_state == CH_STATE_WTOREVT) && - 800d26a: d00a beq.n 800d282 - ((tp->p_epending & tp->p_u.ewmask) != (eventmask_t)0)) || - 800d26c: 2a0b cmp r2, #11 - 800d26e: d000 beq.n 800d272 - 800d270: 4770 bx lr - ((tp->p_state == CH_STATE_WTANDEVT) && - ((tp->p_epending & tp->p_u.ewmask) == tp->p_u.ewmask))) { - 800d272: 6a43 ldr r3, [r0, #36] ; 0x24 - 800d274: 4019 ands r1, r3 - - tp->p_epending |= events; - /* Test on the AND/OR conditions wait states.*/ - if (((tp->p_state == CH_STATE_WTOREVT) && - ((tp->p_epending & tp->p_u.ewmask) != (eventmask_t)0)) || - ((tp->p_state == CH_STATE_WTANDEVT) && - 800d276: 428b cmp r3, r1 - 800d278: d1fa bne.n 800d270 - ((tp->p_epending & tp->p_u.ewmask) == tp->p_u.ewmask))) { - tp->p_u.rdymsg = MSG_OK; - 800d27a: 2300 movs r3, #0 - 800d27c: 6243 str r3, [r0, #36] ; 0x24 - (void) chSchReadyI(tp); - 800d27e: f7ff bd6f b.w 800cd60 - chDbgCheck(tp != NULL); - - tp->p_epending |= events; - /* Test on the AND/OR conditions wait states.*/ - if (((tp->p_state == CH_STATE_WTOREVT) && - ((tp->p_epending & tp->p_u.ewmask) != (eventmask_t)0)) || - 800d282: 6a43 ldr r3, [r0, #36] ; 0x24 - chDbgCheckClassI(); - chDbgCheck(tp != NULL); - - tp->p_epending |= events; - /* Test on the AND/OR conditions wait states.*/ - if (((tp->p_state == CH_STATE_WTOREVT) && - 800d284: 4219 tst r1, r3 - 800d286: d1f8 bne.n 800d27a - 800d288: 4770 bx lr - 800d28a: bf00 nop - 800d28c: f3af 8000 nop.w - -0800d290 : - * @param[in] esp pointer to the @p event_source_t structure - * @param[in] flags the flags set to be added to the listener flags mask - * - * @iclass - */ -void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags) { - 800d290: b570 push {r4, r5, r6, lr} - event_listener_t *elp; - - chDbgCheckClassI(); - chDbgCheck(esp != NULL); - - elp = esp->es_next; - 800d292: 6804 ldr r4, [r0, #0] - /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/ - while (elp != (event_listener_t *)esp) { - 800d294: 42a0 cmp r0, r4 - * @param[in] esp pointer to the @p event_source_t structure - * @param[in] flags the flags set to be added to the listener flags mask - * - * @iclass - */ -void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags) { - 800d296: 4606 mov r6, r0 - 800d298: 460d mov r5, r1 - chDbgCheckClassI(); - chDbgCheck(esp != NULL); - - elp = esp->es_next; - /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/ - while (elp != (event_listener_t *)esp) { - 800d29a: d00d beq.n 800d2b8 - /*lint -restore*/ - elp->el_flags |= flags; - 800d29c: 68e3 ldr r3, [r4, #12] - 800d29e: 432b orrs r3, r5 - 800d2a0: 60e3 str r3, [r4, #12] - /* When flags == 0 the thread will always be signaled because the - source does not emit any flag.*/ - if ((flags == (eventflags_t)0) || - 800d2a2: b115 cbz r5, 800d2aa - ((elp->el_flags & elp->el_wflags) != (eventflags_t)0)) { - 800d2a4: 6922 ldr r2, [r4, #16] - while (elp != (event_listener_t *)esp) { - /*lint -restore*/ - elp->el_flags |= flags; - /* When flags == 0 the thread will always be signaled because the - source does not emit any flag.*/ - if ((flags == (eventflags_t)0) || - 800d2a6: 4213 tst r3, r2 - 800d2a8: d003 beq.n 800d2b2 - ((elp->el_flags & elp->el_wflags) != (eventflags_t)0)) { - chEvtSignalI(elp->el_listener, elp->el_events); - 800d2aa: 6860 ldr r0, [r4, #4] - 800d2ac: 68a1 ldr r1, [r4, #8] - 800d2ae: f7ff ffd7 bl 800d260 - } - elp = elp->el_next; - 800d2b2: 6824 ldr r4, [r4, #0] - chDbgCheckClassI(); - chDbgCheck(esp != NULL); - - elp = esp->es_next; - /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/ - while (elp != (event_listener_t *)esp) { - 800d2b4: 42a6 cmp r6, r4 - 800d2b6: d1f1 bne.n 800d29c - 800d2b8: bd70 pop {r4, r5, r6, pc} - 800d2ba: bf00 nop - 800d2bc: f3af 8000 nop.w - -0800d2c0 : - * @param[in] link application defined pointer - * - * @init - */ -void chIQObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size, - qnotify_t infy, void *link) { - 800d2c0: b430 push {r4, r5} - 800d2c2: 9c02 ldr r4, [sp, #8] - iqp->q_buffer = bp; - iqp->q_rdptr = bp; - iqp->q_wrptr = bp; - iqp->q_top = bp + size; - iqp->q_notify = infy; - iqp->q_link = link; - 800d2c4: 6204 str r4, [r0, #32] - */ -void chIQObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size, - qnotify_t infy, void *link) { - - chThdQueueObjectInit(&iqp->q_waiting); - iqp->q_counter = 0; - 800d2c6: 2500 movs r5, #0 - iqp->q_buffer = bp; - iqp->q_rdptr = bp; - iqp->q_wrptr = bp; - iqp->q_top = bp + size; - 800d2c8: 440a add r2, r1 - */ -void chIQObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size, - qnotify_t infy, void *link) { - - chThdQueueObjectInit(&iqp->q_waiting); - iqp->q_counter = 0; - 800d2ca: 6085 str r5, [r0, #8] - iqp->q_buffer = bp; - iqp->q_rdptr = bp; - iqp->q_wrptr = bp; - iqp->q_top = bp + size; - 800d2cc: 6102 str r2, [r0, #16] - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800d2ce: 6000 str r0, [r0, #0] - tqp->p_prev = (thread_t *)tqp; - 800d2d0: 6040 str r0, [r0, #4] -void chIQObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size, - qnotify_t infy, void *link) { - - chThdQueueObjectInit(&iqp->q_waiting); - iqp->q_counter = 0; - iqp->q_buffer = bp; - 800d2d2: 60c1 str r1, [r0, #12] - iqp->q_rdptr = bp; - 800d2d4: 6181 str r1, [r0, #24] - iqp->q_wrptr = bp; - 800d2d6: 6141 str r1, [r0, #20] - iqp->q_top = bp + size; - iqp->q_notify = infy; - 800d2d8: 61c3 str r3, [r0, #28] - iqp->q_link = link; -} - 800d2da: bc30 pop {r4, r5} - 800d2dc: 4770 bx lr - 800d2de: bf00 nop - -0800d2e0 : - - chDbgCheckClassI(); - - iqp->q_rdptr = iqp->q_buffer; - iqp->q_wrptr = iqp->q_buffer; - iqp->q_counter = 0; - 800d2e0: 2100 movs r1, #0 - */ -void chIQResetI(input_queue_t *iqp) { - - chDbgCheckClassI(); - - iqp->q_rdptr = iqp->q_buffer; - 800d2e2: 68c2 ldr r2, [r0, #12] - iqp->q_wrptr = iqp->q_buffer; - iqp->q_counter = 0; - 800d2e4: 6081 str r1, [r0, #8] - */ -void chIQResetI(input_queue_t *iqp) { - - chDbgCheckClassI(); - - iqp->q_rdptr = iqp->q_buffer; - 800d2e6: 6182 str r2, [r0, #24] - iqp->q_wrptr = iqp->q_buffer; - 800d2e8: 6142 str r2, [r0, #20] - iqp->q_counter = 0; - chThdDequeueAllI(&iqp->q_waiting, Q_RESET); - 800d2ea: f06f 0101 mvn.w r1, #1 - 800d2ee: f7ff bf47 b.w 800d180 - 800d2f2: bf00 nop - 800d2f4: f3af 8000 nop.w - 800d2f8: f3af 8000 nop.w - 800d2fc: f3af 8000 nop.w - -0800d300 : - * @retval Q_TIMEOUT if the specified time expired. - * @retval Q_RESET if the queue has been reset. - * - * @api - */ -msg_t chIQGetTimeout(input_queue_t *iqp, systime_t timeout) { - 800d300: b570 push {r4, r5, r6, lr} - 800d302: 2320 movs r3, #32 - 800d304: 460e mov r6, r1 - 800d306: 4604 mov r4, r0 - 800d308: f383 8811 msr BASEPRI, r3 - uint8_t b; - - chSysLock(); - if (iqp->q_notify != NULL) { - 800d30c: 69c3 ldr r3, [r0, #28] - 800d30e: b12b cbz r3, 800d31c - iqp->q_notify(iqp); - 800d310: 4798 blx r3 - 800d312: e003 b.n 800d31c - } - - while (chIQIsEmptyI(iqp)) { - msg_t msg = chThdEnqueueTimeoutS(&iqp->q_waiting, timeout); - 800d314: f7ff ff1c bl 800d150 - if (msg < Q_OK) { - 800d318: 2800 cmp r0, #0 - 800d31a: db15 blt.n 800d348 - */ -static inline bool chIQIsEmptyI(input_queue_t *iqp) { - - chDbgCheckClassI(); - - return (bool)(chQSpaceI(iqp) == 0U); - 800d31c: 68a5 ldr r5, [r4, #8] - if (iqp->q_notify != NULL) { - iqp->q_notify(iqp); - } - - while (chIQIsEmptyI(iqp)) { - msg_t msg = chThdEnqueueTimeoutS(&iqp->q_waiting, timeout); - 800d31e: 4620 mov r0, r4 - 800d320: 4631 mov r1, r6 - chSysLock(); - if (iqp->q_notify != NULL) { - iqp->q_notify(iqp); - } - - while (chIQIsEmptyI(iqp)) { - 800d322: 2d00 cmp r5, #0 - 800d324: d0f6 beq.n 800d314 - return msg; - } - } - - iqp->q_counter--; - b = *iqp->q_rdptr++; - 800d326: 69a1 ldr r1, [r4, #24] - chSysUnlock(); - return msg; - } - } - - iqp->q_counter--; - 800d328: 68a3 ldr r3, [r4, #8] - b = *iqp->q_rdptr++; - if (iqp->q_rdptr >= iqp->q_top) { - 800d32a: 6925 ldr r5, [r4, #16] - return msg; - } - } - - iqp->q_counter--; - b = *iqp->q_rdptr++; - 800d32c: 1c4a adds r2, r1, #1 - chSysUnlock(); - return msg; - } - } - - iqp->q_counter--; - 800d32e: 3b01 subs r3, #1 - b = *iqp->q_rdptr++; - if (iqp->q_rdptr >= iqp->q_top) { - 800d330: 42aa cmp r2, r5 - chSysUnlock(); - return msg; - } - } - - iqp->q_counter--; - 800d332: 60a3 str r3, [r4, #8] - b = *iqp->q_rdptr++; - 800d334: 61a2 str r2, [r4, #24] - if (iqp->q_rdptr >= iqp->q_top) { - iqp->q_rdptr = iqp->q_buffer; - 800d336: bf28 it cs - 800d338: 68e3 ldrcs r3, [r4, #12] - return msg; - } - } - - iqp->q_counter--; - b = *iqp->q_rdptr++; - 800d33a: 7808 ldrb r0, [r1, #0] - if (iqp->q_rdptr >= iqp->q_top) { - iqp->q_rdptr = iqp->q_buffer; - 800d33c: bf28 it cs - 800d33e: 61a3 strcs r3, [r4, #24] - 800d340: 2300 movs r3, #0 - 800d342: f383 8811 msr BASEPRI, r3 - } - chSysUnlock(); - - return (msg_t)b; -} - 800d346: bd70 pop {r4, r5, r6, pc} - 800d348: f385 8811 msr BASEPRI, r5 - - while (chIQIsEmptyI(iqp)) { - msg_t msg = chThdEnqueueTimeoutS(&iqp->q_waiting, timeout); - if (msg < Q_OK) { - chSysUnlock(); - return msg; - 800d34c: bd70 pop {r4, r5, r6, pc} - 800d34e: bf00 nop - -0800d350 : - * @return The number of bytes effectively transferred. - * - * @api - */ -size_t chIQReadTimeout(input_queue_t *iqp, uint8_t *bp, - size_t n, systime_t timeout) { - 800d350: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - 800d354: 4604 mov r4, r0 - 800d356: b083 sub sp, #12 - 800d358: 4689 mov r9, r1 - 800d35a: 4693 mov fp, r2 - 800d35c: 461d mov r5, r3 - qnotify_t nfy = iqp->q_notify; - 800d35e: f8d0 801c ldr.w r8, [r0, #28] - 800d362: 2720 movs r7, #32 - 800d364: f387 8811 msr BASEPRI, r7 - size_t r = 0; - 800d368: 2600 movs r6, #0 - 800d36a: 9701 str r7, [sp, #4] - 800d36c: 46b2 mov sl, r6 - - chDbgCheck(n > 0U); - - chSysLock(); - while (true) { - if (nfy != NULL) { - 800d36e: f1b8 0f00 cmp.w r8, #0 - 800d372: d005 beq.n 800d380 - nfy(iqp); - 800d374: 4620 mov r0, r4 - 800d376: 47c0 blx r8 - 800d378: e002 b.n 800d380 - } - - while (chIQIsEmptyI(iqp)) { - if (chThdEnqueueTimeoutS(&iqp->q_waiting, timeout) != Q_OK) { - 800d37a: f7ff fee9 bl 800d150 - 800d37e: b9e0 cbnz r0, 800d3ba - 800d380: 68a7 ldr r7, [r4, #8] - 800d382: 4620 mov r0, r4 - 800d384: 4629 mov r1, r5 - while (true) { - if (nfy != NULL) { - nfy(iqp); - } - - while (chIQIsEmptyI(iqp)) { - 800d386: 2f00 cmp r7, #0 - 800d388: d0f7 beq.n 800d37a - return r; - } - } - - iqp->q_counter--; - *bp++ = *iqp->q_rdptr++; - 800d38a: 69a2 ldr r2, [r4, #24] - chSysUnlock(); - return r; - } - } - - iqp->q_counter--; - 800d38c: 68a3 ldr r3, [r4, #8] - *bp++ = *iqp->q_rdptr++; - 800d38e: 1c51 adds r1, r2, #1 - chSysUnlock(); - return r; - } - } - - iqp->q_counter--; - 800d390: 3b01 subs r3, #1 - *bp++ = *iqp->q_rdptr++; - 800d392: 61a1 str r1, [r4, #24] - chSysUnlock(); - return r; - } - } - - iqp->q_counter--; - 800d394: 60a3 str r3, [r4, #8] - *bp++ = *iqp->q_rdptr++; - 800d396: 7813 ldrb r3, [r2, #0] - 800d398: f809 3b01 strb.w r3, [r9], #1 - if (iqp->q_rdptr >= iqp->q_top) { - 800d39c: 6923 ldr r3, [r4, #16] - 800d39e: 69a2 ldr r2, [r4, #24] - 800d3a0: 429a cmp r2, r3 - iqp->q_rdptr = iqp->q_buffer; - 800d3a2: bf24 itt cs - 800d3a4: 68e3 ldrcs r3, [r4, #12] - 800d3a6: 61a3 strcs r3, [r4, #24] - 800d3a8: f38a 8811 msr BASEPRI, sl - } - chSysUnlock(); /* Gives a preemption chance in a controlled point.*/ - - r++; - 800d3ac: 3601 adds r6, #1 - if (--n == 0U) { - 800d3ae: 45b3 cmp fp, r6 - 800d3b0: d005 beq.n 800d3be - 800d3b2: 9b01 ldr r3, [sp, #4] - 800d3b4: f383 8811 msr BASEPRI, r3 - 800d3b8: e7d9 b.n 800d36e - 800d3ba: f387 8811 msr BASEPRI, r7 - return r; - } - - chSysLock(); - } -} - 800d3be: 4630 mov r0, r6 - 800d3c0: b003 add sp, #12 - 800d3c2: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 800d3c6: bf00 nop - 800d3c8: f3af 8000 nop.w - 800d3cc: f3af 8000 nop.w - -0800d3d0 : - * @param[in] link application defined pointer - * - * @init - */ -void chOQObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size, - qnotify_t onfy, void *link) { - 800d3d0: b430 push {r4, r5} - 800d3d2: 9c02 ldr r4, [sp, #8] - oqp->q_buffer = bp; - oqp->q_rdptr = bp; - oqp->q_wrptr = bp; - oqp->q_top = bp + size; - oqp->q_notify = onfy; - oqp->q_link = link; - 800d3d4: 6204 str r4, [r0, #32] - chThdQueueObjectInit(&oqp->q_waiting); - oqp->q_counter = size; - oqp->q_buffer = bp; - oqp->q_rdptr = bp; - oqp->q_wrptr = bp; - oqp->q_top = bp + size; - 800d3d6: 188d adds r5, r1, r2 - 800d3d8: 6105 str r5, [r0, #16] - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800d3da: 6000 str r0, [r0, #0] - tqp->p_prev = (thread_t *)tqp; - 800d3dc: 6040 str r0, [r0, #4] - */ -void chOQObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size, - qnotify_t onfy, void *link) { - - chThdQueueObjectInit(&oqp->q_waiting); - oqp->q_counter = size; - 800d3de: 6082 str r2, [r0, #8] - oqp->q_buffer = bp; - 800d3e0: 60c1 str r1, [r0, #12] - oqp->q_rdptr = bp; - 800d3e2: 6181 str r1, [r0, #24] - oqp->q_wrptr = bp; - 800d3e4: 6141 str r1, [r0, #20] - oqp->q_top = bp + size; - oqp->q_notify = onfy; - 800d3e6: 61c3 str r3, [r0, #28] - oqp->q_link = link; -} - 800d3e8: bc30 pop {r4, r5} - 800d3ea: 4770 bx lr - 800d3ec: f3af 8000 nop.w - -0800d3f0 : - * - * @param[in] oqp pointer to an @p output_queue_t structure - * - * @iclass - */ -void chOQResetI(output_queue_t *oqp) { - 800d3f0: b410 push {r4} - - chDbgCheckClassI(); - - oqp->q_rdptr = oqp->q_buffer; - oqp->q_wrptr = oqp->q_buffer; - oqp->q_counter = chQSizeX(oqp); - 800d3f2: 6902 ldr r2, [r0, #16] - */ -void chOQResetI(output_queue_t *oqp) { - - chDbgCheckClassI(); - - oqp->q_rdptr = oqp->q_buffer; - 800d3f4: 68c4 ldr r4, [r0, #12] - 800d3f6: 6184 str r4, [r0, #24] - oqp->q_wrptr = oqp->q_buffer; - oqp->q_counter = chQSizeX(oqp); - 800d3f8: 1b12 subs r2, r2, r4 -void chOQResetI(output_queue_t *oqp) { - - chDbgCheckClassI(); - - oqp->q_rdptr = oqp->q_buffer; - oqp->q_wrptr = oqp->q_buffer; - 800d3fa: 6144 str r4, [r0, #20] - oqp->q_counter = chQSizeX(oqp); - chThdDequeueAllI(&oqp->q_waiting, Q_RESET); - 800d3fc: f06f 0101 mvn.w r1, #1 - - chDbgCheckClassI(); - - oqp->q_rdptr = oqp->q_buffer; - oqp->q_wrptr = oqp->q_buffer; - oqp->q_counter = chQSizeX(oqp); - 800d400: 6082 str r2, [r0, #8] - chThdDequeueAllI(&oqp->q_waiting, Q_RESET); -} - 800d402: f85d 4b04 ldr.w r4, [sp], #4 - chDbgCheckClassI(); - - oqp->q_rdptr = oqp->q_buffer; - oqp->q_wrptr = oqp->q_buffer; - oqp->q_counter = chQSizeX(oqp); - chThdDequeueAllI(&oqp->q_waiting, Q_RESET); - 800d406: f7ff bebb b.w 800d180 - 800d40a: bf00 nop - 800d40c: f3af 8000 nop.w - -0800d410 : - * @retval Q_TIMEOUT if the specified time expired. - * @retval Q_RESET if the queue has been reset. - * - * @api - */ -msg_t chOQPutTimeout(output_queue_t *oqp, uint8_t b, systime_t timeout) { - 800d410: b5f8 push {r3, r4, r5, r6, r7, lr} - 800d412: 4604 mov r4, r0 - 800d414: 460f mov r7, r1 - 800d416: 4616 mov r6, r2 - 800d418: 2320 movs r3, #32 - 800d41a: f383 8811 msr BASEPRI, r3 - 800d41e: e003 b.n 800d428 - - chSysLock(); - while (chOQIsFullI(oqp)) { - msg_t msg = chThdEnqueueTimeoutS(&oqp->q_waiting, timeout); - 800d420: f7ff fe96 bl 800d150 - if (msg < Q_OK) { - 800d424: 2800 cmp r0, #0 - 800d426: db19 blt.n 800d45c - */ -static inline bool chOQIsFullI(output_queue_t *oqp) { - - chDbgCheckClassI(); - - return (bool)(chQSpaceI(oqp) == 0U); - 800d428: 68a5 ldr r5, [r4, #8] - */ -msg_t chOQPutTimeout(output_queue_t *oqp, uint8_t b, systime_t timeout) { - - chSysLock(); - while (chOQIsFullI(oqp)) { - msg_t msg = chThdEnqueueTimeoutS(&oqp->q_waiting, timeout); - 800d42a: 4620 mov r0, r4 - 800d42c: 4631 mov r1, r6 - * @api - */ -msg_t chOQPutTimeout(output_queue_t *oqp, uint8_t b, systime_t timeout) { - - chSysLock(); - while (chOQIsFullI(oqp)) { - 800d42e: 2d00 cmp r5, #0 - 800d430: d0f6 beq.n 800d420 - return msg; - } - } - - oqp->q_counter--; - *oqp->q_wrptr++ = b; - 800d432: 6962 ldr r2, [r4, #20] - chSysUnlock(); - return msg; - } - } - - oqp->q_counter--; - 800d434: 68a3 ldr r3, [r4, #8] - *oqp->q_wrptr++ = b; - 800d436: 1c51 adds r1, r2, #1 - chSysUnlock(); - return msg; - } - } - - oqp->q_counter--; - 800d438: 3b01 subs r3, #1 - *oqp->q_wrptr++ = b; - 800d43a: 6161 str r1, [r4, #20] - chSysUnlock(); - return msg; - } - } - - oqp->q_counter--; - 800d43c: 60a3 str r3, [r4, #8] - *oqp->q_wrptr++ = b; - 800d43e: 7017 strb r7, [r2, #0] - if (oqp->q_wrptr >= oqp->q_top) { - 800d440: 6923 ldr r3, [r4, #16] - 800d442: 6962 ldr r2, [r4, #20] - 800d444: 429a cmp r2, r3 - oqp->q_wrptr = oqp->q_buffer; - 800d446: bf24 itt cs - 800d448: 68e3 ldrcs r3, [r4, #12] - 800d44a: 6163 strcs r3, [r4, #20] - } - - if (oqp->q_notify != NULL) { - 800d44c: 69e3 ldr r3, [r4, #28] - 800d44e: b10b cbz r3, 800d454 - oqp->q_notify(oqp); - 800d450: 4620 mov r0, r4 - 800d452: 4798 blx r3 - 800d454: 2000 movs r0, #0 - 800d456: f380 8811 msr BASEPRI, r0 - } - chSysUnlock(); - - return Q_OK; -} - 800d45a: bdf8 pop {r3, r4, r5, r6, r7, pc} - 800d45c: f385 8811 msr BASEPRI, r5 - chSysLock(); - while (chOQIsFullI(oqp)) { - msg_t msg = chThdEnqueueTimeoutS(&oqp->q_waiting, timeout); - if (msg < Q_OK) { - chSysUnlock(); - return msg; - 800d460: bdf8 pop {r3, r4, r5, r6, r7, pc} - 800d462: bf00 nop - 800d464: f3af 8000 nop.w - 800d468: f3af 8000 nop.w - 800d46c: f3af 8000 nop.w - -0800d470 : - * @return The number of bytes effectively transferred. - * - * @api - */ -size_t chOQWriteTimeout(output_queue_t *oqp, const uint8_t *bp, - size_t n, systime_t timeout) { - 800d470: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - 800d474: b083 sub sp, #12 - 800d476: 4604 mov r4, r0 - 800d478: 468b mov fp, r1 - 800d47a: 4615 mov r5, r2 - 800d47c: 9301 str r3, [sp, #4] - qnotify_t nfy = oqp->q_notify; - 800d47e: 69c7 ldr r7, [r0, #28] - 800d480: f04f 0820 mov.w r8, #32 - 800d484: f388 8811 msr BASEPRI, r8 - size_t w = 0; - 800d488: 2600 movs r6, #0 - 800d48a: 46b1 mov r9, r6 - 800d48c: 68a3 ldr r3, [r4, #8] - return w; - } - } - - oqp->q_counter--; - *oqp->q_wrptr++ = *bp++; - 800d48e: f10b 0a01 add.w sl, fp, #1 - if (oqp->q_wrptr >= oqp->q_top) { - oqp->q_wrptr = oqp->q_buffer; - } - - if (nfy != NULL) { - nfy(oqp); - 800d492: 4620 mov r0, r4 - - chDbgCheck(n > 0U); - - chSysLock(); - while (true) { - while (chOQIsFullI(oqp)) { - 800d494: b1fb cbz r3, 800d4d6 - return w; - } - } - - oqp->q_counter--; - *oqp->q_wrptr++ = *bp++; - 800d496: 6962 ldr r2, [r4, #20] - chSysUnlock(); - return w; - } - } - - oqp->q_counter--; - 800d498: 68a3 ldr r3, [r4, #8] - *oqp->q_wrptr++ = *bp++; - 800d49a: 1c51 adds r1, r2, #1 - chSysUnlock(); - return w; - } - } - - oqp->q_counter--; - 800d49c: 3b01 subs r3, #1 - *oqp->q_wrptr++ = *bp++; - 800d49e: 6161 str r1, [r4, #20] - chSysUnlock(); - return w; - } - } - - oqp->q_counter--; - 800d4a0: 60a3 str r3, [r4, #8] - *oqp->q_wrptr++ = *bp++; - 800d4a2: f89b 3000 ldrb.w r3, [fp] - 800d4a6: 7013 strb r3, [r2, #0] - if (oqp->q_wrptr >= oqp->q_top) { - 800d4a8: 6923 ldr r3, [r4, #16] - 800d4aa: 6962 ldr r2, [r4, #20] - 800d4ac: 429a cmp r2, r3 - oqp->q_wrptr = oqp->q_buffer; - 800d4ae: bf24 itt cs - 800d4b0: 68e3 ldrcs r3, [r4, #12] - 800d4b2: 6163 strcs r3, [r4, #20] - } - - if (nfy != NULL) { - 800d4b4: b107 cbz r7, 800d4b8 - nfy(oqp); - 800d4b6: 47b8 blx r7 - 800d4b8: f389 8811 msr BASEPRI, r9 - } - chSysUnlock(); /* Gives a preemption chance in a controlled point.*/ - - w++; - if (--n == 0U) { - 800d4bc: 3d01 subs r5, #1 - if (nfy != NULL) { - nfy(oqp); - } - chSysUnlock(); /* Gives a preemption chance in a controlled point.*/ - - w++; - 800d4be: f106 0601 add.w r6, r6, #1 - if (--n == 0U) { - 800d4c2: d012 beq.n 800d4ea - 800d4c4: f388 8811 msr BASEPRI, r8 - 800d4c8: 68a3 ldr r3, [r4, #8] - return w; - } - } - - oqp->q_counter--; - *oqp->q_wrptr++ = *bp++; - 800d4ca: 46d3 mov fp, sl - 800d4cc: f10b 0a01 add.w sl, fp, #1 - if (oqp->q_wrptr >= oqp->q_top) { - oqp->q_wrptr = oqp->q_buffer; - } - - if (nfy != NULL) { - nfy(oqp); - 800d4d0: 4620 mov r0, r4 - - chDbgCheck(n > 0U); - - chSysLock(); - while (true) { - while (chOQIsFullI(oqp)) { - 800d4d2: 2b00 cmp r3, #0 - 800d4d4: d1df bne.n 800d496 - if (chThdEnqueueTimeoutS(&oqp->q_waiting, timeout) != Q_OK) { - 800d4d6: 4620 mov r0, r4 - 800d4d8: 9901 ldr r1, [sp, #4] - 800d4da: 9300 str r3, [sp, #0] - 800d4dc: f7ff fe38 bl 800d150 - 800d4e0: 9b00 ldr r3, [sp, #0] - 800d4e2: 2800 cmp r0, #0 - 800d4e4: d0d2 beq.n 800d48c - 800d4e6: f383 8811 msr BASEPRI, r3 - if (--n == 0U) { - return w; - } - chSysLock(); - } -} - 800d4ea: 4630 mov r0, r6 - 800d4ec: b003 add sp, #12 - 800d4ee: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 800d4f2: bf00 nop - 800d4f4: f3af 8000 nop.w - 800d4f8: f3af 8000 nop.w - 800d4fc: f3af 8000 nop.w - -0800d500 <_core_init>: -#if CH_CFG_MEMCORE_SIZE == 0 - extern uint8_t __heap_base__[]; - extern uint8_t __heap_end__[]; - - /*lint -save -e9033 [10.8] Required cast operations.*/ - nextmem = (uint8_t *)MEM_ALIGN_NEXT(__heap_base__); - 800d500: 4a05 ldr r2, [pc, #20] ; (800d518 <_core_init+0x18>) - endmem = (uint8_t *)MEM_ALIGN_PREV(__heap_end__); - 800d502: 4b06 ldr r3, [pc, #24] ; (800d51c <_core_init+0x1c>) -#if CH_CFG_MEMCORE_SIZE == 0 - extern uint8_t __heap_base__[]; - extern uint8_t __heap_end__[]; - - /*lint -save -e9033 [10.8] Required cast operations.*/ - nextmem = (uint8_t *)MEM_ALIGN_NEXT(__heap_base__); - 800d504: 4806 ldr r0, [pc, #24] ; (800d520 <_core_init+0x20>) - endmem = (uint8_t *)MEM_ALIGN_PREV(__heap_end__); - 800d506: 4907 ldr r1, [pc, #28] ; (800d524 <_core_init+0x24>) -#if CH_CFG_MEMCORE_SIZE == 0 - extern uint8_t __heap_base__[]; - extern uint8_t __heap_end__[]; - - /*lint -save -e9033 [10.8] Required cast operations.*/ - nextmem = (uint8_t *)MEM_ALIGN_NEXT(__heap_base__); - 800d508: f022 0207 bic.w r2, r2, #7 - endmem = (uint8_t *)MEM_ALIGN_PREV(__heap_end__); - 800d50c: f023 0307 bic.w r3, r3, #7 -#if CH_CFG_MEMCORE_SIZE == 0 - extern uint8_t __heap_base__[]; - extern uint8_t __heap_end__[]; - - /*lint -save -e9033 [10.8] Required cast operations.*/ - nextmem = (uint8_t *)MEM_ALIGN_NEXT(__heap_base__); - 800d510: 6002 str r2, [r0, #0] - endmem = (uint8_t *)MEM_ALIGN_PREV(__heap_end__); - 800d512: 600b str r3, [r1, #0] - 800d514: 4770 bx lr - 800d516: bf00 nop - 800d518: 20002e2f .word 0x20002e2f - 800d51c: 20020000 .word 0x20020000 - 800d520: 20000e9c .word 0x20000e9c - 800d524: 20000e98 .word 0x20000e98 - 800d528: f3af 8000 nop.w - 800d52c: f3af 8000 nop.w - -0800d530 : - * @return A pointer to the allocated memory block. - * @retval NULL allocation failed, core memory exhausted. - * - * @api - */ -void *chCoreAlloc(size_t size) { - 800d530: b410 push {r4} - 800d532: 2320 movs r3, #32 - 800d534: f383 8811 msr BASEPRI, r3 - - chDbgCheckClassI(); - - size = MEM_ALIGN_NEXT(size); - /*lint -save -e9033 [10.8] The cast is safe.*/ - if ((size_t)(endmem - nextmem) < size) { - 800d538: 4c09 ldr r4, [pc, #36] ; (800d560 ) - 800d53a: 4b0a ldr r3, [pc, #40] ; (800d564 ) - 800d53c: 6822 ldr r2, [r4, #0] - 800d53e: 6819 ldr r1, [r3, #0] -void *chCoreAllocI(size_t size) { - void *p; - - chDbgCheckClassI(); - - size = MEM_ALIGN_NEXT(size); - 800d540: 1dc3 adds r3, r0, #7 - 800d542: f023 0307 bic.w r3, r3, #7 - /*lint -save -e9033 [10.8] The cast is safe.*/ - if ((size_t)(endmem - nextmem) < size) { - 800d546: 1a89 subs r1, r1, r2 - 800d548: 428b cmp r3, r1 - /*lint -restore*/ - return NULL; - } - p = nextmem; - nextmem += size; - 800d54a: bf9d ittte ls - 800d54c: 189b addls r3, r3, r2 - 800d54e: 6023 strls r3, [r4, #0] - - return p; - 800d550: 4610 movls r0, r2 - - size = MEM_ALIGN_NEXT(size); - /*lint -save -e9033 [10.8] The cast is safe.*/ - if ((size_t)(endmem - nextmem) < size) { - /*lint -restore*/ - return NULL; - 800d552: 2000 movhi r0, #0 - 800d554: 2300 movs r3, #0 - 800d556: f383 8811 msr BASEPRI, r3 - chSysLock(); - p = chCoreAllocI(size); - chSysUnlock(); - - return p; -} - 800d55a: f85d 4b04 ldr.w r4, [sp], #4 - 800d55e: 4770 bx lr - 800d560: 20000e9c .word 0x20000e9c - 800d564: 20000e98 .word 0x20000e98 - 800d568: f3af 8000 nop.w - 800d56c: f3af 8000 nop.w - -0800d570 <_heap_init>: - * - * @notapi - */ -void _heap_init(void) { - - default_heap.h_provider = chCoreAlloc; - 800d570: 4b04 ldr r3, [pc, #16] ; (800d584 <_heap_init+0x14>) - 800d572: 4a05 ldr r2, [pc, #20] ; (800d588 <_heap_init+0x18>) - 800d574: 601a str r2, [r3, #0] - default_heap.h_free.h.u.next = NULL; - default_heap.h_free.h.size = 0; -#if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__) - chMtxObjectInit(&default_heap.h_mtx); - 800d576: f103 0010 add.w r0, r3, #16 - * @notapi - */ -void _heap_init(void) { - - default_heap.h_provider = chCoreAlloc; - default_heap.h_free.h.u.next = NULL; - 800d57a: 2200 movs r2, #0 - 800d57c: 609a str r2, [r3, #8] - default_heap.h_free.h.size = 0; - 800d57e: 60da str r2, [r3, #12] -#if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__) - chMtxObjectInit(&default_heap.h_mtx); - 800d580: f7ff be66 b.w 800d250 - 800d584: 20000ea0 .word 0x20000ea0 - 800d588: 0800d531 .word 0x0800d531 - 800d58c: f3af 8000 nop.w - -0800d590 : -/*lint -restore*/ - struct port_extctx *ctxp; - -#if CORTEX_USE_FPU - /* Enforcing unstacking of the FP part of the context.*/ - FPU->FPCCR &= ~FPU_FPCCR_LSPACT_Msk; - 800d590: 4a06 ldr r2, [pc, #24] ; (800d5ac ) - 800d592: 6853 ldr r3, [r2, #4] - 800d594: f023 0301 bic.w r3, r3, #1 - 800d598: 6053 str r3, [r2, #4] - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); - 800d59a: f3ef 8309 mrs r3, PSP - /* The port_extctx structure is pointed by the PSP register.*/ - ctxp = (struct port_extctx *)__get_PSP(); - - /* Discarding the current exception context and positioning the stack to - point to the real one.*/ - ctxp++; - 800d59e: 3368 adds r3, #104 ; 0x68 - - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp"); - 800d5a0: f383 8809 msr PSP, r3 - - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); - 800d5a4: 2300 movs r3, #0 - 800d5a6: f383 8811 msr BASEPRI, r3 - 800d5aa: 4770 bx lr - 800d5ac: e000ef30 .word 0xe000ef30 - -0800d5b0 <_port_irq_epilogue>: - 800d5b0: 2320 movs r3, #32 - 800d5b2: f383 8811 msr BASEPRI, r3 - * @brief Exception exit redirection to _port_switch_from_isr(). - */ -void _port_irq_epilogue(void) { - - port_lock_from_isr(); - if ((SCB->ICSR & SCB_ICSR_RETTOBASE_Msk) != 0U) { - 800d5b6: 4b12 ldr r3, [pc, #72] ; (800d600 <_port_irq_epilogue+0x50>) - 800d5b8: 685b ldr r3, [r3, #4] - 800d5ba: f413 6300 ands.w r3, r3, #2048 ; 0x800 - 800d5be: d102 bne.n 800d5c6 <_port_irq_epilogue+0x16> - 800d5c0: f383 8811 msr BASEPRI, r3 - 800d5c4: 4770 bx lr -/*===========================================================================*/ - -/** - * @brief Exception exit redirection to _port_switch_from_isr(). - */ -void _port_irq_epilogue(void) { - 800d5c6: b510 push {r4, lr} -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - uint32_t result; - - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - 800d5c8: eef1 3a10 vmrs r3, fpscr - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); - 800d5cc: f3ef 8409 mrs r4, PSP - ctxp--; - - /* Setting up a fake XPSR register value.*/ - ctxp->xpsr = (regarm_t)0x01000000; -#if CORTEX_USE_FPU == TRUE - ctxp->fpscr = (regarm_t)FPU->FPDSCR; - 800d5d0: 4b0c ldr r3, [pc, #48] ; (800d604 <_port_irq_epilogue+0x54>) - /* Adding an artificial exception return context, there is no need to - populate it fully.*/ - ctxp--; - - /* Setting up a fake XPSR register value.*/ - ctxp->xpsr = (regarm_t)0x01000000; - 800d5d2: f04f 7280 mov.w r2, #16777216 ; 0x1000000 -#if CORTEX_USE_FPU == TRUE - ctxp->fpscr = (regarm_t)FPU->FPDSCR; - 800d5d6: 68db ldr r3, [r3, #12] - 800d5d8: f844 3c08 str.w r3, [r4, #-8] - /* Adding an artificial exception return context, there is no need to - populate it fully.*/ - ctxp--; - - /* Setting up a fake XPSR register value.*/ - ctxp->xpsr = (regarm_t)0x01000000; - 800d5dc: f844 2c4c str.w r2, [r4, #-76] - /* The port_extctx structure is pointed by the PSP register.*/ - ctxp = (struct port_extctx *)__get_PSP(); - - /* Adding an artificial exception return context, there is no need to - populate it fully.*/ - ctxp--; - 800d5e0: f1a4 0368 sub.w r3, r4, #104 ; 0x68 - - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp"); - 800d5e4: f383 8809 msr PSP, r3 - /* Writing back the modified PSP value.*/ - __set_PSP((uint32_t)ctxp); - - /* The exit sequence is different depending on if a preemption is - required or not.*/ - if (chSchIsPreemptionRequired()) { - 800d5e8: f7ff fc42 bl 800ce70 - 800d5ec: b118 cbz r0, 800d5f6 <_port_irq_epilogue+0x46> - /* Preemption is required we need to enforce a context switch.*/ - ctxp->pc = (regarm_t)_port_switch_from_isr; - 800d5ee: 4b06 ldr r3, [pc, #24] ; (800d608 <_port_irq_epilogue+0x58>) - 800d5f0: f844 3c50 str.w r3, [r4, #-80] - 800d5f4: bd10 pop {r4, pc} - } - else { - /* Preemption not required, we just need to exit the exception - atomically.*/ - ctxp->pc = (regarm_t)_port_exit_from_isr; - 800d5f6: 4b05 ldr r3, [pc, #20] ; (800d60c <_port_irq_epilogue+0x5c>) - 800d5f8: f844 3c50 str.w r3, [r4, #-80] - 800d5fc: bd10 pop {r4, pc} - 800d5fe: bf00 nop - 800d600: e000ed00 .word 0xe000ed00 - 800d604: e000ef30 .word 0xe000ef30 - 800d608: 0800c139 .word 0x0800c139 - 800d60c: 0800c13c .word 0x0800c13c - -0800d610 : - * board-specific initialization is performed by invoking - * @p boardInit() (usually defined in @p board.c). - * - * @init - */ -void halInit(void) { - 800d610: b508 push {r3, lr} - - /* Initializes the OS Abstraction Layer.*/ - osalInit(); - - /* Platform low level initializations.*/ - hal_lld_init(); - 800d612: f000 ff65 bl 800e4e0 - -#if (HAL_USE_PAL == TRUE) || defined(__DOXYGEN__) - palInit(&pal_default_config); - 800d616: 480a ldr r0, [pc, #40] ; (800d640 ) - 800d618: f001 f97a bl 800e910 <_pal_lld_init> -#endif -#if (HAL_USE_ADC == TRUE) || defined(__DOXYGEN__) - adcInit(); -#endif -#if (HAL_USE_CAN == TRUE) || defined(__DOXYGEN__) - canInit(); - 800d61c: f000 f818 bl 800d650 -#endif -#if (HAL_USE_GPT == TRUE) || defined(__DOXYGEN__) - gptInit(); -#endif -#if (HAL_USE_I2C == TRUE) || defined(__DOXYGEN__) - i2cInit(); - 800d620: f000 f846 bl 800d6b0 -#endif -#if (HAL_USE_I2S == TRUE) || defined(__DOXYGEN__) - i2sInit(); -#endif -#if (HAL_USE_ICU == TRUE) || defined(__DOXYGEN__) - icuInit(); - 800d624: f000 f854 bl 800d6d0 -#endif -#if (HAL_USE_SPI == TRUE) || defined(__DOXYGEN__) - spiInit(); -#endif -#if (HAL_USE_UART == TRUE) || defined(__DOXYGEN__) - uartInit(); - 800d628: f000 fa22 bl 800da70 -#endif -#if (HAL_USE_USB == TRUE) || defined(__DOXYGEN__) - usbInit(); - 800d62c: f000 fa30 bl 800da90 -#endif -#if (HAL_USE_MMC_SPI == TRUE) || defined(__DOXYGEN__) - mmcInit(); -#endif -#if (HAL_USE_SERIAL_USB == TRUE) || defined(__DOXYGEN__) - sduInit(); - 800d630: f000 f906 bl 800d840 - halCommunityInit(); -#endif -#endif - - /* Board specific initialization.*/ - boardInit(); - 800d634: f002 fa7c bl 800fb30 - * configured to require it. - */ -#if OSAL_ST_MODE != OSAL_ST_MODE_NONE - stInit(); -#endif -} - 800d638: e8bd 4008 ldmia.w sp!, {r3, lr} -/* - * The ST driver is a special case, it is only initialized if the OSAL is - * configured to require it. - */ -#if OSAL_ST_MODE != OSAL_ST_MODE_NONE - stInit(); - 800d63c: f000 ba10 b.w 800da60 - 800d640: 08013310 .word 0x08013310 - 800d644: f3af 8000 nop.w - 800d648: f3af 8000 nop.w - 800d64c: f3af 8000 nop.w - -0800d650 : - * - * @init - */ -void canInit(void) { - - can_lld_init(); - 800d650: f001 b946 b.w 800e8e0 - 800d654: f3af 8000 nop.w - 800d658: f3af 8000 nop.w - 800d65c: f3af 8000 nop.w - -0800d660 : - * - * @param[out] canp pointer to the @p CANDriver object - * - * @init - */ -void canObjectInit(CANDriver *canp) { - 800d660: b5f0 push {r4, r5, r6, r7, lr} - - canp->state = CAN_STOP; - canp->config = NULL; - osalThreadQueueObjectInit(&canp->txqueue); - 800d662: f100 0208 add.w r2, r0, #8 - osalThreadQueueObjectInit(&canp->rxqueue); - 800d666: f100 0310 add.w r3, r0, #16 - * - * @init - */ -void canObjectInit(CANDriver *canp) { - - canp->state = CAN_STOP; - 800d66a: f04f 0c01 mov.w ip, #1 - canp->config = NULL; - 800d66e: f04f 0e00 mov.w lr, #0 - osalThreadQueueObjectInit(&canp->txqueue); - osalThreadQueueObjectInit(&canp->rxqueue); - osalEventObjectInit(&canp->rxfull_event); - 800d672: f100 0718 add.w r7, r0, #24 - osalEventObjectInit(&canp->txempty_event); - 800d676: f100 061c add.w r6, r0, #28 - osalEventObjectInit(&canp->error_event); - 800d67a: f100 0520 add.w r5, r0, #32 -#if CAN_USE_SLEEP_MODE == TRUE - osalEventObjectInit(&canp->sleep_event); - 800d67e: f100 0424 add.w r4, r0, #36 ; 0x24 - osalEventObjectInit(&canp->wakeup_event); - 800d682: f100 0128 add.w r1, r0, #40 ; 0x28 - * - * @init - */ -void canObjectInit(CANDriver *canp) { - - canp->state = CAN_STOP; - 800d686: f880 c000 strb.w ip, [r0] - canp->config = NULL; - 800d68a: f8c0 e004 str.w lr, [r0, #4] - * - * @init - */ -static inline void chEvtObjectInit(event_source_t *esp) { - - esp->es_next = (event_listener_t *)esp; - 800d68e: 6187 str r7, [r0, #24] - 800d690: 61c6 str r6, [r0, #28] - 800d692: 6205 str r5, [r0, #32] - 800d694: 6244 str r4, [r0, #36] ; 0x24 - 800d696: 6281 str r1, [r0, #40] ; 0x28 - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800d698: 6082 str r2, [r0, #8] - tqp->p_prev = (thread_t *)tqp; - 800d69a: 60c2 str r2, [r0, #12] - * - * @notapi - */ -static inline void queue_init(threads_queue_t *tqp) { - - tqp->p_next = (thread_t *)tqp; - 800d69c: 6103 str r3, [r0, #16] - tqp->p_prev = (thread_t *)tqp; - 800d69e: 6143 str r3, [r0, #20] - 800d6a0: bdf0 pop {r4, r5, r6, r7, pc} - 800d6a2: bf00 nop - 800d6a4: f3af 8000 nop.w - 800d6a8: f3af 8000 nop.w - 800d6ac: f3af 8000 nop.w - -0800d6b0 : - * - * @init - */ -void i2cInit(void) { - - i2c_lld_init(); - 800d6b0: f001 bb5e b.w 800ed70 - 800d6b4: f3af 8000 nop.w - 800d6b8: f3af 8000 nop.w - 800d6bc: f3af 8000 nop.w - -0800d6c0 : - * - * @init - */ -void i2cObjectInit(I2CDriver *i2cp) { - - i2cp->state = I2C_STOP; - 800d6c0: 2201 movs r2, #1 - i2cp->config = NULL; - 800d6c2: 2300 movs r3, #0 - * - * @init - */ -void i2cObjectInit(I2CDriver *i2cp) { - - i2cp->state = I2C_STOP; - 800d6c4: 7002 strb r2, [r0, #0] - i2cp->config = NULL; - 800d6c6: 6043 str r3, [r0, #4] - * @init - */ -static inline void osalMutexObjectInit(mutex_t *mp) { - -#if CH_CFG_USE_MUTEXES - chMtxObjectInit(mp); - 800d6c8: 300c adds r0, #12 - 800d6ca: f7ff bdc1 b.w 800d250 - 800d6ce: bf00 nop - -0800d6d0 : - * - * @init - */ -void icuInit(void) { - - icu_lld_init(); - 800d6d0: f002 b96e b.w 800f9b0 - 800d6d4: f3af 8000 nop.w - 800d6d8: f3af 8000 nop.w - 800d6dc: f3af 8000 nop.w - -0800d6e0 : - * - * @init - */ -void icuObjectInit(ICUDriver *icup) { - - icup->state = ICU_STOP; - 800d6e0: 2201 movs r2, #1 - icup->config = NULL; - 800d6e2: 2300 movs r3, #0 - * - * @init - */ -void icuObjectInit(ICUDriver *icup) { - - icup->state = ICU_STOP; - 800d6e4: 7002 strb r2, [r0, #0] - icup->config = NULL; - 800d6e6: 6043 str r3, [r0, #4] - 800d6e8: 4770 bx lr - 800d6ea: bf00 nop - 800d6ec: f3af 8000 nop.w - -0800d6f0 : -/** - * @brief Notification of data inserted into the output queue. - * - * @param[in] qp the queue pointer. - */ -static void onotify(io_queue_t *qp) { - 800d6f0: b510 push {r4, lr} - size_t n; - SerialUSBDriver *sdup = qGetLink(qp); - 800d6f2: 6a04 ldr r4, [r0, #32] - - /* If the USB driver is not in the appropriate state then transactions - must not be started.*/ - if ((usbGetDriverStateI(sdup->config->usbp) != USB_ACTIVE) || - 800d6f4: f8d4 2254 ldr.w r2, [r4, #596] ; 0x254 - 800d6f8: 6813 ldr r3, [r2, #0] - 800d6fa: 7819 ldrb r1, [r3, #0] - 800d6fc: 2904 cmp r1, #4 - 800d6fe: d000 beq.n 800d702 - 800d700: bd10 pop {r4, pc} - 800d702: 7a21 ldrb r1, [r4, #8] - 800d704: 2902 cmp r1, #2 - 800d706: d1fb bne.n 800d700 - return; - } - - /* If there is not an ongoing transaction and the output queue contains - data then a new transaction is started.*/ - if (!usbGetTransmitStatusI(sdup->config->usbp, sdup->config->bulk_in)) { - 800d708: 7911 ldrb r1, [r2, #4] - 800d70a: 891a ldrh r2, [r3, #8] - 800d70c: 2301 movs r3, #1 - 800d70e: 408b lsls r3, r1 - 800d710: 401a ands r2, r3 - 800d712: d1f5 bne.n 800d700 - */ -static inline size_t chOQGetFullI(output_queue_t *oqp) { - - chDbgCheckClassI(); - - return (size_t)(chQSizeX(oqp) - chQSpaceI(oqp)); - 800d714: 6c21 ldr r1, [r4, #64] ; 0x40 - 800d716: 6be3 ldr r3, [r4, #60] ; 0x3c - 800d718: 6ba0 ldr r0, [r4, #56] ; 0x38 - 800d71a: 1acb subs r3, r1, r3 - if ((n = oqGetFullI(&sdup->oqueue)) > 0U) { - 800d71c: 1a1b subs r3, r3, r0 - 800d71e: d0ef beq.n 800d700 - - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); - 800d720: f382 8811 msr BASEPRI, r2 - osalSysUnlock(); - - usbPrepareQueuedTransmit(sdup->config->usbp, - 800d724: f8d4 2254 ldr.w r2, [r4, #596] ; 0x254 - 800d728: 6810 ldr r0, [r2, #0] - 800d72a: 7911 ldrb r1, [r2, #4] - 800d72c: f104 0230 add.w r2, r4, #48 ; 0x30 - 800d730: f000 fa0e bl 800db50 - 800d734: 2320 movs r3, #32 - 800d736: f383 8811 msr BASEPRI, r3 - sdup->config->bulk_in, - &sdup->oqueue, n); - - osalSysLock(); - (void) usbStartTransmitI(sdup->config->usbp, sdup->config->bulk_in); - 800d73a: f8d4 3254 ldr.w r3, [r4, #596] ; 0x254 - } - } -} - 800d73e: e8bd 4010 ldmia.w sp!, {r4, lr} - usbPrepareQueuedTransmit(sdup->config->usbp, - sdup->config->bulk_in, - &sdup->oqueue, n); - - osalSysLock(); - (void) usbStartTransmitI(sdup->config->usbp, sdup->config->bulk_in); - 800d742: 6818 ldr r0, [r3, #0] - 800d744: 7919 ldrb r1, [r3, #4] - 800d746: f000 ba2b b.w 800dba0 - 800d74a: bf00 nop - 800d74c: f3af 8000 nop.w - -0800d750 : -/** - * @brief Notification of data removed from the input queue. - * - * @param[in] qp the queue pointer. - */ -static void inotify(io_queue_t *qp) { - 800d750: b538 push {r3, r4, r5, lr} - size_t n, maxsize; - SerialUSBDriver *sdup = qGetLink(qp); - 800d752: 6a04 ldr r4, [r0, #32] - - /* If the USB driver is not in the appropriate state then transactions - must not be started.*/ - if ((usbGetDriverStateI(sdup->config->usbp) != USB_ACTIVE) || - 800d754: f8d4 2254 ldr.w r2, [r4, #596] ; 0x254 - 800d758: 6813 ldr r3, [r2, #0] - 800d75a: 7819 ldrb r1, [r3, #0] - 800d75c: 2904 cmp r1, #4 - 800d75e: d000 beq.n 800d762 - 800d760: bd38 pop {r3, r4, r5, pc} - 800d762: 7a21 ldrb r1, [r4, #8] - 800d764: 2902 cmp r1, #2 - 800d766: d1fb bne.n 800d760 - } - - /* If there is in the queue enough space to hold at least one packet and - a transaction is not yet started then a new transaction is started for - the available space.*/ - maxsize = sdup->config->usbp->epc[sdup->config->bulk_out]->out_maxsize; - 800d768: 7950 ldrb r0, [r2, #5] - if (!usbGetReceiveStatusI(sdup->config->usbp, sdup->config->bulk_out)) { - 800d76a: 8959 ldrh r1, [r3, #10] - } - - /* If there is in the queue enough space to hold at least one packet and - a transaction is not yet started then a new transaction is started for - the available space.*/ - maxsize = sdup->config->usbp->epc[sdup->config->bulk_out]->out_maxsize; - 800d76c: eb03 0380 add.w r3, r3, r0, lsl #2 - if (!usbGetReceiveStatusI(sdup->config->usbp, sdup->config->bulk_out)) { - 800d770: 2201 movs r2, #1 - } - - /* If there is in the queue enough space to hold at least one packet and - a transaction is not yet started then a new transaction is started for - the available space.*/ - maxsize = sdup->config->usbp->epc[sdup->config->bulk_out]->out_maxsize; - 800d772: 68db ldr r3, [r3, #12] - if (!usbGetReceiveStatusI(sdup->config->usbp, sdup->config->bulk_out)) { - 800d774: 4082 lsls r2, r0 - 800d776: 400a ands r2, r1 - } - - /* If there is in the queue enough space to hold at least one packet and - a transaction is not yet started then a new transaction is started for - the available space.*/ - maxsize = sdup->config->usbp->epc[sdup->config->bulk_out]->out_maxsize; - 800d778: 8a5b ldrh r3, [r3, #18] - if (!usbGetReceiveStatusI(sdup->config->usbp, sdup->config->bulk_out)) { - 800d77a: d1f1 bne.n 800d760 - */ -static inline size_t chIQGetEmptyI(input_queue_t *iqp) { - - chDbgCheckClassI(); - - return (size_t)(chQSizeX(iqp) - chQSpaceI(iqp)); - 800d77c: 69a1 ldr r1, [r4, #24] - 800d77e: 69e0 ldr r0, [r4, #28] - 800d780: 6965 ldr r5, [r4, #20] - 800d782: 1a40 subs r0, r0, r1 - 800d784: 1b41 subs r1, r0, r5 - if ((n = iqGetEmptyI(&sdup->iqueue)) >= maxsize) { - 800d786: 428b cmp r3, r1 - 800d788: d8ea bhi.n 800d760 - 800d78a: f382 8811 msr BASEPRI, r2 - osalSysUnlock(); - - n = (n / maxsize) * maxsize; - 800d78e: fbb1 f1f3 udiv r1, r1, r3 - usbPrepareQueuedReceive(sdup->config->usbp, - 800d792: f8d4 2254 ldr.w r2, [r4, #596] ; 0x254 - 800d796: fb03 f301 mul.w r3, r3, r1 - 800d79a: 6810 ldr r0, [r2, #0] - 800d79c: 7951 ldrb r1, [r2, #5] - 800d79e: f104 020c add.w r2, r4, #12 - 800d7a2: f000 f9c5 bl 800db30 - 800d7a6: 2320 movs r3, #32 - 800d7a8: f383 8811 msr BASEPRI, r3 - sdup->config->bulk_out, - &sdup->iqueue, n); - - osalSysLock(); - (void) usbStartReceiveI(sdup->config->usbp, sdup->config->bulk_out); - 800d7ac: f8d4 3254 ldr.w r3, [r4, #596] ; 0x254 - 800d7b0: 6818 ldr r0, [r3, #0] - 800d7b2: 7959 ldrb r1, [r3, #5] - } - } -} - 800d7b4: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} - usbPrepareQueuedReceive(sdup->config->usbp, - sdup->config->bulk_out, - &sdup->iqueue, n); - - osalSysLock(); - (void) usbStartReceiveI(sdup->config->usbp, sdup->config->bulk_out); - 800d7b8: f000 b9da b.w 800db70 - 800d7bc: f3af 8000 nop.w - -0800d7c0 : - return oqWriteTimeout(&((SerialUSBDriver *)ip)->oqueue, bp, n, timeout); -} - -static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t timeout) { - - return iqReadTimeout(&((SerialUSBDriver *)ip)->iqueue, bp, n, timeout); - 800d7c0: 300c adds r0, #12 - 800d7c2: f7ff bdc5 b.w 800d350 - 800d7c6: bf00 nop - 800d7c8: f3af 8000 nop.w - 800d7cc: f3af 8000 nop.w - -0800d7d0 : - n, TIME_INFINITE); -} - -static size_t read(void *ip, uint8_t *bp, size_t n) { - - return iqReadTimeout(&((SerialUSBDriver *)ip)->iqueue, bp, - 800d7d0: 300c adds r0, #12 - 800d7d2: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff - 800d7d6: f7ff bdbb b.w 800d350 - 800d7da: bf00 nop - 800d7dc: f3af 8000 nop.w - -0800d7e0 : - return iqGetTimeout(&((SerialUSBDriver *)ip)->iqueue, timeout); -} - -static size_t writet(void *ip, const uint8_t *bp, size_t n, systime_t timeout) { - - return oqWriteTimeout(&((SerialUSBDriver *)ip)->oqueue, bp, n, timeout); - 800d7e0: 3030 adds r0, #48 ; 0x30 - 800d7e2: f7ff be45 b.w 800d470 - 800d7e6: bf00 nop - 800d7e8: f3af 8000 nop.w - 800d7ec: f3af 8000 nop.w - -0800d7f0 : - * Interface implementation. - */ - -static size_t write(void *ip, const uint8_t *bp, size_t n) { - - return oqWriteTimeout(&((SerialUSBDriver *)ip)->oqueue, bp, - 800d7f0: 3030 adds r0, #48 ; 0x30 - 800d7f2: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff - 800d7f6: f7ff be3b b.w 800d470 - 800d7fa: bf00 nop - 800d7fc: f3af 8000 nop.w - -0800d800 : - return oqPutTimeout(&((SerialUSBDriver *)ip)->oqueue, b, timeout); -} - -static msg_t gett(void *ip, systime_t timeout) { - - return iqGetTimeout(&((SerialUSBDriver *)ip)->iqueue, timeout); - 800d800: 300c adds r0, #12 - 800d802: f7ff bd7d b.w 800d300 - 800d806: bf00 nop - 800d808: f3af 8000 nop.w - 800d80c: f3af 8000 nop.w - -0800d810 : - return oqPutTimeout(&((SerialUSBDriver *)ip)->oqueue, b, TIME_INFINITE); -} - -static msg_t get(void *ip) { - - return iqGetTimeout(&((SerialUSBDriver *)ip)->iqueue, TIME_INFINITE); - 800d810: 300c adds r0, #12 - 800d812: f04f 31ff mov.w r1, #4294967295 ; 0xffffffff - 800d816: f7ff bd73 b.w 800d300 - 800d81a: bf00 nop - 800d81c: f3af 8000 nop.w - -0800d820 : -} - -static msg_t putt(void *ip, uint8_t b, systime_t timeout) { - - return oqPutTimeout(&((SerialUSBDriver *)ip)->oqueue, b, timeout); - 800d820: 3030 adds r0, #48 ; 0x30 - 800d822: f7ff bdf5 b.w 800d410 - 800d826: bf00 nop - 800d828: f3af 8000 nop.w - 800d82c: f3af 8000 nop.w - -0800d830 : - n, TIME_INFINITE); -} - -static msg_t put(void *ip, uint8_t b) { - - return oqPutTimeout(&((SerialUSBDriver *)ip)->oqueue, b, TIME_INFINITE); - 800d830: 3030 adds r0, #48 ; 0x30 - 800d832: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff - 800d836: f7ff bdeb b.w 800d410 - 800d83a: bf00 nop - 800d83c: f3af 8000 nop.w - -0800d840 : - * @note This function is implicitly invoked by @p halInit(), there is - * no need to explicitly initialize the driver. - * - * @init - */ -void sduInit(void) { - 800d840: 4770 bx lr - 800d842: bf00 nop - 800d844: f3af 8000 nop.w - 800d848: f3af 8000 nop.w - 800d84c: f3af 8000 nop.w - -0800d850 : - * - * @param[out] sdup pointer to a @p SerialUSBDriver structure - * - * @init - */ -void sduObjectInit(SerialUSBDriver *sdup) { - 800d850: b510 push {r4, lr} - - sdup->vmt = &vmt; - 800d852: 4603 mov r3, r0 - 800d854: 4a0e ldr r2, [pc, #56] ; (800d890 ) - 800d856: f843 2b04 str.w r2, [r3], #4 - * - * @param[out] sdup pointer to a @p SerialUSBDriver structure - * - * @init - */ -void sduObjectInit(SerialUSBDriver *sdup) { - 800d85a: b082 sub sp, #8 - 800d85c: 4604 mov r4, r0 - - sdup->vmt = &vmt; - osalEventObjectInit(&sdup->event); - sdup->state = SDU_STOP; - 800d85e: 2201 movs r2, #1 - iqObjectInit(&sdup->iqueue, sdup->ib, SERIAL_USB_BUFFERS_SIZE, inotify, sdup); - 800d860: 9000 str r0, [sp, #0] - 800d862: f104 0154 add.w r1, r4, #84 ; 0x54 - 800d866: 6043 str r3, [r0, #4] - */ -void sduObjectInit(SerialUSBDriver *sdup) { - - sdup->vmt = &vmt; - osalEventObjectInit(&sdup->event); - sdup->state = SDU_STOP; - 800d868: 7202 strb r2, [r0, #8] - iqObjectInit(&sdup->iqueue, sdup->ib, SERIAL_USB_BUFFERS_SIZE, inotify, sdup); - 800d86a: 4b0a ldr r3, [pc, #40] ; (800d894 ) - 800d86c: 300c adds r0, #12 - 800d86e: f44f 7280 mov.w r2, #256 ; 0x100 - 800d872: f7ff fd25 bl 800d2c0 - oqObjectInit(&sdup->oqueue, sdup->ob, SERIAL_USB_BUFFERS_SIZE, onotify, sdup); - 800d876: 9400 str r4, [sp, #0] - 800d878: f104 0030 add.w r0, r4, #48 ; 0x30 - 800d87c: f504 71aa add.w r1, r4, #340 ; 0x154 - 800d880: f44f 7280 mov.w r2, #256 ; 0x100 - 800d884: 4b04 ldr r3, [pc, #16] ; (800d898 ) - 800d886: f7ff fda3 bl 800d3d0 -} - 800d88a: b002 add sp, #8 - 800d88c: bd10 pop {r4, pc} - 800d88e: bf00 nop - 800d890: 080131b0 .word 0x080131b0 - 800d894: 0800d751 .word 0x0800d751 - 800d898: 0800d6f1 .word 0x0800d6f1 - 800d89c: f3af 8000 nop.w - -0800d8a0 : - * @param[in] config the serial over USB driver configuration - * - * @api - */ -void sduStart(SerialUSBDriver *sdup, const SerialUSBConfig *config) { - USBDriver *usbp = config->usbp; - 800d8a0: 680b ldr r3, [r1, #0] - 800d8a2: 2220 movs r2, #32 - 800d8a4: f382 8811 msr BASEPRI, r2 - osalDbgCheck(sdup != NULL); - - osalSysLock(); - osalDbgAssert((sdup->state == SDU_STOP) || (sdup->state == SDU_READY), - "invalid state"); - usbp->in_params[config->bulk_in - 1U] = sdup; - 800d8a8: 790a ldrb r2, [r1, #4] - 800d8aa: eb03 0282 add.w r2, r3, r2, lsl #2 - 800d8ae: 6190 str r0, [r2, #24] - usbp->out_params[config->bulk_out - 1U] = sdup; - 800d8b0: 794a ldrb r2, [r1, #5] - 800d8b2: 3209 adds r2, #9 - 800d8b4: f843 0022 str.w r0, [r3, r2, lsl #2] - if (config->int_in > 0U) { - 800d8b8: 798a ldrb r2, [r1, #6] - 800d8ba: b112 cbz r2, 800d8c2 - usbp->in_params[config->int_in - 1U] = sdup; - 800d8bc: eb03 0382 add.w r3, r3, r2, lsl #2 - 800d8c0: 6198 str r0, [r3, #24] - } - sdup->config = config; - sdup->state = SDU_READY; - 800d8c2: 2302 movs r3, #2 - 800d8c4: 7203 strb r3, [r0, #8] - usbp->in_params[config->bulk_in - 1U] = sdup; - usbp->out_params[config->bulk_out - 1U] = sdup; - if (config->int_in > 0U) { - usbp->in_params[config->int_in - 1U] = sdup; - } - sdup->config = config; - 800d8c6: f8c0 1254 str.w r1, [r0, #596] ; 0x254 - 800d8ca: 2300 movs r3, #0 - 800d8cc: f383 8811 msr BASEPRI, r3 - 800d8d0: 4770 bx lr - 800d8d2: bf00 nop - 800d8d4: f3af 8000 nop.w - 800d8d8: f3af 8000 nop.w - 800d8dc: f3af 8000 nop.w - -0800d8e0 : - * - * @param[in] sdup pointer to a @p SerialUSBDriver object - * - * @iclass - */ -void sduConfigureHookI(SerialUSBDriver *sdup) { - 800d8e0: b570 push {r4, r5, r6, lr} - USBDriver *usbp = sdup->config->usbp; - 800d8e2: f8d0 3254 ldr.w r3, [r0, #596] ; 0x254 - - iqResetI(&sdup->iqueue); - 800d8e6: f100 060c add.w r6, r0, #12 - * - * @param[in] sdup pointer to a @p SerialUSBDriver object - * - * @iclass - */ -void sduConfigureHookI(SerialUSBDriver *sdup) { - 800d8ea: 4604 mov r4, r0 - USBDriver *usbp = sdup->config->usbp; - - iqResetI(&sdup->iqueue); - 800d8ec: 4630 mov r0, r6 - * @param[in] sdup pointer to a @p SerialUSBDriver object - * - * @iclass - */ -void sduConfigureHookI(SerialUSBDriver *sdup) { - USBDriver *usbp = sdup->config->usbp; - 800d8ee: 681d ldr r5, [r3, #0] - - iqResetI(&sdup->iqueue); - 800d8f0: f7ff fcf6 bl 800d2e0 - oqResetI(&sdup->oqueue); - 800d8f4: f104 0030 add.w r0, r4, #48 ; 0x30 - 800d8f8: f7ff fd7a bl 800d3f0 - * @iclass - */ -static inline void osalEventBroadcastFlagsI(event_source_t *esp, - eventflags_t flags) { - - chEvtBroadcastFlagsI(esp, flags); - 800d8fc: 1d20 adds r0, r4, #4 - 800d8fe: 2101 movs r1, #1 - 800d900: f7ff fcc6 bl 800d290 - chnAddFlagsI(sdup, CHN_CONNECTED); - - /* Starts the first OUT transaction immediately.*/ - usbPrepareQueuedReceive(usbp, sdup->config->bulk_out, &sdup->iqueue, - usbp->epc[sdup->config->bulk_out]->out_maxsize); - 800d904: f8d4 3254 ldr.w r3, [r4, #596] ; 0x254 - 800d908: 7959 ldrb r1, [r3, #5] - 800d90a: eb05 0381 add.w r3, r5, r1, lsl #2 - iqResetI(&sdup->iqueue); - oqResetI(&sdup->oqueue); - chnAddFlagsI(sdup, CHN_CONNECTED); - - /* Starts the first OUT transaction immediately.*/ - usbPrepareQueuedReceive(usbp, sdup->config->bulk_out, &sdup->iqueue, - 800d90e: 4628 mov r0, r5 - usbp->epc[sdup->config->bulk_out]->out_maxsize); - 800d910: 68db ldr r3, [r3, #12] - iqResetI(&sdup->iqueue); - oqResetI(&sdup->oqueue); - chnAddFlagsI(sdup, CHN_CONNECTED); - - /* Starts the first OUT transaction immediately.*/ - usbPrepareQueuedReceive(usbp, sdup->config->bulk_out, &sdup->iqueue, - 800d912: 4632 mov r2, r6 - 800d914: 8a5b ldrh r3, [r3, #18] - 800d916: f000 f90b bl 800db30 - usbp->epc[sdup->config->bulk_out]->out_maxsize); - (void) usbStartReceiveI(usbp, sdup->config->bulk_out); - 800d91a: f8d4 3254 ldr.w r3, [r4, #596] ; 0x254 - 800d91e: 4628 mov r0, r5 - 800d920: 7959 ldrb r1, [r3, #5] -} - 800d922: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} - chnAddFlagsI(sdup, CHN_CONNECTED); - - /* Starts the first OUT transaction immediately.*/ - usbPrepareQueuedReceive(usbp, sdup->config->bulk_out, &sdup->iqueue, - usbp->epc[sdup->config->bulk_out]->out_maxsize); - (void) usbStartReceiveI(usbp, sdup->config->bulk_out); - 800d926: f000 b923 b.w 800db70 - 800d92a: bf00 nop - 800d92c: f3af 8000 nop.w - -0800d930 : - * @retval true Message handled internally. - * @retval false Message not handled. - */ -bool sduRequestsHook(USBDriver *usbp) { - - if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) { - 800d930: f890 3044 ldrb.w r3, [r0, #68] ; 0x44 - 800d934: f003 0360 and.w r3, r3, #96 ; 0x60 - 800d938: 2b20 cmp r3, #32 - 800d93a: d001 beq.n 800d940 - case CDC_SET_CONTROL_LINE_STATE: - /* Nothing to do, there are no control lines.*/ - usbSetupTransfer(usbp, NULL, 0, NULL); - return true; - default: - return false; - 800d93c: 2000 movs r0, #0 - } - } - return false; -} - 800d93e: 4770 bx lr - * @retval false Message not handled. - */ -bool sduRequestsHook(USBDriver *usbp) { - - if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) { - switch (usbp->setup[1]) { - 800d940: f890 3045 ldrb.w r3, [r0, #69] ; 0x45 - 800d944: 2b21 cmp r3, #33 ; 0x21 - 800d946: d003 beq.n 800d950 - 800d948: 2b22 cmp r3, #34 ; 0x22 - 800d94a: d009 beq.n 800d960 - 800d94c: 2b20 cmp r3, #32 - 800d94e: d1f5 bne.n 800d93c - case CDC_GET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL); - return true; - case CDC_SET_LINE_CODING: - usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding), NULL); - 800d950: 4b06 ldr r3, [pc, #24] ; (800d96c ) - 800d952: 6383 str r3, [r0, #56] ; 0x38 - 800d954: 2207 movs r2, #7 - 800d956: 2300 movs r3, #0 - 800d958: 63c2 str r2, [r0, #60] ; 0x3c - 800d95a: 6403 str r3, [r0, #64] ; 0x40 - return true; - 800d95c: 2001 movs r0, #1 - 800d95e: 4770 bx lr - case CDC_SET_CONTROL_LINE_STATE: - /* Nothing to do, there are no control lines.*/ - usbSetupTransfer(usbp, NULL, 0, NULL); - 800d960: 2300 movs r3, #0 - 800d962: 6383 str r3, [r0, #56] ; 0x38 - 800d964: 63c3 str r3, [r0, #60] ; 0x3c - 800d966: 6403 str r3, [r0, #64] ; 0x40 - return true; - 800d968: 2001 movs r0, #1 - 800d96a: 4770 bx lr - 800d96c: 20000800 .word 0x20000800 - -0800d970 : - * data endpoint. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - */ -void sduDataTransmitted(USBDriver *usbp, usbep_t ep) { - 800d970: b5f8 push {r3, r4, r5, r6, r7, lr} - size_t n; - SerialUSBDriver *sdup = usbp->in_params[ep - 1U]; - 800d972: eb00 0381 add.w r3, r0, r1, lsl #2 - 800d976: 699c ldr r4, [r3, #24] - - if (sdup == NULL) { - 800d978: b1bc cbz r4, 800d9aa - 800d97a: 460e mov r6, r1 - 800d97c: 4605 mov r5, r0 - 800d97e: 2720 movs r7, #32 - 800d980: f387 8811 msr BASEPRI, r7 - 800d984: 2108 movs r1, #8 - 800d986: 1d20 adds r0, r4, #4 - 800d988: f7ff fc82 bl 800d290 - */ -static inline size_t chOQGetFullI(output_queue_t *oqp) { - - chDbgCheckClassI(); - - return (size_t)(chQSizeX(oqp) - chQSpaceI(oqp)); - 800d98c: 6c22 ldr r2, [r4, #64] ; 0x40 - 800d98e: 6be3 ldr r3, [r4, #60] ; 0x3c - 800d990: 6ba1 ldr r1, [r4, #56] ; 0x38 - 800d992: 1ad3 subs r3, r2, r3 - - osalSysLockFromISR(); - chnAddFlagsI(sdup, CHN_OUTPUT_EMPTY); - - /*lint -save -e9013 [15.7] There is no else because it is not needed.*/ - if ((n = oqGetFullI(&sdup->oqueue)) > 0U) { - 800d994: 1a5b subs r3, r3, r1 - 800d996: d110 bne.n 800d9ba - usbPrepareQueuedTransmit(usbp, ep, &sdup->oqueue, n); - - osalSysLockFromISR(); - (void) usbStartTransmitI(usbp, ep); - } - else if ((usbp->epc[ep]->in_state->txsize > 0U) && - 800d998: eb05 0386 add.w r3, r5, r6, lsl #2 - 800d99c: 68db ldr r3, [r3, #12] - 800d99e: 695a ldr r2, [r3, #20] - 800d9a0: 6852 ldr r2, [r2, #4] - 800d9a2: b91a cbnz r2, 800d9ac - 800d9a4: 2300 movs r3, #0 - 800d9a6: f383 8811 msr BASEPRI, r3 - 800d9aa: bdf8 pop {r3, r4, r5, r6, r7, pc} - ((usbp->epc[ep]->in_state->txsize & - ((size_t)usbp->epc[ep]->in_maxsize - 1U)) == 0U)) { - 800d9ac: 8a1b ldrh r3, [r3, #16] - 800d9ae: 3b01 subs r3, #1 - usbPrepareQueuedTransmit(usbp, ep, &sdup->oqueue, n); - - osalSysLockFromISR(); - (void) usbStartTransmitI(usbp, ep); - } - else if ((usbp->epc[ep]->in_state->txsize > 0U) && - 800d9b0: 4013 ands r3, r2 - 800d9b2: d1f7 bne.n 800d9a4 - 800d9b4: f383 8811 msr BASEPRI, r3 - 800d9b8: e002 b.n 800d9c0 - 800d9ba: 2200 movs r2, #0 - 800d9bc: f382 8811 msr BASEPRI, r2 - size. Otherwise the recipient may expect more data coming soon and - not return buffered data to app. See section 5.8.3 Bulk Transfer - Packet Size Constraints of the USB Specification document.*/ - osalSysUnlockFromISR(); - - usbPrepareQueuedTransmit(usbp, ep, &sdup->oqueue, 0); - 800d9c0: f104 0230 add.w r2, r4, #48 ; 0x30 - 800d9c4: 4628 mov r0, r5 - 800d9c6: 4631 mov r1, r6 - 800d9c8: f000 f8c2 bl 800db50 - 800d9cc: f387 8811 msr BASEPRI, r7 - - osalSysLockFromISR(); - (void) usbStartTransmitI(usbp, ep); - 800d9d0: 4628 mov r0, r5 - 800d9d2: 4631 mov r1, r6 - 800d9d4: f000 f8e4 bl 800dba0 - 800d9d8: e7e4 b.n 800d9a4 - 800d9da: bf00 nop - 800d9dc: f3af 8000 nop.w - -0800d9e0 : - * data endpoint. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - */ -void sduDataReceived(USBDriver *usbp, usbep_t ep) { - 800d9e0: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr} - size_t n, maxsize; - SerialUSBDriver *sdup = usbp->out_params[ep - 1U]; - 800d9e4: f101 0309 add.w r3, r1, #9 - 800d9e8: f850 6023 ldr.w r6, [r0, r3, lsl #2] - - if (sdup == NULL) { - 800d9ec: b1be cbz r6, 800da1e - 800d9ee: 4680 mov r8, r0 - 800d9f0: 460f mov r7, r1 - 800d9f2: f04f 0920 mov.w r9, #32 - 800d9f6: f389 8811 msr BASEPRI, r9 - 800d9fa: 2104 movs r1, #4 - 800d9fc: 1870 adds r0, r6, r1 - 800d9fe: f7ff fc47 bl 800d290 - osalSysLockFromISR(); - chnAddFlagsI(sdup, CHN_INPUT_AVAILABLE); - - /* Writes to the input queue can only happen when there is enough space - to hold at least one packet.*/ - maxsize = usbp->epc[ep]->out_maxsize; - 800da02: eb08 0387 add.w r3, r8, r7, lsl #2 - */ -static inline size_t chIQGetEmptyI(input_queue_t *iqp) { - - chDbgCheckClassI(); - - return (size_t)(chQSizeX(iqp) - chQSpaceI(iqp)); - 800da06: 69b4 ldr r4, [r6, #24] - 800da08: 68da ldr r2, [r3, #12] - 800da0a: 69f5 ldr r5, [r6, #28] - 800da0c: 6973 ldr r3, [r6, #20] - 800da0e: 8a51 ldrh r1, [r2, #18] - 800da10: 1b2d subs r5, r5, r4 - 800da12: 1aec subs r4, r5, r3 - if ((n = iqGetEmptyI(&sdup->iqueue)) >= maxsize) { - 800da14: 42a1 cmp r1, r4 - 800da16: d904 bls.n 800da22 - 800da18: 2300 movs r3, #0 - 800da1a: f383 8811 msr BASEPRI, r3 - 800da1e: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc} - 800da22: 2300 movs r3, #0 - 800da24: f383 8811 msr BASEPRI, r3 - /* The endpoint cannot be busy, we are in the context of the callback, - so a packet is in the buffer for sure.*/ - osalSysUnlockFromISR(); - - n = (n / maxsize) * maxsize; - 800da28: fbb4 f3f1 udiv r3, r4, r1 - usbPrepareQueuedReceive(usbp, ep, &sdup->iqueue, n); - 800da2c: f106 020c add.w r2, r6, #12 - 800da30: fb01 f303 mul.w r3, r1, r3 - 800da34: 4640 mov r0, r8 - 800da36: 4639 mov r1, r7 - 800da38: f000 f87a bl 800db30 - 800da3c: f389 8811 msr BASEPRI, r9 - - osalSysLockFromISR(); - (void) usbStartReceiveI(usbp, ep); - 800da40: 4640 mov r0, r8 - 800da42: 4639 mov r1, r7 - 800da44: f000 f894 bl 800db70 - 800da48: e7e6 b.n 800da18 - 800da4a: bf00 nop - 800da4c: f3af 8000 nop.w - -0800da50 : - * interrupt endpoint. - * - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - */ -void sduInterruptTransmitted(USBDriver *usbp, usbep_t ep) { - 800da50: 4770 bx lr - 800da52: bf00 nop - 800da54: f3af 8000 nop.w - 800da58: f3af 8000 nop.w - 800da5c: f3af 8000 nop.w - -0800da60 : - * - * @init - */ -void stInit(void) { - - st_lld_init(); - 800da60: f001 bfc6 b.w 800f9f0 - 800da64: f3af 8000 nop.w - 800da68: f3af 8000 nop.w - 800da6c: f3af 8000 nop.w - -0800da70 : - * - * @init - */ -void uartInit(void) { - - uart_lld_init(); - 800da70: f002 b82e b.w 800fad0 - 800da74: f3af 8000 nop.w - 800da78: f3af 8000 nop.w - 800da7c: f3af 8000 nop.w - -0800da80 : - * @init - */ -void uartObjectInit(UARTDriver *uartp) { - - uartp->state = UART_STOP; - uartp->txstate = UART_TX_IDLE; - 800da80: 2300 movs r3, #0 - * - * @init - */ -void uartObjectInit(UARTDriver *uartp) { - - uartp->state = UART_STOP; - 800da82: 2201 movs r2, #1 - 800da84: 7002 strb r2, [r0, #0] - uartp->txstate = UART_TX_IDLE; - 800da86: 7043 strb r3, [r0, #1] - uartp->rxstate = UART_RX_IDLE; - 800da88: 7083 strb r3, [r0, #2] - uartp->config = NULL; - 800da8a: 6043 str r3, [r0, #4] - 800da8c: 4770 bx lr - 800da8e: bf00 nop - -0800da90 : - * - * @init - */ -void usbInit(void) { - - usb_lld_init(); - 800da90: f001 bb5e b.w 800f150 - 800da94: f3af 8000 nop.w - 800da98: f3af 8000 nop.w - 800da9c: f3af 8000 nop.w - -0800daa0 : - */ -void usbObjectInit(USBDriver *usbp) { - unsigned i; - - usbp->state = USB_STOP; - usbp->config = NULL; - 800daa0: 2300 movs r3, #0 - * @init - */ -void usbObjectInit(USBDriver *usbp) { - unsigned i; - - usbp->state = USB_STOP; - 800daa2: 2201 movs r2, #1 - 800daa4: 7002 strb r2, [r0, #0] - usbp->config = NULL; - 800daa6: 6043 str r3, [r0, #4] - for (i = 0; i < (unsigned)USB_MAX_ENDPOINTS; i++) { - usbp->in_params[i] = NULL; - 800daa8: 61c3 str r3, [r0, #28] - usbp->out_params[i] = NULL; - 800daaa: 6283 str r3, [r0, #40] ; 0x28 - unsigned i; - - usbp->state = USB_STOP; - usbp->config = NULL; - for (i = 0; i < (unsigned)USB_MAX_ENDPOINTS; i++) { - usbp->in_params[i] = NULL; - 800daac: 6203 str r3, [r0, #32] - usbp->out_params[i] = NULL; - 800daae: 62c3 str r3, [r0, #44] ; 0x2c - unsigned i; - - usbp->state = USB_STOP; - usbp->config = NULL; - for (i = 0; i < (unsigned)USB_MAX_ENDPOINTS; i++) { - usbp->in_params[i] = NULL; - 800dab0: 6243 str r3, [r0, #36] ; 0x24 - usbp->out_params[i] = NULL; - 800dab2: 6303 str r3, [r0, #48] ; 0x30 - } - usbp->transmitting = 0; - 800dab4: 8103 strh r3, [r0, #8] - usbp->receiving = 0; - 800dab6: 8143 strh r3, [r0, #10] - 800dab8: 4770 bx lr - 800daba: bf00 nop - 800dabc: f3af 8000 nop.w - -0800dac0 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] config pointer to the @p USBConfig object - * - * @api - */ -void usbStart(USBDriver *usbp, const USBConfig *config) { - 800dac0: b538 push {r3, r4, r5, lr} - 800dac2: 4604 mov r4, r0 - 800dac4: 2320 movs r3, #32 - 800dac6: f383 8811 msr BASEPRI, r3 - osalSysLock(); - osalDbgAssert((usbp->state == USB_STOP) || (usbp->state == USB_READY), - "invalid state"); - usbp->config = config; - for (i = 0; i <= (unsigned)USB_MAX_ENDPOINTS; i++) { - usbp->epc[i] = NULL; - 800daca: 2500 movs r5, #0 - osalDbgCheck((usbp != NULL) && (config != NULL)); - - osalSysLock(); - osalDbgAssert((usbp->state == USB_STOP) || (usbp->state == USB_READY), - "invalid state"); - usbp->config = config; - 800dacc: 6041 str r1, [r0, #4] - for (i = 0; i <= (unsigned)USB_MAX_ENDPOINTS; i++) { - usbp->epc[i] = NULL; - 800dace: 60c5 str r5, [r0, #12] - 800dad0: 6105 str r5, [r0, #16] - 800dad2: 6145 str r5, [r0, #20] - 800dad4: 6185 str r5, [r0, #24] - } - usb_lld_start(usbp); - 800dad6: f001 fb53 bl 800f180 - usbp->state = USB_READY; - 800dada: 2302 movs r3, #2 - 800dadc: 7023 strb r3, [r4, #0] - 800dade: f385 8811 msr BASEPRI, r5 - 800dae2: bd38 pop {r3, r4, r5, pc} - 800dae4: f3af 8000 nop.w - 800dae8: f3af 8000 nop.w - 800daec: f3af 8000 nop.w - -0800daf0 : - * @param[in] epcp the endpoint configuration - * - * @iclass - */ -void usbInitEndpointI(USBDriver *usbp, usbep_t ep, - const USBEndpointConfig *epcp) { - 800daf0: b570 push {r4, r5, r6, lr} - 800daf2: 4606 mov r6, r0 - osalDbgAssert(usbp->state == USB_ACTIVE, - "invalid state"); - osalDbgAssert(usbp->epc[ep] == NULL, "already initialized"); - - /* Logically enabling the endpoint in the USBDriver structure.*/ - if (epcp->in_state != NULL) { - 800daf4: 6950 ldr r0, [r2, #20] - * @param[in] epcp the endpoint configuration - * - * @iclass - */ -void usbInitEndpointI(USBDriver *usbp, usbep_t ep, - const USBEndpointConfig *epcp) { - 800daf6: 4614 mov r4, r2 - 800daf8: 460d mov r5, r1 - osalDbgAssert(usbp->state == USB_ACTIVE, - "invalid state"); - osalDbgAssert(usbp->epc[ep] == NULL, "already initialized"); - - /* Logically enabling the endpoint in the USBDriver structure.*/ - if (epcp->in_state != NULL) { - 800dafa: b118 cbz r0, 800db04 - memset(epcp->in_state, 0, sizeof(USBInEndpointState)); - 800dafc: 2100 movs r1, #0 - 800dafe: 2214 movs r2, #20 - 800db00: f005 faee bl 80130e0 - } - if (epcp->out_state != NULL) { - 800db04: 69a0 ldr r0, [r4, #24] - 800db06: b118 cbz r0, 800db10 - memset(epcp->out_state, 0, sizeof(USBOutEndpointState)); - 800db08: 2100 movs r1, #0 - 800db0a: 2214 movs r2, #20 - 800db0c: f005 fae8 bl 80130e0 - } - - usbp->epc[ep] = epcp; - 800db10: eb06 0385 add.w r3, r6, r5, lsl #2 - - /* Low level endpoint activation.*/ - usb_lld_init_endpoint(usbp, ep); - 800db14: 4630 mov r0, r6 - } - if (epcp->out_state != NULL) { - memset(epcp->out_state, 0, sizeof(USBOutEndpointState)); - } - - usbp->epc[ep] = epcp; - 800db16: 60dc str r4, [r3, #12] - - /* Low level endpoint activation.*/ - usb_lld_init_endpoint(usbp, ep); - 800db18: 4629 mov r1, r5 -} - 800db1a: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} - } - - usbp->epc[ep] = epcp; - - /* Low level endpoint activation.*/ - usb_lld_init_endpoint(usbp, ep); - 800db1e: f001 bc1f b.w 800f360 - 800db22: bf00 nop - 800db24: f3af 8000 nop.w - 800db28: f3af 8000 nop.w - 800db2c: f3af 8000 nop.w - -0800db30 : - * @param[in] n transaction size - * - * @special - */ -void usbPrepareQueuedReceive(USBDriver *usbp, usbep_t ep, - input_queue_t *iqp, size_t n) { - 800db30: b470 push {r4, r5, r6} - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800db32: eb00 0481 add.w r4, r0, r1, lsl #2 - - osp->rxqueued = true; - 800db36: 2601 movs r6, #1 - * - * @special - */ -void usbPrepareQueuedReceive(USBDriver *usbp, usbep_t ep, - input_queue_t *iqp, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800db38: 68e4 ldr r4, [r4, #12] - 800db3a: 69a4 ldr r4, [r4, #24] - - osp->rxqueued = true; - osp->mode.queue.rxqueue = iqp; - osp->rxsize = n; - osp->rxcnt = 0; - 800db3c: 2500 movs r5, #0 -void usbPrepareQueuedReceive(USBDriver *usbp, usbep_t ep, - input_queue_t *iqp, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - - osp->rxqueued = true; - osp->mode.queue.rxqueue = iqp; - 800db3e: 60e2 str r2, [r4, #12] - osp->rxsize = n; - 800db40: 6063 str r3, [r4, #4] - */ -void usbPrepareQueuedReceive(USBDriver *usbp, usbep_t ep, - input_queue_t *iqp, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - - osp->rxqueued = true; - 800db42: 7026 strb r6, [r4, #0] - osp->mode.queue.rxqueue = iqp; - osp->rxsize = n; - osp->rxcnt = 0; - 800db44: 60a5 str r5, [r4, #8] - - usb_lld_prepare_receive(usbp, ep); -} - 800db46: bc70 pop {r4, r5, r6} - osp->rxqueued = true; - osp->mode.queue.rxqueue = iqp; - osp->rxsize = n; - osp->rxcnt = 0; - - usb_lld_prepare_receive(usbp, ep); - 800db48: f001 bcea b.w 800f520 - 800db4c: f3af 8000 nop.w - -0800db50 : - * @param[in] n transaction size - * - * @special - */ -void usbPrepareQueuedTransmit(USBDriver *usbp, usbep_t ep, - output_queue_t *oqp, size_t n) { - 800db50: b470 push {r4, r5, r6} - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800db52: eb00 0481 add.w r4, r0, r1, lsl #2 - - isp->txqueued = true; - 800db56: 2601 movs r6, #1 - * - * @special - */ -void usbPrepareQueuedTransmit(USBDriver *usbp, usbep_t ep, - output_queue_t *oqp, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800db58: 68e4 ldr r4, [r4, #12] - 800db5a: 6964 ldr r4, [r4, #20] - - isp->txqueued = true; - isp->mode.queue.txqueue = oqp; - isp->txsize = n; - isp->txcnt = 0; - 800db5c: 2500 movs r5, #0 -void usbPrepareQueuedTransmit(USBDriver *usbp, usbep_t ep, - output_queue_t *oqp, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = true; - isp->mode.queue.txqueue = oqp; - 800db5e: 60e2 str r2, [r4, #12] - isp->txsize = n; - 800db60: 6063 str r3, [r4, #4] - */ -void usbPrepareQueuedTransmit(USBDriver *usbp, usbep_t ep, - output_queue_t *oqp, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = true; - 800db62: 7026 strb r6, [r4, #0] - isp->mode.queue.txqueue = oqp; - isp->txsize = n; - isp->txcnt = 0; - 800db64: 60a5 str r5, [r4, #8] - - usb_lld_prepare_transmit(usbp, ep); -} - 800db66: bc70 pop {r4, r5, r6} - isp->txqueued = true; - isp->mode.queue.txqueue = oqp; - isp->txsize = n; - isp->txcnt = 0; - - usb_lld_prepare_transmit(usbp, ep); - 800db68: f001 bd5a b.w 800f620 - 800db6c: f3af 8000 nop.w - -0800db70 : -bool usbStartReceiveI(USBDriver *usbp, usbep_t ep) { - - osalDbgCheckClassI(); - osalDbgCheck(usbp != NULL); - - if (usbGetReceiveStatusI(usbp, ep)) { - 800db70: 2201 movs r2, #1 - * @retval false Operation started successfully. - * @retval true Endpoint busy, operation not started. - * - * @iclass - */ -bool usbStartReceiveI(USBDriver *usbp, usbep_t ep) { - 800db72: b570 push {r4, r5, r6, lr} - - osalDbgCheckClassI(); - osalDbgCheck(usbp != NULL); - - if (usbGetReceiveStatusI(usbp, ep)) { - 800db74: fa02 f301 lsl.w r3, r2, r1 - 800db78: 8944 ldrh r4, [r0, #10] - 800db7a: b29b uxth r3, r3 - 800db7c: ea13 0604 ands.w r6, r3, r4 - 800db80: d001 beq.n 800db86 - return true; - 800db82: 4610 mov r0, r2 - } - - usbp->receiving |= (uint16_t)((unsigned)1U << (unsigned)ep); - usb_lld_start_out(usbp, ep); - return false; -} - 800db84: bd70 pop {r4, r5, r6, pc} - - if (usbGetReceiveStatusI(usbp, ep)) { - return true; - } - - usbp->receiving |= (uint16_t)((unsigned)1U << (unsigned)ep); - 800db86: 4323 orrs r3, r4 - 800db88: 8143 strh r3, [r0, #10] - usb_lld_start_out(usbp, ep); - 800db8a: f001 fe59 bl 800f840 - return false; - 800db8e: 4630 mov r0, r6 - 800db90: bd70 pop {r4, r5, r6, pc} - 800db92: bf00 nop - 800db94: f3af 8000 nop.w - 800db98: f3af 8000 nop.w - 800db9c: f3af 8000 nop.w - -0800dba0 : -bool usbStartTransmitI(USBDriver *usbp, usbep_t ep) { - - osalDbgCheckClassI(); - osalDbgCheck(usbp != NULL); - - if (usbGetTransmitStatusI(usbp, ep)) { - 800dba0: 2201 movs r2, #1 - * @retval false Operation started successfully. - * @retval true Endpoint busy, operation not started. - * - * @iclass - */ -bool usbStartTransmitI(USBDriver *usbp, usbep_t ep) { - 800dba2: b570 push {r4, r5, r6, lr} - - osalDbgCheckClassI(); - osalDbgCheck(usbp != NULL); - - if (usbGetTransmitStatusI(usbp, ep)) { - 800dba4: fa02 f301 lsl.w r3, r2, r1 - 800dba8: 8904 ldrh r4, [r0, #8] - 800dbaa: b29b uxth r3, r3 - 800dbac: ea13 0604 ands.w r6, r3, r4 - 800dbb0: d001 beq.n 800dbb6 - return true; - 800dbb2: 4610 mov r0, r2 - } - - usbp->transmitting |= (uint16_t)((unsigned)1U << (unsigned)ep); - usb_lld_start_in(usbp, ep); - return false; -} - 800dbb4: bd70 pop {r4, r5, r6, pc} - - if (usbGetTransmitStatusI(usbp, ep)) { - return true; - } - - usbp->transmitting |= (uint16_t)((unsigned)1U << (unsigned)ep); - 800dbb6: 4323 orrs r3, r4 - 800dbb8: 8103 strh r3, [r0, #8] - usb_lld_start_in(usbp, ep); - 800dbba: f001 fe51 bl 800f860 - return false; - 800dbbe: 4630 mov r0, r6 - 800dbc0: bd70 pop {r4, r5, r6, pc} - 800dbc2: bf00 nop - 800dbc4: f3af 8000 nop.w - 800dbc8: f3af 8000 nop.w - 800dbcc: f3af 8000 nop.w - -0800dbd0 <_usb_reset>: - */ -void _usb_reset(USBDriver *usbp) { - unsigned i; - - usbp->state = USB_READY; - usbp->status = 0; - 800dbd0: 2200 movs r2, #0 - * @notapi - */ -void _usb_reset(USBDriver *usbp) { - unsigned i; - - usbp->state = USB_READY; - 800dbd2: 2102 movs r1, #2 - 800dbd4: 7001 strb r1, [r0, #0] - usbp->status = 0; - 800dbd6: f8a0 204c strh.w r2, [r0, #76] ; 0x4c - usbp->address = 0; - 800dbda: f880 204e strb.w r2, [r0, #78] ; 0x4e - usbp->configuration = 0; - 800dbde: f880 204f strb.w r2, [r0, #79] ; 0x4f - usbp->transmitting = 0; - 800dbe2: 8102 strh r2, [r0, #8] - usbp->receiving = 0; - 800dbe4: 8142 strh r2, [r0, #10] - - /* Invalidates all endpoints into the USBDriver structure.*/ - for (i = 0; i <= (unsigned)USB_MAX_ENDPOINTS; i++) { - usbp->epc[i] = NULL; - 800dbe6: 60c2 str r2, [r0, #12] - 800dbe8: 6102 str r2, [r0, #16] - 800dbea: 6142 str r2, [r0, #20] - 800dbec: 6182 str r2, [r0, #24] - } - - /* EP0 state machine initialization.*/ - usbp->ep0state = USB_EP0_WAITING_SETUP; - 800dbee: f880 2034 strb.w r2, [r0, #52] ; 0x34 - - /* Low level reset.*/ - usb_lld_reset(usbp); - 800dbf2: f001 bb3d b.w 800f270 - 800dbf6: bf00 nop - 800dbf8: f3af 8000 nop.w - 800dbfc: f3af 8000 nop.w - -0800dc00 <_usb_ep0setup>: - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number, always zero - * - * @notapi - */ -void _usb_ep0setup(USBDriver *usbp, usbep_t ep) { - 800dc00: b5f8 push {r3, r4, r5, r6, r7, lr} - size_t max; - - usbp->ep0state = USB_EP0_WAITING_SETUP; - 800dc02: 2300 movs r3, #0 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number, always zero - * - * @notapi - */ -void _usb_ep0setup(USBDriver *usbp, usbep_t ep) { - 800dc04: 4604 mov r4, r0 - size_t max; - - usbp->ep0state = USB_EP0_WAITING_SETUP; - 800dc06: f880 3034 strb.w r3, [r0, #52] ; 0x34 - usbReadSetup(usbp, ep, usbp->setup); - 800dc0a: f100 0244 add.w r2, r0, #68 ; 0x44 - 800dc0e: f001 fc77 bl 800f500 - - /* First verify if the application has an handler installed for this - request.*/ - /*lint -save -e9007 [13.5] No side effects, it is intentional.*/ - if ((usbp->config->requests_hook_cb == NULL) || - 800dc12: 6863 ldr r3, [r4, #4] - 800dc14: 689b ldr r3, [r3, #8] - 800dc16: b363 cbz r3, 800dc72 <_usb_ep0setup+0x72> - !(usbp->config->requests_hook_cb(usbp))) { - 800dc18: 4620 mov r0, r4 - 800dc1a: 4798 blx r3 - usbReadSetup(usbp, ep, usbp->setup); - - /* First verify if the application has an handler installed for this - request.*/ - /*lint -save -e9007 [13.5] No side effects, it is intentional.*/ - if ((usbp->config->requests_hook_cb == NULL) || - 800dc1c: b348 cbz r0, 800dc72 <_usb_ep0setup+0x72> - 800dc1e: 6be5 ldr r5, [r4, #60] ; 0x3c - 800dc20: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - -static uint16_t get_hword(uint8_t *p) { - uint16_t hw; - - hw = (uint16_t)*p++; - hw |= (uint16_t)*p << 8U; - 800dc24: f894 104b ldrb.w r1, [r4, #75] ; 0x4b - 800dc28: f894 204a ldrb.w r2, [r4, #74] ; 0x4a - } -#endif - /* Transfer preparation. The request handler must have populated - correctly the fields ep0next, ep0n and ep0endcb using the macro - usbSetupTransfer().*/ - max = (size_t)get_hword(&usbp->setup[6]); - 800dc2c: ea42 2201 orr.w r2, r2, r1, lsl #8 - /* The transfer size cannot exceed the specified amount.*/ - if (usbp->ep0n > max) { - 800dc30: 42aa cmp r2, r5 - usbp->ep0n = max; - 800dc32: bf3c itt cc - 800dc34: 63e2 strcc r2, [r4, #60] ; 0x3c - 800dc36: 4615 movcc r5, r2 - } - if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { - 800dc38: f013 0f80 tst.w r3, #128 ; 0x80 - * - * @special - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800dc3c: 68e3 ldr r3, [r4, #12] - max = (size_t)get_hword(&usbp->setup[6]); - /* The transfer size cannot exceed the specified amount.*/ - if (usbp->ep0n > max) { - usbp->ep0n = max; - } - if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { - 800dc3e: f040 8088 bne.w 800dd52 <_usb_ep0setup+0x152> -#endif - } - } - else { - /* OUT phase.*/ - if (usbp->ep0n != 0U) { - 800dc42: 2d00 cmp r5, #0 - 800dc44: d16d bne.n 800dd22 <_usb_ep0setup+0x122> - * - * @special - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800dc46: 695b ldr r3, [r3, #20] - osalSysUnlockFromISR(); - } - else { - /* No receive phase, directly sending the zero sized status - packet.*/ - usbp->ep0state = USB_EP0_SENDING_STS; - 800dc48: 2205 movs r2, #5 - 800dc4a: f884 2034 strb.w r2, [r4, #52] ; 0x34 - isp->txqueued = false; - isp->mode.linear.txbuf = buf; - isp->txsize = n; - isp->txcnt = 0; - - usb_lld_prepare_transmit(usbp, ep); - 800dc4e: 4620 mov r0, r4 - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = false; - 800dc50: 701d strb r5, [r3, #0] - isp->mode.linear.txbuf = buf; - 800dc52: 60dd str r5, [r3, #12] - isp->txsize = n; - 800dc54: 605d str r5, [r3, #4] - isp->txcnt = 0; - 800dc56: 609d str r5, [r3, #8] - - usb_lld_prepare_transmit(usbp, ep); - 800dc58: 4629 mov r1, r5 - 800dc5a: f001 fce1 bl 800f620 - 800dc5e: 2320 movs r3, #32 - 800dc60: f383 8811 msr BASEPRI, r3 - packet.*/ - usbp->ep0state = USB_EP0_SENDING_STS; -#if (USB_EP0_STATUS_STAGE == USB_EP0_STATUS_STAGE_SW) - usbPrepareTransmit(usbp, 0, NULL, 0); - osalSysLockFromISR(); - (void) usbStartTransmitI(usbp, 0); - 800dc64: 4620 mov r0, r4 - 800dc66: 4629 mov r1, r5 - 800dc68: f7ff ff9a bl 800dba0 - 800dc6c: f385 8811 msr BASEPRI, r5 - 800dc70: bdf8 pop {r3, r4, r5, r6, r7, pc} - !(usbp->config->requests_hook_cb(usbp))) { - /*lint -restore*/ - /* Invoking the default handler, if this fails then stalls the - endpoint zero as error.*/ - /*lint -save -e9007 [13.5] No side effects, it is intentional.*/ - if (((usbp->setup[0] & USB_RTYPE_TYPE_MASK) != USB_RTYPE_TYPE_STD) || - 800dc72: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800dc76: f013 0760 ands.w r7, r3, #96 ; 0x60 - 800dc7a: d011 beq.n 800dca0 <_usb_ep0setup+0xa0> - !default_handler(usbp)) { - /*lint -restore*/ - /* Error response, the state machine goes into an error state, the low - level layer will have to reset it to USB_EP0_WAITING_SETUP after - receiving a SETUP packet.*/ - usb_lld_stall_in(usbp, 0); - 800dc7c: 4620 mov r0, r4 - 800dc7e: 2100 movs r1, #0 - 800dc80: f001 fe16 bl 800f8b0 - usb_lld_stall_out(usbp, 0); - 800dc84: 4620 mov r0, r4 - 800dc86: 2100 movs r1, #0 - 800dc88: f001 fe02 bl 800f890 - _usb_isr_invoke_event_cb(usbp, USB_EVENT_STALLED); - 800dc8c: 6863 ldr r3, [r4, #4] - 800dc8e: 681b ldr r3, [r3, #0] - 800dc90: b113 cbz r3, 800dc98 <_usb_ep0setup+0x98> - 800dc92: 4620 mov r0, r4 - 800dc94: 2105 movs r1, #5 - 800dc96: 4798 blx r3 - usbp->ep0state = USB_EP0_ERROR; - 800dc98: 2306 movs r3, #6 - 800dc9a: f884 3034 strb.w r3, [r4, #52] ; 0x34 - return; - 800dc9e: bdf8 pop {r3, r4, r5, r6, r7, pc} - const USBDescriptor *dp; - - /* Decoding the request.*/ - switch ((((uint32_t)usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | - USB_RTYPE_TYPE_MASK)) | - ((uint32_t)usbp->setup[1] << 8U))) { - 800dca0: f894 5045 ldrb.w r5, [r4, #69] ; 0x45 - */ -static bool default_handler(USBDriver *usbp) { - const USBDescriptor *dp; - - /* Decoding the request.*/ - switch ((((uint32_t)usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | - 800dca4: f003 027f and.w r2, r3, #127 ; 0x7f - USB_RTYPE_TYPE_MASK)) | - 800dca8: ea42 2605 orr.w r6, r2, r5, lsl #8 - */ -static bool default_handler(USBDriver *usbp) { - const USBDescriptor *dp; - - /* Decoding the request.*/ - switch ((((uint32_t)usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | - 800dcac: f5b6 7f40 cmp.w r6, #768 ; 0x300 - 800dcb0: f000 8100 beq.w 800deb4 <_usb_ep0setup+0x2b4> - 800dcb4: d917 bls.n 800dce6 <_usb_ep0setup+0xe6> - 800dcb6: f5b6 6fc0 cmp.w r6, #1536 ; 0x600 - 800dcba: f000 80e2 beq.w 800de82 <_usb_ep0setup+0x282> - 800dcbe: d977 bls.n 800ddb0 <_usb_ep0setup+0x1b0> - 800dcc0: f5b6 6f10 cmp.w r6, #2304 ; 0x900 - 800dcc4: f000 8087 beq.w 800ddd6 <_usb_ep0setup+0x1d6> - 800dcc8: f640 4202 movw r2, #3074 ; 0xc02 - 800dccc: 4296 cmp r6, r2 - 800dcce: f000 8104 beq.w 800deda <_usb_ep0setup+0x2da> - 800dcd2: f5b6 6f00 cmp.w r6, #2048 ; 0x800 - 800dcd6: d1d1 bne.n 800dc7c <_usb_ep0setup+0x7c> - usbSetupTransfer(usbp, (uint8_t *)dp->ud_string, dp->ud_size, NULL); - /*lint -restore*/ - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_GET_CONFIGURATION << 8): - /* Returning the last selected configuration.*/ - usbSetupTransfer(usbp, &usbp->configuration, 1, NULL); - 800dcd8: f104 024f add.w r2, r4, #79 ; 0x4f - 800dcdc: 2501 movs r5, #1 - 800dcde: 6427 str r7, [r4, #64] ; 0x40 - 800dce0: 63a2 str r2, [r4, #56] ; 0x38 - 800dce2: 63e5 str r5, [r4, #60] ; 0x3c - 800dce4: e79e b.n 800dc24 <_usb_ep0setup+0x24> - */ -static bool default_handler(USBDriver *usbp) { - const USBDescriptor *dp; - - /* Decoding the request.*/ - switch ((((uint32_t)usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | - 800dce6: 2e02 cmp r6, #2 - 800dce8: f000 80b4 beq.w 800de54 <_usb_ep0setup+0x254> - 800dcec: f240 80a9 bls.w 800de42 <_usb_ep0setup+0x242> - 800dcf0: f5b6 7f80 cmp.w r6, #256 ; 0x100 - 800dcf4: f000 8095 beq.w 800de22 <_usb_ep0setup+0x222> - 800dcf8: f5b6 7f81 cmp.w r6, #258 ; 0x102 - 800dcfc: d1be bne.n 800dc7c <_usb_ep0setup+0x7c> - return false; - } - } - case (uint32_t)USB_RTYPE_RECIPIENT_ENDPOINT | ((uint32_t)USB_REQ_CLEAR_FEATURE << 8): - /* Only ENDPOINT_HALT is handled as feature.*/ - if (usbp->setup[2] != USB_FEATURE_ENDPOINT_HALT) { - 800dcfe: f894 2046 ldrb.w r2, [r4, #70] ; 0x46 - 800dd02: 2a00 cmp r2, #0 - 800dd04: d1ba bne.n 800dc7c <_usb_ep0setup+0x7c> - return false; - } - /* Clearing the EP status, not valid for EP0, it is ignored in that case.*/ - if ((usbp->setup[4] & 0x0FU) != 0U) { - 800dd06: f894 2048 ldrb.w r2, [r4, #72] ; 0x48 - 800dd0a: f012 010f ands.w r1, r2, #15 - 800dd0e: d05d beq.n 800ddcc <_usb_ep0setup+0x1cc> - if ((usbp->setup[4] & 0x80U) != 0U) { - 800dd10: 0612 lsls r2, r2, #24 - usb_lld_clear_in(usbp, usbp->setup[4] & 0x0FU); - 800dd12: 4620 mov r0, r4 - if (usbp->setup[2] != USB_FEATURE_ENDPOINT_HALT) { - return false; - } - /* Clearing the EP status, not valid for EP0, it is ignored in that case.*/ - if ((usbp->setup[4] & 0x0FU) != 0U) { - if ((usbp->setup[4] & 0x80U) != 0U) { - 800dd14: f100 8109 bmi.w 800df2a <_usb_ep0setup+0x32a> - usb_lld_clear_in(usbp, usbp->setup[4] & 0x0FU); - } - else { - usb_lld_clear_out(usbp, usbp->setup[4] & 0x0FU); - 800dd18: f001 fdda bl 800f8d0 - 800dd1c: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800dd20: e054 b.n 800ddcc <_usb_ep0setup+0x1cc> - * @param[in] n transaction size - * - * @special - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800dd22: 699b ldr r3, [r3, #24] - else { - /* OUT phase.*/ - if (usbp->ep0n != 0U) { - /* Starts the receive phase.*/ - usbp->ep0state = USB_EP0_RX; - usbPrepareReceive(usbp, 0, usbp->ep0next, usbp->ep0n); - 800dd24: 6ba2 ldr r2, [r4, #56] ; 0x38 - * @special - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - - osp->rxqueued = false; - 800dd26: 2600 movs r6, #0 - } - else { - /* OUT phase.*/ - if (usbp->ep0n != 0U) { - /* Starts the receive phase.*/ - usbp->ep0state = USB_EP0_RX; - 800dd28: 2104 movs r1, #4 - 800dd2a: f884 1034 strb.w r1, [r4, #52] ; 0x34 - osp->rxqueued = false; - osp->mode.linear.rxbuf = buf; - osp->rxsize = n; - osp->rxcnt = 0; - - usb_lld_prepare_receive(usbp, ep); - 800dd2e: 4620 mov r0, r4 - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - - osp->rxqueued = false; - osp->mode.linear.rxbuf = buf; - 800dd30: 60da str r2, [r3, #12] - osp->rxsize = n; - 800dd32: 605d str r5, [r3, #4] - * @special - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - - osp->rxqueued = false; - 800dd34: 701e strb r6, [r3, #0] - osp->mode.linear.rxbuf = buf; - osp->rxsize = n; - osp->rxcnt = 0; - 800dd36: 609e str r6, [r3, #8] - - usb_lld_prepare_receive(usbp, ep); - 800dd38: 4631 mov r1, r6 - 800dd3a: f001 fbf1 bl 800f520 - 800dd3e: 2320 movs r3, #32 - 800dd40: f383 8811 msr BASEPRI, r3 - if (usbp->ep0n != 0U) { - /* Starts the receive phase.*/ - usbp->ep0state = USB_EP0_RX; - usbPrepareReceive(usbp, 0, usbp->ep0next, usbp->ep0n); - osalSysLockFromISR(); - (void) usbStartReceiveI(usbp, 0); - 800dd44: 4620 mov r0, r4 - 800dd46: 4631 mov r1, r6 - 800dd48: f7ff ff12 bl 800db70 - 800dd4c: f386 8811 msr BASEPRI, r6 - 800dd50: bdf8 pop {r3, r4, r5, r6, r7, pc} - if (usbp->ep0n > max) { - usbp->ep0n = max; - } - if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { - /* IN phase.*/ - if (usbp->ep0n != 0U) { - 800dd52: b1bd cbz r5, 800dd84 <_usb_ep0setup+0x184> - * - * @special - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800dd54: 695b ldr r3, [r3, #20] - if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { - /* IN phase.*/ - if (usbp->ep0n != 0U) { - /* Starts the transmit phase.*/ - usbp->ep0state = USB_EP0_TX; - usbPrepareTransmit(usbp, 0, usbp->ep0next, usbp->ep0n); - 800dd56: 6ba2 ldr r2, [r4, #56] ; 0x38 - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = false; - 800dd58: 2600 movs r6, #0 - } - if ((usbp->setup[0] & USB_RTYPE_DIR_MASK) == USB_RTYPE_DIR_DEV2HOST) { - /* IN phase.*/ - if (usbp->ep0n != 0U) { - /* Starts the transmit phase.*/ - usbp->ep0state = USB_EP0_TX; - 800dd5a: 2101 movs r1, #1 - 800dd5c: f884 1034 strb.w r1, [r4, #52] ; 0x34 - isp->txqueued = false; - isp->mode.linear.txbuf = buf; - isp->txsize = n; - isp->txcnt = 0; - - usb_lld_prepare_transmit(usbp, ep); - 800dd60: 4620 mov r0, r4 -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = false; - isp->mode.linear.txbuf = buf; - 800dd62: 60da str r2, [r3, #12] - isp->txsize = n; - 800dd64: 605d str r5, [r3, #4] - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = false; - 800dd66: 701e strb r6, [r3, #0] - isp->mode.linear.txbuf = buf; - isp->txsize = n; - isp->txcnt = 0; - 800dd68: 609e str r6, [r3, #8] - - usb_lld_prepare_transmit(usbp, ep); - 800dd6a: 4631 mov r1, r6 - 800dd6c: f001 fc58 bl 800f620 - 800dd70: 2320 movs r3, #32 - 800dd72: f383 8811 msr BASEPRI, r3 - if (usbp->ep0n != 0U) { - /* Starts the transmit phase.*/ - usbp->ep0state = USB_EP0_TX; - usbPrepareTransmit(usbp, 0, usbp->ep0next, usbp->ep0n); - osalSysLockFromISR(); - (void) usbStartTransmitI(usbp, 0); - 800dd76: 4620 mov r0, r4 - 800dd78: 4631 mov r1, r6 - 800dd7a: f7ff ff11 bl 800dba0 - 800dd7e: f386 8811 msr BASEPRI, r6 - 800dd82: bdf8 pop {r3, r4, r5, r6, r7, pc} - * @param[in] n transaction size - * - * @special - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800dd84: 699b ldr r3, [r3, #24] - osalSysUnlockFromISR(); - } - else { - /* No transmission phase, directly receiving the zero sized status - packet.*/ - usbp->ep0state = USB_EP0_WAITING_STS; - 800dd86: 2203 movs r2, #3 - 800dd88: f884 2034 strb.w r2, [r4, #52] ; 0x34 - osp->rxqueued = false; - osp->mode.linear.rxbuf = buf; - osp->rxsize = n; - osp->rxcnt = 0; - - usb_lld_prepare_receive(usbp, ep); - 800dd8c: 4620 mov r0, r4 - * @special - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - - osp->rxqueued = false; - 800dd8e: 701d strb r5, [r3, #0] - osp->mode.linear.rxbuf = buf; - 800dd90: 60dd str r5, [r3, #12] - osp->rxsize = n; - 800dd92: 605d str r5, [r3, #4] - osp->rxcnt = 0; - 800dd94: 609d str r5, [r3, #8] - - usb_lld_prepare_receive(usbp, ep); - 800dd96: 4629 mov r1, r5 - 800dd98: f001 fbc2 bl 800f520 - 800dd9c: 2320 movs r3, #32 - 800dd9e: f383 8811 msr BASEPRI, r3 - packet.*/ - usbp->ep0state = USB_EP0_WAITING_STS; -#if (USB_EP0_STATUS_STAGE == USB_EP0_STATUS_STAGE_SW) - usbPrepareReceive(usbp, 0, NULL, 0); - osalSysLockFromISR(); - (void) usbStartReceiveI(usbp, 0); - 800dda2: 4620 mov r0, r4 - 800dda4: 4629 mov r1, r5 - 800dda6: f7ff fee3 bl 800db70 - 800ddaa: f385 8811 msr BASEPRI, r5 - 800ddae: bdf8 pop {r3, r4, r5, r6, r7, pc} - */ -static bool default_handler(USBDriver *usbp) { - const USBDescriptor *dp; - - /* Decoding the request.*/ - switch ((((uint32_t)usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | - 800ddb0: f240 3202 movw r2, #770 ; 0x302 - 800ddb4: 4296 cmp r6, r2 - 800ddb6: d021 beq.n 800ddfc <_usb_ep0setup+0x1fc> - 800ddb8: f5b6 6fa0 cmp.w r6, #1280 ; 0x500 - 800ddbc: f47f af5e bne.w 800dc7c <_usb_ep0setup+0x7c> - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_SET_ADDRESS << 8): - /* The SET_ADDRESS handling can be performed here or postponed after - the status packed depending on the USB_SET_ADDRESS_MODE low - driver setting.*/ -#if USB_SET_ADDRESS_MODE == USB_EARLY_SET_ADDRESS - if ((usbp->setup[0] == USB_RTYPE_RECIPIENT_DEVICE) && - 800ddc0: f8b4 2044 ldrh.w r2, [r4, #68] ; 0x44 - 800ddc4: f5b2 6fa0 cmp.w r2, #1280 ; 0x500 - 800ddc8: f000 809d beq.w 800df06 <_usb_ep0setup+0x306> - } - else { - usb_lld_stall_out(usbp, usbp->setup[4] & 0x0FU); - } - } - usbSetupTransfer(usbp, NULL, 0, NULL); - 800ddcc: 2500 movs r5, #0 - 800ddce: 63a5 str r5, [r4, #56] ; 0x38 - 800ddd0: 63e5 str r5, [r4, #60] ; 0x3c - 800ddd2: 6425 str r5, [r4, #64] ; 0x40 - 800ddd4: e726 b.n 800dc24 <_usb_ep0setup+0x24> - /* Returning the last selected configuration.*/ - usbSetupTransfer(usbp, &usbp->configuration, 1, NULL); - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_SET_CONFIGURATION << 8): - /* Handling configuration selection from the host.*/ - usbp->configuration = usbp->setup[2]; - 800ddd6: f894 2046 ldrb.w r2, [r4, #70] ; 0x46 - 800ddda: f884 204f strb.w r2, [r4, #79] ; 0x4f - if (usbp->configuration == 0U) { - 800ddde: 2a00 cmp r2, #0 - 800dde0: f040 8082 bne.w 800dee8 <_usb_ep0setup+0x2e8> - usbp->state = USB_SELECTED; - 800dde4: 2203 movs r2, #3 - 800dde6: 7022 strb r2, [r4, #0] - } - else { - usbp->state = USB_ACTIVE; - } - _usb_isr_invoke_event_cb(usbp, USB_EVENT_CONFIGURED); - 800dde8: 6862 ldr r2, [r4, #4] - 800ddea: 6812 ldr r2, [r2, #0] - 800ddec: 2a00 cmp r2, #0 - 800ddee: d0ed beq.n 800ddcc <_usb_ep0setup+0x1cc> - 800ddf0: 4620 mov r0, r4 - 800ddf2: 2102 movs r1, #2 - 800ddf4: 4790 blx r2 - 800ddf6: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800ddfa: e7e7 b.n 800ddcc <_usb_ep0setup+0x1cc> - } - usbSetupTransfer(usbp, NULL, 0, NULL); - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_ENDPOINT | ((uint32_t)USB_REQ_SET_FEATURE << 8): - /* Only ENDPOINT_HALT is handled as feature.*/ - if (usbp->setup[2] != USB_FEATURE_ENDPOINT_HALT) { - 800ddfc: f894 2046 ldrb.w r2, [r4, #70] ; 0x46 - 800de00: 2a00 cmp r2, #0 - 800de02: f47f af3b bne.w 800dc7c <_usb_ep0setup+0x7c> - return false; - } - /* Stalling the EP, not valid for EP0, it is ignored in that case.*/ - if ((usbp->setup[4] & 0x0FU) != 0U) { - 800de06: f894 2048 ldrb.w r2, [r4, #72] ; 0x48 - 800de0a: f012 010f ands.w r1, r2, #15 - 800de0e: d0dd beq.n 800ddcc <_usb_ep0setup+0x1cc> - if ((usbp->setup[4] & 0x80U) != 0U) { - 800de10: 0613 lsls r3, r2, #24 - usb_lld_stall_in(usbp, usbp->setup[4] & 0x0FU); - 800de12: 4620 mov r0, r4 - if (usbp->setup[2] != USB_FEATURE_ENDPOINT_HALT) { - return false; - } - /* Stalling the EP, not valid for EP0, it is ignored in that case.*/ - if ((usbp->setup[4] & 0x0FU) != 0U) { - if ((usbp->setup[4] & 0x80U) != 0U) { - 800de14: f100 808e bmi.w 800df34 <_usb_ep0setup+0x334> - usb_lld_stall_in(usbp, usbp->setup[4] & 0x0FU); - } - else { - usb_lld_stall_out(usbp, usbp->setup[4] & 0x0FU); - 800de18: f001 fd3a bl 800f890 - 800de1c: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800de20: e7d4 b.n 800ddcc <_usb_ep0setup+0x1cc> - usbSetupTransfer(usbp, (uint8_t *)&usbp->status, 2, NULL); - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_CLEAR_FEATURE << 8): - /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature - number is handled as an error.*/ - if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - 800de22: f894 2046 ldrb.w r2, [r4, #70] ; 0x46 - 800de26: 2a01 cmp r2, #1 - 800de28: f47f af28 bne.w 800dc7c <_usb_ep0setup+0x7c> - usbp->status &= ~2U; - 800de2c: f8b4 204c ldrh.w r2, [r4, #76] ; 0x4c - usbSetupTransfer(usbp, NULL, 0, NULL); - 800de30: 63a7 str r7, [r4, #56] ; 0x38 - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_CLEAR_FEATURE << 8): - /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature - number is handled as an error.*/ - if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - usbp->status &= ~2U; - 800de32: f022 0202 bic.w r2, r2, #2 - usbSetupTransfer(usbp, NULL, 0, NULL); - 800de36: 63e7 str r7, [r4, #60] ; 0x3c - 800de38: 6427 str r7, [r4, #64] ; 0x40 - 800de3a: 463d mov r5, r7 - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_CLEAR_FEATURE << 8): - /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature - number is handled as an error.*/ - if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - usbp->status &= ~2U; - 800de3c: f8a4 204c strh.w r2, [r4, #76] ; 0x4c - 800de40: e6f0 b.n 800dc24 <_usb_ep0setup+0x24> - */ -static bool default_handler(USBDriver *usbp) { - const USBDescriptor *dp; - - /* Decoding the request.*/ - switch ((((uint32_t)usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | - 800de42: 2e00 cmp r6, #0 - 800de44: d146 bne.n 800ded4 <_usb_ep0setup+0x2d4> - USB_RTYPE_TYPE_MASK)) | - ((uint32_t)usbp->setup[1] << 8U))) { - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_GET_STATUS << 8): - /* Just returns the current status word.*/ - usbSetupTransfer(usbp, (uint8_t *)&usbp->status, 2, NULL); - 800de46: f104 024c add.w r2, r4, #76 ; 0x4c - 800de4a: 2502 movs r5, #2 - 800de4c: 6426 str r6, [r4, #64] ; 0x40 - 800de4e: 63a2 str r2, [r4, #56] ; 0x38 - 800de50: 63e5 str r5, [r4, #60] ; 0x3c - 800de52: e6e7 b.n 800dc24 <_usb_ep0setup+0x24> - usbSetupTransfer(usbp, (uint8_t *)zero_status, 2, NULL); - /*lint -restore*/ - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_ENDPOINT | ((uint32_t)USB_REQ_GET_STATUS << 8): - /* Sending the EP status.*/ - if ((usbp->setup[4] & 0x80U) != 0U) { - 800de54: f894 1048 ldrb.w r1, [r4, #72] ; 0x48 - 800de58: f011 0f80 tst.w r1, #128 ; 0x80 - switch (usb_lld_get_status_in(usbp, usbp->setup[4] & 0x0FU)) { - 800de5c: 4620 mov r0, r4 - 800de5e: f001 010f and.w r1, r1, #15 - usbSetupTransfer(usbp, (uint8_t *)zero_status, 2, NULL); - /*lint -restore*/ - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_ENDPOINT | ((uint32_t)USB_REQ_GET_STATUS << 8): - /* Sending the EP status.*/ - if ((usbp->setup[4] & 0x80U) != 0U) { - 800de62: d144 bne.n 800deee <_usb_ep0setup+0x2ee> - default: - return false; - } - } - else { - switch (usb_lld_get_status_out(usbp, usbp->setup[4] & 0x0FU)) { - 800de64: f001 fb2c bl 800f4c0 - 800de68: 2801 cmp r0, #1 - 800de6a: d044 beq.n 800def6 <_usb_ep0setup+0x2f6> - 800de6c: 2802 cmp r0, #2 - 800de6e: f47f af05 bne.w 800dc7c <_usb_ep0setup+0x7c> - usbSetupTransfer(usbp, (uint8_t *)halted_status, 2, NULL); - /*lint -restore*/ - return true; - case EP_STATUS_ACTIVE: - /*lint -save -e9005 [11.8] Removing const is fine.*/ - usbSetupTransfer(usbp, (uint8_t *)active_status, 2, NULL); - 800de72: 4b33 ldr r3, [pc, #204] ; (800df40 <_usb_ep0setup+0x340>) - 800de74: 63a3 str r3, [r4, #56] ; 0x38 - 800de76: 63e0 str r0, [r4, #60] ; 0x3c - 800de78: 6427 str r7, [r4, #64] ; 0x40 - 800de7a: 4605 mov r5, r0 - 800de7c: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800de80: e6d0 b.n 800dc24 <_usb_ep0setup+0x24> - usbSetupTransfer(usbp, NULL, 0, set_address); -#endif - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_GET_DESCRIPTOR << 8): - /* Handling descriptor requests from the host.*/ - dp = usbp->config->get_descriptor_cb(usbp, usbp->setup[3], - 800de82: 6862 ldr r2, [r4, #4] - -static uint16_t get_hword(uint8_t *p) { - uint16_t hw; - - hw = (uint16_t)*p++; - hw |= (uint16_t)*p << 8U; - 800de84: f894 0049 ldrb.w r0, [r4, #73] ; 0x49 - 800de88: f894 3048 ldrb.w r3, [r4, #72] ; 0x48 - usbSetupTransfer(usbp, NULL, 0, set_address); -#endif - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_GET_DESCRIPTOR << 8): - /* Handling descriptor requests from the host.*/ - dp = usbp->config->get_descriptor_cb(usbp, usbp->setup[3], - 800de8c: 6855 ldr r5, [r2, #4] - 800de8e: f894 1047 ldrb.w r1, [r4, #71] ; 0x47 - 800de92: f894 2046 ldrb.w r2, [r4, #70] ; 0x46 - 800de96: ea43 2300 orr.w r3, r3, r0, lsl #8 - 800de9a: 4620 mov r0, r4 - 800de9c: 47a8 blx r5 - usbp->setup[2], - get_hword(&usbp->setup[4])); - if (dp == NULL) { - 800de9e: 2800 cmp r0, #0 - 800dea0: f43f aeec beq.w 800dc7c <_usb_ep0setup+0x7c> - return false; - } - /*lint -save -e9005 [11.8] Removing const is fine.*/ - usbSetupTransfer(usbp, (uint8_t *)dp->ud_string, dp->ud_size, NULL); - 800dea4: 6843 ldr r3, [r0, #4] - 800dea6: 6805 ldr r5, [r0, #0] - 800dea8: 63e5 str r5, [r4, #60] ; 0x3c - 800deaa: 63a3 str r3, [r4, #56] ; 0x38 - 800deac: 6427 str r7, [r4, #64] ; 0x40 - 800deae: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800deb2: e6b7 b.n 800dc24 <_usb_ep0setup+0x24> - } - return false; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_SET_FEATURE << 8): - /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature - number is handled as an error.*/ - if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - 800deb4: f894 2046 ldrb.w r2, [r4, #70] ; 0x46 - 800deb8: 2a01 cmp r2, #1 - 800deba: f47f aedf bne.w 800dc7c <_usb_ep0setup+0x7c> - usbp->status |= 2U; - 800debe: f8b4 204c ldrh.w r2, [r4, #76] ; 0x4c - usbSetupTransfer(usbp, NULL, 0, NULL); - 800dec2: 63a7 str r7, [r4, #56] ; 0x38 - return false; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_SET_FEATURE << 8): - /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature - number is handled as an error.*/ - if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - usbp->status |= 2U; - 800dec4: f042 0202 orr.w r2, r2, #2 - usbSetupTransfer(usbp, NULL, 0, NULL); - 800dec8: 63e7 str r7, [r4, #60] ; 0x3c - 800deca: 6427 str r7, [r4, #64] ; 0x40 - 800decc: 463d mov r5, r7 - return false; - case (uint32_t)USB_RTYPE_RECIPIENT_DEVICE | ((uint32_t)USB_REQ_SET_FEATURE << 8): - /* Only the DEVICE_REMOTE_WAKEUP is handled here, any other feature - number is handled as an error.*/ - if (usbp->setup[2] == USB_FEATURE_DEVICE_REMOTE_WAKEUP) { - usbp->status |= 2U; - 800dece: f8a4 204c strh.w r2, [r4, #76] ; 0x4c - 800ded2: e6a7 b.n 800dc24 <_usb_ep0setup+0x24> - */ -static bool default_handler(USBDriver *usbp) { - const USBDescriptor *dp; - - /* Decoding the request.*/ - switch ((((uint32_t)usbp->setup[0] & (USB_RTYPE_RECIPIENT_MASK | - 800ded4: 2e01 cmp r6, #1 - 800ded6: f47f aed1 bne.w 800dc7c <_usb_ep0setup+0x7c> - case (uint32_t)USB_RTYPE_RECIPIENT_INTERFACE | ((uint32_t)USB_REQ_GET_STATUS << 8): - case (uint32_t)USB_RTYPE_RECIPIENT_ENDPOINT | ((uint32_t)USB_REQ_SYNCH_FRAME << 8): - /* Just sending two zero bytes, the application can change the behavior - using a hook..*/ - /*lint -save -e9005 [11.8] Removing const is fine.*/ - usbSetupTransfer(usbp, (uint8_t *)zero_status, 2, NULL); - 800deda: 4a1a ldr r2, [pc, #104] ; (800df44 <_usb_ep0setup+0x344>) - 800dedc: 63a2 str r2, [r4, #56] ; 0x38 - 800dede: 2502 movs r5, #2 - 800dee0: 2200 movs r2, #0 - 800dee2: 63e5 str r5, [r4, #60] ; 0x3c - 800dee4: 6422 str r2, [r4, #64] ; 0x40 - 800dee6: e69d b.n 800dc24 <_usb_ep0setup+0x24> - usbp->configuration = usbp->setup[2]; - if (usbp->configuration == 0U) { - usbp->state = USB_SELECTED; - } - else { - usbp->state = USB_ACTIVE; - 800dee8: 2204 movs r2, #4 - 800deea: 7022 strb r2, [r4, #0] - 800deec: e77c b.n 800dde8 <_usb_ep0setup+0x1e8> - /*lint -restore*/ - return true; - case (uint32_t)USB_RTYPE_RECIPIENT_ENDPOINT | ((uint32_t)USB_REQ_GET_STATUS << 8): - /* Sending the EP status.*/ - if ((usbp->setup[4] & 0x80U) != 0U) { - switch (usb_lld_get_status_in(usbp, usbp->setup[4] & 0x0FU)) { - 800deee: f001 faf7 bl 800f4e0 - 800def2: 2801 cmp r0, #1 - 800def4: d1ba bne.n 800de6c <_usb_ep0setup+0x26c> - } - else { - switch (usb_lld_get_status_out(usbp, usbp->setup[4] & 0x0FU)) { - case EP_STATUS_STALLED: - /*lint -save -e9005 [11.8] Removing const is fine.*/ - usbSetupTransfer(usbp, (uint8_t *)halted_status, 2, NULL); - 800def6: 4b14 ldr r3, [pc, #80] ; (800df48 <_usb_ep0setup+0x348>) - 800def8: 63a3 str r3, [r4, #56] ; 0x38 - 800defa: 63e6 str r6, [r4, #60] ; 0x3c - 800defc: 6427 str r7, [r4, #64] ; 0x40 - 800defe: 4635 mov r5, r6 - 800df00: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800df04: e68e b.n 800dc24 <_usb_ep0setup+0x24> - * - * @param[in] usbp pointer to the @p USBDriver object - */ -static void set_address(USBDriver *usbp) { - - usbp->address = usbp->setup[2]; - 800df06: f894 3046 ldrb.w r3, [r4, #70] ; 0x46 - 800df0a: f884 304e strb.w r3, [r4, #78] ; 0x4e - usb_lld_set_address(usbp); - 800df0e: 4620 mov r0, r4 - 800df10: f001 fa16 bl 800f340 - _usb_isr_invoke_event_cb(usbp, USB_EVENT_ADDRESS); - 800df14: 6863 ldr r3, [r4, #4] - 800df16: 681b ldr r3, [r3, #0] - 800df18: b113 cbz r3, 800df20 <_usb_ep0setup+0x320> - 800df1a: 4620 mov r0, r4 - 800df1c: 2101 movs r1, #1 - 800df1e: 4798 blx r3 - usbp->state = USB_SELECTED; - 800df20: 2203 movs r2, #3 - 800df22: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800df26: 7022 strb r2, [r4, #0] - 800df28: e750 b.n 800ddcc <_usb_ep0setup+0x1cc> - return false; - } - /* Clearing the EP status, not valid for EP0, it is ignored in that case.*/ - if ((usbp->setup[4] & 0x0FU) != 0U) { - if ((usbp->setup[4] & 0x80U) != 0U) { - usb_lld_clear_in(usbp, usbp->setup[4] & 0x0FU); - 800df2a: f001 fce1 bl 800f8f0 - 800df2e: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800df32: e74b b.n 800ddcc <_usb_ep0setup+0x1cc> - return false; - } - /* Stalling the EP, not valid for EP0, it is ignored in that case.*/ - if ((usbp->setup[4] & 0x0FU) != 0U) { - if ((usbp->setup[4] & 0x80U) != 0U) { - usb_lld_stall_in(usbp, usbp->setup[4] & 0x0FU); - 800df34: f001 fcbc bl 800f8b0 - 800df38: f894 3044 ldrb.w r3, [r4, #68] ; 0x44 - 800df3c: e746 b.n 800ddcc <_usb_ep0setup+0x1cc> - 800df3e: bf00 nop - 800df40: 080131e0 .word 0x080131e0 - 800df44: 080131d0 .word 0x080131d0 - 800df48: 080131f0 .word 0x080131f0 - 800df4c: f3af 8000 nop.w - -0800df50 <_usb_ep0in>: - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number, always zero - * - * @notapi - */ -void _usb_ep0in(USBDriver *usbp, usbep_t ep) { - 800df50: b538 push {r3, r4, r5, lr} - size_t max; - - (void)ep; - switch (usbp->ep0state) { - 800df52: f890 3034 ldrb.w r3, [r0, #52] ; 0x34 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number, always zero - * - * @notapi - */ -void _usb_ep0in(USBDriver *usbp, usbep_t ep) { - 800df56: 4604 mov r4, r0 - size_t max; - - (void)ep; - switch (usbp->ep0state) { - 800df58: 2b06 cmp r3, #6 - 800df5a: d815 bhi.n 800df88 <_usb_ep0in+0x38> - 800df5c: e8df f003 tbb [pc, r3] - 800df60: 041c3404 .word 0x041c3404 - 800df64: 1504 .short 0x1504 - 800df66: 04 .byte 0x04 - 800df67: 00 .byte 0x00 - /* Falling through is intentional.*/ - case USB_EP0_ERROR: - /* Error response, the state machine goes into an error state, the low - level layer will have to reset it to USB_EP0_WAITING_SETUP after - receiving a SETUP packet.*/ - usb_lld_stall_in(usbp, 0); - 800df68: 2100 movs r1, #0 - 800df6a: f001 fca1 bl 800f8b0 - usb_lld_stall_out(usbp, 0); - 800df6e: 4620 mov r0, r4 - 800df70: 2100 movs r1, #0 - 800df72: f001 fc8d bl 800f890 - _usb_isr_invoke_event_cb(usbp, USB_EVENT_STALLED); - 800df76: 6863 ldr r3, [r4, #4] - 800df78: 681b ldr r3, [r3, #0] - 800df7a: b113 cbz r3, 800df82 <_usb_ep0in+0x32> - 800df7c: 4620 mov r0, r4 - 800df7e: 2105 movs r1, #5 - 800df80: 4798 blx r3 - usbp->ep0state = USB_EP0_ERROR; - 800df82: 2306 movs r3, #6 - 800df84: f884 3034 strb.w r3, [r4, #52] ; 0x34 - 800df88: bd38 pop {r3, r4, r5, pc} - usb_lld_end_setup(usbp, ep); -#endif - return; - case USB_EP0_SENDING_STS: - /* Status packet sent, invoking the callback if defined.*/ - if (usbp->ep0endcb != NULL) { - 800df8a: 6c03 ldr r3, [r0, #64] ; 0x40 - 800df8c: b103 cbz r3, 800df90 <_usb_ep0in+0x40> - usbp->ep0endcb(usbp); - 800df8e: 4798 blx r3 - } - usbp->ep0state = USB_EP0_WAITING_SETUP; - 800df90: 2300 movs r3, #0 - 800df92: f884 3034 strb.w r3, [r4, #52] ; 0x34 - return; - 800df96: bd38 pop {r3, r4, r5, pc} - 800df98: 68c3 ldr r3, [r0, #12] - * @param[in] n transaction size - * - * @special - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800df9a: 699b ldr r3, [r3, #24] - - osp->rxqueued = false; - 800df9c: 2500 movs r5, #0 - return; - } - /* Falls into, it is intentional.*/ - case USB_EP0_WAITING_TX0: - /* Transmit phase over, receiving the zero sized status packet.*/ - usbp->ep0state = USB_EP0_WAITING_STS; - 800df9e: 2203 movs r2, #3 - 800dfa0: f884 2034 strb.w r2, [r4, #52] ; 0x34 - osp->rxqueued = false; - osp->mode.linear.rxbuf = buf; - osp->rxsize = n; - osp->rxcnt = 0; - - usb_lld_prepare_receive(usbp, ep); - 800dfa4: 4629 mov r1, r5 - * @special - */ -void usbPrepareReceive(USBDriver *usbp, usbep_t ep, uint8_t *buf, size_t n) { - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - - osp->rxqueued = false; - 800dfa6: 701d strb r5, [r3, #0] - osp->mode.linear.rxbuf = buf; - 800dfa8: 60dd str r5, [r3, #12] - osp->rxsize = n; - 800dfaa: 605d str r5, [r3, #4] - osp->rxcnt = 0; - 800dfac: 609d str r5, [r3, #8] - - usb_lld_prepare_receive(usbp, ep); - 800dfae: 4620 mov r0, r4 - 800dfb0: f001 fab6 bl 800f520 - 800dfb4: 2320 movs r3, #32 - 800dfb6: f383 8811 msr BASEPRI, r3 - /* Transmit phase over, receiving the zero sized status packet.*/ - usbp->ep0state = USB_EP0_WAITING_STS; -#if (USB_EP0_STATUS_STAGE == USB_EP0_STATUS_STAGE_SW) - usbPrepareReceive(usbp, 0, NULL, 0); - osalSysLockFromISR(); - (void) usbStartReceiveI(usbp, 0); - 800dfba: 4620 mov r0, r4 - 800dfbc: 4629 mov r1, r5 - 800dfbe: f7ff fdd7 bl 800db70 - 800dfc2: f385 8811 msr BASEPRI, r5 - 800dfc6: bd38 pop {r3, r4, r5, pc} - -static uint16_t get_hword(uint8_t *p) { - uint16_t hw; - - hw = (uint16_t)*p++; - hw |= (uint16_t)*p << 8U; - 800dfc8: f890 204b ldrb.w r2, [r0, #75] ; 0x4b - 800dfcc: f890 304a ldrb.w r3, [r0, #74] ; 0x4a - case USB_EP0_TX: - max = (size_t)get_hword(&usbp->setup[6]); - /* If the transmitted size is less than the requested size and it is a - multiple of the maximum packet size then a zero size packet must be - transmitted.*/ - if ((usbp->ep0n < max) && - 800dfd0: 6bc1 ldr r1, [r0, #60] ; 0x3c - size_t max; - - (void)ep; - switch (usbp->ep0state) { - case USB_EP0_TX: - max = (size_t)get_hword(&usbp->setup[6]); - 800dfd2: ea43 2302 orr.w r3, r3, r2, lsl #8 - /* If the transmitted size is less than the requested size and it is a - multiple of the maximum packet size then a zero size packet must be - transmitted.*/ - if ((usbp->ep0n < max) && - 800dfd6: 428b cmp r3, r1 - ((usbp->ep0n % usbp->epc[0]->in_maxsize) == 0U)) { - 800dfd8: 68c3 ldr r3, [r0, #12] - case USB_EP0_TX: - max = (size_t)get_hword(&usbp->setup[6]); - /* If the transmitted size is less than the requested size and it is a - multiple of the maximum packet size then a zero size packet must be - transmitted.*/ - if ((usbp->ep0n < max) && - 800dfda: d9de bls.n 800df9a <_usb_ep0in+0x4a> - ((usbp->ep0n % usbp->epc[0]->in_maxsize) == 0U)) { - 800dfdc: 8a1d ldrh r5, [r3, #16] - 800dfde: fbb1 f2f5 udiv r2, r1, r5 - 800dfe2: fb05 1512 mls r5, r5, r2, r1 - case USB_EP0_TX: - max = (size_t)get_hword(&usbp->setup[6]); - /* If the transmitted size is less than the requested size and it is a - multiple of the maximum packet size then a zero size packet must be - transmitted.*/ - if ((usbp->ep0n < max) && - 800dfe6: 2d00 cmp r5, #0 - 800dfe8: d1d7 bne.n 800df9a <_usb_ep0in+0x4a> - * - * @special - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800dfea: 695b ldr r3, [r3, #20] - isp->txqueued = false; - isp->mode.linear.txbuf = buf; - isp->txsize = n; - isp->txcnt = 0; - - usb_lld_prepare_transmit(usbp, ep); - 800dfec: 4629 mov r1, r5 - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = false; - 800dfee: 701d strb r5, [r3, #0] - isp->mode.linear.txbuf = buf; - 800dff0: 60dd str r5, [r3, #12] - isp->txsize = n; - 800dff2: 605d str r5, [r3, #4] - isp->txcnt = 0; - 800dff4: 609d str r5, [r3, #8] - - usb_lld_prepare_transmit(usbp, ep); - 800dff6: f001 fb13 bl 800f620 - 800dffa: 2320 movs r3, #32 - 800dffc: f383 8811 msr BASEPRI, r3 - transmitted.*/ - if ((usbp->ep0n < max) && - ((usbp->ep0n % usbp->epc[0]->in_maxsize) == 0U)) { - usbPrepareTransmit(usbp, 0, NULL, 0); - osalSysLockFromISR(); - (void) usbStartTransmitI(usbp, 0); - 800e000: 4620 mov r0, r4 - 800e002: 4629 mov r1, r5 - 800e004: f7ff fdcc bl 800dba0 - 800e008: f385 8811 msr BASEPRI, r5 - osalSysUnlockFromISR(); - usbp->ep0state = USB_EP0_WAITING_TX0; - 800e00c: 2302 movs r3, #2 - 800e00e: f884 3034 strb.w r3, [r4, #52] ; 0x34 - return; - 800e012: bd38 pop {r3, r4, r5, pc} - 800e014: f3af 8000 nop.w - 800e018: f3af 8000 nop.w - 800e01c: f3af 8000 nop.w - -0800e020 <_usb_ep0out>: - * @notapi - */ -void _usb_ep0out(USBDriver *usbp, usbep_t ep) { - - (void)ep; - switch (usbp->ep0state) { - 800e020: f890 2034 ldrb.w r2, [r0, #52] ; 0x34 - 800e024: 2a06 cmp r2, #6 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number, always zero - * - * @notapi - */ -void _usb_ep0out(USBDriver *usbp, usbep_t ep) { - 800e026: b538 push {r3, r4, r5, lr} - 800e028: d80a bhi.n 800e040 <_usb_ep0out+0x20> - 800e02a: 2301 movs r3, #1 - 800e02c: 4093 lsls r3, r2 - 800e02e: f013 0f67 tst.w r3, #103 ; 0x67 - 800e032: 4604 mov r4, r0 - 800e034: d111 bne.n 800e05a <_usb_ep0out+0x3a> - 800e036: f013 0508 ands.w r5, r3, #8 - 800e03a: d102 bne.n 800e042 <_usb_ep0out+0x22> - 800e03c: 06db lsls r3, r3, #27 - 800e03e: d41d bmi.n 800e07c <_usb_ep0out+0x5c> - 800e040: bd38 pop {r3, r4, r5, pc} - return; - case USB_EP0_WAITING_STS: - /* Status packet received, it must be zero sized, invoking the callback - if defined.*/ -#if (USB_EP0_STATUS_STAGE == USB_EP0_STATUS_STAGE_SW) - if (usbGetReceiveTransactionSizeI(usbp, 0) != 0U) { - 800e042: 68c3 ldr r3, [r0, #12] - 800e044: 699b ldr r3, [r3, #24] - 800e046: 689b ldr r3, [r3, #8] - 800e048: 2b00 cmp r3, #0 - 800e04a: d1f9 bne.n 800e040 <_usb_ep0out+0x20> - break; - } -#endif - if (usbp->ep0endcb != NULL) { - 800e04c: 6c03 ldr r3, [r0, #64] ; 0x40 - 800e04e: b103 cbz r3, 800e052 <_usb_ep0out+0x32> - usbp->ep0endcb(usbp); - 800e050: 4798 blx r3 - } - usbp->ep0state = USB_EP0_WAITING_SETUP; - 800e052: 2300 movs r3, #0 - 800e054: f884 3034 strb.w r3, [r4, #52] ; 0x34 - return; - 800e058: bd38 pop {r3, r4, r5, pc} - /* Falling through is intentional.*/ - case USB_EP0_ERROR: - /* Error response, the state machine goes into an error state, the low - level layer will have to reset it to USB_EP0_WAITING_SETUP after - receiving a SETUP packet.*/ - usb_lld_stall_in(usbp, 0); - 800e05a: 2100 movs r1, #0 - 800e05c: f001 fc28 bl 800f8b0 - usb_lld_stall_out(usbp, 0); - 800e060: 4620 mov r0, r4 - 800e062: 2100 movs r1, #0 - 800e064: f001 fc14 bl 800f890 - _usb_isr_invoke_event_cb(usbp, USB_EVENT_STALLED); - 800e068: 6863 ldr r3, [r4, #4] - 800e06a: 681b ldr r3, [r3, #0] - 800e06c: b113 cbz r3, 800e074 <_usb_ep0out+0x54> - 800e06e: 4620 mov r0, r4 - 800e070: 2105 movs r1, #5 - 800e072: 4798 blx r3 - usbp->ep0state = USB_EP0_ERROR; - 800e074: 2306 movs r3, #6 - 800e076: f884 3034 strb.w r3, [r4, #52] ; 0x34 - 800e07a: bd38 pop {r3, r4, r5, pc} - * - * @special - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800e07c: 68c3 ldr r3, [r0, #12] - 800e07e: 695b ldr r3, [r3, #20] - - (void)ep; - switch (usbp->ep0state) { - case USB_EP0_RX: - /* Receive phase over, sending the zero sized status packet.*/ - usbp->ep0state = USB_EP0_SENDING_STS; - 800e080: 2205 movs r2, #5 - 800e082: f880 2034 strb.w r2, [r0, #52] ; 0x34 - isp->txqueued = false; - isp->mode.linear.txbuf = buf; - isp->txsize = n; - isp->txcnt = 0; - - usb_lld_prepare_transmit(usbp, ep); - 800e086: 4629 mov r1, r5 - */ -void usbPrepareTransmit(USBDriver *usbp, usbep_t ep, - const uint8_t *buf, size_t n) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - - isp->txqueued = false; - 800e088: 701d strb r5, [r3, #0] - isp->mode.linear.txbuf = buf; - 800e08a: 60dd str r5, [r3, #12] - isp->txsize = n; - 800e08c: 605d str r5, [r3, #4] - isp->txcnt = 0; - 800e08e: 609d str r5, [r3, #8] - - usb_lld_prepare_transmit(usbp, ep); - 800e090: f001 fac6 bl 800f620 - 800e094: 2320 movs r3, #32 - 800e096: f383 8811 msr BASEPRI, r3 - /* Receive phase over, sending the zero sized status packet.*/ - usbp->ep0state = USB_EP0_SENDING_STS; -#if (USB_EP0_STATUS_STAGE == USB_EP0_STATUS_STAGE_SW) - usbPrepareTransmit(usbp, 0, NULL, 0); - osalSysLockFromISR(); - (void) usbStartTransmitI(usbp, 0); - 800e09a: 4620 mov r0, r4 - 800e09c: 4629 mov r1, r5 - 800e09e: f7ff fd7f bl 800dba0 - 800e0a2: f385 8811 msr BASEPRI, r5 - 800e0a6: bd38 pop {r3, r4, r5, pc} - 800e0a8: f3af 8000 nop.w - 800e0ac: f3af 8000 nop.w - -0800e0b0 : - * @param[in] prio the interrupt priority - */ -void nvicEnableVector(uint32_t n, uint32_t prio) { - - NVIC->IP[n] = NVIC_PRIORITY_MASK(prio); - NVIC->ICPR[n >> 5] = 1 << (n & 0x1F); - 800e0b0: 0943 lsrs r3, r0, #5 - 800e0b2: 009b lsls r3, r3, #2 - * @brief Sets the priority of an interrupt handler and enables it. - * - * @param[in] n the interrupt number - * @param[in] prio the interrupt priority - */ -void nvicEnableVector(uint32_t n, uint32_t prio) { - 800e0b4: b410 push {r4} - 800e0b6: f103 4360 add.w r3, r3, #3758096384 ; 0xe0000000 - - NVIC->IP[n] = NVIC_PRIORITY_MASK(prio); - 800e0ba: f100 4460 add.w r4, r0, #3758096384 ; 0xe0000000 - 800e0be: f504 4461 add.w r4, r4, #57600 ; 0xe100 - 800e0c2: f503 4361 add.w r3, r3, #57600 ; 0xe100 - 800e0c6: 0109 lsls r1, r1, #4 - NVIC->ICPR[n >> 5] = 1 << (n & 0x1F); - 800e0c8: f000 001f and.w r0, r0, #31 - 800e0cc: 2201 movs r2, #1 - 800e0ce: 4082 lsls r2, r0 - * @param[in] n the interrupt number - * @param[in] prio the interrupt priority - */ -void nvicEnableVector(uint32_t n, uint32_t prio) { - - NVIC->IP[n] = NVIC_PRIORITY_MASK(prio); - 800e0d0: b2c9 uxtb r1, r1 - 800e0d2: f884 1300 strb.w r1, [r4, #768] ; 0x300 - NVIC->ICPR[n >> 5] = 1 << (n & 0x1F); - 800e0d6: f8c3 2180 str.w r2, [r3, #384] ; 0x180 - NVIC->ISER[n >> 5] = 1 << (n & 0x1F); - 800e0da: 601a str r2, [r3, #0] -} - 800e0dc: f85d 4b04 ldr.w r4, [sp], #4 - 800e0e0: 4770 bx lr - 800e0e2: bf00 nop - 800e0e4: f3af 8000 nop.w - 800e0e8: f3af 8000 nop.w - 800e0ec: f3af 8000 nop.w - -0800e0f0 : - */ -void nvicSetSystemHandlerPriority(uint32_t handler, uint32_t prio) { - - osalDbgCheck(handler <= 12); - - SCB->SHP[handler] = NVIC_PRIORITY_MASK(prio); - 800e0f0: f100 4060 add.w r0, r0, #3758096384 ; 0xe0000000 - 800e0f4: f500 406d add.w r0, r0, #60672 ; 0xed00 - 800e0f8: 0109 lsls r1, r1, #4 - 800e0fa: b2c9 uxtb r1, r1 - 800e0fc: 7601 strb r1, [r0, #24] - 800e0fe: 4770 bx lr - -0800e100 : -/** - * @brief DMA1 stream 0 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector6C) { - 800e100: b508 push {r3, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 0) & STM32_DMA_ISR_MASK; - 800e102: 4b07 ldr r3, [pc, #28] ; (800e120 ) - DMA1->LIFCR = flags << 0; - if (dma_isr_redir[0].dma_func) - 800e104: 4a07 ldr r2, [pc, #28] ; (800e124 ) -OSAL_IRQ_HANDLER(Vector6C) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 0) & STM32_DMA_ISR_MASK; - 800e106: 6819 ldr r1, [r3, #0] - 800e108: f001 013d and.w r1, r1, #61 ; 0x3d - DMA1->LIFCR = flags << 0; - 800e10c: 6099 str r1, [r3, #8] - if (dma_isr_redir[0].dma_func) - 800e10e: 6813 ldr r3, [r2, #0] - 800e110: b10b cbz r3, 800e116 - dma_isr_redir[0].dma_func(dma_isr_redir[0].dma_param, flags); - 800e112: 6850 ldr r0, [r2, #4] - 800e114: 4798 blx r3 - - OSAL_IRQ_EPILOGUE(); -} - 800e116: e8bd 4008 ldmia.w sp!, {r3, lr} - flags = (DMA1->LISR >> 0) & STM32_DMA_ISR_MASK; - DMA1->LIFCR = flags << 0; - if (dma_isr_redir[0].dma_func) - dma_isr_redir[0].dma_func(dma_isr_redir[0].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e11a: f7ff ba49 b.w 800d5b0 <_port_irq_epilogue> - 800e11e: bf00 nop - 800e120: 40026000 .word 0x40026000 - 800e124: 20000ec0 .word 0x20000ec0 - 800e128: f3af 8000 nop.w - 800e12c: f3af 8000 nop.w - -0800e130 : -OSAL_IRQ_HANDLER(Vector70) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 6) & STM32_DMA_ISR_MASK; - 800e130: 4b08 ldr r3, [pc, #32] ; (800e154 ) - DMA1->LIFCR = flags << 6; - if (dma_isr_redir[1].dma_func) - 800e132: 4809 ldr r0, [pc, #36] ; (800e158 ) -OSAL_IRQ_HANDLER(Vector70) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 6) & STM32_DMA_ISR_MASK; - 800e134: 6819 ldr r1, [r3, #0] - DMA1->LIFCR = flags << 6; - if (dma_isr_redir[1].dma_func) - 800e136: 6882 ldr r2, [r0, #8] -OSAL_IRQ_HANDLER(Vector70) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 6) & STM32_DMA_ISR_MASK; - 800e138: 0989 lsrs r1, r1, #6 - 800e13a: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA1 stream 1 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector70) { - 800e13e: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 6) & STM32_DMA_ISR_MASK; - DMA1->LIFCR = flags << 6; - 800e140: 018c lsls r4, r1, #6 - 800e142: 609c str r4, [r3, #8] - if (dma_isr_redir[1].dma_func) - 800e144: b10a cbz r2, 800e14a - dma_isr_redir[1].dma_func(dma_isr_redir[1].dma_param, flags); - 800e146: 68c0 ldr r0, [r0, #12] - 800e148: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e14a: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA1->LISR >> 6) & STM32_DMA_ISR_MASK; - DMA1->LIFCR = flags << 6; - if (dma_isr_redir[1].dma_func) - dma_isr_redir[1].dma_func(dma_isr_redir[1].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e14e: f7ff ba2f b.w 800d5b0 <_port_irq_epilogue> - 800e152: bf00 nop - 800e154: 40026000 .word 0x40026000 - 800e158: 20000ec0 .word 0x20000ec0 - 800e15c: f3af 8000 nop.w - -0800e160 : -OSAL_IRQ_HANDLER(Vector74) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 16) & STM32_DMA_ISR_MASK; - 800e160: 4b08 ldr r3, [pc, #32] ; (800e184 ) - DMA1->LIFCR = flags << 16; - if (dma_isr_redir[2].dma_func) - 800e162: 4809 ldr r0, [pc, #36] ; (800e188 ) -OSAL_IRQ_HANDLER(Vector74) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 16) & STM32_DMA_ISR_MASK; - 800e164: 6819 ldr r1, [r3, #0] - DMA1->LIFCR = flags << 16; - if (dma_isr_redir[2].dma_func) - 800e166: 6902 ldr r2, [r0, #16] -OSAL_IRQ_HANDLER(Vector74) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 16) & STM32_DMA_ISR_MASK; - 800e168: 0c09 lsrs r1, r1, #16 - 800e16a: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA1 stream 2 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector74) { - 800e16e: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 16) & STM32_DMA_ISR_MASK; - DMA1->LIFCR = flags << 16; - 800e170: 040c lsls r4, r1, #16 - 800e172: 609c str r4, [r3, #8] - if (dma_isr_redir[2].dma_func) - 800e174: b10a cbz r2, 800e17a - dma_isr_redir[2].dma_func(dma_isr_redir[2].dma_param, flags); - 800e176: 6940 ldr r0, [r0, #20] - 800e178: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e17a: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA1->LISR >> 16) & STM32_DMA_ISR_MASK; - DMA1->LIFCR = flags << 16; - if (dma_isr_redir[2].dma_func) - dma_isr_redir[2].dma_func(dma_isr_redir[2].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e17e: f7ff ba17 b.w 800d5b0 <_port_irq_epilogue> - 800e182: bf00 nop - 800e184: 40026000 .word 0x40026000 - 800e188: 20000ec0 .word 0x20000ec0 - 800e18c: f3af 8000 nop.w - -0800e190 : -OSAL_IRQ_HANDLER(Vector78) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 22) & STM32_DMA_ISR_MASK; - 800e190: 4b08 ldr r3, [pc, #32] ; (800e1b4 ) - DMA1->LIFCR = flags << 22; - if (dma_isr_redir[3].dma_func) - 800e192: 4809 ldr r0, [pc, #36] ; (800e1b8 ) -OSAL_IRQ_HANDLER(Vector78) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 22) & STM32_DMA_ISR_MASK; - 800e194: 6819 ldr r1, [r3, #0] - DMA1->LIFCR = flags << 22; - if (dma_isr_redir[3].dma_func) - 800e196: 6982 ldr r2, [r0, #24] -OSAL_IRQ_HANDLER(Vector78) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 22) & STM32_DMA_ISR_MASK; - 800e198: 0d89 lsrs r1, r1, #22 - 800e19a: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA1 stream 3 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector78) { - 800e19e: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->LISR >> 22) & STM32_DMA_ISR_MASK; - DMA1->LIFCR = flags << 22; - 800e1a0: 058c lsls r4, r1, #22 - 800e1a2: 609c str r4, [r3, #8] - if (dma_isr_redir[3].dma_func) - 800e1a4: b10a cbz r2, 800e1aa - dma_isr_redir[3].dma_func(dma_isr_redir[3].dma_param, flags); - 800e1a6: 69c0 ldr r0, [r0, #28] - 800e1a8: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e1aa: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA1->LISR >> 22) & STM32_DMA_ISR_MASK; - DMA1->LIFCR = flags << 22; - if (dma_isr_redir[3].dma_func) - dma_isr_redir[3].dma_func(dma_isr_redir[3].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e1ae: f7ff b9ff b.w 800d5b0 <_port_irq_epilogue> - 800e1b2: bf00 nop - 800e1b4: 40026000 .word 0x40026000 - 800e1b8: 20000ec0 .word 0x20000ec0 - 800e1bc: f3af 8000 nop.w - -0800e1c0 : -/** - * @brief DMA1 stream 4 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector7C) { - 800e1c0: b508 push {r3, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 0) & STM32_DMA_ISR_MASK; - 800e1c2: 4b07 ldr r3, [pc, #28] ; (800e1e0 ) - DMA1->HIFCR = flags << 0; - if (dma_isr_redir[4].dma_func) - 800e1c4: 4807 ldr r0, [pc, #28] ; (800e1e4 ) -OSAL_IRQ_HANDLER(Vector7C) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 0) & STM32_DMA_ISR_MASK; - 800e1c6: 6859 ldr r1, [r3, #4] - DMA1->HIFCR = flags << 0; - if (dma_isr_redir[4].dma_func) - 800e1c8: 6a02 ldr r2, [r0, #32] -OSAL_IRQ_HANDLER(Vector7C) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 0) & STM32_DMA_ISR_MASK; - 800e1ca: f001 013d and.w r1, r1, #61 ; 0x3d - DMA1->HIFCR = flags << 0; - 800e1ce: 60d9 str r1, [r3, #12] - if (dma_isr_redir[4].dma_func) - 800e1d0: b10a cbz r2, 800e1d6 - dma_isr_redir[4].dma_func(dma_isr_redir[4].dma_param, flags); - 800e1d2: 6a40 ldr r0, [r0, #36] ; 0x24 - 800e1d4: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e1d6: e8bd 4008 ldmia.w sp!, {r3, lr} - flags = (DMA1->HISR >> 0) & STM32_DMA_ISR_MASK; - DMA1->HIFCR = flags << 0; - if (dma_isr_redir[4].dma_func) - dma_isr_redir[4].dma_func(dma_isr_redir[4].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e1da: f7ff b9e9 b.w 800d5b0 <_port_irq_epilogue> - 800e1de: bf00 nop - 800e1e0: 40026000 .word 0x40026000 - 800e1e4: 20000ec0 .word 0x20000ec0 - 800e1e8: f3af 8000 nop.w - 800e1ec: f3af 8000 nop.w - -0800e1f0 : -OSAL_IRQ_HANDLER(Vector80) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 6) & STM32_DMA_ISR_MASK; - 800e1f0: 4b08 ldr r3, [pc, #32] ; (800e214 ) - DMA1->HIFCR = flags << 6; - if (dma_isr_redir[5].dma_func) - 800e1f2: 4809 ldr r0, [pc, #36] ; (800e218 ) -OSAL_IRQ_HANDLER(Vector80) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 6) & STM32_DMA_ISR_MASK; - 800e1f4: 6859 ldr r1, [r3, #4] - DMA1->HIFCR = flags << 6; - if (dma_isr_redir[5].dma_func) - 800e1f6: 6a82 ldr r2, [r0, #40] ; 0x28 -OSAL_IRQ_HANDLER(Vector80) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 6) & STM32_DMA_ISR_MASK; - 800e1f8: 0989 lsrs r1, r1, #6 - 800e1fa: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA1 stream 5 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector80) { - 800e1fe: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 6) & STM32_DMA_ISR_MASK; - DMA1->HIFCR = flags << 6; - 800e200: 018c lsls r4, r1, #6 - 800e202: 60dc str r4, [r3, #12] - if (dma_isr_redir[5].dma_func) - 800e204: b10a cbz r2, 800e20a - dma_isr_redir[5].dma_func(dma_isr_redir[5].dma_param, flags); - 800e206: 6ac0 ldr r0, [r0, #44] ; 0x2c - 800e208: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e20a: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA1->HISR >> 6) & STM32_DMA_ISR_MASK; - DMA1->HIFCR = flags << 6; - if (dma_isr_redir[5].dma_func) - dma_isr_redir[5].dma_func(dma_isr_redir[5].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e20e: f7ff b9cf b.w 800d5b0 <_port_irq_epilogue> - 800e212: bf00 nop - 800e214: 40026000 .word 0x40026000 - 800e218: 20000ec0 .word 0x20000ec0 - 800e21c: f3af 8000 nop.w - -0800e220 : -OSAL_IRQ_HANDLER(Vector84) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 16) & STM32_DMA_ISR_MASK; - 800e220: 4b08 ldr r3, [pc, #32] ; (800e244 ) - DMA1->HIFCR = flags << 16; - if (dma_isr_redir[6].dma_func) - 800e222: 4809 ldr r0, [pc, #36] ; (800e248 ) -OSAL_IRQ_HANDLER(Vector84) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 16) & STM32_DMA_ISR_MASK; - 800e224: 6859 ldr r1, [r3, #4] - DMA1->HIFCR = flags << 16; - if (dma_isr_redir[6].dma_func) - 800e226: 6b02 ldr r2, [r0, #48] ; 0x30 -OSAL_IRQ_HANDLER(Vector84) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 16) & STM32_DMA_ISR_MASK; - 800e228: 0c09 lsrs r1, r1, #16 - 800e22a: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA1 stream 6 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector84) { - 800e22e: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 16) & STM32_DMA_ISR_MASK; - DMA1->HIFCR = flags << 16; - 800e230: 040c lsls r4, r1, #16 - 800e232: 60dc str r4, [r3, #12] - if (dma_isr_redir[6].dma_func) - 800e234: b10a cbz r2, 800e23a - dma_isr_redir[6].dma_func(dma_isr_redir[6].dma_param, flags); - 800e236: 6b40 ldr r0, [r0, #52] ; 0x34 - 800e238: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e23a: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA1->HISR >> 16) & STM32_DMA_ISR_MASK; - DMA1->HIFCR = flags << 16; - if (dma_isr_redir[6].dma_func) - dma_isr_redir[6].dma_func(dma_isr_redir[6].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e23e: f7ff b9b7 b.w 800d5b0 <_port_irq_epilogue> - 800e242: bf00 nop - 800e244: 40026000 .word 0x40026000 - 800e248: 20000ec0 .word 0x20000ec0 - 800e24c: f3af 8000 nop.w - -0800e250 : -OSAL_IRQ_HANDLER(VectorFC) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 22) & STM32_DMA_ISR_MASK; - 800e250: 4b08 ldr r3, [pc, #32] ; (800e274 ) - DMA1->HIFCR = flags << 22; - if (dma_isr_redir[7].dma_func) - 800e252: 4809 ldr r0, [pc, #36] ; (800e278 ) -OSAL_IRQ_HANDLER(VectorFC) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 22) & STM32_DMA_ISR_MASK; - 800e254: 6859 ldr r1, [r3, #4] - DMA1->HIFCR = flags << 22; - if (dma_isr_redir[7].dma_func) - 800e256: 6b82 ldr r2, [r0, #56] ; 0x38 -OSAL_IRQ_HANDLER(VectorFC) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 22) & STM32_DMA_ISR_MASK; - 800e258: 0d89 lsrs r1, r1, #22 - 800e25a: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA1 stream 7 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(VectorFC) { - 800e25e: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA1->HISR >> 22) & STM32_DMA_ISR_MASK; - DMA1->HIFCR = flags << 22; - 800e260: 058c lsls r4, r1, #22 - 800e262: 60dc str r4, [r3, #12] - if (dma_isr_redir[7].dma_func) - 800e264: b10a cbz r2, 800e26a - dma_isr_redir[7].dma_func(dma_isr_redir[7].dma_param, flags); - 800e266: 6bc0 ldr r0, [r0, #60] ; 0x3c - 800e268: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e26a: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA1->HISR >> 22) & STM32_DMA_ISR_MASK; - DMA1->HIFCR = flags << 22; - if (dma_isr_redir[7].dma_func) - dma_isr_redir[7].dma_func(dma_isr_redir[7].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e26e: f7ff b99f b.w 800d5b0 <_port_irq_epilogue> - 800e272: bf00 nop - 800e274: 40026000 .word 0x40026000 - 800e278: 20000ec0 .word 0x20000ec0 - 800e27c: f3af 8000 nop.w - -0800e280 : -/** - * @brief DMA2 stream 0 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector120) { - 800e280: b508 push {r3, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 0) & STM32_DMA_ISR_MASK; - 800e282: 4b07 ldr r3, [pc, #28] ; (800e2a0 ) - DMA2->LIFCR = flags << 0; - if (dma_isr_redir[8].dma_func) - 800e284: 4807 ldr r0, [pc, #28] ; (800e2a4 ) -OSAL_IRQ_HANDLER(Vector120) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 0) & STM32_DMA_ISR_MASK; - 800e286: 6819 ldr r1, [r3, #0] - DMA2->LIFCR = flags << 0; - if (dma_isr_redir[8].dma_func) - 800e288: 6c02 ldr r2, [r0, #64] ; 0x40 -OSAL_IRQ_HANDLER(Vector120) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 0) & STM32_DMA_ISR_MASK; - 800e28a: f001 013d and.w r1, r1, #61 ; 0x3d - DMA2->LIFCR = flags << 0; - 800e28e: 6099 str r1, [r3, #8] - if (dma_isr_redir[8].dma_func) - 800e290: b10a cbz r2, 800e296 - dma_isr_redir[8].dma_func(dma_isr_redir[8].dma_param, flags); - 800e292: 6c40 ldr r0, [r0, #68] ; 0x44 - 800e294: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e296: e8bd 4008 ldmia.w sp!, {r3, lr} - flags = (DMA2->LISR >> 0) & STM32_DMA_ISR_MASK; - DMA2->LIFCR = flags << 0; - if (dma_isr_redir[8].dma_func) - dma_isr_redir[8].dma_func(dma_isr_redir[8].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e29a: f7ff b989 b.w 800d5b0 <_port_irq_epilogue> - 800e29e: bf00 nop - 800e2a0: 40026400 .word 0x40026400 - 800e2a4: 20000ec0 .word 0x20000ec0 - 800e2a8: f3af 8000 nop.w - 800e2ac: f3af 8000 nop.w - -0800e2b0 : -OSAL_IRQ_HANDLER(Vector124) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 6) & STM32_DMA_ISR_MASK; - 800e2b0: 4b08 ldr r3, [pc, #32] ; (800e2d4 ) - DMA2->LIFCR = flags << 6; - if (dma_isr_redir[9].dma_func) - 800e2b2: 4809 ldr r0, [pc, #36] ; (800e2d8 ) -OSAL_IRQ_HANDLER(Vector124) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 6) & STM32_DMA_ISR_MASK; - 800e2b4: 6819 ldr r1, [r3, #0] - DMA2->LIFCR = flags << 6; - if (dma_isr_redir[9].dma_func) - 800e2b6: 6c82 ldr r2, [r0, #72] ; 0x48 -OSAL_IRQ_HANDLER(Vector124) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 6) & STM32_DMA_ISR_MASK; - 800e2b8: 0989 lsrs r1, r1, #6 - 800e2ba: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA2 stream 1 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector124) { - 800e2be: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 6) & STM32_DMA_ISR_MASK; - DMA2->LIFCR = flags << 6; - 800e2c0: 018c lsls r4, r1, #6 - 800e2c2: 609c str r4, [r3, #8] - if (dma_isr_redir[9].dma_func) - 800e2c4: b10a cbz r2, 800e2ca - dma_isr_redir[9].dma_func(dma_isr_redir[9].dma_param, flags); - 800e2c6: 6cc0 ldr r0, [r0, #76] ; 0x4c - 800e2c8: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e2ca: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA2->LISR >> 6) & STM32_DMA_ISR_MASK; - DMA2->LIFCR = flags << 6; - if (dma_isr_redir[9].dma_func) - dma_isr_redir[9].dma_func(dma_isr_redir[9].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e2ce: f7ff b96f b.w 800d5b0 <_port_irq_epilogue> - 800e2d2: bf00 nop - 800e2d4: 40026400 .word 0x40026400 - 800e2d8: 20000ec0 .word 0x20000ec0 - 800e2dc: f3af 8000 nop.w - -0800e2e0 : -OSAL_IRQ_HANDLER(Vector128) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 16) & STM32_DMA_ISR_MASK; - 800e2e0: 4b08 ldr r3, [pc, #32] ; (800e304 ) - DMA2->LIFCR = flags << 16; - if (dma_isr_redir[10].dma_func) - 800e2e2: 4809 ldr r0, [pc, #36] ; (800e308 ) -OSAL_IRQ_HANDLER(Vector128) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 16) & STM32_DMA_ISR_MASK; - 800e2e4: 6819 ldr r1, [r3, #0] - DMA2->LIFCR = flags << 16; - if (dma_isr_redir[10].dma_func) - 800e2e6: 6d02 ldr r2, [r0, #80] ; 0x50 -OSAL_IRQ_HANDLER(Vector128) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 16) & STM32_DMA_ISR_MASK; - 800e2e8: 0c09 lsrs r1, r1, #16 - 800e2ea: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA2 stream 2 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector128) { - 800e2ee: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 16) & STM32_DMA_ISR_MASK; - DMA2->LIFCR = flags << 16; - 800e2f0: 040c lsls r4, r1, #16 - 800e2f2: 609c str r4, [r3, #8] - if (dma_isr_redir[10].dma_func) - 800e2f4: b10a cbz r2, 800e2fa - dma_isr_redir[10].dma_func(dma_isr_redir[10].dma_param, flags); - 800e2f6: 6d40 ldr r0, [r0, #84] ; 0x54 - 800e2f8: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e2fa: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA2->LISR >> 16) & STM32_DMA_ISR_MASK; - DMA2->LIFCR = flags << 16; - if (dma_isr_redir[10].dma_func) - dma_isr_redir[10].dma_func(dma_isr_redir[10].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e2fe: f7ff b957 b.w 800d5b0 <_port_irq_epilogue> - 800e302: bf00 nop - 800e304: 40026400 .word 0x40026400 - 800e308: 20000ec0 .word 0x20000ec0 - 800e30c: f3af 8000 nop.w - -0800e310 : -OSAL_IRQ_HANDLER(Vector12C) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 22) & STM32_DMA_ISR_MASK; - 800e310: 4b08 ldr r3, [pc, #32] ; (800e334 ) - DMA2->LIFCR = flags << 22; - if (dma_isr_redir[11].dma_func) - 800e312: 4809 ldr r0, [pc, #36] ; (800e338 ) -OSAL_IRQ_HANDLER(Vector12C) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 22) & STM32_DMA_ISR_MASK; - 800e314: 6819 ldr r1, [r3, #0] - DMA2->LIFCR = flags << 22; - if (dma_isr_redir[11].dma_func) - 800e316: 6d82 ldr r2, [r0, #88] ; 0x58 -OSAL_IRQ_HANDLER(Vector12C) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 22) & STM32_DMA_ISR_MASK; - 800e318: 0d89 lsrs r1, r1, #22 - 800e31a: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA2 stream 3 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector12C) { - 800e31e: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->LISR >> 22) & STM32_DMA_ISR_MASK; - DMA2->LIFCR = flags << 22; - 800e320: 058c lsls r4, r1, #22 - 800e322: 609c str r4, [r3, #8] - if (dma_isr_redir[11].dma_func) - 800e324: b10a cbz r2, 800e32a - dma_isr_redir[11].dma_func(dma_isr_redir[11].dma_param, flags); - 800e326: 6dc0 ldr r0, [r0, #92] ; 0x5c - 800e328: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e32a: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA2->LISR >> 22) & STM32_DMA_ISR_MASK; - DMA2->LIFCR = flags << 22; - if (dma_isr_redir[11].dma_func) - dma_isr_redir[11].dma_func(dma_isr_redir[11].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e32e: f7ff b93f b.w 800d5b0 <_port_irq_epilogue> - 800e332: bf00 nop - 800e334: 40026400 .word 0x40026400 - 800e338: 20000ec0 .word 0x20000ec0 - 800e33c: f3af 8000 nop.w - -0800e340 : -/** - * @brief DMA2 stream 4 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector130) { - 800e340: b508 push {r3, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 0) & STM32_DMA_ISR_MASK; - 800e342: 4b07 ldr r3, [pc, #28] ; (800e360 ) - DMA2->HIFCR = flags << 0; - if (dma_isr_redir[12].dma_func) - 800e344: 4807 ldr r0, [pc, #28] ; (800e364 ) -OSAL_IRQ_HANDLER(Vector130) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 0) & STM32_DMA_ISR_MASK; - 800e346: 6859 ldr r1, [r3, #4] - DMA2->HIFCR = flags << 0; - if (dma_isr_redir[12].dma_func) - 800e348: 6e02 ldr r2, [r0, #96] ; 0x60 -OSAL_IRQ_HANDLER(Vector130) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 0) & STM32_DMA_ISR_MASK; - 800e34a: f001 013d and.w r1, r1, #61 ; 0x3d - DMA2->HIFCR = flags << 0; - 800e34e: 60d9 str r1, [r3, #12] - if (dma_isr_redir[12].dma_func) - 800e350: b10a cbz r2, 800e356 - dma_isr_redir[12].dma_func(dma_isr_redir[12].dma_param, flags); - 800e352: 6e40 ldr r0, [r0, #100] ; 0x64 - 800e354: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e356: e8bd 4008 ldmia.w sp!, {r3, lr} - flags = (DMA2->HISR >> 0) & STM32_DMA_ISR_MASK; - DMA2->HIFCR = flags << 0; - if (dma_isr_redir[12].dma_func) - dma_isr_redir[12].dma_func(dma_isr_redir[12].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e35a: f7ff b929 b.w 800d5b0 <_port_irq_epilogue> - 800e35e: bf00 nop - 800e360: 40026400 .word 0x40026400 - 800e364: 20000ec0 .word 0x20000ec0 - 800e368: f3af 8000 nop.w - 800e36c: f3af 8000 nop.w - -0800e370 : -OSAL_IRQ_HANDLER(Vector150) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 6) & STM32_DMA_ISR_MASK; - 800e370: 4b08 ldr r3, [pc, #32] ; (800e394 ) - DMA2->HIFCR = flags << 6; - if (dma_isr_redir[13].dma_func) - 800e372: 4809 ldr r0, [pc, #36] ; (800e398 ) -OSAL_IRQ_HANDLER(Vector150) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 6) & STM32_DMA_ISR_MASK; - 800e374: 6859 ldr r1, [r3, #4] - DMA2->HIFCR = flags << 6; - if (dma_isr_redir[13].dma_func) - 800e376: 6e82 ldr r2, [r0, #104] ; 0x68 -OSAL_IRQ_HANDLER(Vector150) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 6) & STM32_DMA_ISR_MASK; - 800e378: 0989 lsrs r1, r1, #6 - 800e37a: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA2 stream 5 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector150) { - 800e37e: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 6) & STM32_DMA_ISR_MASK; - DMA2->HIFCR = flags << 6; - 800e380: 018c lsls r4, r1, #6 - 800e382: 60dc str r4, [r3, #12] - if (dma_isr_redir[13].dma_func) - 800e384: b10a cbz r2, 800e38a - dma_isr_redir[13].dma_func(dma_isr_redir[13].dma_param, flags); - 800e386: 6ec0 ldr r0, [r0, #108] ; 0x6c - 800e388: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e38a: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA2->HISR >> 6) & STM32_DMA_ISR_MASK; - DMA2->HIFCR = flags << 6; - if (dma_isr_redir[13].dma_func) - dma_isr_redir[13].dma_func(dma_isr_redir[13].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e38e: f7ff b90f b.w 800d5b0 <_port_irq_epilogue> - 800e392: bf00 nop - 800e394: 40026400 .word 0x40026400 - 800e398: 20000ec0 .word 0x20000ec0 - 800e39c: f3af 8000 nop.w - -0800e3a0 : -OSAL_IRQ_HANDLER(Vector154) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 16) & STM32_DMA_ISR_MASK; - 800e3a0: 4b08 ldr r3, [pc, #32] ; (800e3c4 ) - DMA2->HIFCR = flags << 16; - if (dma_isr_redir[14].dma_func) - 800e3a2: 4809 ldr r0, [pc, #36] ; (800e3c8 ) -OSAL_IRQ_HANDLER(Vector154) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 16) & STM32_DMA_ISR_MASK; - 800e3a4: 6859 ldr r1, [r3, #4] - DMA2->HIFCR = flags << 16; - if (dma_isr_redir[14].dma_func) - 800e3a6: 6f02 ldr r2, [r0, #112] ; 0x70 -OSAL_IRQ_HANDLER(Vector154) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 16) & STM32_DMA_ISR_MASK; - 800e3a8: 0c09 lsrs r1, r1, #16 - 800e3aa: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA2 stream 6 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector154) { - 800e3ae: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 16) & STM32_DMA_ISR_MASK; - DMA2->HIFCR = flags << 16; - 800e3b0: 040c lsls r4, r1, #16 - 800e3b2: 60dc str r4, [r3, #12] - if (dma_isr_redir[14].dma_func) - 800e3b4: b10a cbz r2, 800e3ba - dma_isr_redir[14].dma_func(dma_isr_redir[14].dma_param, flags); - 800e3b6: 6f40 ldr r0, [r0, #116] ; 0x74 - 800e3b8: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e3ba: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA2->HISR >> 16) & STM32_DMA_ISR_MASK; - DMA2->HIFCR = flags << 16; - if (dma_isr_redir[14].dma_func) - dma_isr_redir[14].dma_func(dma_isr_redir[14].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e3be: f7ff b8f7 b.w 800d5b0 <_port_irq_epilogue> - 800e3c2: bf00 nop - 800e3c4: 40026400 .word 0x40026400 - 800e3c8: 20000ec0 .word 0x20000ec0 - 800e3cc: f3af 8000 nop.w - -0800e3d0 : -OSAL_IRQ_HANDLER(Vector158) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 22) & STM32_DMA_ISR_MASK; - 800e3d0: 4b08 ldr r3, [pc, #32] ; (800e3f4 ) - DMA2->HIFCR = flags << 22; - if (dma_isr_redir[15].dma_func) - 800e3d2: 4809 ldr r0, [pc, #36] ; (800e3f8 ) -OSAL_IRQ_HANDLER(Vector158) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 22) & STM32_DMA_ISR_MASK; - 800e3d4: 6859 ldr r1, [r3, #4] - DMA2->HIFCR = flags << 22; - if (dma_isr_redir[15].dma_func) - 800e3d6: 6f82 ldr r2, [r0, #120] ; 0x78 -OSAL_IRQ_HANDLER(Vector158) { - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 22) & STM32_DMA_ISR_MASK; - 800e3d8: 0d89 lsrs r1, r1, #22 - 800e3da: f001 013d and.w r1, r1, #61 ; 0x3d -/** - * @brief DMA2 stream 7 shared interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(Vector158) { - 800e3de: b510 push {r4, lr} - uint32_t flags; - - OSAL_IRQ_PROLOGUE(); - - flags = (DMA2->HISR >> 22) & STM32_DMA_ISR_MASK; - DMA2->HIFCR = flags << 22; - 800e3e0: 058c lsls r4, r1, #22 - 800e3e2: 60dc str r4, [r3, #12] - if (dma_isr_redir[15].dma_func) - 800e3e4: b10a cbz r2, 800e3ea - dma_isr_redir[15].dma_func(dma_isr_redir[15].dma_param, flags); - 800e3e6: 6fc0 ldr r0, [r0, #124] ; 0x7c - 800e3e8: 4790 blx r2 - - OSAL_IRQ_EPILOGUE(); -} - 800e3ea: e8bd 4010 ldmia.w sp!, {r4, lr} - flags = (DMA2->HISR >> 22) & STM32_DMA_ISR_MASK; - DMA2->HIFCR = flags << 22; - if (dma_isr_redir[15].dma_func) - dma_isr_redir[15].dma_func(dma_isr_redir[15].dma_param, flags); - - OSAL_IRQ_EPILOGUE(); - 800e3ee: f7ff b8df b.w 800d5b0 <_port_irq_epilogue> - 800e3f2: bf00 nop - 800e3f4: 40026400 .word 0x40026400 - 800e3f8: 20000ec0 .word 0x20000ec0 - 800e3fc: f3af 8000 nop.w - -0800e400 : - * @init - */ -void dmaInit(void) { - int i; - - dma_streams_mask = 0; - 800e400: 4b0d ldr r3, [pc, #52] ; (800e438 ) -/** - * @brief STM32 DMA helper initialization. - * - * @init - */ -void dmaInit(void) { - 800e402: b430 push {r4, r5} - int i; - - dma_streams_mask = 0; - 800e404: 2200 movs r2, #0 - 800e406: 4d0d ldr r5, [pc, #52] ; (800e43c ) - 800e408: 4c0d ldr r4, [pc, #52] ; (800e440 ) - 800e40a: 601a str r2, [r3, #0] - for (i = 0; i < STM32_DMA_STREAMS; i++) { - _stm32_dma_streams[i].stream->CR = 0; - 800e40c: 4611 mov r1, r2 - */ -void dmaInit(void) { - int i; - - dma_streams_mask = 0; - for (i = 0; i < STM32_DMA_STREAMS; i++) { - 800e40e: 4613 mov r3, r2 - _stm32_dma_streams[i].stream->CR = 0; - 800e410: 58a8 ldr r0, [r5, r2] - 800e412: 6001 str r1, [r0, #0] - dma_isr_redir[i].dma_func = NULL; - 800e414: f844 1033 str.w r1, [r4, r3, lsl #3] - */ -void dmaInit(void) { - int i; - - dma_streams_mask = 0; - for (i = 0; i < STM32_DMA_STREAMS; i++) { - 800e418: 3301 adds r3, #1 - 800e41a: 2b10 cmp r3, #16 - 800e41c: f102 020c add.w r2, r2, #12 - 800e420: d1f6 bne.n 800e410 - _stm32_dma_streams[i].stream->CR = 0; - dma_isr_redir[i].dma_func = NULL; - } - DMA1->LIFCR = 0xFFFFFFFF; - 800e422: 4908 ldr r1, [pc, #32] ; (800e444 ) - DMA1->HIFCR = 0xFFFFFFFF; - DMA2->LIFCR = 0xFFFFFFFF; - 800e424: 4a08 ldr r2, [pc, #32] ; (800e448 ) - dma_streams_mask = 0; - for (i = 0; i < STM32_DMA_STREAMS; i++) { - _stm32_dma_streams[i].stream->CR = 0; - dma_isr_redir[i].dma_func = NULL; - } - DMA1->LIFCR = 0xFFFFFFFF; - 800e426: f04f 33ff mov.w r3, #4294967295 ; 0xffffffff - 800e42a: 608b str r3, [r1, #8] - DMA1->HIFCR = 0xFFFFFFFF; - DMA2->LIFCR = 0xFFFFFFFF; - DMA2->HIFCR = 0xFFFFFFFF; -} - 800e42c: bc30 pop {r4, r5} - for (i = 0; i < STM32_DMA_STREAMS; i++) { - _stm32_dma_streams[i].stream->CR = 0; - dma_isr_redir[i].dma_func = NULL; - } - DMA1->LIFCR = 0xFFFFFFFF; - DMA1->HIFCR = 0xFFFFFFFF; - 800e42e: 60cb str r3, [r1, #12] - DMA2->LIFCR = 0xFFFFFFFF; - 800e430: 6093 str r3, [r2, #8] - DMA2->HIFCR = 0xFFFFFFFF; - 800e432: 60d3 str r3, [r2, #12] -} - 800e434: 4770 bx lr - 800e436: bf00 nop - 800e438: 20000f40 .word 0x20000f40 - 800e43c: 08013200 .word 0x08013200 - 800e440: 20000ec0 .word 0x20000ec0 - 800e444: 40026000 .word 0x40026000 - 800e448: 40026400 .word 0x40026400 - 800e44c: f3af 8000 nop.w - -0800e450 : - * @special - */ -bool dmaStreamAllocate(const stm32_dma_stream_t *dmastp, - uint32_t priority, - stm32_dmaisr_t func, - void *param) { - 800e450: b5f8 push {r3, r4, r5, r6, r7, lr} - - osalDbgCheck(dmastp != NULL); - - /* Checks if the stream is already taken.*/ - if ((dma_streams_mask & (1 << dmastp->selfindex)) != 0) - 800e452: 4f1f ldr r7, [pc, #124] ; (800e4d0 ) - 800e454: 7a46 ldrb r6, [r0, #9] - 800e456: 683d ldr r5, [r7, #0] - 800e458: 2401 movs r4, #1 - 800e45a: fa04 fe06 lsl.w lr, r4, r6 - 800e45e: ea1e 0f05 tst.w lr, r5 - 800e462: d131 bne.n 800e4c8 - return TRUE; - - /* Marks the stream as allocated.*/ - dma_isr_redir[dmastp->selfindex].dma_func = func; - 800e464: 4c1b ldr r4, [pc, #108] ; (800e4d4 ) - dma_isr_redir[dmastp->selfindex].dma_param = param; - dma_streams_mask |= (1 << dmastp->selfindex); - 800e466: ea4e 0505 orr.w r5, lr, r5 - if ((dma_streams_mask & (1 << dmastp->selfindex)) != 0) - return TRUE; - - /* Marks the stream as allocated.*/ - dma_isr_redir[dmastp->selfindex].dma_func = func; - dma_isr_redir[dmastp->selfindex].dma_param = param; - 800e46a: eb04 0cc6 add.w ip, r4, r6, lsl #3 - dma_streams_mask |= (1 << dmastp->selfindex); - - /* Enabling DMA clocks required by the current streams set.*/ - if ((dma_streams_mask & STM32_DMA1_STREAMS_MASK) != 0) - 800e46e: f015 0fff tst.w r5, #255 ; 0xff - return TRUE; - - /* Marks the stream as allocated.*/ - dma_isr_redir[dmastp->selfindex].dma_func = func; - dma_isr_redir[dmastp->selfindex].dma_param = param; - dma_streams_mask |= (1 << dmastp->selfindex); - 800e472: 603d str r5, [r7, #0] - /* Checks if the stream is already taken.*/ - if ((dma_streams_mask & (1 << dmastp->selfindex)) != 0) - return TRUE; - - /* Marks the stream as allocated.*/ - dma_isr_redir[dmastp->selfindex].dma_func = func; - 800e474: f844 2036 str.w r2, [r4, r6, lsl #3] - dma_isr_redir[dmastp->selfindex].dma_param = param; - 800e478: f8cc 3004 str.w r3, [ip, #4] - dma_streams_mask |= (1 << dmastp->selfindex); - - /* Enabling DMA clocks required by the current streams set.*/ - if ((dma_streams_mask & STM32_DMA1_STREAMS_MASK) != 0) - 800e47c: d004 beq.n 800e488 - rccEnableDMA1(FALSE); - 800e47e: 4c16 ldr r4, [pc, #88] ; (800e4d8 ) - 800e480: 6b23 ldr r3, [r4, #48] ; 0x30 - 800e482: f443 1300 orr.w r3, r3, #2097152 ; 0x200000 - 800e486: 6323 str r3, [r4, #48] ; 0x30 - if ((dma_streams_mask & STM32_DMA2_STREAMS_MASK) != 0) - 800e488: f415 4f7f tst.w r5, #65280 ; 0xff00 - 800e48c: d116 bne.n 800e4bc - rccEnableDMA2(FALSE); - - /* Putting the stream in a safe state.*/ - dmaStreamDisable(dmastp); - 800e48e: 6805 ldr r5, [r0, #0] - 800e490: 682b ldr r3, [r5, #0] - 800e492: f023 031f bic.w r3, r3, #31 - 800e496: 602b str r3, [r5, #0] - 800e498: 682b ldr r3, [r5, #0] - 800e49a: f013 0401 ands.w r4, r3, #1 - 800e49e: d1fb bne.n 800e498 - 800e4a0: 7a07 ldrb r7, [r0, #8] - 800e4a2: 6846 ldr r6, [r0, #4] - 800e4a4: 233d movs r3, #61 ; 0x3d - 800e4a6: 40bb lsls r3, r7 - dmastp->stream->CR = STM32_DMA_CR_RESET_VALUE; - dmastp->stream->FCR = STM32_DMA_FCR_RESET_VALUE; - 800e4a8: 2721 movs r7, #33 ; 0x21 - rccEnableDMA1(FALSE); - if ((dma_streams_mask & STM32_DMA2_STREAMS_MASK) != 0) - rccEnableDMA2(FALSE); - - /* Putting the stream in a safe state.*/ - dmaStreamDisable(dmastp); - 800e4aa: 6033 str r3, [r6, #0] - dmastp->stream->CR = STM32_DMA_CR_RESET_VALUE; - 800e4ac: 602c str r4, [r5, #0] - dmastp->stream->FCR = STM32_DMA_FCR_RESET_VALUE; - 800e4ae: 616f str r7, [r5, #20] - - /* Enables the associated IRQ vector if a callback is defined.*/ - if (func != NULL) - 800e4b0: b162 cbz r2, 800e4cc - nvicEnableVector(dmastp->vector, priority); - 800e4b2: 7a80 ldrb r0, [r0, #10] - 800e4b4: f7ff fdfc bl 800e0b0 - - return FALSE; - 800e4b8: 4620 mov r0, r4 - 800e4ba: bdf8 pop {r3, r4, r5, r6, r7, pc} - - /* Enabling DMA clocks required by the current streams set.*/ - if ((dma_streams_mask & STM32_DMA1_STREAMS_MASK) != 0) - rccEnableDMA1(FALSE); - if ((dma_streams_mask & STM32_DMA2_STREAMS_MASK) != 0) - rccEnableDMA2(FALSE); - 800e4bc: 4c06 ldr r4, [pc, #24] ; (800e4d8 ) - 800e4be: 6b23 ldr r3, [r4, #48] ; 0x30 - 800e4c0: f443 0380 orr.w r3, r3, #4194304 ; 0x400000 - 800e4c4: 6323 str r3, [r4, #48] ; 0x30 - 800e4c6: e7e2 b.n 800e48e - - osalDbgCheck(dmastp != NULL); - - /* Checks if the stream is already taken.*/ - if ((dma_streams_mask & (1 << dmastp->selfindex)) != 0) - return TRUE; - 800e4c8: 4620 mov r0, r4 - 800e4ca: bdf8 pop {r3, r4, r5, r6, r7, pc} - - /* Enables the associated IRQ vector if a callback is defined.*/ - if (func != NULL) - nvicEnableVector(dmastp->vector, priority); - - return FALSE; - 800e4cc: 4610 mov r0, r2 -} - 800e4ce: bdf8 pop {r3, r4, r5, r6, r7, pc} - 800e4d0: 20000f40 .word 0x20000f40 - 800e4d4: 20000ec0 .word 0x20000ec0 - 800e4d8: 40023800 .word 0x40023800 - 800e4dc: f3af 8000 nop.w - -0800e4e0 : - */ -void hal_lld_init(void) { - - /* Reset of all peripherals. AHB3 is not reseted because it could have - been initialized in the board initialization file (board.c).*/ - rccResetAHB1(~0); - 800e4e0: 4b17 ldr r3, [pc, #92] ; (800e540 ) - 800e4e2: f04f 31ff mov.w r1, #4294967295 ; 0xffffffff - 800e4e6: 691a ldr r2, [r3, #16] - 800e4e8: 2200 movs r2, #0 -/** - * @brief Low level HAL driver initialization. - * - * @notapi - */ -void hal_lld_init(void) { - 800e4ea: b410 push {r4} - - /* Reset of all peripherals. AHB3 is not reseted because it could have - been initialized in the board initialization file (board.c).*/ - rccResetAHB1(~0); - 800e4ec: 6119 str r1, [r3, #16] - 800e4ee: 611a str r2, [r3, #16] - rccResetAHB2(~0); - 800e4f0: 6958 ldr r0, [r3, #20] - 800e4f2: 6159 str r1, [r3, #20] - 800e4f4: 615a str r2, [r3, #20] - rccResetAPB1(~RCC_APB1RSTR_PWRRST); - 800e4f6: 6a18 ldr r0, [r3, #32] - * of the whole BKP domain. - */ -static void hal_lld_backup_domain_init(void) { - - /* Backup domain access enabled and left open.*/ - PWR->CR |= PWR_CR_DBP; - 800e4f8: 4c12 ldr r4, [pc, #72] ; (800e544 ) - - /* Reset of all peripherals. AHB3 is not reseted because it could have - been initialized in the board initialization file (board.c).*/ - rccResetAHB1(~0); - rccResetAHB2(~0); - rccResetAPB1(~RCC_APB1RSTR_PWRRST); - 800e4fa: f060 5080 orn r0, r0, #268435456 ; 0x10000000 - 800e4fe: 6218 str r0, [r3, #32] - 800e500: 621a str r2, [r3, #32] - rccResetAPB2(~0); - 800e502: 6a58 ldr r0, [r3, #36] ; 0x24 - 800e504: 6259 str r1, [r3, #36] ; 0x24 - 800e506: 625a str r2, [r3, #36] ; 0x24 - - /* PWR clock enabled.*/ - rccEnablePWRInterface(FALSE); - 800e508: 6c19 ldr r1, [r3, #64] ; 0x40 - 800e50a: f041 5180 orr.w r1, r1, #268435456 ; 0x10000000 - 800e50e: 6419 str r1, [r3, #64] ; 0x40 - * of the whole BKP domain. - */ -static void hal_lld_backup_domain_init(void) { - - /* Backup domain access enabled and left open.*/ - PWR->CR |= PWR_CR_DBP; - 800e510: 6821 ldr r1, [r4, #0] - 800e512: f441 7180 orr.w r1, r1, #256 ; 0x100 - 800e516: 6021 str r1, [r4, #0] - - /* Reset BKP domain if different clock source selected.*/ - if ((RCC->BDCR & STM32_RTCSEL_MASK) != STM32_RTCSEL) { - 800e518: 6f19 ldr r1, [r3, #112] ; 0x70 - 800e51a: f401 7140 and.w r1, r1, #768 ; 0x300 - 800e51e: f5b1 7f00 cmp.w r1, #512 ; 0x200 - 800e522: d003 beq.n 800e52c - /* Backup domain reset.*/ - RCC->BDCR = RCC_BDCR_BDRST; - 800e524: f44f 3180 mov.w r1, #65536 ; 0x10000 - 800e528: 6719 str r1, [r3, #112] ; 0x70 - RCC->BDCR = 0; - 800e52a: 671a str r2, [r3, #112] ; 0x70 - - PWR->CSR |= PWR_CSR_BRE; - while ((PWR->CSR & PWR_CSR_BRR) == 0) - ; /* Waits until the regulator is stable */ -#else - PWR->CSR &= ~PWR_CSR_BRE; - 800e52c: 4a05 ldr r2, [pc, #20] ; (800e544 ) - - /* Programmable voltage detector enable.*/ -#if STM32_PVD_ENABLE - PWR->CR |= PWR_CR_PVDE | (STM32_PLS & STM32_PLS_MASK); -#endif /* STM32_PVD_ENABLE */ -} - 800e52e: f85d 4b04 ldr.w r4, [sp], #4 - - PWR->CSR |= PWR_CSR_BRE; - while ((PWR->CSR & PWR_CSR_BRR) == 0) - ; /* Waits until the regulator is stable */ -#else - PWR->CSR &= ~PWR_CSR_BRE; - 800e532: 6853 ldr r3, [r2, #4] - 800e534: f423 7300 bic.w r3, r3, #512 ; 0x200 - 800e538: 6053 str r3, [r2, #4] - - /* Initializes the backup domain.*/ - hal_lld_backup_domain_init(); - -#if defined(STM32_DMA_REQUIRED) - dmaInit(); - 800e53a: f7ff bf61 b.w 800e400 - 800e53e: bf00 nop - 800e540: 40023800 .word 0x40023800 - 800e544: 40007000 .word 0x40007000 - 800e548: f3af 8000 nop.w - 800e54c: f3af 8000 nop.w - -0800e550 : - */ -void stm32_clock_init(void) { - -#if !STM32_NO_INIT - /* PWR clock enable.*/ - RCC->APB1ENR = RCC_APB1ENR_PWREN; - 800e550: 492c ldr r1, [pc, #176] ; (800e604 ) - - /* PWR initialization.*/ -#if defined(STM32F4XX) || defined(__DOXYGEN__) - PWR->CR = STM32_VOS; - 800e552: 4b2d ldr r3, [pc, #180] ; (800e608 ) - */ -void stm32_clock_init(void) { - -#if !STM32_NO_INIT - /* PWR clock enable.*/ - RCC->APB1ENR = RCC_APB1ENR_PWREN; - 800e554: f04f 5080 mov.w r0, #268435456 ; 0x10000000 - - /* PWR initialization.*/ -#if defined(STM32F4XX) || defined(__DOXYGEN__) - PWR->CR = STM32_VOS; - 800e558: f44f 4240 mov.w r2, #49152 ; 0xc000 - */ -void stm32_clock_init(void) { - -#if !STM32_NO_INIT - /* PWR clock enable.*/ - RCC->APB1ENR = RCC_APB1ENR_PWREN; - 800e55c: 6408 str r0, [r1, #64] ; 0x40 - - /* PWR initialization.*/ -#if defined(STM32F4XX) || defined(__DOXYGEN__) - PWR->CR = STM32_VOS; - 800e55e: 601a str r2, [r3, #0] - PWR->CR = 0; -#endif - - /* HSI setup, it enforces the reset situation in order to handle possible - problems with JTAG probes and re-initializations.*/ - RCC->CR |= RCC_CR_HSION; /* Make sure HSI is ON. */ - 800e560: 680b ldr r3, [r1, #0] - 800e562: f043 0301 orr.w r3, r3, #1 - 800e566: 600b str r3, [r1, #0] - while (!(RCC->CR & RCC_CR_HSIRDY)) - 800e568: 680a ldr r2, [r1, #0] - 800e56a: 4b26 ldr r3, [pc, #152] ; (800e604 ) - 800e56c: 0790 lsls r0, r2, #30 - 800e56e: d5fb bpl.n 800e568 - ; /* Wait until HSI is stable. */ - - /* HSI is selected as new source without touching the other fields in - CFGR. Clearing the register has to be postponed after HSI is the - new source.*/ - RCC->CFGR &= ~RCC_CFGR_SW; /* Reset SW */ - 800e570: 689a ldr r2, [r3, #8] - 800e572: f022 0203 bic.w r2, r2, #3 - 800e576: 609a str r2, [r3, #8] - RCC->CFGR |= RCC_CFGR_SWS_HSI; /* Select HSI as internal*/ - 800e578: 689a ldr r2, [r3, #8] - 800e57a: 609a str r2, [r3, #8] - while ((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_HSI) - 800e57c: 4619 mov r1, r3 - 800e57e: 688b ldr r3, [r1, #8] - 800e580: 4a20 ldr r2, [pc, #128] ; (800e604 ) - 800e582: f013 030c ands.w r3, r3, #12 - 800e586: d1fa bne.n 800e57e - ; /* Wait until HSI is selected. */ - - /* Registers finally cleared to reset values.*/ - RCC->CR &= RCC_CR_HSITRIM | RCC_CR_HSION; /* CR Reset value. */ - 800e588: 6811 ldr r1, [r2, #0] - 800e58a: f001 01f9 and.w r1, r1, #249 ; 0xf9 - 800e58e: 6011 str r1, [r2, #0] - RCC->CFGR = 0; /* CFGR reset value. */ - 800e590: 6093 str r3, [r2, #8] -#if defined(STM32_HSE_BYPASS) - /* HSE Bypass.*/ - RCC->CR |= RCC_CR_HSEON | RCC_CR_HSEBYP; -#else - /* No HSE Bypass.*/ - RCC->CR |= RCC_CR_HSEON; - 800e592: 6813 ldr r3, [r2, #0] - 800e594: f443 3380 orr.w r3, r3, #65536 ; 0x10000 - 800e598: 6013 str r3, [r2, #0] -#endif - while ((RCC->CR & RCC_CR_HSERDY) == 0) - 800e59a: 6811 ldr r1, [r2, #0] - 800e59c: 4b19 ldr r3, [pc, #100] ; (800e604 ) - 800e59e: 0389 lsls r1, r1, #14 - 800e5a0: d5fb bpl.n 800e59a - ; /* Waits until HSE is stable. */ -#endif - -#if STM32_LSI_ENABLED - /* LSI activation.*/ - RCC->CSR |= RCC_CSR_LSION; - 800e5a2: 6f5a ldr r2, [r3, #116] ; 0x74 - 800e5a4: f042 0201 orr.w r2, r2, #1 - 800e5a8: 675a str r2, [r3, #116] ; 0x74 - while ((RCC->CSR & RCC_CSR_LSIRDY) == 0) - 800e5aa: 6f5a ldr r2, [r3, #116] ; 0x74 - 800e5ac: 4915 ldr r1, [pc, #84] ; (800e604 ) - 800e5ae: 0790 lsls r0, r2, #30 - 800e5b0: d5fb bpl.n 800e5aa - ; /* Waits until LSI is stable. */ -#endif - -#if STM32_ACTIVATE_PLL - /* PLL activation.*/ - RCC->PLLCFGR = STM32_PLLQ | STM32_PLLSRC | STM32_PLLP | STM32_PLLN | - 800e5b2: 4b16 ldr r3, [pc, #88] ; (800e60c ) - 800e5b4: 604b str r3, [r1, #4] - STM32_PLLM; - RCC->CR |= RCC_CR_PLLON; - 800e5b6: 680b ldr r3, [r1, #0] - - /* Synchronization with voltage regulator stabilization.*/ -#if defined(STM32F4XX) - while ((PWR->CSR & PWR_CSR_VOSRDY) == 0) - 800e5b8: 4a13 ldr r2, [pc, #76] ; (800e608 ) - -#if STM32_ACTIVATE_PLL - /* PLL activation.*/ - RCC->PLLCFGR = STM32_PLLQ | STM32_PLLSRC | STM32_PLLP | STM32_PLLN | - STM32_PLLM; - RCC->CR |= RCC_CR_PLLON; - 800e5ba: f043 7380 orr.w r3, r3, #16777216 ; 0x1000000 - 800e5be: 600b str r3, [r1, #0] - - /* Synchronization with voltage regulator stabilization.*/ -#if defined(STM32F4XX) - while ((PWR->CSR & PWR_CSR_VOSRDY) == 0) - 800e5c0: 6853 ldr r3, [r2, #4] - 800e5c2: 0459 lsls r1, r3, #17 - 800e5c4: d5fc bpl.n 800e5c0 - ; -#endif /* STM32_OVERDRIVE_REQUIRED */ -#endif /* defined(STM32F4XX) */ - - /* Waiting for PLL lock.*/ - while (!(RCC->CR & RCC_CR_PLLRDY)) - 800e5c6: 490f ldr r1, [pc, #60] ; (800e604 ) - 800e5c8: 680a ldr r2, [r1, #0] - 800e5ca: 4b0e ldr r3, [pc, #56] ; (800e604 ) - 800e5cc: 0192 lsls r2, r2, #6 - 800e5ce: d5fb bpl.n 800e5c8 - FLASH->ACR = FLASH_ACR_PRFTEN | STM32_FLASHBITS; - else - FLASH->ACR = FLASH_ACR_PRFTEN | FLASH_ACR_ICEN | - FLASH_ACR_DCEN | STM32_FLASHBITS; -#else - FLASH->ACR = FLASH_ACR_PRFTEN | FLASH_ACR_ICEN | - 800e5d0: 4a0f ldr r2, [pc, #60] ; (800e610 ) - while (!(RCC->CR & RCC_CR_PLLSAIRDY)) - ; -#endif - - /* Other clock-related settings (dividers, MCO etc).*/ - RCC->CFGR = STM32_MCO2PRE | STM32_MCO2SEL | STM32_MCO1PRE | STM32_MCO1SEL | - 800e5d2: 4910 ldr r1, [pc, #64] ; (800e614 ) - 800e5d4: 6099 str r1, [r3, #8] - FLASH->ACR = FLASH_ACR_PRFTEN | STM32_FLASHBITS; - else - FLASH->ACR = FLASH_ACR_PRFTEN | FLASH_ACR_ICEN | - FLASH_ACR_DCEN | STM32_FLASHBITS; -#else - FLASH->ACR = FLASH_ACR_PRFTEN | FLASH_ACR_ICEN | - 800e5d6: f240 7105 movw r1, #1797 ; 0x705 - 800e5da: 6011 str r1, [r2, #0] - FLASH_ACR_DCEN | STM32_FLASHBITS; -#endif - - /* Switching to the configured clock source if it is different from MSI.*/ -#if (STM32_SW != STM32_SW_HSI) - RCC->CFGR |= STM32_SW; /* Switches on the selected clock source. */ - 800e5dc: 689a ldr r2, [r3, #8] - 800e5de: f042 0202 orr.w r2, r2, #2 - 800e5e2: 609a str r2, [r3, #8] - while ((RCC->CFGR & RCC_CFGR_SWS) != (STM32_SW << 2)) - 800e5e4: 461a mov r2, r3 - 800e5e6: 6893 ldr r3, [r2, #8] - 800e5e8: 4906 ldr r1, [pc, #24] ; (800e604 ) - 800e5ea: f003 030c and.w r3, r3, #12 - 800e5ee: 2b08 cmp r3, #8 - 800e5f0: d1f9 bne.n 800e5e6 -#endif -#endif /* STM32_NO_INIT */ - - /* SYSCFG clock enabled here because it is a multi-functional unit shared - among multiple drivers.*/ - rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, TRUE); - 800e5f2: 6c4b ldr r3, [r1, #68] ; 0x44 - 800e5f4: f443 4380 orr.w r3, r3, #16384 ; 0x4000 - 800e5f8: 644b str r3, [r1, #68] ; 0x44 - 800e5fa: 6e4b ldr r3, [r1, #100] ; 0x64 - 800e5fc: f443 4380 orr.w r3, r3, #16384 ; 0x4000 - 800e600: 664b str r3, [r1, #100] ; 0x64 - 800e602: 4770 bx lr - 800e604: 40023800 .word 0x40023800 - 800e608: 40007000 .word 0x40007000 - 800e60c: 07405408 .word 0x07405408 - 800e610: 40023c00 .word 0x40023c00 - 800e614: 38089400 .word 0x38089400 - 800e618: f3af 8000 nop.w - 800e61c: f3af 8000 nop.w - -0800e620 : - * - * @notapi - */ -static void can_lld_set_filters(uint32_t can2sb, - uint32_t num, - const CANFilter *cfp) { - 800e620: b5f0 push {r4, r5, r6, r7, lr} - - /* Temporarily enabling CAN1 clock.*/ - rccEnableCAN1(FALSE); - 800e622: 4c43 ldr r4, [pc, #268] ; (800e730 ) - - /* Filters initialization.*/ - CAN1->FMR = (CAN1->FMR & 0xFFFF0000) | (can2sb << 8) | CAN_FMR_FINIT; - 800e624: 4d43 ldr r5, [pc, #268] ; (800e734 ) -static void can_lld_set_filters(uint32_t can2sb, - uint32_t num, - const CANFilter *cfp) { - - /* Temporarily enabling CAN1 clock.*/ - rccEnableCAN1(FALSE); - 800e626: 6c23 ldr r3, [r4, #64] ; 0x40 - 800e628: f043 7300 orr.w r3, r3, #33554432 ; 0x2000000 - 800e62c: 6423 str r3, [r4, #64] ; 0x40 - - /* Filters initialization.*/ - CAN1->FMR = (CAN1->FMR & 0xFFFF0000) | (can2sb << 8) | CAN_FMR_FINIT; - 800e62e: f8d5 3200 ldr.w r3, [r5, #512] ; 0x200 - 800e632: 0c1b lsrs r3, r3, #16 - 800e634: 041b lsls r3, r3, #16 - 800e636: f043 0301 orr.w r3, r3, #1 - 800e63a: ea43 2300 orr.w r3, r3, r0, lsl #8 - 800e63e: f8c5 3200 str.w r3, [r5, #512] ; 0x200 - if (num > 0) { - 800e642: 2900 cmp r1, #0 - 800e644: d04e beq.n 800e6e4 - uint32_t i, fmask; - - /* All filters cleared.*/ - CAN1->FA1R = 0; - 800e646: 2300 movs r3, #0 - 800e648: f8c5 321c str.w r3, [r5, #540] ; 0x21c - CAN1->FM1R = 0; - CAN1->FS1R = 0; - CAN1->FFA1R = 0; - for (i = 0; i < STM32_CAN_MAX_FILTERS; i++) { - 800e64c: 4618 mov r0, r3 - if (num > 0) { - uint32_t i, fmask; - - /* All filters cleared.*/ - CAN1->FA1R = 0; - CAN1->FM1R = 0; - 800e64e: f8c5 3204 str.w r3, [r5, #516] ; 0x204 - CAN1->FS1R = 0; - CAN1->FFA1R = 0; - for (i = 0; i < STM32_CAN_MAX_FILTERS; i++) { - CAN1->sFilterRegister[i].FR1 = 0; - 800e652: 461c mov r4, r3 - uint32_t i, fmask; - - /* All filters cleared.*/ - CAN1->FA1R = 0; - CAN1->FM1R = 0; - CAN1->FS1R = 0; - 800e654: f8c5 320c str.w r3, [r5, #524] ; 0x20c - CAN1->FFA1R = 0; - 800e658: f8c5 3214 str.w r3, [r5, #532] ; 0x214 - 800e65c: 00c3 lsls r3, r0, #3 - 800e65e: f103 4380 add.w r3, r3, #1073741824 ; 0x40000000 - 800e662: f503 43c8 add.w r3, r3, #25600 ; 0x6400 - for (i = 0; i < STM32_CAN_MAX_FILTERS; i++) { - 800e666: 3001 adds r0, #1 - 800e668: 281c cmp r0, #28 - CAN1->sFilterRegister[i].FR1 = 0; - 800e66a: f8c3 4240 str.w r4, [r3, #576] ; 0x240 - CAN1->sFilterRegister[i].FR2 = 0; - 800e66e: f8c3 4244 str.w r4, [r3, #580] ; 0x244 - /* All filters cleared.*/ - CAN1->FA1R = 0; - CAN1->FM1R = 0; - CAN1->FS1R = 0; - CAN1->FFA1R = 0; - for (i = 0; i < STM32_CAN_MAX_FILTERS; i++) { - 800e672: d1f3 bne.n 800e65c - - /* Scanning the filters array.*/ - for (i = 0; i < num; i++) { - fmask = 1 << cfp->filter; - if (cfp->mode) - CAN1->FM1R |= fmask; - 800e674: 482f ldr r0, [pc, #188] ; (800e734 ) - /* All filters cleared.*/ - CAN1->FA1R = 0; - CAN1->FM1R = 0; - CAN1->FS1R = 0; - CAN1->FFA1R = 0; - for (i = 0; i < STM32_CAN_MAX_FILTERS; i++) { - 800e676: 2600 movs r6, #0 - CAN1->sFilterRegister[i].FR2 = 0; - } - - /* Scanning the filters array.*/ - for (i = 0; i < num; i++) { - fmask = 1 << cfp->filter; - 800e678: 2701 movs r7, #1 - 800e67a: 6815 ldr r5, [r2, #0] - if (cfp->mode) - 800e67c: 7914 ldrb r4, [r2, #4] - 800e67e: 00eb lsls r3, r5, #3 - 800e680: f103 4380 add.w r3, r3, #1073741824 ; 0x40000000 - 800e684: f014 0f01 tst.w r4, #1 - 800e688: f503 43c8 add.w r3, r3, #25600 ; 0x6400 - CAN1->sFilterRegister[i].FR1 = 0; - CAN1->sFilterRegister[i].FR2 = 0; - } - - /* Scanning the filters array.*/ - for (i = 0; i < num; i++) { - 800e68c: f106 0601 add.w r6, r6, #1 - fmask = 1 << cfp->filter; - 800e690: fa07 f505 lsl.w r5, r7, r5 - if (cfp->mode) - 800e694: d005 beq.n 800e6a2 - CAN1->FM1R |= fmask; - 800e696: f8d0 e204 ldr.w lr, [r0, #516] ; 0x204 - 800e69a: ea45 0e0e orr.w lr, r5, lr - 800e69e: f8c0 e204 str.w lr, [r0, #516] ; 0x204 - if (cfp->scale) - 800e6a2: f014 0f02 tst.w r4, #2 - 800e6a6: d005 beq.n 800e6b4 - CAN1->FS1R |= fmask; - 800e6a8: f8d0 e20c ldr.w lr, [r0, #524] ; 0x20c - 800e6ac: ea45 0e0e orr.w lr, r5, lr - 800e6b0: f8c0 e20c str.w lr, [r0, #524] ; 0x20c - if (cfp->assignment) - 800e6b4: 0764 lsls r4, r4, #29 - 800e6b6: d504 bpl.n 800e6c2 - CAN1->FFA1R |= fmask; - 800e6b8: f8d0 4214 ldr.w r4, [r0, #532] ; 0x214 - 800e6bc: 432c orrs r4, r5 - 800e6be: f8c0 4214 str.w r4, [r0, #532] ; 0x214 - CAN1->sFilterRegister[cfp->filter].FR1 = cfp->register1; - 800e6c2: 6894 ldr r4, [r2, #8] - 800e6c4: f8c3 4240 str.w r4, [r3, #576] ; 0x240 - CAN1->sFilterRegister[cfp->filter].FR2 = cfp->register2; - 800e6c8: 68d4 ldr r4, [r2, #12] - 800e6ca: f8c3 4244 str.w r4, [r3, #580] ; 0x244 - CAN1->FA1R |= fmask; - 800e6ce: f8d0 321c ldr.w r3, [r0, #540] ; 0x21c - CAN1->sFilterRegister[i].FR1 = 0; - CAN1->sFilterRegister[i].FR2 = 0; - } - - /* Scanning the filters array.*/ - for (i = 0; i < num; i++) { - 800e6d2: 428e cmp r6, r1 - CAN1->FS1R |= fmask; - if (cfp->assignment) - CAN1->FFA1R |= fmask; - CAN1->sFilterRegister[cfp->filter].FR1 = cfp->register1; - CAN1->sFilterRegister[cfp->filter].FR2 = cfp->register2; - CAN1->FA1R |= fmask; - 800e6d4: ea43 0305 orr.w r3, r3, r5 - cfp++; - 800e6d8: f102 0210 add.w r2, r2, #16 - CAN1->FS1R |= fmask; - if (cfp->assignment) - CAN1->FFA1R |= fmask; - CAN1->sFilterRegister[cfp->filter].FR1 = cfp->register1; - CAN1->sFilterRegister[cfp->filter].FR2 = cfp->register2; - CAN1->FA1R |= fmask; - 800e6dc: f8c0 321c str.w r3, [r0, #540] ; 0x21c - CAN1->sFilterRegister[i].FR1 = 0; - CAN1->sFilterRegister[i].FR2 = 0; - } - - /* Scanning the filters array.*/ - for (i = 0; i < num; i++) { - 800e6e0: d1cb bne.n 800e67a - 800e6e2: e018 b.n 800e716 - 800e6e4: 00c2 lsls r2, r0, #3 - 800e6e6: f102 4280 add.w r2, r2, #1073741824 ; 0x40000000 - CAN1->sFilterRegister[can2sb].FR2 = 0; -#endif - CAN1->FM1R = 0; - CAN1->FFA1R = 0; -#if STM32_HAS_CAN2 - CAN1->FS1R = 1 | (1 << can2sb); - 800e6ea: 2301 movs r3, #1 - 800e6ec: f502 42c8 add.w r2, r2, #25600 ; 0x6400 - 800e6f0: 4083 lsls r3, r0 - 800e6f2: f043 0301 orr.w r3, r3, #1 - } - } - else { - /* Setting up a single default filter that enables everything for both - CANs.*/ - CAN1->sFilterRegister[0].FR1 = 0; - 800e6f6: f8c5 1240 str.w r1, [r5, #576] ; 0x240 - CAN1->sFilterRegister[0].FR2 = 0; - 800e6fa: f8c5 1244 str.w r1, [r5, #580] ; 0x244 -#if STM32_HAS_CAN2 - CAN1->sFilterRegister[can2sb].FR1 = 0; - 800e6fe: f8c2 1240 str.w r1, [r2, #576] ; 0x240 - CAN1->sFilterRegister[can2sb].FR2 = 0; - 800e702: f8c2 1244 str.w r1, [r2, #580] ; 0x244 -#endif - CAN1->FM1R = 0; - 800e706: f8c5 1204 str.w r1, [r5, #516] ; 0x204 - CAN1->FFA1R = 0; - 800e70a: f8c5 1214 str.w r1, [r5, #532] ; 0x214 -#if STM32_HAS_CAN2 - CAN1->FS1R = 1 | (1 << can2sb); - 800e70e: f8c5 320c str.w r3, [r5, #524] ; 0x20c - CAN1->FA1R = 1 | (1 << can2sb); - 800e712: f8c5 321c str.w r3, [r5, #540] ; 0x21c -#else - CAN1->FS1R = 1; - CAN1->FA1R = 1; -#endif - } - CAN1->FMR &= ~CAN_FMR_FINIT; - 800e716: 4907 ldr r1, [pc, #28] ; (800e734 ) - - /* Clock disabled, it will be enabled again in can_lld_start().*/ - rccDisableCAN1(FALSE); - 800e718: 4a05 ldr r2, [pc, #20] ; (800e730 ) -#else - CAN1->FS1R = 1; - CAN1->FA1R = 1; -#endif - } - CAN1->FMR &= ~CAN_FMR_FINIT; - 800e71a: f8d1 3200 ldr.w r3, [r1, #512] ; 0x200 - 800e71e: f023 0301 bic.w r3, r3, #1 - 800e722: f8c1 3200 str.w r3, [r1, #512] ; 0x200 - - /* Clock disabled, it will be enabled again in can_lld_start().*/ - rccDisableCAN1(FALSE); - 800e726: 6c13 ldr r3, [r2, #64] ; 0x40 - 800e728: f023 7300 bic.w r3, r3, #33554432 ; 0x2000000 - 800e72c: 6413 str r3, [r2, #64] ; 0x40 - 800e72e: bdf0 pop {r4, r5, r6, r7, pc} - 800e730: 40023800 .word 0x40023800 - 800e734: 40006400 .word 0x40006400 - 800e738: f3af 8000 nop.w - 800e73c: f3af 8000 nop.w - -0800e740 : -/** - * @brief CAN1 TX interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_CAN1_TX_HANDLER) { - 800e740: b510 push {r4, lr} - * @notapi - */ -static void can_lld_tx_handler(CANDriver *canp) { - - /* No more events until a message is transmitted.*/ - canp->can->TSR = CAN_TSR_RQCP0 | CAN_TSR_RQCP1 | CAN_TSR_RQCP2; - 800e742: 4c0c ldr r4, [pc, #48] ; (800e774 ) - 800e744: 490c ldr r1, [pc, #48] ; (800e778 ) - 800e746: 6ae2 ldr r2, [r4, #44] ; 0x2c - 800e748: 2320 movs r3, #32 - 800e74a: 6091 str r1, [r2, #8] - 800e74c: f383 8811 msr BASEPRI, r3 - * - * @iclass - */ -static inline void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { - - chThdDequeueAllI(tqp, msg); - 800e750: 2100 movs r1, #0 - 800e752: f104 0008 add.w r0, r4, #8 - 800e756: f7fe fd13 bl 800d180 - * @iclass - */ -static inline void osalEventBroadcastFlagsI(event_source_t *esp, - eventflags_t flags) { - - chEvtBroadcastFlagsI(esp, flags); - 800e75a: f104 001c add.w r0, r4, #28 - 800e75e: 2101 movs r1, #1 - 800e760: f7fe fd96 bl 800d290 - 800e764: 2300 movs r3, #0 - 800e766: f383 8811 msr BASEPRI, r3 - OSAL_IRQ_PROLOGUE(); - - can_lld_tx_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); -} - 800e76a: e8bd 4010 ldmia.w sp!, {r4, lr} - - OSAL_IRQ_PROLOGUE(); - - can_lld_tx_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); - 800e76e: f7fe bf1f b.w 800d5b0 <_port_irq_epilogue> - 800e772: bf00 nop - 800e774: 20000f44 .word 0x20000f44 - 800e778: 00010101 .word 0x00010101 - 800e77c: f3af 8000 nop.w - -0800e780 : -/* - * @brief CAN1 RX0 interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_CAN1_RX0_HANDLER) { - 800e780: b538 push {r3, r4, r5, lr} - * @notapi - */ -static void can_lld_rx0_handler(CANDriver *canp) { - uint32_t rf0r; - - rf0r = canp->can->RF0R; - 800e782: 4d16 ldr r5, [pc, #88] ; (800e7dc ) - 800e784: 6aeb ldr r3, [r5, #44] ; 0x2c - 800e786: 68dc ldr r4, [r3, #12] - if ((rf0r & CAN_RF0R_FMP0) > 0) { - 800e788: 07a2 lsls r2, r4, #30 - 800e78a: d111 bne.n 800e7b0 - osalSysLockFromISR(); - osalThreadDequeueAllI(&canp->rxqueue, MSG_OK); - osalEventBroadcastFlagsI(&canp->rxfull_event, CAN_MAILBOX_TO_MASK(1)); - osalSysUnlockFromISR(); - } - if ((rf0r & CAN_RF0R_FOVR0) > 0) { - 800e78c: 06e3 lsls r3, r4, #27 - 800e78e: d50b bpl.n 800e7a8 - /* Overflow events handling.*/ - canp->can->RF0R = CAN_RF0R_FOVR0; - 800e790: 6aeb ldr r3, [r5, #44] ; 0x2c - 800e792: 2110 movs r1, #16 - 800e794: 60d9 str r1, [r3, #12] - 800e796: 2320 movs r3, #32 - 800e798: f383 8811 msr BASEPRI, r3 - 800e79c: 4810 ldr r0, [pc, #64] ; (800e7e0 ) - 800e79e: f7fe fd77 bl 800d290 - 800e7a2: 2300 movs r3, #0 - 800e7a4: f383 8811 msr BASEPRI, r3 - OSAL_IRQ_PROLOGUE(); - - can_lld_rx0_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); -} - 800e7a8: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} - - OSAL_IRQ_PROLOGUE(); - - can_lld_rx0_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); - 800e7ac: f7fe bf00 b.w 800d5b0 <_port_irq_epilogue> - uint32_t rf0r; - - rf0r = canp->can->RF0R; - if ((rf0r & CAN_RF0R_FMP0) > 0) { - /* No more receive events until the queue 0 has been emptied.*/ - canp->can->IER &= ~CAN_IER_FMPIE0; - 800e7b0: 695a ldr r2, [r3, #20] - 800e7b2: f022 0202 bic.w r2, r2, #2 - 800e7b6: 615a str r2, [r3, #20] - 800e7b8: 2320 movs r3, #32 - 800e7ba: f383 8811 msr BASEPRI, r3 - * - * @iclass - */ -static inline void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { - - chThdDequeueAllI(tqp, msg); - 800e7be: 2100 movs r1, #0 - 800e7c0: f105 0010 add.w r0, r5, #16 - 800e7c4: f7fe fcdc bl 800d180 - * @iclass - */ -static inline void osalEventBroadcastFlagsI(event_source_t *esp, - eventflags_t flags) { - - chEvtBroadcastFlagsI(esp, flags); - 800e7c8: f105 0018 add.w r0, r5, #24 - 800e7cc: 2101 movs r1, #1 - 800e7ce: f7fe fd5f bl 800d290 - 800e7d2: 2300 movs r3, #0 - 800e7d4: f383 8811 msr BASEPRI, r3 - 800e7d8: e7d8 b.n 800e78c - 800e7da: bf00 nop - 800e7dc: 20000f44 .word 0x20000f44 - 800e7e0: 20000f64 .word 0x20000f64 - 800e7e4: f3af 8000 nop.w - 800e7e8: f3af 8000 nop.w - 800e7ec: f3af 8000 nop.w - -0800e7f0 : -/** - * @brief CAN1 RX1 interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_CAN1_RX1_HANDLER) { - 800e7f0: b538 push {r3, r4, r5, lr} - * @notapi - */ -static void can_lld_rx1_handler(CANDriver *canp) { - uint32_t rf1r; - - rf1r = canp->can->RF1R; - 800e7f2: 4d16 ldr r5, [pc, #88] ; (800e84c ) - 800e7f4: 6aeb ldr r3, [r5, #44] ; 0x2c - 800e7f6: 691c ldr r4, [r3, #16] - if ((rf1r & CAN_RF1R_FMP1) > 0) { - 800e7f8: 07a2 lsls r2, r4, #30 - 800e7fa: d111 bne.n 800e820 - osalSysLockFromISR(); - osalThreadDequeueAllI(&canp->rxqueue, MSG_OK); - osalEventBroadcastFlagsI(&canp->rxfull_event, CAN_MAILBOX_TO_MASK(2)); - osalSysUnlockFromISR(); - } - if ((rf1r & CAN_RF1R_FOVR1) > 0) { - 800e7fc: 06e3 lsls r3, r4, #27 - 800e7fe: d50b bpl.n 800e818 - /* Overflow events handling.*/ - canp->can->RF1R = CAN_RF1R_FOVR1; - 800e800: 6aeb ldr r3, [r5, #44] ; 0x2c - 800e802: 2110 movs r1, #16 - 800e804: 6119 str r1, [r3, #16] - 800e806: 2320 movs r3, #32 - 800e808: f383 8811 msr BASEPRI, r3 - 800e80c: 4810 ldr r0, [pc, #64] ; (800e850 ) - 800e80e: f7fe fd3f bl 800d290 - 800e812: 2300 movs r3, #0 - 800e814: f383 8811 msr BASEPRI, r3 - OSAL_IRQ_PROLOGUE(); - - can_lld_rx1_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); -} - 800e818: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} - - OSAL_IRQ_PROLOGUE(); - - can_lld_rx1_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); - 800e81c: f7fe bec8 b.w 800d5b0 <_port_irq_epilogue> - uint32_t rf1r; - - rf1r = canp->can->RF1R; - if ((rf1r & CAN_RF1R_FMP1) > 0) { - /* No more receive events until the queue 0 has been emptied.*/ - canp->can->IER &= ~CAN_IER_FMPIE1; - 800e820: 695a ldr r2, [r3, #20] - 800e822: f022 0210 bic.w r2, r2, #16 - 800e826: 615a str r2, [r3, #20] - 800e828: 2320 movs r3, #32 - 800e82a: f383 8811 msr BASEPRI, r3 - * - * @iclass - */ -static inline void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { - - chThdDequeueAllI(tqp, msg); - 800e82e: 2100 movs r1, #0 - 800e830: f105 0010 add.w r0, r5, #16 - 800e834: f7fe fca4 bl 800d180 - * @iclass - */ -static inline void osalEventBroadcastFlagsI(event_source_t *esp, - eventflags_t flags) { - - chEvtBroadcastFlagsI(esp, flags); - 800e838: f105 0018 add.w r0, r5, #24 - 800e83c: 2102 movs r1, #2 - 800e83e: f7fe fd27 bl 800d290 - 800e842: 2300 movs r3, #0 - 800e844: f383 8811 msr BASEPRI, r3 - 800e848: e7d8 b.n 800e7fc - 800e84a: bf00 nop - 800e84c: 20000f44 .word 0x20000f44 - 800e850: 20000f64 .word 0x20000f64 - 800e854: f3af 8000 nop.w - 800e858: f3af 8000 nop.w - 800e85c: f3af 8000 nop.w - -0800e860 : -/** - * @brief CAN1 SCE interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_CAN1_SCE_HANDLER) { - 800e860: b538 push {r3, r4, r5, lr} - * @notapi - */ -static void can_lld_sce_handler(CANDriver *canp) { - uint32_t msr; - - msr = canp->can->MSR; - 800e862: 4d1b ldr r5, [pc, #108] ; (800e8d0 ) - 800e864: 6aeb ldr r3, [r5, #44] ; 0x2c - 800e866: 685c ldr r4, [r3, #4] - canp->can->MSR = CAN_MSR_ERRI | CAN_MSR_WKUI | CAN_MSR_SLAKI; - 800e868: 221c movs r2, #28 - 800e86a: 605a str r2, [r3, #4] - /* Wakeup event.*/ -#if CAN_USE_SLEEP_MODE - if (msr & CAN_MSR_WKUI) { - 800e86c: 0722 lsls r2, r4, #28 - 800e86e: d41d bmi.n 800e8ac - osalEventBroadcastFlagsI(&canp->wakeup_event, 0); - osalSysUnlockFromISR(); - } -#endif /* CAN_USE_SLEEP_MODE */ - /* Error event.*/ - if (msr & CAN_MSR_ERRI) { - 800e870: 0763 lsls r3, r4, #29 - 800e872: d517 bpl.n 800e8a4 - eventflags_t flags; - uint32_t esr = canp->can->ESR; - 800e874: 6aea ldr r2, [r5, #44] ; 0x2c - 800e876: 6993 ldr r3, [r2, #24] - - canp->can->ESR &= ~CAN_ESR_LEC; - 800e878: 6991 ldr r1, [r2, #24] - 800e87a: f021 0170 bic.w r1, r1, #112 ; 0x70 - 800e87e: 6191 str r1, [r2, #24] - flags = (eventflags_t)(esr & 7); - if ((esr & CAN_ESR_LEC) > 0) - 800e880: f013 0f70 tst.w r3, #112 ; 0x70 - if (msr & CAN_MSR_ERRI) { - eventflags_t flags; - uint32_t esr = canp->can->ESR; - - canp->can->ESR &= ~CAN_ESR_LEC; - flags = (eventflags_t)(esr & 7); - 800e884: f003 0107 and.w r1, r3, #7 - if ((esr & CAN_ESR_LEC) > 0) - flags |= CAN_FRAMING_ERROR; - 800e888: bf18 it ne - 800e88a: f041 0108 orrne.w r1, r1, #8 - 800e88e: 2220 movs r2, #32 - 800e890: f382 8811 msr BASEPRI, r2 - 800e894: 480f ldr r0, [pc, #60] ; (800e8d4 ) - 800e896: ea41 4103 orr.w r1, r1, r3, lsl #16 - 800e89a: f7fe fcf9 bl 800d290 - 800e89e: 2300 movs r3, #0 - 800e8a0: f383 8811 msr BASEPRI, r3 - OSAL_IRQ_PROLOGUE(); - - can_lld_sce_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); -} - 800e8a4: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} - - OSAL_IRQ_PROLOGUE(); - - can_lld_sce_handler(&CAND1); - - OSAL_IRQ_EPILOGUE(); - 800e8a8: f7fe be82 b.w 800d5b0 <_port_irq_epilogue> - canp->can->MSR = CAN_MSR_ERRI | CAN_MSR_WKUI | CAN_MSR_SLAKI; - /* Wakeup event.*/ -#if CAN_USE_SLEEP_MODE - if (msr & CAN_MSR_WKUI) { - canp->state = CAN_READY; - canp->can->MCR &= ~CAN_MCR_SLEEP; - 800e8ac: 681a ldr r2, [r3, #0] - msr = canp->can->MSR; - canp->can->MSR = CAN_MSR_ERRI | CAN_MSR_WKUI | CAN_MSR_SLAKI; - /* Wakeup event.*/ -#if CAN_USE_SLEEP_MODE - if (msr & CAN_MSR_WKUI) { - canp->state = CAN_READY; - 800e8ae: 4628 mov r0, r5 - canp->can->MCR &= ~CAN_MCR_SLEEP; - 800e8b0: f022 0202 bic.w r2, r2, #2 - msr = canp->can->MSR; - canp->can->MSR = CAN_MSR_ERRI | CAN_MSR_WKUI | CAN_MSR_SLAKI; - /* Wakeup event.*/ -#if CAN_USE_SLEEP_MODE - if (msr & CAN_MSR_WKUI) { - canp->state = CAN_READY; - 800e8b4: 2103 movs r1, #3 - 800e8b6: f800 1b28 strb.w r1, [r0], #40 - 800e8ba: 2120 movs r1, #32 - canp->can->MCR &= ~CAN_MCR_SLEEP; - 800e8bc: 601a str r2, [r3, #0] - 800e8be: f381 8811 msr BASEPRI, r1 - 800e8c2: 2100 movs r1, #0 - 800e8c4: f7fe fce4 bl 800d290 - 800e8c8: 2300 movs r3, #0 - 800e8ca: f383 8811 msr BASEPRI, r3 - 800e8ce: e7cf b.n 800e870 - 800e8d0: 20000f44 .word 0x20000f44 - 800e8d4: 20000f64 .word 0x20000f64 - 800e8d8: f3af 8000 nop.w - 800e8dc: f3af 8000 nop.w - -0800e8e0 : -/** - * @brief Low level CAN driver initialization. - * - * @notapi - */ -void can_lld_init(void) { - 800e8e0: b510 push {r4, lr} - -#if STM32_CAN_USE_CAN1 - /* Driver initialization.*/ - canObjectInit(&CAND1); - 800e8e2: 4c06 ldr r4, [pc, #24] ; (800e8fc ) - 800e8e4: 4620 mov r0, r4 - 800e8e6: f7fe febb bl 800d660 - CAND2.can = CAN2; -#endif - - /* Filters initialization.*/ -#if STM32_HAS_CAN2 - can_lld_set_filters(STM32_CAN_MAX_FILTERS / 2, 0, NULL); - 800e8ea: 2100 movs r1, #0 -void can_lld_init(void) { - -#if STM32_CAN_USE_CAN1 - /* Driver initialization.*/ - canObjectInit(&CAND1); - CAND1.can = CAN1; - 800e8ec: 4b04 ldr r3, [pc, #16] ; (800e900 ) - 800e8ee: 62e3 str r3, [r4, #44] ; 0x2c - CAND2.can = CAN2; -#endif - - /* Filters initialization.*/ -#if STM32_HAS_CAN2 - can_lld_set_filters(STM32_CAN_MAX_FILTERS / 2, 0, NULL); - 800e8f0: 460a mov r2, r1 - 800e8f2: 200e movs r0, #14 -#else - can_lld_set_filters(STM32_CAN_MAX_FILTERS, 0, NULL); -#endif -} - 800e8f4: e8bd 4010 ldmia.w sp!, {r4, lr} - CAND2.can = CAN2; -#endif - - /* Filters initialization.*/ -#if STM32_HAS_CAN2 - can_lld_set_filters(STM32_CAN_MAX_FILTERS / 2, 0, NULL); - 800e8f8: f7ff be92 b.w 800e620 - 800e8fc: 20000f44 .word 0x20000f44 - 800e900: 40006400 .word 0x40006400 - 800e904: f3af 8000 nop.w - 800e908: f3af 8000 nop.w - 800e90c: f3af 8000 nop.w - -0800e910 <_pal_lld_init>: - * - * @param[in] config the STM32 ports configuration - * - * @notapi - */ -void _pal_lld_init(const PALConfig *config) { - 800e910: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} -#elif defined(STM32F0XX) - rccEnableAHB(AHB_EN_MASK, TRUE); -#elif defined(STM32F3XX) || defined(STM32F37X) - rccEnableAHB(AHB_EN_MASK, TRUE); -#elif defined(STM32F2XX) || defined(STM32F4XX) - RCC->AHB1ENR |= AHB1_EN_MASK; - 800e914: f8df 81b4 ldr.w r8, [pc, #436] ; 800eacc <_pal_lld_init+0x1bc> -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e918: f8df c1b4 ldr.w ip, [pc, #436] ; 800ead0 <_pal_lld_init+0x1c0> -#elif defined(STM32F0XX) - rccEnableAHB(AHB_EN_MASK, TRUE); -#elif defined(STM32F3XX) || defined(STM32F37X) - rccEnableAHB(AHB_EN_MASK, TRUE); -#elif defined(STM32F2XX) || defined(STM32F4XX) - RCC->AHB1ENR |= AHB1_EN_MASK; - 800e91c: f8d8 a030 ldr.w sl, [r8, #48] ; 0x30 -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e920: f8df e1b0 ldr.w lr, [pc, #432] ; 800ead4 <_pal_lld_init+0x1c4> - 800e924: 4f63 ldr r7, [pc, #396] ; (800eab4 <_pal_lld_init+0x1a4>) - 800e926: 4e64 ldr r6, [pc, #400] ; (800eab8 <_pal_lld_init+0x1a8>) - 800e928: 4d64 ldr r5, [pc, #400] ; (800eabc <_pal_lld_init+0x1ac>) - 800e92a: 4c65 ldr r4, [pc, #404] ; (800eac0 <_pal_lld_init+0x1b0>) - 800e92c: 4965 ldr r1, [pc, #404] ; (800eac4 <_pal_lld_init+0x1b4>) - 800e92e: 4a66 ldr r2, [pc, #408] ; (800eac8 <_pal_lld_init+0x1b8>) - 800e930: f8df b1a4 ldr.w fp, [pc, #420] ; 800ead8 <_pal_lld_init+0x1c8> -#elif defined(STM32F0XX) - rccEnableAHB(AHB_EN_MASK, TRUE); -#elif defined(STM32F3XX) || defined(STM32F37X) - rccEnableAHB(AHB_EN_MASK, TRUE); -#elif defined(STM32F2XX) || defined(STM32F4XX) - RCC->AHB1ENR |= AHB1_EN_MASK; - 800e934: f240 19ff movw r9, #511 ; 0x1ff - 800e938: ea4a 0a09 orr.w sl, sl, r9 - 800e93c: f8c8 a030 str.w sl, [r8, #48] ; 0x30 - RCC->AHB1LPENR |= AHB1_LPEN_MASK; - 800e940: f8d8 a050 ldr.w sl, [r8, #80] ; 0x50 - 800e944: ea4a 0909 orr.w r9, sl, r9 - 800e948: f8c8 9050 str.w r9, [r8, #80] ; 0x50 -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e94c: 6843 ldr r3, [r0, #4] - 800e94e: f8cc 3004 str.w r3, [ip, #4] - gpiop->OSPEEDR = config->ospeedr; - 800e952: 6883 ldr r3, [r0, #8] - 800e954: f8cc 3008 str.w r3, [ip, #8] - gpiop->PUPDR = config->pupdr; - 800e958: 68c3 ldr r3, [r0, #12] - 800e95a: f8cc 300c str.w r3, [ip, #12] - gpiop->ODR = config->odr; - 800e95e: 6903 ldr r3, [r0, #16] - 800e960: f8cc 3014 str.w r3, [ip, #20] - gpiop->AFRL = config->afrl; - 800e964: 6943 ldr r3, [r0, #20] - 800e966: f8cc 3020 str.w r3, [ip, #32] - gpiop->AFRH = config->afrh; - 800e96a: 6983 ldr r3, [r0, #24] - 800e96c: f8cc 3024 str.w r3, [ip, #36] ; 0x24 - gpiop->MODER = config->moder; - 800e970: 6803 ldr r3, [r0, #0] - 800e972: f8cc 3000 str.w r3, [ip] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e976: 6a03 ldr r3, [r0, #32] - 800e978: f8ce 3004 str.w r3, [lr, #4] - gpiop->OSPEEDR = config->ospeedr; - 800e97c: 6a43 ldr r3, [r0, #36] ; 0x24 - 800e97e: f8ce 3008 str.w r3, [lr, #8] - gpiop->PUPDR = config->pupdr; - 800e982: 6a83 ldr r3, [r0, #40] ; 0x28 - 800e984: f8ce 300c str.w r3, [lr, #12] - gpiop->ODR = config->odr; - 800e988: 6ac3 ldr r3, [r0, #44] ; 0x2c - 800e98a: f8ce 3014 str.w r3, [lr, #20] - gpiop->AFRL = config->afrl; - 800e98e: 6b03 ldr r3, [r0, #48] ; 0x30 - 800e990: f8ce 3020 str.w r3, [lr, #32] - gpiop->AFRH = config->afrh; - 800e994: 6b43 ldr r3, [r0, #52] ; 0x34 - 800e996: f8ce 3024 str.w r3, [lr, #36] ; 0x24 - gpiop->MODER = config->moder; - 800e99a: 69c3 ldr r3, [r0, #28] - 800e99c: f8ce 3000 str.w r3, [lr] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e9a0: 6bc3 ldr r3, [r0, #60] ; 0x3c - 800e9a2: 607b str r3, [r7, #4] - gpiop->OSPEEDR = config->ospeedr; - 800e9a4: 6c03 ldr r3, [r0, #64] ; 0x40 - 800e9a6: 60bb str r3, [r7, #8] - gpiop->PUPDR = config->pupdr; - 800e9a8: 6c43 ldr r3, [r0, #68] ; 0x44 - 800e9aa: 60fb str r3, [r7, #12] - gpiop->ODR = config->odr; - 800e9ac: 6c83 ldr r3, [r0, #72] ; 0x48 - 800e9ae: 617b str r3, [r7, #20] - gpiop->AFRL = config->afrl; - 800e9b0: 6cc3 ldr r3, [r0, #76] ; 0x4c - 800e9b2: 623b str r3, [r7, #32] - gpiop->AFRH = config->afrh; - 800e9b4: 6d03 ldr r3, [r0, #80] ; 0x50 - 800e9b6: 627b str r3, [r7, #36] ; 0x24 - gpiop->MODER = config->moder; - 800e9b8: 6b83 ldr r3, [r0, #56] ; 0x38 - 800e9ba: 603b str r3, [r7, #0] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e9bc: 6d87 ldr r7, [r0, #88] ; 0x58 - 800e9be: 6077 str r7, [r6, #4] - gpiop->OSPEEDR = config->ospeedr; - 800e9c0: 6dc7 ldr r7, [r0, #92] ; 0x5c - 800e9c2: 60b7 str r7, [r6, #8] - gpiop->PUPDR = config->pupdr; - 800e9c4: 6e07 ldr r7, [r0, #96] ; 0x60 - 800e9c6: 60f7 str r7, [r6, #12] - gpiop->ODR = config->odr; - 800e9c8: 6e47 ldr r7, [r0, #100] ; 0x64 - 800e9ca: 6177 str r7, [r6, #20] - gpiop->AFRL = config->afrl; - 800e9cc: 6e87 ldr r7, [r0, #104] ; 0x68 - 800e9ce: 6237 str r7, [r6, #32] - gpiop->AFRH = config->afrh; - 800e9d0: 6ec7 ldr r7, [r0, #108] ; 0x6c - 800e9d2: 6277 str r7, [r6, #36] ; 0x24 - gpiop->MODER = config->moder; - 800e9d4: 6d47 ldr r7, [r0, #84] ; 0x54 - 800e9d6: 6037 str r7, [r6, #0] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e9d8: 6f46 ldr r6, [r0, #116] ; 0x74 - 800e9da: 606e str r6, [r5, #4] - gpiop->OSPEEDR = config->ospeedr; - 800e9dc: 6f86 ldr r6, [r0, #120] ; 0x78 - 800e9de: 60ae str r6, [r5, #8] - gpiop->PUPDR = config->pupdr; - 800e9e0: 6fc6 ldr r6, [r0, #124] ; 0x7c - 800e9e2: 60ee str r6, [r5, #12] - gpiop->ODR = config->odr; - 800e9e4: f8d0 6080 ldr.w r6, [r0, #128] ; 0x80 - 800e9e8: 616e str r6, [r5, #20] - gpiop->AFRL = config->afrl; - 800e9ea: f8d0 6084 ldr.w r6, [r0, #132] ; 0x84 - 800e9ee: 622e str r6, [r5, #32] - gpiop->AFRH = config->afrh; - 800e9f0: f8d0 6088 ldr.w r6, [r0, #136] ; 0x88 - 800e9f4: 626e str r6, [r5, #36] ; 0x24 - gpiop->MODER = config->moder; - 800e9f6: 6f06 ldr r6, [r0, #112] ; 0x70 - 800e9f8: 602e str r6, [r5, #0] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800e9fa: f8d0 5090 ldr.w r5, [r0, #144] ; 0x90 - 800e9fe: 6065 str r5, [r4, #4] - gpiop->OSPEEDR = config->ospeedr; - 800ea00: f8d0 5094 ldr.w r5, [r0, #148] ; 0x94 - 800ea04: 60a5 str r5, [r4, #8] - gpiop->PUPDR = config->pupdr; - 800ea06: f8d0 5098 ldr.w r5, [r0, #152] ; 0x98 - 800ea0a: 60e5 str r5, [r4, #12] - gpiop->ODR = config->odr; - 800ea0c: f8d0 509c ldr.w r5, [r0, #156] ; 0x9c - 800ea10: 6165 str r5, [r4, #20] - gpiop->AFRL = config->afrl; - 800ea12: f8d0 50a0 ldr.w r5, [r0, #160] ; 0xa0 - 800ea16: 6225 str r5, [r4, #32] - gpiop->AFRH = config->afrh; - 800ea18: f8d0 50a4 ldr.w r5, [r0, #164] ; 0xa4 - 800ea1c: 6265 str r5, [r4, #36] ; 0x24 - gpiop->MODER = config->moder; - 800ea1e: f8d0 508c ldr.w r5, [r0, #140] ; 0x8c - 800ea22: 6025 str r5, [r4, #0] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800ea24: f8d0 40ac ldr.w r4, [r0, #172] ; 0xac - 800ea28: 604c str r4, [r1, #4] - gpiop->OSPEEDR = config->ospeedr; - 800ea2a: f8d0 40b0 ldr.w r4, [r0, #176] ; 0xb0 - 800ea2e: 608c str r4, [r1, #8] - gpiop->PUPDR = config->pupdr; - 800ea30: f8d0 40b4 ldr.w r4, [r0, #180] ; 0xb4 - 800ea34: 60cc str r4, [r1, #12] - gpiop->ODR = config->odr; - 800ea36: f8d0 40b8 ldr.w r4, [r0, #184] ; 0xb8 - 800ea3a: 614c str r4, [r1, #20] - gpiop->AFRL = config->afrl; - 800ea3c: f8d0 40bc ldr.w r4, [r0, #188] ; 0xbc - 800ea40: 620c str r4, [r1, #32] - gpiop->AFRH = config->afrh; - 800ea42: f8d0 40c0 ldr.w r4, [r0, #192] ; 0xc0 - 800ea46: 624c str r4, [r1, #36] ; 0x24 - gpiop->MODER = config->moder; - 800ea48: f8d0 40a8 ldr.w r4, [r0, #168] ; 0xa8 - 800ea4c: 600c str r4, [r1, #0] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800ea4e: f8d0 10c8 ldr.w r1, [r0, #200] ; 0xc8 - 800ea52: 6051 str r1, [r2, #4] - gpiop->OSPEEDR = config->ospeedr; - 800ea54: f8d0 10cc ldr.w r1, [r0, #204] ; 0xcc - 800ea58: 6091 str r1, [r2, #8] - gpiop->PUPDR = config->pupdr; - 800ea5a: f8d0 10d0 ldr.w r1, [r0, #208] ; 0xd0 - 800ea5e: 60d1 str r1, [r2, #12] - gpiop->ODR = config->odr; - 800ea60: f8d0 10d4 ldr.w r1, [r0, #212] ; 0xd4 - 800ea64: 6151 str r1, [r2, #20] - gpiop->AFRL = config->afrl; - 800ea66: f8d0 10d8 ldr.w r1, [r0, #216] ; 0xd8 - 800ea6a: 6211 str r1, [r2, #32] - gpiop->AFRH = config->afrh; - 800ea6c: f8d0 10dc ldr.w r1, [r0, #220] ; 0xdc - 800ea70: 6251 str r1, [r2, #36] ; 0x24 - gpiop->MODER = config->moder; - 800ea72: f8d0 10c4 ldr.w r1, [r0, #196] ; 0xc4 - 800ea76: 6011 str r1, [r2, #0] -/* Driver local functions. */ -/*===========================================================================*/ - -static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) { - - gpiop->OTYPER = config->otyper; - 800ea78: f8d0 20e4 ldr.w r2, [r0, #228] ; 0xe4 - 800ea7c: f8cb 2004 str.w r2, [fp, #4] - gpiop->OSPEEDR = config->ospeedr; - 800ea80: f8d0 20e8 ldr.w r2, [r0, #232] ; 0xe8 - 800ea84: f8cb 2008 str.w r2, [fp, #8] - gpiop->PUPDR = config->pupdr; - 800ea88: f8d0 20ec ldr.w r2, [r0, #236] ; 0xec - 800ea8c: f8cb 200c str.w r2, [fp, #12] - gpiop->ODR = config->odr; - 800ea90: f8d0 20f0 ldr.w r2, [r0, #240] ; 0xf0 - 800ea94: f8cb 2014 str.w r2, [fp, #20] - gpiop->AFRL = config->afrl; - 800ea98: f8d0 20f4 ldr.w r2, [r0, #244] ; 0xf4 - 800ea9c: f8cb 2020 str.w r2, [fp, #32] - gpiop->AFRH = config->afrh; - 800eaa0: f8d0 20f8 ldr.w r2, [r0, #248] ; 0xf8 - 800eaa4: f8cb 2024 str.w r2, [fp, #36] ; 0x24 - gpiop->MODER = config->moder; - 800eaa8: f8d0 20e0 ldr.w r2, [r0, #224] ; 0xe0 - 800eaac: f8cb 2000 str.w r2, [fp] - 800eab0: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 800eab4: 40020800 .word 0x40020800 - 800eab8: 40020c00 .word 0x40020c00 - 800eabc: 40021000 .word 0x40021000 - 800eac0: 40021400 .word 0x40021400 - 800eac4: 40021800 .word 0x40021800 - 800eac8: 40021c00 .word 0x40021c00 - 800eacc: 40023800 .word 0x40023800 - 800ead0: 40020000 .word 0x40020000 - 800ead4: 40020400 .word 0x40020400 - 800ead8: 40022000 .word 0x40022000 - 800eadc: f3af 8000 nop.w - -0800eae0 <_pal_lld_setgroupmode>: - * @notapi - */ -#if 1 -void _pal_lld_setgroupmode(ioportid_t port, - ioportmask_t mask, - iomode_t mode) { - 800eae0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - while (TRUE) { - if ((mask & 1) != 0) { - uint32_t altrmask, m1, m2, m4; - - altrmask = altr << ((bit & 7) * 4); - m4 = 15 << ((bit & 7) * 4); - 800eae4: f04f 0c0f mov.w ip, #15 -#if 1 -void _pal_lld_setgroupmode(ioportid_t port, - ioportmask_t mask, - iomode_t mode) { - - uint32_t moder = (mode & PAL_STM32_MODE_MASK) >> 0; - 800eae8: f002 0e03 and.w lr, r2, #3 - uint32_t otyper = (mode & PAL_STM32_OTYPE_MASK) >> 2; - 800eaec: f3c2 0780 ubfx r7, r2, #2, #1 - uint32_t ospeedr = (mode & PAL_STM32_OSPEED_MASK) >> 3; - 800eaf0: f3c2 06c1 ubfx r6, r2, #3, #2 - uint32_t pupdr = (mode & PAL_STM32_PUDR_MASK) >> 5; - 800eaf4: f3c2 1541 ubfx r5, r2, #5, #2 - uint32_t altr = (mode & PAL_STM32_ALTERNATE_MASK) >> 7; - uint32_t bit = 0; - 800eaf8: 2400 movs r4, #0 - - uint32_t moder = (mode & PAL_STM32_MODE_MASK) >> 0; - uint32_t otyper = (mode & PAL_STM32_OTYPE_MASK) >> 2; - uint32_t ospeedr = (mode & PAL_STM32_OSPEED_MASK) >> 3; - uint32_t pupdr = (mode & PAL_STM32_PUDR_MASK) >> 5; - uint32_t altr = (mode & PAL_STM32_ALTERNATE_MASK) >> 7; - 800eafa: f3c2 12c3 ubfx r2, r2, #7, #4 - m4 = 15 << ((bit & 7) * 4); - if (bit < 8) - port->AFRL = (port->AFRL & ~m4) | altrmask; - else - port->AFRH = (port->AFRH & ~m4) | altrmask; - m1 = 1 << bit; - 800eafe: f04f 0901 mov.w r9, #1 - port->OTYPER = (port->OTYPER & ~m1) | otyper; - m2 = 3 << (bit * 2); - 800eb02: f04f 0803 mov.w r8, #3 - 800eb06: e02b b.n 800eb60 <_pal_lld_setgroupmode+0x80> - uint32_t altrmask, m1, m2, m4; - - altrmask = altr << ((bit & 7) * 4); - m4 = 15 << ((bit & 7) * 4); - if (bit < 8) - port->AFRL = (port->AFRL & ~m4) | altrmask; - 800eb08: f8d0 b020 ldr.w fp, [r0, #32] - 800eb0c: ea2b 0303 bic.w r3, fp, r3 - 800eb10: ea43 030a orr.w r3, r3, sl - 800eb14: 6203 str r3, [r0, #32] - else - port->AFRH = (port->AFRH & ~m4) | altrmask; - m1 = 1 << bit; - port->OTYPER = (port->OTYPER & ~m1) | otyper; - 800eb16: 6843 ldr r3, [r0, #4] - m4 = 15 << ((bit & 7) * 4); - if (bit < 8) - port->AFRL = (port->AFRL & ~m4) | altrmask; - else - port->AFRH = (port->AFRH & ~m4) | altrmask; - m1 = 1 << bit; - 800eb18: fa09 fa04 lsl.w sl, r9, r4 - port->OTYPER = (port->OTYPER & ~m1) | otyper; - 800eb1c: ea23 030a bic.w r3, r3, sl - 800eb20: 433b orrs r3, r7 - 800eb22: 6043 str r3, [r0, #4] - 800eb24: ea4f 0a44 mov.w sl, r4, lsl #1 - m2 = 3 << (bit * 2); - port->OSPEEDR = (port->OSPEEDR & ~m2) | ospeedr; - 800eb28: 6883 ldr r3, [r0, #8] - port->AFRL = (port->AFRL & ~m4) | altrmask; - else - port->AFRH = (port->AFRH & ~m4) | altrmask; - m1 = 1 << bit; - port->OTYPER = (port->OTYPER & ~m1) | otyper; - m2 = 3 << (bit * 2); - 800eb2a: fa08 fa0a lsl.w sl, r8, sl - port->OSPEEDR = (port->OSPEEDR & ~m2) | ospeedr; - 800eb2e: ea6f 0a0a mvn.w sl, sl - 800eb32: ea0a 0303 and.w r3, sl, r3 - 800eb36: 4333 orrs r3, r6 - 800eb38: 6083 str r3, [r0, #8] - port->PUPDR = (port->PUPDR & ~m2) | pupdr; - 800eb3a: 68c3 ldr r3, [r0, #12] - 800eb3c: ea0a 0303 and.w r3, sl, r3 - 800eb40: 432b orrs r3, r5 - 800eb42: 60c3 str r3, [r0, #12] - port->MODER = (port->MODER & ~m2) | moder; - 800eb44: 6803 ldr r3, [r0, #0] - 800eb46: ea0a 0303 and.w r3, sl, r3 - 800eb4a: ea43 030e orr.w r3, r3, lr - 800eb4e: 6003 str r3, [r0, #0] - } - mask >>= 1; - if (!mask) - 800eb50: 0849 lsrs r1, r1, #1 - 800eb52: d019 beq.n 800eb88 <_pal_lld_setgroupmode+0xa8> - return; - otyper <<= 1; - 800eb54: 007f lsls r7, r7, #1 - ospeedr <<= 2; - 800eb56: 00b6 lsls r6, r6, #2 - pupdr <<= 2; - 800eb58: 00ad lsls r5, r5, #2 - moder <<= 2; - 800eb5a: ea4f 0e8e mov.w lr, lr, lsl #2 - bit++; - 800eb5e: 3401 adds r4, #1 - uint32_t bit = 0; - while (TRUE) { - if ((mask & 1) != 0) { - uint32_t altrmask, m1, m2, m4; - - altrmask = altr << ((bit & 7) * 4); - 800eb60: f004 0307 and.w r3, r4, #7 - 800eb64: 009b lsls r3, r3, #2 - uint32_t ospeedr = (mode & PAL_STM32_OSPEED_MASK) >> 3; - uint32_t pupdr = (mode & PAL_STM32_PUDR_MASK) >> 5; - uint32_t altr = (mode & PAL_STM32_ALTERNATE_MASK) >> 7; - uint32_t bit = 0; - while (TRUE) { - if ((mask & 1) != 0) { - 800eb66: f011 0f01 tst.w r1, #1 - uint32_t altrmask, m1, m2, m4; - - altrmask = altr << ((bit & 7) * 4); - 800eb6a: fa02 fa03 lsl.w sl, r2, r3 - m4 = 15 << ((bit & 7) * 4); - 800eb6e: fa0c f303 lsl.w r3, ip, r3 - uint32_t ospeedr = (mode & PAL_STM32_OSPEED_MASK) >> 3; - uint32_t pupdr = (mode & PAL_STM32_PUDR_MASK) >> 5; - uint32_t altr = (mode & PAL_STM32_ALTERNATE_MASK) >> 7; - uint32_t bit = 0; - while (TRUE) { - if ((mask & 1) != 0) { - 800eb72: d0ed beq.n 800eb50 <_pal_lld_setgroupmode+0x70> - uint32_t altrmask, m1, m2, m4; - - altrmask = altr << ((bit & 7) * 4); - m4 = 15 << ((bit & 7) * 4); - if (bit < 8) - 800eb74: 2c07 cmp r4, #7 - 800eb76: d9c7 bls.n 800eb08 <_pal_lld_setgroupmode+0x28> - port->AFRL = (port->AFRL & ~m4) | altrmask; - else - port->AFRH = (port->AFRH & ~m4) | altrmask; - 800eb78: f8d0 b024 ldr.w fp, [r0, #36] ; 0x24 - 800eb7c: ea2b 0303 bic.w r3, fp, r3 - 800eb80: ea43 030a orr.w r3, r3, sl - 800eb84: 6243 str r3, [r0, #36] ; 0x24 - 800eb86: e7c6 b.n 800eb16 <_pal_lld_setgroupmode+0x36> - 800eb88: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 800eb8c: f3af 8000 nop.w - -0800eb90 : - * @param[in] i2cp pointer to the @p I2CDriver object - * - * @notapi - */ -static void i2c_lld_serve_event_interrupt(I2CDriver *i2cp) { - I2C_TypeDef *dp = i2cp->i2c; - 800eb90: 483a ldr r0, [pc, #232] ; (800ec7c ) - uint32_t event = dp->SR1; - - /* Interrupts are disabled just before dmaStreamEnable() because there - is no need of interrupts until next transaction begin. All the work is - done by the DMA.*/ - switch (I2C_EV_MASK & (event | (regSR2 << 16))) { - 800eb92: 4a3b ldr r2, [pc, #236] ; (800ec80 ) -/** - * @brief I2C2 event interrupt handler. - * - * @notapi - */ -OSAL_IRQ_HANDLER(STM32_I2C2_EVENT_HANDLER) { - 800eb94: b570 push {r4, r5, r6, lr} - * @param[in] i2cp pointer to the @p I2CDriver object - * - * @notapi - */ -static void i2c_lld_serve_event_interrupt(I2CDriver *i2cp) { - I2C_TypeDef *dp = i2cp->i2c; - 800eb96: 6b44 ldr r4, [r0, #52] ; 0x34 - uint32_t regSR2 = dp->SR2; - 800eb98: 69a3 ldr r3, [r4, #24] - uint32_t event = dp->SR1; - 800eb9a: 6965 ldr r5, [r4, #20] - - /* Interrupts are disabled just before dmaStreamEnable() because there - is no need of interrupts until next transaction begin. All the work is - done by the DMA.*/ - switch (I2C_EV_MASK & (event | (regSR2 << 16))) { - 800eb9c: ea45 4303 orr.w r3, r5, r3, lsl #16 - 800eba0: f023 437f bic.w r3, r3, #4278190080 ; 0xff000000 - 800eba4: 4293 cmp r3, r2 - 800eba6: d04c beq.n 800ec42 - 800eba8: d81e bhi.n 800ebe8 - 800ebaa: 3a07 subs r2, #7 - 800ebac: 4293 cmp r3, r2 - 800ebae: d03c beq.n 800ec2a - 800ebb0: 3201 adds r2, #1 - 800ebb2: 4293 cmp r3, r2 - 800ebb4: d110 bne.n 800ebd8 - case I2C_EV9_MASTER_ADD10: - /* Set second addr byte (10-bit addressing)*/ - dp->DR = (0xFF & (i2cp->addr >> 1)); - break; - case I2C_EV6_MASTER_REC_MODE_SELECTED: - dp->CR2 &= ~I2C_CR2_ITEVTEN; - 800ebb6: 6862 ldr r2, [r4, #4] - dmaStreamEnable(i2cp->dmarx); - 800ebb8: 6ac3 ldr r3, [r0, #44] ; 0x2c - case I2C_EV9_MASTER_ADD10: - /* Set second addr byte (10-bit addressing)*/ - dp->DR = (0xFF & (i2cp->addr >> 1)); - break; - case I2C_EV6_MASTER_REC_MODE_SELECTED: - dp->CR2 &= ~I2C_CR2_ITEVTEN; - 800ebba: f422 7200 bic.w r2, r2, #512 ; 0x200 - dmaStreamEnable(i2cp->dmarx); - 800ebbe: 681b ldr r3, [r3, #0] - case I2C_EV9_MASTER_ADD10: - /* Set second addr byte (10-bit addressing)*/ - dp->DR = (0xFF & (i2cp->addr >> 1)); - break; - case I2C_EV6_MASTER_REC_MODE_SELECTED: - dp->CR2 &= ~I2C_CR2_ITEVTEN; - 800ebc0: 6062 str r2, [r4, #4] - dmaStreamEnable(i2cp->dmarx); - 800ebc2: 681a ldr r2, [r3, #0] - 800ebc4: f042 0201 orr.w r2, r2, #1 - 800ebc8: 601a str r2, [r3, #0] - dp->CR2 |= I2C_CR2_LAST; /* Needed in receiver mode. */ - 800ebca: 6862 ldr r2, [r4, #4] - 800ebcc: f442 5280 orr.w r2, r2, #4096 ; 0x1000 - 800ebd0: 6062 str r2, [r4, #4] - if (dmaStreamGetTransactionSize(i2cp->dmarx) < 2) - 800ebd2: 685b ldr r3, [r3, #4] - 800ebd4: 2b01 cmp r3, #1 - 800ebd6: d94b bls.n 800ec70 - break; - default: - break; - } - /* Clear ADDR flag. */ - if (event & (I2C_SR1_ADDR | I2C_SR1_ADD10)) - 800ebd8: f015 0f0a tst.w r5, #10 - (void)dp->SR2; - 800ebdc: bf18 it ne - 800ebde: 69a3 ldrne r3, [r4, #24] - OSAL_IRQ_PROLOGUE(); - - i2c_lld_serve_event_interrupt(&I2CD2); - - OSAL_IRQ_EPILOGUE(); -} - 800ebe0: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} - - OSAL_IRQ_PROLOGUE(); - - i2c_lld_serve_event_interrupt(&I2CD2); - - OSAL_IRQ_EPILOGUE(); - 800ebe4: f7fe bce4 b.w 800d5b0 <_port_irq_epilogue> - uint32_t event = dp->SR1; - - /* Interrupts are disabled just before dmaStreamEnable() because there - is no need of interrupts until next transaction begin. All the work is - done by the DMA.*/ - switch (I2C_EV_MASK & (event | (regSR2 << 16))) { - 800ebe8: 4a26 ldr r2, [pc, #152] ; (800ec84 ) - 800ebea: 4293 cmp r3, r2 - 800ebec: d012 beq.n 800ec14 - 800ebee: 3202 adds r2, #2 - 800ebf0: 4293 cmp r3, r2 - 800ebf2: d1f1 bne.n 800ebd8 - dp->CR2 &= ~I2C_CR2_ITEVTEN; - dmaStreamEnable(i2cp->dmatx); - break; - case I2C_EV8_2_MASTER_BYTE_TRANSMITTED: - /* Catches BTF event after the end of transmission.*/ - if (dmaStreamGetTransactionSize(i2cp->dmarx) > 0) { - 800ebf4: 6ac3 ldr r3, [r0, #44] ; 0x2c - 800ebf6: 681b ldr r3, [r3, #0] - 800ebf8: 685e ldr r6, [r3, #4] - 800ebfa: b33e cbz r6, 800ec4c - /* Starts "read after write" operation, LSB = 1 -> receive.*/ - i2cp->addr |= 0x01; - dp->CR1 |= I2C_CR1_START | I2C_CR1_ACK; - 800ebfc: 6823 ldr r3, [r4, #0] - break; - case I2C_EV8_2_MASTER_BYTE_TRANSMITTED: - /* Catches BTF event after the end of transmission.*/ - if (dmaStreamGetTransactionSize(i2cp->dmarx) > 0) { - /* Starts "read after write" operation, LSB = 1 -> receive.*/ - i2cp->addr |= 0x01; - 800ebfe: 8c02 ldrh r2, [r0, #32] - dp->CR1 |= I2C_CR1_START | I2C_CR1_ACK; - 800ec00: f443 63a0 orr.w r3, r3, #1280 ; 0x500 - break; - case I2C_EV8_2_MASTER_BYTE_TRANSMITTED: - /* Catches BTF event after the end of transmission.*/ - if (dmaStreamGetTransactionSize(i2cp->dmarx) > 0) { - /* Starts "read after write" operation, LSB = 1 -> receive.*/ - i2cp->addr |= 0x01; - 800ec04: f042 0201 orr.w r2, r2, #1 - 800ec08: 8402 strh r2, [r0, #32] - dp->CR1 |= I2C_CR1_START | I2C_CR1_ACK; - 800ec0a: 6023 str r3, [r4, #0] - OSAL_IRQ_PROLOGUE(); - - i2c_lld_serve_event_interrupt(&I2CD2); - - OSAL_IRQ_EPILOGUE(); -} - 800ec0c: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} - - OSAL_IRQ_PROLOGUE(); - - i2c_lld_serve_event_interrupt(&I2CD2); - - OSAL_IRQ_EPILOGUE(); - 800ec10: f7fe bcce b.w 800d5b0 <_port_irq_epilogue> - dp->CR2 |= I2C_CR2_LAST; /* Needed in receiver mode. */ - if (dmaStreamGetTransactionSize(i2cp->dmarx) < 2) - dp->CR1 &= ~I2C_CR1_ACK; - break; - case I2C_EV6_MASTER_TRA_MODE_SELECTED: - dp->CR2 &= ~I2C_CR2_ITEVTEN; - 800ec14: 6863 ldr r3, [r4, #4] - dmaStreamEnable(i2cp->dmatx); - 800ec16: 6b02 ldr r2, [r0, #48] ; 0x30 - dp->CR2 |= I2C_CR2_LAST; /* Needed in receiver mode. */ - if (dmaStreamGetTransactionSize(i2cp->dmarx) < 2) - dp->CR1 &= ~I2C_CR1_ACK; - break; - case I2C_EV6_MASTER_TRA_MODE_SELECTED: - dp->CR2 &= ~I2C_CR2_ITEVTEN; - 800ec18: f423 7300 bic.w r3, r3, #512 ; 0x200 - dmaStreamEnable(i2cp->dmatx); - 800ec1c: 6812 ldr r2, [r2, #0] - dp->CR2 |= I2C_CR2_LAST; /* Needed in receiver mode. */ - if (dmaStreamGetTransactionSize(i2cp->dmarx) < 2) - dp->CR1 &= ~I2C_CR1_ACK; - break; - case I2C_EV6_MASTER_TRA_MODE_SELECTED: - dp->CR2 &= ~I2C_CR2_ITEVTEN; - 800ec1e: 6063 str r3, [r4, #4] - dmaStreamEnable(i2cp->dmatx); - 800ec20: 6813 ldr r3, [r2, #0] - 800ec22: f043 0301 orr.w r3, r3, #1 - 800ec26: 6013 str r3, [r2, #0] - 800ec28: e7d6 b.n 800ebd8 - /* Interrupts are disabled just before dmaStreamEnable() because there - is no need of interrupts until next transaction begin. All the work is - done by the DMA.*/ - switch (I2C_EV_MASK & (event | (regSR2 << 16))) { - case I2C_EV5_MASTER_MODE_SELECT: - if ((i2cp->addr >> 8) > 0) { - 800ec2a: 8c03 ldrh r3, [r0, #32] - 800ec2c: 0a1a lsrs r2, r3, #8 - 800ec2e: d00b beq.n 800ec48 - /* 10-bit address: 1 1 1 1 0 X X R/W */ - dp->DR = 0xF0 | (0x6 & (i2cp->addr >> 8)) | (0x1 & i2cp->addr); - 800ec30: f003 0301 and.w r3, r3, #1 - 800ec34: f043 03f0 orr.w r3, r3, #240 ; 0xf0 - 800ec38: f002 0206 and.w r2, r2, #6 - 800ec3c: 4313 orrs r3, r2 - 800ec3e: 6123 str r3, [r4, #16] - 800ec40: e7ca b.n 800ebd8 - dp->DR = i2cp->addr; - } - break; - case I2C_EV9_MASTER_ADD10: - /* Set second addr byte (10-bit addressing)*/ - dp->DR = (0xFF & (i2cp->addr >> 1)); - 800ec42: 8c03 ldrh r3, [r0, #32] - 800ec44: f3c3 0347 ubfx r3, r3, #1, #8 - 800ec48: 6123 str r3, [r4, #16] - 800ec4a: e7c5 b.n 800ebd8 - /* Starts "read after write" operation, LSB = 1 -> receive.*/ - i2cp->addr |= 0x01; - dp->CR1 |= I2C_CR1_START | I2C_CR1_ACK; - return; - } - dp->CR2 &= ~I2C_CR2_ITEVTEN; - 800ec4c: 6863 ldr r3, [r4, #4] - 800ec4e: f423 7300 bic.w r3, r3, #512 ; 0x200 - 800ec52: 6063 str r3, [r4, #4] - dp->CR1 |= I2C_CR1_STOP; - 800ec54: 6823 ldr r3, [r4, #0] - 800ec56: f443 7300 orr.w r3, r3, #512 ; 0x200 - 800ec5a: 6023 str r3, [r4, #0] - 800ec5c: 2320 movs r3, #32 - 800ec5e: f383 8811 msr BASEPRI, r3 - * - * @iclass - */ -static inline void osalThreadResumeI(thread_reference_t *trp, msg_t msg) { - - chThdResumeI(trp, msg); - 800ec62: 301c adds r0, #28 - 800ec64: 4631 mov r1, r6 - 800ec66: f7fe fa63 bl 800d130 - 800ec6a: f386 8811 msr BASEPRI, r6 - 800ec6e: e7b3 b.n 800ebd8 - case I2C_EV6_MASTER_REC_MODE_SELECTED: - dp->CR2 &= ~I2C_CR2_ITEVTEN; - dmaStreamEnable(i2cp->dmarx); - dp->CR2 |= I2C_CR2_LAST; /* Needed in receiver mode. */ - if (dmaStreamGetTransactionSize(i2cp->dmarx) < 2) - dp->CR1 &= ~I2C_CR1_ACK; - 800ec70: 6823 ldr r3, [r4, #0] - 800ec72: f423 6380 bic.w r3, r3, #1024 ; 0x400 - 800ec76: 6023 str r3, [r4, #0] - 800ec78: e7ae b.n 800ebd8 - 800ec7a: bf00 nop - 800ec7c: 20000f74 .word 0x20000f74 - 800ec80: 00030008 .word 0x00030008 - 800ec84: 00070082 .word 0x00070082 - 800ec88: f3af 8000 nop.w - 800ec8c: f3af 8000 nop.w - -0800ec90 : - * @brief I2C2 error interrupt handler. - * - * @notapi - */ -OSAL_IRQ_HANDLER(STM32_I2C2_ERROR_HANDLER) { - uint16_t sr = I2CD2.i2c->SR1; - 800ec90: 4834 ldr r0, [pc, #208] ; (800ed64 ) -/** - * @brief I2C2 error interrupt handler. - * - * @notapi - */ -OSAL_IRQ_HANDLER(STM32_I2C2_ERROR_HANDLER) { - 800ec92: b5f8 push {r3, r4, r5, r6, r7, lr} - uint16_t sr = I2CD2.i2c->SR1; - 800ec94: 6b44 ldr r4, [r0, #52] ; 0x34 - * @notapi - */ -static void i2c_lld_serve_error_interrupt(I2CDriver *i2cp, uint16_t sr) { - - /* Clears interrupt flags just to be safe.*/ - dmaStreamDisable(i2cp->dmatx); - 800ec96: 6b07 ldr r7, [r0, #48] ; 0x30 - * @brief I2C2 error interrupt handler. - * - * @notapi - */ -OSAL_IRQ_HANDLER(STM32_I2C2_ERROR_HANDLER) { - uint16_t sr = I2CD2.i2c->SR1; - 800ec98: 6966 ldr r6, [r4, #20] - * @notapi - */ -static void i2c_lld_serve_error_interrupt(I2CDriver *i2cp, uint16_t sr) { - - /* Clears interrupt flags just to be safe.*/ - dmaStreamDisable(i2cp->dmatx); - 800ec9a: 683a ldr r2, [r7, #0] - * @brief I2C2 error interrupt handler. - * - * @notapi - */ -OSAL_IRQ_HANDLER(STM32_I2C2_ERROR_HANDLER) { - uint16_t sr = I2CD2.i2c->SR1; - 800ec9c: b2b1 uxth r1, r6 - - OSAL_IRQ_PROLOGUE(); - - I2CD2.i2c->SR1 = ~(sr & I2C_ERROR_MASK); - 800ec9e: f401 435f and.w r3, r1, #57088 ; 0xdf00 - 800eca2: 43db mvns r3, r3 - 800eca4: 6163 str r3, [r4, #20] - * @notapi - */ -static void i2c_lld_serve_error_interrupt(I2CDriver *i2cp, uint16_t sr) { - - /* Clears interrupt flags just to be safe.*/ - dmaStreamDisable(i2cp->dmatx); - 800eca6: 6813 ldr r3, [r2, #0] - 800eca8: f023 031f bic.w r3, r3, #31 - 800ecac: 6013 str r3, [r2, #0] - 800ecae: 6813 ldr r3, [r2, #0] - 800ecb0: 07db lsls r3, r3, #31 - 800ecb2: d4fc bmi.n 800ecae - 800ecb4: f897 e008 ldrb.w lr, [r7, #8] - dmaStreamDisable(i2cp->dmarx); - 800ecb8: 6ac5 ldr r5, [r0, #44] ; 0x2c - * @notapi - */ -static void i2c_lld_serve_error_interrupt(I2CDriver *i2cp, uint16_t sr) { - - /* Clears interrupt flags just to be safe.*/ - dmaStreamDisable(i2cp->dmatx); - 800ecba: 687f ldr r7, [r7, #4] - dmaStreamDisable(i2cp->dmarx); - 800ecbc: 682a ldr r2, [r5, #0] - * @notapi - */ -static void i2c_lld_serve_error_interrupt(I2CDriver *i2cp, uint16_t sr) { - - /* Clears interrupt flags just to be safe.*/ - dmaStreamDisable(i2cp->dmatx); - 800ecbe: 233d movs r3, #61 ; 0x3d - 800ecc0: fa03 f30e lsl.w r3, r3, lr - 800ecc4: 603b str r3, [r7, #0] - dmaStreamDisable(i2cp->dmarx); - 800ecc6: 6813 ldr r3, [r2, #0] - 800ecc8: f023 031f bic.w r3, r3, #31 - 800eccc: 6013 str r3, [r2, #0] - 800ecce: 6813 ldr r3, [r2, #0] - 800ecd0: f013 0301 ands.w r3, r3, #1 - 800ecd4: d1fb bne.n 800ecce - 800ecd6: 7a2f ldrb r7, [r5, #8] - 800ecd8: 686d ldr r5, [r5, #4] - 800ecda: 223d movs r2, #61 ; 0x3d - 800ecdc: 40ba lsls r2, r7 - - i2cp->errors = I2C_NO_ERROR; - - if (sr & I2C_SR1_BERR) /* Bus error. */ - 800ecde: 05cf lsls r7, r1, #23 - */ -static void i2c_lld_serve_error_interrupt(I2CDriver *i2cp, uint16_t sr) { - - /* Clears interrupt flags just to be safe.*/ - dmaStreamDisable(i2cp->dmatx); - dmaStreamDisable(i2cp->dmarx); - 800ece0: 602a str r2, [r5, #0] - - i2cp->errors = I2C_NO_ERROR; - - if (sr & I2C_SR1_BERR) /* Bus error. */ - i2cp->errors |= I2C_BUS_ERROR; - 800ece2: bf48 it mi - 800ece4: 2301 movmi r3, #1 - - if (sr & I2C_SR1_ARLO) /* Arbitration lost. */ - 800ece6: 058d lsls r5, r1, #22 - dmaStreamDisable(i2cp->dmarx); - - i2cp->errors = I2C_NO_ERROR; - - if (sr & I2C_SR1_BERR) /* Bus error. */ - i2cp->errors |= I2C_BUS_ERROR; - 800ece8: 6083 str r3, [r0, #8] - - if (sr & I2C_SR1_ARLO) /* Arbitration lost. */ - i2cp->errors |= I2C_ARBITRATION_LOST; - 800ecea: bf44 itt mi - 800ecec: f043 0302 orrmi.w r3, r3, #2 - 800ecf0: 6083 strmi r3, [r0, #8] - - if (sr & I2C_SR1_AF) { /* Acknowledge fail. */ - 800ecf2: 054a lsls r2, r1, #21 - 800ecf4: d50a bpl.n 800ed0c - i2cp->i2c->CR2 &= ~I2C_CR2_ITEVTEN; - 800ecf6: 6862 ldr r2, [r4, #4] - 800ecf8: f422 7200 bic.w r2, r2, #512 ; 0x200 - 800ecfc: 6062 str r2, [r4, #4] - i2cp->i2c->CR1 |= I2C_CR1_STOP; /* Setting stop bit. */ - 800ecfe: 6822 ldr r2, [r4, #0] - i2cp->errors |= I2C_ACK_FAILURE; - 800ed00: f043 0304 orr.w r3, r3, #4 - if (sr & I2C_SR1_ARLO) /* Arbitration lost. */ - i2cp->errors |= I2C_ARBITRATION_LOST; - - if (sr & I2C_SR1_AF) { /* Acknowledge fail. */ - i2cp->i2c->CR2 &= ~I2C_CR2_ITEVTEN; - i2cp->i2c->CR1 |= I2C_CR1_STOP; /* Setting stop bit. */ - 800ed04: f442 7200 orr.w r2, r2, #512 ; 0x200 - 800ed08: 6022 str r2, [r4, #0] - i2cp->errors |= I2C_ACK_FAILURE; - 800ed0a: 6083 str r3, [r0, #8] - } - - if (sr & I2C_SR1_OVR) /* Overrun. */ - 800ed0c: 050f lsls r7, r1, #20 - i2cp->errors |= I2C_OVERRUN; - 800ed0e: bf44 itt mi - 800ed10: f043 0308 orrmi.w r3, r3, #8 - 800ed14: 6083 strmi r3, [r0, #8] - - if (sr & I2C_SR1_TIMEOUT) /* SMBus Timeout. */ - 800ed16: 044d lsls r5, r1, #17 - i2cp->errors |= I2C_TIMEOUT; - 800ed18: bf44 itt mi - 800ed1a: f043 0320 orrmi.w r3, r3, #32 - 800ed1e: 6083 strmi r3, [r0, #8] - - if (sr & I2C_SR1_PECERR) /* PEC error. */ - 800ed20: 04cc lsls r4, r1, #19 - 800ed22: d513 bpl.n 800ed4c - i2cp->errors |= I2C_PEC_ERROR; - 800ed24: f043 0310 orr.w r3, r3, #16 - - if (sr & I2C_SR1_SMBALERT) /* SMBus alert. */ - 800ed28: 0431 lsls r1, r6, #16 - - if (sr & I2C_SR1_TIMEOUT) /* SMBus Timeout. */ - i2cp->errors |= I2C_TIMEOUT; - - if (sr & I2C_SR1_PECERR) /* PEC error. */ - i2cp->errors |= I2C_PEC_ERROR; - 800ed2a: 6083 str r3, [r0, #8] - - if (sr & I2C_SR1_SMBALERT) /* SMBus alert. */ - 800ed2c: d416 bmi.n 800ed5c - 800ed2e: 2320 movs r3, #32 - 800ed30: f383 8811 msr BASEPRI, r3 - 800ed34: 480c ldr r0, [pc, #48] ; (800ed68 ) - 800ed36: f06f 0101 mvn.w r1, #1 - 800ed3a: f7fe f9f9 bl 800d130 - 800ed3e: 2300 movs r3, #0 - 800ed40: f383 8811 msr BASEPRI, r3 - - I2CD2.i2c->SR1 = ~(sr & I2C_ERROR_MASK); - i2c_lld_serve_error_interrupt(&I2CD2, sr); - - OSAL_IRQ_EPILOGUE(); -} - 800ed44: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr} - OSAL_IRQ_PROLOGUE(); - - I2CD2.i2c->SR1 = ~(sr & I2C_ERROR_MASK); - i2c_lld_serve_error_interrupt(&I2CD2, sr); - - OSAL_IRQ_EPILOGUE(); - 800ed48: f7fe bc32 b.w 800d5b0 <_port_irq_epilogue> - i2cp->errors |= I2C_TIMEOUT; - - if (sr & I2C_SR1_PECERR) /* PEC error. */ - i2cp->errors |= I2C_PEC_ERROR; - - if (sr & I2C_SR1_SMBALERT) /* SMBus alert. */ - 800ed4c: 0432 lsls r2, r6, #16 - 800ed4e: d405 bmi.n 800ed5c - i2cp->errors |= I2C_SMB_ALERT; - - /* If some error has been identified then sends wakes the waiting thread.*/ - if (i2cp->errors != I2C_NO_ERROR) - 800ed50: 2b00 cmp r3, #0 - 800ed52: d1ec bne.n 800ed2e - - I2CD2.i2c->SR1 = ~(sr & I2C_ERROR_MASK); - i2c_lld_serve_error_interrupt(&I2CD2, sr); - - OSAL_IRQ_EPILOGUE(); -} - 800ed54: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr} - OSAL_IRQ_PROLOGUE(); - - I2CD2.i2c->SR1 = ~(sr & I2C_ERROR_MASK); - i2c_lld_serve_error_interrupt(&I2CD2, sr); - - OSAL_IRQ_EPILOGUE(); - 800ed58: f7fe bc2a b.w 800d5b0 <_port_irq_epilogue> - - if (sr & I2C_SR1_PECERR) /* PEC error. */ - i2cp->errors |= I2C_PEC_ERROR; - - if (sr & I2C_SR1_SMBALERT) /* SMBus alert. */ - i2cp->errors |= I2C_SMB_ALERT; - 800ed5c: f043 0340 orr.w r3, r3, #64 ; 0x40 - 800ed60: 6083 str r3, [r0, #8] - 800ed62: e7e4 b.n 800ed2e - 800ed64: 20000f74 .word 0x20000f74 - 800ed68: 20000f90 .word 0x20000f90 - 800ed6c: f3af 8000 nop.w - -0800ed70 : -/** - * @brief Low level I2C driver initialization. - * - * @notapi - */ -void i2c_lld_init(void) { - 800ed70: b510 push {r4, lr} - I2CD1.dmarx = STM32_DMA_STREAM(STM32_I2C_I2C1_RX_DMA_STREAM); - I2CD1.dmatx = STM32_DMA_STREAM(STM32_I2C_I2C1_TX_DMA_STREAM); -#endif /* STM32_I2C_USE_I2C1 */ - -#if STM32_I2C_USE_I2C2 - i2cObjectInit(&I2CD2); - 800ed72: 4c07 ldr r4, [pc, #28] ; (800ed90 ) - 800ed74: 4620 mov r0, r4 - 800ed76: f7fe fca3 bl 800d6c0 - I2CD2.thread = NULL; - I2CD2.i2c = I2C2; - I2CD2.dmarx = STM32_DMA_STREAM(STM32_I2C_I2C2_RX_DMA_STREAM); - 800ed7a: 4b06 ldr r3, [pc, #24] ; (800ed94 ) -#endif /* STM32_I2C_USE_I2C1 */ - -#if STM32_I2C_USE_I2C2 - i2cObjectInit(&I2CD2); - I2CD2.thread = NULL; - I2CD2.i2c = I2C2; - 800ed7c: 4a06 ldr r2, [pc, #24] ; (800ed98 ) - 800ed7e: 6362 str r2, [r4, #52] ; 0x34 - I2CD1.dmatx = STM32_DMA_STREAM(STM32_I2C_I2C1_TX_DMA_STREAM); -#endif /* STM32_I2C_USE_I2C1 */ - -#if STM32_I2C_USE_I2C2 - i2cObjectInit(&I2CD2); - I2CD2.thread = NULL; - 800ed80: 2100 movs r1, #0 - I2CD2.i2c = I2C2; - I2CD2.dmarx = STM32_DMA_STREAM(STM32_I2C_I2C2_RX_DMA_STREAM); - I2CD2.dmatx = STM32_DMA_STREAM(STM32_I2C_I2C2_TX_DMA_STREAM); - 800ed82: f103 023c add.w r2, r3, #60 ; 0x3c - I2CD1.dmatx = STM32_DMA_STREAM(STM32_I2C_I2C1_TX_DMA_STREAM); -#endif /* STM32_I2C_USE_I2C1 */ - -#if STM32_I2C_USE_I2C2 - i2cObjectInit(&I2CD2); - I2CD2.thread = NULL; - 800ed86: 61e1 str r1, [r4, #28] - I2CD2.i2c = I2C2; - I2CD2.dmarx = STM32_DMA_STREAM(STM32_I2C_I2C2_RX_DMA_STREAM); - 800ed88: 62e3 str r3, [r4, #44] ; 0x2c - I2CD2.dmatx = STM32_DMA_STREAM(STM32_I2C_I2C2_TX_DMA_STREAM); - 800ed8a: 6322 str r2, [r4, #48] ; 0x30 - 800ed8c: bd10 pop {r4, pc} - 800ed8e: bf00 nop - 800ed90: 20000f74 .word 0x20000f74 - 800ed94: 08013218 .word 0x08013218 - 800ed98: 40005800 .word 0x40005800 - 800ed9c: f3af 8000 nop.w - -0800eda0 : - * - * @param[in] p pointer to the @p USBDriver object - * - * @special - */ -void usb_lld_pump(void *p) { - 800eda0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - * @api - */ -static inline void chRegSetThreadName(const char *name) { - -#if CH_CFG_USE_REGISTRY == TRUE - ch.rlist.r_current->p_name = name; - 800eda4: 4bb2 ldr r3, [pc, #712] ; (800f070 ) - 800eda6: 49b3 ldr r1, [pc, #716] ; (800f074 ) - 800eda8: 699a ldr r2, [r3, #24] - USBDriver *usbp = (USBDriver *)p; - stm32_otg_t *otgp = usbp->otg; - 800edaa: f8d0 a050 ldr.w sl, [r0, #80] ; 0x50 - 800edae: 6191 str r1, [r2, #24] - * - * @param[in] p pointer to the @p USBDriver object - * - * @special - */ -void usb_lld_pump(void *p) { - 800edb0: b085 sub sp, #20 - 800edb2: 2320 movs r3, #32 - 800edb4: f383 8811 msr BASEPRI, r3 - 800edb8: f100 0360 add.w r3, r0, #96 ; 0x60 - 800edbc: 46d3 mov fp, sl - 800edbe: 9303 str r3, [sp, #12] - 800edc0: 4682 mov sl, r0 - while (true) { - usbep_t ep; - uint32_t epmask; - - /* Nothing to do, going to sleep.*/ - if ((usbp->state == USB_STOP) || - 800edc2: f89a 3000 ldrb.w r3, [sl] - 800edc6: 2b01 cmp r3, #1 - 800edc8: d006 beq.n 800edd8 - 800edca: f8da 305c ldr.w r3, [sl, #92] ; 0x5c - 800edce: b963 cbnz r3, 800edea - ((usbp->txpending == 0) && !(otgp->GINTSTS & GINTSTS_RXFLVL))) { - 800edd0: f8db 3014 ldr.w r3, [fp, #20] - 800edd4: 06db lsls r3, r3, #27 - 800edd6: d408 bmi.n 800edea - otgp->GINTMSK |= GINTMSK_RXFLVLM; - 800edd8: f8db 3018 ldr.w r3, [fp, #24] - * - * @sclass - */ -static inline msg_t osalThreadSuspendS(thread_reference_t *trp) { - - return chThdSuspendS(trp); - 800eddc: 9803 ldr r0, [sp, #12] - 800edde: f043 0310 orr.w r3, r3, #16 - 800ede2: f8cb 3018 str.w r3, [fp, #24] - 800ede6: f7fe f993 bl 800d110 - 800edea: 2300 movs r3, #0 - 800edec: f383 8811 msr BASEPRI, r3 - 800edf0: 4698 mov r8, r3 - - /* Checks if there are TXFIFOs to be filled.*/ - for (ep = 0; ep <= usbp->otgparams->num_endpoints; ep++) { - - /* Empties the RX FIFO.*/ - while (otgp->GINTSTS & GINTSTS_RXFLVL) { - 800edf2: f8db 3014 ldr.w r3, [fp, #20] - 800edf6: f013 0310 ands.w r3, r3, #16 - 800edfa: d024 beq.n 800ee46 - * @notapi - */ -static void otg_rxfifo_handler(USBDriver *usbp) { - uint32_t sts, cnt, ep; - - sts = usbp->otg->GRXSTSP; - 800edfc: f8da 2050 ldr.w r2, [sl, #80] ; 0x50 - 800ee00: 6a13 ldr r3, [r2, #32] - switch (sts & GRXSTSP_PKTSTS_MASK) { - 800ee02: f403 11f0 and.w r1, r3, #1966080 ; 0x1e0000 - 800ee06: f5b1 2f80 cmp.w r1, #262144 ; 0x40000 - 800ee0a: d031 beq.n 800ee70 - 800ee0c: f5b1 2f40 cmp.w r1, #786432 ; 0xc0000 - 800ee10: d1ef bne.n 800edf2 - case GRXSTSP_SETUP_COMP: - break; - case GRXSTSP_SETUP_DATA: - cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF; - ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; - 800ee12: f003 010f and.w r1, r3, #15 - otg_fifo_read_to_buffer(usbp->otg->FIFO[0], usbp->epc[ep]->setup_buf, - 800ee16: eb0a 0181 add.w r1, sl, r1, lsl #2 - sts = usbp->otg->GRXSTSP; - switch (sts & GRXSTSP_PKTSTS_MASK) { - case GRXSTSP_SETUP_COMP: - break; - case GRXSTSP_SETUP_DATA: - cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF; - 800ee1a: f3c3 130a ubfx r3, r3, #4, #11 - ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; - otg_fifo_read_to_buffer(usbp->otg->FIFO[0], usbp->epc[ep]->setup_buf, - 800ee1e: 68c9 ldr r1, [r1, #12] -static void otg_fifo_read_to_buffer(volatile uint32_t *fifop, - uint8_t *buf, - size_t n, - size_t max) { - - n = (n + 3) / 4; - 800ee20: 3303 adds r3, #3 - max = (max + 3) / 4; - while (n) { - 800ee22: 089b lsrs r3, r3, #2 - case GRXSTSP_SETUP_COMP: - break; - case GRXSTSP_SETUP_DATA: - cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF; - ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; - otg_fifo_read_to_buffer(usbp->otg->FIFO[0], usbp->epc[ep]->setup_buf, - 800ee24: 6a0c ldr r4, [r1, #32] - size_t n, - size_t max) { - - n = (n + 3) / 4; - max = (max + 3) / 4; - while (n) { - 800ee26: d0e4 beq.n 800edf2 - 800ee28: f502 5280 add.w r2, r2, #4096 ; 0x1000 - 800ee2c: 2102 movs r1, #2 - uint32_t w = *fifop; - 800ee2e: 6810 ldr r0, [r2, #0] - if (max) { - 800ee30: b111 cbz r1, 800ee38 - /* Note, this line relies on the Cortex-M3/M4 ability to perform - unaligned word accesses and on the LSB-first memory organization.*/ - *((PACKED_VAR uint32_t *)buf) = w; - 800ee32: f844 0b04 str.w r0, [r4], #4 - buf += 4; - max--; - 800ee36: 3901 subs r1, #1 - size_t n, - size_t max) { - - n = (n + 3) / 4; - max = (max + 3) / 4; - while (n) { - 800ee38: 3b01 subs r3, #1 - 800ee3a: d1f8 bne.n 800ee2e - - /* Checks if there are TXFIFOs to be filled.*/ - for (ep = 0; ep <= usbp->otgparams->num_endpoints; ep++) { - - /* Empties the RX FIFO.*/ - while (otgp->GINTSTS & GINTSTS_RXFLVL) { - 800ee3c: f8db 3014 ldr.w r3, [fp, #20] - 800ee40: f013 0310 ands.w r3, r3, #16 - 800ee44: d1da bne.n 800edfc - otg_rxfifo_handler(usbp); - } - - epmask = (1 << ep); - 800ee46: 2101 movs r1, #1 - if (usbp->txpending & epmask) { - 800ee48: f8da 205c ldr.w r2, [sl, #92] ; 0x5c - /* Empties the RX FIFO.*/ - while (otgp->GINTSTS & GINTSTS_RXFLVL) { - otg_rxfifo_handler(usbp); - } - - epmask = (1 << ep); - 800ee4c: fa01 f108 lsl.w r1, r1, r8 - if (usbp->txpending & epmask) { - 800ee50: 4211 tst r1, r2 - /* Empties the RX FIFO.*/ - while (otgp->GINTSTS & GINTSTS_RXFLVL) { - otg_rxfifo_handler(usbp); - } - - epmask = (1 << ep); - 800ee52: 9101 str r1, [sp, #4] - if (usbp->txpending & epmask) { - 800ee54: d168 bne.n 800ef28 - 800ee56: f108 0801 add.w r8, r8, #1 - osalThreadSuspendS(&usbp->wait); - } - osalSysUnlock(); - - /* Checks if there are TXFIFOs to be filled.*/ - for (ep = 0; ep <= usbp->otgparams->num_endpoints; ep++) { - 800ee5a: f8da 3054 ldr.w r3, [sl, #84] ; 0x54 - 800ee5e: 689b ldr r3, [r3, #8] - 800ee60: fa5f f888 uxtb.w r8, r8 - 800ee64: 4598 cmp r8, r3 - 800ee66: d9c4 bls.n 800edf2 - 800ee68: 2320 movs r3, #32 - 800ee6a: f383 8811 msr BASEPRI, r3 - 800ee6e: e7a8 b.n 800edc2 - otg_fifo_read_to_buffer(usbp->otg->FIFO[0], usbp->epc[ep]->setup_buf, - cnt, 8); - break; - case GRXSTSP_OUT_DATA: - cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF; - ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; - 800ee70: f003 050f and.w r5, r3, #15 - 800ee74: eb0a 0585 add.w r5, sl, r5, lsl #2 - ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; - otg_fifo_read_to_buffer(usbp->otg->FIFO[0], usbp->epc[ep]->setup_buf, - cnt, 8); - break; - case GRXSTSP_OUT_DATA: - cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF; - 800ee78: f3c3 140a ubfx r4, r3, #4, #11 - ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; - if (usbp->epc[ep]->out_state->rxqueued) { - 800ee7c: 68eb ldr r3, [r5, #12] - 800ee7e: 6998 ldr r0, [r3, #24] - 800ee80: 7803 ldrb r3, [r0, #0] - 800ee82: b9db cbnz r3, 800eebc - 800ee84: 6843 ldr r3, [r0, #4] - uint8_t *buf, - size_t n, - size_t max) { - - n = (n + 3) / 4; - max = (max + 3) / 4; - 800ee86: 6881 ldr r1, [r0, #8] - otg_fifo_read_to_queue(usbp->otg->FIFO[0], - usbp->epc[ep]->out_state->mode.queue.rxqueue, - cnt); - } - else { - otg_fifo_read_to_buffer(usbp->otg->FIFO[0], - 800ee88: 68c6 ldr r6, [r0, #12] - 800ee8a: 3303 adds r3, #3 - uint8_t *buf, - size_t n, - size_t max) { - - n = (n + 3) / 4; - max = (max + 3) / 4; - 800ee8c: 1a59 subs r1, r3, r1 -static void otg_fifo_read_to_buffer(volatile uint32_t *fifop, - uint8_t *buf, - size_t n, - size_t max) { - - n = (n + 3) / 4; - 800ee8e: 1ce3 adds r3, r4, #3 - max = (max + 3) / 4; - while (n) { - 800ee90: 089b lsrs r3, r3, #2 - uint8_t *buf, - size_t n, - size_t max) { - - n = (n + 3) / 4; - max = (max + 3) / 4; - 800ee92: ea4f 0191 mov.w r1, r1, lsr #2 - while (n) { - 800ee96: d009 beq.n 800eeac - 800ee98: f502 5280 add.w r2, r2, #4096 ; 0x1000 - 800ee9c: 46b6 mov lr, r6 - uint32_t w = *fifop; - 800ee9e: 6817 ldr r7, [r2, #0] - if (max) { - 800eea0: b111 cbz r1, 800eea8 - /* Note, this line relies on the Cortex-M3/M4 ability to perform - unaligned word accesses and on the LSB-first memory organization.*/ - *((PACKED_VAR uint32_t *)buf) = w; - 800eea2: f84e 7b04 str.w r7, [lr], #4 - buf += 4; - max--; - 800eea6: 3901 subs r1, #1 - size_t n, - size_t max) { - - n = (n + 3) / 4; - max = (max + 3) / 4; - while (n) { - 800eea8: 3b01 subs r3, #1 - 800eeaa: d1f8 bne.n 800ee9e - otg_fifo_read_to_buffer(usbp->otg->FIFO[0], - usbp->epc[ep]->out_state->mode.linear.rxbuf, - cnt, - usbp->epc[ep]->out_state->rxsize - - usbp->epc[ep]->out_state->rxcnt); - usbp->epc[ep]->out_state->mode.linear.rxbuf += cnt; - 800eeac: 4426 add r6, r4 - 800eeae: 60c6 str r6, [r0, #12] - } - usbp->epc[ep]->out_state->rxcnt += cnt; - 800eeb0: 68eb ldr r3, [r5, #12] - 800eeb2: 699a ldr r2, [r3, #24] - 800eeb4: 6893 ldr r3, [r2, #8] - 800eeb6: 4423 add r3, r4 - 800eeb8: 6093 str r3, [r2, #8] - 800eeba: e79a b.n 800edf2 - case GRXSTSP_OUT_DATA: - cnt = (sts & GRXSTSP_BCNT_MASK) >> GRXSTSP_BCNT_OFF; - ep = (sts & GRXSTSP_EPNUM_MASK) >> GRXSTSP_EPNUM_OFF; - if (usbp->epc[ep]->out_state->rxqueued) { - /* Queue associated.*/ - otg_fifo_read_to_queue(usbp->otg->FIFO[0], - 800eebc: 68c0 ldr r0, [r0, #12] - input_queue_t *iqp, - size_t n) { - size_t ntogo; - - ntogo = n; - while (ntogo > 0) { - 800eebe: b324 cbz r4, 800ef0a - 800eec0: f502 5280 add.w r2, r2, #4096 ; 0x1000 - 800eec4: 4626 mov r6, r4 - uint32_t w, i; - size_t nw = ntogo / 4; - - if (nw > 0) { - 800eec6: 2e03 cmp r6, #3 - size_t streak; - uint32_t nw2end = (iqp->q_wrptr - iqp->q_wrptr) / 4; - - ntogo -= (streak = nw <= nw2end ? nw : nw2end) * 4; - iqp->q_wrptr = otg_do_pop(fifop, iqp->q_wrptr, streak); - 800eec8: 6941 ldr r1, [r0, #20] - ntogo = n; - while (ntogo > 0) { - uint32_t w, i; - size_t nw = ntogo / 4; - - if (nw > 0) { - 800eeca: d907 bls.n 800eedc - size_t streak; - uint32_t nw2end = (iqp->q_wrptr - iqp->q_wrptr) / 4; - - ntogo -= (streak = nw <= nw2end ? nw : nw2end) * 4; - iqp->q_wrptr = otg_do_pop(fifop, iqp->q_wrptr, streak); - if (iqp->q_wrptr >= iqp->q_top) { - 800eecc: 6903 ldr r3, [r0, #16] - 800eece: 4299 cmp r1, r3 - 800eed0: d304 bcc.n 800eedc - iqp->q_wrptr = iqp->q_buffer; - 800eed2: 68c3 ldr r3, [r0, #12] - 800eed4: 6143 str r3, [r0, #20] - ntogo = n; - while (ntogo > 0) { - uint32_t w, i; - size_t nw = ntogo / 4; - - if (nw > 0) { - 800eed6: 2e03 cmp r6, #3 - size_t streak; - uint32_t nw2end = (iqp->q_wrptr - iqp->q_wrptr) / 4; - - ntogo -= (streak = nw <= nw2end ? nw : nw2end) * 4; - iqp->q_wrptr = otg_do_pop(fifop, iqp->q_wrptr, streak); - 800eed8: 6941 ldr r1, [r0, #20] - ntogo = n; - while (ntogo > 0) { - uint32_t w, i; - size_t nw = ntogo / 4; - - if (nw > 0) { - 800eeda: d8f7 bhi.n 800eecc - queue circular buffer boundary or there are some remaining bytes.*/ - if (ntogo <= 0) - break; - - /* One byte at time.*/ - w = *fifop; - 800eedc: f8d2 e000 ldr.w lr, [r2] - 800eee0: 2700 movs r7, #0 - i = 0; - while ((ntogo > 0) && (i < 4)) { - *iqp->q_wrptr++ = (uint8_t)(w >> (i * 8)); - 800eee2: f101 0c01 add.w ip, r1, #1 - 800eee6: fa2e f307 lsr.w r3, lr, r7 - 800eeea: f8c0 c014 str.w ip, [r0, #20] - 800eeee: 700b strb r3, [r1, #0] - if (iqp->q_wrptr >= iqp->q_top) - 800eef0: 6903 ldr r3, [r0, #16] - 800eef2: 6941 ldr r1, [r0, #20] - 800eef4: 4299 cmp r1, r3 - iqp->q_wrptr = iqp->q_buffer; - 800eef6: bf24 itt cs - 800eef8: 68c3 ldrcs r3, [r0, #12] - 800eefa: 6143 strcs r3, [r0, #20] - break; - - /* One byte at time.*/ - w = *fifop; - i = 0; - while ((ntogo > 0) && (i < 4)) { - 800eefc: 3e01 subs r6, #1 - 800eefe: d004 beq.n 800ef0a - 800ef00: 2f18 cmp r7, #24 - 800ef02: d0e0 beq.n 800eec6 - 800ef04: 3708 adds r7, #8 - 800ef06: 6941 ldr r1, [r0, #20] - 800ef08: e7eb b.n 800eee2 - 800ef0a: 2320 movs r3, #32 - 800ef0c: f383 8811 msr BASEPRI, r3 - } - } - - /* Updating queue.*/ - osalSysLock(); - iqp->q_counter += n; - 800ef10: 6883 ldr r3, [r0, #8] - 800ef12: 4423 add r3, r4 - 800ef14: 6083 str r3, [r0, #8] - * - * @iclass - */ -static inline void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { - - chThdDequeueAllI(tqp, msg); - 800ef16: 2100 movs r1, #0 - 800ef18: f7fe f932 bl 800d180 - * - * @sclass - */ -static inline void osalOsRescheduleS(void) { - - chSchRescheduleS(); - 800ef1c: f7fe f800 bl 800cf20 - 800ef20: 2300 movs r3, #0 - 800ef22: f383 8811 msr BASEPRI, r3 - 800ef26: e7c3 b.n 800eeb0 - 800ef28: 2220 movs r2, #32 - 800ef2a: f382 8811 msr BASEPRI, r2 - operation. - Synopsys document: DesignWare Cores USB 2.0 Hi-Speed On-The-Go (OTG) - "The application has to finish writing one complete packet before - switching to a different channel/endpoint FIFO. Violating this - rule results in an error.".*/ - otgp->GAHBCFG &= ~GAHBCFG_GINTMSK; - 800ef2e: f8db 1008 ldr.w r1, [fp, #8] - usbp->txpending &= ~epmask; - 800ef32: f8da 205c ldr.w r2, [sl, #92] ; 0x5c - 800ef36: 9801 ldr r0, [sp, #4] - operation. - Synopsys document: DesignWare Cores USB 2.0 Hi-Speed On-The-Go (OTG) - "The application has to finish writing one complete packet before - switching to a different channel/endpoint FIFO. Violating this - rule results in an error.".*/ - otgp->GAHBCFG &= ~GAHBCFG_GINTMSK; - 800ef38: f021 0101 bic.w r1, r1, #1 - usbp->txpending &= ~epmask; - 800ef3c: ea22 0200 bic.w r2, r2, r0 - operation. - Synopsys document: DesignWare Cores USB 2.0 Hi-Speed On-The-Go (OTG) - "The application has to finish writing one complete packet before - switching to a different channel/endpoint FIFO. Violating this - rule results in an error.".*/ - otgp->GAHBCFG &= ~GAHBCFG_GINTMSK; - 800ef40: f8cb 1008 str.w r1, [fp, #8] - usbp->txpending &= ~epmask; - 800ef44: f8ca 205c str.w r2, [sl, #92] ; 0x5c - 800ef48: f383 8811 msr BASEPRI, r3 - 800ef4c: eb0a 0988 add.w r9, sl, r8, lsl #2 - /* The TXFIFO is filled until there is space and data to be transmitted.*/ - while (TRUE) { - uint32_t n; - - /* Transaction end condition.*/ - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - 800ef50: f8d9 000c ldr.w r0, [r9, #12] - 800ef54: 6941 ldr r1, [r0, #20] - 800ef56: 688a ldr r2, [r1, #8] - 800ef58: 684b ldr r3, [r1, #4] - 800ef5a: 429a cmp r2, r3 - 800ef5c: f080 80b1 bcs.w 800f0c2 - if (n > usbp->epc[ep]->in_maxsize) - n = usbp->epc[ep]->in_maxsize; - - /* Checks if in the TXFIFO there is enough space to accommodate the - next packet.*/ - if (((usbp->otg->ie[ep].DTXFSTS & DTXFSTS_INEPTFSAV_MASK) * 4) < n) - 800ef60: f8da 6050 ldr.w r6, [sl, #80] ; 0x50 - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - return TRUE; - - /* Number of bytes remaining in current transaction.*/ - n = usbp->epc[ep]->in_state->txsize - usbp->epc[ep]->in_state->txcnt; - if (n > usbp->epc[ep]->in_maxsize) - 800ef64: 8a07 ldrh r7, [r0, #16] - n = usbp->epc[ep]->in_maxsize; - - /* Checks if in the TXFIFO there is enough space to accommodate the - next packet.*/ - if (((usbp->otg->ie[ep].DTXFSTS & DTXFSTS_INEPTFSAV_MASK) * 4) < n) - 800ef66: ea4f 1048 mov.w r0, r8, lsl #5 - 800ef6a: 4604 mov r4, r0 - 800ef6c: 1830 adds r0, r6, r0 - /* Transaction end condition.*/ - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - return TRUE; - - /* Number of bytes remaining in current transaction.*/ - n = usbp->epc[ep]->in_state->txsize - usbp->epc[ep]->in_state->txcnt; - 800ef6e: 1a9b subs r3, r3, r2 - if (n > usbp->epc[ep]->in_maxsize) - n = usbp->epc[ep]->in_maxsize; - - /* Checks if in the TXFIFO there is enough space to accommodate the - next packet.*/ - if (((usbp->otg->ie[ep].DTXFSTS & DTXFSTS_INEPTFSAV_MASK) * 4) < n) - 800ef70: f8d0 2918 ldr.w r2, [r0, #2328] ; 0x918 - 800ef74: 429f cmp r7, r3 - 800ef76: bf28 it cs - 800ef78: 461f movcs r7, r3 - 800ef7a: b293 uxth r3, r2 - 800ef7c: ebb7 0f83 cmp.w r7, r3, lsl #2 - 800ef80: f108 0801 add.w r8, r8, #1 - 800ef84: d82e bhi.n 800efe4 - 800ef86: f8cd b008 str.w fp, [sp, #8] - 800ef8a: 46a3 mov fp, r4 - -#if STM32_USB_OTGFIFO_FILL_BASEPRI - __set_BASEPRI(CORTEX_PRIO_MASK(STM32_USB_OTGFIFO_FILL_BASEPRI)); -#endif - /* Handles the two cases: linear buffer or queue.*/ - if (usbp->epc[ep]->in_state->txqueued) { - 800ef8c: 780b ldrb r3, [r1, #0] - 800ef8e: 2b00 cmp r3, #0 - 800ef90: d13d bne.n 800f00e - */ -static void otg_fifo_write_from_buffer(volatile uint32_t *fifop, - const uint8_t *buf, - size_t n) { - - otg_do_push(fifop, (uint8_t *)buf, (n + 3) / 4); - 800ef92: 1cfb adds r3, r7, #3 - usbp->epc[ep]->in_state->mode.queue.txqueue, - n); - } - else { - /* Linear buffer associated.*/ - otg_fifo_write_from_buffer(usbp->otg->FIFO[ep], - 800ef94: 68cc ldr r4, [r1, #12] - * - * @notapi - */ -static uint8_t *otg_do_push(volatile uint32_t *fifop, uint8_t *buf, size_t n) { - - while (n > 0) { - 800ef96: 089b lsrs r3, r3, #2 - usbp->epc[ep]->in_state->mode.queue.txqueue, - n); - } - else { - /* Linear buffer associated.*/ - otg_fifo_write_from_buffer(usbp->otg->FIFO[ep], - 800ef98: eb06 3608 add.w r6, r6, r8, lsl #12 - * - * @notapi - */ -static uint8_t *otg_do_push(volatile uint32_t *fifop, uint8_t *buf, size_t n) { - - while (n > 0) { - 800ef9c: bf18 it ne - 800ef9e: 4622 movne r2, r4 - 800efa0: d004 beq.n 800efac - /* Note, this line relies on the Cortex-M3/M4 ability to perform - unaligned word accesses and on the LSB-first memory organization.*/ - *fifop = *((PACKED_VAR uint32_t *)buf); - 800efa2: f852 0b04 ldr.w r0, [r2], #4 - 800efa6: 6030 str r0, [r6, #0] - * - * @notapi - */ -static uint8_t *otg_do_push(volatile uint32_t *fifop, uint8_t *buf, size_t n) { - - while (n > 0) { - 800efa8: 3b01 subs r3, #1 - 800efaa: d1fa bne.n 800efa2 - else { - /* Linear buffer associated.*/ - otg_fifo_write_from_buffer(usbp->otg->FIFO[ep], - usbp->epc[ep]->in_state->mode.linear.txbuf, - n); - usbp->epc[ep]->in_state->mode.linear.txbuf += n; - 800efac: 443c add r4, r7 - 800efae: 60cc str r4, [r1, #12] - } -#if STM32_USB_OTGFIFO_FILL_BASEPRI - __set_BASEPRI(0); -#endif - usbp->epc[ep]->in_state->txcnt += n; - 800efb0: f8d9 000c ldr.w r0, [r9, #12] - 800efb4: 6941 ldr r1, [r0, #20] - 800efb6: 688b ldr r3, [r1, #8] - /* The TXFIFO is filled until there is space and data to be transmitted.*/ - while (TRUE) { - uint32_t n; - - /* Transaction end condition.*/ - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - 800efb8: 684a ldr r2, [r1, #4] - usbp->epc[ep]->in_state->mode.linear.txbuf += n; - } -#if STM32_USB_OTGFIFO_FILL_BASEPRI - __set_BASEPRI(0); -#endif - usbp->epc[ep]->in_state->txcnt += n; - 800efba: 443b add r3, r7 - /* The TXFIFO is filled until there is space and data to be transmitted.*/ - while (TRUE) { - uint32_t n; - - /* Transaction end condition.*/ - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - 800efbc: 429a cmp r2, r3 - usbp->epc[ep]->in_state->mode.linear.txbuf += n; - } -#if STM32_USB_OTGFIFO_FILL_BASEPRI - __set_BASEPRI(0); -#endif - usbp->epc[ep]->in_state->txcnt += n; - 800efbe: 608b str r3, [r1, #8] - /* The TXFIFO is filled until there is space and data to be transmitted.*/ - while (TRUE) { - uint32_t n; - - /* Transaction end condition.*/ - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - 800efc0: d97b bls.n 800f0ba - if (n > usbp->epc[ep]->in_maxsize) - n = usbp->epc[ep]->in_maxsize; - - /* Checks if in the TXFIFO there is enough space to accommodate the - next packet.*/ - if (((usbp->otg->ie[ep].DTXFSTS & DTXFSTS_INEPTFSAV_MASK) * 4) < n) - 800efc2: f8da 6050 ldr.w r6, [sl, #80] ; 0x50 - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - return TRUE; - - /* Number of bytes remaining in current transaction.*/ - n = usbp->epc[ep]->in_state->txsize - usbp->epc[ep]->in_state->txcnt; - if (n > usbp->epc[ep]->in_maxsize) - 800efc6: 8a00 ldrh r0, [r0, #16] - n = usbp->epc[ep]->in_maxsize; - - /* Checks if in the TXFIFO there is enough space to accommodate the - next packet.*/ - if (((usbp->otg->ie[ep].DTXFSTS & DTXFSTS_INEPTFSAV_MASK) * 4) < n) - 800efc8: eb06 040b add.w r4, r6, fp - /* Transaction end condition.*/ - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - return TRUE; - - /* Number of bytes remaining in current transaction.*/ - n = usbp->epc[ep]->in_state->txsize - usbp->epc[ep]->in_state->txcnt; - 800efcc: 1ad7 subs r7, r2, r3 - if (n > usbp->epc[ep]->in_maxsize) - n = usbp->epc[ep]->in_maxsize; - - /* Checks if in the TXFIFO there is enough space to accommodate the - next packet.*/ - if (((usbp->otg->ie[ep].DTXFSTS & DTXFSTS_INEPTFSAV_MASK) * 4) < n) - 800efce: f8d4 3918 ldr.w r3, [r4, #2328] ; 0x918 - 800efd2: 4287 cmp r7, r0 - 800efd4: bf28 it cs - 800efd6: 4607 movcs r7, r0 - 800efd8: b29b uxth r3, r3 - 800efda: ebb7 0f83 cmp.w r7, r3, lsl #2 - 800efde: d9d5 bls.n 800ef8c - 800efe0: f8dd b008 ldr.w fp, [sp, #8] - return FALSE; - 800efe4: 2200 movs r2, #0 - 800efe6: 2320 movs r3, #32 - 800efe8: f383 8811 msr BASEPRI, r3 - osalSysUnlock(); - - done = otg_txfifo_handler(usbp, ep); - - osalSysLock(); - otgp->GAHBCFG |= GAHBCFG_GINTMSK; - 800efec: f8db 3008 ldr.w r3, [fp, #8] - 800eff0: f043 0301 orr.w r3, r3, #1 - 800eff4: f8cb 3008 str.w r3, [fp, #8] - if (!done) - 800eff8: b92a cbnz r2, 800f006 - otgp->DIEPEMPMSK |= epmask; - 800effa: f8db 3834 ldr.w r3, [fp, #2100] ; 0x834 - 800effe: 9a01 ldr r2, [sp, #4] - 800f000: 431a orrs r2, r3 - 800f002: f8cb 2834 str.w r2, [fp, #2100] ; 0x834 - 800f006: 2300 movs r3, #0 - 800f008: f383 8811 msr BASEPRI, r3 - 800f00c: e725 b.n 800ee5a - __set_BASEPRI(CORTEX_PRIO_MASK(STM32_USB_OTGFIFO_FILL_BASEPRI)); -#endif - /* Handles the two cases: linear buffer or queue.*/ - if (usbp->epc[ep]->in_state->txqueued) { - /* Queue associated.*/ - otg_fifo_write_from_queue(usbp->otg->FIFO[ep], - 800f00e: eb06 3608 add.w r6, r6, r8, lsl #12 - 800f012: 68c8 ldr r0, [r1, #12] - output_queue_t *oqp, - size_t n) { - size_t ntogo; - - ntogo = n; - while (ntogo > 0) { - 800f014: b1e7 cbz r7, 800f050 - 800f016: f8d0 e010 ldr.w lr, [r0, #16] - 800f01a: 463a mov r2, r7 - uint32_t w, i; - size_t nw = ntogo / 4; - - if (nw > 0) { - 800f01c: 0893 lsrs r3, r2, #2 - 800f01e: d12b bne.n 800f078 - 800f020: 6983 ldr r3, [r0, #24] - } - } - - /* If this condition is not satisfied then there is a word lying across - queue circular buffer boundary or there are some remaining bytes.*/ - if (ntogo <= 0) - 800f022: 2100 movs r1, #0 - 800f024: 460c mov r4, r1 - - /* One byte at time.*/ - w = 0; - i = 0; - while ((ntogo > 0) && (i < 4)) { - w |= (uint32_t)*oqp->q_rdptr++ << (i * 8); - 800f026: 1c5d adds r5, r3, #1 - 800f028: 6185 str r5, [r0, #24] - 800f02a: 781b ldrb r3, [r3, #0] - if (oqp->q_rdptr >= oqp->q_top) - 800f02c: 4575 cmp r5, lr - - /* One byte at time.*/ - w = 0; - i = 0; - while ((ntogo > 0) && (i < 4)) { - w |= (uint32_t)*oqp->q_rdptr++ << (i * 8); - 800f02e: fa03 f301 lsl.w r3, r3, r1 - 800f032: ea44 0403 orr.w r4, r4, r3 - if (oqp->q_rdptr >= oqp->q_top) - oqp->q_rdptr = oqp->q_buffer; - 800f036: bf24 itt cs - 800f038: 68c3 ldrcs r3, [r0, #12] - 800f03a: 6183 strcs r3, [r0, #24] - break; - - /* One byte at time.*/ - w = 0; - i = 0; - while ((ntogo > 0) && (i < 4)) { - 800f03c: 3a01 subs r2, #1 - 800f03e: d004 beq.n 800f04a - 800f040: 2918 cmp r1, #24 - 800f042: d002 beq.n 800f04a - 800f044: 3108 adds r1, #8 - 800f046: 6983 ldr r3, [r0, #24] - 800f048: e7ed b.n 800f026 - if (oqp->q_rdptr >= oqp->q_top) - oqp->q_rdptr = oqp->q_buffer; - ntogo--; - i++; - } - *fifop = w; - 800f04a: 6034 str r4, [r6, #0] - output_queue_t *oqp, - size_t n) { - size_t ntogo; - - ntogo = n; - while (ntogo > 0) { - 800f04c: 2a00 cmp r2, #0 - 800f04e: d1e5 bne.n 800f01c - 800f050: 2320 movs r3, #32 - 800f052: f383 8811 msr BASEPRI, r3 - *fifop = w; - } - - /* Updating queue.*/ - osalSysLock(); - oqp->q_counter += n; - 800f056: 6883 ldr r3, [r0, #8] - 800f058: 443b add r3, r7 - 800f05a: 6083 str r3, [r0, #8] - * - * @iclass - */ -static inline void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { - - chThdDequeueAllI(tqp, msg); - 800f05c: 2100 movs r1, #0 - 800f05e: f7fe f88f bl 800d180 - * - * @sclass - */ -static inline void osalOsRescheduleS(void) { - - chSchRescheduleS(); - 800f062: f7fd ff5d bl 800cf20 - 800f066: 2300 movs r3, #0 - 800f068: f383 8811 msr BASEPRI, r3 - 800f06c: e7a0 b.n 800efb0 - 800f06e: bf00 nop - 800f070: 20000c40 .word 0x20000c40 - 800f074: 080132d0 .word 0x080132d0 - uint32_t w, i; - size_t nw = ntogo / 4; - - if (nw > 0) { - size_t streak; - uint32_t nw2end = (oqp->q_top - oqp->q_rdptr) / 4; - 800f078: 6984 ldr r4, [r0, #24] - 800f07a: ebbe 0104 subs.w r1, lr, r4 - 800f07e: bf48 it mi - 800f080: 3103 addmi r1, #3 - 800f082: 1089 asrs r1, r1, #2 - - ntogo -= (streak = nw <= nw2end ? nw : nw2end) * 4; - 800f084: 428b cmp r3, r1 - 800f086: bf28 it cs - 800f088: 460b movcs r3, r1 - 800f08a: ea4f 0c83 mov.w ip, r3, lsl #2 - 800f08e: ebcc 0202 rsb r2, ip, r2 - * - * @notapi - */ -static uint8_t *otg_do_push(volatile uint32_t *fifop, uint8_t *buf, size_t n) { - - while (n > 0) { - 800f092: b133 cbz r3, 800f0a2 - 800f094: 4621 mov r1, r4 - /* Note, this line relies on the Cortex-M3/M4 ability to perform - unaligned word accesses and on the LSB-first memory organization.*/ - *fifop = *((PACKED_VAR uint32_t *)buf); - 800f096: f851 5b04 ldr.w r5, [r1], #4 - 800f09a: 6035 str r5, [r6, #0] - * - * @notapi - */ -static uint8_t *otg_do_push(volatile uint32_t *fifop, uint8_t *buf, size_t n) { - - while (n > 0) { - 800f09c: 3b01 subs r3, #1 - 800f09e: d1fa bne.n 800f096 - 800f0a0: 4464 add r4, ip - size_t streak; - uint32_t nw2end = (oqp->q_top - oqp->q_rdptr) / 4; - - ntogo -= (streak = nw <= nw2end ? nw : nw2end) * 4; - oqp->q_rdptr = otg_do_push(fifop, oqp->q_rdptr, streak); - if (oqp->q_rdptr >= oqp->q_top) { - 800f0a2: 45a6 cmp lr, r4 - if (nw > 0) { - size_t streak; - uint32_t nw2end = (oqp->q_top - oqp->q_rdptr) / 4; - - ntogo -= (streak = nw <= nw2end ? nw : nw2end) * 4; - oqp->q_rdptr = otg_do_push(fifop, oqp->q_rdptr, streak); - 800f0a4: 6184 str r4, [r0, #24] - if (oqp->q_rdptr >= oqp->q_top) { - 800f0a6: d804 bhi.n 800f0b2 - oqp->q_rdptr = oqp->q_buffer; - 800f0a8: 68c3 ldr r3, [r0, #12] - 800f0aa: 6183 str r3, [r0, #24] - output_queue_t *oqp, - size_t n) { - size_t ntogo; - - ntogo = n; - while (ntogo > 0) { - 800f0ac: 2a00 cmp r2, #0 - 800f0ae: d1b5 bne.n 800f01c - 800f0b0: e7ce b.n 800f050 - } - } - - /* If this condition is not satisfied then there is a word lying across - queue circular buffer boundary or there are some remaining bytes.*/ - if (ntogo <= 0) - 800f0b2: 2a00 cmp r2, #0 - 800f0b4: d0cc beq.n 800f050 - 800f0b6: 4623 mov r3, r4 - 800f0b8: e7b3 b.n 800f022 - 800f0ba: f8dd b008 ldr.w fp, [sp, #8] - while (TRUE) { - uint32_t n; - - /* Transaction end condition.*/ - if (usbp->epc[ep]->in_state->txcnt >= usbp->epc[ep]->in_state->txsize) - return TRUE; - 800f0be: 2201 movs r2, #1 - 800f0c0: e791 b.n 800efe6 - 800f0c2: f108 0801 add.w r8, r8, #1 - 800f0c6: e7fa b.n 800f0be - 800f0c8: f3af 8000 nop.w - 800f0cc: f3af 8000 nop.w - -0800f0d0 : - /* Wait AHB idle condition.*/ - while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0) - ; -} - -static void otg_disable_ep(USBDriver *usbp) { - 800f0d0: b5f0 push {r4, r5, r6, r7, lr} - stm32_otg_t *otgp = usbp->otg; - unsigned i; - - for (i = 0; i <= usbp->otgparams->num_endpoints; i++) { - 800f0d2: 2400 movs r4, #0 - 800f0d4: f8d1 e008 ldr.w lr, [r1, #8] - /* Wait for endpoint disable.*/ - while (!(otgp->ie[i].DIEPINT & DIEPINT_EPDISD)) - ; - } - else - otgp->ie[i].DIEPCTL = 0; - 800f0d8: 4625 mov r5, r4 - for (i = 0; i <= usbp->otgparams->num_endpoints; i++) { - /* Disable only if enabled because this sentence in the manual: - "The application must set this bit only if Endpoint Enable is - already set for this endpoint".*/ - if ((otgp->ie[i].DIEPCTL & DIEPCTL_EPENA) != 0) { - otgp->ie[i].DIEPCTL = DIEPCTL_EPDIS; - 800f0da: f04f 4c80 mov.w ip, #1073741824 ; 0x40000000 - ; - } - else - otgp->ie[i].DIEPCTL = 0; - otgp->ie[i].DIEPTSIZ = 0; - otgp->ie[i].DIEPINT = 0xFFFFFFFF; - 800f0de: f04f 37ff mov.w r7, #4294967295 ; 0xffffffff - 800f0e2: e014 b.n 800f10e - /* Wait for endpoint disable.*/ - while (!(otgp->ie[i].DIEPINT & DIEPINT_EPDISD)) - ; - } - else - otgp->ie[i].DIEPCTL = 0; - 800f0e4: f8c1 5900 str.w r5, [r1, #2304] ; 0x900 - otgp->ie[i].DIEPTSIZ = 0; - 800f0e8: 18c2 adds r2, r0, r3 - 800f0ea: f8c2 5910 str.w r5, [r2, #2320] ; 0x910 - otgp->ie[i].DIEPINT = 0xFFFFFFFF; - 800f0ee: f8c2 7908 str.w r7, [r2, #2312] ; 0x908 - /* Disable only if enabled because this sentence in the manual: - "The application must set this bit only if Endpoint Enable is - already set for this endpoint". - Note that the attempt to disable the OUT EP0 is ignored by the - hardware but the code is simpler this way.*/ - if ((otgp->oe[i].DOEPCTL & DOEPCTL_EPENA) != 0) { - 800f0f2: f8d1 6b00 ldr.w r6, [r1, #2816] ; 0xb00 - 800f0f6: 2e00 cmp r6, #0 - 800f0f8: db17 blt.n 800f12a - /* Wait for endpoint disable.*/ - while (!(otgp->oe[i].DOEPINT & DOEPINT_OTEPDIS)) - ; - } - else - otgp->oe[i].DOEPCTL = 0; - 800f0fa: f8c1 5b00 str.w r5, [r1, #2816] ; 0xb00 - otgp->oe[i].DOEPTSIZ = 0; - 800f0fe: 4403 add r3, r0 - -static void otg_disable_ep(USBDriver *usbp) { - stm32_otg_t *otgp = usbp->otg; - unsigned i; - - for (i = 0; i <= usbp->otgparams->num_endpoints; i++) { - 800f100: 3401 adds r4, #1 - 800f102: 45a6 cmp lr, r4 - while (!(otgp->oe[i].DOEPINT & DOEPINT_OTEPDIS)) - ; - } - else - otgp->oe[i].DOEPCTL = 0; - otgp->oe[i].DOEPTSIZ = 0; - 800f104: f8c3 5b10 str.w r5, [r3, #2832] ; 0xb10 - otgp->oe[i].DOEPINT = 0xFFFFFFFF; - 800f108: f8c3 7b08 str.w r7, [r3, #2824] ; 0xb08 - -static void otg_disable_ep(USBDriver *usbp) { - stm32_otg_t *otgp = usbp->otg; - unsigned i; - - for (i = 0; i <= usbp->otgparams->num_endpoints; i++) { - 800f10c: d314 bcc.n 800f138 - 800f10e: 0163 lsls r3, r4, #5 - 800f110: 18c1 adds r1, r0, r3 - /* Disable only if enabled because this sentence in the manual: - "The application must set this bit only if Endpoint Enable is - already set for this endpoint".*/ - if ((otgp->ie[i].DIEPCTL & DIEPCTL_EPENA) != 0) { - 800f112: f8d1 2900 ldr.w r2, [r1, #2304] ; 0x900 - 800f116: 2a00 cmp r2, #0 - 800f118: dae4 bge.n 800f0e4 - otgp->ie[i].DIEPCTL = DIEPCTL_EPDIS; - 800f11a: f8c1 c900 str.w ip, [r1, #2304] ; 0x900 - /* Wait for endpoint disable.*/ - while (!(otgp->ie[i].DIEPINT & DIEPINT_EPDISD)) - 800f11e: 460e mov r6, r1 - 800f120: f8d6 2908 ldr.w r2, [r6, #2312] ; 0x908 - 800f124: 0792 lsls r2, r2, #30 - 800f126: d5fb bpl.n 800f120 - 800f128: e7de b.n 800f0e8 - "The application must set this bit only if Endpoint Enable is - already set for this endpoint". - Note that the attempt to disable the OUT EP0 is ignored by the - hardware but the code is simpler this way.*/ - if ((otgp->oe[i].DOEPCTL & DOEPCTL_EPENA) != 0) { - otgp->oe[i].DOEPCTL = DOEPCTL_EPDIS; - 800f12a: f8c1 cb00 str.w ip, [r1, #2816] ; 0xb00 - /* Wait for endpoint disable.*/ - while (!(otgp->oe[i].DOEPINT & DOEPINT_OTEPDIS)) - 800f12e: f8d2 1b08 ldr.w r1, [r2, #2824] ; 0xb08 - 800f132: 06c9 lsls r1, r1, #27 - 800f134: d5fb bpl.n 800f12e - 800f136: e7e2 b.n 800f0fe - else - otgp->oe[i].DOEPCTL = 0; - otgp->oe[i].DOEPTSIZ = 0; - otgp->oe[i].DOEPINT = 0xFFFFFFFF; - } - otgp->DAINTMSK = DAINTMSK_OEPM(0) | DAINTMSK_IEPM(0); - 800f138: f04f 1301 mov.w r3, #65537 ; 0x10001 - 800f13c: f8c0 381c str.w r3, [r0, #2076] ; 0x81c - 800f140: bdf0 pop {r4, r5, r6, r7, pc} - 800f142: bf00 nop - 800f144: f3af 8000 nop.w - 800f148: f3af 8000 nop.w - 800f14c: f3af 8000 nop.w - -0800f150 : -/** - * @brief Low level USB driver initialization. - * - * @notapi - */ -void usb_lld_init(void) { - 800f150: b510 push {r4, lr} - - /* Driver initialization.*/ -#if STM32_USB_USE_OTG1 - usbObjectInit(&USBD1); - 800f152: 4c06 ldr r4, [pc, #24] ; (800f16c ) - 800f154: 4620 mov r0, r4 - 800f156: f7fe fca3 bl 800daa0 - USBD1.wait = NULL; - USBD1.otg = OTG_FS; - 800f15a: f04f 43a0 mov.w r3, #1342177280 ; 0x50000000 - USBD1.otgparams = &fsparams; - 800f15e: 4a04 ldr r2, [pc, #16] ; (800f170 ) - - /* Driver initialization.*/ -#if STM32_USB_USE_OTG1 - usbObjectInit(&USBD1); - USBD1.wait = NULL; - USBD1.otg = OTG_FS; - 800f160: 6523 str r3, [r4, #80] ; 0x50 -void usb_lld_init(void) { - - /* Driver initialization.*/ -#if STM32_USB_USE_OTG1 - usbObjectInit(&USBD1); - USBD1.wait = NULL; - 800f162: 2300 movs r3, #0 - USBD1.otg = OTG_FS; - USBD1.otgparams = &fsparams; - 800f164: 6562 str r2, [r4, #84] ; 0x54 -void usb_lld_init(void) { - - /* Driver initialization.*/ -#if STM32_USB_USE_OTG1 - usbObjectInit(&USBD1); - USBD1.wait = NULL; - 800f166: 6623 str r3, [r4, #96] ; 0x60 - USBD1.otg = OTG_FS; - USBD1.otgparams = &fsparams; - -#if defined(_CHIBIOS_RT_) - USBD1.tr = NULL; - 800f168: 6663 str r3, [r4, #100] ; 0x64 - 800f16a: bd10 pop {r4, pc} - 800f16c: 20000fb0 .word 0x20000fb0 - 800f170: 080132c0 .word 0x080132c0 - 800f174: f3af 8000 nop.w - 800f178: f3af 8000 nop.w - 800f17c: f3af 8000 nop.w - -0800f180 : - * - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -void usb_lld_start(USBDriver *usbp) { - 800f180: b570 push {r4, r5, r6, lr} - stm32_otg_t *otgp = usbp->otg; - - if (usbp->state == USB_STOP) { - 800f182: 7803 ldrb r3, [r0, #0] - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -void usb_lld_start(USBDriver *usbp) { - stm32_otg_t *otgp = usbp->otg; - 800f184: 6d06 ldr r6, [r0, #80] ; 0x50 - - if (usbp->state == USB_STOP) { - 800f186: 2b01 cmp r3, #1 - * - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -void usb_lld_start(USBDriver *usbp) { - 800f188: b082 sub sp, #8 - stm32_otg_t *otgp = usbp->otg; - - if (usbp->state == USB_STOP) { - 800f18a: d001 beq.n 800f190 -#endif - - /* Global interrupts enable.*/ - otgp->GAHBCFG |= GAHBCFG_GINTMSK; - } -} - 800f18c: b002 add sp, #8 - 800f18e: bd70 pop {r4, r5, r6, pc} - stm32_otg_t *otgp = usbp->otg; - - if (usbp->state == USB_STOP) { - /* Clock activation.*/ -#if STM32_USB_USE_OTG1 - if (&USBD1 == usbp) { - 800f190: 4b30 ldr r3, [pc, #192] ; (800f254 ) - 800f192: 4298 cmp r0, r3 - 800f194: 4605 mov r5, r0 - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -void usb_lld_start(USBDriver *usbp) { - stm32_otg_t *otgp = usbp->otg; - 800f196: bf18 it ne - 800f198: 4634 movne r4, r6 - - if (usbp->state == USB_STOP) { - /* Clock activation.*/ -#if STM32_USB_USE_OTG1 - if (&USBD1 == usbp) { - 800f19a: d03a beq.n 800f212 - /* Enables IRQ vector.*/ - nvicEnableVector(STM32_OTG2_NUMBER, STM32_USB_OTG2_IRQ_PRIORITY); - } -#endif - - usbp->txpending = 0; - 800f19c: 2300 movs r3, #0 - - /* - Forced device mode. - - USB turn-around time = TRDT_VALUE. - - Full Speed 1.1 PHY.*/ - otgp->GUSBCFG = GUSBCFG_FDMOD | GUSBCFG_TRDT(TRDT_VALUE) | GUSBCFG_PHYSEL; - 800f19e: 482e ldr r0, [pc, #184] ; (800f258 ) - - /* 48MHz 1.1 PHY.*/ - otgp->DCFG = 0x02200000 | DCFG_DSPD_FS11; - 800f1a0: 492e ldr r1, [pc, #184] ; (800f25c ) - /* Enables IRQ vector.*/ - nvicEnableVector(STM32_OTG2_NUMBER, STM32_USB_OTG2_IRQ_PRIORITY); - } -#endif - - usbp->txpending = 0; - 800f1a2: 65eb str r3, [r5, #92] ; 0x5c - /* PHY enabled.*/ - otgp->PCGCCTL = 0; - - /* Internal FS PHY activation.*/ -#if defined(BOARD_OTG_NOVBUSSENS) - otgp->GCCFG = GCCFG_NOVBUSSENS | GCCFG_VBUSASEN | GCCFG_VBUSBSEN | - 800f1a4: f44f 1234 mov.w r2, #2949120 ; 0x2d0000 - usbp->txpending = 0; - - /* - Forced device mode. - - USB turn-around time = TRDT_VALUE. - - Full Speed 1.1 PHY.*/ - otgp->GUSBCFG = GUSBCFG_FDMOD | GUSBCFG_TRDT(TRDT_VALUE) | GUSBCFG_PHYSEL; - 800f1a8: 60f0 str r0, [r6, #12] - - /* 48MHz 1.1 PHY.*/ - otgp->DCFG = 0x02200000 | DCFG_DSPD_FS11; - 800f1aa: f8c6 1800 str.w r1, [r6, #2048] ; 0x800 - * @xclass - */ -#if PORT_SUPPORTS_RT || defined(__DOXYGEN__) -static inline void osalSysPolledDelayX(rtcnt_t cycles) { - - chSysPolledDelayX(cycles); - 800f1ae: 2020 movs r0, #32 - - /* PHY enabled.*/ - otgp->PCGCCTL = 0; - 800f1b0: f8c6 3e00 str.w r3, [r6, #3584] ; 0xe00 - - /* Internal FS PHY activation.*/ -#if defined(BOARD_OTG_NOVBUSSENS) - otgp->GCCFG = GCCFG_NOVBUSSENS | GCCFG_VBUSASEN | GCCFG_VBUSBSEN | - 800f1b4: 63b2 str r2, [r6, #56] ; 0x38 - 800f1b6: f7fd fd33 bl 800cc20 - stm32_otg_t *otgp = usbp->otg; - - osalSysPolledDelayX(32); - - /* Core reset and delay of at least 3 PHY cycles.*/ - otgp->GRSTCTL = GRSTCTL_CSRST; - 800f1ba: 2301 movs r3, #1 - 800f1bc: 6123 str r3, [r4, #16] - while ((otgp->GRSTCTL & GRSTCTL_CSRST) != 0) - 800f1be: 6923 ldr r3, [r4, #16] - 800f1c0: 07db lsls r3, r3, #31 - 800f1c2: d4fc bmi.n 800f1be - 800f1c4: 200c movs r0, #12 - 800f1c6: f7fd fd2b bl 800cc20 - ; - - osalSysPolledDelayX(12); - - /* Wait AHB idle condition.*/ - while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0) - 800f1ca: 6923 ldr r3, [r4, #16] - 800f1cc: 2b00 cmp r3, #0 - 800f1ce: dafc bge.n 800f1ca - - /* Soft core reset.*/ - otg_core_reset(usbp); - - /* Interrupts on TXFIFOs half empty.*/ - otgp->GAHBCFG = 0; - 800f1d0: 2400 movs r4, #0 - 800f1d2: 60b4 str r4, [r6, #8] - - /* Endpoints re-initialization.*/ - otg_disable_ep(usbp); - 800f1d4: 6d28 ldr r0, [r5, #80] ; 0x50 - 800f1d6: 6d69 ldr r1, [r5, #84] ; 0x54 - 800f1d8: f7ff ff7a bl 800f0d0 - /* Clear all pending Device Interrupts, only the USB Reset interrupt - is required initially.*/ - otgp->DIEPMSK = 0; - otgp->DOEPMSK = 0; - otgp->DAINTMSK = 0; - if (usbp->config->sof_cb == NULL) - 800f1dc: 686b ldr r3, [r5, #4] - /* Endpoints re-initialization.*/ - otg_disable_ep(usbp); - - /* Clear all pending Device Interrupts, only the USB Reset interrupt - is required initially.*/ - otgp->DIEPMSK = 0; - 800f1de: f8c6 4810 str.w r4, [r6, #2064] ; 0x810 - otgp->DOEPMSK = 0; - otgp->DAINTMSK = 0; - if (usbp->config->sof_cb == NULL) - 800f1e2: 68db ldr r3, [r3, #12] - otg_disable_ep(usbp); - - /* Clear all pending Device Interrupts, only the USB Reset interrupt - is required initially.*/ - otgp->DIEPMSK = 0; - otgp->DOEPMSK = 0; - 800f1e4: f8c6 4814 str.w r4, [r6, #2068] ; 0x814 - otgp->DAINTMSK = 0; - 800f1e8: f8c6 481c str.w r4, [r6, #2076] ; 0x81c - if (usbp->config->sof_cb == NULL) - 800f1ec: b16b cbz r3, 800f20a - otgp->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM | - GINTMSK_ESUSPM |*/; - else - otgp->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM | - 800f1ee: f243 0308 movw r3, #12296 ; 0x3008 - 800f1f2: 61b3 str r3, [r6, #24] - GINTMSK_ESUSPM */ | GINTMSK_SOFM; - otgp->GINTSTS = 0xFFFFFFFF; /* Clears all pending IRQs, if any. */ - -#if defined(_CHIBIOS_RT_) - /* Creates the data pump thread. Note, it is created only once.*/ - if (usbp->tr == NULL) { - 800f1f4: 6e6b ldr r3, [r5, #100] ; 0x64 - otgp->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM | - GINTMSK_ESUSPM |*/; - else - otgp->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM | - GINTMSK_ESUSPM */ | GINTMSK_SOFM; - otgp->GINTSTS = 0xFFFFFFFF; /* Clears all pending IRQs, if any. */ - 800f1f6: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff - 800f1fa: 6172 str r2, [r6, #20] - -#if defined(_CHIBIOS_RT_) - /* Creates the data pump thread. Note, it is created only once.*/ - if (usbp->tr == NULL) { - 800f1fc: b1d3 cbz r3, 800f234 - chSchRescheduleS(); - } -#endif - - /* Global interrupts enable.*/ - otgp->GAHBCFG |= GAHBCFG_GINTMSK; - 800f1fe: 68b3 ldr r3, [r6, #8] - 800f200: f043 0301 orr.w r3, r3, #1 - 800f204: 60b3 str r3, [r6, #8] - } -} - 800f206: b002 add sp, #8 - 800f208: bd70 pop {r4, r5, r6, pc} - is required initially.*/ - otgp->DIEPMSK = 0; - otgp->DOEPMSK = 0; - otgp->DAINTMSK = 0; - if (usbp->config->sof_cb == NULL) - otgp->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM | - 800f20a: f44f 5340 mov.w r3, #12288 ; 0x3000 - 800f20e: 61b3 str r3, [r6, #24] - 800f210: e7f0 b.n 800f1f4 - if (usbp->state == USB_STOP) { - /* Clock activation.*/ -#if STM32_USB_USE_OTG1 - if (&USBD1 == usbp) { - /* OTG FS clock enable and reset.*/ - rccEnableOTG_FS(FALSE); - 800f212: 4b13 ldr r3, [pc, #76] ; (800f260 ) - 800f214: 6b5a ldr r2, [r3, #52] ; 0x34 - 800f216: f042 0280 orr.w r2, r2, #128 ; 0x80 - 800f21a: 635a str r2, [r3, #52] ; 0x34 - rccResetOTG_FS(); - 800f21c: 695a ldr r2, [r3, #20] - 800f21e: 2100 movs r1, #0 - 800f220: f042 0280 orr.w r2, r2, #128 ; 0x80 - 800f224: 615a str r2, [r3, #20] - - /* Enables IRQ vector.*/ - nvicEnableVector(STM32_OTG1_NUMBER, STM32_USB_OTG1_IRQ_PRIORITY); - 800f226: 2043 movs r0, #67 ; 0x43 - /* Clock activation.*/ -#if STM32_USB_USE_OTG1 - if (&USBD1 == usbp) { - /* OTG FS clock enable and reset.*/ - rccEnableOTG_FS(FALSE); - rccResetOTG_FS(); - 800f228: 6159 str r1, [r3, #20] - - /* Enables IRQ vector.*/ - nvicEnableVector(STM32_OTG1_NUMBER, STM32_USB_OTG1_IRQ_PRIORITY); - 800f22a: 210e movs r1, #14 - 800f22c: f7fe ff40 bl 800e0b0 - 800f230: 6d2c ldr r4, [r5, #80] ; 0x50 - 800f232: e7b3 b.n 800f19c - otgp->GINTSTS = 0xFFFFFFFF; /* Clears all pending IRQs, if any. */ - -#if defined(_CHIBIOS_RT_) - /* Creates the data pump thread. Note, it is created only once.*/ - if (usbp->tr == NULL) { - usbp->tr = chThdCreateI(usbp->wa_pump, sizeof usbp->wa_pump, - 800f234: f44f 7106 mov.w r1, #536 ; 0x218 - 800f238: 2202 movs r2, #2 - 800f23a: 4b0a ldr r3, [pc, #40] ; (800f264 ) - 800f23c: 9500 str r5, [sp, #0] - 800f23e: f105 0068 add.w r0, r5, #104 ; 0x68 - 800f242: f7fd feb5 bl 800cfb0 - 800f246: 6668 str r0, [r5, #100] ; 0x64 - */ -static inline thread_t *chThdStartI(thread_t *tp) { - - chDbgAssert(tp->p_state == CH_STATE_WTSTART, "wrong state"); - - return chSchReadyI(tp); - 800f248: f7fd fd8a bl 800cd60 - STM32_USB_OTG_THREAD_PRIO, - usb_lld_pump, usbp); - chThdStartI(usbp->tr); - chSchRescheduleS(); - 800f24c: f7fd fe68 bl 800cf20 - 800f250: e7d5 b.n 800f1fe - 800f252: bf00 nop - 800f254: 20000fb0 .word 0x20000fb0 - 800f258: 40001440 .word 0x40001440 - 800f25c: 02200003 .word 0x02200003 - 800f260: 40023800 .word 0x40023800 - 800f264: 0800eda1 .word 0x0800eda1 - 800f268: f3af 8000 nop.w - 800f26c: f3af 8000 nop.w - -0800f270 : - * - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -void usb_lld_reset(USBDriver *usbp) { - 800f270: b5f8 push {r3, r4, r5, r6, r7, lr} - unsigned i; - stm32_otg_t *otgp = usbp->otg; - 800f272: 6d05 ldr r5, [r0, #80] ; 0x50 -} - -static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH; - 800f274: 2320 movs r3, #32 - * - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -void usb_lld_reset(USBDriver *usbp) { - 800f276: 4607 mov r7, r0 -} - -static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH; - 800f278: 612b str r3, [r5, #16] - while ((otgp->GRSTCTL & GRSTCTL_TXFFLSH) != 0) - 800f27a: 692b ldr r3, [r5, #16] - 800f27c: f013 0420 ands.w r4, r3, #32 - 800f280: d1fb bne.n 800f27a - 800f282: 200c movs r0, #12 - 800f284: f7fd fccc bl 800cc20 - 800f288: f8d7 e054 ldr.w lr, [r7, #84] ; 0x54 - 800f28c: f8de 6008 ldr.w r6, [lr, #8] - - /* Flush the Tx FIFO.*/ - otg_txfifo_flush(usbp, 0); - - /* All endpoints in NAK mode, interrupts cleared.*/ - for (i = 0; i <= usbp->otgparams->num_endpoints; i++) { - 800f290: 4623 mov r3, r4 - otgp->ie[i].DIEPCTL = DIEPCTL_SNAK; - 800f292: f04f 6000 mov.w r0, #134217728 ; 0x8000000 - otgp->oe[i].DOEPCTL = DOEPCTL_SNAK; - otgp->ie[i].DIEPINT = 0xFF; - 800f296: 21ff movs r1, #255 ; 0xff - 800f298: eb05 1243 add.w r2, r5, r3, lsl #5 - - /* Flush the Tx FIFO.*/ - otg_txfifo_flush(usbp, 0); - - /* All endpoints in NAK mode, interrupts cleared.*/ - for (i = 0; i <= usbp->otgparams->num_endpoints; i++) { - 800f29c: 3301 adds r3, #1 - 800f29e: 42b3 cmp r3, r6 - otgp->ie[i].DIEPCTL = DIEPCTL_SNAK; - 800f2a0: f8c2 0900 str.w r0, [r2, #2304] ; 0x900 - otgp->oe[i].DOEPCTL = DOEPCTL_SNAK; - 800f2a4: f8c2 0b00 str.w r0, [r2, #2816] ; 0xb00 - otgp->ie[i].DIEPINT = 0xFF; - 800f2a8: f8c2 1908 str.w r1, [r2, #2312] ; 0x908 - otgp->oe[i].DOEPINT = 0xFF; - 800f2ac: f8c2 1b08 str.w r1, [r2, #2824] ; 0xb08 - - /* Flush the Tx FIFO.*/ - otg_txfifo_flush(usbp, 0); - - /* All endpoints in NAK mode, interrupts cleared.*/ - for (i = 0; i <= usbp->otgparams->num_endpoints; i++) { - 800f2b0: d9f2 bls.n 800f298 - * - * @notapi - */ -static void otg_ram_reset(USBDriver *usbp) { - - usbp->pmnext = usbp->otgparams->rx_fifo_size; - 800f2b2: f8de 3000 ldr.w r3, [lr] - otgp->ie[i].DIEPINT = 0xFF; - otgp->oe[i].DOEPINT = 0xFF; - } - - /* Endpoint interrupts all disabled and cleared.*/ - otgp->DAINT = 0xFFFFFFFF; - 800f2b6: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff - otgp->DAINTMSK = DAINTMSK_OEPM(0) | DAINTMSK_IEPM(0); - 800f2ba: f04f 1101 mov.w r1, #65537 ; 0x10001 - otgp->ie[i].DIEPINT = 0xFF; - otgp->oe[i].DOEPINT = 0xFF; - } - - /* Endpoint interrupts all disabled and cleared.*/ - otgp->DAINT = 0xFFFFFFFF; - 800f2be: f8c5 2818 str.w r2, [r5, #2072] ; 0x818 - 800f2c2: 6d3a ldr r2, [r7, #80] ; 0x50 - otgp->DAINTMSK = DAINTMSK_OEPM(0) | DAINTMSK_IEPM(0); - 800f2c4: f8c5 181c str.w r1, [r5, #2076] ; 0x81c - * - * @notapi - */ -static void otg_ram_reset(USBDriver *usbp) { - - usbp->pmnext = usbp->otgparams->rx_fifo_size; - 800f2c8: 65bb str r3, [r7, #88] ; 0x58 - - /* Resets the FIFO memory allocator.*/ - otg_ram_reset(usbp); - - /* Receive FIFO size initialization, the address is always zero.*/ - otgp->GRXFSIZ = usbp->otgparams->rx_fifo_size; - 800f2ca: f8de 3000 ldr.w r3, [lr] - 800f2ce: 626b str r3, [r5, #36] ; 0x24 -} - -static void otg_rxfifo_flush(USBDriver *usbp) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_RXFFLSH; - 800f2d0: 2310 movs r3, #16 - 800f2d2: 6113 str r3, [r2, #16] - while ((otgp->GRSTCTL & GRSTCTL_RXFFLSH) != 0) - 800f2d4: 6913 ldr r3, [r2, #16] - 800f2d6: f013 0410 ands.w r4, r3, #16 - 800f2da: d1fb bne.n 800f2d4 - 800f2dc: 200c movs r0, #12 - 800f2de: f7fd fc9f bl 800cc20 - /* Receive FIFO size initialization, the address is always zero.*/ - otgp->GRXFSIZ = usbp->otgparams->rx_fifo_size; - otg_rxfifo_flush(usbp); - - /* Resets the device address to zero.*/ - otgp->DCFG = (otgp->DCFG & ~DCFG_DAD_MASK) | DCFG_DAD(0); - 800f2e2: f8d5 3800 ldr.w r3, [r5, #2048] ; 0x800 - otgp->DOEPMSK = DOEPMSK_STUPM | DOEPMSK_XFRCM; - - /* EP0 initialization, it is a special case.*/ - usbp->epc[0] = &ep0config; - otgp->oe[0].DOEPTSIZ = 0; - otgp->oe[0].DOEPCTL = DOEPCTL_SD0PID | DOEPCTL_USBAEP | DOEPCTL_EPTYP_CTRL | - 800f2e6: 4a11 ldr r2, [pc, #68] ; (800f32c ) - otgp->GINTMSK |= GINTMSK_RXFLVLM | GINTMSK_OEPM | GINTMSK_IEPM; - otgp->DIEPMSK = DIEPMSK_TOCM | DIEPMSK_XFRCM; - otgp->DOEPMSK = DOEPMSK_STUPM | DOEPMSK_XFRCM; - - /* EP0 initialization, it is a special case.*/ - usbp->epc[0] = &ep0config; - 800f2e8: 4811 ldr r0, [pc, #68] ; (800f330 ) - /* Receive FIFO size initialization, the address is always zero.*/ - otgp->GRXFSIZ = usbp->otgparams->rx_fifo_size; - otg_rxfifo_flush(usbp); - - /* Resets the device address to zero.*/ - otgp->DCFG = (otgp->DCFG & ~DCFG_DAD_MASK) | DCFG_DAD(0); - 800f2ea: f423 63fe bic.w r3, r3, #2032 ; 0x7f0 - 800f2ee: f8c5 3800 str.w r3, [r5, #2048] ; 0x800 - - /* Enables also EP-related interrupt sources.*/ - otgp->GINTMSK |= GINTMSK_RXFLVLM | GINTMSK_OEPM | GINTMSK_IEPM; - 800f2f2: 69ab ldr r3, [r5, #24] - 800f2f4: f443 2340 orr.w r3, r3, #786432 ; 0xc0000 - 800f2f8: f043 0310 orr.w r3, r3, #16 - otgp->DIEPMSK = DIEPMSK_TOCM | DIEPMSK_XFRCM; - 800f2fc: 2109 movs r1, #9 - - /* Resets the device address to zero.*/ - otgp->DCFG = (otgp->DCFG & ~DCFG_DAD_MASK) | DCFG_DAD(0); - - /* Enables also EP-related interrupt sources.*/ - otgp->GINTMSK |= GINTMSK_RXFLVLM | GINTMSK_OEPM | GINTMSK_IEPM; - 800f2fe: 61ab str r3, [r5, #24] - otgp->DIEPMSK = DIEPMSK_TOCM | DIEPMSK_XFRCM; - 800f300: f8c5 1810 str.w r1, [r5, #2064] ; 0x810 - otgp->DOEPMSK = DOEPMSK_STUPM | DOEPMSK_XFRCM; - 800f304: f8c5 1814 str.w r1, [r5, #2068] ; 0x814 - - /* EP0 initialization, it is a special case.*/ - usbp->epc[0] = &ep0config; - 800f308: 60f8 str r0, [r7, #12] - otgp->oe[0].DOEPTSIZ = 0; - 800f30a: f8c5 4b10 str.w r4, [r5, #2832] ; 0xb10 - otgp->oe[0].DOEPCTL = DOEPCTL_SD0PID | DOEPCTL_USBAEP | DOEPCTL_EPTYP_CTRL | - 800f30e: f8c5 2b00 str.w r2, [r5, #2816] ; 0xb00 - DOEPCTL_MPSIZ(ep0config.out_maxsize); - otgp->ie[0].DIEPTSIZ = 0; - 800f312: f8c5 4910 str.w r4, [r5, #2320] ; 0x910 - otgp->ie[0].DIEPCTL = DIEPCTL_SD0PID | DIEPCTL_USBAEP | DIEPCTL_EPTYP_CTRL | - 800f316: f8c5 2900 str.w r2, [r5, #2304] ; 0x900 - * @notapi - */ -static uint32_t otg_ram_alloc(USBDriver *usbp, size_t size) { - uint32_t next; - - next = usbp->pmnext; - 800f31a: 6dbb ldr r3, [r7, #88] ; 0x58 - usbp->pmnext += size; - 800f31c: f103 0210 add.w r2, r3, #16 - otgp->oe[0].DOEPCTL = DOEPCTL_SD0PID | DOEPCTL_USBAEP | DOEPCTL_EPTYP_CTRL | - DOEPCTL_MPSIZ(ep0config.out_maxsize); - otgp->ie[0].DIEPTSIZ = 0; - otgp->ie[0].DIEPCTL = DIEPCTL_SD0PID | DIEPCTL_USBAEP | DIEPCTL_EPTYP_CTRL | - DIEPCTL_TXFNUM(0) | DIEPCTL_MPSIZ(ep0config.in_maxsize); - otgp->DIEPTXF0 = DIEPTXF_INEPTXFD(ep0config.in_maxsize / 4) | - 800f320: f443 1380 orr.w r3, r3, #1048576 ; 0x100000 - */ -static uint32_t otg_ram_alloc(USBDriver *usbp, size_t size) { - uint32_t next; - - next = usbp->pmnext; - usbp->pmnext += size; - 800f324: 65ba str r2, [r7, #88] ; 0x58 - otgp->oe[0].DOEPCTL = DOEPCTL_SD0PID | DOEPCTL_USBAEP | DOEPCTL_EPTYP_CTRL | - DOEPCTL_MPSIZ(ep0config.out_maxsize); - otgp->ie[0].DIEPTSIZ = 0; - otgp->ie[0].DIEPCTL = DIEPCTL_SD0PID | DIEPCTL_USBAEP | DIEPCTL_EPTYP_CTRL | - DIEPCTL_TXFNUM(0) | DIEPCTL_MPSIZ(ep0config.in_maxsize); - otgp->DIEPTXF0 = DIEPTXF_INEPTXFD(ep0config.in_maxsize / 4) | - 800f326: 62ab str r3, [r5, #40] ; 0x28 - 800f328: bdf8 pop {r3, r4, r5, r6, r7, pc} - 800f32a: bf00 nop - 800f32c: 10008040 .word 0x10008040 - 800f330: 080132e0 .word 0x080132e0 - 800f334: f3af 8000 nop.w - 800f338: f3af 8000 nop.w - 800f33c: f3af 8000 nop.w - -0800f340 : - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -void usb_lld_set_address(USBDriver *usbp) { - stm32_otg_t *otgp = usbp->otg; - 800f340: 6d02 ldr r2, [r0, #80] ; 0x50 - - otgp->DCFG = (otgp->DCFG & ~DCFG_DAD_MASK) | DCFG_DAD(usbp->address); - 800f342: f890 104e ldrb.w r1, [r0, #78] ; 0x4e - 800f346: f8d2 3800 ldr.w r3, [r2, #2048] ; 0x800 - 800f34a: f423 63fe bic.w r3, r3, #2032 ; 0x7f0 - 800f34e: ea43 1301 orr.w r3, r3, r1, lsl #4 - 800f352: f8c2 3800 str.w r3, [r2, #2048] ; 0x800 - 800f356: 4770 bx lr - 800f358: f3af 8000 nop.w - 800f35c: f3af 8000 nop.w - -0800f360 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { - 800f360: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - 800f364: fa0f f881 sxth.w r8, r1 - 800f368: eb00 0788 add.w r7, r0, r8, lsl #2 - 800f36c: 460d mov r5, r1 - uint32_t ctl, fsize; - stm32_otg_t *otgp = usbp->otg; - - /* IN and OUT common parameters.*/ - switch (usbp->epc[ep]->ep_mode & USB_EP_MODE_TYPE) { - 800f36e: 68fb ldr r3, [r7, #12] - * - * @notapi - */ -void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) { - uint32_t ctl, fsize; - stm32_otg_t *otgp = usbp->otg; - 800f370: 6d04 ldr r4, [r0, #80] ; 0x50 - - /* IN and OUT common parameters.*/ - switch (usbp->epc[ep]->ep_mode & USB_EP_MODE_TYPE) { - 800f372: 681a ldr r2, [r3, #0] - 800f374: f002 0203 and.w r2, r2, #3 - 800f378: 2a02 cmp r2, #2 - 800f37a: d05c beq.n 800f436 - 800f37c: 2a03 cmp r2, #3 - 800f37e: d05c beq.n 800f43a - case USB_EP_MODE_TYPE_CTRL: - ctl = DIEPCTL_SD0PID | DIEPCTL_USBAEP | DIEPCTL_EPTYP_CTRL; - 800f380: 4e4a ldr r6, [pc, #296] ; (800f4ac ) - 800f382: 494b ldr r1, [pc, #300] ; (800f4b0 ) - 800f384: 2a01 cmp r2, #1 - 800f386: bf18 it ne - 800f388: 460e movne r6, r1 - default: - return; - } - - /* OUT endpoint activation or deactivation.*/ - otgp->oe[ep].DOEPTSIZ = 0; - 800f38a: 016a lsls r2, r5, #5 - if (usbp->epc[ep]->out_cb != NULL) { - 800f38c: 68d9 ldr r1, [r3, #12] - default: - return; - } - - /* OUT endpoint activation or deactivation.*/ - otgp->oe[ep].DOEPTSIZ = 0; - 800f38e: eb04 0e02 add.w lr, r4, r2 - 800f392: f04f 0c00 mov.w ip, #0 - 800f396: f8ce cb10 str.w ip, [lr, #2832] ; 0xb10 - if (usbp->epc[ep]->out_cb != NULL) { - 800f39a: 2900 cmp r1, #0 - 800f39c: d071 beq.n 800f482 - otgp->oe[ep].DOEPCTL = ctl | DOEPCTL_MPSIZ(usbp->epc[ep]->out_maxsize); - 800f39e: f8b3 e012 ldrh.w lr, [r3, #18] - 800f3a2: f105 0158 add.w r1, r5, #88 ; 0x58 - 800f3a6: 0149 lsls r1, r1, #5 - 800f3a8: ea46 0e0e orr.w lr, r6, lr - 800f3ac: f844 e001 str.w lr, [r4, r1] - otgp->DAINTMSK |= DAINTMSK_OEPM(ep); - 800f3b0: f105 0c10 add.w ip, r5, #16 - 800f3b4: f8d4 181c ldr.w r1, [r4, #2076] ; 0x81c - 800f3b8: f04f 0e01 mov.w lr, #1 - 800f3bc: fa0e fe0c lsl.w lr, lr, ip - 800f3c0: ea4e 0101 orr.w r1, lr, r1 - 800f3c4: f8c4 181c str.w r1, [r4, #2076] ; 0x81c - otgp->oe[ep].DOEPCTL &= ~DOEPCTL_USBAEP; - otgp->DAINTMSK &= ~DAINTMSK_OEPM(ep); - } - - /* IN endpoint activation or deactivation.*/ - otgp->ie[ep].DIEPTSIZ = 0; - 800f3c8: 4422 add r2, r4 - if (usbp->epc[ep]->in_cb != NULL) { - 800f3ca: 6899 ldr r1, [r3, #8] - otgp->oe[ep].DOEPCTL &= ~DOEPCTL_USBAEP; - otgp->DAINTMSK &= ~DAINTMSK_OEPM(ep); - } - - /* IN endpoint activation or deactivation.*/ - otgp->ie[ep].DIEPTSIZ = 0; - 800f3cc: f04f 0e00 mov.w lr, #0 - 800f3d0: f8c2 e910 str.w lr, [r2, #2320] ; 0x910 - if (usbp->epc[ep]->in_cb != NULL) { - 800f3d4: b399 cbz r1, 800f43e - /* FIFO allocation for the IN endpoint.*/ - fsize = usbp->epc[ep]->in_maxsize / 4; - if (usbp->epc[ep]->in_multiplier > 1) - 800f3d6: 8b99 ldrh r1, [r3, #28] - - /* IN endpoint activation or deactivation.*/ - otgp->ie[ep].DIEPTSIZ = 0; - if (usbp->epc[ep]->in_cb != NULL) { - /* FIFO allocation for the IN endpoint.*/ - fsize = usbp->epc[ep]->in_maxsize / 4; - 800f3d8: 8a1a ldrh r2, [r3, #16] - if (usbp->epc[ep]->in_multiplier > 1) - 800f3da: 2901 cmp r1, #1 - - /* IN endpoint activation or deactivation.*/ - otgp->ie[ep].DIEPTSIZ = 0; - if (usbp->epc[ep]->in_cb != NULL) { - /* FIFO allocation for the IN endpoint.*/ - fsize = usbp->epc[ep]->in_maxsize / 4; - 800f3dc: ea4f 0392 mov.w r3, r2, lsr #2 - if (usbp->epc[ep]->in_multiplier > 1) - fsize *= usbp->epc[ep]->in_multiplier; - 800f3e0: bf88 it hi - 800f3e2: 434b mulhi r3, r1 - otgp->DIEPTXF[ep - 1] = DIEPTXF_INEPTXFD(fsize) | - 800f3e4: f105 0e3f add.w lr, r5, #63 ; 0x3f - * @notapi - */ -static uint32_t otg_ram_alloc(USBDriver *usbp, size_t size) { - uint32_t next; - - next = usbp->pmnext; - 800f3e8: 6d81 ldr r1, [r0, #88] ; 0x58 - if (usbp->epc[ep]->in_cb != NULL) { - /* FIFO allocation for the IN endpoint.*/ - fsize = usbp->epc[ep]->in_maxsize / 4; - if (usbp->epc[ep]->in_multiplier > 1) - fsize *= usbp->epc[ep]->in_multiplier; - otgp->DIEPTXF[ep - 1] = DIEPTXF_INEPTXFD(fsize) | - 800f3ea: eb04 0e8e add.w lr, r4, lr, lsl #2 -} - -static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH; - 800f3ee: 01aa lsls r2, r5, #6 - */ -static uint32_t otg_ram_alloc(USBDriver *usbp, size_t size) { - uint32_t next; - - next = usbp->pmnext; - usbp->pmnext += size; - 800f3f0: eb03 0c01 add.w ip, r3, r1 -} - -static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH; - 800f3f4: f042 0220 orr.w r2, r2, #32 - if (usbp->epc[ep]->in_cb != NULL) { - /* FIFO allocation for the IN endpoint.*/ - fsize = usbp->epc[ep]->in_maxsize / 4; - if (usbp->epc[ep]->in_multiplier > 1) - fsize *= usbp->epc[ep]->in_multiplier; - otgp->DIEPTXF[ep - 1] = DIEPTXF_INEPTXFD(fsize) | - 800f3f8: ea41 4303 orr.w r3, r1, r3, lsl #16 - */ -static uint32_t otg_ram_alloc(USBDriver *usbp, size_t size) { - uint32_t next; - - next = usbp->pmnext; - usbp->pmnext += size; - 800f3fc: f8c0 c058 str.w ip, [r0, #88] ; 0x58 - if (usbp->epc[ep]->in_cb != NULL) { - /* FIFO allocation for the IN endpoint.*/ - fsize = usbp->epc[ep]->in_maxsize / 4; - if (usbp->epc[ep]->in_multiplier > 1) - fsize *= usbp->epc[ep]->in_multiplier; - otgp->DIEPTXF[ep - 1] = DIEPTXF_INEPTXFD(fsize) | - 800f400: f8ce 3004 str.w r3, [lr, #4] -} - -static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH; - 800f404: 6122 str r2, [r4, #16] - while ((otgp->GRSTCTL & GRSTCTL_TXFFLSH) != 0) - 800f406: 6923 ldr r3, [r4, #16] - 800f408: 069a lsls r2, r3, #26 - 800f40a: d4fc bmi.n 800f406 - 800f40c: 200c movs r0, #12 - 800f40e: f7fd fc07 bl 800cc20 - DIEPTXF_INEPTXSA(otg_ram_alloc(usbp, fsize)); - otg_txfifo_flush(usbp, ep); - - otgp->ie[ep].DIEPCTL = ctl | - DIEPCTL_TXFNUM(ep) | - DIEPCTL_MPSIZ(usbp->epc[ep]->in_maxsize); - 800f412: 68fb ldr r3, [r7, #12] - otgp->DIEPTXF[ep - 1] = DIEPTXF_INEPTXFD(fsize) | - DIEPTXF_INEPTXSA(otg_ram_alloc(usbp, fsize)); - otg_txfifo_flush(usbp, ep); - - otgp->ie[ep].DIEPCTL = ctl | - DIEPCTL_TXFNUM(ep) | - 800f414: 8a1a ldrh r2, [r3, #16] - fsize *= usbp->epc[ep]->in_multiplier; - otgp->DIEPTXF[ep - 1] = DIEPTXF_INEPTXFD(fsize) | - DIEPTXF_INEPTXSA(otg_ram_alloc(usbp, fsize)); - otg_txfifo_flush(usbp, ep); - - otgp->ie[ep].DIEPCTL = ctl | - 800f416: f105 0348 add.w r3, r5, #72 ; 0x48 - 800f41a: 015b lsls r3, r3, #5 - 800f41c: ea42 5285 orr.w r2, r2, r5, lsl #22 - DIEPCTL_TXFNUM(ep) | - 800f420: 4332 orrs r2, r6 - fsize *= usbp->epc[ep]->in_multiplier; - otgp->DIEPTXF[ep - 1] = DIEPTXF_INEPTXFD(fsize) | - DIEPTXF_INEPTXSA(otg_ram_alloc(usbp, fsize)); - otg_txfifo_flush(usbp, ep); - - otgp->ie[ep].DIEPCTL = ctl | - 800f422: 50e2 str r2, [r4, r3] - DIEPCTL_TXFNUM(ep) | - DIEPCTL_MPSIZ(usbp->epc[ep]->in_maxsize); - otgp->DAINTMSK |= DAINTMSK_IEPM(ep); - 800f424: 2301 movs r3, #1 - 800f426: f8d4 281c ldr.w r2, [r4, #2076] ; 0x81c - 800f42a: 40ab lsls r3, r5 - 800f42c: 4313 orrs r3, r2 - 800f42e: f8c4 381c str.w r3, [r4, #2076] ; 0x81c - 800f432: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - break; - case USB_EP_MODE_TYPE_ISOC: - ctl = DIEPCTL_SD0PID | DIEPCTL_USBAEP | DIEPCTL_EPTYP_ISO; - break; - case USB_EP_MODE_TYPE_BULK: - ctl = DIEPCTL_SD0PID | DIEPCTL_USBAEP | DIEPCTL_EPTYP_BULK; - 800f436: 4e1f ldr r6, [pc, #124] ; (800f4b4 ) - break; - 800f438: e7a7 b.n 800f38a - case USB_EP_MODE_TYPE_INTR: - ctl = DIEPCTL_SD0PID | DIEPCTL_USBAEP | DIEPCTL_EPTYP_INTR; - 800f43a: 4e1f ldr r6, [pc, #124] ; (800f4b8 ) - break; - 800f43c: e7a5 b.n 800f38a - DIEPCTL_TXFNUM(ep) | - DIEPCTL_MPSIZ(usbp->epc[ep]->in_maxsize); - otgp->DAINTMSK |= DAINTMSK_IEPM(ep); - } - else { - otgp->DIEPTXF[ep - 1] = 0x02000400; /* Reset value.*/ - 800f43e: f105 023f add.w r2, r5, #63 ; 0x3f - 800f442: eb04 0282 add.w r2, r4, r2, lsl #2 -} - -static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH; - 800f446: 01ab lsls r3, r5, #6 - DIEPCTL_TXFNUM(ep) | - DIEPCTL_MPSIZ(usbp->epc[ep]->in_maxsize); - otgp->DAINTMSK |= DAINTMSK_IEPM(ep); - } - else { - otgp->DIEPTXF[ep - 1] = 0x02000400; /* Reset value.*/ - 800f448: 491c ldr r1, [pc, #112] ; (800f4bc ) - 800f44a: 6051 str r1, [r2, #4] -} - -static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) { - stm32_otg_t *otgp = usbp->otg; - - otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH; - 800f44c: f043 0320 orr.w r3, r3, #32 - 800f450: 6123 str r3, [r4, #16] - while ((otgp->GRSTCTL & GRSTCTL_TXFFLSH) != 0) - 800f452: 6923 ldr r3, [r4, #16] - 800f454: 069b lsls r3, r3, #26 - 800f456: d4fc bmi.n 800f452 - 800f458: eb04 1848 add.w r8, r4, r8, lsl #5 - 800f45c: 200c movs r0, #12 - 800f45e: f7fd fbdf bl 800cc20 - otgp->DAINTMSK |= DAINTMSK_IEPM(ep); - } - else { - otgp->DIEPTXF[ep - 1] = 0x02000400; /* Reset value.*/ - otg_txfifo_flush(usbp, ep); - otgp->ie[ep].DIEPCTL &= ~DIEPCTL_USBAEP; - 800f462: f8d8 2900 ldr.w r2, [r8, #2304] ; 0x900 - 800f466: f422 4200 bic.w r2, r2, #32768 ; 0x8000 - 800f46a: f8c8 2900 str.w r2, [r8, #2304] ; 0x900 - otgp->DAINTMSK &= ~DAINTMSK_IEPM(ep); - 800f46e: f8d4 281c ldr.w r2, [r4, #2076] ; 0x81c - 800f472: 2301 movs r3, #1 - 800f474: 40ab lsls r3, r5 - 800f476: ea22 0303 bic.w r3, r2, r3 - 800f47a: f8c4 381c str.w r3, [r4, #2076] ; 0x81c - 800f47e: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - 800f482: eb04 1148 add.w r1, r4, r8, lsl #5 - otgp->oe[ep].DOEPCTL = ctl | DOEPCTL_MPSIZ(usbp->epc[ep]->out_maxsize); - otgp->DAINTMSK |= DAINTMSK_OEPM(ep); - } - else { - otgp->oe[ep].DOEPCTL &= ~DOEPCTL_USBAEP; - otgp->DAINTMSK &= ~DAINTMSK_OEPM(ep); - 800f486: f105 0c10 add.w ip, r5, #16 - if (usbp->epc[ep]->out_cb != NULL) { - otgp->oe[ep].DOEPCTL = ctl | DOEPCTL_MPSIZ(usbp->epc[ep]->out_maxsize); - otgp->DAINTMSK |= DAINTMSK_OEPM(ep); - } - else { - otgp->oe[ep].DOEPCTL &= ~DOEPCTL_USBAEP; - 800f48a: f8d1 eb00 ldr.w lr, [r1, #2816] ; 0xb00 - 800f48e: f42e 4e00 bic.w lr, lr, #32768 ; 0x8000 - 800f492: f8c1 eb00 str.w lr, [r1, #2816] ; 0xb00 - otgp->DAINTMSK &= ~DAINTMSK_OEPM(ep); - 800f496: f8d4 181c ldr.w r1, [r4, #2076] ; 0x81c - 800f49a: f04f 0e01 mov.w lr, #1 - 800f49e: fa0e fe0c lsl.w lr, lr, ip - 800f4a2: ea21 010e bic.w r1, r1, lr - 800f4a6: f8c4 181c str.w r1, [r4, #2076] ; 0x81c - 800f4aa: e78d b.n 800f3c8 - 800f4ac: 10048000 .word 0x10048000 - 800f4b0: 10008000 .word 0x10008000 - 800f4b4: 10088000 .word 0x10088000 - 800f4b8: 100c8000 .word 0x100c8000 - 800f4bc: 02000400 .word 0x02000400 - -0800f4c0 : -usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep) { - uint32_t ctl; - - (void)usbp; - - ctl = usbp->otg->oe[ep].DOEPCTL; - 800f4c0: 3158 adds r1, #88 ; 0x58 - 800f4c2: 6d03 ldr r3, [r0, #80] ; 0x50 - 800f4c4: 0149 lsls r1, r1, #5 - 800f4c6: 585b ldr r3, [r3, r1] - if (!(ctl & DOEPCTL_USBAEP)) - 800f4c8: f413 4000 ands.w r0, r3, #32768 ; 0x8000 - 800f4cc: d004 beq.n 800f4d8 - return EP_STATUS_DISABLED; - if (ctl & DOEPCTL_STALL) - 800f4ce: f413 1f00 tst.w r3, #2097152 ; 0x200000 - return EP_STATUS_STALLED; - return EP_STATUS_ACTIVE; - 800f4d2: bf14 ite ne - 800f4d4: 2001 movne r0, #1 - 800f4d6: 2002 moveq r0, #2 -} - 800f4d8: 4770 bx lr - 800f4da: bf00 nop - 800f4dc: f3af 8000 nop.w - -0800f4e0 : -usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep) { - uint32_t ctl; - - (void)usbp; - - ctl = usbp->otg->ie[ep].DIEPCTL; - 800f4e0: 3148 adds r1, #72 ; 0x48 - 800f4e2: 6d03 ldr r3, [r0, #80] ; 0x50 - 800f4e4: 0149 lsls r1, r1, #5 - 800f4e6: 585b ldr r3, [r3, r1] - if (!(ctl & DIEPCTL_USBAEP)) - 800f4e8: f413 4000 ands.w r0, r3, #32768 ; 0x8000 - 800f4ec: d004 beq.n 800f4f8 - return EP_STATUS_DISABLED; - if (ctl & DIEPCTL_STALL) - 800f4ee: f413 1f00 tst.w r3, #2097152 ; 0x200000 - return EP_STATUS_STALLED; - return EP_STATUS_ACTIVE; - 800f4f2: bf14 ite ne - 800f4f4: 2001 movne r0, #1 - 800f4f6: 2002 moveq r0, #2 -} - 800f4f8: 4770 bx lr - 800f4fa: bf00 nop - 800f4fc: f3af 8000 nop.w - -0800f500 : - * - * @notapi - */ -void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf) { - - memcpy(buf, usbp->epc[ep]->setup_buf, 8); - 800f500: eb00 0181 add.w r1, r0, r1, lsl #2 - 800f504: 68cb ldr r3, [r1, #12] - 800f506: 6a1b ldr r3, [r3, #32] - 800f508: 6819 ldr r1, [r3, #0] - 800f50a: 685b ldr r3, [r3, #4] - 800f50c: 6053 str r3, [r2, #4] - 800f50e: 6011 str r1, [r2, #0] - 800f510: 4770 bx lr - 800f512: bf00 nop - 800f514: f3af 8000 nop.w - 800f518: f3af 8000 nop.w - 800f51c: f3af 8000 nop.w - -0800f520 : - * - * @notapi - */ -void usb_lld_prepare_receive(USBDriver *usbp, usbep_t ep) { - uint32_t pcnt; - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800f520: eb00 0381 add.w r3, r0, r1, lsl #2 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_prepare_receive(USBDriver *usbp, usbep_t ep) { - 800f524: b430 push {r4, r5} - uint32_t pcnt; - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800f526: 68dd ldr r5, [r3, #12] - 800f528: 69ac ldr r4, [r5, #24] - - /* Transfer initialization.*/ - osp->totsize = osp->rxsize; - 800f52a: 6863 ldr r3, [r4, #4] - 800f52c: 6123 str r3, [r4, #16] - if ((ep == 0) && (osp->rxsize > EP0_MAX_OUTSIZE)) - 800f52e: b931 cbnz r1, 800f53e - 800f530: 2b40 cmp r3, #64 ; 0x40 - 800f532: d904 bls.n 800f53e - osp->rxsize = EP0_MAX_OUTSIZE; - 800f534: 2340 movs r3, #64 ; 0x40 - 800f536: 6063 str r3, [r4, #4] - 800f538: 4a09 ldr r2, [pc, #36] ; (800f560 ) - 800f53a: 243f movs r4, #63 ; 0x3f - 800f53c: e002 b.n 800f544 - 800f53e: 1e5c subs r4, r3, #1 - 800f540: f043 42c0 orr.w r2, r3, #1610612736 ; 0x60000000 - - pcnt = (osp->rxsize + usbp->epc[ep]->out_maxsize - 1) / - usbp->epc[ep]->out_maxsize; - usbp->otg->oe[ep].DOEPTSIZ = DOEPTSIZ_STUPCNT(3) | DOEPTSIZ_PKTCNT(pcnt) | - 800f544: 6d00 ldr r0, [r0, #80] ; 0x50 - /* Transfer initialization.*/ - osp->totsize = osp->rxsize; - if ((ep == 0) && (osp->rxsize > EP0_MAX_OUTSIZE)) - osp->rxsize = EP0_MAX_OUTSIZE; - - pcnt = (osp->rxsize + usbp->epc[ep]->out_maxsize - 1) / - 800f546: 8a6d ldrh r5, [r5, #18] - usbp->epc[ep]->out_maxsize; - usbp->otg->oe[ep].DOEPTSIZ = DOEPTSIZ_STUPCNT(3) | DOEPTSIZ_PKTCNT(pcnt) | - 800f548: eb00 1141 add.w r1, r0, r1, lsl #5 - /* Transfer initialization.*/ - osp->totsize = osp->rxsize; - if ((ep == 0) && (osp->rxsize > EP0_MAX_OUTSIZE)) - osp->rxsize = EP0_MAX_OUTSIZE; - - pcnt = (osp->rxsize + usbp->epc[ep]->out_maxsize - 1) / - 800f54c: 1963 adds r3, r4, r5 - 800f54e: fbb3 f3f5 udiv r3, r3, r5 - usbp->epc[ep]->out_maxsize; - usbp->otg->oe[ep].DOEPTSIZ = DOEPTSIZ_STUPCNT(3) | DOEPTSIZ_PKTCNT(pcnt) | - 800f552: ea42 43c3 orr.w r3, r2, r3, lsl #19 - 800f556: f8c1 3b10 str.w r3, [r1, #2832] ; 0xb10 - DOEPTSIZ_XFRSIZ(osp->rxsize); - -} - 800f55a: bc30 pop {r4, r5} - 800f55c: 4770 bx lr - 800f55e: bf00 nop - 800f560: 60000040 .word 0x60000040 - 800f564: f3af 8000 nop.w - 800f568: f3af 8000 nop.w - 800f56c: f3af 8000 nop.w - -0800f570 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -static void otg_epout_handler(USBDriver *usbp, usbep_t ep) { - 800f570: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - stm32_otg_t *otgp = usbp->otg; - 800f574: 4e26 ldr r6, [pc, #152] ; (800f610 ) - 800f576: 6d37 ldr r7, [r6, #80] ; 0x50 - uint32_t epint = otgp->oe[ep].DOEPINT; - 800f578: eb07 1340 add.w r3, r7, r0, lsl #5 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -static void otg_epout_handler(USBDriver *usbp, usbep_t ep) { - 800f57c: 4605 mov r5, r0 - stm32_otg_t *otgp = usbp->otg; - uint32_t epint = otgp->oe[ep].DOEPINT; - 800f57e: f8d3 4b08 ldr.w r4, [r3, #2824] ; 0xb08 - - /* Resets all EP IRQ sources.*/ - otgp->oe[ep].DOEPINT = epint; - 800f582: f8c3 4b08 str.w r4, [r3, #2824] ; 0xb08 - - if ((epint & DOEPINT_STUP) && (otgp->DOEPMSK & DOEPMSK_STUPM)) { - 800f586: 0720 lsls r0, r4, #28 - 800f588: d503 bpl.n 800f592 - 800f58a: f8d7 3814 ldr.w r3, [r7, #2068] ; 0x814 - 800f58e: 0719 lsls r1, r3, #28 - 800f590: d41d bmi.n 800f5ce - /* Setup packets handling, setup packets are handled using a - specific callback.*/ - _usb_isr_invoke_setup_cb(usbp, ep); - - } - if ((epint & DOEPINT_XFRC) && (otgp->DOEPMSK & DOEPMSK_XFRCM)) { - 800f592: 07e2 lsls r2, r4, #31 - 800f594: d519 bpl.n 800f5ca - 800f596: f8d7 3814 ldr.w r3, [r7, #2068] ; 0x814 - 800f59a: 07db lsls r3, r3, #31 - 800f59c: d515 bpl.n 800f5ca - /* Receive transfer complete.*/ - USBOutEndpointState *osp = usbp->epc[ep]->out_state; - 800f59e: eb06 0685 add.w r6, r6, r5, lsl #2 - 800f5a2: 4c1b ldr r4, [pc, #108] ; (800f610 ) - 800f5a4: 68f1 ldr r1, [r6, #12] - 800f5a6: 698b ldr r3, [r1, #24] - - if (osp->rxsize < osp->totsize) { - 800f5a8: 6858 ldr r0, [r3, #4] - 800f5aa: 691a ldr r2, [r3, #16] - 800f5ac: 4290 cmp r0, r2 - 800f5ae: d316 bcc.n 800f5de - usb_lld_start_out(usbp, ep); - chSysUnlockFromISR(); - } - else { - /* End on OUT transfer.*/ - _usb_isr_invoke_out_cb(usbp, ep); - 800f5b0: 8962 ldrh r2, [r4, #10] - 800f5b2: 68ce ldr r6, [r1, #12] - 800f5b4: 2301 movs r3, #1 - 800f5b6: 40ab lsls r3, r5 - 800f5b8: ea22 0303 bic.w r3, r2, r3 - 800f5bc: 8163 strh r3, [r4, #10] - 800f5be: 4629 mov r1, r5 - 800f5c0: 4620 mov r0, r4 - 800f5c2: 4633 mov r3, r6 - } - } -} - 800f5c4: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr} - usb_lld_start_out(usbp, ep); - chSysUnlockFromISR(); - } - else { - /* End on OUT transfer.*/ - _usb_isr_invoke_out_cb(usbp, ep); - 800f5c8: 4718 bx r3 - 800f5ca: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - otgp->oe[ep].DOEPINT = epint; - - if ((epint & DOEPINT_STUP) && (otgp->DOEPMSK & DOEPMSK_STUPM)) { - /* Setup packets handling, setup packets are handled using a - specific callback.*/ - _usb_isr_invoke_setup_cb(usbp, ep); - 800f5ce: eb06 0385 add.w r3, r6, r5, lsl #2 - 800f5d2: 4630 mov r0, r6 - 800f5d4: 68db ldr r3, [r3, #12] - 800f5d6: 4629 mov r1, r5 - 800f5d8: 685b ldr r3, [r3, #4] - 800f5da: 4798 blx r3 - 800f5dc: e7d9 b.n 800f592 - - if (osp->rxsize < osp->totsize) { - /* In case the transaction covered only part of the total transfer - then another transaction is immediately started in order to - cover the remaining.*/ - osp->rxsize = osp->totsize - osp->rxsize; - 800f5de: 1a12 subs r2, r2, r0 - osp->rxcnt = 0; - 800f5e0: 2600 movs r6, #0 - - if (osp->rxsize < osp->totsize) { - /* In case the transaction covered only part of the total transfer - then another transaction is immediately started in order to - cover the remaining.*/ - osp->rxsize = osp->totsize - osp->rxsize; - 800f5e2: 605a str r2, [r3, #4] - osp->rxcnt = 0; - 800f5e4: 609e str r6, [r3, #8] - usb_lld_prepare_receive(usbp, ep); - 800f5e6: 4620 mov r0, r4 - 800f5e8: 4629 mov r1, r5 - 800f5ea: f7ff ff99 bl 800f520 - 800f5ee: 2320 movs r3, #32 - 800f5f0: f383 8811 msr BASEPRI, r3 - 800f5f4: 6d23 ldr r3, [r4, #80] ; 0x50 - 800f5f6: eb03 1545 add.w r5, r3, r5, lsl #5 - * - * @notapi - */ -void usb_lld_start_out(USBDriver *usbp, usbep_t ep) { - - usbp->otg->oe[ep].DOEPCTL |= DOEPCTL_CNAK; - 800f5fa: f8d5 3b00 ldr.w r3, [r5, #2816] ; 0xb00 - 800f5fe: f043 6380 orr.w r3, r3, #67108864 ; 0x4000000 - 800f602: f8c5 3b00 str.w r3, [r5, #2816] ; 0xb00 - 800f606: f386 8811 msr BASEPRI, r6 - 800f60a: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - 800f60e: bf00 nop - 800f610: 20000fb0 .word 0x20000fb0 - 800f614: f3af 8000 nop.w - 800f618: f3af 8000 nop.w - 800f61c: f3af 8000 nop.w - -0800f620 : - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_prepare_transmit(USBDriver *usbp, usbep_t ep) { - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800f620: eb00 0381 add.w r3, r0, r1, lsl #2 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_prepare_transmit(USBDriver *usbp, usbep_t ep) { - 800f624: b410 push {r4} - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800f626: 68dc ldr r4, [r3, #12] - 800f628: 6962 ldr r2, [r4, #20] - - /* Transfer initialization.*/ - isp->totsize = isp->txsize; - 800f62a: 6853 ldr r3, [r2, #4] - 800f62c: 6113 str r3, [r2, #16] - if (isp->txsize == 0) { - 800f62e: b1ab cbz r3, 800f65c - /* Special case, sending zero size packet.*/ - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(1) | DIEPTSIZ_XFRSIZ(0); - } - else { - if ((ep == 0) && (isp->txsize > EP0_MAX_INSIZE)) - 800f630: b171 cbz r1, 800f650 - 800f632: 1e5a subs r2, r3, #1 - isp->txsize = EP0_MAX_INSIZE; - - /* Normal case.*/ - uint32_t pcnt = (isp->txsize + usbp->epc[ep]->in_maxsize - 1) / - usbp->epc[ep]->in_maxsize; - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(pcnt) | - 800f634: 6d00 ldr r0, [r0, #80] ; 0x50 - else { - if ((ep == 0) && (isp->txsize > EP0_MAX_INSIZE)) - isp->txsize = EP0_MAX_INSIZE; - - /* Normal case.*/ - uint32_t pcnt = (isp->txsize + usbp->epc[ep]->in_maxsize - 1) / - 800f636: 8a24 ldrh r4, [r4, #16] - usbp->epc[ep]->in_maxsize; - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(pcnt) | - 800f638: eb00 1141 add.w r1, r0, r1, lsl #5 - else { - if ((ep == 0) && (isp->txsize > EP0_MAX_INSIZE)) - isp->txsize = EP0_MAX_INSIZE; - - /* Normal case.*/ - uint32_t pcnt = (isp->txsize + usbp->epc[ep]->in_maxsize - 1) / - 800f63c: 4422 add r2, r4 - 800f63e: fbb2 f2f4 udiv r2, r2, r4 - usbp->epc[ep]->in_maxsize; - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(pcnt) | - 800f642: ea43 43c2 orr.w r3, r3, r2, lsl #19 - 800f646: f8c1 3910 str.w r3, [r1, #2320] ; 0x910 - DIEPTSIZ_XFRSIZ(isp->txsize); - } -} - 800f64a: f85d 4b04 ldr.w r4, [sp], #4 - 800f64e: 4770 bx lr - if (isp->txsize == 0) { - /* Special case, sending zero size packet.*/ - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(1) | DIEPTSIZ_XFRSIZ(0); - } - else { - if ((ep == 0) && (isp->txsize > EP0_MAX_INSIZE)) - 800f650: 2b40 cmp r3, #64 ; 0x40 - 800f652: d9ee bls.n 800f632 - isp->txsize = EP0_MAX_INSIZE; - 800f654: 2340 movs r3, #64 ; 0x40 - 800f656: 6053 str r3, [r2, #4] - 800f658: 223f movs r2, #63 ; 0x3f - 800f65a: e7eb b.n 800f634 - - /* Transfer initialization.*/ - isp->totsize = isp->txsize; - if (isp->txsize == 0) { - /* Special case, sending zero size packet.*/ - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(1) | DIEPTSIZ_XFRSIZ(0); - 800f65c: 6d03 ldr r3, [r0, #80] ; 0x50 - uint32_t pcnt = (isp->txsize + usbp->epc[ep]->in_maxsize - 1) / - usbp->epc[ep]->in_maxsize; - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(pcnt) | - DIEPTSIZ_XFRSIZ(isp->txsize); - } -} - 800f65e: f85d 4b04 ldr.w r4, [sp], #4 - - /* Transfer initialization.*/ - isp->totsize = isp->txsize; - if (isp->txsize == 0) { - /* Special case, sending zero size packet.*/ - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(1) | DIEPTSIZ_XFRSIZ(0); - 800f662: eb03 1141 add.w r1, r3, r1, lsl #5 - 800f666: f44f 2300 mov.w r3, #524288 ; 0x80000 - 800f66a: f8c1 3910 str.w r3, [r1, #2320] ; 0x910 - uint32_t pcnt = (isp->txsize + usbp->epc[ep]->in_maxsize - 1) / - usbp->epc[ep]->in_maxsize; - usbp->otg->ie[ep].DIEPTSIZ = DIEPTSIZ_PKTCNT(pcnt) | - DIEPTSIZ_XFRSIZ(isp->txsize); - } -} - 800f66e: 4770 bx lr - -0800f670 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -static void otg_epin_handler(USBDriver *usbp, usbep_t ep) { - 800f670: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - stm32_otg_t *otgp = usbp->otg; - 800f674: 4f30 ldr r7, [pc, #192] ; (800f738 ) - 800f676: 6d3d ldr r5, [r7, #80] ; 0x50 - uint32_t epint = otgp->ie[ep].DIEPINT; - 800f678: eb05 1340 add.w r3, r5, r0, lsl #5 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -static void otg_epin_handler(USBDriver *usbp, usbep_t ep) { - 800f67c: 4606 mov r6, r0 - stm32_otg_t *otgp = usbp->otg; - uint32_t epint = otgp->ie[ep].DIEPINT; - 800f67e: f8d3 4908 ldr.w r4, [r3, #2312] ; 0x908 - - otgp->ie[ep].DIEPINT = epint; - 800f682: f8c3 4908 str.w r4, [r3, #2312] ; 0x908 - - if (epint & DIEPINT_TOC) { - /* Timeouts not handled yet, not sure how to handle.*/ - } - if ((epint & DIEPINT_XFRC) && (otgp->DIEPMSK & DIEPMSK_XFRCM)) { - 800f686: 07e1 lsls r1, r4, #31 - 800f688: d503 bpl.n 800f692 - 800f68a: f8d5 3810 ldr.w r3, [r5, #2064] ; 0x810 - 800f68e: 07da lsls r2, r3, #31 - 800f690: d409 bmi.n 800f6a6 - else { - /* End on IN transfer.*/ - _usb_isr_invoke_in_cb(usbp, ep); - } - } - if ((epint & DIEPINT_TXFE) && - 800f692: 0623 lsls r3, r4, #24 - 800f694: d505 bpl.n 800f6a2 - (otgp->DIEPEMPMSK & DIEPEMPMSK_INEPTXFEM(ep))) { - 800f696: 2301 movs r3, #1 - 800f698: f8d5 2834 ldr.w r2, [r5, #2100] ; 0x834 - 800f69c: 40b3 lsls r3, r6 - else { - /* End on IN transfer.*/ - _usb_isr_invoke_in_cb(usbp, ep); - } - } - if ((epint & DIEPINT_TXFE) && - 800f69e: 4213 tst r3, r2 - 800f6a0: d129 bne.n 800f6f6 - 800f6a2: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - if (epint & DIEPINT_TOC) { - /* Timeouts not handled yet, not sure how to handle.*/ - } - if ((epint & DIEPINT_XFRC) && (otgp->DIEPMSK & DIEPMSK_XFRCM)) { - /* Transmit transfer complete.*/ - USBInEndpointState *isp = usbp->epc[ep]->in_state; - 800f6a6: eb07 0380 add.w r3, r7, r0, lsl #2 - 800f6aa: 68d9 ldr r1, [r3, #12] - 800f6ac: 694b ldr r3, [r1, #20] - - if (isp->txsize < isp->totsize) { - 800f6ae: 6858 ldr r0, [r3, #4] - 800f6b0: 691a ldr r2, [r3, #16] - 800f6b2: 4290 cmp r0, r2 - 800f6b4: d234 bcs.n 800f720 - /* In case the transaction covered only part of the total transfer - then another transaction is immediately started in order to - cover the remaining.*/ - isp->txsize = isp->totsize - isp->txsize; - 800f6b6: 1a12 subs r2, r2, r0 - isp->txcnt = 0; - 800f6b8: f04f 0800 mov.w r8, #0 - - if (isp->txsize < isp->totsize) { - /* In case the transaction covered only part of the total transfer - then another transaction is immediately started in order to - cover the remaining.*/ - isp->txsize = isp->totsize - isp->txsize; - 800f6bc: 605a str r2, [r3, #4] - isp->txcnt = 0; - 800f6be: f8c3 8008 str.w r8, [r3, #8] - usb_lld_prepare_transmit(usbp, ep); - 800f6c2: 4638 mov r0, r7 - 800f6c4: 4631 mov r1, r6 - 800f6c6: f7ff ffab bl 800f620 - 800f6ca: 2320 movs r3, #32 - 800f6cc: f383 8811 msr BASEPRI, r3 - * - * @notapi - */ -void usb_lld_start_in(USBDriver *usbp, usbep_t ep) { - - usbp->otg->ie[ep].DIEPCTL |= DIEPCTL_EPENA | DIEPCTL_CNAK; - 800f6d0: 6d3b ldr r3, [r7, #80] ; 0x50 - 800f6d2: eb03 1046 add.w r0, r3, r6, lsl #5 - usbp->otg->DIEPEMPMSK |= DIEPEMPMSK_INEPTXFEM(ep); - 800f6d6: 2201 movs r2, #1 - * - * @notapi - */ -void usb_lld_start_in(USBDriver *usbp, usbep_t ep) { - - usbp->otg->ie[ep].DIEPCTL |= DIEPCTL_EPENA | DIEPCTL_CNAK; - 800f6d8: f8d0 1900 ldr.w r1, [r0, #2304] ; 0x900 - 800f6dc: f041 4104 orr.w r1, r1, #2214592512 ; 0x84000000 - 800f6e0: f8c0 1900 str.w r1, [r0, #2304] ; 0x900 - usbp->otg->DIEPEMPMSK |= DIEPEMPMSK_INEPTXFEM(ep); - 800f6e4: f8d3 1834 ldr.w r1, [r3, #2100] ; 0x834 - 800f6e8: 40b2 lsls r2, r6 - 800f6ea: 430a orrs r2, r1 - 800f6ec: f8c3 2834 str.w r2, [r3, #2100] ; 0x834 - 800f6f0: f388 8811 msr BASEPRI, r8 - 800f6f4: e7cd b.n 800f692 - 800f6f6: 2220 movs r2, #32 - 800f6f8: f382 8811 msr BASEPRI, r2 - if ((epint & DIEPINT_TXFE) && - (otgp->DIEPEMPMSK & DIEPEMPMSK_INEPTXFEM(ep))) { - /* The thread is made ready, it will be scheduled on ISR exit.*/ - osalSysLockFromISR(); - usbp->txpending |= (1 << ep); - otgp->DIEPEMPMSK &= ~(1 << ep); - 800f6fc: f8d5 1834 ldr.w r1, [r5, #2100] ; 0x834 - } - if ((epint & DIEPINT_TXFE) && - (otgp->DIEPEMPMSK & DIEPEMPMSK_INEPTXFEM(ep))) { - /* The thread is made ready, it will be scheduled on ISR exit.*/ - osalSysLockFromISR(); - usbp->txpending |= (1 << ep); - 800f700: 6dfa ldr r2, [r7, #92] ; 0x5c - * - * @iclass - */ -static inline void osalThreadResumeI(thread_reference_t *trp, msg_t msg) { - - chThdResumeI(trp, msg); - 800f702: 480e ldr r0, [pc, #56] ; (800f73c ) - otgp->DIEPEMPMSK &= ~(1 << ep); - 800f704: ea21 0103 bic.w r1, r1, r3 - 800f708: f8c5 1834 str.w r1, [r5, #2100] ; 0x834 - } - if ((epint & DIEPINT_TXFE) && - (otgp->DIEPEMPMSK & DIEPEMPMSK_INEPTXFEM(ep))) { - /* The thread is made ready, it will be scheduled on ISR exit.*/ - osalSysLockFromISR(); - usbp->txpending |= (1 << ep); - 800f70c: 4313 orrs r3, r2 - 800f70e: 2100 movs r1, #0 - 800f710: 65fb str r3, [r7, #92] ; 0x5c - 800f712: f7fd fd0d bl 800d130 - 800f716: 2300 movs r3, #0 - 800f718: f383 8811 msr BASEPRI, r3 - 800f71c: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - usb_lld_start_in(usbp, ep); - osalSysUnlockFromISR(); - } - else { - /* End on IN transfer.*/ - _usb_isr_invoke_in_cb(usbp, ep); - 800f720: 893a ldrh r2, [r7, #8] - 800f722: f8d1 c008 ldr.w ip, [r1, #8] - 800f726: 2301 movs r3, #1 - 800f728: 40b3 lsls r3, r6 - 800f72a: ea22 0303 bic.w r3, r2, r3 - 800f72e: 813b strh r3, [r7, #8] - 800f730: 4638 mov r0, r7 - 800f732: 4631 mov r1, r6 - 800f734: 47e0 blx ip - 800f736: e7ac b.n 800f692 - 800f738: 20000fb0 .word 0x20000fb0 - 800f73c: 20001010 .word 0x20001010 - -0800f740 : -/** - * @brief OTG1 interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_OTG1_HANDLER) { - 800f740: b570 push {r4, r5, r6, lr} - * @param[in] usbp pointer to the @p USBDriver object - * - * @notapi - */ -static void usb_lld_serve_interrupt(USBDriver *usbp) { - stm32_otg_t *otgp = usbp->otg; - 800f742: 4d3a ldr r5, [pc, #232] ; (800f82c ) - 800f744: 6d2e ldr r6, [r5, #80] ; 0x50 - uint32_t sts, src; - - sts = otgp->GINTSTS; - 800f746: 6973 ldr r3, [r6, #20] - sts &= otgp->GINTMSK; - 800f748: 69b4 ldr r4, [r6, #24] - 800f74a: 401c ands r4, r3 - otgp->GINTSTS = sts; - - /* Reset interrupt handling.*/ - if (sts & GINTSTS_USBRST) { - 800f74c: 04e1 lsls r1, r4, #19 - stm32_otg_t *otgp = usbp->otg; - uint32_t sts, src; - - sts = otgp->GINTSTS; - sts &= otgp->GINTMSK; - otgp->GINTSTS = sts; - 800f74e: 6174 str r4, [r6, #20] - - /* Reset interrupt handling.*/ - if (sts & GINTSTS_USBRST) { - 800f750: d42d bmi.n 800f7ae - _usb_reset(usbp); - _usb_isr_invoke_event_cb(usbp, USB_EVENT_RESET); - } - - /* Enumeration done.*/ - if (sts & GINTSTS_ENUMDNE) { - 800f752: 04a2 lsls r2, r4, #18 - (void)otgp->DSTS; - 800f754: bf48 it mi - 800f756: f8d6 3808 ldrmi.w r3, [r6, #2056] ; 0x808 - } - - /* SOF interrupt handling.*/ - if (sts & GINTSTS_SOF) { - 800f75a: 0723 lsls r3, r4, #28 - 800f75c: d504 bpl.n 800f768 - _usb_isr_invoke_sof_cb(usbp); - 800f75e: 686b ldr r3, [r5, #4] - 800f760: 68db ldr r3, [r3, #12] - 800f762: b10b cbz r3, 800f768 - 800f764: 4831 ldr r0, [pc, #196] ; (800f82c ) - 800f766: 4798 blx r3 - } - - /* RX FIFO not empty handling.*/ - if (sts & GINTSTS_RXFLVL) { - 800f768: 06e5 lsls r5, r4, #27 - 800f76a: d42b bmi.n 800f7c4 - osalSysUnlockFromISR(); - } - - /* IN/OUT endpoints event handling.*/ - src = otgp->DAINT; - if (sts & GINTSTS_IEPINT) { - 800f76c: 0360 lsls r0, r4, #13 - osalThreadResumeI(&usbp->wait, MSG_OK); - osalSysUnlockFromISR(); - } - - /* IN/OUT endpoints event handling.*/ - src = otgp->DAINT; - 800f76e: f8d6 5818 ldr.w r5, [r6, #2072] ; 0x818 - if (sts & GINTSTS_IEPINT) { - 800f772: d507 bpl.n 800f784 - if (src & (1 << 0)) - 800f774: 07e9 lsls r1, r5, #31 - 800f776: d445 bmi.n 800f804 - otg_epin_handler(usbp, 0); - if (src & (1 << 1)) - 800f778: 07aa lsls r2, r5, #30 - 800f77a: d448 bmi.n 800f80e - otg_epin_handler(usbp, 1); - if (src & (1 << 2)) - 800f77c: 076b lsls r3, r5, #29 - 800f77e: d44b bmi.n 800f818 - otg_epin_handler(usbp, 2); - if (src & (1 << 3)) - 800f780: 072e lsls r6, r5, #28 - 800f782: d44e bmi.n 800f822 - otg_epin_handler(usbp, 4); - if (src & (1 << 5)) - otg_epin_handler(usbp, 5); -#endif - } - if (sts & GINTSTS_OEPINT) { - 800f784: 0324 lsls r4, r4, #12 - 800f786: d507 bpl.n 800f798 - if (src & (1 << 16)) - 800f788: 03e8 lsls r0, r5, #15 - 800f78a: d430 bmi.n 800f7ee - otg_epout_handler(usbp, 0); - if (src & (1 << 17)) - 800f78c: 03a9 lsls r1, r5, #14 - 800f78e: d433 bmi.n 800f7f8 - otg_epout_handler(usbp, 1); - if (src & (1 << 18)) - 800f790: 036a lsls r2, r5, #13 - 800f792: d426 bmi.n 800f7e2 - otg_epout_handler(usbp, 2); - if (src & (1 << 19)) - 800f794: 032b lsls r3, r5, #12 - 800f796: d403 bmi.n 800f7a0 - OSAL_IRQ_PROLOGUE(); - - usb_lld_serve_interrupt(&USBD1); - - OSAL_IRQ_EPILOGUE(); -} - 800f798: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} - - OSAL_IRQ_PROLOGUE(); - - usb_lld_serve_interrupt(&USBD1); - - OSAL_IRQ_EPILOGUE(); - 800f79c: f7fd bf08 b.w 800d5b0 <_port_irq_epilogue> - if (src & (1 << 17)) - otg_epout_handler(usbp, 1); - if (src & (1 << 18)) - otg_epout_handler(usbp, 2); - if (src & (1 << 19)) - otg_epout_handler(usbp, 3); - 800f7a0: 2003 movs r0, #3 - 800f7a2: f7ff fee5 bl 800f570 - OSAL_IRQ_PROLOGUE(); - - usb_lld_serve_interrupt(&USBD1); - - OSAL_IRQ_EPILOGUE(); -} - 800f7a6: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} - - OSAL_IRQ_PROLOGUE(); - - usb_lld_serve_interrupt(&USBD1); - - OSAL_IRQ_EPILOGUE(); - 800f7aa: f7fd bf01 b.w 800d5b0 <_port_irq_epilogue> - sts &= otgp->GINTMSK; - otgp->GINTSTS = sts; - - /* Reset interrupt handling.*/ - if (sts & GINTSTS_USBRST) { - _usb_reset(usbp); - 800f7ae: 4628 mov r0, r5 - 800f7b0: f7fe fa0e bl 800dbd0 <_usb_reset> - _usb_isr_invoke_event_cb(usbp, USB_EVENT_RESET); - 800f7b4: 686b ldr r3, [r5, #4] - 800f7b6: 681b ldr r3, [r3, #0] - 800f7b8: 2b00 cmp r3, #0 - 800f7ba: d0ca beq.n 800f752 - 800f7bc: 4628 mov r0, r5 - 800f7be: 2100 movs r1, #0 - 800f7c0: 4798 blx r3 - 800f7c2: e7c6 b.n 800f752 - 800f7c4: 2320 movs r3, #32 - 800f7c6: f383 8811 msr BASEPRI, r3 - /* RX FIFO not empty handling.*/ - if (sts & GINTSTS_RXFLVL) { - /* The interrupt is masked while the thread has control or it would - be triggered again.*/ - osalSysLockFromISR(); - otgp->GINTMSK &= ~GINTMSK_RXFLVLM; - 800f7ca: 69b3 ldr r3, [r6, #24] - 800f7cc: 4818 ldr r0, [pc, #96] ; (800f830 ) - 800f7ce: f023 0310 bic.w r3, r3, #16 - 800f7d2: 61b3 str r3, [r6, #24] - 800f7d4: 2100 movs r1, #0 - 800f7d6: f7fd fcab bl 800d130 - 800f7da: 2300 movs r3, #0 - 800f7dc: f383 8811 msr BASEPRI, r3 - 800f7e0: e7c4 b.n 800f76c - if (src & (1 << 16)) - otg_epout_handler(usbp, 0); - if (src & (1 << 17)) - otg_epout_handler(usbp, 1); - if (src & (1 << 18)) - otg_epout_handler(usbp, 2); - 800f7e2: 2002 movs r0, #2 - 800f7e4: f7ff fec4 bl 800f570 - if (src & (1 << 19)) - 800f7e8: 032b lsls r3, r5, #12 - 800f7ea: d5d5 bpl.n 800f798 - 800f7ec: e7d8 b.n 800f7a0 - otg_epin_handler(usbp, 5); -#endif - } - if (sts & GINTSTS_OEPINT) { - if (src & (1 << 16)) - otg_epout_handler(usbp, 0); - 800f7ee: 2000 movs r0, #0 - 800f7f0: f7ff febe bl 800f570 - if (src & (1 << 17)) - 800f7f4: 03a9 lsls r1, r5, #14 - 800f7f6: d5cb bpl.n 800f790 - otg_epout_handler(usbp, 1); - 800f7f8: 2001 movs r0, #1 - 800f7fa: f7ff feb9 bl 800f570 - if (src & (1 << 18)) - 800f7fe: 036a lsls r2, r5, #13 - 800f800: d5c8 bpl.n 800f794 - 800f802: e7ee b.n 800f7e2 - - /* IN/OUT endpoints event handling.*/ - src = otgp->DAINT; - if (sts & GINTSTS_IEPINT) { - if (src & (1 << 0)) - otg_epin_handler(usbp, 0); - 800f804: 2000 movs r0, #0 - 800f806: f7ff ff33 bl 800f670 - if (src & (1 << 1)) - 800f80a: 07aa lsls r2, r5, #30 - 800f80c: d5b6 bpl.n 800f77c - otg_epin_handler(usbp, 1); - 800f80e: 2001 movs r0, #1 - 800f810: f7ff ff2e bl 800f670 - if (src & (1 << 2)) - 800f814: 076b lsls r3, r5, #29 - 800f816: d5b3 bpl.n 800f780 - otg_epin_handler(usbp, 2); - 800f818: 2002 movs r0, #2 - 800f81a: f7ff ff29 bl 800f670 - if (src & (1 << 3)) - 800f81e: 072e lsls r6, r5, #28 - 800f820: d5b0 bpl.n 800f784 - otg_epin_handler(usbp, 3); - 800f822: 2003 movs r0, #3 - 800f824: f7ff ff24 bl 800f670 - 800f828: e7ac b.n 800f784 - 800f82a: bf00 nop - 800f82c: 20000fb0 .word 0x20000fb0 - 800f830: 20001010 .word 0x20001010 - 800f834: f3af 8000 nop.w - 800f838: f3af 8000 nop.w - 800f83c: f3af 8000 nop.w - -0800f840 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_start_out(USBDriver *usbp, usbep_t ep) { - 800f840: 6d03 ldr r3, [r0, #80] ; 0x50 - 800f842: eb03 1141 add.w r1, r3, r1, lsl #5 - - usbp->otg->oe[ep].DOEPCTL |= DOEPCTL_CNAK; - 800f846: f8d1 3b00 ldr.w r3, [r1, #2816] ; 0xb00 - 800f84a: f043 6380 orr.w r3, r3, #67108864 ; 0x4000000 - 800f84e: f8c1 3b00 str.w r3, [r1, #2816] ; 0xb00 - 800f852: 4770 bx lr - 800f854: f3af 8000 nop.w - 800f858: f3af 8000 nop.w - 800f85c: f3af 8000 nop.w - -0800f860 : - * - * @notapi - */ -void usb_lld_start_in(USBDriver *usbp, usbep_t ep) { - - usbp->otg->ie[ep].DIEPCTL |= DIEPCTL_EPENA | DIEPCTL_CNAK; - 800f860: 6d03 ldr r3, [r0, #80] ; 0x50 - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_start_in(USBDriver *usbp, usbep_t ep) { - 800f862: b410 push {r4} - 800f864: eb03 1441 add.w r4, r3, r1, lsl #5 - - usbp->otg->ie[ep].DIEPCTL |= DIEPCTL_EPENA | DIEPCTL_CNAK; - usbp->otg->DIEPEMPMSK |= DIEPEMPMSK_INEPTXFEM(ep); - 800f868: 2201 movs r2, #1 - * - * @notapi - */ -void usb_lld_start_in(USBDriver *usbp, usbep_t ep) { - - usbp->otg->ie[ep].DIEPCTL |= DIEPCTL_EPENA | DIEPCTL_CNAK; - 800f86a: f8d4 0900 ldr.w r0, [r4, #2304] ; 0x900 - 800f86e: f040 4004 orr.w r0, r0, #2214592512 ; 0x84000000 - 800f872: f8c4 0900 str.w r0, [r4, #2304] ; 0x900 - usbp->otg->DIEPEMPMSK |= DIEPEMPMSK_INEPTXFEM(ep); - 800f876: f8d3 0834 ldr.w r0, [r3, #2100] ; 0x834 -} - 800f87a: f85d 4b04 ldr.w r4, [sp], #4 - * @notapi - */ -void usb_lld_start_in(USBDriver *usbp, usbep_t ep) { - - usbp->otg->ie[ep].DIEPCTL |= DIEPCTL_EPENA | DIEPCTL_CNAK; - usbp->otg->DIEPEMPMSK |= DIEPEMPMSK_INEPTXFEM(ep); - 800f87e: 408a lsls r2, r1 - 800f880: 4302 orrs r2, r0 - 800f882: f8c3 2834 str.w r2, [r3, #2100] ; 0x834 -} - 800f886: 4770 bx lr - 800f888: f3af 8000 nop.w - 800f88c: f3af 8000 nop.w - -0800f890 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_stall_out(USBDriver *usbp, usbep_t ep) { - 800f890: 6d03 ldr r3, [r0, #80] ; 0x50 - 800f892: eb03 1141 add.w r1, r3, r1, lsl #5 - - usbp->otg->oe[ep].DOEPCTL |= DOEPCTL_STALL; - 800f896: f8d1 3b00 ldr.w r3, [r1, #2816] ; 0xb00 - 800f89a: f443 1300 orr.w r3, r3, #2097152 ; 0x200000 - 800f89e: f8c1 3b00 str.w r3, [r1, #2816] ; 0xb00 - 800f8a2: 4770 bx lr - 800f8a4: f3af 8000 nop.w - 800f8a8: f3af 8000 nop.w - 800f8ac: f3af 8000 nop.w - -0800f8b0 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_stall_in(USBDriver *usbp, usbep_t ep) { - 800f8b0: 6d03 ldr r3, [r0, #80] ; 0x50 - 800f8b2: eb03 1141 add.w r1, r3, r1, lsl #5 - - usbp->otg->ie[ep].DIEPCTL |= DIEPCTL_STALL; - 800f8b6: f8d1 3900 ldr.w r3, [r1, #2304] ; 0x900 - 800f8ba: f443 1300 orr.w r3, r3, #2097152 ; 0x200000 - 800f8be: f8c1 3900 str.w r3, [r1, #2304] ; 0x900 - 800f8c2: 4770 bx lr - 800f8c4: f3af 8000 nop.w - 800f8c8: f3af 8000 nop.w - 800f8cc: f3af 8000 nop.w - -0800f8d0 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_clear_out(USBDriver *usbp, usbep_t ep) { - 800f8d0: 6d03 ldr r3, [r0, #80] ; 0x50 - 800f8d2: eb03 1141 add.w r1, r3, r1, lsl #5 - - usbp->otg->oe[ep].DOEPCTL &= ~DOEPCTL_STALL; - 800f8d6: f8d1 3b00 ldr.w r3, [r1, #2816] ; 0xb00 - 800f8da: f423 1300 bic.w r3, r3, #2097152 ; 0x200000 - 800f8de: f8c1 3b00 str.w r3, [r1, #2816] ; 0xb00 - 800f8e2: 4770 bx lr - 800f8e4: f3af 8000 nop.w - 800f8e8: f3af 8000 nop.w - 800f8ec: f3af 8000 nop.w - -0800f8f0 : - * @param[in] usbp pointer to the @p USBDriver object - * @param[in] ep endpoint number - * - * @notapi - */ -void usb_lld_clear_in(USBDriver *usbp, usbep_t ep) { - 800f8f0: 6d03 ldr r3, [r0, #80] ; 0x50 - 800f8f2: eb03 1141 add.w r1, r3, r1, lsl #5 - - usbp->otg->ie[ep].DIEPCTL &= ~DIEPCTL_STALL; - 800f8f6: f8d1 3900 ldr.w r3, [r1, #2304] ; 0x900 - 800f8fa: f423 1300 bic.w r3, r3, #2097152 ; 0x200000 - 800f8fe: f8c1 3900 str.w r3, [r1, #2304] ; 0x900 - 800f902: 4770 bx lr - 800f904: f3af 8000 nop.w - 800f908: f3af 8000 nop.w - 800f90c: f3af 8000 nop.w - -0800f910 : - * associated callback pointer is not equal to @p NULL in order to not - * perform an extra check in a potentially critical interrupt handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_TIM3_HANDLER) { - 800f910: b538 push {r3, r4, r5, lr} - * @param[in] icup pointer to the @p ICUDriver object - */ -static void icu_lld_serve_interrupt(ICUDriver *icup) { - uint32_t sr; - - sr = icup->tim->SR; - 800f912: 4d25 ldr r5, [pc, #148] ; (800f9a8 ) - 800f914: 68eb ldr r3, [r5, #12] - sr &= icup->tim->DIER & STM32_TIM_DIER_IRQ_MASK; - icup->tim->SR = ~sr; - if (icup->config->channel == ICU_CHANNEL_1) { - 800f916: 6869 ldr r1, [r5, #4] - * @param[in] icup pointer to the @p ICUDriver object - */ -static void icu_lld_serve_interrupt(ICUDriver *icup) { - uint32_t sr; - - sr = icup->tim->SR; - 800f918: 691a ldr r2, [r3, #16] - sr &= icup->tim->DIER & STM32_TIM_DIER_IRQ_MASK; - 800f91a: 68dc ldr r4, [r3, #12] - icup->tim->SR = ~sr; - if (icup->config->channel == ICU_CHANNEL_1) { - 800f91c: 7d08 ldrb r0, [r1, #20] - 800f91e: 4014 ands r4, r2 - */ -static void icu_lld_serve_interrupt(ICUDriver *icup) { - uint32_t sr; - - sr = icup->tim->SR; - sr &= icup->tim->DIER & STM32_TIM_DIER_IRQ_MASK; - 800f920: b2e2 uxtb r2, r4 - icup->tim->SR = ~sr; - 800f922: 43d2 mvns r2, r2 - 800f924: 611a str r2, [r3, #16] - if (icup->config->channel == ICU_CHANNEL_1) { - 800f926: b9f8 cbnz r0, 800f968 - if ((sr & STM32_TIM_SR_CC2IF) != 0) - 800f928: 0760 lsls r0, r4, #29 - 800f92a: d514 bpl.n 800f956 - _icu_isr_invoke_width_cb(icup); - 800f92c: 782b ldrb r3, [r5, #0] - 800f92e: 2b04 cmp r3, #4 - 800f930: d00d beq.n 800f94e - if ((sr & STM32_TIM_SR_CC1IF) != 0) - 800f932: 07a1 lsls r1, r4, #30 - 800f934: d415 bmi.n 800f962 - if ((sr & STM32_TIM_SR_CC1IF) != 0) - _icu_isr_invoke_width_cb(icup); - if ((sr & STM32_TIM_SR_CC2IF) != 0) - _icu_isr_invoke_period_cb(icup); - } - if ((sr & STM32_TIM_SR_UIF) != 0) - 800f936: 07e4 lsls r4, r4, #31 - 800f938: d505 bpl.n 800f946 - _icu_isr_invoke_overflow_cb(icup); - 800f93a: 686b ldr r3, [r5, #4] - 800f93c: 481a ldr r0, [pc, #104] ; (800f9a8 ) - 800f93e: 691b ldr r3, [r3, #16] - 800f940: 4798 blx r3 - 800f942: 2303 movs r3, #3 - 800f944: 702b strb r3, [r5, #0] - OSAL_IRQ_PROLOGUE(); - - icu_lld_serve_interrupt(&ICUD3); - - OSAL_IRQ_EPILOGUE(); -} - 800f946: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} - - OSAL_IRQ_PROLOGUE(); - - icu_lld_serve_interrupt(&ICUD3); - - OSAL_IRQ_EPILOGUE(); - 800f94a: f7fd be31 b.w 800d5b0 <_port_irq_epilogue> - sr = icup->tim->SR; - sr &= icup->tim->DIER & STM32_TIM_DIER_IRQ_MASK; - icup->tim->SR = ~sr; - if (icup->config->channel == ICU_CHANNEL_1) { - if ((sr & STM32_TIM_SR_CC2IF) != 0) - _icu_isr_invoke_width_cb(icup); - 800f94e: 688b ldr r3, [r1, #8] - 800f950: b31b cbz r3, 800f99a - 800f952: 4628 mov r0, r5 - 800f954: 4798 blx r3 - if ((sr & STM32_TIM_SR_CC1IF) != 0) - 800f956: 07a1 lsls r1, r4, #30 - 800f958: d5ed bpl.n 800f936 - _icu_isr_invoke_period_cb(icup); - 800f95a: 782b ldrb r3, [r5, #0] - 800f95c: 4a12 ldr r2, [pc, #72] ; (800f9a8 ) - 800f95e: 2b04 cmp r3, #4 - 800f960: d014 beq.n 800f98c - 800f962: 2304 movs r3, #4 - 800f964: 702b strb r3, [r5, #0] - 800f966: e7e6 b.n 800f936 - } - else { - if ((sr & STM32_TIM_SR_CC1IF) != 0) - 800f968: 07a2 lsls r2, r4, #30 - 800f96a: d509 bpl.n 800f980 - _icu_isr_invoke_width_cb(icup); - 800f96c: 782b ldrb r3, [r5, #0] - 800f96e: 2b04 cmp r3, #4 - 800f970: d002 beq.n 800f978 - if ((sr & STM32_TIM_SR_CC2IF) != 0) - 800f972: 0763 lsls r3, r4, #29 - 800f974: d4f5 bmi.n 800f962 - 800f976: e7de b.n 800f936 - if ((sr & STM32_TIM_SR_CC1IF) != 0) - _icu_isr_invoke_period_cb(icup); - } - else { - if ((sr & STM32_TIM_SR_CC1IF) != 0) - _icu_isr_invoke_width_cb(icup); - 800f978: 688b ldr r3, [r1, #8] - 800f97a: b18b cbz r3, 800f9a0 - 800f97c: 4628 mov r0, r5 - 800f97e: 4798 blx r3 - if ((sr & STM32_TIM_SR_CC2IF) != 0) - 800f980: 0763 lsls r3, r4, #29 - 800f982: d5d8 bpl.n 800f936 - icup->tim->SR = ~sr; - if (icup->config->channel == ICU_CHANNEL_1) { - if ((sr & STM32_TIM_SR_CC2IF) != 0) - _icu_isr_invoke_width_cb(icup); - if ((sr & STM32_TIM_SR_CC1IF) != 0) - _icu_isr_invoke_period_cb(icup); - 800f984: 782b ldrb r3, [r5, #0] - 800f986: 4a08 ldr r2, [pc, #32] ; (800f9a8 ) - 800f988: 2b04 cmp r3, #4 - 800f98a: d1ea bne.n 800f962 - 800f98c: 6851 ldr r1, [r2, #4] - 800f98e: 68cb ldr r3, [r1, #12] - 800f990: 2b00 cmp r3, #0 - 800f992: d0e6 beq.n 800f962 - 800f994: 4804 ldr r0, [pc, #16] ; (800f9a8 ) - 800f996: 4798 blx r3 - 800f998: e7e3 b.n 800f962 - sr &= icup->tim->DIER & STM32_TIM_DIER_IRQ_MASK; - icup->tim->SR = ~sr; - if (icup->config->channel == ICU_CHANNEL_1) { - if ((sr & STM32_TIM_SR_CC2IF) != 0) - _icu_isr_invoke_width_cb(icup); - if ((sr & STM32_TIM_SR_CC1IF) != 0) - 800f99a: 07a0 lsls r0, r4, #30 - 800f99c: d4f7 bmi.n 800f98e - 800f99e: e7ca b.n 800f936 - _icu_isr_invoke_period_cb(icup); - } - else { - if ((sr & STM32_TIM_SR_CC1IF) != 0) - _icu_isr_invoke_width_cb(icup); - if ((sr & STM32_TIM_SR_CC2IF) != 0) - 800f9a0: 0762 lsls r2, r4, #29 - 800f9a2: d4f4 bmi.n 800f98e - 800f9a4: e7c7 b.n 800f936 - 800f9a6: bf00 nop - 800f9a8: 2000124c .word 0x2000124c - 800f9ac: f3af 8000 nop.w - -0800f9b0 : -/** - * @brief Low level ICU driver initialization. - * - * @notapi - */ -void icu_lld_init(void) { - 800f9b0: b510 push {r4, lr} - ICUD2.tim = STM32_TIM2; -#endif - -#if STM32_ICU_USE_TIM3 - /* Driver initialization.*/ - icuObjectInit(&ICUD3); - 800f9b2: 4c03 ldr r4, [pc, #12] ; (800f9c0 ) - 800f9b4: 4620 mov r0, r4 - 800f9b6: f7fd fe93 bl 800d6e0 - ICUD3.tim = STM32_TIM3; - 800f9ba: 4b02 ldr r3, [pc, #8] ; (800f9c4 ) - 800f9bc: 60e3 str r3, [r4, #12] - 800f9be: bd10 pop {r4, pc} - 800f9c0: 2000124c .word 0x2000124c - 800f9c4: 40000400 .word 0x40000400 - 800f9c8: f3af 8000 nop.w - 800f9cc: f3af 8000 nop.w - -0800f9d0 : - * @brief System Timer vector. - * @details This interrupt is used for system tick in periodic mode. - * - * @isr - */ -OSAL_IRQ_HANDLER(SysTick_Handler) { - 800f9d0: b508 push {r3, lr} - 800f9d2: 2320 movs r3, #32 - 800f9d4: f383 8811 msr BASEPRI, r3 - * service from the HAL. - */ -#if (OSAL_ST_MODE != OSAL_ST_MODE_NONE) || defined(__DOXYGEN__) -static inline void osalOsTimerHandlerI(void) { - - chSysTimerHandlerI(); - 800f9d8: f7fd f8f2 bl 800cbc0 - 800f9dc: 2300 movs r3, #0 - 800f9de: f383 8811 msr BASEPRI, r3 - osalSysLockFromISR(); - osalOsTimerHandlerI(); - osalSysUnlockFromISR(); - - OSAL_IRQ_EPILOGUE(); -} - 800f9e2: e8bd 4008 ldmia.w sp!, {r3, lr} - - osalSysLockFromISR(); - osalOsTimerHandlerI(); - osalSysUnlockFromISR(); - - OSAL_IRQ_EPILOGUE(); - 800f9e6: f7fd bde3 b.w 800d5b0 <_port_irq_epilogue> - 800f9ea: bf00 nop - 800f9ec: f3af 8000 nop.w - -0800f9f0 : -#endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */ - -#if OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC - /* Periodic systick mode, the Cortex-Mx internal systick timer is used - in this mode.*/ - SysTick->LOAD = (STM32_HCLK / OSAL_ST_FREQUENCY) - 1; - 800f9f0: 4b05 ldr r3, [pc, #20] ; (800fa08 ) - 800f9f2: f244 109f movw r0, #16799 ; 0x419f - SysTick->VAL = 0; - 800f9f6: 2100 movs r1, #0 - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - 800f9f8: 2207 movs r2, #7 -#endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */ - -#if OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC - /* Periodic systick mode, the Cortex-Mx internal systick timer is used - in this mode.*/ - SysTick->LOAD = (STM32_HCLK / OSAL_ST_FREQUENCY) - 1; - 800f9fa: 6058 str r0, [r3, #4] - SysTick->VAL = 0; - 800f9fc: 6099 str r1, [r3, #8] - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_ENABLE_Msk | - SysTick_CTRL_TICKINT_Msk; - - /* IRQ enabled.*/ - nvicSetSystemHandlerPriority(HANDLER_SYSTICK, STM32_ST_IRQ_PRIORITY); - 800f9fe: 200b movs r0, #11 - 800fa00: 2108 movs r1, #8 -#if OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC - /* Periodic systick mode, the Cortex-Mx internal systick timer is used - in this mode.*/ - SysTick->LOAD = (STM32_HCLK / OSAL_ST_FREQUENCY) - 1; - SysTick->VAL = 0; - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - 800fa02: 601a str r2, [r3, #0] - SysTick_CTRL_ENABLE_Msk | - SysTick_CTRL_TICKINT_Msk; - - /* IRQ enabled.*/ - nvicSetSystemHandlerPriority(HANDLER_SYSTICK, STM32_ST_IRQ_PRIORITY); - 800fa04: f7fe bb74 b.w 800e0f0 - 800fa08: e000e010 .word 0xe000e010 - 800fa0c: f3af 8000 nop.w - -0800fa10 : -/** - * @brief USART common service routine. - * - * @param[in] uartp pointer to the @p UARTDriver object - */ -static void serve_usart_irq(UARTDriver *uartp) { - 800fa10: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - uint16_t sr; - USART_TypeDef *u = uartp->usart; - 800fa14: 6884 ldr r4, [r0, #8] - uint32_t cr1 = u->CR1; - 800fa16: 68e7 ldr r7, [r4, #12] - - sr = u->SR; /* SR reset step 1.*/ - 800fa18: 6826 ldr r6, [r4, #0] - (void)u->DR; /* SR reset step 2.*/ - 800fa1a: 6862 ldr r2, [r4, #4] - - if (sr & (USART_SR_LBD | USART_SR_ORE | USART_SR_NE | - 800fa1c: f240 130f movw r3, #271 ; 0x10f - 800fa20: 4033 ands r3, r6 -/** - * @brief USART common service routine. - * - * @param[in] uartp pointer to the @p UARTDriver object - */ -static void serve_usart_irq(UARTDriver *uartp) { - 800fa22: 4605 mov r5, r0 - uint32_t cr1 = u->CR1; - - sr = u->SR; /* SR reset step 1.*/ - (void)u->DR; /* SR reset step 2.*/ - - if (sr & (USART_SR_LBD | USART_SR_ORE | USART_SR_NE | - 800fa24: b1eb cbz r3, 800fa62 - USART_SR_FE | USART_SR_PE)) { - u->SR = ~USART_SR_LBD; - if (uartp->config->rxerr_cb != NULL) - 800fa26: 6843 ldr r3, [r0, #4] - 800fa28: 691a ldr r2, [r3, #16] - sr = u->SR; /* SR reset step 1.*/ - (void)u->DR; /* SR reset step 2.*/ - - if (sr & (USART_SR_LBD | USART_SR_ORE | USART_SR_NE | - USART_SR_FE | USART_SR_PE)) { - u->SR = ~USART_SR_LBD; - 800fa2a: f46f 7380 mvn.w r3, #256 ; 0x100 - 800fa2e: 6023 str r3, [r4, #0] - if (uartp->config->rxerr_cb != NULL) - 800fa30: b1ba cbz r2, 800fa62 -static void serve_usart_irq(UARTDriver *uartp) { - uint16_t sr; - USART_TypeDef *u = uartp->usart; - uint32_t cr1 = u->CR1; - - sr = u->SR; /* SR reset step 1.*/ - 800fa32: b2b3 uxth r3, r6 - */ -static uartflags_t translate_errors(uint16_t sr) { - uartflags_t sts = 0; - - if (sr & USART_SR_ORE) - sts |= UART_OVERRUN_ERROR; - 800fa34: f013 0f08 tst.w r3, #8 - 800fa38: bf0c ite eq - 800fa3a: 2100 moveq r1, #0 - 800fa3c: 2110 movne r1, #16 - if (sr & USART_SR_PE) - 800fa3e: 07d8 lsls r0, r3, #31 - sts |= UART_PARITY_ERROR; - 800fa40: bf48 it mi - 800fa42: f041 0104 orrmi.w r1, r1, #4 - if (sr & USART_SR_FE) - 800fa46: 0798 lsls r0, r3, #30 - sts |= UART_FRAMING_ERROR; - 800fa48: bf48 it mi - 800fa4a: f041 0108 orrmi.w r1, r1, #8 - if (sr & USART_SR_NE) - 800fa4e: 0758 lsls r0, r3, #29 - sts |= UART_NOISE_ERROR; - 800fa50: bf48 it mi - 800fa52: f041 0120 orrmi.w r1, r1, #32 - if (sr & USART_SR_LBD) - 800fa56: 05d8 lsls r0, r3, #23 - sts |= UART_BREAK_DETECTED; - 800fa58: bf48 it mi - 800fa5a: f041 0140 orrmi.w r1, r1, #64 ; 0x40 - - if (sr & (USART_SR_LBD | USART_SR_ORE | USART_SR_NE | - USART_SR_FE | USART_SR_PE)) { - u->SR = ~USART_SR_LBD; - if (uartp->config->rxerr_cb != NULL) - uartp->config->rxerr_cb(uartp, translate_errors(sr)); - 800fa5e: 4628 mov r0, r5 - 800fa60: 4790 blx r2 - } - - if ((sr & USART_SR_TC) && (cr1 & USART_CR1_TCIE)) { - 800fa62: 0672 lsls r2, r6, #25 - 800fa64: d50e bpl.n 800fa84 - 800fa66: 067b lsls r3, r7, #25 - 800fa68: d50c bpl.n 800fa84 - /* TC interrupt cleared and disabled.*/ - u->SR = ~USART_SR_TC; - u->CR1 = cr1 & ~USART_CR1_TCIE; - - /* End of transmission, a callback is generated.*/ - if (uartp->config->txend2_cb != NULL) - 800fa6a: 686b ldr r3, [r5, #4] - 800fa6c: 685b ldr r3, [r3, #4] - } - - if ((sr & USART_SR_TC) && (cr1 & USART_CR1_TCIE)) { - /* TC interrupt cleared and disabled.*/ - u->SR = ~USART_SR_TC; - u->CR1 = cr1 & ~USART_CR1_TCIE; - 800fa6e: f027 0740 bic.w r7, r7, #64 ; 0x40 - uartp->config->rxerr_cb(uartp, translate_errors(sr)); - } - - if ((sr & USART_SR_TC) && (cr1 & USART_CR1_TCIE)) { - /* TC interrupt cleared and disabled.*/ - u->SR = ~USART_SR_TC; - 800fa72: f06f 0240 mvn.w r2, #64 ; 0x40 - 800fa76: 6022 str r2, [r4, #0] - u->CR1 = cr1 & ~USART_CR1_TCIE; - 800fa78: 60e7 str r7, [r4, #12] - - /* End of transmission, a callback is generated.*/ - if (uartp->config->txend2_cb != NULL) - 800fa7a: b11b cbz r3, 800fa84 - uartp->config->txend2_cb(uartp); - 800fa7c: 4628 mov r0, r5 - } -} - 800fa7e: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr} - u->SR = ~USART_SR_TC; - u->CR1 = cr1 & ~USART_CR1_TCIE; - - /* End of transmission, a callback is generated.*/ - if (uartp->config->txend2_cb != NULL) - uartp->config->txend2_cb(uartp); - 800fa82: 4718 bx r3 - 800fa84: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - 800fa88: f3af 8000 nop.w - 800fa8c: f3af 8000 nop.w - -0800fa90 : -/** - * @brief USART3 IRQ handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_USART3_HANDLER) { - 800fa90: b508 push {r3, lr} - - OSAL_IRQ_PROLOGUE(); - - serve_usart_irq(&UARTD3); - 800fa92: 4803 ldr r0, [pc, #12] ; (800faa0 ) - 800fa94: f7ff ffbc bl 800fa10 - - OSAL_IRQ_EPILOGUE(); -} - 800fa98: e8bd 4008 ldmia.w sp!, {r3, lr} - - OSAL_IRQ_PROLOGUE(); - - serve_usart_irq(&UARTD3); - - OSAL_IRQ_EPILOGUE(); - 800fa9c: f7fd bd88 b.w 800d5b0 <_port_irq_epilogue> - 800faa0: 20001264 .word 0x20001264 - 800faa4: f3af 8000 nop.w - 800faa8: f3af 8000 nop.w - 800faac: f3af 8000 nop.w - -0800fab0 : -/** - * @brief USART6 IRQ handler. - * - * @isr - */ -OSAL_IRQ_HANDLER(STM32_USART6_HANDLER) { - 800fab0: b508 push {r3, lr} - - OSAL_IRQ_PROLOGUE(); - - serve_usart_irq(&UARTD6); - 800fab2: 4803 ldr r0, [pc, #12] ; (800fac0 ) - 800fab4: f7ff ffac bl 800fa10 - - OSAL_IRQ_EPILOGUE(); -} - 800fab8: e8bd 4008 ldmia.w sp!, {r3, lr} - - OSAL_IRQ_PROLOGUE(); - - serve_usart_irq(&UARTD6); - - OSAL_IRQ_EPILOGUE(); - 800fabc: f7fd bd78 b.w 800d5b0 <_port_irq_epilogue> - 800fac0: 20001280 .word 0x20001280 - 800fac4: f3af 8000 nop.w - 800fac8: f3af 8000 nop.w - 800facc: f3af 8000 nop.w - -0800fad0 : -/** - * @brief Low level UART driver initialization. - * - * @notapi - */ -void uart_lld_init(void) { - 800fad0: b570 push {r4, r5, r6, lr} - UARTD2.dmarx = STM32_DMA_STREAM(STM32_UART_USART2_RX_DMA_STREAM); - UARTD2.dmatx = STM32_DMA_STREAM(STM32_UART_USART2_TX_DMA_STREAM); -#endif - -#if STM32_UART_USE_USART3 - uartObjectInit(&UARTD3); - 800fad2: 4d0c ldr r5, [pc, #48] ; (800fb04 ) - UARTD3.usart = USART3; - UARTD3.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE; - UARTD3.dmarx = STM32_DMA_STREAM(STM32_UART_USART3_RX_DMA_STREAM); - 800fad4: 4c0c ldr r4, [pc, #48] ; (800fb08 ) - UARTD5.dmarx = STM32_DMA_STREAM(STM32_UART_UART5_RX_DMA_STREAM); - UARTD5.dmatx = STM32_DMA_STREAM(STM32_UART_UART5_TX_DMA_STREAM); -#endif - -#if STM32_UART_USE_USART6 - uartObjectInit(&UARTD6); - 800fad6: 4e0d ldr r6, [pc, #52] ; (800fb0c ) - UARTD2.dmarx = STM32_DMA_STREAM(STM32_UART_USART2_RX_DMA_STREAM); - UARTD2.dmatx = STM32_DMA_STREAM(STM32_UART_USART2_TX_DMA_STREAM); -#endif - -#if STM32_UART_USE_USART3 - uartObjectInit(&UARTD3); - 800fad8: 4628 mov r0, r5 - 800fada: f7fd ffd1 bl 800da80 - UARTD3.usart = USART3; - 800fade: 4b0c ldr r3, [pc, #48] ; (800fb10 ) - 800fae0: 60ab str r3, [r5, #8] - UARTD3.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE; - 800fae2: 2206 movs r2, #6 - UARTD3.dmarx = STM32_DMA_STREAM(STM32_UART_USART3_RX_DMA_STREAM); - UARTD3.dmatx = STM32_DMA_STREAM(STM32_UART_USART3_TX_DMA_STREAM); - 800fae4: f104 0318 add.w r3, r4, #24 - UARTD5.dmarx = STM32_DMA_STREAM(STM32_UART_UART5_RX_DMA_STREAM); - UARTD5.dmatx = STM32_DMA_STREAM(STM32_UART_UART5_TX_DMA_STREAM); -#endif - -#if STM32_UART_USE_USART6 - uartObjectInit(&UARTD6); - 800fae8: 4630 mov r0, r6 - -#if STM32_UART_USE_USART3 - uartObjectInit(&UARTD3); - UARTD3.usart = USART3; - UARTD3.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE; - UARTD3.dmarx = STM32_DMA_STREAM(STM32_UART_USART3_RX_DMA_STREAM); - 800faea: 612c str r4, [r5, #16] - UARTD3.dmatx = STM32_DMA_STREAM(STM32_UART_USART3_TX_DMA_STREAM); - 800faec: 616b str r3, [r5, #20] -#endif - -#if STM32_UART_USE_USART3 - uartObjectInit(&UARTD3); - UARTD3.usart = USART3; - UARTD3.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE; - 800faee: 60ea str r2, [r5, #12] - UARTD5.dmarx = STM32_DMA_STREAM(STM32_UART_UART5_RX_DMA_STREAM); - UARTD5.dmatx = STM32_DMA_STREAM(STM32_UART_UART5_TX_DMA_STREAM); -#endif - -#if STM32_UART_USE_USART6 - uartObjectInit(&UARTD6); - 800faf0: f7fd ffc6 bl 800da80 - UARTD6.usart = USART6; - 800faf4: 4b07 ldr r3, [pc, #28] ; (800fb14 ) - 800faf6: 60b3 str r3, [r6, #8] - UARTD6.dmarx = STM32_DMA_STREAM(STM32_UART_USART6_RX_DMA_STREAM); - 800faf8: f104 036c add.w r3, r4, #108 ; 0x6c - UARTD6.dmatx = STM32_DMA_STREAM(STM32_UART_USART6_TX_DMA_STREAM); - 800fafc: 34a8 adds r4, #168 ; 0xa8 -#endif - -#if STM32_UART_USE_USART6 - uartObjectInit(&UARTD6); - UARTD6.usart = USART6; - UARTD6.dmarx = STM32_DMA_STREAM(STM32_UART_USART6_RX_DMA_STREAM); - 800fafe: 6133 str r3, [r6, #16] - UARTD6.dmatx = STM32_DMA_STREAM(STM32_UART_USART6_TX_DMA_STREAM); - 800fb00: 6174 str r4, [r6, #20] - 800fb02: bd70 pop {r4, r5, r6, pc} - 800fb04: 20001264 .word 0x20001264 - 800fb08: 0801320c .word 0x0801320c - 800fb0c: 20001280 .word 0x20001280 - 800fb10: 40004800 .word 0x40004800 - 800fb14: 40011400 .word 0x40011400 - 800fb18: f3af 8000 nop.w - 800fb1c: f3af 8000 nop.w - -0800fb20 <__early_init>: - * @details This initialization must be performed just after stack setup - * and before any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); - 800fb20: f7fe bd16 b.w 800e550 - 800fb24: f3af 8000 nop.w - 800fb28: f3af 8000 nop.w - 800fb2c: f3af 8000 nop.w - -0800fb30 : - -/** - * @brief Board-specific initialization code. - * @todo Add your board-specific code, if any. - */ -void boardInit(void) { - 800fb30: 4770 bx lr - 800fb32: bf00 nop - 800fb34: f3af 8000 nop.w - 800fb38: f3af 8000 nop.w - 800fb3c: f3af 8000 nop.w - -0800fb40 : -static THD_WORKING_AREA(periodic_thread_wa, 1024); -static THD_WORKING_AREA(uart_thread_wa, 128); - - - -static msg_t periodic_thread(void *arg) { - 800fb40: b508 push {r3, lr} - 800fb42: 4b04 ldr r3, [pc, #16] ; (800fb54 ) - 800fb44: 4a04 ldr r2, [pc, #16] ; (800fb58 ) - 800fb46: 699b ldr r3, [r3, #24] - 800fb48: 619a str r2, [r3, #24] - int fault_print = 0; - - for(;;) - { - - chThdSleepMilliseconds(10); - 800fb4a: 2064 movs r0, #100 ; 0x64 - 800fb4c: f7fd faa8 bl 800d0a0 - } - 800fb50: e7fb b.n 800fb4a - 800fb52: bf00 nop - 800fb54: 20000c40 .word 0x20000c40 - 800fb58: 08013410 .word 0x08013410 - 800fb5c: f3af 8000 nop.w - -0800fb60 : - - - - -int bldc_init(void) -{ - 800fb60: b500 push {lr} - 800fb62: b0d1 sub sp, #324 ; 0x144 - halInit(); - 800fb64: f7fd fd54 bl 800d610 - chSysInit(); - 800fb68: f7fc ffd2 bl 800cb10 - - chThdSleepMilliseconds(1000); - 800fb6c: f242 7010 movw r0, #10000 ; 0x2710 - 800fb70: f7fd fa96 bl 800d0a0 - - conf_general_init(); - 800fb74: f001 f934 bl 8010de0 - hw_init_gpio(); - 800fb78: f001 fc2a bl 80113d0 - - - mc_configuration mcconf; - conf_general_read_mc_configuration(&mcconf); - 800fb7c: a824 add r0, sp, #144 ; 0x90 - 800fb7e: f001 f9f7 bl 8010f70 - mcpwm_init(&mcconf); - 800fb82: a824 add r0, sp, #144 ; 0x90 - 800fb84: f000 fa9c bl 80100c0 - - comm_usb_init(); - 800fb88: f001 f8fa bl 8010d80 - - app_configuration appconf; - conf_general_read_app_configuration(&appconf); - 800fb8c: a801 add r0, sp, #4 - 800fb8e: f001 f957 bl 8010e40 - - - - return 0; -} - 800fb92: 2000 movs r0, #0 - 800fb94: b051 add sp, #324 ; 0x144 - 800fb96: f85d fb04 ldr.w pc, [sp], #4 - 800fb9a: bf00 nop - 800fb9c: f3af 8000 nop.w - -0800fba0 : -float dbg_fTheta; -float dbg_fMea; -uint16_t dbg_AccumTheta; - -int bldc_start(void) -{ - 800fba0: b500 push {lr} - 800fba2: b083 sub sp, #12 - - - - //-- 스레드 ìƒì„± - // - chThdCreateStatic(periodic_thread_wa, sizeof(periodic_thread_wa), NORMALPRIO, periodic_thread, NULL); - 800fba4: 2400 movs r4, #0 - 800fba6: 4b0a ldr r3, [pc, #40] ; (800fbd0 ) - 800fba8: 9400 str r4, [sp, #0] - 800fbaa: f44f 61b3 mov.w r1, #1432 ; 0x598 - 800fbae: 2240 movs r2, #64 ; 0x40 - 800fbb0: 4808 ldr r0, [pc, #32] ; (800fbd4 ) - 800fbb2: f7fd fa35 bl 800d020 - chThdCreateStatic(uart_thread_wa, sizeof(uart_thread_wa), NORMALPRIO, uart_process_thread, NULL); - 800fbb6: 9400 str r4, [sp, #0] - 800fbb8: 4807 ldr r0, [pc, #28] ; (800fbd8 ) - 800fbba: 4b08 ldr r3, [pc, #32] ; (800fbdc ) - 800fbbc: f44f 7106 mov.w r1, #536 ; 0x218 - 800fbc0: 2240 movs r2, #64 ; 0x40 - 800fbc2: f7fd fa2d bl 800d020 - //-- IDLE - // - for(;;) - { - //palSetPad(GPIOA, 7); - chThdSleepMilliseconds(1); - 800fbc6: 200a movs r0, #10 - 800fbc8: f7fd fa6a bl 800d0a0 - - //debug_print_usb("8 %f 0\r\n", dbg_fTheta ); - //debug_print_usb("%d\r\n", dbg_AccumTheta ); - usb_uart_printf("500 %f %f 0\r\n", qVelRef*10000, dbg_fMea*10000 ); - */ - } - 800fbcc: e7fb b.n 800fbc6 - 800fbce: bf00 nop - 800fbd0: 0800fb41 .word 0x0800fb41 - 800fbd4: 20001928 .word 0x20001928 - 800fbd8: 200016e0 .word 0x200016e0 - 800fbdc: 0800fee1 .word 0x0800fee1 - -0800fbe0 : -} - - -int send( uint8_t data ) -{ - 800fbe0: b5f0 push {r4, r5, r6, r7, lr} - msg->magic = MAVLINK_STX; - msg->len = length; - msg->sysid = system_id; - msg->compid = component_id; - // One sequence number per channel - msg->seq = mavlink_get_channel_status(chan)->current_tx_seq; - 800fbe2: 4a37 ldr r2, [pc, #220] ; (800fcc0 ) - 800fbe4: f2ad 5d14 subw sp, sp, #1300 ; 0x514 - 800fbe8: 7993 ldrb r3, [r2, #6] - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TEST_CMD_LEN); -#else - mavlink_test_cmd_t packet; - packet.arg2 = arg2; - packet.cmd_1 = cmd_1; - 800fbea: f88d 0112 strb.w r0, [sp, #274] ; 0x112 - packet.arg1 = arg1; - 800fbee: 215c movs r1, #92 ; 0x5c - _mav_put_uint8_t(buf, 3, arg1); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TEST_CMD_LEN); -#else - mavlink_test_cmd_t packet; - packet.arg2 = arg2; - 800fbf0: 205d movs r0, #93 ; 0x5d - 800fbf2: f8ad 0110 strh.w r0, [sp, #272] ; 0x110 - mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1; - 800fbf6: 1c5f adds r7, r3, #1 - packet.cmd_1 = cmd_1; - packet.arg1 = arg1; - 800fbf8: f88d 1113 strb.w r1, [sp, #275] ; 0x113 -{ - // This code part is the same for all messages; - msg->magic = MAVLINK_STX; - msg->len = length; - msg->sysid = system_id; - msg->compid = component_id; - 800fbfc: 2079 movs r0, #121 ; 0x79 - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TEST_CMD_LEN); - 800fbfe: 9944 ldr r1, [sp, #272] ; 0x110 - // One sequence number per channel - msg->seq = mavlink_get_channel_status(chan)->current_tx_seq; - mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1; - 800fc00: 7197 strb r7, [r2, #6] -#endif - - msg->msgid = MAVLINK_MSG_ID_TEST_CMD; - 800fc02: 26dc movs r6, #220 ; 0xdc -MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t chan, uint8_t length) -#endif -{ - // This code part is the same for all messages; - msg->magic = MAVLINK_STX; - 800fc04: 25fe movs r5, #254 ; 0xfe - msg->len = length; - msg->sysid = system_id; - 800fc06: 2409 movs r4, #9 - uint8_t chan, uint8_t length) -#endif -{ - // This code part is the same for all messages; - msg->magic = MAVLINK_STX; - msg->len = length; - 800fc08: 2204 movs r2, #4 - msg->sysid = system_id; - msg->compid = component_id; - // One sequence number per channel - msg->seq = mavlink_get_channel_status(chan)->current_tx_seq; - 800fc0a: f88d 3004 strb.w r3, [sp, #4] -{ - // This code part is the same for all messages; - msg->magic = MAVLINK_STX; - msg->len = length; - msg->sysid = system_id; - msg->compid = component_id; - 800fc0e: f88d 0006 strb.w r0, [sp, #6] - mavlink_test_cmd_t packet; - packet.arg2 = arg2; - packet.cmd_1 = cmd_1; - packet.arg1 = arg1; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TEST_CMD_LEN); - 800fc12: 9102 str r1, [sp, #8] -#endif - - msg->msgid = MAVLINK_MSG_ID_TEST_CMD; - 800fc14: f88d 6007 strb.w r6, [sp, #7] -MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t chan, uint8_t length) -#endif -{ - // This code part is the same for all messages; - msg->magic = MAVLINK_STX; - 800fc18: f88d 5002 strb.w r5, [sp, #2] - msg->len = length; - msg->sysid = system_id; - 800fc1c: f88d 4005 strb.w r4, [sp, #5] - uint8_t chan, uint8_t length) -#endif -{ - // This code part is the same for all messages; - msg->magic = MAVLINK_STX; - msg->len = length; - 800fc20: f88d 2003 strb.w r2, [sp, #3] - 800fc24: f10d 0103 add.w r1, sp, #3 - 800fc28: f10d 0007 add.w r0, sp, #7 - * - * @param crcAccum the 16 bit X.25 CRC - */ -static inline void crc_init(uint16_t* crcAccum) -{ - *crcAccum = X25_INIT_CRC; - 800fc2c: f64f 73ff movw r3, #65535 ; 0xffff - 800fc30: e001 b.n 800fc36 - 800fc32: f811 2f01 ldrb.w r2, [r1, #1]! -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fc36: 405a eors r2, r3 - tmp ^= (tmp<<4); - 800fc38: ea82 1202 eor.w r2, r2, r2, lsl #4 - 800fc3c: b2d2 uxtb r2, r2 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fc3e: 0a1b lsrs r3, r3, #8 - 800fc40: ea83 1312 eor.w r3, r3, r2, lsr #4 - 800fc44: ea43 2302 orr.w r3, r3, r2, lsl #8 - **/ -static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length) -{ - uint16_t crcTmp; - crc_init(&crcTmp); - while (length--) { - 800fc48: 4281 cmp r1, r0 - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - tmp ^= (tmp<<4); - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fc4a: ea83 03c2 eor.w r3, r3, r2, lsl #3 - **/ -static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length) -{ - uint16_t crcTmp; - crc_init(&crcTmp); - while (length--) { - 800fc4e: d1f0 bne.n 800fc32 - msg->sysid = system_id; - msg->compid = component_id; - // One sequence number per channel - msg->seq = mavlink_get_channel_status(chan)->current_tx_seq; - mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1; - msg->checksum = crc_calculate(((const uint8_t*)(msg)) + 3, MAVLINK_CORE_HEADER_LEN); - 800fc50: f8ad 3000 strh.w r3, [sp] - * @param data new bytes to hash - * @param crcAccum the already accumulated checksum - **/ -static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length) -{ - const uint8_t *p = (const uint8_t *)pBuffer; - 800fc54: a902 add r1, sp, #8 - 800fc56: a803 add r0, sp, #12 -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fc58: f811 2b01 ldrb.w r2, [r1], #1 - 800fc5c: 405a eors r2, r3 - tmp ^= (tmp<<4); - 800fc5e: ea82 1202 eor.w r2, r2, r2, lsl #4 - 800fc62: b2d2 uxtb r2, r2 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fc64: 0a1b lsrs r3, r3, #8 - 800fc66: ea83 1312 eor.w r3, r3, r2, lsr #4 - 800fc6a: ea83 2302 eor.w r3, r3, r2, lsl #8 - 800fc6e: ea83 03c2 eor.w r3, r3, r2, lsl #3 - 800fc72: b29b uxth r3, r3 - * @param crcAccum the already accumulated checksum - **/ -static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length) -{ - const uint8_t *p = (const uint8_t *)pBuffer; - while (length--) { - 800fc74: 4281 cmp r1, r0 - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - tmp ^= (tmp<<4); - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fc76: f8ad 3000 strh.w r3, [sp] - * @param crcAccum the already accumulated checksum - **/ -static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length) -{ - const uint8_t *p = (const uint8_t *)pBuffer; - while (length--) { - 800fc7a: d1ed bne.n 800fc58 -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fc7c: f083 0225 eor.w r2, r3, #37 ; 0x25 - tmp ^= (tmp<<4); - 800fc80: ea82 1202 eor.w r2, r2, r2, lsl #4 - 800fc84: b2d2 uxtb r2, r2 -/** - * @brief Pack a message to send it over a serial byte stream - */ -MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg) -{ - memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len); - 800fc86: f8dd 0002 ldr.w r0, [sp, #2] - 800fc8a: f8dd 1006 ldr.w r1, [sp, #6] - 800fc8e: f8bd 500a ldrh.w r5, [sp, #10] - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fc92: 0a1b lsrs r3, r3, #8 - 800fc94: ea83 1312 eor.w r3, r3, r2, lsr #4 - 800fc98: ac44 add r4, sp, #272 ; 0x110 - 800fc9a: c403 stmia r4!, {r0, r1} - 800fc9c: ea83 2302 eor.w r3, r3, r2, lsl #8 - 800fca0: ea83 03c2 eor.w r3, r3, r2, lsl #3 - 800fca4: b29b uxth r3, r3 - 800fca6: 8025 strh r5, [r4, #0] - crc_accumulate_buffer(&msg->checksum, _MAV_PAYLOAD(msg), msg->len); -#if MAVLINK_CRC_EXTRA - crc_accumulate(crc_extra, &msg->checksum); -#endif - mavlink_ck_a(msg) = (uint8_t)(msg->checksum & 0xFF); - mavlink_ck_b(msg) = (uint8_t)(msg->checksum >> 8); - 800fca8: 0a1a lsrs r2, r3, #8 - // ë‹¤ìŒ í•¨ìˆ˜ë‚´ë¶€ì—서 전송할 í”„ë ˆìž„ì„ ì™„ì„±í•¨, CRC ìƒì„±ë“± - int len = mavlink_msg_to_send_buffer(buf, &msg); - - // 시리얼 í¬íŠ¸ë¡œ ë²„í¼ í¬ì¸í„°ëŠ” buf, 길ì´ëŠ” len ë‚´ìš©ì„ ì „ë‹¬ 하면 ì™„ì„±ë¨ - - usb_uart_write(buf, len); - 800fcaa: a844 add r0, sp, #272 ; 0x110 - 800fcac: 210c movs r1, #12 - 800fcae: f88d 211b strb.w r2, [sp, #283] ; 0x11b - msg->checksum = crc_calculate(((const uint8_t*)(msg)) + 3, MAVLINK_CORE_HEADER_LEN); - crc_accumulate_buffer(&msg->checksum, _MAV_PAYLOAD(msg), msg->len); -#if MAVLINK_CRC_EXTRA - crc_accumulate(crc_extra, &msg->checksum); -#endif - mavlink_ck_a(msg) = (uint8_t)(msg->checksum & 0xFF); - 800fcb2: f88d 311a strb.w r3, [sp, #282] ; 0x11a - 800fcb6: f001 f80b bl 8010cd0 -} - 800fcba: f20d 5d14 addw sp, sp, #1300 ; 0x514 - 800fcbe: bdf0 pop {r4, r5, r6, r7, pc} - 800fcc0: 200018f8 .word 0x200018f8 - 800fcc4: f3af 8000 nop.w - 800fcc8: f3af 8000 nop.w - 800fccc: f3af 8000 nop.w - -0800fcd0 : - - -bool recv( uint8_t ch ) -{ - 800fcd0: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} -#endif -#endif - - int bufferIndex = 0; - - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - 800fcd4: 4d7e ldr r5, [pc, #504] ; (800fed0 ) - - switch (status->parse_state) - 800fcd6: 78eb ldrb r3, [r5, #3] -#endif -#endif - - int bufferIndex = 0; - - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - 800fcd8: 2200 movs r2, #0 - 800fcda: b0c6 sub sp, #280 ; 0x118 - 800fcdc: 4604 mov r4, r0 - 800fcde: 702a strb r2, [r5, #0] - - switch (status->parse_state) - 800fce0: 2b0a cmp r3, #10 - 800fce2: f200 80d1 bhi.w 800fe88 - 800fce6: e8df f003 tbb [pc, r3] - 800fcea: 3636 .short 0x3636 - 800fcec: 3ca997bb .word 0x3ca997bb - 800fcf0: 067c624e .word 0x067c624e - 800fcf4: 06 .byte 0x06 - 800fcf5: 00 .byte 0x00 - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx] = (char)c; - break; - - case MAVLINK_PARSE_STATE_GOT_CRC1: - case MAVLINK_PARSE_STATE_GOT_BAD_CRC1: - if (status->parse_state == MAVLINK_PARSE_STATE_GOT_BAD_CRC1 || c != (rxmsg->checksum >> 8)) { - 800fcf6: 2b0a cmp r3, #10 - 800fcf8: 4976 ldr r1, [pc, #472] ; (800fed4 ) - 800fcfa: d004 beq.n 800fd06 - 800fcfc: 880b ldrh r3, [r1, #0] - 800fcfe: ebb0 2f13 cmp.w r0, r3, lsr #8 - 800fd02: f000 80e2 beq.w 800feca - // got a bad CRC message - status->msg_received = MAVLINK_FRAMING_BAD_CRC; - 800fd06: 2702 movs r7, #2 - 800fd08: 702f strb r7, [r5, #0] - } else { - // Successfully got message - status->msg_received = MAVLINK_FRAMING_OK; - } - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx+1] = (char)c; - 800fd0a: 792b ldrb r3, [r5, #4] - 800fd0c: f8df 81c4 ldr.w r8, [pc, #452] ; 800fed4 - status->msg_received = MAVLINK_FRAMING_BAD_CRC; - } else { - // Successfully got message - status->msg_received = MAVLINK_FRAMING_OK; - } - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - 800fd10: 4e6f ldr r6, [pc, #444] ; (800fed0 ) - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx+1] = (char)c; - 800fd12: 440b add r3, r1 - status->msg_received = MAVLINK_FRAMING_BAD_CRC; - } else { - // Successfully got message - status->msg_received = MAVLINK_FRAMING_OK; - } - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - 800fd14: f04f 0e01 mov.w lr, #1 - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx+1] = (char)c; - memcpy(r_message, rxmsg, sizeof(mavlink_message_t)); - 800fd18: 4641 mov r1, r8 - 800fd1a: a802 add r0, sp, #8 - 800fd1c: f44f 7288 mov.w r2, #272 ; 0x110 - } else { - // Successfully got message - status->msg_received = MAVLINK_FRAMING_OK; - } - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx+1] = (char)c; - 800fd20: 725c strb r4, [r3, #9] - status->msg_received = MAVLINK_FRAMING_BAD_CRC; - } else { - // Successfully got message - status->msg_received = MAVLINK_FRAMING_OK; - } - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - 800fd22: f885 e003 strb.w lr, [r5, #3] - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx+1] = (char)c; - memcpy(r_message, rxmsg, sizeof(mavlink_message_t)); - 800fd26: f7fc fe2b bl 800c980 - break; - } - - bufferIndex++; - // If a message has been sucessfully decoded, check index - if (status->msg_received == MAVLINK_FRAMING_OK) - 800fd2a: 2f01 cmp r7, #1 - 800fd2c: f040 80ad bne.w 800fe8a - // status->packet_rx_drop_count++; - // status->current_seq++; - //} - status->current_rx_seq = rxmsg->seq; - // Initial condition: If no packet has been received so far, drop count is undefined - if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0; - 800fd30: 8933 ldrh r3, [r6, #8] - //while(status->current_seq != rxmsg->seq) - //{ - // status->packet_rx_drop_count++; - // status->current_seq++; - //} - status->current_rx_seq = rxmsg->seq; - 800fd32: f898 2004 ldrb.w r2, [r8, #4] - 800fd36: 7172 strb r2, [r6, #5] - // Initial condition: If no packet has been received so far, drop count is undefined - if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0; - 800fd38: b903 cbnz r3, 800fd3c - 800fd3a: 8173 strh r3, [r6, #10] - mavlink_message_t msg; // 로컬변수로 ì„ ì–¸í•´ë„ ìž˜ 수행 ë˜ëŠ”ë° ì•„ë§ˆë„ ì‹¤ì œ ìžë£Œêµ¬ì¡°ëŠ” static 으로 구현 ë˜ëŠ”ê±° 같아요. - mavlink_status_t status; // 현재 ìˆ˜ì‹ ëœ ë°ì´í„° 파싱한 ìƒíƒœ 리턴값. - - if (mavlink_parse_char(MAVLINK_COMM_0, ch, &msg, &status) == MAVLINK_FRAMING_OK) - { - if( MAVLINK_MSG_ID_TEST_CMD == msg.msgid ) // 메세지 ID ê°€ TEST_CMD ë¼ë©´ í•´ì„ - 800fd3c: f89d 200f ldrb.w r2, [sp, #15] - // Count this packet as received - status->packet_rx_success_count++; - 800fd40: 3301 adds r3, #1 - r_mavlink_status->parse_state = status->parse_state; - r_mavlink_status->packet_idx = status->packet_idx; - r_mavlink_status->current_rx_seq = status->current_rx_seq+1; - r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count; - r_mavlink_status->packet_rx_drop_count = status->parse_error; - status->parse_error = 0; - 800fd42: 2100 movs r1, #0 - 800fd44: 2adc cmp r2, #220 ; 0xdc - //} - status->current_rx_seq = rxmsg->seq; - // Initial condition: If no packet has been received so far, drop count is undefined - if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0; - // Count this packet as received - status->packet_rx_success_count++; - 800fd46: 812b strh r3, [r5, #8] - r_mavlink_status->parse_state = status->parse_state; - r_mavlink_status->packet_idx = status->packet_idx; - r_mavlink_status->current_rx_seq = status->current_rx_seq+1; - r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count; - r_mavlink_status->packet_rx_drop_count = status->parse_error; - status->parse_error = 0; - 800fd48: 70a9 strb r1, [r5, #2] - 800fd4a: f000 80b2 beq.w 800feb2 -} - - -bool recv( uint8_t ch ) -{ - bool ret = false; - 800fd4e: 2000 movs r0, #0 - ret = true; - } - } - - return ret; -} - 800fd50: b046 add sp, #280 ; 0x118 - 800fd52: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - - switch (status->parse_state) - { - case MAVLINK_PARSE_STATE_UNINIT: - case MAVLINK_PARSE_STATE_IDLE: - if (c == MAVLINK_STX) - 800fd56: 28fe cmp r0, #254 ; 0xfe - 800fd58: f000 80ad beq.w 800feb6 - r_mavlink_status->parse_state = status->parse_state; - r_mavlink_status->packet_idx = status->packet_idx; - r_mavlink_status->current_rx_seq = status->current_rx_seq+1; - r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count; - r_mavlink_status->packet_rx_drop_count = status->parse_error; - status->parse_error = 0; - 800fd5c: 2300 movs r3, #0 - 800fd5e: 70ab strb r3, [r5, #2] - 800fd60: e7f5 b.n 800fd4e - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_SYSID; - break; - - case MAVLINK_PARSE_STATE_GOT_SYSID: - rxmsg->compid = c; - 800fd62: 4a5c ldr r2, [pc, #368] ; (800fed4 ) -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fd64: 8813 ldrh r3, [r2, #0] - 800fd66: 7190 strb r0, [r2, #6] - 800fd68: 405c eors r4, r3 - tmp ^= (tmp<<4); - 800fd6a: ea84 1404 eor.w r4, r4, r4, lsl #4 - 800fd6e: b2e4 uxtb r4, r4 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fd70: 0a1b lsrs r3, r3, #8 - 800fd72: ea83 1314 eor.w r3, r3, r4, lsr #4 - 800fd76: ea43 2304 orr.w r3, r3, r4, lsl #8 - 800fd7a: ea83 03c4 eor.w r3, r3, r4, lsl #3 - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_COMPID; - 800fd7e: 2106 movs r1, #6 - 800fd80: 8013 strh r3, [r2, #0] - 800fd82: 70e9 strb r1, [r5, #3] - 800fd84: e7ea b.n 800fd5c - status->parse_error++; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - break; - } -#endif - rxmsg->msgid = c; - 800fd86: 4a53 ldr r2, [pc, #332] ; (800fed4 ) -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fd88: 8813 ldrh r3, [r2, #0] - mavlink_update_checksum(rxmsg, c); - if (rxmsg->len == 0) - 800fd8a: 78d1 ldrb r1, [r2, #3] - status->parse_error++; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - break; - } -#endif - rxmsg->msgid = c; - 800fd8c: 71d0 strb r0, [r2, #7] - 800fd8e: 405c eors r4, r3 - tmp ^= (tmp<<4); - 800fd90: ea84 1404 eor.w r4, r4, r4, lsl #4 - 800fd94: b2e4 uxtb r4, r4 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fd96: 0a1b lsrs r3, r3, #8 - 800fd98: ea83 1314 eor.w r3, r3, r4, lsr #4 - 800fd9c: ea43 2304 orr.w r3, r3, r4, lsl #8 - 800fda0: ea83 03c4 eor.w r3, r3, r4, lsl #3 - 800fda4: 8013 strh r3, [r2, #0] - mavlink_update_checksum(rxmsg, c); - if (rxmsg->len == 0) - 800fda6: b1c9 cbz r1, 800fddc - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD; - } - else - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_MSGID; - 800fda8: 2307 movs r3, #7 - 800fdaa: 70eb strb r3, [r5, #3] - 800fdac: e7d6 b.n 800fd5c - } - break; - - case MAVLINK_PARSE_STATE_GOT_MSGID: - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx++] = (char)c; - 800fdae: 4949 ldr r1, [pc, #292] ; (800fed4 ) - 800fdb0: 792a ldrb r2, [r5, #4] - 800fdb2: 188b adds r3, r1, r2 - 800fdb4: 3201 adds r2, #1 - 800fdb6: 7218 strb r0, [r3, #8] -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fdb8: 880b ldrh r3, [r1, #0] - mavlink_update_checksum(rxmsg, c); - if (status->packet_idx == rxmsg->len) - 800fdba: 78c8 ldrb r0, [r1, #3] - 800fdbc: 405c eors r4, r3 - tmp ^= (tmp<<4); - 800fdbe: ea84 1404 eor.w r4, r4, r4, lsl #4 - 800fdc2: b2e4 uxtb r4, r4 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fdc4: 0a1b lsrs r3, r3, #8 - 800fdc6: ea83 1314 eor.w r3, r3, r4, lsr #4 - status->parse_state = MAVLINK_PARSE_STATE_GOT_MSGID; - } - break; - - case MAVLINK_PARSE_STATE_GOT_MSGID: - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx++] = (char)c; - 800fdca: b2d2 uxtb r2, r2 - 800fdcc: ea43 2304 orr.w r3, r3, r4, lsl #8 - 800fdd0: ea83 03c4 eor.w r3, r3, r4, lsl #3 - mavlink_update_checksum(rxmsg, c); - if (status->packet_idx == rxmsg->len) - 800fdd4: 4290 cmp r0, r2 - status->parse_state = MAVLINK_PARSE_STATE_GOT_MSGID; - } - break; - - case MAVLINK_PARSE_STATE_GOT_MSGID: - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx++] = (char)c; - 800fdd6: 712a strb r2, [r5, #4] - 800fdd8: 800b strh r3, [r1, #0] - mavlink_update_checksum(rxmsg, c); - if (status->packet_idx == rxmsg->len) - 800fdda: d1bf bne.n 800fd5c -#endif - rxmsg->msgid = c; - mavlink_update_checksum(rxmsg, c); - if (rxmsg->len == 0) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD; - 800fddc: 2308 movs r3, #8 - 800fdde: 70eb strb r3, [r5, #3] - 800fde0: e7bc b.n 800fd5c -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fde2: 493c ldr r1, [pc, #240] ; (800fed4 ) - } - break; - - case MAVLINK_PARSE_STATE_GOT_PAYLOAD: -#if MAVLINK_CRC_EXTRA - mavlink_update_checksum(rxmsg, MAVLINK_MESSAGE_CRC(rxmsg->msgid)); - 800fde4: 483c ldr r0, [pc, #240] ; (800fed8 ) - 800fde6: 79cb ldrb r3, [r1, #7] - 800fde8: 880a ldrh r2, [r1, #0] - 800fdea: 5cc3 ldrb r3, [r0, r3] - 800fdec: 4053 eors r3, r2 - tmp ^= (tmp<<4); - 800fdee: ea83 1303 eor.w r3, r3, r3, lsl #4 - 800fdf2: b2db uxtb r3, r3 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fdf4: 0a12 lsrs r2, r2, #8 - 800fdf6: ea82 1213 eor.w r2, r2, r3, lsr #4 - 800fdfa: ea42 2203 orr.w r2, r2, r3, lsl #8 - 800fdfe: ea82 03c3 eor.w r3, r2, r3, lsl #3 -#endif - if (c != (rxmsg->checksum & 0xFF)) { - 800fe02: b2da uxtb r2, r3 - 800fe04: 4294 cmp r4, r2 - 800fe06: 800b strh r3, [r1, #0] - status->parse_state = MAVLINK_PARSE_STATE_GOT_BAD_CRC1; - 800fe08: bf14 ite ne - 800fe0a: 230a movne r3, #10 - } else { - status->parse_state = MAVLINK_PARSE_STATE_GOT_CRC1; - 800fe0c: 2309 moveq r3, #9 - 800fe0e: 70eb strb r3, [r5, #3] - } - _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx] = (char)c; - 800fe10: 792b ldrb r3, [r5, #4] - 800fe12: 4419 add r1, r3 - 800fe14: 720c strb r4, [r1, #8] - 800fe16: e7a1 b.n 800fd5c - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_SEQ; - break; - - case MAVLINK_PARSE_STATE_GOT_SEQ: - rxmsg->sysid = c; - 800fe18: 4a2e ldr r2, [pc, #184] ; (800fed4 ) -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fe1a: 8813 ldrh r3, [r2, #0] - 800fe1c: 7150 strb r0, [r2, #5] - 800fe1e: 405c eors r4, r3 - tmp ^= (tmp<<4); - 800fe20: ea84 1404 eor.w r4, r4, r4, lsl #4 - 800fe24: b2e4 uxtb r4, r4 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fe26: 0a1b lsrs r3, r3, #8 - 800fe28: ea83 1314 eor.w r3, r3, r4, lsr #4 - 800fe2c: ea43 2304 orr.w r3, r3, r4, lsl #8 - 800fe30: ea83 03c4 eor.w r3, r3, r4, lsl #3 - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_SYSID; - 800fe34: 2105 movs r1, #5 - 800fe36: 8013 strh r3, [r2, #0] - 800fe38: 70e9 strb r1, [r5, #3] - 800fe3a: e78f b.n 800fd5c - status->parse_state = MAVLINK_PARSE_STATE_GOT_LENGTH; - } - break; - - case MAVLINK_PARSE_STATE_GOT_LENGTH: - rxmsg->seq = c; - 800fe3c: 4a25 ldr r2, [pc, #148] ; (800fed4 ) -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fe3e: 8813 ldrh r3, [r2, #0] - 800fe40: 7110 strb r0, [r2, #4] - 800fe42: 405c eors r4, r3 - tmp ^= (tmp<<4); - 800fe44: ea84 1404 eor.w r4, r4, r4, lsl #4 - 800fe48: b2e4 uxtb r4, r4 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fe4a: 0a1b lsrs r3, r3, #8 - 800fe4c: ea83 1314 eor.w r3, r3, r4, lsr #4 - 800fe50: ea43 2304 orr.w r3, r3, r4, lsl #8 - 800fe54: ea83 03c4 eor.w r3, r3, r4, lsl #3 - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_SEQ; - 800fe58: 2103 movs r1, #3 - 800fe5a: 8013 strh r3, [r2, #0] - 800fe5c: 70e9 strb r1, [r5, #3] - 800fe5e: e77d b.n 800fd5c - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - } - else - { - // NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 - rxmsg->len = c; - 800fe60: 4a1c ldr r2, [pc, #112] ; (800fed4 ) -static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) -{ - /*Accumulate one byte of data into the CRC*/ - uint8_t tmp; - - tmp = data ^ (uint8_t)(*crcAccum &0xff); - 800fe62: 8813 ldrh r3, [r2, #0] - 800fe64: 70d0 strb r0, [r2, #3] - 800fe66: 405c eors r4, r3 - tmp ^= (tmp<<4); - 800fe68: ea84 1404 eor.w r4, r4, r4, lsl #4 - 800fe6c: b2e4 uxtb r4, r4 - *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); - 800fe6e: 0a1b lsrs r3, r3, #8 - 800fe70: ea83 1314 eor.w r3, r3, r4, lsr #4 - 800fe74: ea43 2304 orr.w r3, r3, r4, lsl #8 - 800fe78: ea83 03c4 eor.w r3, r3, r4, lsl #3 - status->packet_idx = 0; - 800fe7c: 2000 movs r0, #0 - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_LENGTH; - 800fe7e: 2104 movs r1, #4 - 800fe80: 8013 strh r3, [r2, #0] - } - else - { - // NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 - rxmsg->len = c; - status->packet_idx = 0; - 800fe82: 7128 strb r0, [r5, #4] - mavlink_update_checksum(rxmsg, c); - status->parse_state = MAVLINK_PARSE_STATE_GOT_LENGTH; - 800fe84: 70e9 strb r1, [r5, #3] - 800fe86: e769 b.n 800fd5c - - int bufferIndex = 0; - - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - - switch (status->parse_state) - 800fe88: 2700 movs r7, #0 - r_mavlink_status->parse_state = status->parse_state; - r_mavlink_status->packet_idx = status->packet_idx; - r_mavlink_status->current_rx_seq = status->current_rx_seq+1; - r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count; - r_mavlink_status->packet_rx_drop_count = status->parse_error; - status->parse_error = 0; - 800fe8a: 2100 movs r1, #0 - - if (status->msg_received == MAVLINK_FRAMING_BAD_CRC) { - 800fe8c: 2f02 cmp r7, #2 - r_mavlink_status->parse_state = status->parse_state; - r_mavlink_status->packet_idx = status->packet_idx; - r_mavlink_status->current_rx_seq = status->current_rx_seq+1; - r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count; - r_mavlink_status->packet_rx_drop_count = status->parse_error; - status->parse_error = 0; - 800fe8e: 70a9 strb r1, [r5, #2] - 800fe90: 4b0f ldr r3, [pc, #60] ; (800fed0 ) - - if (status->msg_received == MAVLINK_FRAMING_BAD_CRC) { - 800fe92: f47f af5c bne.w 800fd4e - uint8_t msg_received = mavlink_frame_char(chan, c, r_message, r_mavlink_status); - if (msg_received == MAVLINK_FRAMING_BAD_CRC) { - // we got a bad CRC. Treat as a parse failure - mavlink_message_t* rxmsg = mavlink_get_channel_buffer(chan); - mavlink_status_t* status = mavlink_get_channel_status(chan); - status->parse_error++; - 800fe96: 2201 movs r2, #1 - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - if (c == MAVLINK_STX) - 800fe98: 2cfe cmp r4, #254 ; 0xfe - if (msg_received == MAVLINK_FRAMING_BAD_CRC) { - // we got a bad CRC. Treat as a parse failure - mavlink_message_t* rxmsg = mavlink_get_channel_buffer(chan); - mavlink_status_t* status = mavlink_get_channel_status(chan); - status->parse_error++; - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - 800fe9a: 7019 strb r1, [r3, #0] - uint8_t msg_received = mavlink_frame_char(chan, c, r_message, r_mavlink_status); - if (msg_received == MAVLINK_FRAMING_BAD_CRC) { - // we got a bad CRC. Treat as a parse failure - mavlink_message_t* rxmsg = mavlink_get_channel_buffer(chan); - mavlink_status_t* status = mavlink_get_channel_status(chan); - status->parse_error++; - 800fe9c: 709a strb r2, [r3, #2] - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - if (c == MAVLINK_STX) - 800fe9e: d001 beq.n 800fea4 - // we got a bad CRC. Treat as a parse failure - mavlink_message_t* rxmsg = mavlink_get_channel_buffer(chan); - mavlink_status_t* status = mavlink_get_channel_status(chan); - status->parse_error++; - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - 800fea0: 70da strb r2, [r3, #3] - 800fea2: e754 b.n 800fd4e - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - rxmsg->len = 0; - 800fea4: 4a0b ldr r2, [pc, #44] ; (800fed4 ) - status->parse_error++; - status->msg_received = MAVLINK_FRAMING_INCOMPLETE; - status->parse_state = MAVLINK_PARSE_STATE_IDLE; - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - 800fea6: 70df strb r7, [r3, #3] - * - * @param crcAccum the 16 bit X.25 CRC - */ -static inline void crc_init(uint16_t* crcAccum) -{ - *crcAccum = X25_INIT_CRC; - 800fea8: f64f 73ff movw r3, #65535 ; 0xffff - rxmsg->len = 0; - 800feac: 70d1 strb r1, [r2, #3] - 800feae: 8013 strh r3, [r2, #0] - 800feb0: e74d b.n 800fd4e - mavlink_test_cmd_t test_cmd; - mavlink_msg_test_cmd_decode( &msg, &test_cmd); // 메세지 디코딩 - - //Serial.print("seq= "); - //Serial.println(test_cmd.arg1); - ret = true; - 800feb2: 2001 movs r0, #1 - 800feb4: e74c b.n 800fd50 - case MAVLINK_PARSE_STATE_UNINIT: - case MAVLINK_PARSE_STATE_IDLE: - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - rxmsg->len = 0; - 800feb6: 4b07 ldr r3, [pc, #28] ; (800fed4 ) - 800feb8: 2000 movs r0, #0 - 800feba: f64f 71ff movw r1, #65535 ; 0xffff - { - case MAVLINK_PARSE_STATE_UNINIT: - case MAVLINK_PARSE_STATE_IDLE: - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - 800febe: 2202 movs r2, #2 - rxmsg->len = 0; - rxmsg->magic = c; - 800fec0: 709c strb r4, [r3, #2] - case MAVLINK_PARSE_STATE_UNINIT: - case MAVLINK_PARSE_STATE_IDLE: - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - rxmsg->len = 0; - 800fec2: 70d8 strb r0, [r3, #3] - 800fec4: 8019 strh r1, [r3, #0] - { - case MAVLINK_PARSE_STATE_UNINIT: - case MAVLINK_PARSE_STATE_IDLE: - if (c == MAVLINK_STX) - { - status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; - 800fec6: 70ea strb r2, [r5, #3] - 800fec8: e748 b.n 800fd5c - if (status->parse_state == MAVLINK_PARSE_STATE_GOT_BAD_CRC1 || c != (rxmsg->checksum >> 8)) { - // got a bad CRC message - status->msg_received = MAVLINK_FRAMING_BAD_CRC; - } else { - // Successfully got message - status->msg_received = MAVLINK_FRAMING_OK; - 800feca: 2701 movs r7, #1 - 800fecc: 702f strb r7, [r5, #0] - 800fece: e71c b.n 800fd0a - 800fed0: 200018f8 .word 0x200018f8 - 800fed4: 200012a0 .word 0x200012a0 - 800fed8: 08013430 .word 0x08013430 - 800fedc: f3af 8000 nop.w - -0800fee0 : -} - - -uint8_t Ch; - -static msg_t uart_process_thread(void *arg) { - 800fee0: b508 push {r3, lr} - 800fee2: 4b08 ldr r3, [pc, #32] ; (800ff04 ) - 800fee4: 4a08 ldr r2, [pc, #32] ; (800ff08 ) - 800fee6: 699b ldr r3, [r3, #24] - 800fee8: 4c08 ldr r4, [pc, #32] ; (800ff0c ) - 800feea: 619a str r2, [r3, #24] - - for(;;) - { - //chThdSleepMilliseconds(1); - - Ch = usb_uart_getch(); - 800feec: f000 ff00 bl 8010cf0 - 800fef0: 7020 strb r0, [r4, #0] - if( recv( Ch ) ) - 800fef2: f7ff feed bl 800fcd0 - 800fef6: 2800 cmp r0, #0 - 800fef8: d0f8 beq.n 800feec - { - send( 1 ); - 800fefa: 2001 movs r0, #1 - 800fefc: f7ff fe70 bl 800fbe0 - 800ff00: e7f4 b.n 800feec - 800ff02: bf00 nop - 800ff04: 20000c40 .word 0x20000c40 - 800ff08: 08013420 .word 0x08013420 - 800ff0c: 2000129c .word 0x2000129c - -0800ff10 : -unsigned int Drive_Status = 0; -unsigned int State_Index = 0; - - -static msg_t SEQUENCE_thread(void *arg) -{ - 800ff10: b508 push {r3, lr} - 800ff12: 4b04 ldr r3, [pc, #16] ; (800ff24 ) - 800ff14: 4a04 ldr r2, [pc, #16] ; (800ff28 ) - 800ff16: 699b ldr r3, [r3, #24] - // asm(" nop"); //END_SEQ: - - -#endif //pbhp 151001 - - chThdSleepMilliseconds(1); - 800ff18: 200a movs r0, #10 - 800ff1a: 619a str r2, [r3, #24] - 800ff1c: f7fd f8c0 bl 800d0a0 - - return 0; -} - 800ff20: 2000 movs r0, #0 - 800ff22: bd08 pop {r3, pc} - 800ff24: 20000c40 .word 0x20000c40 - 800ff28: 08013530 .word 0x08013530 - 800ff2c: f3af 8000 nop.w - -0800ff30 : -void mcpwm_adc_int_handler(void *p, uint32_t flags) { - (void)p; - (void)flags; - - TIM12->CNT = 0; - LED_GREEN_ON(); - 800ff30: 4b04 ldr r3, [pc, #16] ; (800ff44 ) - */ -void mcpwm_adc_int_handler(void *p, uint32_t flags) { - (void)p; - (void)flags; - - TIM12->CNT = 0; - 800ff32: 4905 ldr r1, [pc, #20] ; (800ff48 ) - 800ff34: 2000 movs r0, #0 - LED_GREEN_ON(); - 800ff36: 2240 movs r2, #64 ; 0x40 - */ -void mcpwm_adc_int_handler(void *p, uint32_t flags) { - (void)p; - (void)flags; - - TIM12->CNT = 0; - 800ff38: 6248 str r0, [r1, #36] ; 0x24 - LED_GREEN_ON(); - 800ff3a: 831a strh r2, [r3, #24] - LED_GREEN_OFF(); - - - // Reset the watchdog - WWDG_SetCounter(100); - 800ff3c: 2064 movs r0, #100 ; 0x64 - (void)p; - (void)flags; - - TIM12->CNT = 0; - LED_GREEN_ON(); - LED_GREEN_OFF(); - 800ff3e: 835a strh r2, [r3, #26] - - - // Reset the watchdog - WWDG_SetCounter(100); - 800ff40: f002 b976 b.w 8012230 - 800ff44: 40020400 .word 0x40020400 - 800ff48: 40001800 .word 0x40001800 - 800ff4c: f3af 8000 nop.w - -0800ff50 : - - return False; -} - -void ClarkePark(void) -{ - 800ff50: b510 push {r4, lr} - ParkParm.qIalpha = ParkParm.qIa; - 800ff52: 4c17 ldr r4, [pc, #92] ; (800ffb0 ) - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - 800ff54: eddf 7a17 vldr s15, [pc, #92] ; 800ffb4 - - return False; -} - -void ClarkePark(void) -{ - 800ff58: ed2d 8b04 vpush {d8-d9} - ParkParm.qIalpha = ParkParm.qIa; - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - 800ff5c: ed94 8a04 vldr s16, [r4, #16] - return False; -} - -void ClarkePark(void) -{ - ParkParm.qIalpha = ParkParm.qIa; - 800ff60: edd4 8a03 vldr s17, [r4, #12] - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - // Ialpha and Ibeta have been calculated. Now do rotation. - // Get qSin, qCos from ParkParm structure - - ParkParm.qId = ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); - 800ff64: edd4 9a00 vldr s19, [r4] - return False; -} - -void ClarkePark(void) -{ - ParkParm.qIalpha = ParkParm.qIa; - 800ff68: edc4 8a05 vstr s17, [r4, #20] - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - 800ff6c: ee38 8a08 vadd.f32 s16, s16, s16 - // Ialpha and Ibeta have been calculated. Now do rotation. - // Get qSin, qCos from ParkParm structure - - ParkParm.qId = ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); - 800ff70: eeb0 0a69 vmov.f32 s0, s19 -} - -void ClarkePark(void) -{ - ParkParm.qIalpha = ParkParm.qIa; - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - 800ff74: ee28 8a27 vmul.f32 s16, s16, s15 - 800ff78: eea8 8aa7 vfma.f32 s16, s17, s15 - 800ff7c: ed84 8a06 vstr s16, [r4, #24] - // Ialpha and Ibeta have been calculated. Now do rotation. - // Get qSin, qCos from ParkParm structure - - ParkParm.qId = ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); - 800ff80: f002 f96e bl 8012260 - 800ff84: eeb0 9a40 vmov.f32 s18, s0 - 800ff88: eeb0 0a69 vmov.f32 s0, s19 - 800ff8c: f002 f9a8 bl 80122e0 - ParkParm.qIq = -ParkParm.qIalpha*sinf(ParkParm.qAngle) + ParkParm.qIbeta*cosf(ParkParm.qAngle); - 800ff90: ee68 7a09 vmul.f32 s15, s16, s18 - ParkParm.qIalpha = ParkParm.qIa; - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - // Ialpha and Ibeta have been calculated. Now do rotation. - // Get qSin, qCos from ParkParm structure - - ParkParm.qId = ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); - 800ff94: ee28 8a00 vmul.f32 s16, s16, s0 - ParkParm.qIq = -ParkParm.qIalpha*sinf(ParkParm.qAngle) + ParkParm.qIbeta*cosf(ParkParm.qAngle); - 800ff98: eee8 7ac0 vfms.f32 s15, s17, s0 - ParkParm.qIalpha = ParkParm.qIa; - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - // Ialpha and Ibeta have been calculated. Now do rotation. - // Get qSin, qCos from ParkParm structure - - ParkParm.qId = ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); - 800ff9c: eea8 8a89 vfma.f32 s16, s17, s18 - ParkParm.qIq = -ParkParm.qIalpha*sinf(ParkParm.qAngle) + ParkParm.qIbeta*cosf(ParkParm.qAngle); - 800ffa0: edc4 7a08 vstr s15, [r4, #32] - ParkParm.qIalpha = ParkParm.qIa; - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - // Ialpha and Ibeta have been calculated. Now do rotation. - // Get qSin, qCos from ParkParm structure - - ParkParm.qId = ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); - 800ffa4: ed84 8a07 vstr s16, [r4, #28] - ParkParm.qIq = -ParkParm.qIalpha*sinf(ParkParm.qAngle) + ParkParm.qIbeta*cosf(ParkParm.qAngle); - - return; -} - 800ffa8: ecbd 8b04 vpop {d8-d9} - 800ffac: bd10 pop {r4, pc} - 800ffae: bf00 nop - 800ffb0: 200029ac .word 0x200029ac - 800ffb4: 3f13cd3a .word 0x3f13cd3a - 800ffb8: f3af 8000 nop.w - 800ffbc: f3af 8000 nop.w - -0800ffc0 : - -} -void CalcPI( tPIParm *pParm) -{ - float U,Exc,Err; - Err = pParm->qInRef - pParm->qInMeas; - 800ffc0: ed90 7a06 vldr s14, [r0, #24] - 800ffc4: ed90 6a07 vldr s12, [r0, #28] - - U = pParm->qdSum + pParm->qKp * Err; - 800ffc8: edd0 7a00 vldr s15, [r0] - 800ffcc: edd0 5a01 vldr s11, [r0, #4] - - if( U > pParm->qOutMax ) pParm->qOut = pParm->qOutMax; - 800ffd0: edd0 6a04 vldr s13, [r0, #16] - -} -void CalcPI( tPIParm *pParm) -{ - float U,Exc,Err; - Err = pParm->qInRef - pParm->qInMeas; - 800ffd4: ee37 6a46 vsub.f32 s12, s14, s12 - - U = pParm->qdSum + pParm->qKp * Err; - 800ffd8: eeb0 7a67 vmov.f32 s14, s15 - 800ffdc: eea5 7a86 vfma.f32 s14, s11, s12 - - if( U > pParm->qOutMax ) pParm->qOut = pParm->qOutMax; - 800ffe0: eeb4 7ae6 vcmpe.f32 s14, s13 - 800ffe4: eef1 fa10 vmrs APSR_nzcv, fpscr - 800ffe8: dc0b bgt.n 8010002 - else if( U < pParm->qOutMin ) pParm->qOut = pParm->qOutMin; - 800ffea: edd0 6a05 vldr s13, [r0, #20] - 800ffee: eeb4 7ae6 vcmpe.f32 s14, s13 - 800fff2: eef1 fa10 vmrs APSR_nzcv, fpscr - 800fff6: d404 bmi.n 8010002 - else pParm->qOut = U ; - 800fff8: eef0 6a47 vmov.f32 s13, s14 - 800fffc: ed80 7a08 vstr s14, [r0, #32] - 8010000: e001 b.n 8010006 - Err = pParm->qInRef - pParm->qInMeas; - - U = pParm->qdSum + pParm->qKp * Err; - - if( U > pParm->qOutMax ) pParm->qOut = pParm->qOutMax; - else if( U < pParm->qOutMin ) pParm->qOut = pParm->qOutMin; - 8010002: edc0 6a08 vstr s13, [r0, #32] - else pParm->qOut = U ; - - Exc = U - pParm->qOut; - - pParm->qdSum = pParm->qdSum + pParm->qKi * Err - pParm->qKc * Exc ; - 8010006: ed90 5a02 vldr s10, [r0, #8] - 801000a: edd0 5a03 vldr s11, [r0, #12] - 801000e: eee5 7a06 vfma.f32 s15, s10, s12 - - if( U > pParm->qOutMax ) pParm->qOut = pParm->qOutMax; - else if( U < pParm->qOutMin ) pParm->qOut = pParm->qOutMin; - else pParm->qOut = U ; - - Exc = U - pParm->qOut; - 8010012: ee37 7a66 vsub.f32 s14, s14, s13 - - pParm->qdSum = pParm->qdSum + pParm->qKi * Err - pParm->qKc * Exc ; - 8010016: eee5 7ac7 vfms.f32 s15, s11, s14 - 801001a: edc0 7a00 vstr s15, [r0] - 801001e: 4770 bx lr - -08010020 : - - return; -} -void SetupControlParameters(void) -{ - 8010020: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr} - PIParmD.qOutMin = -PIParmD.qOutMax; - - InitPI(&PIParmD); - - // ============= PI Q Term =============== - PIParmQ.qKp = QKP; - 8010024: 481a ldr r0, [pc, #104] ; (8010090 ) -} -void SetupControlParameters(void) -{ - - // ============= PI D Term =============== - PIParmD.qKp = DKP; - 8010026: 4c1b ldr r4, [pc, #108] ; (8010094 ) - PIParmQ.qOutMin = -PIParmQ.qOutMax; - - InitPI(&PIParmQ); - - // ============= PI W Term =============== - PIParmW.qKp = WKP; - 8010028: 491b ldr r1, [pc, #108] ; (8010098 ) - PIParmW.qOutMin = -PIParmW.qOutMax; - - InitPI(&PIParmW); - - // ============= PI PLL Term =============== - PIParmPLL.qKp = WKP; - 801002a: 4a1c ldr r2, [pc, #112] ; (801009c ) -{ - - // ============= PI D Term =============== - PIParmD.qKp = DKP; - PIParmD.qKi = DKI; - PIParmD.qKc = DKC; - 801002c: 4d1c ldr r5, [pc, #112] ; (80100a0 ) -void SetupControlParameters(void) -{ - - // ============= PI D Term =============== - PIParmD.qKp = DKP; - PIParmD.qKi = DKI; - 801002e: 4e1d ldr r6, [pc, #116] ; (80100a4 ) -} -void SetupControlParameters(void) -{ - - // ============= PI D Term =============== - PIParmD.qKp = DKP; - 8010030: f8df 9078 ldr.w r9, [pc, #120] ; 80100ac - PIParmD.qKi = DKI; - PIParmD.qKc = DKC; - PIParmD.qOutMax = DOUTMAX; - PIParmD.qOutMin = -PIParmD.qOutMax; - 8010034: f8df 8078 ldr.w r8, [pc, #120] ; 80100b0 - - // ============= PI W Term =============== - PIParmW.qKp = WKP; - PIParmW.qKi = WKI; - PIParmW.qKc = WKC; - PIParmW.qOutMax = WOUTMAX; - 8010038: f8df e078 ldr.w lr, [pc, #120] ; 80100b4 - PIParmW.qOutMin = -PIParmW.qOutMax; - 801003c: 4f1a ldr r7, [pc, #104] ; (80100a8 ) -} -void SetupControlParameters(void) -{ - - // ============= PI D Term =============== - PIParmD.qKp = DKP; - 801003e: f8c4 9004 str.w r9, [r4, #4] - } - } - } -void InitPI( tPIParm *pParm) -{ - pParm->qdSum=0; - 8010042: 2300 movs r3, #0 - PIParmQ.qOutMin = -PIParmQ.qOutMax; - - InitPI(&PIParmQ); - - // ============= PI W Term =============== - PIParmW.qKp = WKP; - 8010044: f04f 4c80 mov.w ip, #1073741824 ; 0x40000000 - PIParmD.qOutMin = -PIParmD.qOutMax; - - InitPI(&PIParmD); - - // ============= PI Q Term =============== - PIParmQ.qKp = QKP; - 8010048: f8c0 9004 str.w r9, [r0, #4] -void SetupControlParameters(void) -{ - - // ============= PI D Term =============== - PIParmD.qKp = DKP; - PIParmD.qKi = DKI; - 801004c: 60a6 str r6, [r4, #8] - - InitPI(&PIParmD); - - // ============= PI Q Term =============== - PIParmQ.qKp = QKP; - PIParmQ.qKi = QKI; - 801004e: 6086 str r6, [r0, #8] -{ - - // ============= PI D Term =============== - PIParmD.qKp = DKP; - PIParmD.qKi = DKI; - PIParmD.qKc = DKC; - 8010050: 60e5 str r5, [r4, #12] - PIParmD.qOutMax = DOUTMAX; - 8010052: 6125 str r5, [r4, #16] - InitPI(&PIParmD); - - // ============= PI Q Term =============== - PIParmQ.qKp = QKP; - PIParmQ.qKi = QKI; - PIParmQ.qKc = QKC; - 8010054: 60c5 str r5, [r0, #12] - PIParmQ.qOutMax = QOUTMAX; - 8010056: 6105 str r5, [r0, #16] - // ============= PI D Term =============== - PIParmD.qKp = DKP; - PIParmD.qKi = DKI; - PIParmD.qKc = DKC; - PIParmD.qOutMax = DOUTMAX; - PIParmD.qOutMin = -PIParmD.qOutMax; - 8010058: f8c4 8014 str.w r8, [r4, #20] - // ============= PI Q Term =============== - PIParmQ.qKp = QKP; - PIParmQ.qKi = QKI; - PIParmQ.qKc = QKC; - PIParmQ.qOutMax = QOUTMAX; - PIParmQ.qOutMin = -PIParmQ.qOutMax; - 801005c: f8c0 8014 str.w r8, [r0, #20] - } - } - } -void InitPI( tPIParm *pParm) -{ - pParm->qdSum=0; - 8010060: 6023 str r3, [r4, #0] - pParm->qOut=0; - 8010062: 6223 str r3, [r4, #32] - } - } - } -void InitPI( tPIParm *pParm) -{ - pParm->qdSum=0; - 8010064: 6003 str r3, [r0, #0] - pParm->qOut=0; - 8010066: 6203 str r3, [r0, #32] - - InitPI(&PIParmQ); - - // ============= PI W Term =============== - PIParmW.qKp = WKP; - PIParmW.qKi = WKI; - 8010068: 608e str r6, [r1, #8] - PIParmW.qKc = WKC; - 801006a: 60cd str r5, [r1, #12] - } - } - } -void InitPI( tPIParm *pParm) -{ - pParm->qdSum=0; - 801006c: 600b str r3, [r1, #0] - pParm->qOut=0; - 801006e: 620b str r3, [r1, #32] - - InitPI(&PIParmW); - - // ============= PI PLL Term =============== - PIParmPLL.qKp = WKP; - PIParmPLL.qKi = WKI; - 8010070: 6096 str r6, [r2, #8] - PIParmPLL.qKc = WKC; - 8010072: 60d5 str r5, [r2, #12] - } - } - } -void InitPI( tPIParm *pParm) -{ - pParm->qdSum=0; - 8010074: 6013 str r3, [r2, #0] - pParm->qOut=0; - 8010076: 6213 str r3, [r2, #32] - PIParmQ.qOutMin = -PIParmQ.qOutMax; - - InitPI(&PIParmQ); - - // ============= PI W Term =============== - PIParmW.qKp = WKP; - 8010078: f8c1 c004 str.w ip, [r1, #4] - PIParmW.qOutMin = -PIParmW.qOutMax; - - InitPI(&PIParmW); - - // ============= PI PLL Term =============== - PIParmPLL.qKp = WKP; - 801007c: f8c2 c004 str.w ip, [r2, #4] - - // ============= PI W Term =============== - PIParmW.qKp = WKP; - PIParmW.qKi = WKI; - PIParmW.qKc = WKC; - PIParmW.qOutMax = WOUTMAX; - 8010080: f8c1 e010 str.w lr, [r1, #16] - - // ============= PI PLL Term =============== - PIParmPLL.qKp = WKP; - PIParmPLL.qKi = WKI; - PIParmPLL.qKc = WKC; - PIParmPLL.qOutMax = WOUTMAX; - 8010084: f8c2 e010 str.w lr, [r2, #16] - // ============= PI W Term =============== - PIParmW.qKp = WKP; - PIParmW.qKi = WKI; - PIParmW.qKc = WKC; - PIParmW.qOutMax = WOUTMAX; - PIParmW.qOutMin = -PIParmW.qOutMax; - 8010088: 614f str r7, [r1, #20] - // ============= PI PLL Term =============== - PIParmPLL.qKp = WKP; - PIParmPLL.qKi = WKI; - PIParmPLL.qKc = WKC; - PIParmPLL.qOutMax = WOUTMAX; - PIParmPLL.qOutMin = -PIParmPLL.qOutMax; - 801008a: 6157 str r7, [r2, #20] - 801008c: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} - 8010090: 200028d0 .word 0x200028d0 - 8010094: 20001ee8 .word 0x20001ee8 - 8010098: 20001f10 .word 0x20001f10 - 801009c: 2000290c .word 0x2000290c - 80100a0: 3f7fff58 .word 0x3f7fff58 - 80100a4: 3c23d70a .word 0x3c23d70a - 80100a8: bf733333 .word 0xbf733333 - 80100ac: 3d4ccccd .word 0x3d4ccccd - 80100b0: bf7fff58 .word 0xbf7fff58 - 80100b4: 3f733333 .word 0x3f733333 - 80100b8: f3af 8000 nop.w - 80100bc: f3af 8000 nop.w - -080100c0 : -static THD_WORKING_AREA(SEQUENCE_thread_wa, 2048); -static msg_t SEQUENCE_thread(void *arg); -//static WORKING_AREA(rpm_thread_wa, 1024); -//static msg_t rpm_thread(void *arg); - -void mcpwm_init(mc_configuration *configuration) { - 80100c0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - 80100c4: b0a9 sub sp, #164 ; 0xa4 - utils_sys_lock_cnt(); - 80100c6: f000 fe6b bl 8010da0 - TIM_OCInitTypeDef TIM_OCInitStructure; - TIM_BDTRInitTypeDef TIM_BDTRInitStructure; - NVIC_InitTypeDef NVIC_InitStructure; - - // Initialize variables - fault_now = FAULT_CODE_NONE; - 80100ca: 4bd9 ldr r3, [pc, #868] ; (8010430 ) - dccal_done = false; - - TIM_DeInit(TIM1); - 80100cc: 4ed9 ldr r6, [pc, #868] ; (8010434 ) - TIM_DeInit(TIM8); - 80100ce: 4fda ldr r7, [pc, #872] ; (8010438 ) - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now /2; - 80100d0: f8df b390 ldr.w fp, [pc, #912] ; 8010464 - TIM_OCInitTypeDef TIM_OCInitStructure; - TIM_BDTRInitTypeDef TIM_BDTRInitStructure; - NVIC_InitTypeDef NVIC_InitStructure; - - // Initialize variables - fault_now = FAULT_CODE_NONE; - 80100d4: 2400 movs r4, #0 - 80100d6: 701c strb r4, [r3, #0] - dccal_done = false; - 80100d8: 4bd8 ldr r3, [pc, #864] ; (801043c ) - - TIM_DeInit(TIM1); - 80100da: 4630 mov r0, r6 - TIM_BDTRInitTypeDef TIM_BDTRInitStructure; - NVIC_InitTypeDef NVIC_InitStructure; - - // Initialize variables - fault_now = FAULT_CODE_NONE; - dccal_done = false; - 80100dc: 701c strb r4, [r3, #0] - - TIM_DeInit(TIM1); - 80100de: f001 fd6f bl 8011bc0 - TIM_DeInit(TIM8); - 80100e2: 4638 mov r0, r7 - 80100e4: f001 fd6c bl 8011bc0 - TIM1->CNT = 0; - TIM8->CNT = 0; - - // TIM1 clock enable - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - 80100e8: 2001 movs r0, #1 - 80100ea: 4601 mov r1, r0 - fault_now = FAULT_CODE_NONE; - dccal_done = false; - - TIM_DeInit(TIM1); - TIM_DeInit(TIM8); - TIM1->CNT = 0; - 80100ec: 6274 str r4, [r6, #36] ; 0x24 - TIM8->CNT = 0; - 80100ee: 627c str r4, [r7, #36] ; 0x24 - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now /2; - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_RepetitionCounter = 1; - 80100f0: 2501 movs r5, #1 - TIM_DeInit(TIM8); - TIM1->CNT = 0; - TIM8->CNT = 0; - - // TIM1 clock enable - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - 80100f2: f001 fd35 bl 8011b60 - - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - 80100f6: f04f 0e20 mov.w lr, #32 - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now /2; - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_RepetitionCounter = 1; - - TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); - 80100fa: 4630 mov r0, r6 - 80100fc: a903 add r1, sp, #12 - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now /2; - 80100fe: f8db 2000 ldr.w r2, [fp] - // TIM1 clock enable - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - 8010102: f8ad e00e strh.w lr, [sp, #14] - - // TIM1 clock enable - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - 8010106: f8ad 400c strh.w r4, [sp, #12] - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now /2; - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - 801010a: f8ad 4014 strh.w r4, [sp, #20] - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now /2; - 801010e: 4bcc ldr r3, [pc, #816] ; (8010440 ) - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_RepetitionCounter = 1; - 8010110: f88d 5016 strb.w r5, [sp, #22] - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); - - // Time Base configuration - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now /2; - 8010114: fb93 f3f2 sdiv r3, r3, r2 - 8010118: 9304 str r3, [sp, #16] - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_RepetitionCounter = 1; - - TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); - 801011a: f001 fe31 bl 8011d80 - - // Channel 1, 2 and 3 Configuration in PWM mode - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR / 2; - 801011e: 6af3 ldr r3, [r6, #44] ; 0x2c - - TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); - - // Channel 1, 2 and 3 Configuration in PWM mode - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - 8010120: f8ad 503a strh.w r5, [sp, #58] ; 0x3a - TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR / 2; - 8010124: 40eb lsrs r3, r5 - 8010126: 9310 str r3, [sp, #64] ; 0x40 - TIM_TimeBaseStructure.TIM_RepetitionCounter = 1; - - TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); - - // Channel 1, 2 and 3 Configuration in PWM mode - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - 8010128: 2360 movs r3, #96 ; 0x60 - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR / 2; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - 801012a: f44f 7880 mov.w r8, #256 ; 0x100 - TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); - - // Channel 1, 2 and 3 Configuration in PWM mode - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; - 801012e: f04f 0904 mov.w r9, #4 - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set; - - TIM_OC1Init(TIM1, &TIM_OCInitStructure); - 8010132: 4630 mov r0, r6 - 8010134: a90e add r1, sp, #56 ; 0x38 - TIM_TimeBaseStructure.TIM_RepetitionCounter = 1; - - TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); - - // Channel 1, 2 and 3 Configuration in PWM mode - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - 8010136: f8ad 3038 strh.w r3, [sp, #56] ; 0x38 - TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR / 2; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set; - 801013a: f44f 7300 mov.w r3, #512 ; 0x200 - 801013e: f8ad 304a strh.w r3, [sp, #74] ; 0x4a - // Channel 1, 2 and 3 Configuration in PWM mode - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR / 2; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - 8010142: f8ad 4044 strh.w r4, [sp, #68] ; 0x44 - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - 8010146: f8ad 4046 strh.w r4, [sp, #70] ; 0x46 - TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); - - // Channel 1, 2 and 3 Configuration in PWM mode - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable; - 801014a: f8ad 903c strh.w r9, [sp, #60] ; 0x3c - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR / 2; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - 801014e: f8ad 8048 strh.w r8, [sp, #72] ; 0x48 - TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set; - - TIM_OC1Init(TIM1, &TIM_OCInitStructure); - 8010152: f001 fe85 bl 8011e60 - TIM_OC2Init(TIM1, &TIM_OCInitStructure); - 8010156: 4630 mov r0, r6 - 8010158: a90e add r1, sp, #56 ; 0x38 - 801015a: f001 fec1 bl 8011ee0 - TIM_OC3Init(TIM1, &TIM_OCInitStructure); - 801015e: 4630 mov r0, r6 - 8010160: a90e add r1, sp, #56 ; 0x38 - 8010162: f001 ff0d bl 8011f80 - TIM_OC4Init(TIM1, &TIM_OCInitStructure); - 8010166: 4630 mov r0, r6 - 8010168: a90e add r1, sp, #56 ; 0x38 - 801016a: f001 ff51 bl 8012010 - - TIM_OC1PreloadConfig(TIM1, TIM_OCPreload_Enable); - 801016e: 4630 mov r0, r6 - 8010170: 2108 movs r1, #8 - 8010172: f001 ff8d bl 8012090 - TIM_OC2PreloadConfig(TIM1, TIM_OCPreload_Enable); - 8010176: 4630 mov r0, r6 - 8010178: 2108 movs r1, #8 - 801017a: f001 ff91 bl 80120a0 - TIM_OC3PreloadConfig(TIM1, TIM_OCPreload_Enable); - 801017e: 4630 mov r0, r6 - 8010180: 2108 movs r1, #8 - 8010182: f001 ff9d bl 80120c0 - TIM_OC4PreloadConfig(TIM1, TIM_OCPreload_Enable); - 8010186: 4630 mov r0, r6 - 8010188: 2108 movs r1, #8 - 801018a: f001 ffa1 bl 80120d0 - - // Automatic Output enable, Break, dead time and lock configuration - TIM_BDTRInitStructure.TIM_OSSRState = TIM_OSSRState_Enable; - TIM_BDTRInitStructure.TIM_OSSIState = TIM_OSSRState_Enable; - TIM_BDTRInitStructure.TIM_LOCKLevel = TIM_LOCKLevel_OFF; - TIM_BDTRInitStructure.TIM_DeadTime = MCPWM_DEAD_TIME_CYCLES; - 801018e: 2350 movs r3, #80 ; 0x50 - TIM_OC2PreloadConfig(TIM1, TIM_OCPreload_Enable); - TIM_OC3PreloadConfig(TIM1, TIM_OCPreload_Enable); - TIM_OC4PreloadConfig(TIM1, TIM_OCPreload_Enable); - - // Automatic Output enable, Break, dead time and lock configuration - TIM_BDTRInitStructure.TIM_OSSRState = TIM_OSSRState_Enable; - 8010190: f44f 6a00 mov.w sl, #2048 ; 0x800 - TIM_BDTRInitStructure.TIM_DeadTime = MCPWM_DEAD_TIME_CYCLES; - TIM_BDTRInitStructure.TIM_Break = TIM_Break_Disable; - TIM_BDTRInitStructure.TIM_BreakPolarity = TIM_BreakPolarity_High; - TIM_BDTRInitStructure.TIM_AutomaticOutput = TIM_AutomaticOutput_Disable; - - TIM_BDTRConfig(TIM1, &TIM_BDTRInitStructure); - 8010194: 4630 mov r0, r6 - 8010196: a906 add r1, sp, #24 - - // Automatic Output enable, Break, dead time and lock configuration - TIM_BDTRInitStructure.TIM_OSSRState = TIM_OSSRState_Enable; - TIM_BDTRInitStructure.TIM_OSSIState = TIM_OSSRState_Enable; - TIM_BDTRInitStructure.TIM_LOCKLevel = TIM_LOCKLevel_OFF; - TIM_BDTRInitStructure.TIM_DeadTime = MCPWM_DEAD_TIME_CYCLES; - 8010198: f8ad 301e strh.w r3, [sp, #30] - TIM_BDTRInitStructure.TIM_Break = TIM_Break_Disable; - TIM_BDTRInitStructure.TIM_BreakPolarity = TIM_BreakPolarity_High; - 801019c: f44f 5300 mov.w r3, #8192 ; 0x2000 - 80101a0: f8ad 3022 strh.w r3, [sp, #34] ; 0x22 - TIM_OC2PreloadConfig(TIM1, TIM_OCPreload_Enable); - TIM_OC3PreloadConfig(TIM1, TIM_OCPreload_Enable); - TIM_OC4PreloadConfig(TIM1, TIM_OCPreload_Enable); - - // Automatic Output enable, Break, dead time and lock configuration - TIM_BDTRInitStructure.TIM_OSSRState = TIM_OSSRState_Enable; - 80101a4: f8ad a018 strh.w sl, [sp, #24] - TIM_BDTRInitStructure.TIM_OSSIState = TIM_OSSRState_Enable; - 80101a8: f8ad a01a strh.w sl, [sp, #26] - TIM_BDTRInitStructure.TIM_LOCKLevel = TIM_LOCKLevel_OFF; - 80101ac: f8ad 401c strh.w r4, [sp, #28] - TIM_BDTRInitStructure.TIM_DeadTime = MCPWM_DEAD_TIME_CYCLES; - TIM_BDTRInitStructure.TIM_Break = TIM_Break_Disable; - 80101b0: f8ad 4020 strh.w r4, [sp, #32] - TIM_BDTRInitStructure.TIM_BreakPolarity = TIM_BreakPolarity_High; - TIM_BDTRInitStructure.TIM_AutomaticOutput = TIM_AutomaticOutput_Disable; - 80101b4: f8ad 4024 strh.w r4, [sp, #36] ; 0x24 - - TIM_BDTRConfig(TIM1, &TIM_BDTRInitStructure); - 80101b8: f001 ff9a bl 80120f0 - TIM_CCPreloadControl(TIM1, ENABLE); - 80101bc: 4630 mov r0, r6 - 80101be: 4629 mov r1, r5 - 80101c0: f001 ffbe bl 8012140 - TIM_ARRPreloadConfig(TIM1, ENABLE); - 80101c4: 4630 mov r0, r6 - 80101c6: 4629 mov r1, r5 - 80101c8: f001 fe2a bl 8011e20 - ADC_CommonInitTypeDef ADC_CommonInitStructure; - DMA_InitTypeDef DMA_InitStructure; - ADC_InitTypeDef ADC_InitStructure; - - // Clock - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2 | RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC, ENABLE); - 80101cc: 4629 mov r1, r5 - 80101ce: 489d ldr r0, [pc, #628] ; (8010444 ) - 80101d0: f001 fca6 bl 8011b20 - RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC2 | RCC_APB2Periph_ADC3, ENABLE); - 80101d4: 4629 mov r1, r5 - 80101d6: f44f 60e0 mov.w r0, #1792 ; 0x700 - 80101da: f001 fcc1 bl 8011b60 - - dmaStreamAllocate(STM32_DMA_STREAM(STM32_DMA_STREAM_ID(2, 4)),3,(stm32_dmaisr_t)mcpwm_adc_int_handler,(void *)0); - 80101de: 4623 mov r3, r4 - 80101e0: 4a99 ldr r2, [pc, #612] ; (8010448 ) - 80101e2: 489a ldr r0, [pc, #616] ; (801044c ) - 80101e4: 2103 movs r1, #3 - 80101e6: f7fe f933 bl 800e450 - DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; - DMA_InitStructure.DMA_BufferSize = HW_ADC_CHANNELS; - DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; - DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; - DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; - 80101ea: f44f 5100 mov.w r1, #8192 ; 0x2000 - - dmaStreamAllocate(STM32_DMA_STREAM(STM32_DMA_STREAM_ID(2, 4)),3,(stm32_dmaisr_t)mcpwm_adc_int_handler,(void *)0); - - // DMA for the ADC - DMA_InitStructure.DMA_Channel = DMA_Channel_0; - DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADC_Value; - 80101ee: f8df c278 ldr.w ip, [pc, #632] ; 8010468 - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - 80101f2: f8df e278 ldr.w lr, [pc, #632] ; 801046c - DMA_InitStructure.DMA_Priority = DMA_Priority_High; - DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; - DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_1QuarterFull; - DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; - DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; - DMA_Init(DMA2_Stream4, &DMA_InitStructure); - 80101f6: 4896 ldr r0, [pc, #600] ; (8010450 ) - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; - DMA_InitStructure.DMA_BufferSize = HW_ADC_CHANNELS; - DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; - DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; - 80101f8: f8cd a080 str.w sl, [sp, #128] ; 0x80 - DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; - DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; - DMA_InitStructure.DMA_Priority = DMA_Priority_High; - 80101fc: f44f 3300 mov.w r3, #131072 ; 0x20000 - DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADC_Value; - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; - DMA_InitStructure.DMA_BufferSize = HW_ADC_CHANNELS; - DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; - DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - 8010200: f44f 6280 mov.w r2, #1024 ; 0x400 - // DMA for the ADC - DMA_InitStructure.DMA_Channel = DMA_Channel_0; - DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADC_Value; - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; - DMA_InitStructure.DMA_BufferSize = HW_ADC_CHANNELS; - 8010204: f04f 0a0c mov.w sl, #12 - DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; - DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; - DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; - 8010208: 9121 str r1, [sp, #132] ; 0x84 - DMA_InitStructure.DMA_Priority = DMA_Priority_High; - DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; - DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_1QuarterFull; - DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; - DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; - DMA_Init(DMA2_Stream4, &DMA_InitStructure); - 801020a: a919 add r1, sp, #100 ; 0x64 - - dmaStreamAllocate(STM32_DMA_STREAM(STM32_DMA_STREAM_ID(2, 4)),3,(stm32_dmaisr_t)mcpwm_adc_int_handler,(void *)0); - - // DMA for the ADC - DMA_InitStructure.DMA_Channel = DMA_Channel_0; - DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADC_Value; - 801020c: f8cd c06c str.w ip, [sp, #108] ; 0x6c - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - 8010210: f8cd e068 str.w lr, [sp, #104] ; 0x68 - DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; - DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; - DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; - DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; - DMA_InitStructure.DMA_Priority = DMA_Priority_High; - 8010214: 9323 str r3, [sp, #140] ; 0x8c - DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADC_Value; - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; - DMA_InitStructure.DMA_BufferSize = HW_ADC_CHANNELS; - DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; - DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - 8010216: 921f str r2, [sp, #124] ; 0x7c - RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC2 | RCC_APB2Periph_ADC3, ENABLE); - - dmaStreamAllocate(STM32_DMA_STREAM(STM32_DMA_STREAM_ID(2, 4)),3,(stm32_dmaisr_t)mcpwm_adc_int_handler,(void *)0); - - // DMA for the ADC - DMA_InitStructure.DMA_Channel = DMA_Channel_0; - 8010218: 9419 str r4, [sp, #100] ; 0x64 - DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADC_Value; - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; - 801021a: 941c str r4, [sp, #112] ; 0x70 - DMA_InitStructure.DMA_BufferSize = HW_ADC_CHANNELS; - DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; - 801021c: 941e str r4, [sp, #120] ; 0x78 - DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; - DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; - DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; - 801021e: f8cd 8088 str.w r8, [sp, #136] ; 0x88 - DMA_InitStructure.DMA_Priority = DMA_Priority_High; - DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; - 8010222: 9424 str r4, [sp, #144] ; 0x90 - DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_1QuarterFull; - 8010224: 9425 str r4, [sp, #148] ; 0x94 - DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; - 8010226: 9426 str r4, [sp, #152] ; 0x98 - DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; - 8010228: 9427 str r4, [sp, #156] ; 0x9c - // DMA for the ADC - DMA_InitStructure.DMA_Channel = DMA_Channel_0; - DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&ADC_Value; - DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC->CDR; - DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; - DMA_InitStructure.DMA_BufferSize = HW_ADC_CHANNELS; - 801022a: f8cd a074 str.w sl, [sp, #116] ; 0x74 - DMA_InitStructure.DMA_Priority = DMA_Priority_High; - DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; - DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_1QuarterFull; - DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; - DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; - DMA_Init(DMA2_Stream4, &DMA_InitStructure); - 801022e: f001 fb47 bl 80118c0 - - // DMA2_Stream0 enable - DMA_Cmd(DMA2_Stream4, ENABLE); - 8010232: 4629 mov r1, r5 - 8010234: 4886 ldr r0, [pc, #536] ; (8010450 ) - 8010236: f001 fb7b bl 8011930 - - // Enable transfer complete interrupt - DMA_ITConfig(DMA2_Stream4, DMA_IT_TC, ENABLE); - 801023a: 2110 movs r1, #16 - 801023c: 462a mov r2, r5 - 801023e: 4884 ldr r0, [pc, #528] ; (8010450 ) - 8010240: f001 fb86 bl 8011950 - - // ADC Common Init - // Note that the ADC is running at 42MHz, which is higher than the - // specified 36MHz in the data sheet, but it works. - ADC_CommonInitStructure.ADC_Mode = ADC_TripleMode_RegSimult; - 8010244: 2216 movs r2, #22 - ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2; - ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_1; - 8010246: f44f 4380 mov.w r3, #16384 ; 0x4000 - ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles; - ADC_CommonInit(&ADC_CommonInitStructure); - 801024a: a80a add r0, sp, #40 ; 0x28 - DMA_ITConfig(DMA2_Stream4, DMA_IT_TC, ENABLE); - - // ADC Common Init - // Note that the ADC is running at 42MHz, which is higher than the - // specified 36MHz in the data sheet, but it works. - ADC_CommonInitStructure.ADC_Mode = ADC_TripleMode_RegSimult; - 801024c: 920a str r2, [sp, #40] ; 0x28 - ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2; - ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_1; - 801024e: 930c str r3, [sp, #48] ; 0x30 - - // ADC Common Init - // Note that the ADC is running at 42MHz, which is higher than the - // specified 36MHz in the data sheet, but it works. - ADC_CommonInitStructure.ADC_Mode = ADC_TripleMode_RegSimult; - ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2; - 8010250: 940b str r4, [sp, #44] ; 0x2c - ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_1; - ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles; - 8010252: 940d str r4, [sp, #52] ; 0x34 - ADC_CommonInit(&ADC_CommonInitStructure); - 8010254: f001 fa44 bl 80116e0 - // Channel-specific settings - ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; - ADC_InitStructure.ADC_ScanConvMode = ENABLE; - ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Falling; - ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T8_CC1; - 8010258: f04f 6350 mov.w r3, #218103808 ; 0xd000000 - - // Channel-specific settings - ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; - ADC_InitStructure.ADC_ScanConvMode = ENABLE; - ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Falling; - 801025c: f04f 5200 mov.w r2, #536870912 ; 0x20000000 - ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T8_CC1; - ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; - ADC_InitStructure.ADC_NbrOfConversion = HW_ADC_NBR_CONV; - - ADC_Init(ADC1, &ADC_InitStructure); - 8010260: a913 add r1, sp, #76 ; 0x4c - 8010262: 487c ldr r0, [pc, #496] ; (8010454 ) - // Channel-specific settings - ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; - ADC_InitStructure.ADC_ScanConvMode = ENABLE; - ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Falling; - ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T8_CC1; - 8010264: 9316 str r3, [sp, #88] ; 0x58 - - // Channel-specific settings - ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; - ADC_InitStructure.ADC_ScanConvMode = ENABLE; - ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Falling; - 8010266: 9215 str r2, [sp, #84] ; 0x54 - ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_1; - ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles; - ADC_CommonInit(&ADC_CommonInitStructure); - - // Channel-specific settings - ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; - 8010268: 9413 str r4, [sp, #76] ; 0x4c - ADC_InitStructure.ADC_ScanConvMode = ENABLE; - 801026a: f88d 5050 strb.w r5, [sp, #80] ; 0x50 - ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; - 801026e: f88d 4051 strb.w r4, [sp, #81] ; 0x51 - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Falling; - ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T8_CC1; - ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; - 8010272: 9417 str r4, [sp, #92] ; 0x5c - ADC_InitStructure.ADC_NbrOfConversion = HW_ADC_NBR_CONV; - 8010274: f88d 9060 strb.w r9, [sp, #96] ; 0x60 - - ADC_Init(ADC1, &ADC_InitStructure); - 8010278: f001 fa0a bl 8011690 - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None; - ADC_InitStructure.ADC_ExternalTrigConv = 0; - ADC_Init(ADC2, &ADC_InitStructure); - 801027c: a913 add r1, sp, #76 ; 0x4c - 801027e: 4876 ldr r0, [pc, #472] ; (8010458 ) - ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T8_CC1; - ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; - ADC_InitStructure.ADC_NbrOfConversion = HW_ADC_NBR_CONV; - - ADC_Init(ADC1, &ADC_InitStructure); - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None; - 8010280: 9415 str r4, [sp, #84] ; 0x54 - ADC_InitStructure.ADC_ExternalTrigConv = 0; - 8010282: 9416 str r4, [sp, #88] ; 0x58 - ADC_Init(ADC2, &ADC_InitStructure); - 8010284: f001 fa04 bl 8011690 - ADC_Init(ADC3, &ADC_InitStructure); - 8010288: a913 add r1, sp, #76 ; 0x4c - 801028a: 4874 ldr r0, [pc, #464] ; (801045c ) - 801028c: f001 fa00 bl 8011690 - - hw_setup_adc_channels(); - 8010290: f001 f966 bl 8011560 - - // Enable DMA request after last transfer (Multi-ADC mode) - ADC_MultiModeDMARequestAfterLastTransferCmd(ENABLE); - 8010294: 4628 mov r0, r5 - 8010296: f001 fa93 bl 80117c0 - - // Injected channels for current measurement at end of cycle - ADC_ExternalTrigInjectedConvConfig(ADC1, ADC_ExternalTrigInjecConv_T8_CC2); - 801029a: 486e ldr r0, [pc, #440] ; (8010454 ) - 801029c: f44f 2140 mov.w r1, #786432 ; 0xc0000 - 80102a0: f001 fad6 bl 8011850 - ADC_ExternalTrigInjectedConvConfig(ADC2, ADC_ExternalTrigInjecConv_T8_CC3); - 80102a4: 486c ldr r0, [pc, #432] ; (8010458 ) - 80102a6: f44f 2150 mov.w r1, #851968 ; 0xd0000 - 80102aa: f001 fad1 bl 8011850 - ADC_ExternalTrigInjectedConvEdgeConfig(ADC1, ADC_ExternalTrigInjecConvEdge_Falling); - 80102ae: 4869 ldr r0, [pc, #420] ; (8010454 ) - 80102b0: f44f 1100 mov.w r1, #2097152 ; 0x200000 - 80102b4: f001 fad4 bl 8011860 - ADC_ExternalTrigInjectedConvEdgeConfig(ADC2, ADC_ExternalTrigInjecConvEdge_Falling); - 80102b8: 4867 ldr r0, [pc, #412] ; (8010458 ) - 80102ba: f44f 1100 mov.w r1, #2097152 ; 0x200000 - 80102be: f001 facf bl 8011860 - ADC_InjectedSequencerLengthConfig(ADC1, 1); - 80102c2: 4629 mov r1, r5 - 80102c4: 4863 ldr r0, [pc, #396] ; (8010454 ) - 80102c6: f001 fabb bl 8011840 - ADC_InjectedSequencerLengthConfig(ADC2, 1); - 80102ca: 4629 mov r1, r5 - 80102cc: 4862 ldr r0, [pc, #392] ; (8010458 ) - 80102ce: f001 fab7 bl 8011840 - - // Interrupt - ADC_ITConfig(ADC1, ADC_IT_JEOC, ENABLE); - 80102d2: f240 4107 movw r1, #1031 ; 0x407 - 80102d6: 462a mov r2, r5 - 80102d8: 485e ldr r0, [pc, #376] ; (8010454 ) - 80102da: f001 fad9 bl 8011890 - NVIC_InitStructure.NVIC_IRQChannel = ADC_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3; - 80102de: 2303 movs r3, #3 - ADC_InjectedSequencerLengthConfig(ADC1, 1); - ADC_InjectedSequencerLengthConfig(ADC2, 1); - - // Interrupt - ADC_ITConfig(ADC1, ADC_IT_JEOC, ENABLE); - NVIC_InitStructure.NVIC_IRQChannel = ADC_IRQn; - 80102e0: 2212 movs r2, #18 - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); - 80102e2: a802 add r0, sp, #8 - ADC_InjectedSequencerLengthConfig(ADC1, 1); - ADC_InjectedSequencerLengthConfig(ADC2, 1); - - // Interrupt - ADC_ITConfig(ADC1, ADC_IT_JEOC, ENABLE); - NVIC_InitStructure.NVIC_IRQChannel = ADC_IRQn; - 80102e4: f88d 2008 strb.w r2, [sp, #8] - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3; - 80102e8: f88d 3009 strb.w r3, [sp, #9] - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; - 80102ec: f88d 300a strb.w r3, [sp, #10] - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - 80102f0: f88d 500b strb.w r5, [sp, #11] - NVIC_Init(&NVIC_InitStructure); - 80102f4: f001 f994 bl 8011620 - - // Enable ADC1 - ADC_Cmd(ADC1, ENABLE); - 80102f8: 4629 mov r1, r5 - 80102fa: 4856 ldr r0, [pc, #344] ; (8010454 ) - 80102fc: f001 fa08 bl 8011710 - - // Enable ADC2 - ADC_Cmd(ADC2, ENABLE); - 8010300: 4629 mov r1, r5 - 8010302: 4855 ldr r0, [pc, #340] ; (8010458 ) - 8010304: f001 fa04 bl 8011710 - - // Enable ADC3 - ADC_Cmd(ADC3, ENABLE); - 8010308: 4629 mov r1, r5 - 801030a: 4854 ldr r0, [pc, #336] ; (801045c ) - 801030c: f001 fa00 bl 8011710 - - // ------------- Timer8 for ADC sampling ------------- // - // Time Base configuration - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE); - 8010310: 4629 mov r1, r5 - 8010312: 2002 movs r0, #2 - 8010314: f001 fc24 bl 8011b60 - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now; - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; - - TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure); - 8010318: 4638 mov r0, r7 - 801031a: eb0d 010a add.w r1, sp, sl - // Time Base configuration - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE); - - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now; - 801031e: f8db 2000 ldr.w r2, [fp] - - // ------------- Timer8 for ADC sampling ------------- // - // Time Base configuration - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE); - - TIM_TimeBaseStructure.TIM_Prescaler = 0; - 8010322: f8ad 400c strh.w r4, [sp, #12] - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - 8010326: f8ad 400e strh.w r4, [sp, #14] - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now; - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - 801032a: f8ad 4014 strh.w r4, [sp, #20] - TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; - 801032e: f88d 4016 strb.w r4, [sp, #22] - // Time Base configuration - RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE); - - TIM_TimeBaseStructure.TIM_Prescaler = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - TIM_TimeBaseStructure.TIM_Period = SYSTEM_CORE_CLOCK / (int)switching_frequency_now; - 8010332: 4b4b ldr r3, [pc, #300] ; (8010460 ) - 8010334: fb93 f3f2 sdiv r3, r3, r2 - 8010338: 9304 str r3, [sp, #16] - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; - - TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure); - 801033a: f001 fd21 bl 8011d80 - - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - 801033e: 2260 movs r2, #96 ; 0x60 - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR; - 8010340: 6af3 ldr r3, [r6, #44] ; 0x2c - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; - - TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure); - - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - 8010342: f8ad 2038 strh.w r2, [sp, #56] ; 0x38 - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set; - TIM_OC1Init(TIM8, &TIM_OCInitStructure); TIM_OC1PreloadConfig(TIM8, TIM_OCPreload_Enable); - 8010346: 4638 mov r0, r7 - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set; - 8010348: f44f 7200 mov.w r2, #512 ; 0x200 - TIM_OC1Init(TIM8, &TIM_OCInitStructure); TIM_OC1PreloadConfig(TIM8, TIM_OCPreload_Enable); - 801034c: a90e add r1, sp, #56 ; 0x38 - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set; - 801034e: f8ad 204a strh.w r2, [sp, #74] ; 0x4a - - TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure); - - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR; - 8010352: 9310 str r3, [sp, #64] ; 0x40 - TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; - - TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure); - - TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; - TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; - 8010354: f8ad 503a strh.w r5, [sp, #58] ; 0x3a - TIM_OCInitStructure.TIM_Pulse = TIM1->ARR; - TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; - 8010358: f8ad 4044 strh.w r4, [sp, #68] ; 0x44 - TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High; - 801035c: f8ad 4046 strh.w r4, [sp, #70] ; 0x46 - TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set; - 8010360: f8ad 8048 strh.w r8, [sp, #72] ; 0x48 - TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set; - TIM_OC1Init(TIM8, &TIM_OCInitStructure); TIM_OC1PreloadConfig(TIM8, TIM_OCPreload_Enable); - 8010364: f001 fd7c bl 8011e60 - 8010368: 4638 mov r0, r7 - 801036a: 2108 movs r1, #8 - 801036c: f001 fe90 bl 8012090 - TIM_OC2Init(TIM8, &TIM_OCInitStructure); TIM_OC2PreloadConfig(TIM8, TIM_OCPreload_Enable); - 8010370: 4638 mov r0, r7 - 8010372: a90e add r1, sp, #56 ; 0x38 - 8010374: f001 fdb4 bl 8011ee0 - 8010378: 4638 mov r0, r7 - 801037a: 2108 movs r1, #8 - 801037c: f001 fe90 bl 80120a0 - TIM_OC3Init(TIM8, &TIM_OCInitStructure); TIM_OC3PreloadConfig(TIM8, TIM_OCPreload_Enable); - 8010380: 4638 mov r0, r7 - 8010382: a90e add r1, sp, #56 ; 0x38 - 8010384: f001 fdfc bl 8011f80 - 8010388: 4638 mov r0, r7 - 801038a: 2108 movs r1, #8 - 801038c: f001 fe98 bl 80120c0 - - TIM_ARRPreloadConfig(TIM8, ENABLE); - 8010390: 4638 mov r0, r7 - 8010392: 4629 mov r1, r5 - 8010394: f001 fd44 bl 8011e20 - TIM_CCPreloadControl(TIM8, ENABLE); - 8010398: 4638 mov r0, r7 - 801039a: 4629 mov r1, r5 - 801039c: f001 fed0 bl 8012140 - - // PWM outputs have to be enabled in order to trigger ADC on CCx - TIM_CtrlPWMOutputs(TIM8, ENABLE); - 80103a0: 4638 mov r0, r7 - 80103a2: 4629 mov r1, r5 - 80103a4: f001 febc bl 8012120 - - // TIM1 Master and TIM8 slave - TIM_SelectOutputTrigger(TIM1, TIM_TRGOSource_Update); - 80103a8: 4630 mov r0, r6 - 80103aa: 2120 movs r1, #32 - 80103ac: f001 fee8 bl 8012180 - TIM_SelectMasterSlaveMode(TIM1, TIM_MasterSlaveMode_Enable); - 80103b0: 4630 mov r0, r6 - 80103b2: 2180 movs r1, #128 ; 0x80 - 80103b4: f001 ff04 bl 80121c0 - TIM_SelectInputTrigger(TIM8, TIM_TS_ITR0); - 80103b8: 4638 mov r0, r7 - 80103ba: 4621 mov r1, r4 - 80103bc: f001 fed8 bl 8012170 - TIM_SelectSlaveMode(TIM8, TIM_SlaveMode_Reset); - 80103c0: 4638 mov r0, r7 - 80103c2: 4649 mov r1, r9 - 80103c4: f001 feec bl 80121a0 - - // Enable TIM8 - TIM_Cmd(TIM8, ENABLE); - 80103c8: 4638 mov r0, r7 - 80103ca: 4629 mov r1, r5 - 80103cc: f001 fd38 bl 8011e40 - - // Enable TIM1 - TIM_Cmd(TIM1, ENABLE); - 80103d0: 4630 mov r0, r6 - 80103d2: 4629 mov r1, r5 - 80103d4: f001 fd34 bl 8011e40 - - // Main Output Enable - TIM_CtrlPWMOutputs(TIM1, ENABLE); - 80103d8: 4630 mov r0, r6 - 80103da: 4629 mov r1, r5 - 80103dc: f001 fea0 bl 8012120 - - // 32-bit timer for RPM measurement - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); - 80103e0: 4628 mov r0, r5 - 80103e2: 4629 mov r1, r5 - 80103e4: f001 fbac bl 8011b40 - uint16_t PrescalerValue = (uint16_t) ((SYSTEM_CORE_CLOCK / 2) / MCPWM_RPM_TIMER_FREQ) - 1; - - // Time base configuration - TIM_TimeBaseStructure.TIM_Period = 0xFFFFFFFF; - 80103e8: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff - TIM_TimeBaseStructure.TIM_Prescaler = PrescalerValue; - 80103ec: 2353 movs r3, #83 ; 0x53 - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure); - 80103ee: eb0d 010a add.w r1, sp, sl - 80103f2: f04f 4080 mov.w r0, #1073741824 ; 0x40000000 - // 32-bit timer for RPM measurement - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); - uint16_t PrescalerValue = (uint16_t) ((SYSTEM_CORE_CLOCK / 2) / MCPWM_RPM_TIMER_FREQ) - 1; - - // Time base configuration - TIM_TimeBaseStructure.TIM_Period = 0xFFFFFFFF; - 80103f6: 9204 str r2, [sp, #16] - TIM_TimeBaseStructure.TIM_Prescaler = PrescalerValue; - 80103f8: f8ad 300c strh.w r3, [sp, #12] - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - 80103fc: f8ad 4014 strh.w r4, [sp, #20] - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - 8010400: f8ad 400e strh.w r4, [sp, #14] - TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure); - 8010404: f001 fcbc bl 8011d80 - - // TIM2 enable counter - TIM_Cmd(TIM2, ENABLE); - 8010408: 4629 mov r1, r5 - 801040a: f04f 4080 mov.w r0, #1073741824 ; 0x40000000 - 801040e: f001 fd17 bl 8011e40 - - - // ADC sampling locations - //stop_pwm_hw(); - utils_sys_lock_cnt(); - 8010412: f000 fcc5 bl 8010da0 - - // Disable preload register updates - TIM1->CR1 |= TIM_CR1_UDIS; - 8010416: 6833 ldr r3, [r6, #0] - 8010418: f043 0302 orr.w r3, r3, #2 - 801041c: 6033 str r3, [r6, #0] - TIM8->CR1 |= TIM_CR1_UDIS; - 801041e: 683b ldr r3, [r7, #0] - - TIM8->CCR1 = 500;//for vdc - 8010420: f44f 72fa mov.w r2, #500 ; 0x1f4 - //stop_pwm_hw(); - utils_sys_lock_cnt(); - - // Disable preload register updates - TIM1->CR1 |= TIM_CR1_UDIS; - TIM8->CR1 |= TIM_CR1_UDIS; - 8010424: f043 0302 orr.w r3, r3, #2 - 8010428: 603b str r3, [r7, #0] - - TIM8->CCR1 = 500;//for vdc - 801042a: 637a str r2, [r7, #52] ; 0x34 - 801042c: e020 b.n 8010470 - 801042e: bf00 nop - 8010430: 20002a20 .word 0x20002a20 - 8010434: 40010000 .word 0x40010000 - 8010438: 40010400 .word 0x40010400 - 801043c: 20002900 .word 0x20002900 - 8010440: 0501bd00 .word 0x0501bd00 - 8010444: 00400005 .word 0x00400005 - 8010448: 0800ff31 .word 0x0800ff31 - 801044c: 08013290 .word 0x08013290 - 8010450: 40026470 .word 0x40026470 - 8010454: 40012000 .word 0x40012000 - 8010458: 40012100 .word 0x40012100 - 801045c: 40012200 .word 0x40012200 - 8010460: 0a037a00 .word 0x0a037a00 - 8010464: 20000808 .word 0x20000808 - 8010468: 20001ec4 .word 0x20001ec4 - 801046c: 40012308 .word 0x40012308 - TIM8->CCR2 = TIM1->ARR;//for Ib - 8010470: 6af3 ldr r3, [r6, #44] ; 0x2c - 8010472: 63bb str r3, [r7, #56] ; 0x38 - TIM8->CCR3 = TIM1->ARR;//for Ia - 8010474: 6af3 ldr r3, [r6, #44] ; 0x2c - 8010476: 63fb str r3, [r7, #60] ; 0x3c - - // Enables preload register updates - TIM1->CR1 &= ~TIM_CR1_UDIS; - 8010478: 6833 ldr r3, [r6, #0] - 801047a: f023 0302 bic.w r3, r3, #2 - 801047e: 6033 str r3, [r6, #0] - TIM8->CR1 &= ~TIM_CR1_UDIS; - 8010480: 683b ldr r3, [r7, #0] - 8010482: f023 0302 bic.w r3, r3, #2 - 8010486: 603b str r3, [r7, #0] - - utils_sys_unlock_cnt(); - 8010488: f000 fc9a bl 8010dc0 - - - // Calibrate current offset - ENABLE_GATE(); - 801048c: 4b31 ldr r3, [pc, #196] ; (8010554 ) -static volatile int curr_start_samples; -static volatile int curr0_offset; -static volatile int curr1_offset; -static void do_dc_cal(void) { - DCCAL_ON(); - while(IS_DRV_FAULT()){}; - 801048e: 4a32 ldr r2, [pc, #200] ; (8010558 ) - utils_sys_unlock_cnt(); - - - // Calibrate current offset - ENABLE_GATE(); - DCCAL_OFF(); - 8010490: 2180 movs r1, #128 ; 0x80 - - utils_sys_unlock_cnt(); - - - // Calibrate current offset - ENABLE_GATE(); - 8010492: 2040 movs r0, #64 ; 0x40 - 8010494: 8318 strh r0, [r3, #24] - DCCAL_OFF(); - 8010496: 8359 strh r1, [r3, #26] - GAIN_FULLDN(); - 8010498: f8a3 801a strh.w r8, [r3, #26] -static volatile int curr1_sum; -static volatile int curr_start_samples; -static volatile int curr0_offset; -static volatile int curr1_offset; -static void do_dc_cal(void) { - DCCAL_ON(); - 801049c: 8319 strh r1, [r3, #24] - while(IS_DRV_FAULT()){}; - 801049e: 6913 ldr r3, [r2, #16] - 80104a0: 04db lsls r3, r3, #19 - 80104a2: d5fc bpl.n 801049e - chThdSleepMilliseconds(1000); - 80104a4: f242 7010 movw r0, #10000 ; 0x2710 - 80104a8: f7fc fdfa bl 800d0a0 - curr0_sum = 0; - 80104ac: 4c2b ldr r4, [pc, #172] ; (801055c ) - curr1_sum = 0; - 80104ae: 482c ldr r0, [pc, #176] ; (8010560 ) - curr_start_samples = 0; - 80104b0: 492c ldr r1, [pc, #176] ; (8010564 ) -static volatile int curr1_offset; -static void do_dc_cal(void) { - DCCAL_ON(); - while(IS_DRV_FAULT()){}; - chThdSleepMilliseconds(1000); - curr0_sum = 0; - 80104b2: 2300 movs r3, #0 - 80104b4: 6023 str r3, [r4, #0] - curr1_sum = 0; - 80104b6: 6003 str r3, [r0, #0] - curr_start_samples = 0; - 80104b8: 600b str r3, [r1, #0] - while(curr_start_samples < 4000) {}; - 80104ba: 680b ldr r3, [r1, #0] - 80104bc: 4a29 ldr r2, [pc, #164] ; (8010564 ) - 80104be: f5b3 6f7a cmp.w r3, #4000 ; 0xfa0 - 80104c2: dbfa blt.n 80104ba - curr0_offset = curr0_sum / curr_start_samples; - 80104c4: 4928 ldr r1, [pc, #160] ; (8010568 ) - curr1_offset = curr1_sum / curr_start_samples; - 80104c6: 4f29 ldr r7, [pc, #164] ; (801056c ) - chThdSleepMilliseconds(1000); - curr0_sum = 0; - curr1_sum = 0; - curr_start_samples = 0; - while(curr_start_samples < 4000) {}; - curr0_offset = curr0_sum / curr_start_samples; - 80104c8: 6823 ldr r3, [r4, #0] - curr1_offset = curr1_sum / curr_start_samples; - DCCAL_OFF(); - 80104ca: 4e22 ldr r6, [pc, #136] ; (8010554 ) - chThdSleepMilliseconds(1000); - curr0_sum = 0; - curr1_sum = 0; - curr_start_samples = 0; - while(curr_start_samples < 4000) {}; - curr0_offset = curr0_sum / curr_start_samples; - 80104cc: 6814 ldr r4, [r2, #0] - 80104ce: fb93 f3f4 sdiv r3, r3, r4 - 80104d2: 600b str r3, [r1, #0] - curr1_offset = curr1_sum / curr_start_samples; - 80104d4: 6803 ldr r3, [r0, #0] - 80104d6: 6812 ldr r2, [r2, #0] - 80104d8: fb93 f3f2 sdiv r3, r3, r2 - DCCAL_OFF(); - dccal_done = true; - 80104dc: 2501 movs r5, #1 - curr0_sum = 0; - curr1_sum = 0; - curr_start_samples = 0; - while(curr_start_samples < 4000) {}; - curr0_offset = curr0_sum / curr_start_samples; - curr1_offset = curr1_sum / curr_start_samples; - 80104de: 603b str r3, [r7, #0] - DCCAL_OFF(); - 80104e0: 2480 movs r4, #128 ; 0x80 - dccal_done = true; - 80104e2: 4b23 ldr r3, [pc, #140] ; (8010570 ) - curr1_sum = 0; - curr_start_samples = 0; - while(curr_start_samples < 4000) {}; - curr0_offset = curr0_sum / curr_start_samples; - curr1_offset = curr1_sum / curr_start_samples; - DCCAL_OFF(); - 80104e4: 8374 strh r4, [r6, #26] - GAIN_FULLDN(); - do_dc_cal(); - - - // Various time measurements - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM12, ENABLE); - 80104e6: 4629 mov r1, r5 - 80104e8: 2040 movs r0, #64 ; 0x40 - PrescalerValue = (uint16_t) ((SYSTEM_CORE_CLOCK / 2) / 10000000) - 1; - - // Time base configuration - TIM_TimeBaseStructure.TIM_Period = 0xFFFFFFFF; - TIM_TimeBaseStructure.TIM_Prescaler = PrescalerValue; - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - 80104ea: 2400 movs r4, #0 - curr_start_samples = 0; - while(curr_start_samples < 4000) {}; - curr0_offset = curr0_sum / curr_start_samples; - curr1_offset = curr1_sum / curr_start_samples; - DCCAL_OFF(); - dccal_done = true; - 80104ec: 701d strb r5, [r3, #0] - GAIN_FULLDN(); - do_dc_cal(); - - - // Various time measurements - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM12, ENABLE); - 80104ee: f001 fb27 bl 8011b40 - PrescalerValue = (uint16_t) ((SYSTEM_CORE_CLOCK / 2) / 10000000) - 1; - - // Time base configuration - TIM_TimeBaseStructure.TIM_Period = 0xFFFFFFFF; - 80104f2: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff - TIM_TimeBaseStructure.TIM_Prescaler = PrescalerValue; - 80104f6: 2307 movs r3, #7 - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - TIM_TimeBaseInit(TIM12, &TIM_TimeBaseStructure); - 80104f8: a903 add r1, sp, #12 - 80104fa: 481e ldr r0, [pc, #120] ; (8010574 ) - // Various time measurements - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM12, ENABLE); - PrescalerValue = (uint16_t) ((SYSTEM_CORE_CLOCK / 2) / 10000000) - 1; - - // Time base configuration - TIM_TimeBaseStructure.TIM_Period = 0xFFFFFFFF; - 80104fc: 9204 str r2, [sp, #16] - TIM_TimeBaseStructure.TIM_Prescaler = PrescalerValue; - 80104fe: f8ad 300c strh.w r3, [sp, #12] - TIM_TimeBaseStructure.TIM_ClockDivision = 0; - 8010502: f8ad 4014 strh.w r4, [sp, #20] - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - 8010506: f8ad 400e strh.w r4, [sp, #14] - TIM_TimeBaseInit(TIM12, &TIM_TimeBaseStructure); - 801050a: f001 fc39 bl 8011d80 - - // TIM3 enable counter - TIM_Cmd(TIM12, ENABLE); - 801050e: 4629 mov r1, r5 - 8010510: 4818 ldr r0, [pc, #96] ; (8010574 ) - 8010512: f001 fc95 bl 8011e40 - - // Start threads - chThdCreateStatic(SEQUENCE_thread_wa, sizeof(SEQUENCE_thread_wa), NORMALPRIO, SEQUENCE_thread, NULL); - 8010516: 4b18 ldr r3, [pc, #96] ; (8010578 ) - 8010518: 9400 str r4, [sp, #0] - 801051a: 2240 movs r2, #64 ; 0x40 - 801051c: f640 1198 movw r1, #2456 ; 0x998 - 8010520: 4816 ldr r0, [pc, #88] ; (801057c ) - 8010522: f7fc fd7d bl 800d020 - ////chThdCreateStatic(rpm_thread_wa, sizeof(rpm_thread_wa), NORMALPRIO, rpm_thread, NULL); - - // WWDG configuration - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE); - 8010526: 4629 mov r1, r5 - 8010528: f44f 6000 mov.w r0, #2048 ; 0x800 - 801052c: f001 fb08 bl 8011b40 - WWDG_SetPrescaler(WWDG_Prescaler_1); - 8010530: 4620 mov r0, r4 - 8010532: f001 fe55 bl 80121e0 - WWDG_SetWindowValue(255); - 8010536: 20ff movs r0, #255 ; 0xff - 8010538: f001 fe62 bl 8012200 - WWDG_Enable(100); - 801053c: 2064 movs r0, #100 ; 0x64 - 801053e: f001 fe7f bl 8012240 - - -//--------------------------------------------------------------------------- - - - SetupControlParameters(); - 8010542: f7ff fd6d bl 8010020 - - - uGF.Word = 0; // clear flags - 8010546: 4b0e ldr r3, [pc, #56] ; (8010580 ) - - #ifdef ENVOLTRIPPLE - uGF.bit.EnVoltRipCo = 1; - #endif - - uGF.bit.RunMotor = 1; - 8010548: 2202 movs r2, #2 - - - SetupControlParameters(); - - - uGF.Word = 0; // clear flags - 801054a: 801c strh r4, [r3, #0] - - #ifdef ENVOLTRIPPLE - uGF.bit.EnVoltRipCo = 1; - #endif - - uGF.bit.RunMotor = 1; - 801054c: 701a strb r2, [r3, #0] - -} - 801054e: b029 add sp, #164 ; 0xa4 - 8010550: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 8010554: 40020800 .word 0x40020800 - 8010558: 40020400 .word 0x40020400 - 801055c: 20002a18 .word 0x20002a18 - 8010560: 20001f0c .word 0x20001f0c - 8010564: 200028f8 .word 0x200028f8 - 8010568: 20001ec0 .word 0x20001ec0 - 801056c: 20002a14 .word 0x20002a14 - 8010570: 20002900 .word 0x20002900 - 8010574: 40001800 .word 0x40001800 - 8010578: 0800ff11 .word 0x0800ff11 - 801057c: 20001f38 .word 0x20001f38 - 8010580: 200028f4 .word 0x200028f4 - 8010584: f3af 8000 nop.w - 8010588: f3af 8000 nop.w - 801058c: f3af 8000 nop.w - -08010590 : - // CompVdq = ------------- * Vdq - // DCbus - // - // If target and measured are equal, no operation is made. - // - if (TargetDCbus > DCbus) - 8010590: 4a14 ldr r2, [pc, #80] ; (80105e4 ) - 8010592: 4b15 ldr r3, [pc, #84] ; (80105e8 ) - 8010594: ed92 7a00 vldr s14, [r2] - 8010598: edd3 7a00 vldr s15, [r3] - 801059c: eeb4 7ae7 vcmpe.f32 s14, s15 - 80105a0: eef1 fa10 vmrs APSR_nzcv, fpscr - 80105a4: dc11 bgt.n 80105ca - CompVdq = Vdq + (((TargetDCbus - DCbus)/ DCbus)* Vdq); - else if (DCbus > TargetDCbus) - 80105a6: ed93 7a00 vldr s14, [r3] - 80105aa: edd2 7a00 vldr s15, [r2] - 80105ae: eeb4 7ae7 vcmpe.f32 s14, s15 - 80105b2: eef1 fa10 vmrs APSR_nzcv, fpscr - 80105b6: dd07 ble.n 80105c8 - CompVdq = ((TargetDCbus/ DCbus)* Vdq); - 80105b8: edd2 7a00 vldr s15, [r2] - 80105bc: ed93 7a00 vldr s14, [r3] - 80105c0: eec7 7a87 vdiv.f32 s15, s15, s14 - 80105c4: ee20 0a27 vmul.f32 s0, s0, s15 - else - CompVdq = Vdq; - - return CompVdq; -} - 80105c8: 4770 bx lr - // DCbus - // - // If target and measured are equal, no operation is made. - // - if (TargetDCbus > DCbus) - CompVdq = Vdq + (((TargetDCbus - DCbus)/ DCbus)* Vdq); - 80105ca: ed92 7a00 vldr s14, [r2] - 80105ce: edd3 7a00 vldr s15, [r3] - 80105d2: edd3 6a00 vldr s13, [r3] - 80105d6: ee77 7a67 vsub.f32 s15, s14, s15 - 80105da: eec7 7aa6 vdiv.f32 s15, s15, s13 - 80105de: eea7 0a80 vfma.f32 s0, s15, s0 - 80105e2: 4770 bx lr - 80105e4: 2000293c .word 0x2000293c - 80105e8: 20002938 .word 0x20002938 - 80105ec: f3af 8000 nop.w - -080105f0 : - - } - else - // Closed Loop Vector Control - { - if(AccumThetaCnt == 0) - 80105f0: 4b37 ldr r3, [pc, #220] ; (80106d0 ) - 80105f2: 881b ldrh r3, [r3, #0] - return; -} -//--------------------------------------------------------------------- -// Executes one PI itteration for each of the three loops Id,Iq,Speed, - -void DoControl( void ) - 80105f4: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - // Closed Loop Vector Control - { - if(AccumThetaCnt == 0) - { - // Execute the velocity control loop - PIParmW.qInMeas = smc1.Omega; - 80105f8: f8df 80fc ldr.w r8, [pc, #252] ; 80106f8 - - } - else - // Closed Loop Vector Control - { - if(AccumThetaCnt == 0) - 80105fc: 2b00 cmp r3, #0 - 80105fe: d055 beq.n 80106ac - 8010600: 4f34 ldr r7, [pc, #208] ; (80106d4 ) - PIParmW.qInRef = -0.01f;//CtrlParm.qVelRef; - CalcPI(&PIParmW); - CtrlParm.qVqRef = PIParmW.qOut; - } - - if (uGF.bit.EnTorqueMod) - 8010602: 4d35 ldr r5, [pc, #212] ; (80106d8 ) - CtrlParm.qVqRef = CtrlParm.qVelRef; - - //CtrlParm.qVdRef = FieldWeakening(fabsf(CtrlParm.qVelRef)); - - // PI control for D - PIParmD.qInMeas = ParkParm.qId; - 8010604: 4c35 ldr r4, [pc, #212] ; (80106dc ) - PIParmW.qInRef = -0.01f;//CtrlParm.qVelRef; - CalcPI(&PIParmW); - CtrlParm.qVqRef = PIParmW.qOut; - } - - if (uGF.bit.EnTorqueMod) - 8010606: 782b ldrb r3, [r5, #0] - CtrlParm.qVqRef = CtrlParm.qVelRef; - - //CtrlParm.qVdRef = FieldWeakening(fabsf(CtrlParm.qVelRef)); - - // PI control for D - PIParmD.qInMeas = ParkParm.qId; - 8010608: 4e35 ldr r6, [pc, #212] ; (80106e0 ) - PIParmW.qInRef = -0.01f;//CtrlParm.qVelRef; - CalcPI(&PIParmW); - CtrlParm.qVqRef = PIParmW.qOut; - } - - if (uGF.bit.EnTorqueMod) - 801060a: 0759 lsls r1, r3, #29 - CtrlParm.qVqRef = CtrlParm.qVelRef; - 801060c: bf44 itt mi - 801060e: 683b ldrmi r3, [r7, #0] - 8010610: 60bb strmi r3, [r7, #8] - - //CtrlParm.qVdRef = FieldWeakening(fabsf(CtrlParm.qVelRef)); - - // PI control for D - PIParmD.qInMeas = ParkParm.qId; - 8010612: 69f2 ldr r2, [r6, #28] - 8010614: 61e2 str r2, [r4, #28] - PIParmD.qInRef = 0.0f;//CtrlParm.qVdRef; - 8010616: 2300 movs r3, #0 - CalcPI(&PIParmD); - 8010618: 4620 mov r0, r4 - - //CtrlParm.qVdRef = FieldWeakening(fabsf(CtrlParm.qVelRef)); - - // PI control for D - PIParmD.qInMeas = ParkParm.qId; - PIParmD.qInRef = 0.0f;//CtrlParm.qVdRef; - 801061a: 61a3 str r3, [r4, #24] - CalcPI(&PIParmD); - 801061c: f7ff fcd0 bl 800ffc0 - - if(uGF.bit.EnVoltRipCo) - 8010620: 782b ldrb r3, [r5, #0] - ParkParm.qVd = VoltRippleComp(PIParmD.qOut); - 8010622: ed94 0a08 vldr s0, [r4, #32] - // PI control for D - PIParmD.qInMeas = ParkParm.qId; - PIParmD.qInRef = 0.0f;//CtrlParm.qVdRef; - CalcPI(&PIParmD); - - if(uGF.bit.EnVoltRipCo) - 8010626: 071a lsls r2, r3, #28 - 8010628: d43b bmi.n 80106a2 - ParkParm.qVd = VoltRippleComp(PIParmD.qOut); - else - ParkParm.qVd = PIParmD.qOut; - 801062a: ed86 0a09 vstr s0, [r6, #36] ; 0x24 - - qVdSquared = ParkParm.qVd * ParkParm.qVd; - 801062e: ee20 0a00 vmul.f32 s0, s0, s0 - 8010632: 4b2c ldr r3, [pc, #176] ; (80106e4 ) - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - 8010634: eddf 7a2c vldr s15, [pc, #176] ; 80106e8 - if(uGF.bit.EnVoltRipCo) - ParkParm.qVd = VoltRippleComp(PIParmD.qOut); - else - ParkParm.qVd = PIParmD.qOut; - - qVdSquared = ParkParm.qVd * ParkParm.qVd; - 8010638: ed83 0a00 vstr s0, [r3] - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - 801063c: ed93 0a00 vldr s0, [r3] - 8010640: ee37 0ac0 vsub.f32 s0, s15, s0 - 8010644: eef1 7ac0 vsqrt.f32 s15, s0 - 8010648: eef4 7a67 vcmp.f32 s15, s15 - 801064c: eef1 fa10 vmrs APSR_nzcv, fpscr - 8010650: d139 bne.n 80106c6 - 8010652: 4c26 ldr r4, [pc, #152] ; (80106ec ) - PIParmQ.qOutMin = -PIParmQ.qOutMax; - - // PI control for Q - PIParmQ.qInMeas = ParkParm.qIq; - 8010654: 6a32 ldr r2, [r6, #32] - PIParmQ.qInRef = CtrlParm.qVqRef; - 8010656: 68bb ldr r3, [r7, #8] - 8010658: 61a3 str r3, [r4, #24] - else - ParkParm.qVd = PIParmD.qOut; - - qVdSquared = ParkParm.qVd * ParkParm.qVd; - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - PIParmQ.qOutMin = -PIParmQ.qOutMax; - 801065a: eeb1 7a67 vneg.f32 s14, s15 - - // PI control for Q - PIParmQ.qInMeas = ParkParm.qIq; - PIParmQ.qInRef = CtrlParm.qVqRef; - CalcPI(&PIParmQ); - 801065e: 4620 mov r0, r4 - qVdSquared = ParkParm.qVd * ParkParm.qVd; - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - PIParmQ.qOutMin = -PIParmQ.qOutMax; - - // PI control for Q - PIParmQ.qInMeas = ParkParm.qIq; - 8010660: 61e2 str r2, [r4, #28] - ParkParm.qVd = VoltRippleComp(PIParmD.qOut); - else - ParkParm.qVd = PIParmD.qOut; - - qVdSquared = ParkParm.qVd * ParkParm.qVd; - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - 8010662: edc4 7a04 vstr s15, [r4, #16] - PIParmQ.qOutMin = -PIParmQ.qOutMax; - 8010666: ed84 7a05 vstr s14, [r4, #20] - - // PI control for Q - PIParmQ.qInMeas = ParkParm.qIq; - PIParmQ.qInRef = CtrlParm.qVqRef; - CalcPI(&PIParmQ); - 801066a: f7ff fca9 bl 800ffc0 - - // If voltage ripple compensation flag is set, adjust the output - // of the Q controller depending on measured DC Bus voltage - if(uGF.bit.EnVoltRipCo) - 801066e: 782b ldrb r3, [r5, #0] - qVdSquared = ParkParm.qVd * ParkParm.qVd; - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - PIParmQ.qOutMin = -PIParmQ.qOutMax; - - // PI control for Q - PIParmQ.qInMeas = ParkParm.qIq; - 8010670: 4e1b ldr r6, [pc, #108] ; (80106e0 ) - PIParmQ.qInRef = CtrlParm.qVqRef; - CalcPI(&PIParmQ); - - // If voltage ripple compensation flag is set, adjust the output - // of the Q controller depending on measured DC Bus voltage - if(uGF.bit.EnVoltRipCo) - 8010672: 071b lsls r3, r3, #28 - 8010674: d40e bmi.n 8010694 - ParkParm.qVq = VoltRippleComp(PIParmQ.qOut); - else - ParkParm.qVq = PIParmQ.qOut; - 8010676: 6a23 ldr r3, [r4, #32] - 8010678: 62b3 str r3, [r6, #40] ; 0x28 - - // Limit, if motor is stalled, stop motor commutation - if (smc1.OmegaFltred < 0) - 801067a: edd8 7a18 vldr s15, [r8, #96] ; 0x60 - 801067e: eef5 7ac0 vcmpe.f32 s15, #0.0 - 8010682: eef1 fa10 vmrs APSR_nzcv, fpscr - 8010686: d503 bpl.n 8010690 - { - uGF.bit.RunMotor = 0; - 8010688: 782b ldrb r3, [r5, #0] - 801068a: f36f 0341 bfc r3, #1, #1 - 801068e: 702b strb r3, [r5, #0] - 8010690: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - CalcPI(&PIParmQ); - - // If voltage ripple compensation flag is set, adjust the output - // of the Q controller depending on measured DC Bus voltage - if(uGF.bit.EnVoltRipCo) - ParkParm.qVq = VoltRippleComp(PIParmQ.qOut); - 8010694: ed94 0a08 vldr s0, [r4, #32] - 8010698: f7ff ff7a bl 8010590 - 801069c: ed86 0a0a vstr s0, [r6, #40] ; 0x28 - 80106a0: e7eb b.n 801067a - PIParmD.qInMeas = ParkParm.qId; - PIParmD.qInRef = 0.0f;//CtrlParm.qVdRef; - CalcPI(&PIParmD); - - if(uGF.bit.EnVoltRipCo) - ParkParm.qVd = VoltRippleComp(PIParmD.qOut); - 80106a2: f7ff ff75 bl 8010590 - 80106a6: ed86 0a09 vstr s0, [r6, #36] ; 0x24 - 80106aa: e7c0 b.n 801062e - // Closed Loop Vector Control - { - if(AccumThetaCnt == 0) - { - // Execute the velocity control loop - PIParmW.qInMeas = smc1.Omega; - 80106ac: 4c10 ldr r4, [pc, #64] ; (80106f0 ) - PIParmW.qInRef = -0.01f;//CtrlParm.qVelRef; - 80106ae: 4b11 ldr r3, [pc, #68] ; (80106f4 ) - // Closed Loop Vector Control - { - if(AccumThetaCnt == 0) - { - // Execute the velocity control loop - PIParmW.qInMeas = smc1.Omega; - 80106b0: f8d8 205c ldr.w r2, [r8, #92] ; 0x5c - PIParmW.qInRef = -0.01f;//CtrlParm.qVelRef; - CalcPI(&PIParmW); - CtrlParm.qVqRef = PIParmW.qOut; - 80106b4: 4f07 ldr r7, [pc, #28] ; (80106d4 ) - { - if(AccumThetaCnt == 0) - { - // Execute the velocity control loop - PIParmW.qInMeas = smc1.Omega; - PIParmW.qInRef = -0.01f;//CtrlParm.qVelRef; - 80106b6: 61a3 str r3, [r4, #24] - CalcPI(&PIParmW); - 80106b8: 4620 mov r0, r4 - // Closed Loop Vector Control - { - if(AccumThetaCnt == 0) - { - // Execute the velocity control loop - PIParmW.qInMeas = smc1.Omega; - 80106ba: 61e2 str r2, [r4, #28] - PIParmW.qInRef = -0.01f;//CtrlParm.qVelRef; - CalcPI(&PIParmW); - 80106bc: f7ff fc80 bl 800ffc0 - CtrlParm.qVqRef = PIParmW.qOut; - 80106c0: 6a23 ldr r3, [r4, #32] - 80106c2: 60bb str r3, [r7, #8] - 80106c4: e79d b.n 8010602 - ParkParm.qVd = VoltRippleComp(PIParmD.qOut); - else - ParkParm.qVd = PIParmD.qOut; - - qVdSquared = ParkParm.qVd * ParkParm.qVd; - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - 80106c6: f001 fe4b bl 8012360 - 80106ca: eef0 7a40 vmov.f32 s15, s0 - 80106ce: e7c0 b.n 8010652 - 80106d0: 20002940 .word 0x20002940 - 80106d4: 20001edc .word 0x20001edc - 80106d8: 200028f4 .word 0x200028f4 - 80106dc: 20001ee8 .word 0x20001ee8 - 80106e0: 200029ac .word 0x200029ac - 80106e4: 20002934 .word 0x20002934 - 80106e8: 3f670a3d .word 0x3f670a3d - 80106ec: 200028d0 .word 0x200028d0 - 80106f0: 20001f10 .word 0x20001f10 - 80106f4: bc23d70a .word 0xbc23d70a - 80106f8: 20002948 .word 0x20002948 - 80106fc: f3af 8000 nop.w - -08010700 : - MeasCurrParm.Offseta = Offset_a; - MeasCurrParm.Offsetb = Offset_b; - return; -} -void InvPark(void) -{ - 8010700: b510 push {r4, lr} - ParkParm.qValpha = ParkParm.qVd*cosf(ParkParm.qAngle) - ParkParm.qVq*sinf(ParkParm.qAngle); - 8010702: 4c11 ldr r4, [pc, #68] ; (8010748 ) - MeasCurrParm.Offseta = Offset_a; - MeasCurrParm.Offsetb = Offset_b; - return; -} -void InvPark(void) -{ - 8010704: ed2d 8b04 vpush {d8-d9} - ParkParm.qValpha = ParkParm.qVd*cosf(ParkParm.qAngle) - ParkParm.qVq*sinf(ParkParm.qAngle); - 8010708: ed94 9a00 vldr s18, [r4] - 801070c: ed94 8a09 vldr s16, [r4, #36] ; 0x24 - 8010710: eeb0 0a49 vmov.f32 s0, s18 - 8010714: f001 fda4 bl 8012260 - 8010718: eef0 8a40 vmov.f32 s17, s0 - 801071c: eeb0 0a49 vmov.f32 s0, s18 - 8010720: f001 fdde bl 80122e0 - 8010724: edd4 7a0a vldr s15, [r4, #40] ; 0x28 - 8010728: ee20 7a67 vnmul.f32 s14, s0, s15 - ParkParm.qVbeta = ParkParm.qVd*sinf(ParkParm.qAngle) + ParkParm.qVq*cosf(ParkParm.qAngle); - 801072c: ee68 7aa7 vmul.f32 s15, s17, s15 - MeasCurrParm.Offsetb = Offset_b; - return; -} -void InvPark(void) -{ - ParkParm.qValpha = ParkParm.qVd*cosf(ParkParm.qAngle) - ParkParm.qVq*sinf(ParkParm.qAngle); - 8010730: eea8 7a28 vfma.f32 s14, s16, s17 - ParkParm.qVbeta = ParkParm.qVd*sinf(ParkParm.qAngle) + ParkParm.qVq*cosf(ParkParm.qAngle); - 8010734: eee8 7a00 vfma.f32 s15, s16, s0 - return; -} - 8010738: ecbd 8b04 vpop {d8-d9} - MeasCurrParm.Offsetb = Offset_b; - return; -} -void InvPark(void) -{ - ParkParm.qValpha = ParkParm.qVd*cosf(ParkParm.qAngle) - ParkParm.qVq*sinf(ParkParm.qAngle); - 801073c: ed84 7a0b vstr s14, [r4, #44] ; 0x2c - ParkParm.qVbeta = ParkParm.qVd*sinf(ParkParm.qAngle) + ParkParm.qVq*cosf(ParkParm.qAngle); - 8010740: edc4 7a0c vstr s15, [r4, #48] ; 0x30 - return; -} - 8010744: bd10 pop {r4, pc} - 8010746: bf00 nop - 8010748: 200029ac .word 0x200029ac - 801074c: f3af 8000 nop.w - -08010750 : - - return; -} -void CalcTimes(void) -{ - SVGenParm.iPWMPeriod = LOOPINTCY; - 8010750: 4b18 ldr r3, [pc, #96] ; (80107b4 ) - 8010752: 4a19 ldr r2, [pc, #100] ; (80107b8 ) - 8010754: 6adb ldr r3, [r3, #44] ; 0x2c - - SVGenParm.T1 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T1); - 8010756: ed92 7a04 vldr s14, [r2, #16] - SVGenParm.T2 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T2); - 801075a: edd2 6a05 vldr s13, [r2, #20] - - return; -} -void CalcTimes(void) -{ - SVGenParm.iPWMPeriod = LOOPINTCY; - 801075e: 6013 str r3, [r2, #0] - - SVGenParm.T1 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T1); - 8010760: ee07 3a90 vmov s15, r3 - 8010764: eef8 7a67 vcvt.f32.u32 s15, s15 - SVGenParm.T2 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T2); - SVGenParm.Tc = (((float)SVGenParm.iPWMPeriod-SVGenParm.T1-SVGenParm.T2)/2); - 8010768: eeb6 6a00 vmov.f32 s12, #96 ; 0x60 -} -void CalcTimes(void) -{ - SVGenParm.iPWMPeriod = LOOPINTCY; - - SVGenParm.T1 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T1); - 801076c: ee27 7a87 vmul.f32 s14, s15, s14 - SVGenParm.T2 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T2); - 8010770: ee67 6aa6 vmul.f32 s13, s15, s13 - SVGenParm.Tc = (((float)SVGenParm.iPWMPeriod-SVGenParm.T1-SVGenParm.T2)/2); - 8010774: ee77 7ac7 vsub.f32 s15, s15, s14 -} -void CalcTimes(void) -{ - SVGenParm.iPWMPeriod = LOOPINTCY; - - SVGenParm.T1 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T1); - 8010778: ed82 7a04 vstr s14, [r2, #16] - SVGenParm.T2 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T2); - SVGenParm.Tc = (((float)SVGenParm.iPWMPeriod-SVGenParm.T1-SVGenParm.T2)/2); - 801077c: ee77 7ae6 vsub.f32 s15, s15, s13 -void CalcTimes(void) -{ - SVGenParm.iPWMPeriod = LOOPINTCY; - - SVGenParm.T1 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T1); - SVGenParm.T2 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T2); - 8010780: edc2 6a05 vstr s13, [r2, #20] - SVGenParm.Tc = (((float)SVGenParm.iPWMPeriod-SVGenParm.T1-SVGenParm.T2)/2); - 8010784: ee67 7a86 vmul.f32 s15, s15, s12 - 8010788: eefc 7ae7 vcvt.u32.f32 s15, s15 - SVGenParm.Tb = SVGenParm.Tc + SVGenParm.T1; - 801078c: eeb8 6a67 vcvt.f32.u32 s12, s15 -{ - SVGenParm.iPWMPeriod = LOOPINTCY; - - SVGenParm.T1 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T1); - SVGenParm.T2 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T2); - SVGenParm.Tc = (((float)SVGenParm.iPWMPeriod-SVGenParm.T1-SVGenParm.T2)/2); - 8010790: edc2 7a08 vstr s15, [r2, #32] - SVGenParm.Tb = SVGenParm.Tc + SVGenParm.T1; - 8010794: ee37 7a06 vadd.f32 s14, s14, s12 - 8010798: eebc 7ac7 vcvt.u32.f32 s14, s14 - SVGenParm.Ta = SVGenParm.Tb + SVGenParm.T2 ; - 801079c: eef8 7a47 vcvt.f32.u32 s15, s14 - SVGenParm.iPWMPeriod = LOOPINTCY; - - SVGenParm.T1 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T1); - SVGenParm.T2 = ((float)SVGenParm.iPWMPeriod * SVGenParm.T2); - SVGenParm.Tc = (((float)SVGenParm.iPWMPeriod-SVGenParm.T1-SVGenParm.T2)/2); - SVGenParm.Tb = SVGenParm.Tc + SVGenParm.T1; - 80107a0: ed82 7a07 vstr s14, [r2, #28] - SVGenParm.Ta = SVGenParm.Tb + SVGenParm.T2 ; - 80107a4: ee76 6aa7 vadd.f32 s13, s13, s15 - 80107a8: eefc 6ae6 vcvt.u32.f32 s13, s13 - 80107ac: edc2 6a06 vstr s13, [r2, #24] - 80107b0: 4770 bx lr - 80107b2: bf00 nop - 80107b4: 40010000 .word 0x40010000 - 80107b8: 200029f0 .word 0x200029f0 - 80107bc: f3af 8000 nop.w - -080107c0 : - - return; -} -void update_timer_Duty(unsigned int duty_A,unsigned int duty_B,unsigned int duty_C) -{ - 80107c0: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - 80107c4: 4616 mov r6, r2 - 80107c6: 4680 mov r8, r0 - 80107c8: 460f mov r7, r1 - utils_sys_lock_cnt(); - 80107ca: f000 fae9 bl 8010da0 - - // Disable preload register updates - TIM1->CR1 |= TIM_CR1_UDIS; - 80107ce: 4b0d ldr r3, [pc, #52] ; (8010804 ) - TIM8->CR1 |= TIM_CR1_UDIS; - 80107d0: 4c0d ldr r4, [pc, #52] ; (8010808 ) -void update_timer_Duty(unsigned int duty_A,unsigned int duty_B,unsigned int duty_C) -{ - utils_sys_lock_cnt(); - - // Disable preload register updates - TIM1->CR1 |= TIM_CR1_UDIS; - 80107d2: 681d ldr r5, [r3, #0] - 80107d4: f045 0502 orr.w r5, r5, #2 - 80107d8: 601d str r5, [r3, #0] - TIM8->CR1 |= TIM_CR1_UDIS; - 80107da: 6825 ldr r5, [r4, #0] - 80107dc: f045 0502 orr.w r5, r5, #2 - 80107e0: 6025 str r5, [r4, #0] - - TIM1->CCR1 = duty_A; - 80107e2: f8c3 8034 str.w r8, [r3, #52] ; 0x34 - TIM1->CCR2 = duty_B; - 80107e6: 639f str r7, [r3, #56] ; 0x38 - TIM1->CCR3 = duty_C; - 80107e8: 63de str r6, [r3, #60] ; 0x3c - //TIM8->CCR2 = duty_A; - //TIM8->CCR3 = duty_C; - - - // Enables preload register updates - TIM1->CR1 &= ~TIM_CR1_UDIS; - 80107ea: 681a ldr r2, [r3, #0] - 80107ec: f022 0202 bic.w r2, r2, #2 - 80107f0: 601a str r2, [r3, #0] - TIM8->CR1 &= ~TIM_CR1_UDIS; - 80107f2: 6823 ldr r3, [r4, #0] - 80107f4: f023 0302 bic.w r3, r3, #2 - 80107f8: 6023 str r3, [r4, #0] - - utils_sys_unlock_cnt(); -} - 80107fa: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr} - - // Enables preload register updates - TIM1->CR1 &= ~TIM_CR1_UDIS; - TIM8->CR1 &= ~TIM_CR1_UDIS; - - utils_sys_unlock_cnt(); - 80107fe: f000 badf b.w 8010dc0 - 8010802: bf00 nop - 8010804: 40010000 .word 0x40010000 - 8010808: 40010400 .word 0x40010400 - 801080c: f3af 8000 nop.w - -08010810 : -} -void CalcSVGen( void ) -{ - 8010810: b510 push {r4, lr} - if( SVGenParm.qVr1 >= 0 ) - 8010812: 4c3f ldr r4, [pc, #252] ; (8010910 ) - 8010814: edd4 7a01 vldr s15, [r4, #4] - 8010818: eef5 7ac0 vcmpe.f32 s15, #0.0 - 801081c: eef1 fa10 vmrs APSR_nzcv, fpscr - 8010820: db27 blt.n 8010872 - { - // (xx1) - if( SVGenParm.qVr2 >= 0 ) - 8010822: ed94 7a02 vldr s14, [r4, #8] - 8010826: eeb5 7ac0 vcmpe.f32 s14, #0.0 - 801082a: eef1 fa10 vmrs APSR_nzcv, fpscr - 801082e: da13 bge.n 8010858 - update_timer_Duty(SVGenParm.Ta,SVGenParm.Tb,SVGenParm.Tc) ; - } - else - { - // (x01) - if( SVGenParm.qVr3 >= 0 ) - 8010830: edd4 6a03 vldr s13, [r4, #12] - 8010834: eef5 6ac0 vcmpe.f32 s13, #0.0 - 8010838: eef1 fa10 vmrs APSR_nzcv, fpscr - 801083c: db45 blt.n 80108ca - { - // Sector 5: (1,0,1) 120-180 degrees - SVGenParm.T2 = SVGenParm.qVr1; - 801083e: edc4 7a05 vstr s15, [r4, #20] - SVGenParm.T1 = SVGenParm.qVr3; - 8010842: edc4 6a04 vstr s13, [r4, #16] - CalcTimes(); - 8010846: f7ff ff83 bl 8010750 - update_timer_Duty(SVGenParm.Tc,SVGenParm.Ta,SVGenParm.Tb) ; - 801084a: 6a20 ldr r0, [r4, #32] - 801084c: 69a1 ldr r1, [r4, #24] - 801084e: 69e2 ldr r2, [r4, #28] - CalcTimes(); - update_timer_Duty(SVGenParm.Tc,SVGenParm.Tb,SVGenParm.Ta) ; - } - } - -} - 8010850: e8bd 4010 ldmia.w sp!, {r4, lr} - { - // Sector 5: (1,0,1) 120-180 degrees - SVGenParm.T2 = SVGenParm.qVr1; - SVGenParm.T1 = SVGenParm.qVr3; - CalcTimes(); - update_timer_Duty(SVGenParm.Tc,SVGenParm.Ta,SVGenParm.Tb) ; - 8010854: f7ff bfb4 b.w 80107c0 - if( SVGenParm.qVr2 >= 0 ) - { - // (x11) - // Must be Sector 3 since Sector 7 not allowed - // Sector 3: (0,1,1) 0-60 degrees - SVGenParm.T2 = SVGenParm.qVr2; - 8010858: ed84 7a05 vstr s14, [r4, #20] - SVGenParm.T1 = SVGenParm.qVr1; - 801085c: edc4 7a04 vstr s15, [r4, #16] - CalcTimes(); - 8010860: f7ff ff76 bl 8010750 - update_timer_Duty(SVGenParm.Ta,SVGenParm.Tb,SVGenParm.Tc) ; - 8010864: f104 0018 add.w r0, r4, #24 - 8010868: c807 ldmia r0, {r0, r1, r2} - CalcTimes(); - update_timer_Duty(SVGenParm.Tc,SVGenParm.Tb,SVGenParm.Ta) ; - } - } - -} - 801086a: e8bd 4010 ldmia.w sp!, {r4, lr} - // Must be Sector 3 since Sector 7 not allowed - // Sector 3: (0,1,1) 0-60 degrees - SVGenParm.T2 = SVGenParm.qVr2; - SVGenParm.T1 = SVGenParm.qVr1; - CalcTimes(); - update_timer_Duty(SVGenParm.Ta,SVGenParm.Tb,SVGenParm.Tc) ; - 801086e: f7ff bfa7 b.w 80107c0 - } - } - else - { - // (xx0) - if( SVGenParm.qVr2 >= 0 ) - 8010872: edd4 6a02 vldr s13, [r4, #8] - 8010876: eef5 6ac0 vcmpe.f32 s13, #0.0 - 801087a: eef1 fa10 vmrs APSR_nzcv, fpscr - 801087e: db35 blt.n 80108ec - { - // (x10) - if( SVGenParm.qVr3 >= 0 ) - 8010880: ed94 7a03 vldr s14, [r4, #12] - 8010884: eeb5 7ac0 vcmpe.f32 s14, #0.0 - 8010888: eef1 fa10 vmrs APSR_nzcv, fpscr - 801088c: db0c blt.n 80108a8 - { - // Sector 6: (1,1,0) 240-300 degrees - SVGenParm.T2 = SVGenParm.qVr3; - 801088e: ed84 7a05 vstr s14, [r4, #20] - SVGenParm.T1 = SVGenParm.qVr2; - 8010892: edc4 6a04 vstr s13, [r4, #16] - CalcTimes(); - 8010896: f7ff ff5b bl 8010750 - update_timer_Duty(SVGenParm.Tb,SVGenParm.Tc,SVGenParm.Ta) ; - 801089a: 69e0 ldr r0, [r4, #28] - 801089c: 6a21 ldr r1, [r4, #32] - 801089e: 69a2 ldr r2, [r4, #24] - CalcTimes(); - update_timer_Duty(SVGenParm.Tc,SVGenParm.Tb,SVGenParm.Ta) ; - } - } - -} - 80108a0: e8bd 4010 ldmia.w sp!, {r4, lr} - { - // Sector 6: (1,1,0) 240-300 degrees - SVGenParm.T2 = SVGenParm.qVr3; - SVGenParm.T1 = SVGenParm.qVr2; - CalcTimes(); - update_timer_Duty(SVGenParm.Tb,SVGenParm.Tc,SVGenParm.Ta) ; - 80108a4: f7ff bf8c b.w 80107c0 - } - else - { - // Sector 2: (0,1,0) 300-0 degrees - SVGenParm.T2 = -SVGenParm.qVr3; - 80108a8: eeb1 7a47 vneg.f32 s14, s14 - SVGenParm.T1 = -SVGenParm.qVr1; - 80108ac: eef1 7a67 vneg.f32 s15, s15 - update_timer_Duty(SVGenParm.Tb,SVGenParm.Tc,SVGenParm.Ta) ; - } - else - { - // Sector 2: (0,1,0) 300-0 degrees - SVGenParm.T2 = -SVGenParm.qVr3; - 80108b0: ed84 7a05 vstr s14, [r4, #20] - SVGenParm.T1 = -SVGenParm.qVr1; - 80108b4: edc4 7a04 vstr s15, [r4, #16] - CalcTimes(); - 80108b8: f7ff ff4a bl 8010750 - update_timer_Duty(SVGenParm.Ta,SVGenParm.Tc,SVGenParm.Tb) ; - 80108bc: 69a0 ldr r0, [r4, #24] - 80108be: 6a21 ldr r1, [r4, #32] - 80108c0: 69e2 ldr r2, [r4, #28] - CalcTimes(); - update_timer_Duty(SVGenParm.Tc,SVGenParm.Tb,SVGenParm.Ta) ; - } - } - -} - 80108c2: e8bd 4010 ldmia.w sp!, {r4, lr} - { - // Sector 2: (0,1,0) 300-0 degrees - SVGenParm.T2 = -SVGenParm.qVr3; - SVGenParm.T1 = -SVGenParm.qVr1; - CalcTimes(); - update_timer_Duty(SVGenParm.Ta,SVGenParm.Tc,SVGenParm.Tb) ; - 80108c6: f7ff bf7b b.w 80107c0 - - } - else - { - // Sector 1: (0,0,1) 60-120 degrees - SVGenParm.T2 = -SVGenParm.qVr2; - 80108ca: eeb1 7a47 vneg.f32 s14, s14 - SVGenParm.T1 = -SVGenParm.qVr3; - 80108ce: eef1 6a66 vneg.f32 s13, s13 - - } - else - { - // Sector 1: (0,0,1) 60-120 degrees - SVGenParm.T2 = -SVGenParm.qVr2; - 80108d2: ed84 7a05 vstr s14, [r4, #20] - SVGenParm.T1 = -SVGenParm.qVr3; - 80108d6: edc4 6a04 vstr s13, [r4, #16] - CalcTimes(); - 80108da: f7ff ff39 bl 8010750 - update_timer_Duty(SVGenParm.Tb,SVGenParm.Ta,SVGenParm.Tc) ; - 80108de: 69e0 ldr r0, [r4, #28] - 80108e0: 69a1 ldr r1, [r4, #24] - 80108e2: 6a22 ldr r2, [r4, #32] - CalcTimes(); - update_timer_Duty(SVGenParm.Tc,SVGenParm.Tb,SVGenParm.Ta) ; - } - } - -} - 80108e4: e8bd 4010 ldmia.w sp!, {r4, lr} - { - // Sector 1: (0,0,1) 60-120 degrees - SVGenParm.T2 = -SVGenParm.qVr2; - SVGenParm.T1 = -SVGenParm.qVr3; - CalcTimes(); - update_timer_Duty(SVGenParm.Tb,SVGenParm.Ta,SVGenParm.Tc) ; - 80108e8: f7ff bf6a b.w 80107c0 - else - { - // (x00) - // Must be Sector 4 since Sector 0 not allowed - // Sector 4: (1,0,0) 180-240 degrees - SVGenParm.T2 = -SVGenParm.qVr1; - 80108ec: eef1 7a67 vneg.f32 s15, s15 - SVGenParm.T1 = -SVGenParm.qVr2; - 80108f0: eef1 6a66 vneg.f32 s13, s13 - else - { - // (x00) - // Must be Sector 4 since Sector 0 not allowed - // Sector 4: (1,0,0) 180-240 degrees - SVGenParm.T2 = -SVGenParm.qVr1; - 80108f4: edc4 7a05 vstr s15, [r4, #20] - SVGenParm.T1 = -SVGenParm.qVr2; - 80108f8: edc4 6a04 vstr s13, [r4, #16] - CalcTimes(); - 80108fc: f7ff ff28 bl 8010750 - update_timer_Duty(SVGenParm.Tc,SVGenParm.Tb,SVGenParm.Ta) ; - 8010900: 6a20 ldr r0, [r4, #32] - 8010902: 69e1 ldr r1, [r4, #28] - 8010904: 69a2 ldr r2, [r4, #24] - } - } - -} - 8010906: e8bd 4010 ldmia.w sp!, {r4, lr} - // Must be Sector 4 since Sector 0 not allowed - // Sector 4: (1,0,0) 180-240 degrees - SVGenParm.T2 = -SVGenParm.qVr1; - SVGenParm.T1 = -SVGenParm.qVr2; - CalcTimes(); - update_timer_Duty(SVGenParm.Tc,SVGenParm.Tb,SVGenParm.Ta) ; - 801090a: f7ff bf59 b.w 80107c0 - 801090e: bf00 nop - 8010910: 200029f0 .word 0x200029f0 - 8010914: f3af 8000 nop.w - 8010918: f3af 8000 nop.w - 801091c: f3af 8000 nop.w - -08010920 : -float sinth; - - - -void SMC_HallSensor_Estimation (SMC *s) -{ - 8010920: b570 push {r4, r5, r6, lr} - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - 8010922: 4b55 ldr r3, [pc, #340] ; (8010a78 ) - 8010924: ed9f 7a55 vldr s14, [pc, #340] ; 8010a7c - 8010928: 889a ldrh r2, [r3, #4] - HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; - 801092a: 885b ldrh r3, [r3, #2] - //HallPLLB = HallPLLB / Hall_KB; - - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - - costh = cosf(Theta); - 801092c: 4c54 ldr r4, [pc, #336] ; (8010a80 ) - sinth = sinf(Theta); - - //Hall_SinCos = HallPLLA_filtered * costh; - //Hall_CosSin = HallPLLB_filtered * sinth; - - Hall_SinCos = HallPLLA * costh; - 801092e: 4e55 ldr r6, [pc, #340] ; (8010a84 ) - //HallPLLB = HallPLLB / Hall_KB; - - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - - costh = cosf(Theta); - 8010930: ed94 0a00 vldr s0, [r4] -float sinth; - - - -void SMC_HallSensor_Estimation (SMC *s) -{ - 8010934: ed2d 8b04 vpush {d8-d9} - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; - 8010938: ee07 3a90 vmov s15, r3 - -void SMC_HallSensor_Estimation (SMC *s) -{ - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - 801093c: ee08 2a10 vmov s16, r2 - 8010940: eddf 8a51 vldr s17, [pc, #324] ; 8010a88 - 8010944: 4a51 ldr r2, [pc, #324] ; (8010a8c ) - HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; - 8010946: 4b52 ldr r3, [pc, #328] ; (8010a90 ) - -void SMC_HallSensor_Estimation (SMC *s) -{ - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - 8010948: eeb8 8a48 vcvt.f32.u32 s16, s16 - HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; - 801094c: eef8 7a67 vcvt.f32.u32 s15, s15 - -void SMC_HallSensor_Estimation (SMC *s) -{ - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - 8010950: ee38 8a68 vsub.f32 s16, s16, s17 - HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; - 8010954: ee77 7ae8 vsub.f32 s15, s15, s17 - -void SMC_HallSensor_Estimation (SMC *s) -{ - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - 8010958: ee88 8a07 vdiv.f32 s16, s16, s14 -float sinth; - - - -void SMC_HallSensor_Estimation (SMC *s) -{ - 801095c: 4605 mov r5, r0 - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; - 801095e: eec7 8a87 vdiv.f32 s17, s15, s14 - -void SMC_HallSensor_Estimation (SMC *s) -{ - - - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; - 8010962: ed82 8a00 vstr s16, [r2] - HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; - 8010966: edc3 8a00 vstr s17, [r3] - //HallPLLB = HallPLLB / Hall_KB; - - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - - costh = cosf(Theta); - 801096a: f001 fc79 bl 8012260 - 801096e: 4b49 ldr r3, [pc, #292] ; (8010a94 ) - 8010970: eeb0 9a40 vmov.f32 s18, s0 - sinth = sinf(Theta); - 8010974: ed94 0a00 vldr s0, [r4] - //HallPLLB = HallPLLB / Hall_KB; - - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - - costh = cosf(Theta); - 8010978: ed83 9a00 vstr s18, [r3] - sinth = sinf(Theta); - 801097c: f001 fcb0 bl 80122e0 - - //Hall_SinCos = HallPLLA_filtered * costh; - //Hall_CosSin = HallPLLB_filtered * sinth; - - Hall_SinCos = HallPLLA * costh; - 8010980: ee28 8a09 vmul.f32 s16, s16, s18 - Hall_CosSin = HallPLLB * sinth; - 8010984: ee68 8a80 vmul.f32 s17, s17, s0 - - float err, tmp_kp, tmp_kpi; - tmp_kp = 1.0f; - tmp_kpi = (1.0f + 1.0f * Tsamp); - err = Hall_SinCos - Hall_CosSin; - Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); - 8010988: 4a43 ldr r2, [pc, #268] ; (8010a98 ) - 801098a: ed9f 6a44 vldr s12, [pc, #272] ; 8010a9c - 801098e: edd2 7a00 vldr s15, [r2] - sinth = sinf(Theta); - - //Hall_SinCos = HallPLLA_filtered * costh; - //Hall_CosSin = HallPLLB_filtered * sinth; - - Hall_SinCos = HallPLLA * costh; - 8010992: ed86 8a00 vstr s16, [r6] - //Digital_PI_controller(Hall_PIout, Hall_SinCos, Hall_CosSin, Hall_Err0, 10, 1, 1, Tsamp); - - float err, tmp_kp, tmp_kpi; - tmp_kp = 1.0f; - tmp_kpi = (1.0f + 1.0f * Tsamp); - err = Hall_SinCos - Hall_CosSin; - 8010996: ee38 8a68 vsub.f32 s16, s16, s17 - Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); - 801099a: 4b41 ldr r3, [pc, #260] ; (8010aa0 ) - - //Hall_SinCos = HallPLLA_filtered * costh; - //Hall_CosSin = HallPLLB_filtered * sinth; - - Hall_SinCos = HallPLLA * costh; - Hall_CosSin = HallPLLB * sinth; - 801099c: 4841 ldr r0, [pc, #260] ; (8010aa4 ) - - float err, tmp_kp, tmp_kpi; - tmp_kp = 1.0f; - tmp_kpi = (1.0f + 1.0f * Tsamp); - err = Hall_SinCos - Hall_CosSin; - Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); - 801099e: edd3 6a00 vldr s13, [r3] - - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - - costh = cosf(Theta); - sinth = sinf(Theta); - 80109a2: 4941 ldr r1, [pc, #260] ; (8010aa8 ) - - //Hall_SinCos = HallPLLA_filtered * costh; - //Hall_CosSin = HallPLLB_filtered * sinth; - - Hall_SinCos = HallPLLA * costh; - Hall_CosSin = HallPLLB * sinth; - 80109a4: edc0 8a00 vstr s17, [r0] - - float err, tmp_kp, tmp_kpi; - tmp_kp = 1.0f; - tmp_kpi = (1.0f + 1.0f * Tsamp); - err = Hall_SinCos - Hall_CosSin; - Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); - 80109a8: eed8 7a06 vfnms.f32 s15, s16, s12 - Hall_PIout = Bound_limit(Hall_PIout, 10.0f); - 80109ac: eeb2 7a04 vmov.f32 s14, #36 ; 0x24 - - float err, tmp_kp, tmp_kpi; - tmp_kp = 1.0f; - tmp_kpi = (1.0f + 1.0f * Tsamp); - err = Hall_SinCos - Hall_CosSin; - Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); - 80109b0: ee77 7aa6 vadd.f32 s15, s15, s13 - - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - - costh = cosf(Theta); - sinth = sinf(Theta); - 80109b4: ed81 0a00 vstr s0, [r1] - - float err, tmp_kp, tmp_kpi; - tmp_kp = 1.0f; - tmp_kpi = (1.0f + 1.0f * Tsamp); - err = Hall_SinCos - Hall_CosSin; - Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); - 80109b8: edc3 7a00 vstr s15, [r3] - Hall_PIout = Bound_limit(Hall_PIout, 10.0f); - 80109bc: edd3 7a00 vldr s15, [r3] - 80109c0: eef4 7ac7 vcmpe.f32 s15, s14 - 80109c4: eef1 fa10 vmrs APSR_nzcv, fpscr - 80109c8: dc0a bgt.n 80109e0 - 80109ca: edd3 7a00 vldr s15, [r3] - 80109ce: eeba 7a04 vmov.f32 s14, #164 ; 0xa4 - 80109d2: eef4 7ac7 vcmpe.f32 s15, s14 - 80109d6: eef1 fa10 vmrs APSR_nzcv, fpscr - 80109da: bf58 it pl - 80109dc: ed93 7a00 vldrpl s14, [r3] - 80109e0: ed83 7a00 vstr s14, [r3] - Hall_Err0= err; - 80109e4: ed82 8a00 vstr s16, [r2] - - Theta += Hall_PIout ; - 80109e8: edd3 7a00 vldr s15, [r3] - 80109ec: edd4 6a00 vldr s13, [r4] - if((2.0f * PI) < Theta) Theta = Theta - (2.0f * PI); - 80109f0: ed9f 7a2e vldr s14, [pc, #184] ; 8010aac - err = Hall_SinCos - Hall_CosSin; - Hall_PIout += ((tmp_kpi * err) - (tmp_kp * Hall_Err0)); - Hall_PIout = Bound_limit(Hall_PIout, 10.0f); - Hall_Err0= err; - - Theta += Hall_PIout ; - 80109f4: 4a22 ldr r2, [pc, #136] ; (8010a80 ) - 80109f6: ee77 7aa6 vadd.f32 s15, s15, s13 - 80109fa: edc4 7a00 vstr s15, [r4] - if((2.0f * PI) < Theta) Theta = Theta - (2.0f * PI); - 80109fe: edd4 7a00 vldr s15, [r4] - 8010a02: eef4 7ac7 vcmpe.f32 s15, s14 - 8010a06: eef1 fa10 vmrs APSR_nzcv, fpscr - 8010a0a: edd2 7a00 vldr s15, [r2] - 8010a0e: dd1e ble.n 8010a4e - 8010a10: ee37 7ac7 vsub.f32 s14, s15, s14 - 8010a14: ed82 7a00 vstr s14, [r2] - else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; - - s->Theta= Theta + 0.3f; - 8010a18: ed94 7a00 vldr s14, [r4] - 8010a1c: eddf 7a24 vldr s15, [pc, #144] ; 8010ab0 - - if((2.0f * PI) < s->Theta) s->Theta = s->Theta - (2.0f * PI); - 8010a20: eddf 6a22 vldr s13, [pc, #136] ; 8010aac - - Theta += Hall_PIout ; - if((2.0f * PI) < Theta) Theta = Theta - (2.0f * PI); - else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; - - s->Theta= Theta + 0.3f; - 8010a24: ee77 7a27 vadd.f32 s15, s14, s15 - - if((2.0f * PI) < s->Theta) s->Theta = s->Theta - (2.0f * PI); - 8010a28: eef4 7ae6 vcmpe.f32 s15, s13 - 8010a2c: eef1 fa10 vmrs APSR_nzcv, fpscr - 8010a30: dc19 bgt.n 8010a66 - - //s->Omega = Wpll; - //s->Theta =Theta; - - //DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) -} - 8010a32: ecbd 8b04 vpop {d8-d9} - else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; - - s->Theta= Theta + 0.3f; - - if((2.0f * PI) < s->Theta) s->Theta = s->Theta - (2.0f * PI); - else if(s->Theta < 0.0f) s->Theta = (2.0f * PI) + s->Theta; - 8010a36: eef5 7ac0 vcmpe.f32 s15, #0.0 - 8010a3a: eef1 fa10 vmrs APSR_nzcv, fpscr - 8010a3e: bf48 it mi - 8010a40: ee77 7aa6 vaddmi.f32 s15, s15, s13 - - s->Omega = Hall_PIout; - 8010a44: 681b ldr r3, [r3, #0] - else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; - - s->Theta= Theta + 0.3f; - - if((2.0f * PI) < s->Theta) s->Theta = s->Theta - (2.0f * PI); - else if(s->Theta < 0.0f) s->Theta = (2.0f * PI) + s->Theta; - 8010a46: edc5 7a16 vstr s15, [r5, #88] ; 0x58 - - s->Omega = Hall_PIout; - 8010a4a: 65eb str r3, [r5, #92] ; 0x5c - - //s->Omega = Wpll; - //s->Theta =Theta; - - //DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) -} - 8010a4c: bd70 pop {r4, r5, r6, pc} - Hall_PIout = Bound_limit(Hall_PIout, 10.0f); - Hall_Err0= err; - - Theta += Hall_PIout ; - if((2.0f * PI) < Theta) Theta = Theta - (2.0f * PI); - else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; - 8010a4e: eef5 7ac0 vcmpe.f32 s15, #0.0 - 8010a52: eef1 fa10 vmrs APSR_nzcv, fpscr - 8010a56: d5df bpl.n 8010a18 - 8010a58: edd2 7a00 vldr s15, [r2] - 8010a5c: ee37 7a87 vadd.f32 s14, s15, s14 - 8010a60: ed82 7a00 vstr s14, [r2] - 8010a64: e7d8 b.n 8010a18 - - //s->Omega = Wpll; - //s->Theta =Theta; - - //DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) -} - 8010a66: ecbd 8b04 vpop {d8-d9} - if((2.0f * PI) < Theta) Theta = Theta - (2.0f * PI); - else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; - - s->Theta= Theta + 0.3f; - - if((2.0f * PI) < s->Theta) s->Theta = s->Theta - (2.0f * PI); - 8010a6a: ee77 7ae6 vsub.f32 s15, s15, s13 - else if(s->Theta < 0.0f) s->Theta = (2.0f * PI) + s->Theta; - - s->Omega = Hall_PIout; - 8010a6e: 681b ldr r3, [r3, #0] - if((2.0f * PI) < Theta) Theta = Theta - (2.0f * PI); - else if(Theta < 0.0f) Theta = (2.0f * PI) + Theta; - - s->Theta= Theta + 0.3f; - - if((2.0f * PI) < s->Theta) s->Theta = s->Theta - (2.0f * PI); - 8010a70: edc5 7a16 vstr s15, [r5, #88] ; 0x58 - else if(s->Theta < 0.0f) s->Theta = (2.0f * PI) + s->Theta; - - s->Omega = Hall_PIout; - 8010a74: 65eb str r3, [r5, #92] ; 0x5c - - //s->Omega = Wpll; - //s->Theta =Theta; - - //DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) -} - 8010a76: bd70 pop {r4, r5, r6, pc} - 8010a78: 20001ec4 .word 0x20001ec4 - 8010a7c: 457ff000 .word 0x457ff000 - 8010a80: 20002944 .word 0x20002944 - 8010a84: 20002908 .word 0x20002908 - 8010a88: 449b2000 .word 0x449b2000 - 8010a8c: 20002a24 .word 0x20002a24 - 8010a90: 20002a28 .word 0x20002a28 - 8010a94: 200029ec .word 0x200029ec - 8010a98: 20002904 .word 0x20002904 - 8010a9c: 3f80020c .word 0x3f80020c - 8010aa0: 20002a1c .word 0x20002a1c - 8010aa4: 200028fc .word 0x200028fc - 8010aa8: 20002930 .word 0x20002930 - 8010aac: 40c90fdb .word 0x40c90fdb - 8010ab0: 3e99999a .word 0x3e99999a - 8010ab4: f3af 8000 nop.w - 8010ab8: f3af 8000 nop.w - 8010abc: f3af 8000 nop.w - -08010ac0 : -{ - return(ITM_SendChar(ch)); -} - -void mcpwm_adc_inj_int_handler(void) -{ - 8010ac0: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr} - TIM12->CNT = 0; - 8010ac4: 4b41 ldr r3, [pc, #260] ; (8010bcc ) - - int curr0 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1); - 8010ac6: 4842 ldr r0, [pc, #264] ; (8010bd0 ) - debug_print_usb( " Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test 12345 \r\n"); - } - */ - //debug_print_usb( "iT "); - - SMC_HallSensor_Estimation (&smc1); - 8010ac8: f8df 8130 ldr.w r8, [pc, #304] ; 8010bfc - - //spi_dac_write_A( dacDataA++); - //spi_dac_write_B( dacDataB--); - - - if( uGF.bit.RunMotor ) - 8010acc: 4e41 ldr r6, [pc, #260] ; (8010bd4 ) - return(ITM_SendChar(ch)); -} - -void mcpwm_adc_inj_int_handler(void) -{ - TIM12->CNT = 0; - 8010ace: 2700 movs r7, #0 - 8010ad0: 625f str r7, [r3, #36] ; 0x24 - - int curr0 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1); - 8010ad2: 2114 movs r1, #20 - 8010ad4: f000 fecc bl 8011870 - int curr1 = ADC_GetInjectedConversionValue(ADC2, ADC_InjectedChannel_1); - 8010ad8: 2114 movs r1, #20 - -void mcpwm_adc_inj_int_handler(void) -{ - TIM12->CNT = 0; - - int curr0 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1); - 8010ada: 4605 mov r5, r0 - int curr1 = ADC_GetInjectedConversionValue(ADC2, ADC_InjectedChannel_1); - 8010adc: 483e ldr r0, [pc, #248] ; (8010bd8 ) - 8010ade: f000 fec7 bl 8011870 - 8010ae2: 4604 mov r4, r0 - - curr0_sum += curr0; - 8010ae4: 483d ldr r0, [pc, #244] ; (8010bdc ) - curr1_sum += curr1; - 8010ae6: 493e ldr r1, [pc, #248] ; (8010be0 ) - TIM12->CNT = 0; - - int curr0 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1); - int curr1 = ADC_GetInjectedConversionValue(ADC2, ADC_InjectedChannel_1); - - curr0_sum += curr0; - 8010ae8: 6803 ldr r3, [r0, #0] - curr1_sum += curr1; - curr_start_samples++; - 8010aea: 4a3e ldr r2, [pc, #248] ; (8010be4 ) - TIM12->CNT = 0; - - int curr0 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1); - int curr1 = ADC_GetInjectedConversionValue(ADC2, ADC_InjectedChannel_1); - - curr0_sum += curr0; - 8010aec: 442b add r3, r5 - 8010aee: 6003 str r3, [r0, #0] - curr1_sum += curr1; - 8010af0: 680b ldr r3, [r1, #0] - 8010af2: 4423 add r3, r4 - 8010af4: 600b str r3, [r1, #0] - curr_start_samples++; - 8010af6: 6813 ldr r3, [r2, #0] - debug_print_usb( " Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test 12345 \r\n"); - } - */ - //debug_print_usb( "iT "); - - SMC_HallSensor_Estimation (&smc1); - 8010af8: 4640 mov r0, r8 - int curr0 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1); - int curr1 = ADC_GetInjectedConversionValue(ADC2, ADC_InjectedChannel_1); - - curr0_sum += curr0; - curr1_sum += curr1; - curr_start_samples++; - 8010afa: 3301 adds r3, #1 - 8010afc: 6013 str r3, [r2, #0] - debug_print_usb( " Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test Debug Test 12345 \r\n"); - } - */ - //debug_print_usb( "iT "); - - SMC_HallSensor_Estimation (&smc1); - 8010afe: f7ff ff0f bl 8010920 - - //spi_dac_write_A( dacDataA++); - //spi_dac_write_B( dacDataB--); - - - if( uGF.bit.RunMotor ) - 8010b02: 7833 ldrb r3, [r6, #0] - 8010b04: 079a lsls r2, r3, #30 - 8010b06: d55b bpl.n 8010bc0 - { - ENABLE_GATE(); - 8010b08: f8df e0f4 ldr.w lr, [pc, #244] ; 8010c00 - LED_RED_ON(); - 8010b0c: 4b36 ldr r3, [pc, #216] ; (8010be8 ) -} -void MeasCompCurr( int curr1, int curr2 ) -{ - int CorrADC1, CorrADC2; - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - 8010b0e: 4a37 ldr r2, [pc, #220] ; (8010bec ) - - //debug_print_usb( "%f,%d,%d\r\n",ParkParm.qAngle ,curr0,curr1); - - - // Calculate commutation angle using estimator - ParkParm.qAngle = smc1.Theta; - 8010b10: f8d8 c058 ldr.w ip, [r8, #88] ; 0x58 - - //ParkParm.qAngle = (float)IN[2]; - //smc1.Omega = (float)IN[3] *LOOPTIMEINSEC * IRP_PERCALC * POLEPAIRS/PI; - - AccumThetaCnt++; - 8010b14: 4936 ldr r1, [pc, #216] ; (8010bf0 ) - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - CorrADC2 = curr2 - MeasCurrParm.Offsetb; - // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); - - ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; - 8010b16: f8df 80ec ldr.w r8, [pc, #236] ; 8010c04 - - - if( uGF.bit.RunMotor ) - { - ENABLE_GATE(); - LED_RED_ON(); - 8010b1a: 2080 movs r0, #128 ; 0x80 - //spi_dac_write_B( dacDataB--); - - - if( uGF.bit.RunMotor ) - { - ENABLE_GATE(); - 8010b1c: f04f 0940 mov.w r9, #64 ; 0x40 - 8010b20: f8ae 9018 strh.w r9, [lr, #24] - LED_RED_ON(); - 8010b24: 8318 strh r0, [r3, #24] -} -void MeasCompCurr( int curr1, int curr2 ) -{ - int CorrADC1, CorrADC2; - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - 8010b26: f8b2 e004 ldrh.w lr, [r2, #4] - CorrADC2 = curr2 - MeasCurrParm.Offsetb; - 8010b2a: 8990 ldrh r0, [r2, #12] - // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); - - ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; - 8010b2c: ed92 6a00 vldr s12, [r2] - ParkParm.qIb = MeasCurrParm.qKb * (float)CorrADC2; - 8010b30: edd2 6a02 vldr s13, [r2, #8] - ParkParm.qAngle = smc1.Theta; - - //ParkParm.qAngle = (float)IN[2]; - //smc1.Omega = (float)IN[3] *LOOPTIMEINSEC * IRP_PERCALC * POLEPAIRS/PI; - - AccumThetaCnt++; - 8010b34: 880b ldrh r3, [r1, #0] - - //debug_print_usb( "%f,%d,%d\r\n",ParkParm.qAngle ,curr0,curr1); - - - // Calculate commutation angle using estimator - ParkParm.qAngle = smc1.Theta; - 8010b36: f8c8 c000 str.w ip, [r8] -} -void MeasCompCurr( int curr1, int curr2 ) -{ - int CorrADC1, CorrADC2; - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - 8010b3a: fa0f fe8e sxth.w lr, lr - 8010b3e: ebce 0505 rsb r5, lr, r5 - CorrADC2 = curr2 - MeasCurrParm.Offsetb; - 8010b42: b202 sxth r2, r0 - // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); - - ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; - 8010b44: ee07 5a90 vmov s15, r5 -void MeasCompCurr( int curr1, int curr2 ) -{ - int CorrADC1, CorrADC2; - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - CorrADC2 = curr2 - MeasCurrParm.Offsetb; - 8010b48: 1aa4 subs r4, r4, r2 - // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); - - ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; - 8010b4a: eeb8 7ae7 vcvt.f32.s32 s14, s15 - ParkParm.qIb = MeasCurrParm.qKb * (float)CorrADC2; - 8010b4e: ee07 4a90 vmov s15, r4 - 8010b52: eef8 7ae7 vcvt.f32.s32 s15, s15 - ParkParm.qAngle = smc1.Theta; - - //ParkParm.qAngle = (float)IN[2]; - //smc1.Omega = (float)IN[3] *LOOPTIMEINSEC * IRP_PERCALC * POLEPAIRS/PI; - - AccumThetaCnt++; - 8010b56: 3301 adds r3, #1 - 8010b58: b29b uxth r3, r3 - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - CorrADC2 = curr2 - MeasCurrParm.Offsetb; - // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); - - ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; - 8010b5a: ee26 7a07 vmul.f32 s14, s12, s14 - ParkParm.qIb = MeasCurrParm.qKb * (float)CorrADC2; - 8010b5e: ee66 7aa7 vmul.f32 s15, s13, s15 - - //ParkParm.qAngle = (float)IN[2]; - //smc1.Omega = (float)IN[3] *LOOPTIMEINSEC * IRP_PERCALC * POLEPAIRS/PI; - - AccumThetaCnt++; - if (AccumThetaCnt == IRP_PERCALC) - 8010b62: 2b10 cmp r3, #16 - ParkParm.qAngle = smc1.Theta; - - //ParkParm.qAngle = (float)IN[2]; - //smc1.Omega = (float)IN[3] *LOOPTIMEINSEC * IRP_PERCALC * POLEPAIRS/PI; - - AccumThetaCnt++; - 8010b64: bf14 ite ne - 8010b66: 800b strhne r3, [r1, #0] - if (AccumThetaCnt == IRP_PERCALC) - { - AccumThetaCnt = 0; - 8010b68: 800f strheq r7, [r1, #0] - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - CorrADC2 = curr2 - MeasCurrParm.Offsetb; - // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); - - ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; - 8010b6a: ed88 7a03 vstr s14, [r8, #12] - ParkParm.qIb = MeasCurrParm.qKb * (float)CorrADC2; - 8010b6e: edc8 7a04 vstr s15, [r8, #16] - AccumThetaCnt = 0; - } - - - // Calculate qId,qIq from qSin,qCos,qIa,qIb - ClarkePark(); - 8010b72: f7ff f9ed bl 800ff50 -// Executes one PI itteration for each of the three loops Id,Iq,Speed, - -void DoControl( void ) - { - - if( uGF.bit.OpenLoop ) - 8010b76: 7833 ldrb r3, [r6, #0] - 8010b78: 07db lsls r3, r3, #31 - 8010b7a: d523 bpl.n 8010bc4 - //ParkParm.qAngle += 0.002f; - //if(2*PI < ParkParm.qAngle)ParkParm.qAngle=2*PI - ParkParm.qAngle; - - - // Calculate qValpha, qVbeta from qSin,qCos,qVd,qVq - InvPark(); - 8010b7c: f7ff fdc0 bl 8010700 -{ - //SVGenParm.qVr1 =ParkParm.qValpha; - //SVGenParm.qVr2 = (-ParkParm.qValpha + SQRT3 * ParkParm.qVbeta)/2; - //SVGenParm.qVr3 = (-ParkParm.qValpha - SQRT3 * ParkParm.qVbeta)/2; - - SVGenParm.qVr1 =ParkParm.qVbeta; - 8010b80: edd8 6a0c vldr s13, [r8, #48] ; 0x30 - SVGenParm.qVr2 = (-ParkParm.qVbeta + SQRT3 * ParkParm.qValpha)/2; - 8010b84: edd8 5a0b vldr s11, [r8, #44] ; 0x2c - 8010b88: ed9f 6a1a vldr s12, [pc, #104] ; 8010bf4 -{ - //SVGenParm.qVr1 =ParkParm.qValpha; - //SVGenParm.qVr2 = (-ParkParm.qValpha + SQRT3 * ParkParm.qVbeta)/2; - //SVGenParm.qVr3 = (-ParkParm.qValpha - SQRT3 * ParkParm.qVbeta)/2; - - SVGenParm.qVr1 =ParkParm.qVbeta; - 8010b8c: 4b1a ldr r3, [pc, #104] ; (8010bf8 ) - 8010b8e: eef1 7a66 vneg.f32 s15, s13 - SVGenParm.qVr2 = (-ParkParm.qVbeta + SQRT3 * ParkParm.qValpha)/2; - 8010b92: eeb0 7a67 vmov.f32 s14, s15 - 8010b96: eea5 7a86 vfma.f32 s14, s11, s12 - SVGenParm.qVr3 = (-ParkParm.qVbeta - SQRT3 * ParkParm.qValpha)/2; - 8010b9a: eee5 7ac6 vfms.f32 s15, s11, s12 - //SVGenParm.qVr1 =ParkParm.qValpha; - //SVGenParm.qVr2 = (-ParkParm.qValpha + SQRT3 * ParkParm.qVbeta)/2; - //SVGenParm.qVr3 = (-ParkParm.qValpha - SQRT3 * ParkParm.qVbeta)/2; - - SVGenParm.qVr1 =ParkParm.qVbeta; - SVGenParm.qVr2 = (-ParkParm.qVbeta + SQRT3 * ParkParm.qValpha)/2; - 8010b9e: eeb6 6a00 vmov.f32 s12, #96 ; 0x60 - 8010ba2: ee27 7a06 vmul.f32 s14, s14, s12 - SVGenParm.qVr3 = (-ParkParm.qVbeta - SQRT3 * ParkParm.qValpha)/2; - 8010ba6: ee67 7a86 vmul.f32 s15, s15, s12 -{ - //SVGenParm.qVr1 =ParkParm.qValpha; - //SVGenParm.qVr2 = (-ParkParm.qValpha + SQRT3 * ParkParm.qVbeta)/2; - //SVGenParm.qVr3 = (-ParkParm.qValpha - SQRT3 * ParkParm.qVbeta)/2; - - SVGenParm.qVr1 =ParkParm.qVbeta; - 8010baa: edc3 6a01 vstr s13, [r3, #4] - SVGenParm.qVr2 = (-ParkParm.qVbeta + SQRT3 * ParkParm.qValpha)/2; - 8010bae: ed83 7a02 vstr s14, [r3, #8] - SVGenParm.qVr3 = (-ParkParm.qVbeta - SQRT3 * ParkParm.qValpha)/2; - 8010bb2: edc3 7a03 vstr s15, [r3, #12] - - // Calculate Vr1,Vr2,Vr3 from qValpha, qVbeta - CalcRefVec(); - - // Calculate and set PWM duty cycles from Vr1,Vr2,Vr3 - CalcSVGen(); - 8010bb6: f7ff fe2b bl 8010810 - - LED_RED_OFF(); - 8010bba: 4b0b ldr r3, [pc, #44] ; (8010be8 ) - 8010bbc: 2280 movs r2, #128 ; 0x80 - 8010bbe: 835a strh r2, [r3, #26] - 8010bc0: e8bd 83f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, pc} - 8010bc4: f7ff fd14 bl 80105f0 - 8010bc8: e7d8 b.n 8010b7c - 8010bca: bf00 nop - 8010bcc: 40001800 .word 0x40001800 - 8010bd0: 40012000 .word 0x40012000 - 8010bd4: 200028f4 .word 0x200028f4 - 8010bd8: 40012100 .word 0x40012100 - 8010bdc: 20002a18 .word 0x20002a18 - 8010be0: 20001f0c .word 0x20001f0c - 8010be4: 200028f8 .word 0x200028f8 - 8010be8: 40020400 .word 0x40020400 - 8010bec: 20002a2c .word 0x20002a2c - 8010bf0: 20002940 .word 0x20002940 - 8010bf4: 3fddb3d7 .word 0x3fddb3d7 - 8010bf8: 200029f0 .word 0x200029f0 - 8010bfc: 20002948 .word 0x20002948 - 8010c00: 40020800 .word 0x40020800 - 8010c04: 200029ac .word 0x200029ac - 8010c08: f3af 8000 nop.w - 8010c0c: f3af 8000 nop.w - -08010c10 : - uint8_t dindex, - uint16_t lang) { - - (void)usbp; - (void)lang; - switch (dtype) { - 8010c10: 2902 cmp r1, #2 - 8010c12: d006 beq.n 8010c22 - 8010c14: 2903 cmp r1, #3 - 8010c16: d006 beq.n 8010c26 - 8010c18: 2901 cmp r1, #1 - return &vcom_configuration_descriptor; - case USB_DESCRIPTOR_STRING: - if (dindex < 4) - return &vcom_strings[dindex]; - } - return NULL; - 8010c1a: 4806 ldr r0, [pc, #24] ; (8010c34 ) - 8010c1c: bf18 it ne - 8010c1e: 2000 movne r0, #0 - 8010c20: 4770 bx lr - (void)lang; - switch (dtype) { - case USB_DESCRIPTOR_DEVICE: - return &vcom_device_descriptor; - case USB_DESCRIPTOR_CONFIGURATION: - return &vcom_configuration_descriptor; - 8010c22: 4805 ldr r0, [pc, #20] ; (8010c38 ) - 8010c24: 4770 bx lr - case USB_DESCRIPTOR_STRING: - if (dindex < 4) - 8010c26: 2a03 cmp r2, #3 - return &vcom_strings[dindex]; - 8010c28: bf9a itte ls - 8010c2a: 4b04 ldrls r3, [pc, #16] ; (8010c3c ) - 8010c2c: eb03 00c2 addls.w r0, r3, r2, lsl #3 - } - return NULL; - 8010c30: 2000 movhi r0, #0 -} - 8010c32: 4770 bx lr - 8010c34: 080136f0 .word 0x080136f0 - 8010c38: 08013570 .word 0x08013570 - 8010c3c: 080136c0 .word 0x080136c0 - -08010c40 : -/* - * Handles the USB driver global events. - */ -static void usb_event(USBDriver *usbp, usbevent_t event) { - - switch (event) { - 8010c40: 2902 cmp r1, #2 - 8010c42: d115 bne.n 8010c70 -}; - -/* - * Handles the USB driver global events. - */ -static void usb_event(USBDriver *usbp, usbevent_t event) { - 8010c44: b538 push {r3, r4, r5, lr} - 8010c46: 4605 mov r5, r0 - 8010c48: 460c mov r4, r1 - 8010c4a: 2320 movs r3, #32 - 8010c4c: f383 8811 msr BASEPRI, r3 - chSysLockFromISR(); - - /* Enables the endpoints specified into the configuration. - Note, this callback is invoked from an ISR so I-Class functions - must be used.*/ - usbInitEndpointI(usbp, USBD2_DATA_REQUEST_EP, &ep1config); - 8010c50: 2101 movs r1, #1 - 8010c52: 4a08 ldr r2, [pc, #32] ; (8010c74 ) - 8010c54: f7fc ff4c bl 800daf0 - usbInitEndpointI(usbp, USBD2_INTERRUPT_REQUEST_EP, &ep2config); - 8010c58: 4628 mov r0, r5 - 8010c5a: 4621 mov r1, r4 - 8010c5c: 4a06 ldr r2, [pc, #24] ; (8010c78 ) - 8010c5e: f7fc ff47 bl 800daf0 - - /* Resetting the state of the CDC subsystem.*/ - sduConfigureHookI(&SDU1); - 8010c62: 4806 ldr r0, [pc, #24] ; (8010c7c ) - 8010c64: f7fc fe3c bl 800d8e0 - 8010c68: 2300 movs r3, #0 - 8010c6a: f383 8811 msr BASEPRI, r3 - 8010c6e: bd38 pop {r3, r4, r5, pc} - 8010c70: 4770 bx lr - 8010c72: bf00 nop - 8010c74: 08013540 .word 0x08013540 - 8010c78: 08013580 .word 0x08013580 - 8010c7c: 20002a50 .word 0x20002a50 - -08010c80 : - USBD2_INTERRUPT_REQUEST_EP -}; - - -void usb_uart_init(void) -{ - 8010c80: b538 push {r3, r4, r5, lr} - sduObjectInit(&SDU1); - 8010c82: 4d0e ldr r5, [pc, #56] ; (8010cbc ) - /* - * Activates the USB driver and then the USB bus pull-up on D+. - * Note, a delay is inserted in order to not have to disconnect the cable - * after a reset. - */ - usbDisconnectBus(serusbcfg.usbp); - 8010c84: 4c0e ldr r4, [pc, #56] ; (8010cc0 ) -}; - - -void usb_uart_init(void) -{ - sduObjectInit(&SDU1); - 8010c86: 4628 mov r0, r5 - 8010c88: f7fc fde2 bl 800d850 - sduStart(&SDU1, &serusbcfg); - 8010c8c: 490d ldr r1, [pc, #52] ; (8010cc4 ) - 8010c8e: 4628 mov r0, r5 - 8010c90: f7fc fe06 bl 800d8a0 - /* - * Activates the USB driver and then the USB bus pull-up on D+. - * Note, a delay is inserted in order to not have to disconnect the cable - * after a reset. - */ - usbDisconnectBus(serusbcfg.usbp); - 8010c94: 6d22 ldr r2, [r4, #80] ; 0x50 - 8010c96: 6b93 ldr r3, [r2, #56] ; 0x38 - 8010c98: f423 2300 bic.w r3, r3, #524288 ; 0x80000 - 8010c9c: 6393 str r3, [r2, #56] ; 0x38 - chThdSleepMilliseconds(1500); - 8010c9e: f643 2098 movw r0, #15000 ; 0x3a98 - 8010ca2: f7fc f9fd bl 800d0a0 - usbStart(serusbcfg.usbp, &usbcfg); - 8010ca6: 4620 mov r0, r4 - 8010ca8: 4907 ldr r1, [pc, #28] ; (8010cc8 ) - 8010caa: f7fc ff09 bl 800dac0 - usbConnectBus(serusbcfg.usbp); - 8010cae: 6d22 ldr r2, [r4, #80] ; 0x50 - 8010cb0: 6b93 ldr r3, [r2, #56] ; 0x38 - 8010cb2: f443 2300 orr.w r3, r3, #524288 ; 0x80000 - 8010cb6: 6393 str r3, [r2, #56] ; 0x38 - 8010cb8: bd38 pop {r3, r4, r5, pc} - 8010cba: bf00 nop - 8010cbc: 20002a50 .word 0x20002a50 - 8010cc0: 20000fb0 .word 0x20000fb0 - 8010cc4: 080136e0 .word 0x080136e0 - 8010cc8: 080135b0 .word 0x080135b0 - 8010ccc: f3af 8000 nop.w - -08010cd0 : - -int usb_uart_write( uint8_t *p_data, uint32_t len ) -{ - int ret = 0; - - ret = chSequentialStreamWrite(&SDU1, p_data, len); - 8010cd0: 4b05 ldr r3, [pc, #20] ; (8010ce8 ) - return ret; -} - - -int usb_uart_write( uint8_t *p_data, uint32_t len ) -{ - 8010cd2: b410 push {r4} - int ret = 0; - - ret = chSequentialStreamWrite(&SDU1, p_data, len); - 8010cd4: 681c ldr r4, [r3, #0] - 8010cd6: 6824 ldr r4, [r4, #0] - return ret; -} - - -int usb_uart_write( uint8_t *p_data, uint32_t len ) -{ - 8010cd8: 460a mov r2, r1 - int ret = 0; - - ret = chSequentialStreamWrite(&SDU1, p_data, len); - 8010cda: 4601 mov r1, r0 - 8010cdc: 4618 mov r0, r3 - 8010cde: 4623 mov r3, r4 - - return ret; -} - 8010ce0: f85d 4b04 ldr.w r4, [sp], #4 - -int usb_uart_write( uint8_t *p_data, uint32_t len ) -{ - int ret = 0; - - ret = chSequentialStreamWrite(&SDU1, p_data, len); - 8010ce4: 4718 bx r3 - 8010ce6: bf00 nop - 8010ce8: 20002a50 .word 0x20002a50 - 8010cec: f3af 8000 nop.w - -08010cf0 : - - return ret; -} - -uint8_t usb_uart_getch( void ) -{ - 8010cf0: b500 push {lr} - uint8_t buffer[128]; - int len; - - - len = chSequentialStreamRead(&SDU1, (uint8_t*) buffer, 1); - 8010cf2: 4806 ldr r0, [pc, #24] ; (8010d0c ) - 8010cf4: 6803 ldr r3, [r0, #0] - - return ret; -} - -uint8_t usb_uart_getch( void ) -{ - 8010cf6: b0a1 sub sp, #132 ; 0x84 - uint8_t buffer[128]; - int len; - - - len = chSequentialStreamRead(&SDU1, (uint8_t*) buffer, 1); - 8010cf8: 685b ldr r3, [r3, #4] - 8010cfa: 4669 mov r1, sp - 8010cfc: 2201 movs r2, #1 - 8010cfe: 4798 blx r3 - - return buffer[0]; -} - 8010d00: f89d 0000 ldrb.w r0, [sp] - 8010d04: b021 add sp, #132 ; 0x84 - 8010d06: f85d fb04 ldr.w pc, [sp], #4 - 8010d0a: bf00 nop - 8010d0c: 20002a50 .word 0x20002a50 - -08010d10 : -#include "isr_vector_table.h" -#include "main.h" -#include "mcpwm.h" -#include "hw.h" - -CH_IRQ_HANDLER(TIM7_IRQHandler) { - 8010d10: b508 push {r3, lr} - CH_IRQ_PROLOGUE(); - TIM_ClearITPendingBit(TIM7, TIM_IT_Update); - 8010d12: 4804 ldr r0, [pc, #16] ; (8010d24 ) - 8010d14: 2101 movs r1, #1 - 8010d16: f001 fa23 bl 8012160 - - CH_IRQ_EPILOGUE(); -} - 8010d1a: e8bd 4008 ldmia.w sp!, {r3, lr} - -CH_IRQ_HANDLER(TIM7_IRQHandler) { - CH_IRQ_PROLOGUE(); - TIM_ClearITPendingBit(TIM7, TIM_IT_Update); - - CH_IRQ_EPILOGUE(); - 8010d1e: f7fc bc47 b.w 800d5b0 <_port_irq_epilogue> - 8010d22: bf00 nop - 8010d24: 40001400 .word 0x40001400 - 8010d28: f3af 8000 nop.w - 8010d2c: f3af 8000 nop.w - -08010d30 : -} - -CH_IRQ_HANDLER(ADC1_2_3_IRQHandler) { - 8010d30: b508 push {r3, lr} - CH_IRQ_PROLOGUE(); - ADC_ClearITPendingBit(ADC1, ADC_IT_JEOC); - 8010d32: 4805 ldr r0, [pc, #20] ; (8010d48 ) - 8010d34: f240 4107 movw r1, #1031 ; 0x407 - 8010d38: f000 fdba bl 80118b0 - mcpwm_adc_inj_int_handler(); - 8010d3c: f7ff fec0 bl 8010ac0 - CH_IRQ_EPILOGUE(); -} - 8010d40: e8bd 4008 ldmia.w sp!, {r3, lr} - -CH_IRQ_HANDLER(ADC1_2_3_IRQHandler) { - CH_IRQ_PROLOGUE(); - ADC_ClearITPendingBit(ADC1, ADC_IT_JEOC); - mcpwm_adc_inj_int_handler(); - CH_IRQ_EPILOGUE(); - 8010d44: f7fc bc34 b.w 800d5b0 <_port_irq_epilogue> - 8010d48: 40012000 .word 0x40012000 - 8010d4c: f3af 8000 nop.w - -08010d50 : -} - -CH_IRQ_HANDLER(HW_ENC_EXTI_ISR_VEC) { - 8010d50: b508 push {r3, lr} - if (EXTI_GetITStatus(HW_ENC_EXTI_LINE) != RESET) { - 8010d52: f44f 6000 mov.w r0, #2048 ; 0x800 - 8010d56: f000 fe1b bl 8011990 - 8010d5a: b900 cbnz r0, 8010d5e - 8010d5c: bd08 pop {r3, pc} - // Clear the encoder counter - HW_ENC_TIM->CNT = 0; - 8010d5e: 4b04 ldr r3, [pc, #16] ; (8010d70 ) - 8010d60: 2200 movs r2, #0 - 8010d62: 625a str r2, [r3, #36] ; 0x24 - - // Clear the EXTI line pending bit - EXTI_ClearITPendingBit(HW_ENC_EXTI_LINE); - 8010d64: f44f 6000 mov.w r0, #2048 ; 0x800 - } -} - 8010d68: e8bd 4008 ldmia.w sp!, {r3, lr} - if (EXTI_GetITStatus(HW_ENC_EXTI_LINE) != RESET) { - // Clear the encoder counter - HW_ENC_TIM->CNT = 0; - - // Clear the EXTI line pending bit - EXTI_ClearITPendingBit(HW_ENC_EXTI_LINE); - 8010d6c: f000 be20 b.w 80119b0 - 8010d70: 40000800 .word 0x40000800 - 8010d74: f3af 8000 nop.w - 8010d78: f3af 8000 nop.w - 8010d7c: f3af 8000 nop.w - -08010d80 : - chMtxLock(&send_mutex); - chSequentialStreamWrite(&SDU1, buffer, len); - chMtxUnlock(&send_mutex); -} - -void comm_usb_init(void) { - 8010d80: b508 push {r3, lr} - usb_uart_init(); - 8010d82: f7ff ff7d bl 8010c80 - //packet_init(send_packet, process_packet, PACKET_HANDLER); - - chMtxObjectInit(&send_mutex); - 8010d86: 4802 ldr r0, [pc, #8] ; (8010d90 ) - - // Threads - //chThdCreateStatic(serial_read_thread_wa, sizeof(serial_read_thread_wa), NORMALPRIO, serial_read_thread, NULL); - //chThdCreateStatic(serial_process_thread_wa, sizeof(serial_process_thread_wa), NORMALPRIO, serial_process_thread, NULL); -} - 8010d88: e8bd 4008 ldmia.w sp!, {r3, lr} - -void comm_usb_init(void) { - usb_uart_init(); - //packet_init(send_packet, process_packet, PACKET_HANDLER); - - chMtxObjectInit(&send_mutex); - 8010d8c: f7fc ba60 b.w 800d250 - 8010d90: 20002cd0 .word 0x20002cd0 - 8010d94: f3af 8000 nop.w - 8010d98: f3af 8000 nop.w - 8010d9c: f3af 8000 nop.w - -08010da0 : - * exist to unlock the system. That means, if lock is called five times, unlock has to - * be called five times as well. Note that chSysLock and chSysLockFromIsr are the same - * for this port. - */ -void utils_sys_lock_cnt(void) { - if (!sys_lock_cnt) { - 8010da0: 4b04 ldr r3, [pc, #16] ; (8010db4 ) - 8010da2: 681a ldr r2, [r3, #0] - 8010da4: b912 cbnz r2, 8010dac - 8010da6: 2220 movs r2, #32 - 8010da8: f382 8811 msr BASEPRI, r2 - chSysLock(); - } - sys_lock_cnt++; - 8010dac: 681a ldr r2, [r3, #0] - 8010dae: 3201 adds r2, #1 - 8010db0: 601a str r2, [r3, #0] - 8010db2: 4770 bx lr - 8010db4: 20002ce0 .word 0x20002ce0 - 8010db8: f3af 8000 nop.w - 8010dbc: f3af 8000 nop.w - -08010dc0 : - * exist to unlock the system. That means, if lock is called five times, unlock has to - * be called five times as well. Note that chSysUnlock and chSysUnlockFromIsr are the same - * for this port. - */ -void utils_sys_unlock_cnt(void) { - if (sys_lock_cnt) { - 8010dc0: 4b05 ldr r3, [pc, #20] ; (8010dd8 ) - 8010dc2: 681a ldr r2, [r3, #0] - 8010dc4: b132 cbz r2, 8010dd4 - sys_lock_cnt--; - 8010dc6: 681a ldr r2, [r3, #0] - 8010dc8: 3a01 subs r2, #1 - 8010dca: 601a str r2, [r3, #0] - if (!sys_lock_cnt) { - 8010dcc: 681b ldr r3, [r3, #0] - 8010dce: b90b cbnz r3, 8010dd4 - 8010dd0: f383 8811 msr BASEPRI, r3 - 8010dd4: 4770 bx lr - 8010dd6: bf00 nop - 8010dd8: 20002ce0 .word 0x20002ce0 - 8010ddc: f3af 8000 nop.w - -08010de0 : -#define EEPROM_BASE_APPCONF 2000 - -// Global variables -uint16_t VirtAddVarTab[NB_OF_VAR]; - -void conf_general_init(void) { - 8010de0: b508 push {r3, lr} - // First, make sure that all relevant virtual addresses are assigned for page swapping. - memset(VirtAddVarTab, 0, sizeof(VirtAddVarTab)); - 8010de2: 2100 movs r1, #0 - 8010de4: f44f 72a0 mov.w r2, #320 ; 0x140 - 8010de8: 4810 ldr r0, [pc, #64] ; (8010e2c ) - 8010dea: f002 f979 bl 80130e0 - 8010dee: 4a10 ldr r2, [pc, #64] ; (8010e30 ) - 8010df0: f44f 737a mov.w r3, #1000 ; 0x3e8 - 8010df4: f102 018c add.w r1, r2, #140 ; 0x8c - - int ind = 0; - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - VirtAddVarTab[ind++] = EEPROM_BASE_MCCONF + i; - 8010df8: f822 3f02 strh.w r3, [r2, #2]! - 8010dfc: 3301 adds r3, #1 -void conf_general_init(void) { - // First, make sure that all relevant virtual addresses are assigned for page swapping. - memset(VirtAddVarTab, 0, sizeof(VirtAddVarTab)); - - int ind = 0; - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - 8010dfe: 428a cmp r2, r1 - 8010e00: b29b uxth r3, r3 - 8010e02: d1f9 bne.n 8010df8 - 8010e04: 4a0b ldr r2, [pc, #44] ; (8010e34 ) - 8010e06: f44f 63fa mov.w r3, #2000 ; 0x7d0 - 8010e0a: f102 018c add.w r1, r2, #140 ; 0x8c - VirtAddVarTab[ind++] = EEPROM_BASE_MCCONF + i; - } - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - VirtAddVarTab[ind++] = EEPROM_BASE_APPCONF + i; - 8010e0e: f822 3f02 strh.w r3, [r2, #2]! - 8010e12: 3301 adds r3, #1 - int ind = 0; - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - VirtAddVarTab[ind++] = EEPROM_BASE_MCCONF + i; - } - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - 8010e14: 428a cmp r2, r1 - 8010e16: b29b uxth r3, r3 - 8010e18: d1f9 bne.n 8010e0e - VirtAddVarTab[ind++] = EEPROM_BASE_APPCONF + i; - } - - FLASH_Unlock(); - 8010e1a: f000 fdd1 bl 80119c0 - FLASH_ClearFlag(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | - 8010e1e: 20f2 movs r0, #242 ; 0xf2 - 8010e20: f000 fdde bl 80119e0 - FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - EE_Init(); -} - 8010e24: e8bd 4008 ldmia.w sp!, {r3, lr} - } - - FLASH_Unlock(); - FLASH_ClearFlag(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | - FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - EE_Init(); - 8010e28: f000 ba1a b.w 8011260 - 8010e2c: 20002ce4 .word 0x20002ce4 - 8010e30: 20002ce2 .word 0x20002ce2 - 8010e34: 20002d6e .word 0x20002d6e - 8010e38: f3af 8000 nop.w - 8010e3c: f3af 8000 nop.w - -08010e40 : - * Read app_configuration from EEPROM. If this fails, default values will be used. - * - * @param conf - * A pointer to a app_configuration struct to write the read configuration to. - */ -void conf_general_read_app_configuration(app_configuration *conf) { - 8010e40: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - 8010e44: 4605 mov r5, r0 - 8010e46: b083 sub sp, #12 - 8010e48: 4606 mov r6, r0 - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - 8010e4a: 2400 movs r4, #0 - 8010e4c: e00a b.n 8010e64 - if (EE_ReadVariable(EEPROM_BASE_APPCONF + i, &var) == 0) { - conf_addr[2 * i] = (var >> 8) & 0xFF; - 8010e4e: f8bd 3006 ldrh.w r3, [sp, #6] - 8010e52: 0a1a lsrs r2, r3, #8 - 8010e54: f805 2014 strb.w r2, [r5, r4, lsl #1] -void conf_general_read_app_configuration(app_configuration *conf) { - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - 8010e58: 3401 adds r4, #1 - 8010e5a: 2c46 cmp r4, #70 ; 0x46 - if (EE_ReadVariable(EEPROM_BASE_APPCONF + i, &var) == 0) { - conf_addr[2 * i] = (var >> 8) & 0xFF; - conf_addr[2 * i + 1] = var & 0xFF; - 8010e5c: 7073 strb r3, [r6, #1] - 8010e5e: f106 0602 add.w r6, r6, #2 -void conf_general_read_app_configuration(app_configuration *conf) { - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - 8010e62: d06b beq.n 8010f3c - 8010e64: f504 60fa add.w r0, r4, #2000 ; 0x7d0 - if (EE_ReadVariable(EEPROM_BASE_APPCONF + i, &var) == 0) { - 8010e68: b280 uxth r0, r0 - 8010e6a: f10d 0106 add.w r1, sp, #6 - 8010e6e: f000 f9bf bl 80111f0 - 8010e72: 2800 cmp r0, #0 - 8010e74: d0eb beq.n 8010e4e - } - } - - // Set the default configuration - if (!is_ok) { - memset(conf, 0, sizeof(app_configuration)); - 8010e76: 2100 movs r1, #0 - 8010e78: 228c movs r2, #140 ; 0x8c - 8010e7a: 4628 mov r0, r5 - 8010e7c: f002 f930 bl 80130e0 - conf->app_ppm_conf.pulse_start = 1.0; - conf->app_ppm_conf.pulse_end = 2.0; - conf->app_ppm_conf.median_filter = false; - conf->app_ppm_conf.safe_start = true; - conf->app_ppm_conf.rpm_lim_start = 150000.0; - conf->app_ppm_conf.rpm_lim_end = 200000.0; - 8010e80: 4f30 ldr r7, [pc, #192] ; (8010f44 ) - // The default app is UART in case the UART port is used for - // firmware updates. - conf->app_to_use = APP_UART; - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - conf->app_ppm_conf.pid_max_erpm = 15000; - 8010e82: 4b31 ldr r3, [pc, #196] ; (8010f48 ) - conf->app_ppm_conf.tc = false; - conf->app_ppm_conf.tc_max_diff = 3000.0; - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - conf->app_adc_conf.hyst = 0.15; - conf->app_adc_conf.voltage_start = 0.9; - 8010e84: f8df c0d0 ldr.w ip, [pc, #208] ; 8010f58 - // firmware updates. - conf->app_to_use = APP_UART; - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - conf->app_ppm_conf.pid_max_erpm = 15000; - conf->app_ppm_conf.hyst = 0.15; - 8010e88: 4c30 ldr r4, [pc, #192] ; (8010f4c ) - conf->app_ppm_conf.pulse_start = 1.0; - conf->app_ppm_conf.pulse_end = 2.0; - conf->app_ppm_conf.median_filter = false; - conf->app_ppm_conf.safe_start = true; - conf->app_ppm_conf.rpm_lim_start = 150000.0; - 8010e8a: 4831 ldr r0, [pc, #196] ; (8010f50 ) - conf->app_ppm_conf.rpm_lim_end = 200000.0; - conf->app_ppm_conf.multi_esc = false; - conf->app_ppm_conf.tc = false; - conf->app_ppm_conf.tc_max_diff = 3000.0; - 8010e8c: 4931 ldr r1, [pc, #196] ; (8010f54 ) - // The default app is UART in case the UART port is used for - // firmware updates. - conf->app_to_use = APP_UART; - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - conf->app_ppm_conf.pid_max_erpm = 15000; - 8010e8e: 61eb str r3, [r5, #28] - memset(conf, 0, sizeof(app_configuration)); - conf->controller_id = 0; - conf->timeout_msec = 1000; - conf->timeout_brake_current = 0.0; - conf->send_can_status = false; - conf->send_can_status_rate_hz = 500; - 8010e90: f44f 76fa mov.w r6, #500 ; 0x1f4 - } - - // Set the default configuration - if (!is_ok) { - memset(conf, 0, sizeof(app_configuration)); - conf->controller_id = 0; - 8010e94: 2300 movs r3, #0 - conf->app_ppm_conf.pid_max_erpm = 15000; - conf->app_ppm_conf.hyst = 0.15; - conf->app_ppm_conf.pulse_start = 1.0; - conf->app_ppm_conf.pulse_end = 2.0; - conf->app_ppm_conf.median_filter = false; - conf->app_ppm_conf.safe_start = true; - 8010e96: 2201 movs r2, #1 - conf->app_ppm_conf.rpm_lim_start = 150000.0; - conf->app_ppm_conf.rpm_lim_end = 200000.0; - 8010e98: 636f str r7, [r5, #52] ; 0x34 - conf->app_adc_conf.use_filter = true; - conf->app_adc_conf.safe_start = true; - conf->app_adc_conf.button_inverted = false; - conf->app_adc_conf.voltage_inverted = false; - conf->app_adc_conf.rpm_lim_start = 150000; - conf->app_adc_conf.rpm_lim_end = 200000; - 8010e9a: 65af str r7, [r5, #88] ; 0x58 - conf->app_ppm_conf.tc = false; - conf->app_ppm_conf.tc_max_diff = 3000.0; - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - conf->app_adc_conf.hyst = 0.15; - conf->app_adc_conf.voltage_start = 0.9; - 8010e9c: f8c5 c048 str.w ip, [r5, #72] ; 0x48 - memset(conf, 0, sizeof(app_configuration)); - conf->controller_id = 0; - conf->timeout_msec = 1000; - conf->timeout_brake_current = 0.0; - conf->send_can_status = false; - conf->send_can_status_rate_hz = 500; - 8010ea0: 612e str r6, [r5, #16] - conf->app_adc_conf.rpm_lim_start = 150000; - conf->app_adc_conf.rpm_lim_end = 200000; - conf->app_adc_conf.multi_esc = false; - conf->app_adc_conf.tc = false; - conf->app_adc_conf.tc_max_diff = 3000.0; - conf->app_adc_conf.update_rate_hz = 500; - 8010ea2: 666e str r6, [r5, #100] ; 0x64 - conf->app_uart_baudrate = 115200; - - conf->app_chuk_conf.ctrl_type = CHUK_CTRL_TYPE_CURRENT; - conf->app_chuk_conf.hyst = 0.15; - conf->app_chuk_conf.rpm_lim_start = 150000.0; - conf->app_chuk_conf.rpm_lim_end = 250000.0; - 8010ea4: f8df e0b4 ldr.w lr, [pc, #180] ; 8010f5c - conf->app_ppm_conf.tc_max_diff = 3000.0; - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - conf->app_adc_conf.hyst = 0.15; - conf->app_adc_conf.voltage_start = 0.9; - conf->app_adc_conf.voltage_end = 3.0; - 8010ea8: f8df 80b4 ldr.w r8, [pc, #180] ; 8010f60 - // firmware updates. - conf->app_to_use = APP_UART; - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - conf->app_ppm_conf.pid_max_erpm = 15000; - conf->app_ppm_conf.hyst = 0.15; - 8010eac: 622c str r4, [r5, #32] - - // Set the default configuration - if (!is_ok) { - memset(conf, 0, sizeof(app_configuration)); - conf->controller_id = 0; - conf->timeout_msec = 1000; - 8010eae: f44f 7b7a mov.w fp, #1000 ; 0x3e8 - conf->send_can_status = false; - conf->send_can_status_rate_hz = 500; - - // The default app is UART in case the UART port is used for - // firmware updates. - conf->app_to_use = APP_UART; - 8010eb2: f04f 0903 mov.w r9, #3 - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - conf->app_ppm_conf.pid_max_erpm = 15000; - conf->app_ppm_conf.hyst = 0.15; - conf->app_ppm_conf.pulse_start = 1.0; - 8010eb6: eef7 7a00 vmov.f32 s15, #112 ; 0x70 - conf->app_ppm_conf.pulse_end = 2.0; - 8010eba: f04f 4a80 mov.w sl, #1073741824 ; 0x40000000 - conf->app_adc_conf.multi_esc = false; - conf->app_adc_conf.tc = false; - conf->app_adc_conf.tc_max_diff = 3000.0; - conf->app_adc_conf.update_rate_hz = 500; - - conf->app_uart_baudrate = 115200; - 8010ebe: f44f 3ce1 mov.w ip, #115200 ; 0x1c200 - - conf->app_chuk_conf.ctrl_type = CHUK_CTRL_TYPE_CURRENT; - conf->app_chuk_conf.hyst = 0.15; - conf->app_chuk_conf.rpm_lim_start = 150000.0; - conf->app_chuk_conf.rpm_lim_end = 250000.0; - conf->app_chuk_conf.ramp_time_pos = 0.5; - 8010ec2: f04f 577c mov.w r7, #1056964608 ; 0x3f000000 - conf->app_chuk_conf.ramp_time_neg = 0.25; - 8010ec6: f04f 567a mov.w r6, #1048576000 ; 0x3e800000 - conf->app_ppm_conf.multi_esc = false; - conf->app_ppm_conf.tc = false; - conf->app_ppm_conf.tc_max_diff = 3000.0; - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - conf->app_adc_conf.hyst = 0.15; - 8010eca: 646c str r4, [r5, #68] ; 0x44 - conf->app_ppm_conf.hyst = 0.15; - conf->app_ppm_conf.pulse_start = 1.0; - conf->app_ppm_conf.pulse_end = 2.0; - conf->app_ppm_conf.median_filter = false; - conf->app_ppm_conf.safe_start = true; - conf->app_ppm_conf.rpm_lim_start = 150000.0; - 8010ecc: 6328 str r0, [r5, #48] ; 0x30 - conf->app_adc_conf.voltage_end = 3.0; - conf->app_adc_conf.use_filter = true; - conf->app_adc_conf.safe_start = true; - conf->app_adc_conf.button_inverted = false; - conf->app_adc_conf.voltage_inverted = false; - conf->app_adc_conf.rpm_lim_start = 150000; - 8010ece: 6568 str r0, [r5, #84] ; 0x54 - conf->app_ppm_conf.safe_start = true; - conf->app_ppm_conf.rpm_lim_start = 150000.0; - conf->app_ppm_conf.rpm_lim_end = 200000.0; - conf->app_ppm_conf.multi_esc = false; - conf->app_ppm_conf.tc = false; - conf->app_ppm_conf.tc_max_diff = 3000.0; - 8010ed0: 63e9 str r1, [r5, #60] ; 0x3c - conf->app_adc_conf.voltage_inverted = false; - conf->app_adc_conf.rpm_lim_start = 150000; - conf->app_adc_conf.rpm_lim_end = 200000; - conf->app_adc_conf.multi_esc = false; - conf->app_adc_conf.tc = false; - conf->app_adc_conf.tc_max_diff = 3000.0; - 8010ed2: 6629 str r1, [r5, #96] ; 0x60 - } - - // Set the default configuration - if (!is_ok) { - memset(conf, 0, sizeof(app_configuration)); - conf->controller_id = 0; - 8010ed4: 702b strb r3, [r5, #0] - conf->timeout_msec = 1000; - conf->timeout_brake_current = 0.0; - conf->send_can_status = false; - 8010ed6: 732b strb r3, [r5, #12] - - // The default app is UART in case the UART port is used for - // firmware updates. - conf->app_to_use = APP_UART; - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - 8010ed8: 762b strb r3, [r5, #24] - conf->app_ppm_conf.pid_max_erpm = 15000; - conf->app_ppm_conf.hyst = 0.15; - conf->app_ppm_conf.pulse_start = 1.0; - conf->app_ppm_conf.pulse_end = 2.0; - conf->app_ppm_conf.median_filter = false; - 8010eda: f885 302c strb.w r3, [r5, #44] ; 0x2c - conf->app_ppm_conf.safe_start = true; - conf->app_ppm_conf.rpm_lim_start = 150000.0; - conf->app_ppm_conf.rpm_lim_end = 200000.0; - conf->app_ppm_conf.multi_esc = false; - 8010ede: f885 3038 strb.w r3, [r5, #56] ; 0x38 - conf->app_ppm_conf.tc = false; - 8010ee2: f885 3039 strb.w r3, [r5, #57] ; 0x39 - conf->app_ppm_conf.tc_max_diff = 3000.0; - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - 8010ee6: f885 3040 strb.w r3, [r5, #64] ; 0x40 - conf->app_adc_conf.hyst = 0.15; - conf->app_adc_conf.voltage_start = 0.9; - conf->app_adc_conf.voltage_end = 3.0; - conf->app_adc_conf.use_filter = true; - conf->app_adc_conf.safe_start = true; - conf->app_adc_conf.button_inverted = false; - 8010eea: f885 3052 strb.w r3, [r5, #82] ; 0x52 - conf->app_adc_conf.voltage_inverted = false; - 8010eee: f885 3053 strb.w r3, [r5, #83] ; 0x53 - conf->app_adc_conf.rpm_lim_start = 150000; - conf->app_adc_conf.rpm_lim_end = 200000; - conf->app_adc_conf.multi_esc = false; - 8010ef2: f885 305c strb.w r3, [r5, #92] ; 0x5c - conf->app_adc_conf.tc = false; - 8010ef6: f885 305d strb.w r3, [r5, #93] ; 0x5d - - // Set the default configuration - if (!is_ok) { - memset(conf, 0, sizeof(app_configuration)); - conf->controller_id = 0; - conf->timeout_msec = 1000; - 8010efa: f8c5 b004 str.w fp, [r5, #4] - conf->send_can_status = false; - conf->send_can_status_rate_hz = 500; - - // The default app is UART in case the UART port is used for - // firmware updates. - conf->app_to_use = APP_UART; - 8010efe: f885 9014 strb.w r9, [r5, #20] - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - conf->app_ppm_conf.pid_max_erpm = 15000; - conf->app_ppm_conf.hyst = 0.15; - conf->app_ppm_conf.pulse_start = 1.0; - 8010f02: edc5 7a09 vstr s15, [r5, #36] ; 0x24 - conf->app_ppm_conf.pulse_end = 2.0; - 8010f06: f8c5 a028 str.w sl, [r5, #40] ; 0x28 - conf->app_ppm_conf.median_filter = false; - conf->app_ppm_conf.safe_start = true; - 8010f0a: f885 202d strb.w r2, [r5, #45] ; 0x2d - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - conf->app_adc_conf.hyst = 0.15; - conf->app_adc_conf.voltage_start = 0.9; - conf->app_adc_conf.voltage_end = 3.0; - conf->app_adc_conf.use_filter = true; - 8010f0e: f885 2050 strb.w r2, [r5, #80] ; 0x50 - conf->app_adc_conf.safe_start = true; - 8010f12: f885 2051 strb.w r2, [r5, #81] ; 0x51 - conf->app_adc_conf.tc_max_diff = 3000.0; - conf->app_adc_conf.update_rate_hz = 500; - - conf->app_uart_baudrate = 115200; - - conf->app_chuk_conf.ctrl_type = CHUK_CTRL_TYPE_CURRENT; - 8010f16: f885 206c strb.w r2, [r5, #108] ; 0x6c - conf->app_ppm_conf.tc_max_diff = 3000.0; - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - conf->app_adc_conf.hyst = 0.15; - conf->app_adc_conf.voltage_start = 0.9; - conf->app_adc_conf.voltage_end = 3.0; - 8010f1a: f8c5 804c str.w r8, [r5, #76] ; 0x4c - conf->app_adc_conf.multi_esc = false; - conf->app_adc_conf.tc = false; - conf->app_adc_conf.tc_max_diff = 3000.0; - conf->app_adc_conf.update_rate_hz = 500; - - conf->app_uart_baudrate = 115200; - 8010f1e: f8c5 c068 str.w ip, [r5, #104] ; 0x68 - - conf->app_chuk_conf.ctrl_type = CHUK_CTRL_TYPE_CURRENT; - conf->app_chuk_conf.hyst = 0.15; - 8010f22: 672c str r4, [r5, #112] ; 0x70 - conf->app_chuk_conf.rpm_lim_start = 150000.0; - 8010f24: 6768 str r0, [r5, #116] ; 0x74 - conf->app_chuk_conf.rpm_lim_end = 250000.0; - conf->app_chuk_conf.ramp_time_pos = 0.5; - conf->app_chuk_conf.ramp_time_neg = 0.25; - conf->app_chuk_conf.multi_esc = true; - 8010f26: f885 2084 strb.w r2, [r5, #132] ; 0x84 - conf->app_chuk_conf.tc = false; - 8010f2a: f885 3085 strb.w r3, [r5, #133] ; 0x85 - conf->app_chuk_conf.tc_max_diff = 3000.0; - 8010f2e: f8c5 1088 str.w r1, [r5, #136] ; 0x88 - conf->app_uart_baudrate = 115200; - - conf->app_chuk_conf.ctrl_type = CHUK_CTRL_TYPE_CURRENT; - conf->app_chuk_conf.hyst = 0.15; - conf->app_chuk_conf.rpm_lim_start = 150000.0; - conf->app_chuk_conf.rpm_lim_end = 250000.0; - 8010f32: f8c5 e078 str.w lr, [r5, #120] ; 0x78 - conf->app_chuk_conf.ramp_time_pos = 0.5; - 8010f36: 67ef str r7, [r5, #124] ; 0x7c - conf->app_chuk_conf.ramp_time_neg = 0.25; - 8010f38: f8c5 6080 str.w r6, [r5, #128] ; 0x80 - conf->app_chuk_conf.multi_esc = true; - conf->app_chuk_conf.tc = false; - conf->app_chuk_conf.tc_max_diff = 3000.0; - } -} - 8010f3c: b003 add sp, #12 - 8010f3e: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 8010f42: bf00 nop - 8010f44: 48435000 .word 0x48435000 - 8010f48: 466a6000 .word 0x466a6000 - 8010f4c: 3e19999a .word 0x3e19999a - 8010f50: 48127c00 .word 0x48127c00 - 8010f54: 453b8000 .word 0x453b8000 - 8010f58: 3f666666 .word 0x3f666666 - 8010f5c: 48742400 .word 0x48742400 - 8010f60: 40400000 .word 0x40400000 - 8010f64: f3af 8000 nop.w - 8010f68: f3af 8000 nop.w - 8010f6c: f3af 8000 nop.w - -08010f70 : - * Read mc_configuration from EEPROM. If this fails, default values will be used. - * - * @param conf - * A pointer to a mc_configuration struct to write the read configuration to. - */ -void conf_general_read_mc_configuration(mc_configuration *conf) { - 8010f70: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - 8010f74: 4605 mov r5, r0 - 8010f76: b083 sub sp, #12 - 8010f78: 4606 mov r6, r0 - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(mc_configuration) / 2);i++) { - 8010f7a: 2400 movs r4, #0 - 8010f7c: e00b b.n 8010f96 - if (EE_ReadVariable(EEPROM_BASE_MCCONF + i, &var) == 0) { - conf_addr[2 * i] = (var >> 8) & 0xFF; - 8010f7e: f8bd 3006 ldrh.w r3, [sp, #6] - 8010f82: 0a1a lsrs r2, r3, #8 - 8010f84: f805 2014 strb.w r2, [r5, r4, lsl #1] -void conf_general_read_mc_configuration(mc_configuration *conf) { - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(mc_configuration) / 2);i++) { - 8010f88: 3401 adds r4, #1 - 8010f8a: 2c58 cmp r4, #88 ; 0x58 - if (EE_ReadVariable(EEPROM_BASE_MCCONF + i, &var) == 0) { - conf_addr[2 * i] = (var >> 8) & 0xFF; - conf_addr[2 * i + 1] = var & 0xFF; - 8010f8c: 7073 strb r3, [r6, #1] - 8010f8e: f106 0602 add.w r6, r6, #2 -void conf_general_read_mc_configuration(mc_configuration *conf) { - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(mc_configuration) / 2);i++) { - 8010f92: f000 8088 beq.w 80110a6 - 8010f96: f504 707a add.w r0, r4, #1000 ; 0x3e8 - if (EE_ReadVariable(EEPROM_BASE_MCCONF + i, &var) == 0) { - 8010f9a: b280 uxth r0, r0 - 8010f9c: f10d 0106 add.w r1, sp, #6 - 8010fa0: f000 f926 bl 80111f0 - 8010fa4: 2800 cmp r0, #0 - 8010fa6: d0ea beq.n 8010f7e - if (!is_ok) { - conf->pwm_mode = MCPWM_PWM_MODE; - conf->comm_mode = MCPWM_COMM_MODE; - conf->motor_type = MC_DEFAULT_MOTOR_TYPE; - - conf->l_current_max = MCPWM_CURRENT_MAX; - 8010fa8: 4b40 ldr r3, [pc, #256] ; (80110ac ) - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - conf->l_slow_abs_current = MCPWM_SLOW_ABS_OVERCURRENT; - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - 8010faa: 4a41 ldr r2, [pc, #260] ; (80110b0 ) - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - conf->l_in_current_min = MCPWM_IN_CURRENT_MIN; - conf->l_abs_current_max = MCPWM_MAX_ABS_CURRENT; - conf->l_min_erpm = MCPWM_RPM_MIN; - 8010fac: f8df e130 ldr.w lr, [pc, #304] ; 80110e0 - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - 8010fb0: eddf 7a40 vldr s15, [pc, #256] ; 80110b4 - conf->pwm_mode = MCPWM_PWM_MODE; - conf->comm_mode = MCPWM_COMM_MODE; - conf->motor_type = MC_DEFAULT_MOTOR_TYPE; - - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - 8010fb4: 4940 ldr r1, [pc, #256] ; (80110b8 ) - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - conf->l_slow_abs_current = MCPWM_SLOW_ABS_OVERCURRENT; - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - 8010fb6: 4f41 ldr r7, [pc, #260] ; (80110bc ) - - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - conf->l_in_current_min = MCPWM_IN_CURRENT_MIN; - conf->l_abs_current_max = MCPWM_MAX_ABS_CURRENT; - 8010fb8: f8df a128 ldr.w sl, [pc, #296] ; 80110e4 - conf->l_min_erpm = MCPWM_RPM_MIN; - conf->l_max_erpm = MCPWM_RPM_MAX; - 8010fbc: f8df 9128 ldr.w r9, [pc, #296] ; 80110e8 - conf->l_max_erpm_fbrake = MCPWM_CURR_MAX_RPM_FBRAKE; - 8010fc0: 4c3f ldr r4, [pc, #252] ; (80110c0 ) - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - 8010fc2: 4840 ldr r0, [pc, #256] ; (80110c4 ) - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - 8010fc4: f8df 8124 ldr.w r8, [pc, #292] ; 80110ec - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - conf->l_temp_motor_start = MCPWM_LIM_TEMP_MOTOR_START; - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - conf->l_min_duty = MCPWM_MIN_DUTY; - conf->l_max_duty = MCPWM_MAX_DUTY; - 8010fc8: f8df c124 ldr.w ip, [pc, #292] ; 80110f0 - if (!is_ok) { - conf->pwm_mode = MCPWM_PWM_MODE; - conf->comm_mode = MCPWM_COMM_MODE; - conf->motor_type = MC_DEFAULT_MOTOR_TYPE; - - conf->l_current_max = MCPWM_CURRENT_MAX; - 8010fcc: 606b str r3, [r5, #4] - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - 8010fce: 60eb str r3, [r5, #12] - conf->l_temp_motor_start = MCPWM_LIM_TEMP_MOTOR_START; - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - conf->l_min_duty = MCPWM_MIN_DUTY; - conf->l_max_duty = MCPWM_MAX_DUTY; - - conf->lo_current_max = conf->l_current_max; - 8010fd0: 64eb str r3, [r5, #76] ; 0x4c - conf->lo_current_min = conf->l_current_min; - conf->lo_in_current_max = conf->l_in_current_max; - 8010fd2: 656b str r3, [r5, #84] ; 0x54 - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - conf->sl_phase_advance_at_br = MCPWM_CYCLE_INT_LIMIT_HIGH_FAC; - 8010fd4: f8df b11c ldr.w fp, [pc, #284] ; 80110f4 - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - 8010fd8: 4b3b ldr r3, [pc, #236] ; (80110c8 ) - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - conf->l_in_current_min = MCPWM_IN_CURRENT_MIN; - conf->l_abs_current_max = MCPWM_MAX_ABS_CURRENT; - conf->l_min_erpm = MCPWM_RPM_MIN; - 8010fda: f8c5 e018 str.w lr, [r5, #24] - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - conf->l_slow_abs_current = MCPWM_SLOW_ABS_OVERCURRENT; - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - 8010fde: 63aa str r2, [r5, #56] ; 0x38 - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - conf->sl_phase_advance_at_br = MCPWM_CYCLE_INT_LIMIT_HIGH_FAC; - conf->sl_cycle_int_rpm_br = MCPWM_CYCLE_INT_START_RPM_BR; - 8010fe0: f8df e114 ldr.w lr, [pc, #276] ; 80110f8 - conf->l_slow_abs_current = MCPWM_SLOW_ABS_OVERCURRENT; - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - conf->l_temp_motor_start = MCPWM_LIM_TEMP_MOTOR_START; - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - 8010fe4: 642a str r2, [r5, #64] ; 0x40 - conf->lo_current_min = conf->l_current_min; - conf->lo_in_current_max = conf->l_in_current_max; - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - 8010fe6: ed9f 7a39 vldr s14, [pc, #228] ; 80110cc - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - conf->l_temp_motor_start = MCPWM_LIM_TEMP_MOTOR_START; - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - conf->l_min_duty = MCPWM_MIN_DUTY; - 8010fea: 4e39 ldr r6, [pc, #228] ; (80110d0 ) - conf->pwm_mode = MCPWM_PWM_MODE; - conf->comm_mode = MCPWM_COMM_MODE; - conf->motor_type = MC_DEFAULT_MOTOR_TYPE; - - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - 8010fec: 60a9 str r1, [r5, #8] - break; - } - } - - if (!is_ok) { - conf->pwm_mode = MCPWM_PWM_MODE; - 8010fee: 2201 movs r2, #1 - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - conf->l_min_duty = MCPWM_MIN_DUTY; - conf->l_max_duty = MCPWM_MAX_DUTY; - - conf->lo_current_max = conf->l_current_max; - conf->lo_current_min = conf->l_current_min; - 8010ff0: 6529 str r1, [r5, #80] ; 0x50 - - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - conf->l_in_current_min = MCPWM_IN_CURRENT_MIN; - conf->l_abs_current_max = MCPWM_MAX_ABS_CURRENT; - 8010ff2: f8c5 a014 str.w sl, [r5, #20] - conf->l_min_erpm = MCPWM_RPM_MIN; - conf->l_max_erpm = MCPWM_RPM_MAX; - 8010ff6: f8c5 901c str.w r9, [r5, #28] - conf->l_max_erpm_fbrake = MCPWM_CURR_MAX_RPM_FBRAKE; - 8010ffa: 622c str r4, [r5, #32] - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - 8010ffc: 6268 str r0, [r5, #36] ; 0x24 - - conf->hall_dir = MCPWM_HALL_DIR; - conf->hall_fwd_add = MCPWM_HALL_FWD_ADD; - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - - conf->s_pid_kp = MCPWM_PID_KP; - 8010ffe: 4c35 ldr r4, [pc, #212] ; (80110d4 ) - conf->s_pid_ki = MCPWM_PID_KI; - 8011000: 4835 ldr r0, [pc, #212] ; (80110d8 ) - conf->l_min_erpm = MCPWM_RPM_MIN; - conf->l_max_erpm = MCPWM_RPM_MAX; - conf->l_max_erpm_fbrake = MCPWM_CURR_MAX_RPM_FBRAKE; - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - 8011002: f8c5 802c str.w r8, [r5, #44] ; 0x2c - conf->hall_fwd_add = MCPWM_HALL_FWD_ADD; - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - - conf->s_pid_kp = MCPWM_PID_KP; - conf->s_pid_ki = MCPWM_PID_KI; - conf->s_pid_kd = MCPWM_PID_KD; - 8011006: 2100 movs r1, #0 - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - conf->l_slow_abs_current = MCPWM_SLOW_ABS_OVERCURRENT; - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - 8011008: 636f str r7, [r5, #52] ; 0x34 - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - conf->l_temp_motor_start = MCPWM_LIM_TEMP_MOTOR_START; - 801100a: 63ef str r7, [r5, #60] ; 0x3c - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - conf->l_min_duty = MCPWM_MIN_DUTY; - conf->l_max_duty = MCPWM_MAX_DUTY; - 801100c: f8c5 c048 str.w ip, [r5, #72] ; 0x48 - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - 8011010: 666b str r3, [r5, #100] ; 0x64 - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - 8011012: edc5 7a1b vstr s15, [r5, #108] ; 0x6c - } - } - - if (!is_ok) { - conf->pwm_mode = MCPWM_PWM_MODE; - conf->comm_mode = MCPWM_COMM_MODE; - 8011016: 2300 movs r3, #0 - conf->motor_type = MC_DEFAULT_MOTOR_TYPE; - - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - conf->l_in_current_min = MCPWM_IN_CURRENT_MIN; - 8011018: 4f30 ldr r7, [pc, #192] ; (80110dc ) - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - conf->sl_phase_advance_at_br = MCPWM_CYCLE_INT_LIMIT_HIGH_FAC; - 801101a: f8c5 b070 str.w fp, [r5, #112] ; 0x70 - conf->sl_cycle_int_rpm_br = MCPWM_CYCLE_INT_START_RPM_BR; - 801101e: f8c5 e074 str.w lr, [r5, #116] ; 0x74 - break; - } - } - - if (!is_ok) { - conf->pwm_mode = MCPWM_PWM_MODE; - 8011022: 702a strb r2, [r5, #0] - conf->l_max_erpm = MCPWM_RPM_MAX; - conf->l_max_erpm_fbrake = MCPWM_CURR_MAX_RPM_FBRAKE; - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - conf->l_slow_abs_current = MCPWM_SLOW_ABS_OVERCURRENT; - 8011024: f885 2030 strb.w r2, [r5, #48] ; 0x30 - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - 8011028: f885 2031 strb.w r2, [r5, #49] ; 0x31 - conf->lo_current_max = conf->l_current_max; - conf->lo_current_min = conf->l_current_min; - conf->lo_in_current_max = conf->l_in_current_max; - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - 801102c: f885 205c strb.w r2, [r5, #92] ; 0x5c - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - conf->sl_phase_advance_at_br = MCPWM_CYCLE_INT_LIMIT_HIGH_FAC; - conf->sl_cycle_int_rpm_br = MCPWM_CYCLE_INT_START_RPM_BR; - conf->sl_bemf_coupling_k = MCPWM_BEMF_INPUT_COUPLING_K; - 8011030: f8df a0c8 ldr.w sl, [pc, #200] ; 80110fc - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - - conf->s_pid_kp = MCPWM_PID_KP; - conf->s_pid_ki = MCPWM_PID_KI; - conf->s_pid_kd = MCPWM_PID_KD; - conf->s_pid_min_rpm = MCPWM_PID_MIN_RPM; - 8011034: f8df 90c8 ldr.w r9, [pc, #200] ; 8011100 - conf->p_pid_ki = MCPWM_P_PID_KI; - conf->p_pid_kd = MCPWM_P_PID_KD; - - conf->cc_startup_boost_duty = MCPWM_CURRENT_STARTUP_BOOST; - conf->cc_min_current = MCPWM_CURRENT_CONTROL_MIN; - conf->cc_gain = MCPWM_CURRENT_CONTROL_GAIN; - 8011038: f8df 80c8 ldr.w r8, [pc, #200] ; 8011104 - conf->cc_ramp_step_max = 0.04; - 801103c: f8df c0c8 ldr.w ip, [pc, #200] ; 8011108 - conf->lo_in_current_max = conf->l_in_current_max; - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - 8011040: f8df b0c8 ldr.w fp, [pc, #200] ; 801110c - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - conf->l_temp_motor_start = MCPWM_LIM_TEMP_MOTOR_START; - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - conf->l_min_duty = MCPWM_MIN_DUTY; - 8011044: 646e str r6, [r5, #68] ; 0x44 - conf->l_abs_current_max = MCPWM_MAX_ABS_CURRENT; - conf->l_min_erpm = MCPWM_RPM_MIN; - conf->l_max_erpm = MCPWM_RPM_MAX; - conf->l_max_erpm_fbrake = MCPWM_CURR_MAX_RPM_FBRAKE; - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - 8011046: eef2 7a00 vmov.f32 s15, #32 - conf->p_pid_kp = MCPWM_P_PID_KP; - conf->p_pid_ki = MCPWM_P_PID_KI; - conf->p_pid_kd = MCPWM_P_PID_KD; - - conf->cc_startup_boost_duty = MCPWM_CURRENT_STARTUP_BOOST; - conf->cc_min_current = MCPWM_CURRENT_CONTROL_MIN; - 801104a: f04f 5e7e mov.w lr, #1065353216 ; 0x3f800000 - conf->cc_gain = MCPWM_CURRENT_CONTROL_GAIN; - conf->cc_ramp_step_max = 0.04; - - conf->m_fault_stop_time_ms = MCPWM_FAULT_STOP_TIME; - 801104e: f640 32b8 movw r2, #3000 ; 0xbb8 - conf->lo_current_min = conf->l_current_min; - conf->lo_in_current_max = conf->l_in_current_max; - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - 8011052: ed85 7a18 vstr s14, [r5, #96] ; 0x60 - } - } - - if (!is_ok) { - conf->pwm_mode = MCPWM_PWM_MODE; - conf->comm_mode = MCPWM_COMM_MODE; - 8011056: 706b strb r3, [r5, #1] - conf->motor_type = MC_DEFAULT_MOTOR_TYPE; - 8011058: 70ab strb r3, [r5, #2] - - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - conf->l_in_current_min = MCPWM_IN_CURRENT_MIN; - 801105a: 612f str r7, [r5, #16] - conf->l_max_duty = MCPWM_MAX_DUTY; - - conf->lo_current_max = conf->l_current_max; - conf->lo_current_min = conf->l_current_min; - conf->lo_in_current_max = conf->l_in_current_max; - conf->lo_in_current_min = conf->l_in_current_min; - 801105c: 65af str r7, [r5, #88] ; 0x58 - conf->l_abs_current_max = MCPWM_MAX_ABS_CURRENT; - conf->l_min_erpm = MCPWM_RPM_MIN; - conf->l_max_erpm = MCPWM_RPM_MAX; - conf->l_max_erpm_fbrake = MCPWM_CURR_MAX_RPM_FBRAKE; - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - 801105e: edc5 7a0a vstr s15, [r5, #40] ; 0x28 - conf->lo_in_current_max = conf->l_in_current_max; - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - 8011062: f8c5 b068 str.w fp, [r5, #104] ; 0x68 - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - conf->sl_phase_advance_at_br = MCPWM_CYCLE_INT_LIMIT_HIGH_FAC; - conf->sl_cycle_int_rpm_br = MCPWM_CYCLE_INT_START_RPM_BR; - conf->sl_bemf_coupling_k = MCPWM_BEMF_INPUT_COUPLING_K; - 8011066: f8c5 a078 str.w sl, [r5, #120] ; 0x78 - - conf->p_pid_kp = MCPWM_P_PID_KP; - conf->p_pid_ki = MCPWM_P_PID_KI; - conf->p_pid_kd = MCPWM_P_PID_KD; - - conf->cc_startup_boost_duty = MCPWM_CURRENT_STARTUP_BOOST; - 801106a: f8c5 609c str.w r6, [r5, #156] ; 0x9c - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - conf->sl_phase_advance_at_br = MCPWM_CYCLE_INT_LIMIT_HIGH_FAC; - conf->sl_cycle_int_rpm_br = MCPWM_CYCLE_INT_START_RPM_BR; - conf->sl_bemf_coupling_k = MCPWM_BEMF_INPUT_COUPLING_K; - - conf->hall_dir = MCPWM_HALL_DIR; - 801106e: f885 307c strb.w r3, [r5, #124] ; 0x7c - conf->hall_fwd_add = MCPWM_HALL_FWD_ADD; - 8011072: f885 307d strb.w r3, [r5, #125] ; 0x7d - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - 8011076: f885 307e strb.w r3, [r5, #126] ; 0x7e - - conf->s_pid_kp = MCPWM_PID_KP; - 801107a: f8c5 4080 str.w r4, [r5, #128] ; 0x80 - conf->s_pid_ki = MCPWM_PID_KI; - conf->s_pid_kd = MCPWM_PID_KD; - conf->s_pid_min_rpm = MCPWM_PID_MIN_RPM; - - conf->p_pid_kp = MCPWM_P_PID_KP; - 801107e: f8c5 4090 str.w r4, [r5, #144] ; 0x90 - conf->hall_dir = MCPWM_HALL_DIR; - conf->hall_fwd_add = MCPWM_HALL_FWD_ADD; - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - - conf->s_pid_kp = MCPWM_PID_KP; - conf->s_pid_ki = MCPWM_PID_KI; - 8011082: f8c5 0084 str.w r0, [r5, #132] ; 0x84 - conf->s_pid_kd = MCPWM_PID_KD; - conf->s_pid_min_rpm = MCPWM_PID_MIN_RPM; - - conf->p_pid_kp = MCPWM_P_PID_KP; - conf->p_pid_ki = MCPWM_P_PID_KI; - 8011086: f8c5 0094 str.w r0, [r5, #148] ; 0x94 - conf->hall_fwd_add = MCPWM_HALL_FWD_ADD; - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - - conf->s_pid_kp = MCPWM_PID_KP; - conf->s_pid_ki = MCPWM_PID_KI; - conf->s_pid_kd = MCPWM_PID_KD; - 801108a: f8c5 1088 str.w r1, [r5, #136] ; 0x88 - conf->s_pid_min_rpm = MCPWM_PID_MIN_RPM; - - conf->p_pid_kp = MCPWM_P_PID_KP; - conf->p_pid_ki = MCPWM_P_PID_KI; - conf->p_pid_kd = MCPWM_P_PID_KD; - 801108e: f8c5 1098 str.w r1, [r5, #152] ; 0x98 - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - - conf->s_pid_kp = MCPWM_PID_KP; - conf->s_pid_ki = MCPWM_PID_KI; - conf->s_pid_kd = MCPWM_PID_KD; - conf->s_pid_min_rpm = MCPWM_PID_MIN_RPM; - 8011092: f8c5 908c str.w r9, [r5, #140] ; 0x8c - conf->p_pid_ki = MCPWM_P_PID_KI; - conf->p_pid_kd = MCPWM_P_PID_KD; - - conf->cc_startup_boost_duty = MCPWM_CURRENT_STARTUP_BOOST; - conf->cc_min_current = MCPWM_CURRENT_CONTROL_MIN; - conf->cc_gain = MCPWM_CURRENT_CONTROL_GAIN; - 8011096: f8c5 80a4 str.w r8, [r5, #164] ; 0xa4 - conf->cc_ramp_step_max = 0.04; - 801109a: f8c5 c0a8 str.w ip, [r5, #168] ; 0xa8 - conf->p_pid_kp = MCPWM_P_PID_KP; - conf->p_pid_ki = MCPWM_P_PID_KI; - conf->p_pid_kd = MCPWM_P_PID_KD; - - conf->cc_startup_boost_duty = MCPWM_CURRENT_STARTUP_BOOST; - conf->cc_min_current = MCPWM_CURRENT_CONTROL_MIN; - 801109e: f8c5 e0a0 str.w lr, [r5, #160] ; 0xa0 - conf->cc_gain = MCPWM_CURRENT_CONTROL_GAIN; - conf->cc_ramp_step_max = 0.04; - - conf->m_fault_stop_time_ms = MCPWM_FAULT_STOP_TIME; - 80110a2: f8c5 20ac str.w r2, [r5, #172] ; 0xac - } -} - 80110a6: b003 add sp, #12 - 80110a8: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 80110ac: 42700000 .word 0x42700000 - 80110b0: 42c80000 .word 0x42c80000 - 80110b4: 42780000 .word 0x42780000 - 80110b8: c2700000 .word 0xc2700000 - 80110bc: 42a00000 .word 0x42a00000 - 80110c0: 43960000 .word 0x43960000 - 80110c4: 44bb8000 .word 0x44bb8000 - 80110c8: 44898000 .word 0x44898000 - 80110cc: 43160000 .word 0x43160000 - 80110d0: 3c23d70a .word 0x3c23d70a - 80110d4: 38d1b717 .word 0x38d1b717 - 80110d8: 3b03126f .word 0x3b03126f - 80110dc: c1a00000 .word 0xc1a00000 - 80110e0: c7c35000 .word 0xc7c35000 - 80110e4: 43020000 .word 0x43020000 - 80110e8: 47c35000 .word 0x47c35000 - 80110ec: 42480000 .word 0x42480000 - 80110f0: 3f733333 .word 0x3f733333 - 80110f4: 3f4ccccd .word 0x3f4ccccd - 80110f8: 479c4000 .word 0x479c4000 - 80110fc: 44160000 .word 0x44160000 - 8011100: 44610000 .word 0x44610000 - 8011104: 3b96bb99 .word 0x3b96bb99 - 8011108: 3d23d70a .word 0x3d23d70a - 801110c: 41200000 .word 0x41200000 - -08011110 : - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data) -{ - 8011110: b538 push {r3, r4, r5, lr} - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 8011112: 4a1b ldr r2, [pc, #108] ; (8011180 ) -static uint16_t EE_FindValidPage(uint8_t Operation) -{ - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 8011114: 4b1b ldr r3, [pc, #108] ; (8011184 ) - 8011116: 881b ldrh r3, [r3, #0] - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 8011118: 8812 ldrh r2, [r2, #0] - 801111a: b292 uxth r2, r2 -static uint16_t EE_FindValidPage(uint8_t Operation) -{ - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 801111c: b29b uxth r3, r3 - - /* Write or read operation */ - switch (Operation) - { - case WRITE_IN_VALID_PAGE: /* ---- Write operation ---- */ - if (PageStatus1 == VALID_PAGE) - 801111e: b9ea cbnz r2, 801115c - { - /* Page0 receiving data */ - if (PageStatus0 == RECEIVE_DATA) - 8011120: f64e 62ee movw r2, #61166 ; 0xeeee - else if (PageStatus0 == VALID_PAGE) - { - /* Page1 receiving data */ - if (PageStatus1 == RECEIVE_DATA) - { - return PAGE1; /* Page1 valid */ - 8011124: 1a9b subs r3, r3, r2 - 8011126: bf18 it ne - 8011128: 2301 movne r3, #1 - { - return NO_VALID_PAGE; - } - - /* Get the valid Page start Address */ - Address = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - 801112a: f503 5400 add.w r4, r3, #8192 ; 0x2000 - - /* Get the valid Page end Address */ - PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - 801112e: 4a16 ldr r2, [pc, #88] ; (8011188 ) - 8011130: 3301 adds r3, #1 - { - return NO_VALID_PAGE; - } - - /* Get the valid Page start Address */ - Address = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - 8011132: 3401 adds r4, #1 - - /* Get the valid Page end Address */ - PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - 8011134: 039b lsls r3, r3, #14 - { - return NO_VALID_PAGE; - } - - /* Get the valid Page start Address */ - Address = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - 8011136: 03a4 lsls r4, r4, #14 - - /* Get the valid Page end Address */ - PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - 8011138: 441a add r2, r3 - - /* Check each active page address starting from begining */ - while (Address < PageEndAddress) - 801113a: 4294 cmp r4, r2 - 801113c: d303 bcc.n 8011146 - 801113e: e010 b.n 8011162 - return FlashStatus; - } - else - { - /* Next address location */ - Address = Address + 4; - 8011140: 3404 adds r4, #4 - - /* Get the valid Page end Address */ - PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - - /* Check each active page address starting from begining */ - while (Address < PageEndAddress) - 8011142: 42a2 cmp r2, r4 - 8011144: d90d bls.n 8011162 - { - /* Verify if Address and Address+2 contents are 0xFFFFFFFF */ - if ((*(__IO uint32_t*)Address) == 0xFFFFFFFF) - 8011146: 6823 ldr r3, [r4, #0] - 8011148: 3301 adds r3, #1 - 801114a: d1f9 bne.n 8011140 - 801114c: 4605 mov r5, r0 - { - /* Set variable data */ - FlashStatus = FLASH_ProgramHalfWord(Address, Data); - 801114e: 4620 mov r0, r4 - 8011150: f000 fcc6 bl 8011ae0 - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - 8011154: 2809 cmp r0, #9 - 8011156: d00d beq.n 8011174 - return FlashStatus; - } - /* Set variable virtual address */ - FlashStatus = FLASH_ProgramHalfWord(Address + 2, VirtAddress); - /* Return program operation status */ - return FlashStatus; - 8011158: b280 uxth r0, r0 - 801115a: bd38 pop {r3, r4, r5, pc} - else - { - return PAGE1; /* Page1 valid */ - } - } - else if (PageStatus0 == VALID_PAGE) - 801115c: b11b cbz r3, 8011166 - ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) - { - return NO_VALID_PAGE; - 801115e: 20ab movs r0, #171 ; 0xab - 8011160: bd38 pop {r3, r4, r5, pc} - Address = Address + 4; - } - } - - /* Return PAGE_FULL in case the valid page is full */ - return PAGE_FULL; - 8011162: 2080 movs r0, #128 ; 0x80 - 8011164: bd38 pop {r3, r4, r5, pc} - } - } - else if (PageStatus0 == VALID_PAGE) - { - /* Page1 receiving data */ - if (PageStatus1 == RECEIVE_DATA) - 8011166: f64e 63ee movw r3, #61166 ; 0xeeee - { - return PAGE1; /* Page1 valid */ - 801116a: 1ad3 subs r3, r2, r3 - 801116c: fab3 f383 clz r3, r3 - 8011170: 095b lsrs r3, r3, #5 - 8011172: e7da b.n 801112a - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - /* Set variable virtual address */ - FlashStatus = FLASH_ProgramHalfWord(Address + 2, VirtAddress); - 8011174: 1ca0 adds r0, r4, #2 - 8011176: 4629 mov r1, r5 - 8011178: f000 fcb2 bl 8011ae0 - 801117c: e7ec b.n 8011158 - 801117e: bf00 nop - 8011180: 08008000 .word 0x08008000 - 8011184: 08004000 .word 0x08004000 - 8011188: 08003ffe .word 0x08003ffe - 801118c: f3af 8000 nop.w - -08011190 : - -/* - * Erase flash page if it is not already erased. This is to save write cycles and - * prevent the memory from getting erased in case of unstable voltage at boot. - */ -static uint16_t EE_EraseSectorIfNotEmpty(uint32_t FLASH_Sector, uint8_t VoltageRange) { - 8011190: b510 push {r4, lr} - 8011192: 4604 mov r4, r0 - uint8_t *addr = flash_helper_get_sector_address(FLASH_Sector); - 8011194: f000 f904 bl 80113a0 - 8011198: f500 527f add.w r2, r0, #16320 ; 0x3fc0 - 801119c: 323f adds r2, #63 ; 0x3f - 801119e: 3801 subs r0, #1 - 80111a0: e001 b.n 80111a6 - - for (unsigned int i = 0;i < PAGE_SIZE;i++) { - 80111a2: 4290 cmp r0, r2 - 80111a4: d009 beq.n 80111ba - if (addr[i] != 0xFF) { - 80111a6: f810 3f01 ldrb.w r3, [r0, #1]! - 80111aa: 2bff cmp r3, #255 ; 0xff - 80111ac: d0f9 beq.n 80111a2 - return FLASH_EraseSector(FLASH_Sector, VoltageRange); - 80111ae: 4620 mov r0, r4 - 80111b0: 2102 movs r1, #2 - 80111b2: f000 fc55 bl 8011a60 - 80111b6: b280 uxth r0, r0 - 80111b8: bd10 pop {r4, pc} - } - } - - return FLASH_COMPLETE; - 80111ba: 2009 movs r0, #9 -} - 80111bc: bd10 pop {r4, pc} - 80111be: bf00 nop - -080111c0 : - * @param None - * @retval Status of the last operation (Flash write or erase) done during - * EEPROM formating - */ -static FLASH_Status EE_Format(void) -{ - 80111c0: b508 push {r3, lr} - FLASH_Status FlashStatus = FLASH_COMPLETE; - - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID, VOLTAGE_RANGE); - 80111c2: 2008 movs r0, #8 - 80111c4: f7ff ffe4 bl 8011190 - 80111c8: b2c0 uxtb r0, r0 - - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - 80111ca: 2809 cmp r0, #9 - 80111cc: d000 beq.n 80111d0 - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - - /* Return Page1 erase operation status */ - return FlashStatus; -} - 80111ce: bd08 pop {r3, pc} - { - return FlashStatus; - } - - /* Set Page0 as valid page: Write VALID_PAGE at Page0 base address */ - FlashStatus = FLASH_ProgramHalfWord(PAGE0_BASE_ADDRESS, VALID_PAGE); - 80111d0: 4805 ldr r0, [pc, #20] ; (80111e8 ) - 80111d2: 2100 movs r1, #0 - 80111d4: f000 fc84 bl 8011ae0 - - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - 80111d8: 2809 cmp r0, #9 - 80111da: d1f8 bne.n 80111ce - { - return FlashStatus; - } - - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - 80111dc: 2010 movs r0, #16 - 80111de: f7ff ffd7 bl 8011190 - 80111e2: b2c0 uxtb r0, r0 - 80111e4: e7f3 b.n 80111ce - 80111e6: bf00 nop - 80111e8: 08004000 .word 0x08004000 - 80111ec: f3af 8000 nop.w - -080111f0 : -static uint16_t EE_FindValidPage(uint8_t Operation) -{ - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 80111f0: 4b15 ldr r3, [pc, #84] ; (8011248 ) - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 80111f2: 4a16 ldr r2, [pc, #88] ; (801124c ) -static uint16_t EE_FindValidPage(uint8_t Operation) -{ - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 80111f4: 881b ldrh r3, [r3, #0] - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 80111f6: 8812 ldrh r2, [r2, #0] -static uint16_t EE_FindValidPage(uint8_t Operation) -{ - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 80111f8: b29b uxth r3, r3 - * - 0: if variable was found - * - 1: if the variable was not found - * - NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) -{ - 80111fa: b410 push {r4} - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 80111fc: b292 uxth r2, r2 - { - return NO_VALID_PAGE; /* No valid Page */ - } - - case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ - if (PageStatus0 == VALID_PAGE) - 80111fe: b1bb cbz r3, 8011230 - { - return PAGE0; /* Page0 valid */ - } - else if (PageStatus1 == VALID_PAGE) - 8011200: b11a cbz r2, 801120a - ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) - { - return NO_VALID_PAGE; - 8011202: 20ab movs r0, #171 ; 0xab - } - } - - /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ - return ReadStatus; -} - 8011204: f85d 4b04 ldr.w r4, [sp], #4 - 8011208: 4770 bx lr - case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ - if (PageStatus0 == VALID_PAGE) - { - return PAGE0; /* Page0 valid */ - } - else if (PageStatus1 == VALID_PAGE) - 801120a: 4b11 ldr r3, [pc, #68] ; (8011250 ) - 801120c: 4c11 ldr r4, [pc, #68] ; (8011254 ) - 801120e: 461a mov r2, r3 - - /* Check each active page address starting from end */ - while (Address > (PageStartAddress + 2)) - { - /* Get the current location content to be compared with virtual address */ - AddressValue = (*(__IO uint16_t*)Address); - 8011210: 8812 ldrh r2, [r2, #0] - 8011212: b292 uxth r2, r2 - - /* Compare the read address with the virtual address */ - if (AddressValue == VirtAddress) - 8011214: 4282 cmp r2, r0 - 8011216: d104 bne.n 8011222 - 8011218: e00e b.n 8011238 - - /* Check each active page address starting from end */ - while (Address > (PageStartAddress + 2)) - { - /* Get the current location content to be compared with virtual address */ - AddressValue = (*(__IO uint16_t*)Address); - 801121a: 881a ldrh r2, [r3, #0] - 801121c: b292 uxth r2, r2 - - /* Compare the read address with the virtual address */ - if (AddressValue == VirtAddress) - 801121e: 4282 cmp r2, r0 - 8011220: d00a beq.n 8011238 - break; - } - else - { - /* Next address location */ - Address = Address - 4; - 8011222: 3b04 subs r3, #4 - - /* Get the valid Page end Address */ - Address = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - - /* Check each active page address starting from end */ - while (Address > (PageStartAddress + 2)) - 8011224: 429c cmp r4, r3 - 8011226: d3f8 bcc.n 801121a - * - NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) -{ - uint16_t ValidPage = PAGE0; - uint16_t AddressValue = 0x5555, ReadStatus = 1; - 8011228: 2001 movs r0, #1 - } - } - - /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ - return ReadStatus; -} - 801122a: f85d 4b04 ldr.w r4, [sp], #4 - 801122e: 4770 bx lr - { - return NO_VALID_PAGE; /* No valid Page */ - } - - case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ - if (PageStatus0 == VALID_PAGE) - 8011230: 4b09 ldr r3, [pc, #36] ; (8011258 ) - 8011232: 4c0a ldr r4, [pc, #40] ; (801125c ) - 8011234: 461a mov r2, r3 - 8011236: e7eb b.n 8011210 - - /* Compare the read address with the virtual address */ - if (AddressValue == VirtAddress) - { - /* Get content of Address-2 which is variable value */ - *Data = (*(__IO uint16_t*)(Address - 2)); - 8011238: f833 3c02 ldrh.w r3, [r3, #-2] - 801123c: 800b strh r3, [r1, #0] - - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - 801123e: 2000 movs r0, #0 - } - } - - /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ - return ReadStatus; -} - 8011240: f85d 4b04 ldr.w r4, [sp], #4 - 8011244: 4770 bx lr - 8011246: bf00 nop - 8011248: 08004000 .word 0x08004000 - 801124c: 08008000 .word 0x08008000 - 8011250: 0800bffe .word 0x0800bffe - 8011254: 08008002 .word 0x08008002 - 8011258: 08007ffe .word 0x08007ffe - 801125c: 08004002 .word 0x08004002 - -08011260 : - * @param None. - * @retval - Flash error code: on write Flash error - * - FLASH_COMPLETE: on success - */ -uint16_t EE_Init(void) -{ - 8011260: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - uint16_t EepromStatus = 0, ReadStatus = 0; - int16_t x = -1; - uint16_t FlashStatus; - - /* Get Page0 status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 8011264: 4d48 ldr r5, [pc, #288] ; (8011388 ) - /* Get Page1 status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 8011266: 4e49 ldr r6, [pc, #292] ; (801138c ) - uint16_t EepromStatus = 0, ReadStatus = 0; - int16_t x = -1; - uint16_t FlashStatus; - - /* Get Page0 status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 8011268: 882c ldrh r4, [r5, #0] - /* Get Page1 status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 801126a: 8833 ldrh r3, [r6, #0] - uint16_t EepromStatus = 0, ReadStatus = 0; - int16_t x = -1; - uint16_t FlashStatus; - - /* Get Page0 status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - 801126c: b2a4 uxth r4, r4 - /* Get Page1 status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - /* Check for invalid header states and repair if necessary */ - switch (PageStatus0) - 801126e: f64e 62ee movw r2, #61166 ; 0xeeee - 8011272: 4294 cmp r4, r2 - uint16_t FlashStatus; - - /* Get Page0 status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - /* Get Page1 status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - 8011274: b29b uxth r3, r3 - - /* Check for invalid header states and repair if necessary */ - switch (PageStatus0) - 8011276: d048 beq.n 801130a - 8011278: f64f 78ff movw r8, #65535 ; 0xffff - 801127c: 4544 cmp r4, r8 - 801127e: d034 beq.n 80112ea - 8011280: b124 cbz r4, 801128c - } - break; - - default: /* Any other state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - 8011282: f7ff ff9d bl 80111c0 - 8011286: b280 uxth r0, r0 - } - break; - } - - return FLASH_COMPLETE; -} - 8011288: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - } - } - break; - - case VALID_PAGE: - if (PageStatus1 == VALID_PAGE) /* Invalid state -> format eeprom */ - 801128c: 2b00 cmp r3, #0 - 801128e: d0f8 beq.n 8011282 - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else if (PageStatus1 == ERASED) /* Page0 valid, Page1 erased */ - 8011290: 4543 cmp r3, r8 - 8011292: d064 beq.n 801135e - 8011294: 4d3e ldr r5, [pc, #248] ; (8011390 ) - else /* Page0 valid, Page1 receive */ - { - /* Transfer data from Page0 to Page1 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - 8011296: 4e3f ldr r6, [pc, #252] ; (8011394 ) - x = VarIdx; - } - if (VarIdx != x) - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 8011298: 4f3f ldr r7, [pc, #252] ; (8011398 ) - else /* Page0 valid, Page1 receive */ - { - /* Transfer data from Page0 to Page1 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - 801129a: 8833 ldrh r3, [r6, #0] - 801129c: f835 2f02 ldrh.w r2, [r5, #2]! - x = VarIdx; - } - if (VarIdx != x) - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 80112a0: 493d ldr r1, [pc, #244] ; (8011398 ) - else /* Page0 valid, Page1 receive */ - { - /* Transfer data from Page0 to Page1 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - 80112a2: b29b uxth r3, r3 - 80112a4: 4293 cmp r3, r2 - { - x = VarIdx; - 80112a6: bf08 it eq - 80112a8: fa1f f884 uxtheq.w r8, r4 - } - if (VarIdx != x) - 80112ac: fa0f f388 sxth.w r3, r8 - 80112b0: 429c cmp r4, r3 - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 80112b2: 4610 mov r0, r2 - 80112b4: f104 0401 add.w r4, r4, #1 - { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - { - x = VarIdx; - } - if (VarIdx != x) - 80112b8: d009 beq.n 80112ce - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 80112ba: f7ff ff99 bl 80111f0 - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) - 80112be: 2801 cmp r0, #1 - 80112c0: d005 beq.n 80112ce - { - /* Transfer the variable to the Page1 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - 80112c2: 8828 ldrh r0, [r5, #0] - 80112c4: 8839 ldrh r1, [r7, #0] - 80112c6: f7ff ff23 bl 8011110 - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != FLASH_COMPLETE) - 80112ca: 2809 cmp r0, #9 - 80112cc: d1dc bne.n 8011288 - } - } - else /* Page0 valid, Page1 receive */ - { - /* Transfer data from Page0 to Page1 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - 80112ce: 2ca0 cmp r4, #160 ; 0xa0 - 80112d0: d1e3 bne.n 801129a - } - } - } - } - /* Mark Page1 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE1_BASE_ADDRESS, VALID_PAGE); - 80112d2: 482e ldr r0, [pc, #184] ; (801138c ) - 80112d4: 2100 movs r1, #0 - 80112d6: f000 fc03 bl 8011ae0 - 80112da: b280 uxth r0, r0 - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - 80112dc: 2809 cmp r0, #9 - 80112de: d1d3 bne.n 8011288 - { - return FlashStatus; - } - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID, VOLTAGE_RANGE); - 80112e0: 2008 movs r0, #8 - } - break; - } - - return FLASH_COMPLETE; -} - 80112e2: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr} - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID, VOLTAGE_RANGE); - 80112e6: f7ff bf53 b.w 8011190 - - /* Check for invalid header states and repair if necessary */ - switch (PageStatus0) - { - case ERASED: - if (PageStatus1 == VALID_PAGE) /* Page0 erased, Page1 valid */ - 80112ea: 2b00 cmp r3, #0 - 80112ec: d0f8 beq.n 80112e0 - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else if (PageStatus1 == RECEIVE_DATA) /* Page0 erased, Page1 receive */ - 80112ee: 4293 cmp r3, r2 - 80112f0: d1c7 bne.n 8011282 - { - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID, VOLTAGE_RANGE); - 80112f2: 2008 movs r0, #8 - 80112f4: f7ff ff4c bl 8011190 - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - 80112f8: 2809 cmp r0, #9 - 80112fa: d1c5 bne.n 8011288 - { - return FlashStatus; - } - /* Mark Page1 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE1_BASE_ADDRESS, VALID_PAGE); - 80112fc: 4630 mov r0, r6 - 80112fe: 2100 movs r1, #0 - 8011300: f000 fbee bl 8011ae0 - 8011304: b280 uxth r0, r0 - 8011306: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - } - } - break; - - case RECEIVE_DATA: - if (PageStatus1 == VALID_PAGE) /* Page0 receive, Page1 valid */ - 801130a: bb6b cbnz r3, 8011368 - 801130c: 4d20 ldr r5, [pc, #128] ; (8011390 ) - { - /* Transfer data from Page1 to Page0 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - 801130e: 4e23 ldr r6, [pc, #140] ; (801139c ) - x = VarIdx; - } - if (VarIdx != x) - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 8011310: 4f21 ldr r7, [pc, #132] ; (8011398 ) - } - } - break; - - case RECEIVE_DATA: - if (PageStatus1 == VALID_PAGE) /* Page0 receive, Page1 valid */ - 8011312: 461c mov r4, r3 - 8011314: f64f 78ff movw r8, #65535 ; 0xffff - { - /* Transfer data from Page1 to Page0 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - 8011318: 8833 ldrh r3, [r6, #0] - 801131a: f835 2f02 ldrh.w r2, [r5, #2]! - x = VarIdx; - } - if (VarIdx != x) - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 801131e: 491e ldr r1, [pc, #120] ; (8011398 ) - if (PageStatus1 == VALID_PAGE) /* Page0 receive, Page1 valid */ - { - /* Transfer data from Page1 to Page0 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - 8011320: b29b uxth r3, r3 - 8011322: 4293 cmp r3, r2 - { - x = VarIdx; - 8011324: bf08 it eq - 8011326: fa1f f884 uxtheq.w r8, r4 - } - if (VarIdx != x) - 801132a: fa0f f388 sxth.w r3, r8 - 801132e: 429c cmp r4, r3 - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 8011330: 4610 mov r0, r2 - 8011332: f104 0401 add.w r4, r4, #1 - { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - { - x = VarIdx; - } - if (VarIdx != x) - 8011336: d009 beq.n 801134c - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - 8011338: f7ff ff5a bl 80111f0 - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) - 801133c: 2801 cmp r0, #1 - 801133e: d005 beq.n 801134c - { - /* Transfer the variable to the Page0 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - 8011340: 8828 ldrh r0, [r5, #0] - 8011342: 8839 ldrh r1, [r7, #0] - 8011344: f7ff fee4 bl 8011110 - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != FLASH_COMPLETE) - 8011348: 2809 cmp r0, #9 - 801134a: d19d bne.n 8011288 - - case RECEIVE_DATA: - if (PageStatus1 == VALID_PAGE) /* Page0 receive, Page1 valid */ - { - /* Transfer data from Page1 to Page0 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - 801134c: 2ca0 cmp r4, #160 ; 0xa0 - 801134e: d1e3 bne.n 8011318 - } - } - } - } - /* Mark Page0 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE0_BASE_ADDRESS, VALID_PAGE); - 8011350: 480d ldr r0, [pc, #52] ; (8011388 ) - 8011352: 2100 movs r1, #0 - 8011354: f000 fbc4 bl 8011ae0 - 8011358: b280 uxth r0, r0 - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - 801135a: 2809 cmp r0, #9 - 801135c: d194 bne.n 8011288 - } - } - else if (PageStatus1 == ERASED) /* Page0 valid, Page1 erased */ - { - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - 801135e: 2010 movs r0, #16 - } - break; - } - - return FLASH_COMPLETE; -} - 8011360: e8bd 41f0 ldmia.w sp!, {r4, r5, r6, r7, r8, lr} - } - } - else if (PageStatus1 == ERASED) /* Page0 valid, Page1 erased */ - { - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - 8011364: f7ff bf14 b.w 8011190 - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else if (PageStatus1 == ERASED) /* Page0 receive, Page1 erased */ - 8011368: f64f 72ff movw r2, #65535 ; 0xffff - 801136c: 4293 cmp r3, r2 - 801136e: d188 bne.n 8011282 - { - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - 8011370: 2010 movs r0, #16 - 8011372: f7ff ff0d bl 8011190 - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - 8011376: 2809 cmp r0, #9 - 8011378: d186 bne.n 8011288 - { - return FlashStatus; - } - /* Mark Page0 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE0_BASE_ADDRESS, VALID_PAGE); - 801137a: 4628 mov r0, r5 - 801137c: 2100 movs r1, #0 - 801137e: f000 fbaf bl 8011ae0 - 8011382: b280 uxth r0, r0 - 8011384: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - 8011388: 08004000 .word 0x08004000 - 801138c: 08008000 .word 0x08008000 - 8011390: 20002ce2 .word 0x20002ce2 - 8011394: 08008006 .word 0x08008006 - 8011398: 20002e24 .word 0x20002e24 - 801139c: 08004006 .word 0x08004006 - -080113a0 : - - // Jump to the bootloader - jump_to_bootloader(); -} - -uint8_t* flash_helper_get_sector_address(uint32_t fsector) { - 80113a0: 4a07 ldr r2, [pc, #28] ; (80113c0 ) - uint8_t *res = 0; - - for (int i = 0;i < FLASH_SECTORS;i++) { - 80113a2: 2300 movs r3, #0 - if (flash_sector[i] == fsector) { - 80113a4: f832 1b02 ldrh.w r1, [r2], #2 - 80113a8: 4281 cmp r1, r0 - 80113aa: d004 beq.n 80113b6 -} - -uint8_t* flash_helper_get_sector_address(uint32_t fsector) { - uint8_t *res = 0; - - for (int i = 0;i < FLASH_SECTORS;i++) { - 80113ac: 3301 adds r3, #1 - 80113ae: 2b0c cmp r3, #12 - 80113b0: d1f8 bne.n 80113a4 - // Jump to the bootloader - jump_to_bootloader(); -} - -uint8_t* flash_helper_get_sector_address(uint32_t fsector) { - uint8_t *res = 0; - 80113b2: 2000 movs r0, #0 - break; - } - } - - return res; -} - 80113b4: 4770 bx lr -uint8_t* flash_helper_get_sector_address(uint32_t fsector) { - uint8_t *res = 0; - - for (int i = 0;i < FLASH_SECTORS;i++) { - if (flash_sector[i] == fsector) { - res = (uint8_t *)flash_addr[i]; - 80113b6: 4a03 ldr r2, [pc, #12] ; (80113c4 ) - 80113b8: f852 0023 ldr.w r0, [r2, r3, lsl #2] - break; - 80113bc: 4770 bx lr - 80113be: bf00 nop - 80113c0: 08013700 .word 0x08013700 - 80113c4: 08013720 .word 0x08013720 - 80113c8: f3af 8000 nop.w - 80113cc: f3af 8000 nop.w - -080113d0 : - STD_DUTY_CYCLE -}; - -void hw_init_gpio(void) { - // GPIO clock enable - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE); - 80113d0: 2001 movs r0, #1 - OPMODE_I2C, - 100000, - STD_DUTY_CYCLE -}; - -void hw_init_gpio(void) { - 80113d2: e92d 43f8 stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, lr} - // GPIO clock enable - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE); - 80113d6: 4601 mov r1, r0 - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); - - // LEDs - palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 80113d8: 4e5e ldr r6, [pc, #376] ; (8011554 ) - - palClearPad(GPIOB, 6); - palClearPad(GPIOB, 7); - - // GPIOC (ENABLE_GATE) - palSetPadMode(GPIOC, 6,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 80113da: 4c5f ldr r4, [pc, #380] ; (8011558 ) - - // Fault pin - palSetPadMode(GPIOB, 12, PAL_MODE_INPUT_PULLUP); - - //PWM ( GPIOA Configuration: Channel 1 to 3 as alternate function push-pull) - palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(GPIO_AF_TIM1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_FLOATING); - 80113dc: 4d5f ldr r5, [pc, #380] ; (801155c ) - STD_DUTY_CYCLE -}; - -void hw_init_gpio(void) { - // GPIO clock enable - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE); - 80113de: f000 fb9f bl 8011b20 - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); - 80113e2: 2002 movs r0, #2 - 80113e4: 2101 movs r1, #1 - 80113e6: f000 fb9b bl 8011b20 - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); - 80113ea: 2004 movs r0, #4 - 80113ec: 2101 movs r1, #1 - 80113ee: f000 fb97 bl 8011b20 - - // LEDs - palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 80113f2: 4630 mov r0, r6 - 80113f4: 2140 movs r1, #64 ; 0x40 - 80113f6: 2219 movs r2, #25 - 80113f8: f7fd fb72 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 80113fc: 2180 movs r1, #128 ; 0x80 - - palClearPad(GPIOB, 6); - palClearPad(GPIOB, 7); - 80113fe: 4688 mov r8, r1 - - // LEDs - palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - - palClearPad(GPIOB, 6); - 8011400: 2740 movs r7, #64 ; 0x40 - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); - RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); - - // LEDs - palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 8011402: 4630 mov r0, r6 - 8011404: 2219 movs r2, #25 - 8011406: f7fd fb6b bl 800eae0 <_pal_lld_setgroupmode> - - palClearPad(GPIOB, 6); - 801140a: 8377 strh r7, [r6, #26] - palClearPad(GPIOB, 7); - - // GPIOC (ENABLE_GATE) - palSetPadMode(GPIOC, 6,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 801140c: 4639 mov r1, r7 - 801140e: 4620 mov r0, r4 - // LEDs - palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - - palClearPad(GPIOB, 6); - palClearPad(GPIOB, 7); - 8011410: f8a6 801a strh.w r8, [r6, #26] - - // GPIOC (ENABLE_GATE) - palSetPadMode(GPIOC, 6,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 8011414: 2219 movs r2, #25 - 8011416: f7fd fb63 bl 800eae0 <_pal_lld_setgroupmode> - DISABLE_GATE(); - - // GPIOC (DCCAL) - palSetPadMode(GPIOC, 7,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 801141a: 4620 mov r0, r4 - 801141c: 4641 mov r1, r8 - palClearPad(GPIOB, 6); - palClearPad(GPIOB, 7); - - // GPIOC (ENABLE_GATE) - palSetPadMode(GPIOC, 6,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - DISABLE_GATE(); - 801141e: 8367 strh r7, [r4, #26] - - // GPIOC (DCCAL) - palSetPadMode(GPIOC, 7,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 8011420: 2219 movs r2, #25 - 8011422: f7fd fb5d bl 800eae0 <_pal_lld_setgroupmode> - - // GPIOC (GAIN) - palSetPadMode(GPIOC, 8,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 8011426: f44f 7180 mov.w r1, #256 ; 0x100 - GAIN_FULLDN(); - 801142a: 4689 mov r9, r1 - - // GPIOC (DCCAL) - palSetPadMode(GPIOC, 7,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - - // GPIOC (GAIN) - palSetPadMode(GPIOC, 8,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - 801142c: 4620 mov r0, r4 - 801142e: 2219 movs r2, #25 - 8011430: f7fd fb56 bl 800eae0 <_pal_lld_setgroupmode> - GAIN_FULLDN(); - - // Fault pin - palSetPadMode(GPIOB, 12, PAL_MODE_INPUT_PULLUP); - 8011434: 4630 mov r0, r6 - // GPIOC (DCCAL) - palSetPadMode(GPIOC, 7,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - - // GPIOC (GAIN) - palSetPadMode(GPIOC, 8,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - GAIN_FULLDN(); - 8011436: f8a4 901a strh.w r9, [r4, #26] - - // Fault pin - palSetPadMode(GPIOB, 12, PAL_MODE_INPUT_PULLUP); - 801143a: f44f 5180 mov.w r1, #4096 ; 0x1000 - 801143e: 2220 movs r2, #32 - 8011440: f7fd fb4e bl 800eae0 <_pal_lld_setgroupmode> - - //PWM ( GPIOA Configuration: Channel 1 to 3 as alternate function push-pull) - palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(GPIO_AF_TIM1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_FLOATING); - 8011444: 4649 mov r1, r9 - 8011446: 4628 mov r0, r5 - 8011448: 229a movs r2, #154 ; 0x9a - 801144a: f7fd fb49 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(GPIO_AF_TIM1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_FLOATING); - 801144e: 4628 mov r0, r5 - 8011450: f44f 7100 mov.w r1, #512 ; 0x200 - 8011454: 229a movs r2, #154 ; 0x9a - 8011456: f7fd fb43 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(GPIO_AF_TIM1) |PAL_STM32_OSPEED_HIGHEST |PAL_STM32_PUDR_FLOATING); - 801145a: 4628 mov r0, r5 - 801145c: f44f 6180 mov.w r1, #1024 ; 0x400 - 8011460: 229a movs r2, #154 ; 0x9a - 8011462: f7fd fb3d bl 800eae0 <_pal_lld_setgroupmode> - - palSetPadMode(GPIOB, 13, PAL_MODE_ALTERNATE(GPIO_AF_TIM1) |PAL_STM32_OSPEED_HIGHEST |PAL_STM32_PUDR_FLOATING); - 8011466: 4630 mov r0, r6 - 8011468: f44f 5100 mov.w r1, #8192 ; 0x2000 - 801146c: 229a movs r2, #154 ; 0x9a - 801146e: f7fd fb37 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOB, 14, PAL_MODE_ALTERNATE(GPIO_AF_TIM1) |PAL_STM32_OSPEED_HIGHEST |PAL_STM32_PUDR_FLOATING); - 8011472: 4630 mov r0, r6 - 8011474: f44f 4180 mov.w r1, #16384 ; 0x4000 - 8011478: 229a movs r2, #154 ; 0x9a - 801147a: f7fd fb31 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOB, 15, PAL_MODE_ALTERNATE(GPIO_AF_TIM1) |PAL_STM32_OSPEED_HIGHEST |PAL_STM32_PUDR_FLOATING); - 801147e: 4630 mov r0, r6 - 8011480: f44f 4100 mov.w r1, #32768 ; 0x8000 - 8011484: 229a movs r2, #154 ; 0x9a - 8011486: f7fd fb2b bl 800eae0 <_pal_lld_setgroupmode> - - // DHall sensors - palSetPadMode(HW_HALL_ENC_GPIO1, HW_HALL_ENC_PIN1, PAL_MODE_INPUT_PULLUP); - 801148a: 4620 mov r0, r4 - 801148c: f44f 5100 mov.w r1, #8192 ; 0x2000 - 8011490: 2220 movs r2, #32 - 8011492: f7fd fb25 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(HW_HALL_ENC_GPIO2, HW_HALL_ENC_PIN2, PAL_MODE_INPUT_PULLUP); - 8011496: 4620 mov r0, r4 - 8011498: f44f 4180 mov.w r1, #16384 ; 0x4000 - 801149c: 2220 movs r2, #32 - 801149e: f7fd fb1f bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(HW_HALL_ENC_GPIO3, HW_HALL_ENC_PIN3, PAL_MODE_INPUT_PULLUP); - 80114a2: 4620 mov r0, r4 - 80114a4: f44f 4100 mov.w r1, #32768 ; 0x8000 - 80114a8: 2220 movs r2, #32 - 80114aa: f7fd fb19 bl 800eae0 <_pal_lld_setgroupmode> - - // ADC Pins - palSetPadMode(GPIOA, 0, PAL_MODE_INPUT_ANALOG);//sen3 - 80114ae: 4628 mov r0, r5 - 80114b0: 2101 movs r1, #1 - 80114b2: 2203 movs r2, #3 - 80114b4: f7fd fb14 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 1, PAL_MODE_INPUT_ANALOG);//sen2 - 80114b8: 4628 mov r0, r5 - 80114ba: 2102 movs r1, #2 - 80114bc: 2203 movs r2, #3 - 80114be: f7fd fb0f bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_ANALOG);//sen1 - 80114c2: 4628 mov r0, r5 - 80114c4: 2104 movs r1, #4 - 80114c6: 2203 movs r2, #3 - 80114c8: f7fd fb0a bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_ANALOG);//INV_TEMP - 80114cc: 4628 mov r0, r5 - 80114ce: 2108 movs r1, #8 - 80114d0: 2203 movs r2, #3 - 80114d2: f7fd fb05 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG); - 80114d6: 4628 mov r0, r5 - 80114d8: 2110 movs r1, #16 - 80114da: 2203 movs r2, #3 - 80114dc: f7fd fb00 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG); - 80114e0: 4628 mov r0, r5 - 80114e2: 2120 movs r1, #32 - 80114e4: 2203 movs r2, #3 - 80114e6: f7fd fafb bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_ANALOG); - 80114ea: 4628 mov r0, r5 - 80114ec: 4639 mov r1, r7 - 80114ee: 2203 movs r2, #3 - 80114f0: f7fd faf6 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOA, 7, PAL_MODE_INPUT_ANALOG); - 80114f4: 4628 mov r0, r5 - 80114f6: 4641 mov r1, r8 - 80114f8: 2203 movs r2, #3 - 80114fa: f7fd faf1 bl 800eae0 <_pal_lld_setgroupmode> - - palSetPadMode(GPIOB, 0, PAL_MODE_INPUT_ANALOG);//BR_SO1 - 80114fe: 4630 mov r0, r6 - 8011500: 2101 movs r1, #1 - 8011502: 2203 movs r2, #3 - 8011504: f7fd faec bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOB, 1, PAL_MODE_INPUT_ANALOG);//BR_SO2 - 8011508: 4630 mov r0, r6 - 801150a: 2102 movs r1, #2 - 801150c: 2203 movs r2, #3 - 801150e: f7fd fae7 bl 800eae0 <_pal_lld_setgroupmode> - - palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_ANALOG);//MOTOR_TEMP - 8011512: 4620 mov r0, r4 - 8011514: 2101 movs r1, #1 - 8011516: 2203 movs r2, #3 - 8011518: f7fd fae2 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOC, 1, PAL_MODE_INPUT_ANALOG); - 801151c: 4620 mov r0, r4 - 801151e: 2102 movs r1, #2 - 8011520: 2203 movs r2, #3 - 8011522: f7fd fadd bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_ANALOG);//VIN - 8011526: 4620 mov r0, r4 - 8011528: 2104 movs r1, #4 - 801152a: 2203 movs r2, #3 - 801152c: f7fd fad8 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOC, 3, PAL_MODE_INPUT_ANALOG); - 8011530: 4620 mov r0, r4 - 8011532: 2108 movs r1, #8 - 8011534: 2203 movs r2, #3 - 8011536: f7fd fad3 bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOC, 4, PAL_MODE_INPUT_ANALOG); - 801153a: 4620 mov r0, r4 - 801153c: 2110 movs r1, #16 - 801153e: 2203 movs r2, #3 - 8011540: f7fd face bl 800eae0 <_pal_lld_setgroupmode> - palSetPadMode(GPIOC, 5, PAL_MODE_INPUT_ANALOG);//ADC_EXT - 8011544: 4620 mov r0, r4 - 8011546: 2120 movs r1, #32 - 8011548: 2203 movs r2, #3 - -} - 801154a: e8bd 43f8 ldmia.w sp!, {r3, r4, r5, r6, r7, r8, r9, lr} - palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_ANALOG);//MOTOR_TEMP - palSetPadMode(GPIOC, 1, PAL_MODE_INPUT_ANALOG); - palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_ANALOG);//VIN - palSetPadMode(GPIOC, 3, PAL_MODE_INPUT_ANALOG); - palSetPadMode(GPIOC, 4, PAL_MODE_INPUT_ANALOG); - palSetPadMode(GPIOC, 5, PAL_MODE_INPUT_ANALOG);//ADC_EXT - 801154e: f7fd bac7 b.w 800eae0 <_pal_lld_setgroupmode> - 8011552: bf00 nop - 8011554: 40020400 .word 0x40020400 - 8011558: 40020800 .word 0x40020800 - 801155c: 40020000 .word 0x40020000 - -08011560 : - -} - -void hw_setup_adc_channels(void) { - 8011560: b570 push {r4, r5, r6, lr} - // ADC1 regular channels - ADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_15Cycles); - 8011562: 4d2c ldr r5, [pc, #176] ; (8011614 ) - ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 2, ADC_SampleTime_15Cycles); - ADC_RegularChannelConfig(ADC1, ADC_Channel_10, 3, ADC_SampleTime_15Cycles); - ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 4, ADC_SampleTime_15Cycles); - - // ADC2 regular channels - ADC_RegularChannelConfig(ADC2, ADC_Channel_1, 1, ADC_SampleTime_15Cycles); - 8011564: 4c2c ldr r4, [pc, #176] ; (8011618 ) - ADC_RegularChannelConfig(ADC2, ADC_Channel_8, 2, ADC_SampleTime_15Cycles); - ADC_RegularChannelConfig(ADC2, ADC_Channel_11, 3, ADC_SampleTime_15Cycles); - ADC_RegularChannelConfig(ADC2, ADC_Channel_15, 4, ADC_SampleTime_15Cycles); - - // ADC3 regular channels - ADC_RegularChannelConfig(ADC3, ADC_Channel_2, 1, ADC_SampleTime_15Cycles); - 8011566: 4e2d ldr r6, [pc, #180] ; (801161c ) - -} - -void hw_setup_adc_channels(void) { - // ADC1 regular channels - ADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_15Cycles); - 8011568: 2201 movs r2, #1 - 801156a: 4628 mov r0, r5 - 801156c: 4613 mov r3, r2 - 801156e: 2100 movs r1, #0 - 8011570: f000 f8de bl 8011730 - ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 2, ADC_SampleTime_15Cycles); - 8011574: 4628 mov r0, r5 - 8011576: 2107 movs r1, #7 - 8011578: 2202 movs r2, #2 - 801157a: 2301 movs r3, #1 - 801157c: f000 f8d8 bl 8011730 - ADC_RegularChannelConfig(ADC1, ADC_Channel_10, 3, ADC_SampleTime_15Cycles); - 8011580: 4628 mov r0, r5 - 8011582: 210a movs r1, #10 - 8011584: 2203 movs r2, #3 - 8011586: 2301 movs r3, #1 - 8011588: f000 f8d2 bl 8011730 - ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 4, ADC_SampleTime_15Cycles); - 801158c: 2104 movs r1, #4 - 801158e: 4628 mov r0, r5 - 8011590: 460a mov r2, r1 - 8011592: 2301 movs r3, #1 - 8011594: f000 f8cc bl 8011730 - - // ADC2 regular channels - ADC_RegularChannelConfig(ADC2, ADC_Channel_1, 1, ADC_SampleTime_15Cycles); - 8011598: 2101 movs r1, #1 - 801159a: 4620 mov r0, r4 - 801159c: 460a mov r2, r1 - 801159e: 460b mov r3, r1 - 80115a0: f000 f8c6 bl 8011730 - ADC_RegularChannelConfig(ADC2, ADC_Channel_8, 2, ADC_SampleTime_15Cycles); - 80115a4: 4620 mov r0, r4 - 80115a6: 2108 movs r1, #8 - 80115a8: 2202 movs r2, #2 - 80115aa: 2301 movs r3, #1 - 80115ac: f000 f8c0 bl 8011730 - ADC_RegularChannelConfig(ADC2, ADC_Channel_11, 3, ADC_SampleTime_15Cycles); - 80115b0: 4620 mov r0, r4 - 80115b2: 210b movs r1, #11 - 80115b4: 2203 movs r2, #3 - 80115b6: 2301 movs r3, #1 - 80115b8: f000 f8ba bl 8011730 - ADC_RegularChannelConfig(ADC2, ADC_Channel_15, 4, ADC_SampleTime_15Cycles); - 80115bc: 4620 mov r0, r4 - 80115be: 210f movs r1, #15 - 80115c0: 2204 movs r2, #4 - 80115c2: 2301 movs r3, #1 - 80115c4: f000 f8b4 bl 8011730 - - // ADC3 regular channels - ADC_RegularChannelConfig(ADC3, ADC_Channel_2, 1, ADC_SampleTime_15Cycles); - 80115c8: 2201 movs r2, #1 - 80115ca: 4630 mov r0, r6 - 80115cc: 4613 mov r3, r2 - 80115ce: 2102 movs r1, #2 - 80115d0: f000 f8ae bl 8011730 - ADC_RegularChannelConfig(ADC3, ADC_Channel_3, 2, ADC_SampleTime_15Cycles); - 80115d4: 4630 mov r0, r6 - 80115d6: 2103 movs r1, #3 - 80115d8: 2202 movs r2, #2 - 80115da: 2301 movs r3, #1 - 80115dc: f000 f8a8 bl 8011730 - ADC_RegularChannelConfig(ADC3, ADC_Channel_12, 3, ADC_SampleTime_15Cycles); - 80115e0: 4630 mov r0, r6 - 80115e2: 210c movs r1, #12 - 80115e4: 2203 movs r2, #3 - 80115e6: 2301 movs r3, #1 - 80115e8: f000 f8a2 bl 8011730 - ADC_RegularChannelConfig(ADC3, ADC_Channel_5, 4, ADC_SampleTime_15Cycles); - 80115ec: 4630 mov r0, r6 - 80115ee: 2105 movs r1, #5 - 80115f0: 2204 movs r2, #4 - 80115f2: 2301 movs r3, #1 - 80115f4: f000 f89c bl 8011730 - - // Injected channels - ADC_InjectedChannelConfig(ADC1, ADC_Channel_8, 1, ADC_SampleTime_15Cycles); - 80115f8: 2201 movs r2, #1 - 80115fa: 4628 mov r0, r5 - 80115fc: 4613 mov r3, r2 - 80115fe: 2108 movs r1, #8 - 8011600: f000 f8ee bl 80117e0 - ADC_InjectedChannelConfig(ADC2, ADC_Channel_9, 1, ADC_SampleTime_15Cycles); - 8011604: 2201 movs r2, #1 - 8011606: 4620 mov r0, r4 - 8011608: 4613 mov r3, r2 - 801160a: 2109 movs r1, #9 -} - 801160c: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} - ADC_RegularChannelConfig(ADC3, ADC_Channel_12, 3, ADC_SampleTime_15Cycles); - ADC_RegularChannelConfig(ADC3, ADC_Channel_5, 4, ADC_SampleTime_15Cycles); - - // Injected channels - ADC_InjectedChannelConfig(ADC1, ADC_Channel_8, 1, ADC_SampleTime_15Cycles); - ADC_InjectedChannelConfig(ADC2, ADC_Channel_9, 1, ADC_SampleTime_15Cycles); - 8011610: f000 b8e6 b.w 80117e0 - 8011614: 40012000 .word 0x40012000 - 8011618: 40012100 .word 0x40012100 - 801161c: 40012200 .word 0x40012200 - -08011620 : - /* Check the parameters */ - assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd)); - assert_param(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority)); - assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority)); - - if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) - 8011620: 78c3 ldrb r3, [r0, #3] - 8011622: b95b cbnz r3, 801163c - (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); - } - else - { - /* Disable the Selected IRQ Channels -------------------------------------*/ - NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = - 8011624: 7803 ldrb r3, [r0, #0] - 8011626: 4818 ldr r0, [pc, #96] ; (8011688 ) - 8011628: 095a lsrs r2, r3, #5 - 801162a: 3220 adds r2, #32 - (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); - 801162c: f003 031f and.w r3, r3, #31 - 8011630: 2101 movs r1, #1 - 8011632: fa01 f303 lsl.w r3, r1, r3 - (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); - } - else - { - /* Disable the Selected IRQ Channels -------------------------------------*/ - NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = - 8011636: f840 3022 str.w r3, [r0, r2, lsl #2] - 801163a: 4770 bx lr - assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority)); - - if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) - { - /* Compute the Corresponding IRQ Priority --------------------------------*/ - tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; - 801163c: 4b13 ldr r3, [pc, #76] ; (801168c ) - * @param NVIC_InitStruct: pointer to a NVIC_InitTypeDef structure that contains - * the configuration information for the specified NVIC peripheral. - * @retval None - */ -void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct) -{ - 801163e: b4f0 push {r4, r5, r6, r7} - assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority)); - - if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) - { - /* Compute the Corresponding IRQ Priority --------------------------------*/ - tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; - 8011640: 68d9 ldr r1, [r3, #12] - tmppre = (0x4 - tmppriority); - tmpsub = tmpsub >> tmppriority; - - tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; - 8011642: 7845 ldrb r5, [r0, #1] - tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub); - 8011644: 7882 ldrb r2, [r0, #2] - - tmppriority = tmppriority << 0x04; - - NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority; - 8011646: 7804 ldrb r4, [r0, #0] - 8011648: 4e0f ldr r6, [pc, #60] ; (8011688 ) - assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority)); - - if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) - { - /* Compute the Corresponding IRQ Priority --------------------------------*/ - tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; - 801164a: 43c9 mvns r1, r1 - 801164c: f3c1 2102 ubfx r1, r1, #8, #3 - tmppre = (0x4 - tmppriority); - 8011650: f1c1 0704 rsb r7, r1, #4 - tmpsub = tmpsub >> tmppriority; - - tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; - 8011654: b2ff uxtb r7, r7 - if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) - { - /* Compute the Corresponding IRQ Priority --------------------------------*/ - tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; - tmppre = (0x4 - tmppriority); - tmpsub = tmpsub >> tmppriority; - 8011656: 230f movs r3, #15 - - tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; - 8011658: 40bd lsls r5, r7 - if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) - { - /* Compute the Corresponding IRQ Priority --------------------------------*/ - tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; - tmppre = (0x4 - tmppriority); - tmpsub = tmpsub >> tmppriority; - 801165a: 410b asrs r3, r1 - - tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; - tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub); - 801165c: 4013 ands r3, r2 - /* Compute the Corresponding IRQ Priority --------------------------------*/ - tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; - tmppre = (0x4 - tmppriority); - tmpsub = tmpsub >> tmppriority; - - tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; - 801165e: b2e9 uxtb r1, r5 - tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub); - 8011660: 430b orrs r3, r1 - - tmppriority = tmppriority << 0x04; - - NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority; - 8011662: f104 4260 add.w r2, r4, #3758096384 ; 0xe0000000 - 8011666: f502 4261 add.w r2, r2, #57600 ; 0xe100 - tmpsub = tmpsub >> tmppriority; - - tmppriority = NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; - tmppriority |= (uint8_t)(NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub); - - tmppriority = tmppriority << 0x04; - 801166a: 011b lsls r3, r3, #4 - 801166c: b2db uxtb r3, r3 - - NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority; - 801166e: f882 3300 strb.w r3, [r2, #768] ; 0x300 - - /* Enable the Selected IRQ Channels --------------------------------------*/ - NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = - 8011672: 7803 ldrb r3, [r0, #0] - (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); - 8011674: 2201 movs r2, #1 - 8011676: f003 011f and.w r1, r3, #31 - tmppriority = tmppriority << 0x04; - - NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority; - - /* Enable the Selected IRQ Channels --------------------------------------*/ - NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = - 801167a: 095b lsrs r3, r3, #5 - (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); - 801167c: 408a lsls r2, r1 - tmppriority = tmppriority << 0x04; - - NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority; - - /* Enable the Selected IRQ Channels --------------------------------------*/ - NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = - 801167e: f846 2023 str.w r2, [r6, r3, lsl #2] - { - /* Disable the Selected IRQ Channels -------------------------------------*/ - NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = - (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); - } -} - 8011682: bcf0 pop {r4, r5, r6, r7} - 8011684: 4770 bx lr - 8011686: bf00 nop - 8011688: e000e100 .word 0xe000e100 - 801168c: e000ed00 .word 0xe000ed00 - -08011690 : - * @param ADC_InitStruct: pointer to an ADC_InitTypeDef structure that contains - * the configuration information for the specified ADC peripheral. - * @retval None - */ -void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct) -{ - 8011690: b5f0 push {r4, r5, r6, r7, lr} - assert_param(IS_ADC_DATA_ALIGN(ADC_InitStruct->ADC_DataAlign)); - assert_param(IS_ADC_REGULAR_LENGTH(ADC_InitStruct->ADC_NbrOfConversion)); - - /*---------------------------- ADCx CR1 Configuration -----------------*/ - /* Get the ADCx CR1 value */ - tmpreg1 = ADCx->CR1; - 8011692: 6844 ldr r4, [r0, #4] - 8011694: 680a ldr r2, [r1, #0] - tmpreg1 &= CR1_CLEAR_MASK; - - /* Configure ADCx: scan conversion mode and resolution */ - /* Set SCAN bit according to ADC_ScanConvMode value */ - /* Set RES bit according to ADC_Resolution value */ - tmpreg1 |= (uint32_t)(((uint32_t)ADC_InitStruct->ADC_ScanConvMode << 8) | \ - 8011696: f891 c004 ldrb.w ip, [r1, #4] - 801169a: f8d1 e00c ldr.w lr, [r1, #12] - 801169e: 690e ldr r6, [r1, #16] - 80116a0: 688d ldr r5, [r1, #8] - /* Set EXTSEL bits according to ADC_ExternalTrigConv value */ - /* Set CONT bit according to ADC_ContinuousConvMode value */ - tmpreg1 |= (uint32_t)(ADC_InitStruct->ADC_DataAlign | \ - ADC_InitStruct->ADC_ExternalTrigConv | - ADC_InitStruct->ADC_ExternalTrigConvEdge | \ - ((uint32_t)ADC_InitStruct->ADC_ContinuousConvMode << 1)); - 80116a2: 794f ldrb r7, [r1, #5] - /*---------------------------- ADCx CR2 Configuration -----------------*/ - /* Get the ADCx CR2 value */ - tmpreg1 = ADCx->CR2; - - /* Clear CONT, ALIGN, EXTEN and EXTSEL bits */ - tmpreg1 &= CR2_CLEAR_MASK; - 80116a4: 4b0d ldr r3, [pc, #52] ; (80116dc ) - /*---------------------------- ADCx CR1 Configuration -----------------*/ - /* Get the ADCx CR1 value */ - tmpreg1 = ADCx->CR1; - - /* Clear RES and SCAN bits */ - tmpreg1 &= CR1_CLEAR_MASK; - 80116a6: f024 7440 bic.w r4, r4, #50331648 ; 0x3000000 - 80116aa: f424 7480 bic.w r4, r4, #256 ; 0x100 - 80116ae: 4322 orrs r2, r4 - - /* Configure ADCx: scan conversion mode and resolution */ - /* Set SCAN bit according to ADC_ScanConvMode value */ - /* Set RES bit according to ADC_Resolution value */ - tmpreg1 |= (uint32_t)(((uint32_t)ADC_InitStruct->ADC_ScanConvMode << 8) | \ - 80116b0: ea42 220c orr.w r2, r2, ip, lsl #8 - ADC_InitStruct->ADC_Resolution); - /* Write to ADCx CR1 */ - ADCx->CR1 = tmpreg1; - 80116b4: 6042 str r2, [r0, #4] - /*---------------------------- ADCx CR2 Configuration -----------------*/ - /* Get the ADCx CR2 value */ - tmpreg1 = ADCx->CR2; - 80116b6: 6884 ldr r4, [r0, #8] - 80116b8: ea4e 0206 orr.w r2, lr, r6 - 80116bc: 432a orrs r2, r5 - - /* Clear CONT, ALIGN, EXTEN and EXTSEL bits */ - tmpreg1 &= CR2_CLEAR_MASK; - 80116be: 4023 ands r3, r4 - 80116c0: 4313 orrs r3, r2 - continuous conversion mode */ - /* Set ALIGN bit according to ADC_DataAlign value */ - /* Set EXTEN bits according to ADC_ExternalTrigConvEdge value */ - /* Set EXTSEL bits according to ADC_ExternalTrigConv value */ - /* Set CONT bit according to ADC_ContinuousConvMode value */ - tmpreg1 |= (uint32_t)(ADC_InitStruct->ADC_DataAlign | \ - 80116c2: ea43 0347 orr.w r3, r3, r7, lsl #1 - ADC_InitStruct->ADC_ExternalTrigConv | - ADC_InitStruct->ADC_ExternalTrigConvEdge | \ - ((uint32_t)ADC_InitStruct->ADC_ContinuousConvMode << 1)); - - /* Write to ADCx CR2 */ - ADCx->CR2 = tmpreg1; - 80116c6: 6083 str r3, [r0, #8] - /* Clear L bits */ - tmpreg1 &= SQR1_L_RESET; - - /* Configure ADCx: regular channel sequence length */ - /* Set L bits according to ADC_NbrOfConversion value */ - tmpreg2 |= (uint8_t)(ADC_InitStruct->ADC_NbrOfConversion - (uint8_t)1); - 80116c8: 7d0a ldrb r2, [r1, #20] - - /* Write to ADCx CR2 */ - ADCx->CR2 = tmpreg1; - /*---------------------------- ADCx SQR1 Configuration -----------------*/ - /* Get the ADCx SQR1 value */ - tmpreg1 = ADCx->SQR1; - 80116ca: 6ac3 ldr r3, [r0, #44] ; 0x2c - /* Clear L bits */ - tmpreg1 &= SQR1_L_RESET; - - /* Configure ADCx: regular channel sequence length */ - /* Set L bits according to ADC_NbrOfConversion value */ - tmpreg2 |= (uint8_t)(ADC_InitStruct->ADC_NbrOfConversion - (uint8_t)1); - 80116cc: 3a01 subs r2, #1 - tmpreg1 |= ((uint32_t)tmpreg2 << 20); - 80116ce: b2d2 uxtb r2, r2 - /*---------------------------- ADCx SQR1 Configuration -----------------*/ - /* Get the ADCx SQR1 value */ - tmpreg1 = ADCx->SQR1; - - /* Clear L bits */ - tmpreg1 &= SQR1_L_RESET; - 80116d0: f423 0370 bic.w r3, r3, #15728640 ; 0xf00000 - - /* Configure ADCx: regular channel sequence length */ - /* Set L bits according to ADC_NbrOfConversion value */ - tmpreg2 |= (uint8_t)(ADC_InitStruct->ADC_NbrOfConversion - (uint8_t)1); - tmpreg1 |= ((uint32_t)tmpreg2 << 20); - 80116d4: ea43 5302 orr.w r3, r3, r2, lsl #20 - - /* Write to ADCx SQR1 */ - ADCx->SQR1 = tmpreg1; - 80116d8: 62c3 str r3, [r0, #44] ; 0x2c - 80116da: bdf0 pop {r4, r5, r6, r7, pc} - 80116dc: c0fff7fd .word 0xc0fff7fd - -080116e0 : - * @param ADC_CommonInitStruct: pointer to an ADC_CommonInitTypeDef structure - * that contains the configuration information for All ADCs peripherals. - * @retval None - */ -void ADC_CommonInit(ADC_CommonInitTypeDef* ADC_CommonInitStruct) -{ - 80116e0: b470 push {r4, r5, r6} - and DMA access mode for multimode */ - /* Set MULTI bits according to ADC_Mode value */ - /* Set ADCPRE bits according to ADC_Prescaler value */ - /* Set DMA bits according to ADC_DMAAccessMode value */ - /* Set DELAY bits according to ADC_TwoSamplingDelay value */ - tmpreg1 |= (uint32_t)(ADC_CommonInitStruct->ADC_Mode | - 80116e2: e890 0044 ldmia.w r0, {r2, r6} - assert_param(IS_ADC_PRESCALER(ADC_CommonInitStruct->ADC_Prescaler)); - assert_param(IS_ADC_DMA_ACCESS_MODE(ADC_CommonInitStruct->ADC_DMAAccessMode)); - assert_param(IS_ADC_SAMPLING_DELAY(ADC_CommonInitStruct->ADC_TwoSamplingDelay)); - /*---------------------------- ADC CCR Configuration -----------------*/ - /* Get the ADC CCR value */ - tmpreg1 = ADC->CCR; - 80116e6: 4d06 ldr r5, [pc, #24] ; (8011700 ) - /* Set MULTI bits according to ADC_Mode value */ - /* Set ADCPRE bits according to ADC_Prescaler value */ - /* Set DMA bits according to ADC_DMAAccessMode value */ - /* Set DELAY bits according to ADC_TwoSamplingDelay value */ - tmpreg1 |= (uint32_t)(ADC_CommonInitStruct->ADC_Mode | - ADC_CommonInitStruct->ADC_Prescaler | - 80116e8: 6884 ldr r4, [r0, #8] - and DMA access mode for multimode */ - /* Set MULTI bits according to ADC_Mode value */ - /* Set ADCPRE bits according to ADC_Prescaler value */ - /* Set DMA bits according to ADC_DMAAccessMode value */ - /* Set DELAY bits according to ADC_TwoSamplingDelay value */ - tmpreg1 |= (uint32_t)(ADC_CommonInitStruct->ADC_Mode | - 80116ea: 68c1 ldr r1, [r0, #12] - /*---------------------------- ADC CCR Configuration -----------------*/ - /* Get the ADC CCR value */ - tmpreg1 = ADC->CCR; - - /* Clear MULTI, DELAY, DMA and ADCPRE bits */ - tmpreg1 &= CR_CLEAR_MASK; - 80116ec: 4b05 ldr r3, [pc, #20] ; (8011704 ) - assert_param(IS_ADC_PRESCALER(ADC_CommonInitStruct->ADC_Prescaler)); - assert_param(IS_ADC_DMA_ACCESS_MODE(ADC_CommonInitStruct->ADC_DMAAccessMode)); - assert_param(IS_ADC_SAMPLING_DELAY(ADC_CommonInitStruct->ADC_TwoSamplingDelay)); - /*---------------------------- ADC CCR Configuration -----------------*/ - /* Get the ADC CCR value */ - tmpreg1 = ADC->CCR; - 80116ee: 6868 ldr r0, [r5, #4] - and DMA access mode for multimode */ - /* Set MULTI bits according to ADC_Mode value */ - /* Set ADCPRE bits according to ADC_Prescaler value */ - /* Set DMA bits according to ADC_DMAAccessMode value */ - /* Set DELAY bits according to ADC_TwoSamplingDelay value */ - tmpreg1 |= (uint32_t)(ADC_CommonInitStruct->ADC_Mode | - 80116f0: 4332 orrs r2, r6 - ADC_CommonInitStruct->ADC_Prescaler | - 80116f2: 4322 orrs r2, r4 - and DMA access mode for multimode */ - /* Set MULTI bits according to ADC_Mode value */ - /* Set ADCPRE bits according to ADC_Prescaler value */ - /* Set DMA bits according to ADC_DMAAccessMode value */ - /* Set DELAY bits according to ADC_TwoSamplingDelay value */ - tmpreg1 |= (uint32_t)(ADC_CommonInitStruct->ADC_Mode | - 80116f4: 430a orrs r2, r1 - /*---------------------------- ADC CCR Configuration -----------------*/ - /* Get the ADC CCR value */ - tmpreg1 = ADC->CCR; - - /* Clear MULTI, DELAY, DMA and ADCPRE bits */ - tmpreg1 &= CR_CLEAR_MASK; - 80116f6: 4003 ands r3, r0 - and DMA access mode for multimode */ - /* Set MULTI bits according to ADC_Mode value */ - /* Set ADCPRE bits according to ADC_Prescaler value */ - /* Set DMA bits according to ADC_DMAAccessMode value */ - /* Set DELAY bits according to ADC_TwoSamplingDelay value */ - tmpreg1 |= (uint32_t)(ADC_CommonInitStruct->ADC_Mode | - 80116f8: 4313 orrs r3, r2 - ADC_CommonInitStruct->ADC_Prescaler | - ADC_CommonInitStruct->ADC_DMAAccessMode | - ADC_CommonInitStruct->ADC_TwoSamplingDelay); - - /* Write to ADC CCR */ - ADC->CCR = tmpreg1; - 80116fa: 606b str r3, [r5, #4] -} - 80116fc: bc70 pop {r4, r5, r6} - 80116fe: 4770 bx lr - 8011700: 40012300 .word 0x40012300 - 8011704: fffc30e0 .word 0xfffc30e0 - 8011708: f3af 8000 nop.w - 801170c: f3af 8000 nop.w - -08011710 : - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - /* Set the ADON bit to wake up the ADC from power down mode */ - ADCx->CR2 |= (uint32_t)ADC_CR2_ADON; - 8011710: 6883 ldr r3, [r0, #8] -void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState) -{ - /* Check the parameters */ - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - 8011712: b919 cbnz r1, 801171c - ADCx->CR2 |= (uint32_t)ADC_CR2_ADON; - } - else - { - /* Disable the selected ADC peripheral */ - ADCx->CR2 &= (uint32_t)(~ADC_CR2_ADON); - 8011714: f023 0301 bic.w r3, r3, #1 - 8011718: 6083 str r3, [r0, #8] - 801171a: 4770 bx lr - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - /* Set the ADON bit to wake up the ADC from power down mode */ - ADCx->CR2 |= (uint32_t)ADC_CR2_ADON; - 801171c: f043 0301 orr.w r3, r3, #1 - 8011720: 6083 str r3, [r0, #8] - 8011722: 4770 bx lr - 8011724: f3af 8000 nop.w - 8011728: f3af 8000 nop.w - 801172c: f3af 8000 nop.w - -08011730 : - assert_param(IS_ADC_CHANNEL(ADC_Channel)); - assert_param(IS_ADC_REGULAR_RANK(Rank)); - assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime)); - - /* if ADC_Channel_10 ... ADC_Channel_18 is selected */ - if (ADC_Channel > ADC_Channel_9) - 8011730: 2909 cmp r1, #9 - * @arg ADC_SampleTime_144Cycles: Sample time equal to 144 cycles - * @arg ADC_SampleTime_480Cycles: Sample time equal to 480 cycles - * @retval None - */ -void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime) -{ - 8011732: b470 push {r4, r5, r6} - assert_param(IS_ADC_CHANNEL(ADC_Channel)); - assert_param(IS_ADC_REGULAR_RANK(Rank)); - assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime)); - - /* if ADC_Channel_10 ... ADC_Channel_18 is selected */ - if (ADC_Channel > ADC_Channel_9) - 8011734: d91c bls.n 8011770 - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR1; - - /* Calculate the mask to clear */ - tmpreg2 = SMPR1_SMP_SET << (3 * (ADC_Channel - 10)); - 8011736: f1a1 040a sub.w r4, r1, #10 - 801173a: eb04 0444 add.w r4, r4, r4, lsl #1 - - /* if ADC_Channel_10 ... ADC_Channel_18 is selected */ - if (ADC_Channel > ADC_Channel_9) - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR1; - 801173e: 68c5 ldr r5, [r0, #12] - - /* Calculate the mask to clear */ - tmpreg2 = SMPR1_SMP_SET << (3 * (ADC_Channel - 10)); - 8011740: 2607 movs r6, #7 - 8011742: 40a6 lsls r6, r4 - - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3 * (ADC_Channel - 10)); - 8011744: 40a3 lsls r3, r4 - - /* Calculate the mask to clear */ - tmpreg2 = SMPR1_SMP_SET << (3 * (ADC_Channel - 10)); - - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - 8011746: ea25 0406 bic.w r4, r5, r6 - - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3 * (ADC_Channel - 10)); - - /* Set the new sample time */ - tmpreg1 |= tmpreg2; - 801174a: 4323 orrs r3, r4 - - /* Store the new register value */ - ADCx->SMPR2 = tmpreg1; - } - /* For Rank 1 to 6 */ - if (Rank < 7) - 801174c: 2a06 cmp r2, #6 - - /* Set the new sample time */ - tmpreg1 |= tmpreg2; - - /* Store the new register value */ - ADCx->SMPR1 = tmpreg1; - 801174e: 60c3 str r3, [r0, #12] - - /* Store the new register value */ - ADCx->SMPR2 = tmpreg1; - } - /* For Rank 1 to 6 */ - if (Rank < 7) - 8011750: d91a bls.n 8011788 - - /* Store the new register value */ - ADCx->SQR3 = tmpreg1; - } - /* For Rank 7 to 12 */ - else if (Rank < 13) - 8011752: 2a0c cmp r2, #12 - 8011754: d925 bls.n 80117a2 - { - /* Get the old register value */ - tmpreg1 = ADCx->SQR1; - - /* Calculate the mask to clear */ - tmpreg2 = SQR1_SQ_SET << (5 * (Rank - 13)); - 8011756: 3a0d subs r2, #13 - } - /* For Rank 13 to 16 */ - else - { - /* Get the old register value */ - tmpreg1 = ADCx->SQR1; - 8011758: 6ac4 ldr r4, [r0, #44] ; 0x2c - - /* Calculate the mask to clear */ - tmpreg2 = SQR1_SQ_SET << (5 * (Rank - 13)); - 801175a: eb02 0282 add.w r2, r2, r2, lsl #2 - 801175e: 231f movs r3, #31 - 8011760: 4093 lsls r3, r2 - - /* Clear the old SQx bits for the selected rank */ - tmpreg1 &= ~tmpreg2; - 8011762: ea24 0303 bic.w r3, r4, r3 - - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 13)); - 8011766: 4091 lsls r1, r2 - - /* Set the SQx bits for the selected rank */ - tmpreg1 |= tmpreg2; - 8011768: 4319 orrs r1, r3 - - /* Store the new register value */ - ADCx->SQR1 = tmpreg1; - 801176a: 62c1 str r1, [r0, #44] ; 0x2c - } -} - 801176c: bc70 pop {r4, r5, r6} - 801176e: 4770 bx lr - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR2; - - /* Calculate the mask to clear */ - tmpreg2 = SMPR2_SMP_SET << (3 * ADC_Channel); - 8011770: eb01 0641 add.w r6, r1, r1, lsl #1 - ADCx->SMPR1 = tmpreg1; - } - else /* ADC_Channel include in ADC_Channel_[0..9] */ - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR2; - 8011774: 6905 ldr r5, [r0, #16] - - /* Calculate the mask to clear */ - tmpreg2 = SMPR2_SMP_SET << (3 * ADC_Channel); - 8011776: 2407 movs r4, #7 - 8011778: 40b4 lsls r4, r6 - - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3 * ADC_Channel); - 801177a: 40b3 lsls r3, r6 - - /* Calculate the mask to clear */ - tmpreg2 = SMPR2_SMP_SET << (3 * ADC_Channel); - - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - 801177c: ea25 0404 bic.w r4, r5, r4 - - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3 * ADC_Channel); - - /* Set the new sample time */ - tmpreg1 |= tmpreg2; - 8011780: 4323 orrs r3, r4 - - /* Store the new register value */ - ADCx->SMPR2 = tmpreg1; - } - /* For Rank 1 to 6 */ - if (Rank < 7) - 8011782: 2a06 cmp r2, #6 - - /* Set the new sample time */ - tmpreg1 |= tmpreg2; - - /* Store the new register value */ - ADCx->SMPR2 = tmpreg1; - 8011784: 6103 str r3, [r0, #16] - } - /* For Rank 1 to 6 */ - if (Rank < 7) - 8011786: d8e4 bhi.n 8011752 - { - /* Get the old register value */ - tmpreg1 = ADCx->SQR3; - - /* Calculate the mask to clear */ - tmpreg2 = SQR3_SQ_SET << (5 * (Rank - 1)); - 8011788: 3a01 subs r2, #1 - } - /* For Rank 1 to 6 */ - if (Rank < 7) - { - /* Get the old register value */ - tmpreg1 = ADCx->SQR3; - 801178a: 6b44 ldr r4, [r0, #52] ; 0x34 - - /* Calculate the mask to clear */ - tmpreg2 = SQR3_SQ_SET << (5 * (Rank - 1)); - 801178c: eb02 0282 add.w r2, r2, r2, lsl #2 - 8011790: 231f movs r3, #31 - 8011792: 4093 lsls r3, r2 - - /* Clear the old SQx bits for the selected rank */ - tmpreg1 &= ~tmpreg2; - 8011794: ea24 0303 bic.w r3, r4, r3 - - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 1)); - 8011798: 4091 lsls r1, r2 - - /* Set the SQx bits for the selected rank */ - tmpreg1 |= tmpreg2; - 801179a: 4319 orrs r1, r3 - - /* Store the new register value */ - ADCx->SQR3 = tmpreg1; - 801179c: 6341 str r1, [r0, #52] ; 0x34 - tmpreg1 |= tmpreg2; - - /* Store the new register value */ - ADCx->SQR1 = tmpreg1; - } -} - 801179e: bc70 pop {r4, r5, r6} - 80117a0: 4770 bx lr - { - /* Get the old register value */ - tmpreg1 = ADCx->SQR2; - - /* Calculate the mask to clear */ - tmpreg2 = SQR2_SQ_SET << (5 * (Rank - 7)); - 80117a2: 3a07 subs r2, #7 - } - /* For Rank 7 to 12 */ - else if (Rank < 13) - { - /* Get the old register value */ - tmpreg1 = ADCx->SQR2; - 80117a4: 6b04 ldr r4, [r0, #48] ; 0x30 - - /* Calculate the mask to clear */ - tmpreg2 = SQR2_SQ_SET << (5 * (Rank - 7)); - 80117a6: eb02 0282 add.w r2, r2, r2, lsl #2 - 80117aa: 231f movs r3, #31 - 80117ac: 4093 lsls r3, r2 - - /* Clear the old SQx bits for the selected rank */ - tmpreg1 &= ~tmpreg2; - 80117ae: ea24 0303 bic.w r3, r4, r3 - - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 7)); - 80117b2: 4091 lsls r1, r2 - - /* Set the SQx bits for the selected rank */ - tmpreg1 |= tmpreg2; - 80117b4: 4319 orrs r1, r3 - - /* Store the new register value */ - ADCx->SQR2 = tmpreg1; - 80117b6: 6301 str r1, [r0, #48] ; 0x30 - tmpreg1 |= tmpreg2; - - /* Store the new register value */ - ADCx->SQR1 = tmpreg1; - } -} - 80117b8: bc70 pop {r4, r5, r6} - 80117ba: 4770 bx lr - 80117bc: f3af 8000 nop.w - -080117c0 : - /* Check the parameters */ - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - /* Enable the selected ADC DMA request after last transfer */ - ADC->CCR |= (uint32_t)ADC_CCR_DDS; - 80117c0: 4a05 ldr r2, [pc, #20] ; (80117d8 ) - 80117c2: 6853 ldr r3, [r2, #4] - */ -void ADC_MultiModeDMARequestAfterLastTransferCmd(FunctionalState NewState) -{ - /* Check the parameters */ - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - 80117c4: b918 cbnz r0, 80117ce - ADC->CCR |= (uint32_t)ADC_CCR_DDS; - } - else - { - /* Disable the selected ADC DMA request after last transfer */ - ADC->CCR &= (uint32_t)(~ADC_CCR_DDS); - 80117c6: f423 5300 bic.w r3, r3, #8192 ; 0x2000 - 80117ca: 6053 str r3, [r2, #4] - 80117cc: 4770 bx lr - /* Check the parameters */ - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - /* Enable the selected ADC DMA request after last transfer */ - ADC->CCR |= (uint32_t)ADC_CCR_DDS; - 80117ce: f443 5300 orr.w r3, r3, #8192 ; 0x2000 - 80117d2: 6053 str r3, [r2, #4] - 80117d4: 4770 bx lr - 80117d6: bf00 nop - 80117d8: 40012300 .word 0x40012300 - 80117dc: f3af 8000 nop.w - -080117e0 : - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_ADC_CHANNEL(ADC_Channel)); - assert_param(IS_ADC_INJECTED_RANK(Rank)); - assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime)); - /* if ADC_Channel_10 ... ADC_Channel_18 is selected */ - if (ADC_Channel > ADC_Channel_9) - 80117e0: 2909 cmp r1, #9 - * @arg ADC_SampleTime_144Cycles: Sample time equal to 144 cycles - * @arg ADC_SampleTime_480Cycles: Sample time equal to 480 cycles - * @retval None - */ -void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime) -{ - 80117e2: b470 push {r4, r5, r6} - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_ADC_CHANNEL(ADC_Channel)); - assert_param(IS_ADC_INJECTED_RANK(Rank)); - assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime)); - /* if ADC_Channel_10 ... ADC_Channel_18 is selected */ - if (ADC_Channel > ADC_Channel_9) - 80117e4: d81a bhi.n 801181c - else /* ADC_Channel include in ADC_Channel_[0..9] */ - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR2; - /* Calculate the mask to clear */ - tmpreg2 = SMPR2_SMP_SET << (3 * ADC_Channel); - 80117e6: eb01 0641 add.w r6, r1, r1, lsl #1 - ADCx->SMPR1 = tmpreg1; - } - else /* ADC_Channel include in ADC_Channel_[0..9] */ - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR2; - 80117ea: 6905 ldr r5, [r0, #16] - /* Calculate the mask to clear */ - tmpreg2 = SMPR2_SMP_SET << (3 * ADC_Channel); - 80117ec: 2407 movs r4, #7 - 80117ee: 40b4 lsls r4, r6 - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3 * ADC_Channel); - 80117f0: 40b3 lsls r3, r6 - /* Get the old register value */ - tmpreg1 = ADCx->SMPR2; - /* Calculate the mask to clear */ - tmpreg2 = SMPR2_SMP_SET << (3 * ADC_Channel); - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - 80117f2: ea25 0404 bic.w r4, r5, r4 - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3 * ADC_Channel); - /* Set the new sample time */ - tmpreg1 |= tmpreg2; - 80117f6: 4323 orrs r3, r4 - /* Store the new register value */ - ADCx->SMPR2 = tmpreg1; - 80117f8: 6103 str r3, [r0, #16] - } - /* Rank configuration */ - /* Get the old register value */ - tmpreg1 = ADCx->JSQR; - 80117fa: 6b83 ldr r3, [r0, #56] ; 0x38 - 80117fc: 3202 adds r2, #2 - /* Get JL value: Number = JL+1 */ - tmpreg3 = (tmpreg1 & JSQR_JL_SET)>> 20; - 80117fe: f3c3 5401 ubfx r4, r3, #20, #2 - /* Calculate the mask to clear: ((Rank-1)+(4-JL-1)) */ - tmpreg2 = JSQR_JSQ_SET << (5 * (uint8_t)((Rank + 3) - (tmpreg3 + 1))); - 8011802: 1b12 subs r2, r2, r4 - 8011804: b2d2 uxtb r2, r2 - 8011806: eb02 0282 add.w r2, r2, r2, lsl #2 - 801180a: 241f movs r4, #31 - 801180c: 4094 lsls r4, r2 - /* Clear the old JSQx bits for the selected rank */ - tmpreg1 &= ~tmpreg2; - 801180e: ea23 0304 bic.w r3, r3, r4 - /* Calculate the mask to set: ((Rank-1)+(4-JL-1)) */ - tmpreg2 = (uint32_t)ADC_Channel << (5 * (uint8_t)((Rank + 3) - (tmpreg3 + 1))); - 8011812: 4091 lsls r1, r2 - /* Set the JSQx bits for the selected rank */ - tmpreg1 |= tmpreg2; - 8011814: 4319 orrs r1, r3 - /* Store the new register value */ - ADCx->JSQR = tmpreg1; - 8011816: 6381 str r1, [r0, #56] ; 0x38 -} - 8011818: bc70 pop {r4, r5, r6} - 801181a: 4770 bx lr - if (ADC_Channel > ADC_Channel_9) - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR1; - /* Calculate the mask to clear */ - tmpreg2 = SMPR1_SMP_SET << (3*(ADC_Channel - 10)); - 801181c: f1a1 040a sub.w r4, r1, #10 - 8011820: eb04 0444 add.w r4, r4, r4, lsl #1 - assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime)); - /* if ADC_Channel_10 ... ADC_Channel_18 is selected */ - if (ADC_Channel > ADC_Channel_9) - { - /* Get the old register value */ - tmpreg1 = ADCx->SMPR1; - 8011824: 68c5 ldr r5, [r0, #12] - /* Calculate the mask to clear */ - tmpreg2 = SMPR1_SMP_SET << (3*(ADC_Channel - 10)); - 8011826: 2607 movs r6, #7 - 8011828: 40a6 lsls r6, r4 - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3*(ADC_Channel - 10)); - 801182a: 40a3 lsls r3, r4 - /* Get the old register value */ - tmpreg1 = ADCx->SMPR1; - /* Calculate the mask to clear */ - tmpreg2 = SMPR1_SMP_SET << (3*(ADC_Channel - 10)); - /* Clear the old sample time */ - tmpreg1 &= ~tmpreg2; - 801182c: ea25 0406 bic.w r4, r5, r6 - /* Calculate the mask to set */ - tmpreg2 = (uint32_t)ADC_SampleTime << (3*(ADC_Channel - 10)); - /* Set the new sample time */ - tmpreg1 |= tmpreg2; - 8011830: 4323 orrs r3, r4 - /* Store the new register value */ - ADCx->SMPR1 = tmpreg1; - 8011832: 60c3 str r3, [r0, #12] - 8011834: e7e1 b.n 80117fa - 8011836: bf00 nop - 8011838: f3af 8000 nop.w - 801183c: f3af 8000 nop.w - -08011840 : - /* Check the parameters */ - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_ADC_INJECTED_LENGTH(Length)); - - /* Get the old register value */ - tmpreg1 = ADCx->JSQR; - 8011840: 6b83 ldr r3, [r0, #56] ; 0x38 - - /* Clear the old injected sequence length JL bits */ - tmpreg1 &= JSQR_JL_RESET; - - /* Set the injected sequence length JL bits */ - tmpreg2 = Length - 1; - 8011842: 3901 subs r1, #1 - - /* Get the old register value */ - tmpreg1 = ADCx->JSQR; - - /* Clear the old injected sequence length JL bits */ - tmpreg1 &= JSQR_JL_RESET; - 8011844: f423 1340 bic.w r3, r3, #3145728 ; 0x300000 - - /* Set the injected sequence length JL bits */ - tmpreg2 = Length - 1; - tmpreg1 |= tmpreg2 << 20; - 8011848: ea43 5101 orr.w r1, r3, r1, lsl #20 - - /* Store the new register value */ - ADCx->JSQR = tmpreg1; - 801184c: 6381 str r1, [r0, #56] ; 0x38 - 801184e: 4770 bx lr - -08011850 : - /* Check the parameters */ - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_ADC_EXT_INJEC_TRIG(ADC_ExternalTrigInjecConv)); - - /* Get the old register value */ - tmpreg = ADCx->CR2; - 8011850: 6883 ldr r3, [r0, #8] - - /* Clear the old external event selection for injected group */ - tmpreg &= CR2_JEXTSEL_RESET; - 8011852: f423 2370 bic.w r3, r3, #983040 ; 0xf0000 - - /* Set the external event selection for injected group */ - tmpreg |= ADC_ExternalTrigInjecConv; - 8011856: 4319 orrs r1, r3 - - /* Store the new register value */ - ADCx->CR2 = tmpreg; - 8011858: 6081 str r1, [r0, #8] - 801185a: 4770 bx lr - 801185c: f3af 8000 nop.w - -08011860 : - uint32_t tmpreg = 0; - /* Check the parameters */ - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_ADC_EXT_INJEC_TRIG_EDGE(ADC_ExternalTrigInjecConvEdge)); - /* Get the old register value */ - tmpreg = ADCx->CR2; - 8011860: 6883 ldr r3, [r0, #8] - /* Clear the old external trigger edge for injected group */ - tmpreg &= CR2_JEXTEN_RESET; - 8011862: f423 1340 bic.w r3, r3, #3145728 ; 0x300000 - /* Set the new external trigger edge for injected group */ - tmpreg |= ADC_ExternalTrigInjecConvEdge; - 8011866: 4319 orrs r1, r3 - /* Store the new register value */ - ADCx->CR2 = tmpreg; - 8011868: 6081 str r1, [r0, #8] - 801186a: 4770 bx lr - 801186c: f3af 8000 nop.w - -08011870 : - * @arg ADC_InjectedChannel_3: Injected Channel3 selected - * @arg ADC_InjectedChannel_4: Injected Channel4 selected - * @retval The Data conversion value. - */ -uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel) -{ - 8011870: b082 sub sp, #8 - __IO uint32_t tmp = 0; - 8011872: 2300 movs r3, #0 - 8011874: 9301 str r3, [sp, #4] - - /* Check the parameters */ - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel)); - - tmp = (uint32_t)ADCx; - 8011876: 9001 str r0, [sp, #4] - tmp += ADC_InjectedChannel + JDR_OFFSET; - 8011878: 9b01 ldr r3, [sp, #4] - 801187a: 3328 adds r3, #40 ; 0x28 - 801187c: 4419 add r1, r3 - 801187e: 9101 str r1, [sp, #4] - - /* Returns the selected injected channel conversion data value */ - return (uint16_t) (*(__IO uint32_t*) tmp); - 8011880: 9b01 ldr r3, [sp, #4] - 8011882: 6818 ldr r0, [r3, #0] -} - 8011884: b280 uxth r0, r0 - 8011886: b002 add sp, #8 - 8011888: 4770 bx lr - 801188a: bf00 nop - 801188c: f3af 8000 nop.w - -08011890 : - assert_param(IS_FUNCTIONAL_STATE(NewState)); - assert_param(IS_ADC_IT(ADC_IT)); - - /* Get the ADC IT index */ - itmask = (uint8_t)ADC_IT; - itmask = (uint32_t)0x01 << itmask; - 8011890: b2c9 uxtb r1, r1 - 8011892: 2301 movs r3, #1 - 8011894: 408b lsls r3, r1 - - if (NewState != DISABLE) - 8011896: b922 cbnz r2, 80118a2 - ADCx->CR1 |= itmask; - } - else - { - /* Disable the selected ADC interrupts */ - ADCx->CR1 &= (~(uint32_t)itmask); - 8011898: 6842 ldr r2, [r0, #4] - 801189a: ea22 0303 bic.w r3, r2, r3 - 801189e: 6043 str r3, [r0, #4] - 80118a0: 4770 bx lr - itmask = (uint32_t)0x01 << itmask; - - if (NewState != DISABLE) - { - /* Enable the selected ADC interrupts */ - ADCx->CR1 |= itmask; - 80118a2: 6842 ldr r2, [r0, #4] - 80118a4: 4313 orrs r3, r2 - 80118a6: 6043 str r3, [r0, #4] - 80118a8: 4770 bx lr - 80118aa: bf00 nop - 80118ac: f3af 8000 nop.w - -080118b0 : - assert_param(IS_ADC_ALL_PERIPH(ADCx)); - assert_param(IS_ADC_IT(ADC_IT)); - /* Get the ADC IT index */ - itmask = (uint8_t)(ADC_IT >> 8); - /* Clear the selected ADC interrupt pending bits */ - ADCx->SR = ~(uint32_t)itmask; - 80118b0: ea6f 2111 mvn.w r1, r1, lsr #8 - 80118b4: 6001 str r1, [r0, #0] - 80118b6: 4770 bx lr - 80118b8: f3af 8000 nop.w - 80118bc: f3af 8000 nop.w - -080118c0 : - * @param DMA_InitStruct: pointer to a DMA_InitTypeDef structure that contains - * the configuration information for the specified DMA Stream. - * @retval None - */ -void DMA_Init(DMA_Stream_TypeDef* DMAy_Streamx, DMA_InitTypeDef* DMA_InitStruct) -{ - 80118c0: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - 80118c4: b082 sub sp, #8 - /* Set MBURST bits according to DMA_MemoryBurst value */ - /* Set PBURST bits according to DMA_PeripheralBurst value */ - tmpreg |= DMA_InitStruct->DMA_Channel | DMA_InitStruct->DMA_DIR | - DMA_InitStruct->DMA_PeripheralInc | DMA_InitStruct->DMA_MemoryInc | - DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | - DMA_InitStruct->DMA_Mode | DMA_InitStruct->DMA_Priority | - 80118c6: 6a8b ldr r3, [r1, #40] ; 0x28 - 80118c8: 9301 str r3, [sp, #4] - /* Set MSIZE bits according to DMA_MemoryDataSize value */ - /* Set CIRC bit according to DMA_Mode value */ - /* Set PL bits according to DMA_Priority value */ - /* Set MBURST bits according to DMA_MemoryBurst value */ - /* Set PBURST bits according to DMA_PeripheralBurst value */ - tmpreg |= DMA_InitStruct->DMA_Channel | DMA_InitStruct->DMA_DIR | - 80118ca: 68cb ldr r3, [r1, #12] - 80118cc: 694f ldr r7, [r1, #20] - DMA_InitStruct->DMA_PeripheralInc | DMA_InitStruct->DMA_MemoryInc | - 80118ce: 698e ldr r6, [r1, #24] - 80118d0: 69cd ldr r5, [r1, #28] - DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | - 80118d2: 6a0c ldr r4, [r1, #32] - 80118d4: 6a4a ldr r2, [r1, #36] ; 0x24 - assert_param(IS_DMA_MEMORY_BURST(DMA_InitStruct->DMA_MemoryBurst)); - assert_param(IS_DMA_PERIPHERAL_BURST(DMA_InitStruct->DMA_PeripheralBurst)); - - /*------------------------- DMAy Streamx CR Configuration ------------------*/ - /* Get the DMAy_Streamx CR value */ - tmpreg = DMAy_Streamx->CR; - 80118d6: f8d0 c000 ldr.w ip, [r0] - - /* Clear CHSEL, MBURST, PBURST, PL, MSIZE, PSIZE, MINC, PINC, CIRC and DIR bits */ - tmpreg &= ((uint32_t)~(DMA_SxCR_CHSEL | DMA_SxCR_MBURST | DMA_SxCR_PBURST | \ - 80118da: f8df e050 ldr.w lr, [pc, #80] ; 801192c - /* Set MSIZE bits according to DMA_MemoryDataSize value */ - /* Set CIRC bit according to DMA_Mode value */ - /* Set PL bits according to DMA_Priority value */ - /* Set MBURST bits according to DMA_MemoryBurst value */ - /* Set PBURST bits according to DMA_PeripheralBurst value */ - tmpreg |= DMA_InitStruct->DMA_Channel | DMA_InitStruct->DMA_DIR | - 80118de: 4698 mov r8, r3 - 80118e0: 680b ldr r3, [r1, #0] - 80118e2: ea48 0803 orr.w r8, r8, r3 - 80118e6: ea48 0707 orr.w r7, r8, r7 - DMA_InitStruct->DMA_PeripheralInc | DMA_InitStruct->DMA_MemoryInc | - 80118ea: 433e orrs r6, r7 - 80118ec: 4335 orrs r5, r6 - DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | - 80118ee: 432c orrs r4, r5 - DMA_InitStruct->DMA_Mode | DMA_InitStruct->DMA_Priority | - 80118f0: 9b01 ldr r3, [sp, #4] - tmpreg &= (uint32_t)~(DMA_SxFCR_DMDIS | DMA_SxFCR_FTH); - - /* Configure DMAy Streamx FIFO: - Set DMDIS bits according to DMA_FIFOMode value - Set FTH bits according to DMA_FIFOThreshold value */ - tmpreg |= DMA_InitStruct->DMA_FIFOMode | DMA_InitStruct->DMA_FIFOThreshold; - 80118f2: 6b0e ldr r6, [r1, #48] ; 0x30 - /* Write to DMAy Streamx CR */ - DMAy_Streamx->FCR = tmpreg; - - /*------------------------- DMAy Streamx NDTR Configuration ----------------*/ - /* Write to DMAy Streamx NDTR register */ - DMAy_Streamx->NDTR = DMA_InitStruct->DMA_BufferSize; - 80118f4: 690d ldr r5, [r1, #16] - /* Set PL bits according to DMA_Priority value */ - /* Set MBURST bits according to DMA_MemoryBurst value */ - /* Set PBURST bits according to DMA_PeripheralBurst value */ - tmpreg |= DMA_InitStruct->DMA_Channel | DMA_InitStruct->DMA_DIR | - DMA_InitStruct->DMA_PeripheralInc | DMA_InitStruct->DMA_MemoryInc | - DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | - 80118f6: 4322 orrs r2, r4 - DMA_InitStruct->DMA_Mode | DMA_InitStruct->DMA_Priority | - 80118f8: 4313 orrs r3, r2 - 80118fa: 6b4a ldr r2, [r1, #52] ; 0x34 - /* Write to DMAy Streamx NDTR register */ - DMAy_Streamx->NDTR = DMA_InitStruct->DMA_BufferSize; - - /*------------------------- DMAy Streamx PAR Configuration -----------------*/ - /* Write to DMAy Streamx PAR */ - DMAy_Streamx->PAR = DMA_InitStruct->DMA_PeripheralBaseAddr; - 80118fc: 684c ldr r4, [r1, #4] - /* Set MBURST bits according to DMA_MemoryBurst value */ - /* Set PBURST bits according to DMA_PeripheralBurst value */ - tmpreg |= DMA_InitStruct->DMA_Channel | DMA_InitStruct->DMA_DIR | - DMA_InitStruct->DMA_PeripheralInc | DMA_InitStruct->DMA_MemoryInc | - DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | - DMA_InitStruct->DMA_Mode | DMA_InitStruct->DMA_Priority | - 80118fe: 4313 orrs r3, r2 - DMA_InitStruct->DMA_MemoryBurst | DMA_InitStruct->DMA_PeripheralBurst; - 8011900: 6b8a ldr r2, [r1, #56] ; 0x38 - /*------------------------- DMAy Streamx CR Configuration ------------------*/ - /* Get the DMAy_Streamx CR value */ - tmpreg = DMAy_Streamx->CR; - - /* Clear CHSEL, MBURST, PBURST, PL, MSIZE, PSIZE, MINC, PINC, CIRC and DIR bits */ - tmpreg &= ((uint32_t)~(DMA_SxCR_CHSEL | DMA_SxCR_MBURST | DMA_SxCR_PBURST | \ - 8011902: ea0c 0e0e and.w lr, ip, lr - /* Set PBURST bits according to DMA_PeripheralBurst value */ - tmpreg |= DMA_InitStruct->DMA_Channel | DMA_InitStruct->DMA_DIR | - DMA_InitStruct->DMA_PeripheralInc | DMA_InitStruct->DMA_MemoryInc | - DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | - DMA_InitStruct->DMA_Mode | DMA_InitStruct->DMA_Priority | - DMA_InitStruct->DMA_MemoryBurst | DMA_InitStruct->DMA_PeripheralBurst; - 8011906: 4313 orrs r3, r2 - /* Set MSIZE bits according to DMA_MemoryDataSize value */ - /* Set CIRC bit according to DMA_Mode value */ - /* Set PL bits according to DMA_Priority value */ - /* Set MBURST bits according to DMA_MemoryBurst value */ - /* Set PBURST bits according to DMA_PeripheralBurst value */ - tmpreg |= DMA_InitStruct->DMA_Channel | DMA_InitStruct->DMA_DIR | - 8011908: ea43 030e orr.w r3, r3, lr - DMA_InitStruct->DMA_PeripheralDataSize | DMA_InitStruct->DMA_MemoryDataSize | - DMA_InitStruct->DMA_Mode | DMA_InitStruct->DMA_Priority | - DMA_InitStruct->DMA_MemoryBurst | DMA_InitStruct->DMA_PeripheralBurst; - - /* Write to DMAy Streamx CR register */ - DMAy_Streamx->CR = tmpreg; - 801190c: 6003 str r3, [r0, #0] - - /*------------------------- DMAy Streamx FCR Configuration -----------------*/ - /* Get the DMAy_Streamx FCR value */ - tmpreg = DMAy_Streamx->FCR; - 801190e: 6942 ldr r2, [r0, #20] - tmpreg &= (uint32_t)~(DMA_SxFCR_DMDIS | DMA_SxFCR_FTH); - - /* Configure DMAy Streamx FIFO: - Set DMDIS bits according to DMA_FIFOMode value - Set FTH bits according to DMA_FIFOThreshold value */ - tmpreg |= DMA_InitStruct->DMA_FIFOMode | DMA_InitStruct->DMA_FIFOThreshold; - 8011910: 6acb ldr r3, [r1, #44] ; 0x2c - /* Write to DMAy Streamx PAR */ - DMAy_Streamx->PAR = DMA_InitStruct->DMA_PeripheralBaseAddr; - - /*------------------------- DMAy Streamx M0AR Configuration ----------------*/ - /* Write to DMAy Streamx M0AR */ - DMAy_Streamx->M0AR = DMA_InitStruct->DMA_Memory0BaseAddr; - 8011912: 6889 ldr r1, [r1, #8] - /*------------------------- DMAy Streamx FCR Configuration -----------------*/ - /* Get the DMAy_Streamx FCR value */ - tmpreg = DMAy_Streamx->FCR; - - /* Clear DMDIS and FTH bits */ - tmpreg &= (uint32_t)~(DMA_SxFCR_DMDIS | DMA_SxFCR_FTH); - 8011914: f022 0207 bic.w r2, r2, #7 - - /* Configure DMAy Streamx FIFO: - Set DMDIS bits according to DMA_FIFOMode value - Set FTH bits according to DMA_FIFOThreshold value */ - tmpreg |= DMA_InitStruct->DMA_FIFOMode | DMA_InitStruct->DMA_FIFOThreshold; - 8011918: 4333 orrs r3, r6 - 801191a: 4313 orrs r3, r2 - - /* Write to DMAy Streamx CR */ - DMAy_Streamx->FCR = tmpreg; - 801191c: 6143 str r3, [r0, #20] - - /*------------------------- DMAy Streamx NDTR Configuration ----------------*/ - /* Write to DMAy Streamx NDTR register */ - DMAy_Streamx->NDTR = DMA_InitStruct->DMA_BufferSize; - 801191e: 6045 str r5, [r0, #4] - - /*------------------------- DMAy Streamx PAR Configuration -----------------*/ - /* Write to DMAy Streamx PAR */ - DMAy_Streamx->PAR = DMA_InitStruct->DMA_PeripheralBaseAddr; - 8011920: 6084 str r4, [r0, #8] - - /*------------------------- DMAy Streamx M0AR Configuration ----------------*/ - /* Write to DMAy Streamx M0AR */ - DMAy_Streamx->M0AR = DMA_InitStruct->DMA_Memory0BaseAddr; - 8011922: 60c1 str r1, [r0, #12] -} - 8011924: b002 add sp, #8 - 8011926: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - 801192a: bf00 nop - 801192c: f01c803f .word 0xf01c803f - -08011930 : - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - /* Enable the selected DMAy Streamx by setting EN bit */ - DMAy_Streamx->CR |= (uint32_t)DMA_SxCR_EN; - 8011930: 6803 ldr r3, [r0, #0] -{ - /* Check the parameters */ - assert_param(IS_DMA_ALL_PERIPH(DMAy_Streamx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - 8011932: b919 cbnz r1, 801193c - DMAy_Streamx->CR |= (uint32_t)DMA_SxCR_EN; - } - else - { - /* Disable the selected DMAy Streamx by clearing EN bit */ - DMAy_Streamx->CR &= ~(uint32_t)DMA_SxCR_EN; - 8011934: f023 0301 bic.w r3, r3, #1 - 8011938: 6003 str r3, [r0, #0] - 801193a: 4770 bx lr - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - /* Enable the selected DMAy Streamx by setting EN bit */ - DMAy_Streamx->CR |= (uint32_t)DMA_SxCR_EN; - 801193c: f043 0301 orr.w r3, r3, #1 - 8011940: 6003 str r3, [r0, #0] - 8011942: 4770 bx lr - 8011944: f3af 8000 nop.w - 8011948: f3af 8000 nop.w - 801194c: f3af 8000 nop.w - -08011950 : - assert_param(IS_DMA_ALL_PERIPH(DMAy_Streamx)); - assert_param(IS_DMA_CONFIG_IT(DMA_IT)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - /* Check if the DMA_IT parameter contains a FIFO interrupt */ - if ((DMA_IT & DMA_IT_FE) != 0) - 8011950: 060b lsls r3, r1, #24 - 8011952: d50c bpl.n 801196e - { - if (NewState != DISABLE) - { - /* Enable the selected DMA FIFO interrupts */ - DMAy_Streamx->FCR |= (uint32_t)DMA_IT_FE; - 8011954: 6943 ldr r3, [r0, #20] - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - /* Check if the DMA_IT parameter contains a FIFO interrupt */ - if ((DMA_IT & DMA_IT_FE) != 0) - { - if (NewState != DISABLE) - 8011956: b1aa cbz r2, 8011984 - { - /* Enable the selected DMA FIFO interrupts */ - DMAy_Streamx->FCR |= (uint32_t)DMA_IT_FE; - 8011958: f043 0380 orr.w r3, r3, #128 ; 0x80 - DMAy_Streamx->FCR &= ~(uint32_t)DMA_IT_FE; - } - } - - /* Check if the DMA_IT parameter contains a Transfer interrupt */ - if (DMA_IT != DMA_IT_FE) - 801195c: 2980 cmp r1, #128 ; 0x80 - if ((DMA_IT & DMA_IT_FE) != 0) - { - if (NewState != DISABLE) - { - /* Enable the selected DMA FIFO interrupts */ - DMAy_Streamx->FCR |= (uint32_t)DMA_IT_FE; - 801195e: 6143 str r3, [r0, #20] - DMAy_Streamx->FCR &= ~(uint32_t)DMA_IT_FE; - } - } - - /* Check if the DMA_IT parameter contains a Transfer interrupt */ - if (DMA_IT != DMA_IT_FE) - 8011960: d00f beq.n 8011982 - { - if (NewState != DISABLE) - { - /* Enable the selected DMA transfer interrupts */ - DMAy_Streamx->CR |= (uint32_t)(DMA_IT & TRANSFER_IT_ENABLE_MASK); - 8011962: 6803 ldr r3, [r0, #0] - 8011964: f001 011e and.w r1, r1, #30 - 8011968: 4319 orrs r1, r3 - 801196a: 6001 str r1, [r0, #0] - 801196c: 4770 bx lr - DMAy_Streamx->FCR &= ~(uint32_t)DMA_IT_FE; - } - } - - /* Check if the DMA_IT parameter contains a Transfer interrupt */ - if (DMA_IT != DMA_IT_FE) - 801196e: 2980 cmp r1, #128 ; 0x80 - 8011970: d007 beq.n 8011982 - { - if (NewState != DISABLE) - 8011972: 2a00 cmp r2, #0 - 8011974: d1f5 bne.n 8011962 - DMAy_Streamx->CR |= (uint32_t)(DMA_IT & TRANSFER_IT_ENABLE_MASK); - } - else - { - /* Disable the selected DMA transfer interrupts */ - DMAy_Streamx->CR &= ~(uint32_t)(DMA_IT & TRANSFER_IT_ENABLE_MASK); - 8011976: 6803 ldr r3, [r0, #0] - 8011978: f001 011e and.w r1, r1, #30 - 801197c: ea23 0101 bic.w r1, r3, r1 - 8011980: 6001 str r1, [r0, #0] - 8011982: 4770 bx lr - DMAy_Streamx->FCR |= (uint32_t)DMA_IT_FE; - } - else - { - /* Disable the selected DMA FIFO interrupts */ - DMAy_Streamx->FCR &= ~(uint32_t)DMA_IT_FE; - 8011984: f023 0380 bic.w r3, r3, #128 ; 0x80 - } - } - - /* Check if the DMA_IT parameter contains a Transfer interrupt */ - if (DMA_IT != DMA_IT_FE) - 8011988: 2980 cmp r1, #128 ; 0x80 - DMAy_Streamx->FCR |= (uint32_t)DMA_IT_FE; - } - else - { - /* Disable the selected DMA FIFO interrupts */ - DMAy_Streamx->FCR &= ~(uint32_t)DMA_IT_FE; - 801198a: 6143 str r3, [r0, #20] - } - } - - /* Check if the DMA_IT parameter contains a Transfer interrupt */ - if (DMA_IT != DMA_IT_FE) - 801198c: d1f3 bne.n 8011976 - 801198e: 4770 bx lr - -08011990 : -{ - FlagStatus bitstatus = RESET; - /* Check the parameters */ - assert_param(IS_GET_EXTI_LINE(EXTI_Line)); - - if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) - 8011990: 4b03 ldr r3, [pc, #12] ; (80119a0 ) - 8011992: 695b ldr r3, [r3, #20] - 8011994: 4218 tst r0, r3 - { - bitstatus = RESET; - } - return bitstatus; - -} - 8011996: bf14 ite ne - 8011998: 2001 movne r0, #1 - 801199a: 2000 moveq r0, #0 - 801199c: 4770 bx lr - 801199e: bf00 nop - 80119a0: 40013c00 .word 0x40013c00 - 80119a4: f3af 8000 nop.w - 80119a8: f3af 8000 nop.w - 80119ac: f3af 8000 nop.w - -080119b0 : -void EXTI_ClearITPendingBit(uint32_t EXTI_Line) -{ - /* Check the parameters */ - assert_param(IS_EXTI_LINE(EXTI_Line)); - - EXTI->PR = EXTI_Line; - 80119b0: 4b01 ldr r3, [pc, #4] ; (80119b8 ) - 80119b2: 6158 str r0, [r3, #20] - 80119b4: 4770 bx lr - 80119b6: bf00 nop - 80119b8: 40013c00 .word 0x40013c00 - 80119bc: f3af 8000 nop.w - -080119c0 : - * @param None - * @retval None - */ -void FLASH_Unlock(void) -{ - if((FLASH->CR & FLASH_CR_LOCK) != RESET) - 80119c0: 4b04 ldr r3, [pc, #16] ; (80119d4 ) - 80119c2: 691a ldr r2, [r3, #16] - 80119c4: 2a00 cmp r2, #0 - 80119c6: da03 bge.n 80119d0 - { - /* Authorize the FLASH Registers access */ - FLASH->KEYR = FLASH_KEY1; - 80119c8: 4903 ldr r1, [pc, #12] ; (80119d8 ) - FLASH->KEYR = FLASH_KEY2; - 80119ca: 4a04 ldr r2, [pc, #16] ; (80119dc ) -void FLASH_Unlock(void) -{ - if((FLASH->CR & FLASH_CR_LOCK) != RESET) - { - /* Authorize the FLASH Registers access */ - FLASH->KEYR = FLASH_KEY1; - 80119cc: 6059 str r1, [r3, #4] - FLASH->KEYR = FLASH_KEY2; - 80119ce: 605a str r2, [r3, #4] - 80119d0: 4770 bx lr - 80119d2: bf00 nop - 80119d4: 40023c00 .word 0x40023c00 - 80119d8: 45670123 .word 0x45670123 - 80119dc: cdef89ab .word 0xcdef89ab - -080119e0 : -{ - /* Check the parameters */ - assert_param(IS_FLASH_CLEAR_FLAG(FLASH_FLAG)); - - /* Clear the flags */ - FLASH->SR = FLASH_FLAG; - 80119e0: 4b01 ldr r3, [pc, #4] ; (80119e8 ) - 80119e2: 60d8 str r0, [r3, #12] - 80119e4: 4770 bx lr - 80119e6: bf00 nop - 80119e8: 40023c00 .word 0x40023c00 - 80119ec: f3af 8000 nop.w - -080119f0 : - */ -FLASH_Status FLASH_GetStatus(void) -{ - FLASH_Status flashstatus = FLASH_COMPLETE; - - if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY) - 80119f0: 4b0e ldr r3, [pc, #56] ; (8011a2c ) - 80119f2: 68da ldr r2, [r3, #12] - 80119f4: 03d2 lsls r2, r2, #15 - 80119f6: d409 bmi.n 8011a0c - { - flashstatus = FLASH_BUSY; - } - else - { - if((FLASH->SR & FLASH_FLAG_WRPERR) != (uint32_t)0x00) - 80119f8: 68da ldr r2, [r3, #12] - 80119fa: 06d1 lsls r1, r2, #27 - 80119fc: d501 bpl.n 8011a02 - { - flashstatus = FLASH_ERROR_WRP; - 80119fe: 2006 movs r0, #6 - 8011a00: 4770 bx lr - } - else - { - if((FLASH->SR & FLASH_FLAG_RDERR) != (uint32_t)0x00) - 8011a02: 68da ldr r2, [r3, #12] - 8011a04: 05d2 lsls r2, r2, #23 - 8011a06: d503 bpl.n 8011a10 - { - flashstatus = FLASH_ERROR_RD; - 8011a08: 2002 movs r0, #2 - 8011a0a: 4770 bx lr -{ - FLASH_Status flashstatus = FLASH_COMPLETE; - - if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY) - { - flashstatus = FLASH_BUSY; - 8011a0c: 2001 movs r0, #1 - 8011a0e: 4770 bx lr - { - flashstatus = FLASH_ERROR_RD; - } - else - { - if((FLASH->SR & (uint32_t)0xE0) != (uint32_t)0x00) - 8011a10: 68da ldr r2, [r3, #12] - 8011a12: f012 0fe0 tst.w r2, #224 ; 0xe0 - 8011a16: d001 beq.n 8011a1c - { - flashstatus = FLASH_ERROR_PROGRAM; - 8011a18: 2007 movs r0, #7 - } - } - } - /* Return the FLASH Status */ - return flashstatus; -} - 8011a1a: 4770 bx lr - { - flashstatus = FLASH_ERROR_PROGRAM; - } - else - { - if((FLASH->SR & FLASH_FLAG_OPERR) != (uint32_t)0x00) - 8011a1c: 68db ldr r3, [r3, #12] - 8011a1e: f013 0f02 tst.w r3, #2 - { - flashstatus = FLASH_ERROR_OPERATION; - } - else - { - flashstatus = FLASH_COMPLETE; - 8011a22: bf14 ite ne - 8011a24: 2008 movne r0, #8 - 8011a26: 2009 moveq r0, #9 - 8011a28: 4770 bx lr - 8011a2a: bf00 nop - 8011a2c: 40023c00 .word 0x40023c00 - -08011a30 : - * @param None - * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, - * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. - */ -FLASH_Status FLASH_WaitForLastOperation(void) -{ - 8011a30: b500 push {lr} - 8011a32: b083 sub sp, #12 - __IO FLASH_Status status = FLASH_COMPLETE; - 8011a34: 2309 movs r3, #9 - 8011a36: f88d 3007 strb.w r3, [sp, #7] - - /* Check for the FLASH Status */ - status = FLASH_GetStatus(); - 8011a3a: f7ff ffd9 bl 80119f0 - 8011a3e: f88d 0007 strb.w r0, [sp, #7] - - /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset. - Even if the FLASH operation fails, the BUSY flag will be reset and an error - flag will be set */ - while(status == FLASH_BUSY) - 8011a42: f89d 3007 ldrb.w r3, [sp, #7] - 8011a46: 2b01 cmp r3, #1 - 8011a48: d0f7 beq.n 8011a3a - { - status = FLASH_GetStatus(); - } - /* Return the operation status */ - return status; - 8011a4a: f89d 0007 ldrb.w r0, [sp, #7] - 8011a4e: b2c0 uxtb r0, r0 -} - 8011a50: b003 add sp, #12 - 8011a52: f85d fb04 ldr.w pc, [sp], #4 - 8011a56: bf00 nop - 8011a58: f3af 8000 nop.w - 8011a5c: f3af 8000 nop.w - -08011a60 : - * - * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, - * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. - */ -FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange) -{ - 8011a60: b570 push {r4, r5, r6, lr} - 8011a62: 4606 mov r6, r0 - - /* Check the parameters */ - assert_param(IS_FLASH_SECTOR(FLASH_Sector)); - assert_param(IS_VOLTAGERANGE(VoltageRange)); - - if(VoltageRange == VoltageRange_1) - 8011a64: b359 cbz r1, 8011abe - { - tmp_psize = FLASH_PSIZE_BYTE; - } - else if(VoltageRange == VoltageRange_2) - 8011a66: 2901 cmp r1, #1 - 8011a68: d02f beq.n 8011aca - { - tmp_psize = FLASH_PSIZE_HALF_WORD; - } - else if(VoltageRange == VoltageRange_3) - 8011a6a: 2902 cmp r1, #2 - { - tmp_psize = FLASH_PSIZE_WORD; - } - else - { - tmp_psize = FLASH_PSIZE_DOUBLE_WORD; - 8011a6c: bf0c ite eq - 8011a6e: f44f 7400 moveq.w r4, #512 ; 0x200 - 8011a72: f44f 7440 movne.w r4, #768 ; 0x300 - } - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(); - 8011a76: f7ff ffdb bl 8011a30 - - if(status == FLASH_COMPLETE) - 8011a7a: 2809 cmp r0, #9 - 8011a7c: d124 bne.n 8011ac8 - { - /* if the previous operation is completed, proceed to erase the sector */ - FLASH->CR &= CR_PSIZE_MASK; - 8011a7e: 4d14 ldr r5, [pc, #80] ; (8011ad0 ) - 8011a80: 692b ldr r3, [r5, #16] - 8011a82: f423 7340 bic.w r3, r3, #768 ; 0x300 - 8011a86: 612b str r3, [r5, #16] - FLASH->CR |= tmp_psize; - 8011a88: 6929 ldr r1, [r5, #16] - 8011a8a: 4321 orrs r1, r4 - 8011a8c: 6129 str r1, [r5, #16] - FLASH->CR &= SECTOR_MASK; - 8011a8e: 692b ldr r3, [r5, #16] - 8011a90: f023 03f8 bic.w r3, r3, #248 ; 0xf8 - 8011a94: 612b str r3, [r5, #16] - FLASH->CR |= FLASH_CR_SER | FLASH_Sector; - 8011a96: 692b ldr r3, [r5, #16] - 8011a98: f043 0302 orr.w r3, r3, #2 - 8011a9c: 431e orrs r6, r3 - 8011a9e: 612e str r6, [r5, #16] - FLASH->CR |= FLASH_CR_STRT; - 8011aa0: 692b ldr r3, [r5, #16] - 8011aa2: f443 3380 orr.w r3, r3, #65536 ; 0x10000 - 8011aa6: 612b str r3, [r5, #16] - - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(); - 8011aa8: f7ff ffc2 bl 8011a30 - - /* if the erase operation is completed, disable the SER Bit */ - FLASH->CR &= (~FLASH_CR_SER); - 8011aac: 692b ldr r3, [r5, #16] - 8011aae: f023 0302 bic.w r3, r3, #2 - 8011ab2: 612b str r3, [r5, #16] - FLASH->CR &= SECTOR_MASK; - 8011ab4: 692b ldr r3, [r5, #16] - 8011ab6: f023 03f8 bic.w r3, r3, #248 ; 0xf8 - 8011aba: 612b str r3, [r5, #16] - } - /* Return the Erase Status */ - return status; -} - 8011abc: bd70 pop {r4, r5, r6, pc} - assert_param(IS_FLASH_SECTOR(FLASH_Sector)); - assert_param(IS_VOLTAGERANGE(VoltageRange)); - - if(VoltageRange == VoltageRange_1) - { - tmp_psize = FLASH_PSIZE_BYTE; - 8011abe: 460c mov r4, r1 - else - { - tmp_psize = FLASH_PSIZE_DOUBLE_WORD; - } - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(); - 8011ac0: f7ff ffb6 bl 8011a30 - - if(status == FLASH_COMPLETE) - 8011ac4: 2809 cmp r0, #9 - 8011ac6: d0da beq.n 8011a7e - FLASH->CR &= (~FLASH_CR_SER); - FLASH->CR &= SECTOR_MASK; - } - /* Return the Erase Status */ - return status; -} - 8011ac8: bd70 pop {r4, r5, r6, pc} - { - tmp_psize = FLASH_PSIZE_BYTE; - } - else if(VoltageRange == VoltageRange_2) - { - tmp_psize = FLASH_PSIZE_HALF_WORD; - 8011aca: f44f 7480 mov.w r4, #256 ; 0x100 - 8011ace: e7f7 b.n 8011ac0 - 8011ad0: 40023c00 .word 0x40023c00 - 8011ad4: f3af 8000 nop.w - 8011ad8: f3af 8000 nop.w - 8011adc: f3af 8000 nop.w - -08011ae0 : - * @param Data: specifies the data to be programmed. - * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, - * FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. - */ -FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) -{ - 8011ae0: b570 push {r4, r5, r6, lr} - 8011ae2: 4605 mov r5, r0 - 8011ae4: 460e mov r6, r1 - - /* Check the parameters */ - assert_param(IS_FLASH_ADDRESS(Address)); - - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(); - 8011ae6: f7ff ffa3 bl 8011a30 - - if(status == FLASH_COMPLETE) - 8011aea: 2809 cmp r0, #9 - 8011aec: d000 beq.n 8011af0 - /* if the program operation is completed, disable the PG Bit */ - FLASH->CR &= (~FLASH_CR_PG); - } - /* Return the Program Status */ - return status; -} - 8011aee: bd70 pop {r4, r5, r6, pc} - status = FLASH_WaitForLastOperation(); - - if(status == FLASH_COMPLETE) - { - /* if the previous operation is completed, proceed to program the new data */ - FLASH->CR &= CR_PSIZE_MASK; - 8011af0: 4c0a ldr r4, [pc, #40] ; (8011b1c ) - 8011af2: 6923 ldr r3, [r4, #16] - 8011af4: f423 7340 bic.w r3, r3, #768 ; 0x300 - 8011af8: 6123 str r3, [r4, #16] - FLASH->CR |= FLASH_PSIZE_HALF_WORD; - 8011afa: 6923 ldr r3, [r4, #16] - 8011afc: f443 7380 orr.w r3, r3, #256 ; 0x100 - 8011b00: 6123 str r3, [r4, #16] - FLASH->CR |= FLASH_CR_PG; - 8011b02: 6923 ldr r3, [r4, #16] - 8011b04: f043 0301 orr.w r3, r3, #1 - 8011b08: 6123 str r3, [r4, #16] - - *(__IO uint16_t*)Address = Data; - 8011b0a: 802e strh r6, [r5, #0] - - /* Wait for last operation to be completed */ - status = FLASH_WaitForLastOperation(); - 8011b0c: f7ff ff90 bl 8011a30 - - /* if the program operation is completed, disable the PG Bit */ - FLASH->CR &= (~FLASH_CR_PG); - 8011b10: 6923 ldr r3, [r4, #16] - 8011b12: f023 0301 bic.w r3, r3, #1 - 8011b16: 6123 str r3, [r4, #16] - } - /* Return the Program Status */ - return status; -} - 8011b18: bd70 pop {r4, r5, r6, pc} - 8011b1a: bf00 nop - 8011b1c: 40023c00 .word 0x40023c00 - -08011b20 : - assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph)); - - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - RCC->AHB1ENR |= RCC_AHB1Periph; - 8011b20: 4a04 ldr r2, [pc, #16] ; (8011b34 ) - 8011b22: 6b13 ldr r3, [r2, #48] ; 0x30 -{ - /* Check the parameters */ - assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph)); - - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - 8011b24: b919 cbnz r1, 8011b2e - { - RCC->AHB1ENR |= RCC_AHB1Periph; - } - else - { - RCC->AHB1ENR &= ~RCC_AHB1Periph; - 8011b26: ea23 0000 bic.w r0, r3, r0 - 8011b2a: 6310 str r0, [r2, #48] ; 0x30 - 8011b2c: 4770 bx lr - assert_param(IS_RCC_AHB1_CLOCK_PERIPH(RCC_AHB1Periph)); - - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - RCC->AHB1ENR |= RCC_AHB1Periph; - 8011b2e: 4318 orrs r0, r3 - 8011b30: 6310 str r0, [r2, #48] ; 0x30 - 8011b32: 4770 bx lr - 8011b34: 40023800 .word 0x40023800 - 8011b38: f3af 8000 nop.w - 8011b3c: f3af 8000 nop.w - -08011b40 : - assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - RCC->APB1ENR |= RCC_APB1Periph; - 8011b40: 4a04 ldr r2, [pc, #16] ; (8011b54 ) - 8011b42: 6c13 ldr r3, [r2, #64] ; 0x40 -{ - /* Check the parameters */ - assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - 8011b44: b919 cbnz r1, 8011b4e - { - RCC->APB1ENR |= RCC_APB1Periph; - } - else - { - RCC->APB1ENR &= ~RCC_APB1Periph; - 8011b46: ea23 0000 bic.w r0, r3, r0 - 8011b4a: 6410 str r0, [r2, #64] ; 0x40 - 8011b4c: 4770 bx lr - assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - RCC->APB1ENR |= RCC_APB1Periph; - 8011b4e: 4318 orrs r0, r3 - 8011b50: 6410 str r0, [r2, #64] ; 0x40 - 8011b52: 4770 bx lr - 8011b54: 40023800 .word 0x40023800 - 8011b58: f3af 8000 nop.w - 8011b5c: f3af 8000 nop.w - -08011b60 : - assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - RCC->APB2ENR |= RCC_APB2Periph; - 8011b60: 4a04 ldr r2, [pc, #16] ; (8011b74 ) - 8011b62: 6c53 ldr r3, [r2, #68] ; 0x44 -{ - /* Check the parameters */ - assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - 8011b64: b919 cbnz r1, 8011b6e - { - RCC->APB2ENR |= RCC_APB2Periph; - } - else - { - RCC->APB2ENR &= ~RCC_APB2Periph; - 8011b66: ea23 0000 bic.w r0, r3, r0 - 8011b6a: 6450 str r0, [r2, #68] ; 0x44 - 8011b6c: 4770 bx lr - assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - RCC->APB2ENR |= RCC_APB2Periph; - 8011b6e: 4318 orrs r0, r3 - 8011b70: 6450 str r0, [r2, #68] ; 0x44 - 8011b72: 4770 bx lr - 8011b74: 40023800 .word 0x40023800 - 8011b78: f3af 8000 nop.w - 8011b7c: f3af 8000 nop.w - -08011b80 : - /* Check the parameters */ - assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - RCC->APB1RSTR |= RCC_APB1Periph; - 8011b80: 4a04 ldr r2, [pc, #16] ; (8011b94 ) - 8011b82: 6a13 ldr r3, [r2, #32] -void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState) -{ - /* Check the parameters */ - assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - 8011b84: b919 cbnz r1, 8011b8e - { - RCC->APB1RSTR |= RCC_APB1Periph; - } - else - { - RCC->APB1RSTR &= ~RCC_APB1Periph; - 8011b86: ea23 0000 bic.w r0, r3, r0 - 8011b8a: 6210 str r0, [r2, #32] - 8011b8c: 4770 bx lr - /* Check the parameters */ - assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - RCC->APB1RSTR |= RCC_APB1Periph; - 8011b8e: 4318 orrs r0, r3 - 8011b90: 6210 str r0, [r2, #32] - 8011b92: 4770 bx lr - 8011b94: 40023800 .word 0x40023800 - 8011b98: f3af 8000 nop.w - 8011b9c: f3af 8000 nop.w - -08011ba0 : - /* Check the parameters */ - assert_param(IS_RCC_APB2_RESET_PERIPH(RCC_APB2Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - RCC->APB2RSTR |= RCC_APB2Periph; - 8011ba0: 4a04 ldr r2, [pc, #16] ; (8011bb4 ) - 8011ba2: 6a53 ldr r3, [r2, #36] ; 0x24 -void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState) -{ - /* Check the parameters */ - assert_param(IS_RCC_APB2_RESET_PERIPH(RCC_APB2Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - 8011ba4: b919 cbnz r1, 8011bae - { - RCC->APB2RSTR |= RCC_APB2Periph; - } - else - { - RCC->APB2RSTR &= ~RCC_APB2Periph; - 8011ba6: ea23 0000 bic.w r0, r3, r0 - 8011baa: 6250 str r0, [r2, #36] ; 0x24 - 8011bac: 4770 bx lr - /* Check the parameters */ - assert_param(IS_RCC_APB2_RESET_PERIPH(RCC_APB2Periph)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - RCC->APB2RSTR |= RCC_APB2Periph; - 8011bae: 4318 orrs r0, r3 - 8011bb0: 6250 str r0, [r2, #36] ; 0x24 - 8011bb2: 4770 bx lr - 8011bb4: 40023800 .word 0x40023800 - 8011bb8: f3af 8000 nop.w - 8011bbc: f3af 8000 nop.w - -08011bc0 : - * @param TIMx: where x can be 1 to 14 to select the TIM peripheral. - * @retval None - - */ -void TIM_DeInit(TIM_TypeDef* TIMx) -{ - 8011bc0: b508 push {r3, lr} - /* Check the parameters */ - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - - if (TIMx == TIM1) - 8011bc2: 4b60 ldr r3, [pc, #384] ; (8011d44 ) - 8011bc4: 4298 cmp r0, r3 - 8011bc6: d035 beq.n 8011c34 - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, DISABLE); - } - else if (TIMx == TIM2) - 8011bc8: f1b0 4f80 cmp.w r0, #1073741824 ; 0x40000000 - 8011bcc: d03c beq.n 8011c48 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, DISABLE); - } - else if (TIMx == TIM3) - 8011bce: 4b5e ldr r3, [pc, #376] ; (8011d48 ) - 8011bd0: 4298 cmp r0, r3 - 8011bd2: d043 beq.n 8011c5c - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, DISABLE); - } - else if (TIMx == TIM4) - 8011bd4: 4b5d ldr r3, [pc, #372] ; (8011d4c ) - 8011bd6: 4298 cmp r0, r3 - 8011bd8: d04a beq.n 8011c70 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE); - } - else if (TIMx == TIM5) - 8011bda: 4b5d ldr r3, [pc, #372] ; (8011d50 ) - 8011bdc: 4298 cmp r0, r3 - 8011bde: d051 beq.n 8011c84 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, DISABLE); - } - else if (TIMx == TIM6) - 8011be0: 4b5c ldr r3, [pc, #368] ; (8011d54 ) - 8011be2: 4298 cmp r0, r3 - 8011be4: d058 beq.n 8011c98 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, DISABLE); - } - else if (TIMx == TIM7) - 8011be6: 4b5c ldr r3, [pc, #368] ; (8011d58 ) - 8011be8: 4298 cmp r0, r3 - 8011bea: d05f beq.n 8011cac - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, DISABLE); - } - else if (TIMx == TIM8) - 8011bec: 4b5b ldr r3, [pc, #364] ; (8011d5c ) - 8011bee: 4298 cmp r0, r3 - 8011bf0: d066 beq.n 8011cc0 - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, DISABLE); - } - else if (TIMx == TIM9) - 8011bf2: 4b5b ldr r3, [pc, #364] ; (8011d60 ) - 8011bf4: 4298 cmp r0, r3 - 8011bf6: d06d beq.n 8011cd4 - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, DISABLE); - } - else if (TIMx == TIM10) - 8011bf8: 4b5a ldr r3, [pc, #360] ; (8011d64 ) - 8011bfa: 4298 cmp r0, r3 - 8011bfc: d076 beq.n 8011cec - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, DISABLE); - } - else if (TIMx == TIM11) - 8011bfe: 4b5a ldr r3, [pc, #360] ; (8011d68 ) - 8011c00: 4298 cmp r0, r3 - 8011c02: d07f beq.n 8011d04 - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, DISABLE); - } - else if (TIMx == TIM12) - 8011c04: 4b59 ldr r3, [pc, #356] ; (8011d6c ) - 8011c06: 4298 cmp r0, r3 - 8011c08: f000 8088 beq.w 8011d1c - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, DISABLE); - } - else if (TIMx == TIM13) - 8011c0c: 4b58 ldr r3, [pc, #352] ; (8011d70 ) - 8011c0e: 4298 cmp r0, r3 - 8011c10: f000 808e beq.w 8011d30 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, DISABLE); - } - else - { - if (TIMx == TIM14) - 8011c14: 4b57 ldr r3, [pc, #348] ; (8011d74 ) - 8011c16: 4298 cmp r0, r3 - 8011c18: d000 beq.n 8011c1c - 8011c1a: bd08 pop {r3, pc} - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - 8011c1c: f44f 7080 mov.w r0, #256 ; 0x100 - 8011c20: 2101 movs r1, #1 - 8011c22: f7ff ffad bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - 8011c26: f44f 7080 mov.w r0, #256 ; 0x100 - 8011c2a: 2100 movs r1, #0 - } - } -} - 8011c2c: e8bd 4008 ldmia.w sp!, {r3, lr} - else - { - if (TIMx == TIM14) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - 8011c30: f7ff bfa6 b.w 8011b80 - /* Check the parameters */ - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - - if (TIMx == TIM1) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, ENABLE); - 8011c34: 2001 movs r0, #1 - 8011c36: 4601 mov r1, r0 - 8011c38: f7ff ffb2 bl 8011ba0 - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, DISABLE); - 8011c3c: 2001 movs r0, #1 - 8011c3e: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011c40: e8bd 4008 ldmia.w sp!, {r3, lr} - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - - if (TIMx == TIM1) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, DISABLE); - 8011c44: f7ff bfac b.w 8011ba0 - } - else if (TIMx == TIM2) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, ENABLE); - 8011c48: 2001 movs r0, #1 - 8011c4a: 4601 mov r1, r0 - 8011c4c: f7ff ff98 bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, DISABLE); - 8011c50: 2001 movs r0, #1 - 8011c52: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011c54: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, DISABLE); - } - else if (TIMx == TIM2) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, DISABLE); - 8011c58: f7ff bf92 b.w 8011b80 - } - else if (TIMx == TIM3) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, ENABLE); - 8011c5c: 2002 movs r0, #2 - 8011c5e: 2101 movs r1, #1 - 8011c60: f7ff ff8e bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, DISABLE); - 8011c64: 2002 movs r0, #2 - 8011c66: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011c68: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, DISABLE); - } - else if (TIMx == TIM3) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, DISABLE); - 8011c6c: f7ff bf88 b.w 8011b80 - } - else if (TIMx == TIM4) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, ENABLE); - 8011c70: 2004 movs r0, #4 - 8011c72: 2101 movs r1, #1 - 8011c74: f7ff ff84 bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE); - 8011c78: 2004 movs r0, #4 - 8011c7a: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011c7c: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, DISABLE); - } - else if (TIMx == TIM4) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE); - 8011c80: f7ff bf7e b.w 8011b80 - } - else if (TIMx == TIM5) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, ENABLE); - 8011c84: 2008 movs r0, #8 - 8011c86: 2101 movs r1, #1 - 8011c88: f7ff ff7a bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, DISABLE); - 8011c8c: 2008 movs r0, #8 - 8011c8e: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011c90: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE); - } - else if (TIMx == TIM5) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, DISABLE); - 8011c94: f7ff bf74 b.w 8011b80 - } - else if (TIMx == TIM6) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, ENABLE); - 8011c98: 2010 movs r0, #16 - 8011c9a: 2101 movs r1, #1 - 8011c9c: f7ff ff70 bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, DISABLE); - 8011ca0: 2010 movs r0, #16 - 8011ca2: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011ca4: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, DISABLE); - } - else if (TIMx == TIM6) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, DISABLE); - 8011ca8: f7ff bf6a b.w 8011b80 - } - else if (TIMx == TIM7) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, ENABLE); - 8011cac: 2020 movs r0, #32 - 8011cae: 2101 movs r1, #1 - 8011cb0: f7ff ff66 bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, DISABLE); - 8011cb4: 2020 movs r0, #32 - 8011cb6: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011cb8: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, DISABLE); - } - else if (TIMx == TIM7) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, DISABLE); - 8011cbc: f7ff bf60 b.w 8011b80 - } - else if (TIMx == TIM8) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, ENABLE); - 8011cc0: 2002 movs r0, #2 - 8011cc2: 2101 movs r1, #1 - 8011cc4: f7ff ff6c bl 8011ba0 - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, DISABLE); - 8011cc8: 2002 movs r0, #2 - 8011cca: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011ccc: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, DISABLE); - } - else if (TIMx == TIM8) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, DISABLE); - 8011cd0: f7ff bf66 b.w 8011ba0 - } - else if (TIMx == TIM9) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, ENABLE); - 8011cd4: f44f 3080 mov.w r0, #65536 ; 0x10000 - 8011cd8: 2101 movs r1, #1 - 8011cda: f7ff ff61 bl 8011ba0 - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, DISABLE); - 8011cde: f44f 3080 mov.w r0, #65536 ; 0x10000 - 8011ce2: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011ce4: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, DISABLE); - } - else if (TIMx == TIM9) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, DISABLE); - 8011ce8: f7ff bf5a b.w 8011ba0 - } - else if (TIMx == TIM10) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, ENABLE); - 8011cec: f44f 3000 mov.w r0, #131072 ; 0x20000 - 8011cf0: 2101 movs r1, #1 - 8011cf2: f7ff ff55 bl 8011ba0 - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, DISABLE); - 8011cf6: f44f 3000 mov.w r0, #131072 ; 0x20000 - 8011cfa: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011cfc: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, DISABLE); - } - else if (TIMx == TIM10) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, DISABLE); - 8011d00: f7ff bf4e b.w 8011ba0 - } - else if (TIMx == TIM11) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, ENABLE); - 8011d04: f44f 2080 mov.w r0, #262144 ; 0x40000 - 8011d08: 2101 movs r1, #1 - 8011d0a: f7ff ff49 bl 8011ba0 - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, DISABLE); - 8011d0e: f44f 2080 mov.w r0, #262144 ; 0x40000 - 8011d12: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011d14: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, DISABLE); - } - else if (TIMx == TIM11) - { - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, ENABLE); - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, DISABLE); - 8011d18: f7ff bf42 b.w 8011ba0 - } - else if (TIMx == TIM12) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, ENABLE); - 8011d1c: 2040 movs r0, #64 ; 0x40 - 8011d1e: 2101 movs r1, #1 - 8011d20: f7ff ff2e bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, DISABLE); - 8011d24: 2040 movs r0, #64 ; 0x40 - 8011d26: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011d28: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, DISABLE); - } - else if (TIMx == TIM12) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, DISABLE); - 8011d2c: f7ff bf28 b.w 8011b80 - } - else if (TIMx == TIM13) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, ENABLE); - 8011d30: 2080 movs r0, #128 ; 0x80 - 8011d32: 2101 movs r1, #1 - 8011d34: f7ff ff24 bl 8011b80 - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, DISABLE); - 8011d38: 2080 movs r0, #128 ; 0x80 - 8011d3a: 2100 movs r1, #0 - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); - } - } -} - 8011d3c: e8bd 4008 ldmia.w sp!, {r3, lr} - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, DISABLE); - } - else if (TIMx == TIM13) - { - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, ENABLE); - RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, DISABLE); - 8011d40: f7ff bf1e b.w 8011b80 - 8011d44: 40010000 .word 0x40010000 - 8011d48: 40000400 .word 0x40000400 - 8011d4c: 40000800 .word 0x40000800 - 8011d50: 40000c00 .word 0x40000c00 - 8011d54: 40001000 .word 0x40001000 - 8011d58: 40001400 .word 0x40001400 - 8011d5c: 40010400 .word 0x40010400 - 8011d60: 40014000 .word 0x40014000 - 8011d64: 40014400 .word 0x40014400 - 8011d68: 40014800 .word 0x40014800 - 8011d6c: 40001800 .word 0x40001800 - 8011d70: 40001c00 .word 0x40001c00 - 8011d74: 40002000 .word 0x40002000 - 8011d78: f3af 8000 nop.w - 8011d7c: f3af 8000 nop.w - -08011d80 : - assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode)); - assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision)); - - tmpcr1 = TIMx->CR1; - - if((TIMx == TIM1) || (TIMx == TIM8)|| - 8011d80: 4a22 ldr r2, [pc, #136] ; (8011e0c ) - /* Check the parameters */ - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode)); - assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision)); - - tmpcr1 = TIMx->CR1; - 8011d82: 6803 ldr r3, [r0, #0] - - if((TIMx == TIM1) || (TIMx == TIM8)|| - 8011d84: 4290 cmp r0, r2 - /* Check the parameters */ - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode)); - assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision)); - - tmpcr1 = TIMx->CR1; - 8011d86: b29b uxth r3, r3 - - if((TIMx == TIM1) || (TIMx == TIM8)|| - 8011d88: d012 beq.n 8011db0 - 8011d8a: f502 6280 add.w r2, r2, #1024 ; 0x400 - 8011d8e: 4290 cmp r0, r2 - 8011d90: d00e beq.n 8011db0 - 8011d92: f1b0 4f80 cmp.w r0, #1073741824 ; 0x40000000 - 8011d96: d00b beq.n 8011db0 - (TIMx == TIM2) || (TIMx == TIM3)|| - 8011d98: f5a2 3280 sub.w r2, r2, #65536 ; 0x10000 - 8011d9c: 4290 cmp r0, r2 - 8011d9e: d007 beq.n 8011db0 - 8011da0: f502 6280 add.w r2, r2, #1024 ; 0x400 - 8011da4: 4290 cmp r0, r2 - 8011da6: d003 beq.n 8011db0 - (TIMx == TIM4) || (TIMx == TIM5)) - 8011da8: f502 6280 add.w r2, r2, #1024 ; 0x400 - 8011dac: 4290 cmp r0, r2 - 8011dae: d103 bne.n 8011db8 - { - /* Select the Counter Mode */ - tmpcr1 &= (uint16_t)(~(TIM_CR1_DIR | TIM_CR1_CMS)); - tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode; - 8011db0: 884a ldrh r2, [r1, #2] - if((TIMx == TIM1) || (TIMx == TIM8)|| - (TIMx == TIM2) || (TIMx == TIM3)|| - (TIMx == TIM4) || (TIMx == TIM5)) - { - /* Select the Counter Mode */ - tmpcr1 &= (uint16_t)(~(TIM_CR1_DIR | TIM_CR1_CMS)); - 8011db2: f023 0370 bic.w r3, r3, #112 ; 0x70 - tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode; - 8011db6: 4313 orrs r3, r2 - } - - if((TIMx != TIM6) && (TIMx != TIM7)) - 8011db8: 4a15 ldr r2, [pc, #84] ; (8011e10 ) - 8011dba: 4290 cmp r0, r2 - 8011dbc: d01e beq.n 8011dfc - 8011dbe: f502 6280 add.w r2, r2, #1024 ; 0x400 - 8011dc2: 4290 cmp r0, r2 - 8011dc4: d01a beq.n 8011dfc - { - /* Set the clock division */ - tmpcr1 &= (uint16_t)(~TIM_CR1_CKD); - tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; - 8011dc6: 890a ldrh r2, [r1, #8] - * @param TIM_TimeBaseInitStruct: pointer to a TIM_TimeBaseInitTypeDef structure - * that contains the configuration information for the specified TIM peripheral. - * @retval None - */ -void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) -{ - 8011dc8: b470 push {r4, r5, r6} - } - - if((TIMx != TIM6) && (TIMx != TIM7)) - { - /* Set the clock division */ - tmpcr1 &= (uint16_t)(~TIM_CR1_CKD); - 8011dca: f423 7340 bic.w r3, r3, #768 ; 0x300 - TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; - - /* Set the Prescaler value */ - TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; - - if ((TIMx == TIM1) || (TIMx == TIM8)) - 8011dce: 4c0f ldr r4, [pc, #60] ; (8011e0c ) - } - - TIMx->CR1 = tmpcr1; - - /* Set the Autoreload value */ - TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; - 8011dd0: 684e ldr r6, [r1, #4] - - /* Set the Prescaler value */ - TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; - 8011dd2: 880d ldrh r5, [r1, #0] - } - - if((TIMx != TIM6) && (TIMx != TIM7)) - { - /* Set the clock division */ - tmpcr1 &= (uint16_t)(~TIM_CR1_CKD); - 8011dd4: b29b uxth r3, r3 - tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; - } - - TIMx->CR1 = tmpcr1; - 8011dd6: 4313 orrs r3, r2 - TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; - - /* Set the Prescaler value */ - TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; - - if ((TIMx == TIM1) || (TIMx == TIM8)) - 8011dd8: 42a0 cmp r0, r4 - /* Set the clock division */ - tmpcr1 &= (uint16_t)(~TIM_CR1_CKD); - tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; - } - - TIMx->CR1 = tmpcr1; - 8011dda: 6003 str r3, [r0, #0] - - /* Set the Autoreload value */ - TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; - 8011ddc: 62c6 str r6, [r0, #44] ; 0x2c - - /* Set the Prescaler value */ - TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; - 8011dde: 6285 str r5, [r0, #40] ; 0x28 - - if ((TIMx == TIM1) || (TIMx == TIM8)) - 8011de0: d006 beq.n 8011df0 - 8011de2: 4b0c ldr r3, [pc, #48] ; (8011e14 ) - 8011de4: 4298 cmp r0, r3 - 8011de6: d003 beq.n 8011df0 - TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter; - } - - /* Generate an update event to reload the Prescaler - and the repetition counter(only for TIM1 and TIM8) value immediately */ - TIMx->EGR = TIM_PSCReloadMode_Immediate; - 8011de8: 2301 movs r3, #1 - 8011dea: 6143 str r3, [r0, #20] -} - 8011dec: bc70 pop {r4, r5, r6} - 8011dee: 4770 bx lr - TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; - - if ((TIMx == TIM1) || (TIMx == TIM8)) - { - /* Set the Repetition Counter value */ - TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter; - 8011df0: 7a8b ldrb r3, [r1, #10] - 8011df2: 6303 str r3, [r0, #48] ; 0x30 - } - - /* Generate an update event to reload the Prescaler - and the repetition counter(only for TIM1 and TIM8) value immediately */ - TIMx->EGR = TIM_PSCReloadMode_Immediate; - 8011df4: 2301 movs r3, #1 - 8011df6: 6143 str r3, [r0, #20] -} - 8011df8: bc70 pop {r4, r5, r6} - 8011dfa: 4770 bx lr - /* Set the clock division */ - tmpcr1 &= (uint16_t)(~TIM_CR1_CKD); - tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; - } - - TIMx->CR1 = tmpcr1; - 8011dfc: 6003 str r3, [r0, #0] - - /* Set the Autoreload value */ - TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; - 8011dfe: 684a ldr r2, [r1, #4] - - /* Set the Prescaler value */ - TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; - 8011e00: 880b ldrh r3, [r1, #0] - } - - TIMx->CR1 = tmpcr1; - - /* Set the Autoreload value */ - TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; - 8011e02: 62c2 str r2, [r0, #44] ; 0x2c - - /* Set the Prescaler value */ - TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; - 8011e04: 6283 str r3, [r0, #40] ; 0x28 - TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter; - } - - /* Generate an update event to reload the Prescaler - and the repetition counter(only for TIM1 and TIM8) value immediately */ - TIMx->EGR = TIM_PSCReloadMode_Immediate; - 8011e06: 2301 movs r3, #1 - 8011e08: 6143 str r3, [r0, #20] - 8011e0a: 4770 bx lr - 8011e0c: 40010000 .word 0x40010000 - 8011e10: 40001000 .word 0x40001000 - 8011e14: 40010400 .word 0x40010400 - 8011e18: f3af 8000 nop.w - 8011e1c: f3af 8000 nop.w - -08011e20 : -{ - /* Check the parameters */ - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - 8011e20: b929 cbnz r1, 8011e2e - TIMx->CR1 |= TIM_CR1_ARPE; - } - else - { - /* Reset the ARR Preload Bit */ - TIMx->CR1 &= (uint16_t)~TIM_CR1_ARPE; - 8011e22: 6802 ldr r2, [r0, #0] - 8011e24: f64f 737f movw r3, #65407 ; 0xff7f - 8011e28: 4013 ands r3, r2 - 8011e2a: 6003 str r3, [r0, #0] - 8011e2c: 4770 bx lr - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - /* Set the ARR Preload Bit */ - TIMx->CR1 |= TIM_CR1_ARPE; - 8011e2e: 6803 ldr r3, [r0, #0] - 8011e30: f043 0380 orr.w r3, r3, #128 ; 0x80 - 8011e34: 6003 str r3, [r0, #0] - 8011e36: 4770 bx lr - 8011e38: f3af 8000 nop.w - 8011e3c: f3af 8000 nop.w - -08011e40 : -{ - /* Check the parameters */ - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - 8011e40: b929 cbnz r1, 8011e4e - TIMx->CR1 |= TIM_CR1_CEN; - } - else - { - /* Disable the TIM Counter */ - TIMx->CR1 &= (uint16_t)~TIM_CR1_CEN; - 8011e42: 6802 ldr r2, [r0, #0] - 8011e44: f64f 73fe movw r3, #65534 ; 0xfffe - 8011e48: 4013 ands r3, r2 - 8011e4a: 6003 str r3, [r0, #0] - 8011e4c: 4770 bx lr - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - /* Enable the TIM Counter */ - TIMx->CR1 |= TIM_CR1_CEN; - 8011e4e: 6803 ldr r3, [r0, #0] - 8011e50: f043 0301 orr.w r3, r3, #1 - 8011e54: 6003 str r3, [r0, #0] - 8011e56: 4770 bx lr - 8011e58: f3af 8000 nop.w - 8011e5c: f3af 8000 nop.w - -08011e60 : - assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); - assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); - assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); - - /* Disable the Channel 1: Reset the CC1E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC1E; - 8011e60: 6a02 ldr r2, [r0, #32] - 8011e62: f64f 73fe movw r3, #65534 ; 0xfffe - 8011e66: 4013 ands r3, r2 - 8011e68: 6203 str r3, [r0, #32] - * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure that contains - * the configuration information for the specified TIM peripheral. - * @retval None - */ -void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) -{ - 8011e6a: b5f0 push {r4, r5, r6, r7, lr} - 8011e6c: 898a ldrh r2, [r1, #12] - - /* Disable the Channel 1: Reset the CC1E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC1E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - 8011e6e: 6a04 ldr r4, [r0, #32] - 8011e70: 884b ldrh r3, [r1, #2] - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8011e72: 6846 ldr r6, [r0, #4] - tmpccer |= TIM_OCInitStruct->TIM_OCPolarity; - - /* Set the Output State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputState; - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011e74: 4f17 ldr r7, [pc, #92] ; (8011ed4 ) - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - - /* Get the TIMx CCMR1 register value */ - tmpccmrx = TIMx->CCMR1; - 8011e76: f8d0 c018 ldr.w ip, [r0, #24] - - /* Reset the Output Compare Mode Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC1M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC1S; - /* Select the Output Compare Mode */ - tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; - 8011e7a: f8b1 e000 ldrh.w lr, [r1] - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC1P; - 8011e7e: f64f 75fd movw r5, #65533 ; 0xfffd - 8011e82: 4025 ands r5, r4 - 8011e84: 4313 orrs r3, r2 - /* Get the TIMx CCMR1 register value */ - tmpccmrx = TIMx->CCMR1; - - /* Reset the Output Compare Mode Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC1M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC1S; - 8011e86: f64f 748c movw r4, #65420 ; 0xff8c - tmpccer &= (uint16_t)~TIM_CCER_CC1P; - /* Set the Output Compare Polarity */ - tmpccer |= TIM_OCInitStruct->TIM_OCPolarity; - - /* Set the Output State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputState; - 8011e8a: 432b orrs r3, r5 - /* Get the TIMx CCMR1 register value */ - tmpccmrx = TIMx->CCMR1; - - /* Reset the Output Compare Mode Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC1M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC1S; - 8011e8c: ea0c 0404 and.w r4, ip, r4 - tmpccer |= TIM_OCInitStruct->TIM_OCPolarity; - - /* Set the Output State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputState; - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011e90: 42b8 cmp r0, r7 - tmpccer &= (uint16_t)~TIM_CCER_CC1P; - /* Set the Output Compare Polarity */ - tmpccer |= TIM_OCInitStruct->TIM_OCPolarity; - - /* Set the Output State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputState; - 8011e92: b29b uxth r3, r3 - TIMx->CCER &= (uint16_t)~TIM_CCER_CC1E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8011e94: b2b2 uxth r2, r6 - - /* Reset the Output Compare Mode Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC1M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC1S; - /* Select the Output Compare Mode */ - tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; - 8011e96: ea44 040e orr.w r4, r4, lr - tmpccer |= TIM_OCInitStruct->TIM_OCPolarity; - - /* Set the Output State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputState; - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011e9a: d008 beq.n 8011eae - 8011e9c: 4d0e ldr r5, [pc, #56] ; (8011ed8 ) - 8011e9e: 42a8 cmp r0, r5 - 8011ea0: d005 beq.n 8011eae - - /* Write to TIMx CCMR1 */ - TIMx->CCMR1 = tmpccmrx; - - /* Set the Capture Compare Register value */ - TIMx->CCR1 = TIM_OCInitStruct->TIM_Pulse; - 8011ea2: 6889 ldr r1, [r1, #8] - tmpcr2 |= TIM_OCInitStruct->TIM_OCIdleState; - /* Set the Output N Idle state */ - tmpcr2 |= TIM_OCInitStruct->TIM_OCNIdleState; - } - /* Write to TIMx CR2 */ - TIMx->CR2 = tmpcr2; - 8011ea4: 6042 str r2, [r0, #4] - - /* Write to TIMx CCMR1 */ - TIMx->CCMR1 = tmpccmrx; - 8011ea6: 6184 str r4, [r0, #24] - - /* Set the Capture Compare Register value */ - TIMx->CCR1 = TIM_OCInitStruct->TIM_Pulse; - 8011ea8: 6341 str r1, [r0, #52] ; 0x34 - - /* Write to TIMx CCER */ - TIMx->CCER = tmpccer; - 8011eaa: 6203 str r3, [r0, #32] - 8011eac: bdf0 pop {r4, r5, r6, r7, pc} - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC1NP; - /* Set the Output N Polarity */ - tmpccer |= TIM_OCInitStruct->TIM_OCNPolarity; - 8011eae: 89ce ldrh r6, [r1, #14] - 8011eb0: f8b1 e012 ldrh.w lr, [r1, #18] - 8011eb4: 8a0d ldrh r5, [r1, #16] - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC1NE; - - /* Set the Output N State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputNState; - 8011eb6: 888f ldrh r7, [r1, #4] - assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity)); - assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState)); - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC1NP; - 8011eb8: f023 0308 bic.w r3, r3, #8 - - /* Set the Output N State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputNState; - /* Reset the Output Compare and Output Compare N IDLE State */ - tmpcr2 &= (uint16_t)~TIM_CR2_OIS1; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS1N; - 8011ebc: f422 7240 bic.w r2, r2, #768 ; 0x300 - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC1NP; - /* Set the Output N Polarity */ - tmpccer |= TIM_OCInitStruct->TIM_OCNPolarity; - 8011ec0: 4333 orrs r3, r6 - 8011ec2: ea4e 0505 orr.w r5, lr, r5 - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC1NE; - 8011ec6: f023 0304 bic.w r3, r3, #4 - tmpcr2 &= (uint16_t)~TIM_CR2_OIS1; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS1N; - /* Set the Output Idle state */ - tmpcr2 |= TIM_OCInitStruct->TIM_OCIdleState; - /* Set the Output N Idle state */ - tmpcr2 |= TIM_OCInitStruct->TIM_OCNIdleState; - 8011eca: 432a orrs r2, r5 - tmpccer |= TIM_OCInitStruct->TIM_OCNPolarity; - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC1NE; - - /* Set the Output N State */ - tmpccer |= TIM_OCInitStruct->TIM_OutputNState; - 8011ecc: 433b orrs r3, r7 - tmpcr2 &= (uint16_t)~TIM_CR2_OIS1; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS1N; - /* Set the Output Idle state */ - tmpcr2 |= TIM_OCInitStruct->TIM_OCIdleState; - /* Set the Output N Idle state */ - tmpcr2 |= TIM_OCInitStruct->TIM_OCNIdleState; - 8011ece: b292 uxth r2, r2 - 8011ed0: e7e7 b.n 8011ea2 - 8011ed2: bf00 nop - 8011ed4: 40010000 .word 0x40010000 - 8011ed8: 40010400 .word 0x40010400 - 8011edc: f3af 8000 nop.w - -08011ee0 : - assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); - assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); - assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); - - /* Disable the Channel 2: Reset the CC2E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC2E; - 8011ee0: 6a02 ldr r2, [r0, #32] - tmpccer &= (uint16_t)~TIM_CCER_CC2P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4); - 8011ee2: f8b1 c002 ldrh.w ip, [r1, #2] - assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); - assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); - assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); - - /* Disable the Channel 2: Reset the CC2E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC2E; - 8011ee6: f64f 73ef movw r3, #65519 ; 0xffef - 8011eea: 4013 ands r3, r2 - 8011eec: 6203 str r3, [r0, #32] - * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure that contains - * the configuration information for the specified TIM peripheral. - * @retval None - */ -void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) -{ - 8011eee: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - - /* Disable the Channel 2: Reset the CC2E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC2E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - 8011ef2: f8d0 8020 ldr.w r8, [r0, #32] - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC2P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); - 8011ef6: 898d ldrh r5, [r1, #12] - TIMx->CCER &= (uint16_t)~TIM_CCER_CC2E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8011ef8: 6844 ldr r4, [r0, #4] - - /* Get the TIMx CCMR1 register value */ - tmpccmrx = TIMx->CCMR1; - 8011efa: f8d0 e018 ldr.w lr, [r0, #24] - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011efe: 4e1c ldr r6, [pc, #112] ; (8011f70 ) - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC2M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC2S; - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - 8011f00: 880f ldrh r7, [r1, #0] - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC2P; - 8011f02: f64f 72df movw r2, #65503 ; 0xffdf - /* Get the TIMx CCMR1 register value */ - tmpccmrx = TIMx->CCMR1; - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC2M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC2S; - 8011f06: f648 43ff movw r3, #36095 ; 0x8cff - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC2P; - 8011f0a: ea08 0202 and.w r2, r8, r2 - 8011f0e: ea4c 0505 orr.w r5, ip, r5 - /* Get the TIMx CCMR1 register value */ - tmpccmrx = TIMx->CCMR1; - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC2M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC2S; - 8011f12: ea0e 0303 and.w r3, lr, r3 - tmpccer &= (uint16_t)~TIM_CCER_CC2P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4); - 8011f16: ea42 1205 orr.w r2, r2, r5, lsl #4 - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC2M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC2S; - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - 8011f1a: ea43 2307 orr.w r3, r3, r7, lsl #8 - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011f1e: 42b0 cmp r0, r6 - tmpccer &= (uint16_t)~TIM_CCER_CC2P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4); - 8011f20: b292 uxth r2, r2 - TIMx->CCER &= (uint16_t)~TIM_CCER_CC2E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8011f22: b2a4 uxth r4, r4 - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR1_OC2M; - tmpccmrx &= (uint16_t)~TIM_CCMR1_CC2S; - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - 8011f24: b29b uxth r3, r3 - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011f26: d009 beq.n 8011f3c - 8011f28: 4d12 ldr r5, [pc, #72] ; (8011f74 ) - 8011f2a: 42a8 cmp r0, r5 - 8011f2c: d006 beq.n 8011f3c - - /* Write to TIMx CCMR1 */ - TIMx->CCMR1 = tmpccmrx; - - /* Set the Capture Compare Register value */ - TIMx->CCR2 = TIM_OCInitStruct->TIM_Pulse; - 8011f2e: 6889 ldr r1, [r1, #8] - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 2); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 2); - } - /* Write to TIMx CR2 */ - TIMx->CR2 = tmpcr2; - 8011f30: 6044 str r4, [r0, #4] - - /* Write to TIMx CCMR1 */ - TIMx->CCMR1 = tmpccmrx; - 8011f32: 6183 str r3, [r0, #24] - - /* Set the Capture Compare Register value */ - TIMx->CCR2 = TIM_OCInitStruct->TIM_Pulse; - 8011f34: 6381 str r1, [r0, #56] ; 0x38 - - /* Write to TIMx CCER */ - TIMx->CCER = tmpccer; - 8011f36: 6202 str r2, [r0, #32] - 8011f38: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC2NP; - /* Set the Output N Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 4); - 8011f3c: 89cd ldrh r5, [r1, #14] - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 2); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 2); - 8011f3e: f8b1 8012 ldrh.w r8, [r1, #18] - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 4); - /* Reset the Output Compare and Output Compare N IDLE State */ - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 2); - 8011f42: 8a0f ldrh r7, [r1, #16] - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 4); - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC2NE; - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 4); - 8011f44: f8b1 c004 ldrh.w ip, [r1, #4] - assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity)); - assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState)); - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC2NP; - 8011f48: f022 0e80 bic.w lr, r2, #128 ; 0x80 - /* Set the Output N Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 4); - 8011f4c: ea4e 1e05 orr.w lr, lr, r5, lsl #4 - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC2NE; - 8011f50: f64f 75bf movw r5, #65471 ; 0xffbf - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 4); - /* Reset the Output Compare and Output Compare N IDLE State */ - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2N; - 8011f54: f424 6640 bic.w r6, r4, #3072 ; 0xc00 - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC2NP; - /* Set the Output N Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 4); - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC2NE; - 8011f58: ea0e 0505 and.w r5, lr, r5 - 8011f5c: ea48 0407 orr.w r4, r8, r7 - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 4); - 8011f60: ea45 120c orr.w r2, r5, ip, lsl #4 - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 2); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 2); - 8011f64: ea46 0484 orr.w r4, r6, r4, lsl #2 - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 4); - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC2NE; - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 4); - 8011f68: b292 uxth r2, r2 - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS2N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 2); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 2); - 8011f6a: b2a4 uxth r4, r4 - 8011f6c: e7df b.n 8011f2e - 8011f6e: bf00 nop - 8011f70: 40010000 .word 0x40010000 - 8011f74: 40010400 .word 0x40010400 - 8011f78: f3af 8000 nop.w - 8011f7c: f3af 8000 nop.w - -08011f80 : - assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); - assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); - assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); - - /* Disable the Channel 3: Reset the CC2E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC3E; - 8011f80: 6a02 ldr r2, [r0, #32] - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC3M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC3S; - /* Select the Output Compare Mode */ - tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; - 8011f82: f8b1 c000 ldrh.w ip, [r1] - assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); - assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); - assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); - - /* Disable the Channel 3: Reset the CC2E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC3E; - 8011f86: f64f 63ff movw r3, #65279 ; 0xfeff - 8011f8a: 4013 ands r3, r2 - 8011f8c: 6203 str r3, [r0, #32] - * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure that contains - * the configuration information for the specified TIM peripheral. - * @retval None - */ -void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) -{ - 8011f8e: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - - /* Disable the Channel 3: Reset the CC2E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC3E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - 8011f92: 6a02 ldr r2, [r0, #32] - tmpccer &= (uint16_t)~TIM_CCER_CC3P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 8); - 8011f94: f8b1 e002 ldrh.w lr, [r1, #2] - tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC3P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); - 8011f98: 898c ldrh r4, [r1, #12] - TIMx->CCER &= (uint16_t)~TIM_CCER_CC3E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8011f9a: 6845 ldr r5, [r0, #4] - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 8); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011f9c: 4e1a ldr r6, [pc, #104] ; (8012008 ) - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - - /* Get the TIMx CCMR2 register value */ - tmpccmrx = TIMx->CCMR2; - 8011f9e: 69c7 ldr r7, [r0, #28] - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC3S; - /* Select the Output Compare Mode */ - tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC3P; - 8011fa0: f64f 53ff movw r3, #65023 ; 0xfdff - 8011fa4: 4013 ands r3, r2 - 8011fa6: ea4e 0404 orr.w r4, lr, r4 - /* Get the TIMx CCMR2 register value */ - tmpccmrx = TIMx->CCMR2; - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC3M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC3S; - 8011faa: f64f 728c movw r2, #65420 ; 0xff8c - tmpccer &= (uint16_t)~TIM_CCER_CC3P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 8); - 8011fae: ea43 2304 orr.w r3, r3, r4, lsl #8 - /* Get the TIMx CCMR2 register value */ - tmpccmrx = TIMx->CCMR2; - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC3M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC3S; - 8011fb2: 403a ands r2, r7 - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 8); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011fb4: 42b0 cmp r0, r6 - tmpccer &= (uint16_t)~TIM_CCER_CC3P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 8); - 8011fb6: b29b uxth r3, r3 - TIMx->CCER &= (uint16_t)~TIM_CCER_CC3E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8011fb8: b2ad uxth r5, r5 - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC3M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC3S; - /* Select the Output Compare Mode */ - tmpccmrx |= TIM_OCInitStruct->TIM_OCMode; - 8011fba: ea42 020c orr.w r2, r2, ip - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 8); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 8); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8011fbe: d009 beq.n 8011fd4 - 8011fc0: 4c12 ldr r4, [pc, #72] ; (801200c ) - 8011fc2: 42a0 cmp r0, r4 - 8011fc4: d006 beq.n 8011fd4 - - /* Write to TIMx CCMR2 */ - TIMx->CCMR2 = tmpccmrx; - - /* Set the Capture Compare Register value */ - TIMx->CCR3 = TIM_OCInitStruct->TIM_Pulse; - 8011fc6: 6889 ldr r1, [r1, #8] - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 4); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 4); - } - /* Write to TIMx CR2 */ - TIMx->CR2 = tmpcr2; - 8011fc8: 6045 str r5, [r0, #4] - - /* Write to TIMx CCMR2 */ - TIMx->CCMR2 = tmpccmrx; - 8011fca: 61c2 str r2, [r0, #28] - - /* Set the Capture Compare Register value */ - TIMx->CCR3 = TIM_OCInitStruct->TIM_Pulse; - 8011fcc: 63c1 str r1, [r0, #60] ; 0x3c - - /* Write to TIMx CCER */ - TIMx->CCER = tmpccer; - 8011fce: 6203 str r3, [r0, #32] - 8011fd0: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC3NP; - /* Set the Output N Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 8); - 8011fd4: 89cc ldrh r4, [r1, #14] - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 4); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 4); - 8011fd6: f8b1 8012 ldrh.w r8, [r1, #18] - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 8); - /* Reset the Output Compare and Output Compare N IDLE State */ - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 4); - 8011fda: 8a0f ldrh r7, [r1, #16] - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 8); - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC3NE; - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 8); - 8011fdc: f8b1 c004 ldrh.w ip, [r1, #4] - assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity)); - assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState)); - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC3NP; - 8011fe0: f423 6e00 bic.w lr, r3, #2048 ; 0x800 - /* Set the Output N Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 8); - 8011fe4: ea4e 2e04 orr.w lr, lr, r4, lsl #8 - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC3NE; - 8011fe8: f64f 34ff movw r4, #64511 ; 0xfbff - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 8); - /* Reset the Output Compare and Output Compare N IDLE State */ - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3N; - 8011fec: f425 5640 bic.w r6, r5, #12288 ; 0x3000 - /* Reset the Output N Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC3NP; - /* Set the Output N Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 8); - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC3NE; - 8011ff0: ea0e 0404 and.w r4, lr, r4 - 8011ff4: ea48 0507 orr.w r5, r8, r7 - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 8); - 8011ff8: ea44 230c orr.w r3, r4, ip, lsl #8 - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 4); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 4); - 8011ffc: ea46 1505 orr.w r5, r6, r5, lsl #4 - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCNPolarity << 8); - /* Reset the Output N State */ - tmpccer &= (uint16_t)~TIM_CCER_CC3NE; - - /* Set the Output N State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputNState << 8); - 8012000: b29b uxth r3, r3 - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3; - tmpcr2 &= (uint16_t)~TIM_CR2_OIS3N; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 4); - /* Set the Output N Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCNIdleState << 4); - 8012002: b2ad uxth r5, r5 - 8012004: e7df b.n 8011fc6 - 8012006: bf00 nop - 8012008: 40010000 .word 0x40010000 - 801200c: 40010400 .word 0x40010400 - -08012010 : - assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); - assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); - assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); - - /* Disable the Channel 4: Reset the CC4E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC4E; - 8012010: 6a02 ldr r2, [r0, #32] - tmpccer &= (uint16_t)~TIM_CCER_CC4P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 12); - 8012012: f8b1 c002 ldrh.w ip, [r1, #2] - assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode)); - assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState)); - assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity)); - - /* Disable the Channel 4: Reset the CC4E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC4E; - 8012016: f64e 73ff movw r3, #61439 ; 0xefff - 801201a: 4013 ands r3, r2 - 801201c: 6203 str r3, [r0, #32] - * @param TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure that contains - * the configuration information for the specified TIM peripheral. - * @retval None - */ -void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct) -{ - 801201e: e92d 41f0 stmdb sp!, {r4, r5, r6, r7, r8, lr} - - /* Disable the Channel 4: Reset the CC4E Bit */ - TIMx->CCER &= (uint16_t)~TIM_CCER_CC4E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - 8012022: f8d0 8020 ldr.w r8, [r0, #32] - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC4P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); - 8012026: 898d ldrh r5, [r1, #12] - TIMx->CCER &= (uint16_t)~TIM_CCER_CC4E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8012028: 6844 ldr r4, [r0, #4] - - /* Get the TIMx CCMR2 register value */ - tmpccmrx = TIMx->CCMR2; - 801202a: f8d0 e01c ldr.w lr, [r0, #28] - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 12); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 801202e: 4e13 ldr r6, [pc, #76] ; (801207c ) - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC4M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC4S; - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - 8012030: 880f ldrh r7, [r1, #0] - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC4P; - 8012032: f64d 73ff movw r3, #57343 ; 0xdfff - /* Get the TIMx CCMR2 register value */ - tmpccmrx = TIMx->CCMR2; - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC4M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC4S; - 8012036: f648 42ff movw r2, #36095 ; 0x8cff - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - - /* Reset the Output Polarity level */ - tmpccer &= (uint16_t)~TIM_CCER_CC4P; - 801203a: ea08 0303 and.w r3, r8, r3 - 801203e: ea4c 0505 orr.w r5, ip, r5 - /* Get the TIMx CCMR2 register value */ - tmpccmrx = TIMx->CCMR2; - - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC4M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC4S; - 8012042: ea0e 0202 and.w r2, lr, r2 - tmpccer &= (uint16_t)~TIM_CCER_CC4P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 12); - 8012046: ea43 3305 orr.w r3, r3, r5, lsl #12 - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC4M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC4S; - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - 801204a: ea42 2207 orr.w r2, r2, r7, lsl #8 - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 12); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 801204e: 42b0 cmp r0, r6 - tmpccer &= (uint16_t)~TIM_CCER_CC4P; - /* Set the Output Compare Polarity */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 12); - 8012050: b29b uxth r3, r3 - TIMx->CCER &= (uint16_t)~TIM_CCER_CC4E; - - /* Get the TIMx CCER register value */ - tmpccer = TIMx->CCER; - /* Get the TIMx CR2 register value */ - tmpcr2 = TIMx->CR2; - 8012052: b2a4 uxth r4, r4 - /* Reset the Output Compare mode and Capture/Compare selection Bits */ - tmpccmrx &= (uint16_t)~TIM_CCMR2_OC4M; - tmpccmrx &= (uint16_t)~TIM_CCMR2_CC4S; - - /* Select the Output Compare Mode */ - tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8); - 8012054: b292 uxth r2, r2 - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 12); - - /* Set the Output State */ - tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 12); - - if((TIMx == TIM1) || (TIMx == TIM8)) - 8012056: d009 beq.n 801206c - 8012058: 4d09 ldr r5, [pc, #36] ; (8012080 ) - 801205a: 42a8 cmp r0, r5 - 801205c: d006 beq.n 801206c - - /* Write to TIMx CCMR2 */ - TIMx->CCMR2 = tmpccmrx; - - /* Set the Capture Compare Register value */ - TIMx->CCR4 = TIM_OCInitStruct->TIM_Pulse; - 801205e: 6889 ldr r1, [r1, #8] - tmpcr2 &=(uint16_t) ~TIM_CR2_OIS4; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 6); - } - /* Write to TIMx CR2 */ - TIMx->CR2 = tmpcr2; - 8012060: 6044 str r4, [r0, #4] - - /* Write to TIMx CCMR2 */ - TIMx->CCMR2 = tmpccmrx; - 8012062: 61c2 str r2, [r0, #28] - - /* Set the Capture Compare Register value */ - TIMx->CCR4 = TIM_OCInitStruct->TIM_Pulse; - 8012064: 6401 str r1, [r0, #64] ; 0x40 - - /* Write to TIMx CCER */ - TIMx->CCER = tmpccer; - 8012066: 6203 str r3, [r0, #32] - 8012068: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} - { - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - /* Reset the Output Compare IDLE State */ - tmpcr2 &=(uint16_t) ~TIM_CR2_OIS4; - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 6); - 801206c: 8a0d ldrh r5, [r1, #16] - - if((TIMx == TIM1) || (TIMx == TIM8)) - { - assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState)); - /* Reset the Output Compare IDLE State */ - tmpcr2 &=(uint16_t) ~TIM_CR2_OIS4; - 801206e: f424 4480 bic.w r4, r4, #16384 ; 0x4000 - /* Set the Output Idle state */ - tmpcr2 |= (uint16_t)(TIM_OCInitStruct->TIM_OCIdleState << 6); - 8012072: ea44 1485 orr.w r4, r4, r5, lsl #6 - 8012076: b2a4 uxth r4, r4 - 8012078: e7f1 b.n 801205e - 801207a: bf00 nop - 801207c: 40010000 .word 0x40010000 - 8012080: 40010400 .word 0x40010400 - 8012084: f3af 8000 nop.w - 8012088: f3af 8000 nop.w - 801208c: f3af 8000 nop.w - -08012090 : - - /* Check the parameters */ - assert_param(IS_TIM_LIST1_PERIPH(TIMx)); - assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); - - tmpccmr1 = TIMx->CCMR1; - 8012090: 6982 ldr r2, [r0, #24] - - /* Reset the OC1PE Bit */ - tmpccmr1 &= (uint16_t)(~TIM_CCMR1_OC1PE); - 8012092: f64f 73f7 movw r3, #65527 ; 0xfff7 - 8012096: 4013 ands r3, r2 - - /* Enable or Disable the Output Compare Preload feature */ - tmpccmr1 |= TIM_OCPreload; - - /* Write to TIMx CCMR1 register */ - TIMx->CCMR1 = tmpccmr1; - 8012098: 4319 orrs r1, r3 - 801209a: 6181 str r1, [r0, #24] - 801209c: 4770 bx lr - 801209e: bf00 nop - -080120a0 : - - /* Check the parameters */ - assert_param(IS_TIM_LIST2_PERIPH(TIMx)); - assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); - - tmpccmr1 = TIMx->CCMR1; - 80120a0: 6982 ldr r2, [r0, #24] - - /* Reset the OC2PE Bit */ - tmpccmr1 &= (uint16_t)(~TIM_CCMR1_OC2PE); - 80120a2: f24f 73ff movw r3, #63487 ; 0xf7ff - 80120a6: 4013 ands r3, r2 - - /* Enable or Disable the Output Compare Preload feature */ - tmpccmr1 |= (uint16_t)(TIM_OCPreload << 8); - 80120a8: ea43 2101 orr.w r1, r3, r1, lsl #8 - - /* Write to TIMx CCMR1 register */ - TIMx->CCMR1 = tmpccmr1; - 80120ac: b289 uxth r1, r1 - 80120ae: 6181 str r1, [r0, #24] - 80120b0: 4770 bx lr - 80120b2: bf00 nop - 80120b4: f3af 8000 nop.w - 80120b8: f3af 8000 nop.w - 80120bc: f3af 8000 nop.w - -080120c0 : - - /* Check the parameters */ - assert_param(IS_TIM_LIST3_PERIPH(TIMx)); - assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); - - tmpccmr2 = TIMx->CCMR2; - 80120c0: 69c2 ldr r2, [r0, #28] - - /* Reset the OC3PE Bit */ - tmpccmr2 &= (uint16_t)(~TIM_CCMR2_OC3PE); - 80120c2: f64f 73f7 movw r3, #65527 ; 0xfff7 - 80120c6: 4013 ands r3, r2 - - /* Enable or Disable the Output Compare Preload feature */ - tmpccmr2 |= TIM_OCPreload; - - /* Write to TIMx CCMR2 register */ - TIMx->CCMR2 = tmpccmr2; - 80120c8: 4319 orrs r1, r3 - 80120ca: 61c1 str r1, [r0, #28] - 80120cc: 4770 bx lr - 80120ce: bf00 nop - -080120d0 : - - /* Check the parameters */ - assert_param(IS_TIM_LIST3_PERIPH(TIMx)); - assert_param(IS_TIM_OCPRELOAD_STATE(TIM_OCPreload)); - - tmpccmr2 = TIMx->CCMR2; - 80120d0: 69c2 ldr r2, [r0, #28] - - /* Reset the OC4PE Bit */ - tmpccmr2 &= (uint16_t)(~TIM_CCMR2_OC4PE); - 80120d2: f24f 73ff movw r3, #63487 ; 0xf7ff - 80120d6: 4013 ands r3, r2 - - /* Enable or Disable the Output Compare Preload feature */ - tmpccmr2 |= (uint16_t)(TIM_OCPreload << 8); - 80120d8: ea43 2101 orr.w r1, r3, r1, lsl #8 - - /* Write to TIMx CCMR2 register */ - TIMx->CCMR2 = tmpccmr2; - 80120dc: b289 uxth r1, r1 - 80120de: 61c1 str r1, [r0, #28] - 80120e0: 4770 bx lr - 80120e2: bf00 nop - 80120e4: f3af 8000 nop.w - 80120e8: f3af 8000 nop.w - 80120ec: f3af 8000 nop.w - -080120f0 : - * @param TIM_BDTRInitStruct: pointer to a TIM_BDTRInitTypeDef structure that - * contains the BDTR Register configuration information for the TIM peripheral. - * @retval None - */ -void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct) -{ - 80120f0: b5f0 push {r4, r5, r6, r7, lr} - - /* Set the Lock level, the Break enable Bit and the Polarity, the OSSR State, - the OSSI State, the dead time value and the Automatic Output Enable Bit */ - TIMx->BDTR = (uint32_t)TIM_BDTRInitStruct->TIM_OSSRState | TIM_BDTRInitStruct->TIM_OSSIState | - TIM_BDTRInitStruct->TIM_LOCKLevel | TIM_BDTRInitStruct->TIM_DeadTime | - TIM_BDTRInitStruct->TIM_Break | TIM_BDTRInitStruct->TIM_BreakPolarity | - 80120f2: 880b ldrh r3, [r1, #0] - 80120f4: f8b1 e002 ldrh.w lr, [r1, #2] - 80120f8: 888f ldrh r7, [r1, #4] - 80120fa: 88ce ldrh r6, [r1, #6] - 80120fc: 890d ldrh r5, [r1, #8] - 80120fe: 894c ldrh r4, [r1, #10] - 8012100: 898a ldrh r2, [r1, #12] - 8012102: ea4e 0303 orr.w r3, lr, r3 - 8012106: 433b orrs r3, r7 - 8012108: 4333 orrs r3, r6 - 801210a: 432b orrs r3, r5 - 801210c: 4323 orrs r3, r4 - 801210e: 4313 orrs r3, r2 - 8012110: b29b uxth r3, r3 - assert_param(IS_TIM_BREAK_POLARITY(TIM_BDTRInitStruct->TIM_BreakPolarity)); - assert_param(IS_TIM_AUTOMATIC_OUTPUT_STATE(TIM_BDTRInitStruct->TIM_AutomaticOutput)); - - /* Set the Lock level, the Break enable Bit and the Polarity, the OSSR State, - the OSSI State, the dead time value and the Automatic Output Enable Bit */ - TIMx->BDTR = (uint32_t)TIM_BDTRInitStruct->TIM_OSSRState | TIM_BDTRInitStruct->TIM_OSSIState | - 8012112: 6443 str r3, [r0, #68] ; 0x44 - 8012114: bdf0 pop {r4, r5, r6, r7, pc} - 8012116: bf00 nop - 8012118: f3af 8000 nop.w - 801211c: f3af 8000 nop.w - -08012120 : - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - /* Enable the TIM Main Output */ - TIMx->BDTR |= TIM_BDTR_MOE; - 8012120: 6c43 ldr r3, [r0, #68] ; 0x44 -{ - /* Check the parameters */ - assert_param(IS_TIM_LIST4_PERIPH(TIMx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - 8012122: b919 cbnz r1, 801212c - TIMx->BDTR |= TIM_BDTR_MOE; - } - else - { - /* Disable the TIM Main Output */ - TIMx->BDTR &= (uint16_t)~TIM_BDTR_MOE; - 8012124: f3c3 030e ubfx r3, r3, #0, #15 - 8012128: 6443 str r3, [r0, #68] ; 0x44 - 801212a: 4770 bx lr - assert_param(IS_FUNCTIONAL_STATE(NewState)); - - if (NewState != DISABLE) - { - /* Enable the TIM Main Output */ - TIMx->BDTR |= TIM_BDTR_MOE; - 801212c: f443 4300 orr.w r3, r3, #32768 ; 0x8000 - 8012130: 6443 str r3, [r0, #68] ; 0x44 - 8012132: 4770 bx lr - 8012134: f3af 8000 nop.w - 8012138: f3af 8000 nop.w - 801213c: f3af 8000 nop.w - -08012140 : -void TIM_CCPreloadControl(TIM_TypeDef* TIMx, FunctionalState NewState) -{ - /* Check the parameters */ - assert_param(IS_TIM_LIST4_PERIPH(TIMx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - 8012140: b929 cbnz r1, 801214e - TIMx->CR2 |= TIM_CR2_CCPC; - } - else - { - /* Reset the CCPC Bit */ - TIMx->CR2 &= (uint16_t)~TIM_CR2_CCPC; - 8012142: 6842 ldr r2, [r0, #4] - 8012144: f64f 73fe movw r3, #65534 ; 0xfffe - 8012148: 4013 ands r3, r2 - 801214a: 6043 str r3, [r0, #4] - 801214c: 4770 bx lr - assert_param(IS_TIM_LIST4_PERIPH(TIMx)); - assert_param(IS_FUNCTIONAL_STATE(NewState)); - if (NewState != DISABLE) - { - /* Set the CCPC Bit */ - TIMx->CR2 |= TIM_CR2_CCPC; - 801214e: 6843 ldr r3, [r0, #4] - 8012150: f043 0301 orr.w r3, r3, #1 - 8012154: 6043 str r3, [r0, #4] - 8012156: 4770 bx lr - 8012158: f3af 8000 nop.w - 801215c: f3af 8000 nop.w - -08012160 : -{ - /* Check the parameters */ - assert_param(IS_TIM_ALL_PERIPH(TIMx)); - - /* Clear the IT pending Bit */ - TIMx->SR = (uint16_t)~TIM_IT; - 8012160: 43c9 mvns r1, r1 - 8012162: b289 uxth r1, r1 - 8012164: 6101 str r1, [r0, #16] - 8012166: 4770 bx lr - 8012168: f3af 8000 nop.w - 801216c: f3af 8000 nop.w - -08012170 : - /* Check the parameters */ - assert_param(IS_TIM_LIST1_PERIPH(TIMx)); - assert_param(IS_TIM_TRIGGER_SELECTION(TIM_InputTriggerSource)); - - /* Get the TIMx SMCR register value */ - tmpsmcr = TIMx->SMCR; - 8012170: 6882 ldr r2, [r0, #8] - - /* Reset the TS Bits */ - tmpsmcr &= (uint16_t)~TIM_SMCR_TS; - 8012172: f64f 738f movw r3, #65423 ; 0xff8f - 8012176: 4013 ands r3, r2 - - /* Set the Input Trigger source */ - tmpsmcr |= TIM_InputTriggerSource; - - /* Write to TIMx SMCR */ - TIMx->SMCR = tmpsmcr; - 8012178: 4319 orrs r1, r3 - 801217a: 6081 str r1, [r0, #8] - 801217c: 4770 bx lr - 801217e: bf00 nop - -08012180 : - /* Check the parameters */ - assert_param(IS_TIM_LIST5_PERIPH(TIMx)); - assert_param(IS_TIM_TRGO_SOURCE(TIM_TRGOSource)); - - /* Reset the MMS Bits */ - TIMx->CR2 &= (uint16_t)~TIM_CR2_MMS; - 8012180: 6842 ldr r2, [r0, #4] - 8012182: f64f 738f movw r3, #65423 ; 0xff8f - 8012186: 4013 ands r3, r2 - 8012188: 6043 str r3, [r0, #4] - /* Select the TRGO source */ - TIMx->CR2 |= TIM_TRGOSource; - 801218a: 6843 ldr r3, [r0, #4] - 801218c: 4319 orrs r1, r3 - 801218e: 6041 str r1, [r0, #4] - 8012190: 4770 bx lr - 8012192: bf00 nop - 8012194: f3af 8000 nop.w - 8012198: f3af 8000 nop.w - 801219c: f3af 8000 nop.w - -080121a0 : - /* Check the parameters */ - assert_param(IS_TIM_LIST2_PERIPH(TIMx)); - assert_param(IS_TIM_SLAVE_MODE(TIM_SlaveMode)); - - /* Reset the SMS Bits */ - TIMx->SMCR &= (uint16_t)~TIM_SMCR_SMS; - 80121a0: 6882 ldr r2, [r0, #8] - 80121a2: f64f 73f8 movw r3, #65528 ; 0xfff8 - 80121a6: 4013 ands r3, r2 - 80121a8: 6083 str r3, [r0, #8] - - /* Select the Slave Mode */ - TIMx->SMCR |= TIM_SlaveMode; - 80121aa: 6883 ldr r3, [r0, #8] - 80121ac: 4319 orrs r1, r3 - 80121ae: 6081 str r1, [r0, #8] - 80121b0: 4770 bx lr - 80121b2: bf00 nop - 80121b4: f3af 8000 nop.w - 80121b8: f3af 8000 nop.w - 80121bc: f3af 8000 nop.w - -080121c0 : - /* Check the parameters */ - assert_param(IS_TIM_LIST2_PERIPH(TIMx)); - assert_param(IS_TIM_MSM_STATE(TIM_MasterSlaveMode)); - - /* Reset the MSM Bit */ - TIMx->SMCR &= (uint16_t)~TIM_SMCR_MSM; - 80121c0: 6882 ldr r2, [r0, #8] - 80121c2: f64f 737f movw r3, #65407 ; 0xff7f - 80121c6: 4013 ands r3, r2 - 80121c8: 6083 str r3, [r0, #8] - - /* Set or Reset the MSM Bit */ - TIMx->SMCR |= TIM_MasterSlaveMode; - 80121ca: 6883 ldr r3, [r0, #8] - 80121cc: 4319 orrs r1, r3 - 80121ce: 6081 str r1, [r0, #8] - 80121d0: 4770 bx lr - 80121d2: bf00 nop - 80121d4: f3af 8000 nop.w - 80121d8: f3af 8000 nop.w - 80121dc: f3af 8000 nop.w - -080121e0 : -{ - uint32_t tmpreg = 0; - /* Check the parameters */ - assert_param(IS_WWDG_PRESCALER(WWDG_Prescaler)); - /* Clear WDGTB[1:0] bits */ - tmpreg = WWDG->CFR & CFR_WDGTB_MASK; - 80121e0: 4a03 ldr r2, [pc, #12] ; (80121f0 ) - 80121e2: 6853 ldr r3, [r2, #4] - 80121e4: f423 73c0 bic.w r3, r3, #384 ; 0x180 - /* Set WDGTB[1:0] bits according to WWDG_Prescaler value */ - tmpreg |= WWDG_Prescaler; - 80121e8: 4318 orrs r0, r3 - /* Store the new value */ - WWDG->CFR = tmpreg; - 80121ea: 6050 str r0, [r2, #4] - 80121ec: 4770 bx lr - 80121ee: bf00 nop - 80121f0: 40002c00 .word 0x40002c00 - 80121f4: f3af 8000 nop.w - 80121f8: f3af 8000 nop.w - 80121fc: f3af 8000 nop.w - -08012200 : - * @param WindowValue: specifies the window value to be compared to the downcounter. - * This parameter value must be lower than 0x80. - * @retval None - */ -void WWDG_SetWindowValue(uint8_t WindowValue) -{ - 8012200: b082 sub sp, #8 - - /* Check the parameters */ - assert_param(IS_WWDG_WINDOW_VALUE(WindowValue)); - /* Clear W[6:0] bits */ - - tmpreg = WWDG->CFR & CFR_W_MASK; - 8012202: 4a08 ldr r2, [pc, #32] ; (8012224 ) - * This parameter value must be lower than 0x80. - * @retval None - */ -void WWDG_SetWindowValue(uint8_t WindowValue) -{ - __IO uint32_t tmpreg = 0; - 8012204: 2300 movs r3, #0 - 8012206: 9301 str r3, [sp, #4] - - /* Check the parameters */ - assert_param(IS_WWDG_WINDOW_VALUE(WindowValue)); - /* Clear W[6:0] bits */ - - tmpreg = WWDG->CFR & CFR_W_MASK; - 8012208: 6853 ldr r3, [r2, #4] - 801220a: f023 037f bic.w r3, r3, #127 ; 0x7f - 801220e: 9301 str r3, [sp, #4] - - /* Set W[6:0] bits according to WindowValue value */ - tmpreg |= WindowValue & (uint32_t) BIT_MASK; - 8012210: 9b01 ldr r3, [sp, #4] - 8012212: f000 007f and.w r0, r0, #127 ; 0x7f - 8012216: 4303 orrs r3, r0 - 8012218: 9301 str r3, [sp, #4] - - /* Store the new value */ - WWDG->CFR = tmpreg; - 801221a: 9b01 ldr r3, [sp, #4] - 801221c: 6053 str r3, [r2, #4] -} - 801221e: b002 add sp, #8 - 8012220: 4770 bx lr - 8012222: bf00 nop - 8012224: 40002c00 .word 0x40002c00 - 8012228: f3af 8000 nop.w - 801222c: f3af 8000 nop.w - -08012230 : -{ - /* Check the parameters */ - assert_param(IS_WWDG_COUNTER(Counter)); - /* Write to T[6:0] bits to configure the counter value, no need to do - a read-modify-write; writing a 0 to WDGA bit does nothing */ - WWDG->CR = Counter & BIT_MASK; - 8012230: 4b02 ldr r3, [pc, #8] ; (801223c ) - 8012232: f000 007f and.w r0, r0, #127 ; 0x7f - 8012236: 6018 str r0, [r3, #0] - 8012238: 4770 bx lr - 801223a: bf00 nop - 801223c: 40002c00 .word 0x40002c00 - -08012240 : - */ -void WWDG_Enable(uint8_t Counter) -{ - /* Check the parameters */ - assert_param(IS_WWDG_COUNTER(Counter)); - WWDG->CR = WWDG_CR_WDGA | Counter; - 8012240: 4b02 ldr r3, [pc, #8] ; (801224c ) - 8012242: f040 0080 orr.w r0, r0, #128 ; 0x80 - 8012246: 6018 str r0, [r3, #0] - 8012248: 4770 bx lr - 801224a: bf00 nop - 801224c: 40002c00 .word 0x40002c00 - -08012250
: - WORK : - ARG : void - RET : void ----------------------------------------------------------------------------*/ -int main(void) -{ - 8012250: b508 push {r3, lr} - ARG : void - RET : void ----------------------------------------------------------------------------*/ -void main_init(void) -{ - bldc_init(); - 8012252: f7fd fc85 bl 800fb60 - - test.print(); - - //-- BLDC 시작 - // - bldc_start(); - 8012256: f7fd fca3 bl 800fba0 - - - return 0; -} - 801225a: 2000 movs r0, #0 - 801225c: bd08 pop {r3, pc} - 801225e: bf00 nop - -08012260 : - 8012260: b500 push {lr} - 8012262: ee10 3a10 vmov r3, s0 - 8012266: 4a1a ldr r2, [pc, #104] ; (80122d0 ) - 8012268: f023 4300 bic.w r3, r3, #2147483648 ; 0x80000000 - 801226c: 4293 cmp r3, r2 - 801226e: b083 sub sp, #12 - 8012270: dd19 ble.n 80122a6 - 8012272: f1b3 4fff cmp.w r3, #2139095040 ; 0x7f800000 - 8012276: db04 blt.n 8012282 - 8012278: ee30 0a40 vsub.f32 s0, s0, s0 - 801227c: b003 add sp, #12 - 801227e: f85d fb04 ldr.w pc, [sp], #4 - 8012282: 4668 mov r0, sp - 8012284: f000 f8cc bl 8012420 <__ieee754_rem_pio2f> - 8012288: f000 0003 and.w r0, r0, #3 - 801228c: 2801 cmp r0, #1 - 801228e: ed9d 0a00 vldr s0, [sp] - 8012292: eddd 0a01 vldr s1, [sp, #4] - 8012296: d012 beq.n 80122be - 8012298: 2802 cmp r0, #2 - 801229a: d00b beq.n 80122b4 - 801229c: b1a0 cbz r0, 80122c8 - 801229e: 2001 movs r0, #1 - 80122a0: f000 fdde bl 8012e60 <__kernel_sinf> - 80122a4: e7ea b.n 801227c - 80122a6: eddf 0a0b vldr s1, [pc, #44] ; 80122d4 - 80122aa: f000 fa59 bl 8012760 <__kernel_cosf> - 80122ae: b003 add sp, #12 - 80122b0: f85d fb04 ldr.w pc, [sp], #4 - 80122b4: f000 fa54 bl 8012760 <__kernel_cosf> - 80122b8: eeb1 0a40 vneg.f32 s0, s0 - 80122bc: e7de b.n 801227c - 80122be: f000 fdcf bl 8012e60 <__kernel_sinf> - 80122c2: eeb1 0a40 vneg.f32 s0, s0 - 80122c6: e7d9 b.n 801227c - 80122c8: f000 fa4a bl 8012760 <__kernel_cosf> - 80122cc: e7d6 b.n 801227c - 80122ce: bf00 nop - 80122d0: 3f490fd8 .word 0x3f490fd8 - ... - -080122e0 : - 80122e0: b500 push {lr} - 80122e2: ee10 3a10 vmov r3, s0 - 80122e6: 4a1b ldr r2, [pc, #108] ; (8012354 ) - 80122e8: f023 4300 bic.w r3, r3, #2147483648 ; 0x80000000 - 80122ec: 4293 cmp r3, r2 - 80122ee: b083 sub sp, #12 - 80122f0: dd1a ble.n 8012328 - 80122f2: f1b3 4fff cmp.w r3, #2139095040 ; 0x7f800000 - 80122f6: db04 blt.n 8012302 - 80122f8: ee30 0a40 vsub.f32 s0, s0, s0 - 80122fc: b003 add sp, #12 - 80122fe: f85d fb04 ldr.w pc, [sp], #4 - 8012302: 4668 mov r0, sp - 8012304: f000 f88c bl 8012420 <__ieee754_rem_pio2f> - 8012308: f000 0003 and.w r0, r0, #3 - 801230c: 2801 cmp r0, #1 - 801230e: ed9d 0a00 vldr s0, [sp] - 8012312: eddd 0a01 vldr s1, [sp, #4] - 8012316: d015 beq.n 8012344 - 8012318: 2802 cmp r0, #2 - 801231a: d00d beq.n 8012338 - 801231c: b1a8 cbz r0, 801234a - 801231e: f000 fa1f bl 8012760 <__kernel_cosf> - 8012322: eeb1 0a40 vneg.f32 s0, s0 - 8012326: e7e9 b.n 80122fc - 8012328: eddf 0a0b vldr s1, [pc, #44] ; 8012358 - 801232c: 2000 movs r0, #0 - 801232e: f000 fd97 bl 8012e60 <__kernel_sinf> - 8012332: b003 add sp, #12 - 8012334: f85d fb04 ldr.w pc, [sp], #4 - 8012338: 2001 movs r0, #1 - 801233a: f000 fd91 bl 8012e60 <__kernel_sinf> - 801233e: eeb1 0a40 vneg.f32 s0, s0 - 8012342: e7db b.n 80122fc - 8012344: f000 fa0c bl 8012760 <__kernel_cosf> - 8012348: e7d8 b.n 80122fc - 801234a: 2001 movs r0, #1 - 801234c: f000 fd88 bl 8012e60 <__kernel_sinf> - 8012350: e7d4 b.n 80122fc - 8012352: bf00 nop - 8012354: 3f490fd8 .word 0x3f490fd8 - ... - -08012360 : - 8012360: b510 push {r4, lr} - 8012362: ed2d 8b02 vpush {d8} - 8012366: 4c2a ldr r4, [pc, #168] ; (8012410 ) - 8012368: b08a sub sp, #40 ; 0x28 - 801236a: eef0 8a40 vmov.f32 s17, s0 - 801236e: f000 f99f bl 80126b0 <__ieee754_sqrtf> - 8012372: f994 3000 ldrsb.w r3, [r4] - 8012376: 3301 adds r3, #1 - 8012378: eeb0 8a40 vmov.f32 s16, s0 - 801237c: d009 beq.n 8012392 - 801237e: eeb0 0a68 vmov.f32 s0, s17 - 8012382: f000 fe0d bl 8012fa0 <__fpclassifyf> - 8012386: b120 cbz r0, 8012392 - 8012388: eef5 8ac0 vcmpe.f32 s17, #0.0 - 801238c: eef1 fa10 vmrs APSR_nzcv, fpscr - 8012390: d405 bmi.n 801239e - 8012392: eeb0 0a48 vmov.f32 s0, s16 - 8012396: b00a add sp, #40 ; 0x28 - 8012398: ecbd 8b02 vpop {d8} - 801239c: bd10 pop {r4, pc} - 801239e: 2301 movs r3, #1 - 80123a0: 4a1c ldr r2, [pc, #112] ; (8012414 ) - 80123a2: 9300 str r3, [sp, #0] - 80123a4: ee18 0a90 vmov r0, s17 - 80123a8: 2300 movs r3, #0 - 80123aa: 9201 str r2, [sp, #4] - 80123ac: 9308 str r3, [sp, #32] - 80123ae: f7fa f82b bl 800c408 <__aeabi_f2d> - 80123b2: 7824 ldrb r4, [r4, #0] - 80123b4: e9cd 0104 strd r0, r1, [sp, #16] - 80123b8: e9cd 0102 strd r0, r1, [sp, #8] - 80123bc: b99c cbnz r4, 80123e6 - 80123be: 2200 movs r2, #0 - 80123c0: 2300 movs r3, #0 - 80123c2: e9cd 2306 strd r2, r3, [sp, #24] - 80123c6: 4668 mov r0, sp - 80123c8: f000 fd92 bl 8012ef0 - 80123cc: b1a8 cbz r0, 80123fa - 80123ce: 9b08 ldr r3, [sp, #32] - 80123d0: b9c3 cbnz r3, 8012404 - 80123d2: e9dd 0106 ldrd r0, r1, [sp, #24] - 80123d6: f7fa fa83 bl 800c8e0 <__aeabi_d2f> - 80123da: ee00 0a10 vmov s0, r0 - 80123de: b00a add sp, #40 ; 0x28 - 80123e0: ecbd 8b02 vpop {d8} - 80123e4: bd10 pop {r4, pc} - 80123e6: 2000 movs r0, #0 - 80123e8: 2100 movs r1, #0 - 80123ea: 4602 mov r2, r0 - 80123ec: 460b mov r3, r1 - 80123ee: f7fa f989 bl 800c704 <__aeabi_ddiv> - 80123f2: 2c02 cmp r4, #2 - 80123f4: e9cd 0106 strd r0, r1, [sp, #24] - 80123f8: d1e5 bne.n 80123c6 - 80123fa: f000 fe69 bl 80130d0 <__errno> - 80123fe: 2321 movs r3, #33 ; 0x21 - 8012400: 6003 str r3, [r0, #0] - 8012402: e7e4 b.n 80123ce - 8012404: f000 fe64 bl 80130d0 <__errno> - 8012408: 9b08 ldr r3, [sp, #32] - 801240a: 6003 str r3, [r0, #0] - 801240c: e7e1 b.n 80123d2 - 801240e: bf00 nop - 8012410: 2000080c .word 0x2000080c - 8012414: 08013750 .word 0x08013750 - ... - -08012420 <__ieee754_rem_pio2f>: - 8012420: b570 push {r4, r5, r6, lr} - 8012422: ee10 3a10 vmov r3, s0 - 8012426: 4a94 ldr r2, [pc, #592] ; (8012678 <__ieee754_rem_pio2f+0x258>) - 8012428: f023 4400 bic.w r4, r3, #2147483648 ; 0x80000000 - 801242c: 4294 cmp r4, r2 - 801242e: b086 sub sp, #24 - 8012430: ee10 6a10 vmov r6, s0 - 8012434: 4605 mov r5, r0 - 8012436: dd66 ble.n 8012506 <__ieee754_rem_pio2f+0xe6> - 8012438: 4a90 ldr r2, [pc, #576] ; (801267c <__ieee754_rem_pio2f+0x25c>) - 801243a: 4294 cmp r4, r2 - 801243c: dc1a bgt.n 8012474 <__ieee754_rem_pio2f+0x54> - 801243e: 2b00 cmp r3, #0 - 8012440: eddf 7a8f vldr s15, [pc, #572] ; 8012680 <__ieee754_rem_pio2f+0x260> - 8012444: 4a8f ldr r2, [pc, #572] ; (8012684 <__ieee754_rem_pio2f+0x264>) - 8012446: f024 040f bic.w r4, r4, #15 - 801244a: f340 80dd ble.w 8012608 <__ieee754_rem_pio2f+0x1e8> - 801244e: 4294 cmp r4, r2 - 8012450: ee70 7a67 vsub.f32 s15, s0, s15 - 8012454: d066 beq.n 8012524 <__ieee754_rem_pio2f+0x104> - 8012456: ed9f 7a8c vldr s14, [pc, #560] ; 8012688 <__ieee754_rem_pio2f+0x268> - 801245a: ee77 6ac7 vsub.f32 s13, s15, s14 - 801245e: 2001 movs r0, #1 - 8012460: ee77 7ae6 vsub.f32 s15, s15, s13 - 8012464: edc5 6a00 vstr s13, [r5] - 8012468: ee77 7ac7 vsub.f32 s15, s15, s14 - 801246c: edc5 7a01 vstr s15, [r5, #4] - 8012470: b006 add sp, #24 - 8012472: bd70 pop {r4, r5, r6, pc} - 8012474: 4a85 ldr r2, [pc, #532] ; (801268c <__ieee754_rem_pio2f+0x26c>) - 8012476: 4294 cmp r4, r2 - 8012478: dd66 ble.n 8012548 <__ieee754_rem_pio2f+0x128> - 801247a: f1b4 4fff cmp.w r4, #2139095040 ; 0x7f800000 - 801247e: da49 bge.n 8012514 <__ieee754_rem_pio2f+0xf4> - 8012480: 15e2 asrs r2, r4, #23 - 8012482: 3a86 subs r2, #134 ; 0x86 - 8012484: eba4 53c2 sub.w r3, r4, r2, lsl #23 - 8012488: ee07 3a10 vmov s14, r3 - 801248c: eefd 6ac7 vcvt.s32.f32 s13, s14 - 8012490: eddf 7a7f vldr s15, [pc, #508] ; 8012690 <__ieee754_rem_pio2f+0x270> - 8012494: eef8 6ae6 vcvt.f32.s32 s13, s13 - 8012498: ee37 7a66 vsub.f32 s14, s14, s13 - 801249c: edcd 6a03 vstr s13, [sp, #12] - 80124a0: ee27 7a27 vmul.f32 s14, s14, s15 - 80124a4: eefd 6ac7 vcvt.s32.f32 s13, s14 - 80124a8: eef8 6ae6 vcvt.f32.s32 s13, s13 - 80124ac: ee37 7a66 vsub.f32 s14, s14, s13 - 80124b0: edcd 6a04 vstr s13, [sp, #16] - 80124b4: ee67 7a27 vmul.f32 s15, s14, s15 - 80124b8: eef5 7a40 vcmp.f32 s15, #0.0 - 80124bc: eef1 fa10 vmrs APSR_nzcv, fpscr - 80124c0: edcd 7a05 vstr s15, [sp, #20] - 80124c4: f040 80b3 bne.w 801262e <__ieee754_rem_pio2f+0x20e> - 80124c8: eef5 6a40 vcmp.f32 s13, #0.0 - 80124cc: eef1 fa10 vmrs APSR_nzcv, fpscr - 80124d0: bf14 ite ne - 80124d2: 2302 movne r3, #2 - 80124d4: 2301 moveq r3, #1 - 80124d6: 496f ldr r1, [pc, #444] ; (8012694 <__ieee754_rem_pio2f+0x274>) - 80124d8: 2002 movs r0, #2 - 80124da: e88d 0003 stmia.w sp, {r0, r1} - 80124de: a803 add r0, sp, #12 - 80124e0: 4629 mov r1, r5 - 80124e2: f000 f9c5 bl 8012870 <__kernel_rem_pio2f> - 80124e6: 2e00 cmp r6, #0 - 80124e8: da12 bge.n 8012510 <__ieee754_rem_pio2f+0xf0> - 80124ea: ed95 7a00 vldr s14, [r5] - 80124ee: edd5 7a01 vldr s15, [r5, #4] - 80124f2: eeb1 7a47 vneg.f32 s14, s14 - 80124f6: eef1 7a67 vneg.f32 s15, s15 - 80124fa: 4240 negs r0, r0 - 80124fc: ed85 7a00 vstr s14, [r5] - 8012500: edc5 7a01 vstr s15, [r5, #4] - 8012504: e004 b.n 8012510 <__ieee754_rem_pio2f+0xf0> - 8012506: 2200 movs r2, #0 - 8012508: ed85 0a00 vstr s0, [r5] - 801250c: 6042 str r2, [r0, #4] - 801250e: 2000 movs r0, #0 - 8012510: b006 add sp, #24 - 8012512: bd70 pop {r4, r5, r6, pc} - 8012514: ee70 7a40 vsub.f32 s15, s0, s0 - 8012518: 2000 movs r0, #0 - 801251a: edc5 7a01 vstr s15, [r5, #4] - 801251e: edc5 7a00 vstr s15, [r5] - 8012522: e7f5 b.n 8012510 <__ieee754_rem_pio2f+0xf0> - 8012524: eddf 6a5c vldr s13, [pc, #368] ; 8012698 <__ieee754_rem_pio2f+0x278> - 8012528: ed9f 7a5c vldr s14, [pc, #368] ; 801269c <__ieee754_rem_pio2f+0x27c> - 801252c: ee77 7ae6 vsub.f32 s15, s15, s13 - 8012530: 2001 movs r0, #1 - 8012532: ee77 6ac7 vsub.f32 s13, s15, s14 - 8012536: ee77 7ae6 vsub.f32 s15, s15, s13 - 801253a: edc5 6a00 vstr s13, [r5] - 801253e: ee77 7ac7 vsub.f32 s15, s15, s14 - 8012542: edc5 7a01 vstr s15, [r5, #4] - 8012546: e7e3 b.n 8012510 <__ieee754_rem_pio2f+0xf0> - 8012548: f000 fcda bl 8012f00 - 801254c: eddf 6a54 vldr s13, [pc, #336] ; 80126a0 <__ieee754_rem_pio2f+0x280> - 8012550: eddf 5a4b vldr s11, [pc, #300] ; 8012680 <__ieee754_rem_pio2f+0x260> - 8012554: ed9f 7a4c vldr s14, [pc, #304] ; 8012688 <__ieee754_rem_pio2f+0x268> - 8012558: eef6 7a00 vmov.f32 s15, #96 ; 0x60 - 801255c: eee0 7a26 vfma.f32 s15, s0, s13 - 8012560: eefd 7ae7 vcvt.s32.f32 s15, s15 - 8012564: ee17 0a90 vmov r0, s15 - 8012568: eef8 6ae7 vcvt.f32.s32 s13, s15 - 801256c: 281f cmp r0, #31 - 801256e: eeb1 6a66 vneg.f32 s12, s13 - 8012572: eea6 0a25 vfma.f32 s0, s12, s11 - 8012576: ee66 7a87 vmul.f32 s15, s13, s14 - 801257a: dc1d bgt.n 80125b8 <__ieee754_rem_pio2f+0x198> - 801257c: 4a49 ldr r2, [pc, #292] ; (80126a4 <__ieee754_rem_pio2f+0x284>) - 801257e: 1e41 subs r1, r0, #1 - 8012580: f024 03ff bic.w r3, r4, #255 ; 0xff - 8012584: f852 2021 ldr.w r2, [r2, r1, lsl #2] - 8012588: 4293 cmp r3, r2 - 801258a: d015 beq.n 80125b8 <__ieee754_rem_pio2f+0x198> - 801258c: ee30 7a67 vsub.f32 s14, s0, s15 - 8012590: ed85 7a00 vstr s14, [r5] - 8012594: ee30 0a47 vsub.f32 s0, s0, s14 - 8012598: 2e00 cmp r6, #0 - 801259a: ee30 0a67 vsub.f32 s0, s0, s15 - 801259e: ed85 0a01 vstr s0, [r5, #4] - 80125a2: dab5 bge.n 8012510 <__ieee754_rem_pio2f+0xf0> - 80125a4: eeb1 7a47 vneg.f32 s14, s14 - 80125a8: eeb1 0a40 vneg.f32 s0, s0 - 80125ac: ed85 7a00 vstr s14, [r5] - 80125b0: ed85 0a01 vstr s0, [r5, #4] - 80125b4: 4240 negs r0, r0 - 80125b6: e7ab b.n 8012510 <__ieee754_rem_pio2f+0xf0> - 80125b8: ee30 7a67 vsub.f32 s14, s0, s15 - 80125bc: 15e4 asrs r4, r4, #23 - 80125be: ee17 3a10 vmov r3, s14 - 80125c2: f3c3 53c7 ubfx r3, r3, #23, #8 - 80125c6: 1ae3 subs r3, r4, r3 - 80125c8: 2b08 cmp r3, #8 - 80125ca: dde1 ble.n 8012590 <__ieee754_rem_pio2f+0x170> - 80125cc: eddf 7a32 vldr s15, [pc, #200] ; 8012698 <__ieee754_rem_pio2f+0x278> - 80125d0: ed9f 7a32 vldr s14, [pc, #200] ; 801269c <__ieee754_rem_pio2f+0x27c> - 80125d4: eef0 5a40 vmov.f32 s11, s0 - 80125d8: eee6 5a27 vfma.f32 s11, s12, s15 - 80125dc: ee30 0a65 vsub.f32 s0, s0, s11 - 80125e0: eea6 0a27 vfma.f32 s0, s12, s15 - 80125e4: eef0 7a40 vmov.f32 s15, s0 - 80125e8: eed6 7a87 vfnms.f32 s15, s13, s14 - 80125ec: ee35 7ae7 vsub.f32 s14, s11, s15 - 80125f0: ee17 3a10 vmov r3, s14 - 80125f4: f3c3 53c7 ubfx r3, r3, #23, #8 - 80125f8: 1ae4 subs r4, r4, r3 - 80125fa: 2c19 cmp r4, #25 - 80125fc: dc2c bgt.n 8012658 <__ieee754_rem_pio2f+0x238> - 80125fe: ed85 7a00 vstr s14, [r5] - 8012602: eeb0 0a65 vmov.f32 s0, s11 - 8012606: e7c5 b.n 8012594 <__ieee754_rem_pio2f+0x174> - 8012608: 4294 cmp r4, r2 - 801260a: ee70 7a27 vadd.f32 s15, s0, s15 - 801260e: d010 beq.n 8012632 <__ieee754_rem_pio2f+0x212> - 8012610: ed9f 7a1d vldr s14, [pc, #116] ; 8012688 <__ieee754_rem_pio2f+0x268> - 8012614: ee77 6a87 vadd.f32 s13, s15, s14 - 8012618: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff - 801261c: ee77 7ae6 vsub.f32 s15, s15, s13 - 8012620: edc5 6a00 vstr s13, [r5] - 8012624: ee77 7a87 vadd.f32 s15, s15, s14 - 8012628: edc5 7a01 vstr s15, [r5, #4] - 801262c: e770 b.n 8012510 <__ieee754_rem_pio2f+0xf0> - 801262e: 2303 movs r3, #3 - 8012630: e751 b.n 80124d6 <__ieee754_rem_pio2f+0xb6> - 8012632: eddf 6a19 vldr s13, [pc, #100] ; 8012698 <__ieee754_rem_pio2f+0x278> - 8012636: ed9f 7a19 vldr s14, [pc, #100] ; 801269c <__ieee754_rem_pio2f+0x27c> - 801263a: ee77 7aa6 vadd.f32 s15, s15, s13 - 801263e: f04f 30ff mov.w r0, #4294967295 ; 0xffffffff - 8012642: ee77 6a87 vadd.f32 s13, s15, s14 - 8012646: ee77 7ae6 vsub.f32 s15, s15, s13 - 801264a: edc5 6a00 vstr s13, [r5] - 801264e: ee77 7a87 vadd.f32 s15, s15, s14 - 8012652: edc5 7a01 vstr s15, [r5, #4] - 8012656: e75b b.n 8012510 <__ieee754_rem_pio2f+0xf0> - 8012658: ed9f 7a13 vldr s14, [pc, #76] ; 80126a8 <__ieee754_rem_pio2f+0x288> - 801265c: ed9f 5a13 vldr s10, [pc, #76] ; 80126ac <__ieee754_rem_pio2f+0x28c> - 8012660: eeb0 0a65 vmov.f32 s0, s11 - 8012664: eea6 0a07 vfma.f32 s0, s12, s14 - 8012668: ee75 7ac0 vsub.f32 s15, s11, s0 - 801266c: eee6 7a07 vfma.f32 s15, s12, s14 - 8012670: eed6 7a85 vfnms.f32 s15, s13, s10 - 8012674: e78a b.n 801258c <__ieee754_rem_pio2f+0x16c> - 8012676: bf00 nop - 8012678: 3f490fd8 .word 0x3f490fd8 - 801267c: 4016cbe3 .word 0x4016cbe3 - 8012680: 3fc90f80 .word 0x3fc90f80 - 8012684: 3fc90fd0 .word 0x3fc90fd0 - 8012688: 37354443 .word 0x37354443 - 801268c: 43490f80 .word 0x43490f80 - 8012690: 43800000 .word 0x43800000 - 8012694: 080137e0 .word 0x080137e0 - 8012698: 37354400 .word 0x37354400 - 801269c: 2e85a308 .word 0x2e85a308 - 80126a0: 3f22f984 .word 0x3f22f984 - 80126a4: 08013760 .word 0x08013760 - 80126a8: 2e85a300 .word 0x2e85a300 - 80126ac: 248d3132 .word 0x248d3132 - -080126b0 <__ieee754_sqrtf>: - 80126b0: ee10 3a10 vmov r3, s0 - 80126b4: f023 4200 bic.w r2, r3, #2147483648 ; 0x80000000 - 80126b8: f1b2 4fff cmp.w r2, #2139095040 ; 0x7f800000 - 80126bc: b470 push {r4, r5, r6} - 80126be: d230 bcs.n 8012722 <__ieee754_sqrtf+0x72> - 80126c0: b36a cbz r2, 801271e <__ieee754_sqrtf+0x6e> - 80126c2: 2b00 cmp r3, #0 - 80126c4: db3d blt.n 8012742 <__ieee754_sqrtf+0x92> - 80126c6: f5b2 0f00 cmp.w r2, #8388608 ; 0x800000 - 80126ca: ea4f 51e3 mov.w r1, r3, asr #23 - 80126ce: d32c bcc.n 801272a <__ieee754_sqrtf+0x7a> - 80126d0: f1a1 027f sub.w r2, r1, #127 ; 0x7f - 80126d4: f3c3 0316 ubfx r3, r3, #0, #23 - 80126d8: 07d1 lsls r1, r2, #31 - 80126da: f443 0300 orr.w r3, r3, #8388608 ; 0x800000 - 80126de: bf48 it mi - 80126e0: 005b lslmi r3, r3, #1 - 80126e2: 2400 movs r4, #0 - 80126e4: 1056 asrs r6, r2, #1 - 80126e6: 005b lsls r3, r3, #1 - 80126e8: 4625 mov r5, r4 - 80126ea: 2119 movs r1, #25 - 80126ec: f04f 7280 mov.w r2, #16777216 ; 0x1000000 - 80126f0: 18a8 adds r0, r5, r2 - 80126f2: 4298 cmp r0, r3 - 80126f4: dc02 bgt.n 80126fc <__ieee754_sqrtf+0x4c> - 80126f6: 1a1b subs r3, r3, r0 - 80126f8: 1885 adds r5, r0, r2 - 80126fa: 4414 add r4, r2 - 80126fc: 3901 subs r1, #1 - 80126fe: ea4f 0343 mov.w r3, r3, lsl #1 - 8012702: ea4f 0252 mov.w r2, r2, lsr #1 - 8012706: d1f3 bne.n 80126f0 <__ieee754_sqrtf+0x40> - 8012708: b113 cbz r3, 8012710 <__ieee754_sqrtf+0x60> - 801270a: f004 0301 and.w r3, r4, #1 - 801270e: 441c add r4, r3 - 8012710: 1064 asrs r4, r4, #1 - 8012712: f104 547c add.w r4, r4, #1056964608 ; 0x3f000000 - 8012716: eb04 53c6 add.w r3, r4, r6, lsl #23 - 801271a: ee00 3a10 vmov s0, r3 - 801271e: bc70 pop {r4, r5, r6} - 8012720: 4770 bx lr - 8012722: eea0 0a00 vfma.f32 s0, s0, s0 - 8012726: bc70 pop {r4, r5, r6} - 8012728: 4770 bx lr - 801272a: f413 0200 ands.w r2, r3, #8388608 ; 0x800000 - 801272e: d10d bne.n 801274c <__ieee754_sqrtf+0x9c> - 8012730: 005b lsls r3, r3, #1 - 8012732: 0218 lsls r0, r3, #8 - 8012734: f102 0201 add.w r2, r2, #1 - 8012738: d5fa bpl.n 8012730 <__ieee754_sqrtf+0x80> - 801273a: f1c2 0201 rsb r2, r2, #1 - 801273e: 4411 add r1, r2 - 8012740: e7c6 b.n 80126d0 <__ieee754_sqrtf+0x20> - 8012742: ee30 0a40 vsub.f32 s0, s0, s0 - 8012746: ee80 0a00 vdiv.f32 s0, s0, s0 - 801274a: e7e8 b.n 801271e <__ieee754_sqrtf+0x6e> - 801274c: 2201 movs r2, #1 - 801274e: 4411 add r1, r2 - 8012750: e7be b.n 80126d0 <__ieee754_sqrtf+0x20> - 8012752: bf00 nop - ... - -08012760 <__kernel_cosf>: - 8012760: ee10 3a10 vmov r3, s0 - 8012764: f023 4300 bic.w r3, r3, #2147483648 ; 0x80000000 - 8012768: f1b3 5f48 cmp.w r3, #838860800 ; 0x32000000 - 801276c: da2c bge.n 80127c8 <__kernel_cosf+0x68> - 801276e: eefd 7ac0 vcvt.s32.f32 s15, s0 - 8012772: ee17 3a90 vmov r3, s15 - 8012776: 2b00 cmp r3, #0 - 8012778: d060 beq.n 801283c <__kernel_cosf+0xdc> - 801277a: ee20 7a00 vmul.f32 s14, s0, s0 - 801277e: eddf 4a31 vldr s9, [pc, #196] ; 8012844 <__kernel_cosf+0xe4> - 8012782: ed9f 5a31 vldr s10, [pc, #196] ; 8012848 <__kernel_cosf+0xe8> - 8012786: eddf 5a31 vldr s11, [pc, #196] ; 801284c <__kernel_cosf+0xec> - 801278a: ed9f 6a31 vldr s12, [pc, #196] ; 8012850 <__kernel_cosf+0xf0> - 801278e: eddf 7a31 vldr s15, [pc, #196] ; 8012854 <__kernel_cosf+0xf4> - 8012792: eddf 6a31 vldr s13, [pc, #196] ; 8012858 <__kernel_cosf+0xf8> - 8012796: eea7 5a24 vfma.f32 s10, s14, s9 - 801279a: eee5 5a07 vfma.f32 s11, s10, s14 - 801279e: eea5 6a87 vfma.f32 s12, s11, s14 - 80127a2: eee6 7a07 vfma.f32 s15, s12, s14 - 80127a6: eee7 6a87 vfma.f32 s13, s15, s14 - 80127aa: ee66 6a87 vmul.f32 s13, s13, s14 - 80127ae: ee60 0ac0 vnmul.f32 s1, s1, s0 - 80127b2: eeb6 6a00 vmov.f32 s12, #96 ; 0x60 - 80127b6: eee7 0a26 vfma.f32 s1, s14, s13 - 80127ba: eef7 7a00 vmov.f32 s15, #112 ; 0x70 - 80127be: eed7 0a06 vfnms.f32 s1, s14, s12 - 80127c2: ee37 0ae0 vsub.f32 s0, s15, s1 - 80127c6: 4770 bx lr - 80127c8: ee20 7a00 vmul.f32 s14, s0, s0 - 80127cc: eddf 4a1d vldr s9, [pc, #116] ; 8012844 <__kernel_cosf+0xe4> - 80127d0: ed9f 5a1d vldr s10, [pc, #116] ; 8012848 <__kernel_cosf+0xe8> - 80127d4: eddf 5a1d vldr s11, [pc, #116] ; 801284c <__kernel_cosf+0xec> - 80127d8: ed9f 6a1d vldr s12, [pc, #116] ; 8012850 <__kernel_cosf+0xf0> - 80127dc: eddf 7a1d vldr s15, [pc, #116] ; 8012854 <__kernel_cosf+0xf4> - 80127e0: eddf 6a1d vldr s13, [pc, #116] ; 8012858 <__kernel_cosf+0xf8> - 80127e4: 4a1d ldr r2, [pc, #116] ; (801285c <__kernel_cosf+0xfc>) - 80127e6: eea7 5a24 vfma.f32 s10, s14, s9 - 80127ea: 4293 cmp r3, r2 - 80127ec: eee5 5a07 vfma.f32 s11, s10, s14 - 80127f0: eea5 6a87 vfma.f32 s12, s11, s14 - 80127f4: eee6 7a07 vfma.f32 s15, s12, s14 - 80127f8: eee7 6a87 vfma.f32 s13, s15, s14 - 80127fc: ee66 6a87 vmul.f32 s13, s13, s14 - 8012800: ddd5 ble.n 80127ae <__kernel_cosf+0x4e> - 8012802: 4a17 ldr r2, [pc, #92] ; (8012860 <__kernel_cosf+0x100>) - 8012804: 4293 cmp r3, r2 - 8012806: dc14 bgt.n 8012832 <__kernel_cosf+0xd2> - 8012808: f103 437f add.w r3, r3, #4278190080 ; 0xff000000 - 801280c: ee07 3a90 vmov s15, r3 - 8012810: eeb7 6a00 vmov.f32 s12, #112 ; 0x70 - 8012814: ee36 6a67 vsub.f32 s12, s12, s15 - 8012818: ee60 0ac0 vnmul.f32 s1, s1, s0 - 801281c: eef6 5a00 vmov.f32 s11, #96 ; 0x60 - 8012820: eee7 0a26 vfma.f32 s1, s14, s13 - 8012824: eed7 7a25 vfnms.f32 s15, s14, s11 - 8012828: ee77 7ae0 vsub.f32 s15, s15, s1 - 801282c: ee36 0a67 vsub.f32 s0, s12, s15 - 8012830: 4770 bx lr - 8012832: eeb6 6a07 vmov.f32 s12, #103 ; 0x67 - 8012836: eef5 7a02 vmov.f32 s15, #82 ; 0x52 - 801283a: e7ed b.n 8012818 <__kernel_cosf+0xb8> - 801283c: eeb7 0a00 vmov.f32 s0, #112 ; 0x70 - 8012840: 4770 bx lr - 8012842: bf00 nop - 8012844: ad47d74e .word 0xad47d74e - 8012848: 310f74f6 .word 0x310f74f6 - 801284c: b493f27c .word 0xb493f27c - 8012850: 37d00d01 .word 0x37d00d01 - 8012854: bab60b61 .word 0xbab60b61 - 8012858: 3d2aaaab .word 0x3d2aaaab - 801285c: 3e999999 .word 0x3e999999 - 8012860: 3f480000 .word 0x3f480000 - ... - -08012870 <__kernel_rem_pio2f>: - 8012870: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} - 8012874: ed2d 8b04 vpush {d8-d9} - 8012878: b0d7 sub sp, #348 ; 0x15c - 801287a: 1e5f subs r7, r3, #1 - 801287c: 4cd7 ldr r4, [pc, #860] ; (8012bdc <__kernel_rem_pio2f+0x36c>) - 801287e: 9d64 ldr r5, [sp, #400] ; 0x190 - 8012880: 9302 str r3, [sp, #8] - 8012882: 1ed3 subs r3, r2, #3 - 8012884: bf48 it mi - 8012886: 1d13 addmi r3, r2, #4 - 8012888: f854 6025 ldr.w r6, [r4, r5, lsl #2] - 801288c: 9101 str r1, [sp, #4] - 801288e: 10db asrs r3, r3, #3 - 8012890: ea23 73e3 bic.w r3, r3, r3, asr #31 - 8012894: ea6f 0b03 mvn.w fp, r3 - 8012898: 19b9 adds r1, r7, r6 - 801289a: 9303 str r3, [sp, #12] - 801289c: 4682 mov sl, r0 - 801289e: eb02 0bcb add.w fp, r2, fp, lsl #3 - 80128a2: eba3 0307 sub.w r3, r3, r7 - 80128a6: d414 bmi.n 80128d2 <__kernel_rem_pio2f+0x62> - 80128a8: 4419 add r1, r3 - 80128aa: 9865 ldr r0, [sp, #404] ; 0x194 - 80128ac: 3101 adds r1, #1 - 80128ae: aa1a add r2, sp, #104 ; 0x68 - 80128b0: 2b00 cmp r3, #0 - 80128b2: bfaa itet ge - 80128b4: f850 4023 ldrge.w r4, [r0, r3, lsl #2] - 80128b8: eddf 7acc vldrlt s15, [pc, #816] ; 8012bec <__kernel_rem_pio2f+0x37c> - 80128bc: ee07 4a90 vmovge s15, r4 - 80128c0: f103 0301 add.w r3, r3, #1 - 80128c4: bfa8 it ge - 80128c6: eef8 7ae7 vcvtge.f32.s32 s15, s15 - 80128ca: 428b cmp r3, r1 - 80128cc: ece2 7a01 vstmia r2!, {s15} - 80128d0: d1ee bne.n 80128b0 <__kernel_rem_pio2f+0x40> - 80128d2: 2e00 cmp r6, #0 - 80128d4: db1a blt.n 801290c <__kernel_rem_pio2f+0x9c> - 80128d6: 9b02 ldr r3, [sp, #8] - 80128d8: a91a add r1, sp, #104 ; 0x68 - 80128da: 1c74 adds r4, r6, #1 - 80128dc: eb01 0484 add.w r4, r1, r4, lsl #2 - 80128e0: a842 add r0, sp, #264 ; 0x108 - 80128e2: 009d lsls r5, r3, #2 - 80128e4: 2f00 cmp r7, #0 - 80128e6: f2c0 81ba blt.w 8012c5e <__kernel_rem_pio2f+0x3ee> - 80128ea: eddf 7ac0 vldr s15, [pc, #768] ; 8012bec <__kernel_rem_pio2f+0x37c> - 80128ee: 4652 mov r2, sl - 80128f0: 194b adds r3, r1, r5 - 80128f2: ed33 7a01 vldmdb r3!, {s14} - 80128f6: ecf2 6a01 vldmia r2!, {s13} - 80128fa: 4299 cmp r1, r3 - 80128fc: eee6 7a87 vfma.f32 s15, s13, s14 - 8012900: d1f7 bne.n 80128f2 <__kernel_rem_pio2f+0x82> - 8012902: 3104 adds r1, #4 - 8012904: 42a1 cmp r1, r4 - 8012906: ece0 7a01 vstmia r0!, {s15} - 801290a: d1eb bne.n 80128e4 <__kernel_rem_pio2f+0x74> - 801290c: 9a02 ldr r2, [sp, #8] - 801290e: eddf 8ab4 vldr s17, [pc, #720] ; 8012be0 <__kernel_rem_pio2f+0x370> - 8012912: ed9f 8ab4 vldr s16, [pc, #720] ; 8012be4 <__kernel_rem_pio2f+0x374> - 8012916: f106 4380 add.w r3, r6, #1073741824 ; 0x40000000 - 801291a: 3b01 subs r3, #1 - 801291c: 009b lsls r3, r3, #2 - 801291e: ebc2 7982 rsb r9, r2, r2, lsl #30 - 8012922: aa06 add r2, sp, #24 - 8012924: f103 0804 add.w r8, r3, #4 - 8012928: 4413 add r3, r2 - 801292a: 4490 add r8, r2 - 801292c: 9304 str r3, [sp, #16] - 801292e: ea4f 0989 mov.w r9, r9, lsl #2 - 8012932: 4634 mov r4, r6 - 8012934: 00a5 lsls r5, r4, #2 - 8012936: ab56 add r3, sp, #344 ; 0x158 - 8012938: 442b add r3, r5 - 801293a: 2c00 cmp r4, #0 - 801293c: ed13 0a14 vldr s0, [r3, #-80] ; 0xffffffb0 - 8012940: dd18 ble.n 8012974 <__kernel_rem_pio2f+0x104> - 8012942: a942 add r1, sp, #264 ; 0x108 - 8012944: 194b adds r3, r1, r5 - 8012946: aa05 add r2, sp, #20 - 8012948: ee60 7a28 vmul.f32 s15, s0, s17 - 801294c: eeb0 7a40 vmov.f32 s14, s0 - 8012950: eefd 7ae7 vcvt.s32.f32 s15, s15 - 8012954: ed73 6a01 vldmdb r3!, {s13} - 8012958: eef8 7ae7 vcvt.f32.s32 s15, s15 - 801295c: 428b cmp r3, r1 - 801295e: eea7 7ac8 vfms.f32 s14, s15, s16 - 8012962: ee37 0aa6 vadd.f32 s0, s15, s13 - 8012966: eebd 7ac7 vcvt.s32.f32 s14, s14 - 801296a: ee17 0a10 vmov r0, s14 - 801296e: f842 0f04 str.w r0, [r2, #4]! - 8012972: d1e9 bne.n 8012948 <__kernel_rem_pio2f+0xd8> - 8012974: 4658 mov r0, fp - 8012976: f000 fb33 bl 8012fe0 - 801297a: eeb0 9a40 vmov.f32 s18, s0 - 801297e: eeb4 0a00 vmov.f32 s0, #64 ; 0x40 - 8012982: ee29 0a00 vmul.f32 s0, s18, s0 - 8012986: f000 fac3 bl 8012f10 - 801298a: eef2 7a00 vmov.f32 s15, #32 - 801298e: eea0 9a67 vfms.f32 s18, s0, s15 - 8012992: f1bb 0f00 cmp.w fp, #0 - 8012996: eefd 9ac9 vcvt.s32.f32 s19, s18 - 801299a: eef8 7ae9 vcvt.f32.s32 s15, s19 - 801299e: ee39 9a67 vsub.f32 s18, s18, s15 - 80129a2: f340 8141 ble.w 8012c28 <__kernel_rem_pio2f+0x3b8> - 80129a6: 1e60 subs r0, r4, #1 - 80129a8: aa06 add r2, sp, #24 - 80129aa: f1cb 0308 rsb r3, fp, #8 - 80129ae: f852 1020 ldr.w r1, [r2, r0, lsl #2] - 80129b2: fa41 f203 asr.w r2, r1, r3 - 80129b6: fa02 f303 lsl.w r3, r2, r3 - 80129ba: f10d 0e18 add.w lr, sp, #24 - 80129be: 1ac9 subs r1, r1, r3 - 80129c0: f84e 1020 str.w r1, [lr, r0, lsl #2] - 80129c4: ee19 0a90 vmov r0, s19 - 80129c8: 4410 add r0, r2 - 80129ca: f1cb 0307 rsb r3, fp, #7 - 80129ce: ee09 0a90 vmov s19, r0 - 80129d2: 4119 asrs r1, r3 - 80129d4: 2900 cmp r1, #0 - 80129d6: dd39 ble.n 8012a4c <__kernel_rem_pio2f+0x1dc> - 80129d8: ee19 3a90 vmov r3, s19 - 80129dc: 2c00 cmp r4, #0 - 80129de: f103 0301 add.w r3, r3, #1 - 80129e2: ee09 3a90 vmov s19, r3 - 80129e6: f340 81cb ble.w 8012d80 <__kernel_rem_pio2f+0x510> - 80129ea: 2200 movs r2, #0 - 80129ec: 4610 mov r0, r2 - 80129ee: f10d 0e14 add.w lr, sp, #20 - 80129f2: e008 b.n 8012a06 <__kernel_rem_pio2f+0x196> - 80129f4: f5c3 7c80 rsb ip, r3, #256 ; 0x100 - 80129f8: b113 cbz r3, 8012a00 <__kernel_rem_pio2f+0x190> - 80129fa: f8ce c000 str.w ip, [lr] - 80129fe: 2001 movs r0, #1 - 8012a00: 3201 adds r2, #1 - 8012a02: 4294 cmp r4, r2 - 8012a04: dd0c ble.n 8012a20 <__kernel_rem_pio2f+0x1b0> - 8012a06: f85e 3f04 ldr.w r3, [lr, #4]! - 8012a0a: 2800 cmp r0, #0 - 8012a0c: d0f2 beq.n 80129f4 <__kernel_rem_pio2f+0x184> - 8012a0e: 3201 adds r2, #1 - 8012a10: f1c3 03ff rsb r3, r3, #255 ; 0xff - 8012a14: 4294 cmp r4, r2 - 8012a16: f8ce 3000 str.w r3, [lr] - 8012a1a: f04f 0001 mov.w r0, #1 - 8012a1e: dcf2 bgt.n 8012a06 <__kernel_rem_pio2f+0x196> - 8012a20: f1bb 0f00 cmp.w fp, #0 - 8012a24: dd10 ble.n 8012a48 <__kernel_rem_pio2f+0x1d8> - 8012a26: f1bb 0f01 cmp.w fp, #1 - 8012a2a: f000 8104 beq.w 8012c36 <__kernel_rem_pio2f+0x3c6> - 8012a2e: f1bb 0f02 cmp.w fp, #2 - 8012a32: d109 bne.n 8012a48 <__kernel_rem_pio2f+0x1d8> - 8012a34: 1e62 subs r2, r4, #1 - 8012a36: ab06 add r3, sp, #24 - 8012a38: f10d 0e18 add.w lr, sp, #24 - 8012a3c: f853 3022 ldr.w r3, [r3, r2, lsl #2] - 8012a40: f003 033f and.w r3, r3, #63 ; 0x3f - 8012a44: f84e 3022 str.w r3, [lr, r2, lsl #2] - 8012a48: 2902 cmp r1, #2 - 8012a4a: d059 beq.n 8012b00 <__kernel_rem_pio2f+0x290> - 8012a4c: eeb5 9a40 vcmp.f32 s18, #0.0 - 8012a50: eef1 fa10 vmrs APSR_nzcv, fpscr - 8012a54: d166 bne.n 8012b24 <__kernel_rem_pio2f+0x2b4> - 8012a56: 1e63 subs r3, r4, #1 - 8012a58: 429e cmp r6, r3 - 8012a5a: dc0b bgt.n 8012a74 <__kernel_rem_pio2f+0x204> - 8012a5c: aa06 add r2, sp, #24 - 8012a5e: 4415 add r5, r2 - 8012a60: 2200 movs r2, #0 - 8012a62: f855 0d04 ldr.w r0, [r5, #-4]! - 8012a66: 4545 cmp r5, r8 - 8012a68: ea42 0200 orr.w r2, r2, r0 - 8012a6c: d1f9 bne.n 8012a62 <__kernel_rem_pio2f+0x1f2> - 8012a6e: 2a00 cmp r2, #0 - 8012a70: f040 8170 bne.w 8012d54 <__kernel_rem_pio2f+0x4e4> - 8012a74: 1e73 subs r3, r6, #1 - 8012a76: aa06 add r2, sp, #24 - 8012a78: f852 3023 ldr.w r3, [r2, r3, lsl #2] - 8012a7c: 2b00 cmp r3, #0 - 8012a7e: f040 817c bne.w 8012d7a <__kernel_rem_pio2f+0x50a> - 8012a82: 9b04 ldr r3, [sp, #16] - 8012a84: f04f 0e01 mov.w lr, #1 - 8012a88: f853 2d04 ldr.w r2, [r3, #-4]! - 8012a8c: f10e 0e01 add.w lr, lr, #1 - 8012a90: 2a00 cmp r2, #0 - 8012a92: d0f9 beq.n 8012a88 <__kernel_rem_pio2f+0x218> - 8012a94: 44a6 add lr, r4 - 8012a96: 1c63 adds r3, r4, #1 - 8012a98: 4573 cmp r3, lr - 8012a9a: dc2f bgt.n 8012afc <__kernel_rem_pio2f+0x28c> - 8012a9c: 9a03 ldr r2, [sp, #12] - 8012a9e: 189d adds r5, r3, r2 - 8012aa0: 9a02 ldr r2, [sp, #8] - 8012aa2: f105 4580 add.w r5, r5, #1073741824 ; 0x40000000 - 8012aa6: 18a0 adds r0, r4, r2 - 8012aa8: eb0e 0c02 add.w ip, lr, r2 - 8012aac: 9a65 ldr r2, [sp, #404] ; 0x194 - 8012aae: 3d01 subs r5, #1 - 8012ab0: eb02 0585 add.w r5, r2, r5, lsl #2 - 8012ab4: aa1a add r2, sp, #104 ; 0x68 - 8012ab6: eb02 0080 add.w r0, r2, r0, lsl #2 - 8012aba: eb02 0c8c add.w ip, r2, ip, lsl #2 - 8012abe: aa42 add r2, sp, #264 ; 0x108 - 8012ac0: eb02 0483 add.w r4, r2, r3, lsl #2 - 8012ac4: f855 3f04 ldr.w r3, [r5, #4]! - 8012ac8: ee07 3a90 vmov s15, r3 - 8012acc: eef8 7ae7 vcvt.f32.s32 s15, s15 - 8012ad0: 2f00 cmp r7, #0 - 8012ad2: ece0 7a01 vstmia r0!, {s15} - 8012ad6: eddf 7a45 vldr s15, [pc, #276] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012ada: db0b blt.n 8012af4 <__kernel_rem_pio2f+0x284> - 8012adc: 4652 mov r2, sl - 8012ade: eb00 0109 add.w r1, r0, r9 - 8012ae2: 4603 mov r3, r0 - 8012ae4: ed33 7a01 vldmdb r3!, {s14} - 8012ae8: ecf2 6a01 vldmia r2!, {s13} - 8012aec: 428b cmp r3, r1 - 8012aee: eee6 7a87 vfma.f32 s15, s13, s14 - 8012af2: d1f7 bne.n 8012ae4 <__kernel_rem_pio2f+0x274> - 8012af4: 4560 cmp r0, ip - 8012af6: ece4 7a01 vstmia r4!, {s15} - 8012afa: d1e3 bne.n 8012ac4 <__kernel_rem_pio2f+0x254> - 8012afc: 4674 mov r4, lr - 8012afe: e719 b.n 8012934 <__kernel_rem_pio2f+0xc4> - 8012b00: eeb7 0a00 vmov.f32 s0, #112 ; 0x70 - 8012b04: ee30 9a49 vsub.f32 s18, s0, s18 - 8012b08: 2800 cmp r0, #0 - 8012b0a: d09f beq.n 8012a4c <__kernel_rem_pio2f+0x1dc> - 8012b0c: 4658 mov r0, fp - 8012b0e: 9105 str r1, [sp, #20] - 8012b10: f000 fa66 bl 8012fe0 - 8012b14: ee39 9a40 vsub.f32 s18, s18, s0 - 8012b18: 9905 ldr r1, [sp, #20] - 8012b1a: eeb5 9a40 vcmp.f32 s18, #0.0 - 8012b1e: eef1 fa10 vmrs APSR_nzcv, fpscr - 8012b22: d098 beq.n 8012a56 <__kernel_rem_pio2f+0x1e6> - 8012b24: eeb0 0a49 vmov.f32 s0, s18 - 8012b28: f1cb 0000 rsb r0, fp, #0 - 8012b2c: 9102 str r1, [sp, #8] - 8012b2e: f000 fa57 bl 8012fe0 - 8012b32: ed9f 7a2c vldr s14, [pc, #176] ; 8012be4 <__kernel_rem_pio2f+0x374> - 8012b36: 9902 ldr r1, [sp, #8] - 8012b38: eeb4 0ac7 vcmpe.f32 s0, s14 - 8012b3c: eef1 fa10 vmrs APSR_nzcv, fpscr - 8012b40: f2c0 817e blt.w 8012e40 <__kernel_rem_pio2f+0x5d0> - 8012b44: eddf 7a26 vldr s15, [pc, #152] ; 8012be0 <__kernel_rem_pio2f+0x370> - 8012b48: ee60 7a27 vmul.f32 s15, s0, s15 - 8012b4c: a806 add r0, sp, #24 - 8012b4e: eefd 7ae7 vcvt.s32.f32 s15, s15 - 8012b52: 1c63 adds r3, r4, #1 - 8012b54: eef8 7ae7 vcvt.f32.s32 s15, s15 - 8012b58: f10b 0b08 add.w fp, fp, #8 - 8012b5c: eea7 0ac7 vfms.f32 s0, s15, s14 - 8012b60: eefd 7ae7 vcvt.s32.f32 s15, s15 - 8012b64: eebd 0ac0 vcvt.s32.f32 s0, s0 - 8012b68: ee10 2a10 vmov r2, s0 - 8012b6c: f840 2024 str.w r2, [r0, r4, lsl #2] - 8012b70: ee17 2a90 vmov r2, s15 - 8012b74: f840 2023 str.w r2, [r0, r3, lsl #2] - 8012b78: 4658 mov r0, fp - 8012b7a: eeb7 0a00 vmov.f32 s0, #112 ; 0x70 - 8012b7e: 9303 str r3, [sp, #12] - 8012b80: 9102 str r1, [sp, #8] - 8012b82: f000 fa2d bl 8012fe0 - 8012b86: 9b03 ldr r3, [sp, #12] - 8012b88: 9902 ldr r1, [sp, #8] - 8012b8a: 2b00 cmp r3, #0 - 8012b8c: f2c0 80c7 blt.w 8012d1e <__kernel_rem_pio2f+0x4ae> - 8012b90: f103 0e01 add.w lr, r3, #1 - 8012b94: ea4f 028e mov.w r2, lr, lsl #2 - 8012b98: ac42 add r4, sp, #264 ; 0x108 - 8012b9a: a806 add r0, sp, #24 - 8012b9c: ed9f 7a10 vldr s14, [pc, #64] ; 8012be0 <__kernel_rem_pio2f+0x370> - 8012ba0: 4410 add r0, r2 - 8012ba2: 18a7 adds r7, r4, r2 - 8012ba4: ed70 7a01 vldmdb r0!, {s15} - 8012ba8: eef8 7ae7 vcvt.f32.s32 s15, s15 - 8012bac: ee67 7a80 vmul.f32 s15, s15, s0 - 8012bb0: ee20 0a07 vmul.f32 s0, s0, s14 - 8012bb4: ed67 7a01 vstmdb r7!, {s15} - 8012bb8: 42a7 cmp r7, r4 - 8012bba: d1f3 bne.n 8012ba4 <__kernel_rem_pio2f+0x334> - 8012bbc: 3a04 subs r2, #4 - 8012bbe: 4417 add r7, r2 - 8012bc0: 2500 movs r5, #0 - 8012bc2: 2e00 cmp r6, #0 - 8012bc4: f2c0 80a8 blt.w 8012d18 <__kernel_rem_pio2f+0x4a8> - 8012bc8: 2d00 cmp r5, #0 - 8012bca: f2c0 80a5 blt.w 8012d18 <__kernel_rem_pio2f+0x4a8> - 8012bce: 4c06 ldr r4, [pc, #24] ; (8012be8 <__kernel_rem_pio2f+0x378>) - 8012bd0: eddf 7a06 vldr s15, [pc, #24] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012bd4: 4638 mov r0, r7 - 8012bd6: 2200 movs r2, #0 - 8012bd8: e00c b.n 8012bf4 <__kernel_rem_pio2f+0x384> - 8012bda: bf00 nop - 8012bdc: 08013b00 .word 0x08013b00 - 8012be0: 3b800000 .word 0x3b800000 - 8012be4: 43800000 .word 0x43800000 - 8012be8: 08013b10 .word 0x08013b10 - 8012bec: 00000000 .word 0x00000000 - 8012bf0: 42aa cmp r2, r5 - 8012bf2: dc08 bgt.n 8012c06 <__kernel_rem_pio2f+0x396> - 8012bf4: ecf4 6a01 vldmia r4!, {s13} - 8012bf8: ecb0 7a01 vldmia r0!, {s14} - 8012bfc: 3201 adds r2, #1 - 8012bfe: 4296 cmp r6, r2 - 8012c00: eee6 7a87 vfma.f32 s15, s13, s14 - 8012c04: daf4 bge.n 8012bf0 <__kernel_rem_pio2f+0x380> - 8012c06: aa56 add r2, sp, #344 ; 0x158 - 8012c08: eb02 0285 add.w r2, r2, r5, lsl #2 - 8012c0c: 3501 adds r5, #1 - 8012c0e: 4575 cmp r5, lr - 8012c10: f1a7 0704 sub.w r7, r7, #4 - 8012c14: ed42 7a28 vstr s15, [r2, #-160] ; 0xffffff60 - 8012c18: d1d3 bne.n 8012bc2 <__kernel_rem_pio2f+0x352> - 8012c1a: 9a64 ldr r2, [sp, #400] ; 0x190 - 8012c1c: 2a03 cmp r2, #3 - 8012c1e: d85f bhi.n 8012ce0 <__kernel_rem_pio2f+0x470> - 8012c20: e8df f002 tbb [pc, r2] - 8012c24: b0373767 .word 0xb0373767 - 8012c28: d110 bne.n 8012c4c <__kernel_rem_pio2f+0x3dc> - 8012c2a: 1e63 subs r3, r4, #1 - 8012c2c: aa06 add r2, sp, #24 - 8012c2e: f852 1023 ldr.w r1, [r2, r3, lsl #2] - 8012c32: 1209 asrs r1, r1, #8 - 8012c34: e6ce b.n 80129d4 <__kernel_rem_pio2f+0x164> - 8012c36: 1e62 subs r2, r4, #1 - 8012c38: ab06 add r3, sp, #24 - 8012c3a: f10d 0e18 add.w lr, sp, #24 - 8012c3e: f853 3022 ldr.w r3, [r3, r2, lsl #2] - 8012c42: f003 037f and.w r3, r3, #127 ; 0x7f - 8012c46: f84e 3022 str.w r3, [lr, r2, lsl #2] - 8012c4a: e6fd b.n 8012a48 <__kernel_rem_pio2f+0x1d8> - 8012c4c: eef6 7a00 vmov.f32 s15, #96 ; 0x60 - 8012c50: eeb4 9ae7 vcmpe.f32 s18, s15 - 8012c54: eef1 fa10 vmrs APSR_nzcv, fpscr - 8012c58: da0a bge.n 8012c70 <__kernel_rem_pio2f+0x400> - 8012c5a: 2100 movs r1, #0 - 8012c5c: e6f6 b.n 8012a4c <__kernel_rem_pio2f+0x1dc> - 8012c5e: ed5f 7a1d vldr s15, [pc, #-116] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012c62: 3104 adds r1, #4 - 8012c64: 42a1 cmp r1, r4 - 8012c66: ece0 7a01 vstmia r0!, {s15} - 8012c6a: f47f ae3b bne.w 80128e4 <__kernel_rem_pio2f+0x74> - 8012c6e: e64d b.n 801290c <__kernel_rem_pio2f+0x9c> - 8012c70: ee19 3a90 vmov r3, s19 - 8012c74: 2c00 cmp r4, #0 - 8012c76: f103 0301 add.w r3, r3, #1 - 8012c7a: ee09 3a90 vmov s19, r3 - 8012c7e: bfc8 it gt - 8012c80: 2102 movgt r1, #2 - 8012c82: f73f aeb2 bgt.w 80129ea <__kernel_rem_pio2f+0x17a> - 8012c86: eef7 7a00 vmov.f32 s15, #112 ; 0x70 - 8012c8a: ee37 9ac9 vsub.f32 s18, s15, s18 - 8012c8e: 2102 movs r1, #2 - 8012c90: e6dc b.n 8012a4c <__kernel_rem_pio2f+0x1dc> - 8012c92: aa2e add r2, sp, #184 ; 0xb8 - 8012c94: ed5f 7a2b vldr s15, [pc, #-172] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012c98: eb02 0e8e add.w lr, r2, lr, lsl #2 - 8012c9c: ed3e 7a01 vldmdb lr!, {s14} - 8012ca0: 4596 cmp lr, r2 - 8012ca2: ee77 7a87 vadd.f32 s15, s15, s14 - 8012ca6: d1f9 bne.n 8012c9c <__kernel_rem_pio2f+0x42c> - 8012ca8: 2900 cmp r1, #0 - 8012caa: d043 beq.n 8012d34 <__kernel_rem_pio2f+0x4c4> - 8012cac: eddd 6a2e vldr s13, [sp, #184] ; 0xb8 - 8012cb0: 9a01 ldr r2, [sp, #4] - 8012cb2: eeb1 7a67 vneg.f32 s14, s15 - 8012cb6: 2b00 cmp r3, #0 - 8012cb8: ee76 7ae7 vsub.f32 s15, s13, s15 - 8012cbc: ed82 7a00 vstr s14, [r2] - 8012cc0: dd09 ble.n 8012cd6 <__kernel_rem_pio2f+0x466> - 8012cc2: a82f add r0, sp, #188 ; 0xbc - 8012cc4: 2201 movs r2, #1 - 8012cc6: ecb0 7a01 vldmia r0!, {s14} - 8012cca: 3201 adds r2, #1 - 8012ccc: 4293 cmp r3, r2 - 8012cce: ee77 7a87 vadd.f32 s15, s15, s14 - 8012cd2: daf8 bge.n 8012cc6 <__kernel_rem_pio2f+0x456> - 8012cd4: b109 cbz r1, 8012cda <__kernel_rem_pio2f+0x46a> - 8012cd6: eef1 7a67 vneg.f32 s15, s15 - 8012cda: 9b01 ldr r3, [sp, #4] - 8012cdc: edc3 7a01 vstr s15, [r3, #4] - 8012ce0: ee19 3a90 vmov r3, s19 - 8012ce4: f003 0007 and.w r0, r3, #7 - 8012ce8: b057 add sp, #348 ; 0x15c - 8012cea: ecbd 8b04 vpop {d8-d9} - 8012cee: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} - 8012cf2: aa2e add r2, sp, #184 ; 0xb8 - 8012cf4: ed5f 7a43 vldr s15, [pc, #-268] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012cf8: eb02 0e8e add.w lr, r2, lr, lsl #2 - 8012cfc: ed3e 7a01 vldmdb lr!, {s14} - 8012d00: 3b01 subs r3, #1 - 8012d02: 1c5a adds r2, r3, #1 - 8012d04: ee77 7a87 vadd.f32 s15, s15, s14 - 8012d08: d1f8 bne.n 8012cfc <__kernel_rem_pio2f+0x48c> - 8012d0a: b109 cbz r1, 8012d10 <__kernel_rem_pio2f+0x4a0> - 8012d0c: eef1 7a67 vneg.f32 s15, s15 - 8012d10: 9b01 ldr r3, [sp, #4] - 8012d12: edc3 7a00 vstr s15, [r3] - 8012d16: e7e3 b.n 8012ce0 <__kernel_rem_pio2f+0x470> - 8012d18: ed5f 7a4c vldr s15, [pc, #-304] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012d1c: e773 b.n 8012c06 <__kernel_rem_pio2f+0x396> - 8012d1e: 9a64 ldr r2, [sp, #400] ; 0x190 - 8012d20: 2a03 cmp r2, #3 - 8012d22: d8dd bhi.n 8012ce0 <__kernel_rem_pio2f+0x470> - 8012d24: e8df f002 tbb [pc, r2] - 8012d28: 80020213 .word 0x80020213 - 8012d2c: ed5f 7a51 vldr s15, [pc, #-324] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012d30: 2900 cmp r1, #0 - 8012d32: d1bb bne.n 8012cac <__kernel_rem_pio2f+0x43c> - 8012d34: ed9d 7a2e vldr s14, [sp, #184] ; 0xb8 - 8012d38: 9a01 ldr r2, [sp, #4] - 8012d3a: 2b00 cmp r3, #0 - 8012d3c: edc2 7a00 vstr s15, [r2] - 8012d40: ee77 7a67 vsub.f32 s15, s14, s15 - 8012d44: dcbd bgt.n 8012cc2 <__kernel_rem_pio2f+0x452> - 8012d46: 9b01 ldr r3, [sp, #4] - 8012d48: edc3 7a01 vstr s15, [r3, #4] - 8012d4c: e7c8 b.n 8012ce0 <__kernel_rem_pio2f+0x470> - 8012d4e: ed5f 7a59 vldr s15, [pc, #-356] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012d52: e7da b.n 8012d0a <__kernel_rem_pio2f+0x49a> - 8012d54: aa06 add r2, sp, #24 - 8012d56: f1ab 0b08 sub.w fp, fp, #8 - 8012d5a: f852 2023 ldr.w r2, [r2, r3, lsl #2] - 8012d5e: 2a00 cmp r2, #0 - 8012d60: f47f af0a bne.w 8012b78 <__kernel_rem_pio2f+0x308> - 8012d64: aa06 add r2, sp, #24 - 8012d66: eb02 0283 add.w r2, r2, r3, lsl #2 - 8012d6a: f852 0d04 ldr.w r0, [r2, #-4]! - 8012d6e: 3b01 subs r3, #1 - 8012d70: f1ab 0b08 sub.w fp, fp, #8 - 8012d74: 2800 cmp r0, #0 - 8012d76: d0f8 beq.n 8012d6a <__kernel_rem_pio2f+0x4fa> - 8012d78: e6fe b.n 8012b78 <__kernel_rem_pio2f+0x308> - 8012d7a: f04f 0e01 mov.w lr, #1 - 8012d7e: e689 b.n 8012a94 <__kernel_rem_pio2f+0x224> - 8012d80: 2000 movs r0, #0 - 8012d82: e64d b.n 8012a20 <__kernel_rem_pio2f+0x1b0> - 8012d84: 2b00 cmp r3, #0 - 8012d86: dd4f ble.n 8012e28 <__kernel_rem_pio2f+0x5b8> - 8012d88: 009a lsls r2, r3, #2 - 8012d8a: a856 add r0, sp, #344 ; 0x158 - 8012d8c: 4410 add r0, r2 - 8012d8e: ad2e add r5, sp, #184 ; 0xb8 - 8012d90: 1d14 adds r4, r2, #4 - 8012d92: ed10 7a28 vldr s14, [r0, #-160] ; 0xffffff60 - 8012d96: 442c add r4, r5 - 8012d98: 18a8 adds r0, r5, r2 - 8012d9a: ed70 7a01 vldmdb r0!, {s15} - 8012d9e: ee77 6a27 vadd.f32 s13, s14, s15 - 8012da2: 42a8 cmp r0, r5 - 8012da4: ee77 7ae6 vsub.f32 s15, s15, s13 - 8012da8: ee77 7a27 vadd.f32 s15, s14, s15 - 8012dac: eeb0 7a66 vmov.f32 s14, s13 - 8012db0: ed64 7a01 vstmdb r4!, {s15} - 8012db4: edc0 6a00 vstr s13, [r0] - 8012db8: d1ef bne.n 8012d9a <__kernel_rem_pio2f+0x52a> - 8012dba: 2b01 cmp r3, #1 - 8012dbc: dd34 ble.n 8012e28 <__kernel_rem_pio2f+0x5b8> - 8012dbe: 1d13 adds r3, r2, #4 - 8012dc0: ac56 add r4, sp, #344 ; 0x158 - 8012dc2: 4414 add r4, r2 - 8012dc4: 4403 add r3, r0 - 8012dc6: ed14 7a28 vldr s14, [r4, #-160] ; 0xffffff60 - 8012dca: 4402 add r2, r0 - 8012dcc: ac2f add r4, sp, #188 ; 0xbc - 8012dce: 4618 mov r0, r3 - 8012dd0: ed72 7a01 vldmdb r2!, {s15} - 8012dd4: ee77 6a87 vadd.f32 s13, s15, s14 - 8012dd8: 42a2 cmp r2, r4 - 8012dda: ee77 7ae6 vsub.f32 s15, s15, s13 - 8012dde: ee77 7a87 vadd.f32 s15, s15, s14 - 8012de2: eeb0 7a66 vmov.f32 s14, s13 - 8012de6: ed60 7a01 vstmdb r0!, {s15} - 8012dea: edc2 6a00 vstr s13, [r2] - 8012dee: d1ef bne.n 8012dd0 <__kernel_rem_pio2f+0x560> - 8012df0: ed5f 7a82 vldr s15, [pc, #-520] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012df4: aa30 add r2, sp, #192 ; 0xc0 - 8012df6: ed33 7a01 vldmdb r3!, {s14} - 8012dfa: 4293 cmp r3, r2 - 8012dfc: ee77 7a87 vadd.f32 s15, s15, s14 - 8012e00: d1f9 bne.n 8012df6 <__kernel_rem_pio2f+0x586> - 8012e02: b1a9 cbz r1, 8012e30 <__kernel_rem_pio2f+0x5c0> - 8012e04: eddd 6a2e vldr s13, [sp, #184] ; 0xb8 - 8012e08: ed9d 7a2f vldr s14, [sp, #188] ; 0xbc - 8012e0c: 9a01 ldr r2, [sp, #4] - 8012e0e: eef1 7a67 vneg.f32 s15, s15 - 8012e12: eef1 6a66 vneg.f32 s13, s13 - 8012e16: eeb1 7a47 vneg.f32 s14, s14 - 8012e1a: edc2 7a02 vstr s15, [r2, #8] - 8012e1e: edc2 6a00 vstr s13, [r2] - 8012e22: ed82 7a01 vstr s14, [r2, #4] - 8012e26: e75b b.n 8012ce0 <__kernel_rem_pio2f+0x470> - 8012e28: ed5f 7a90 vldr s15, [pc, #-576] ; 8012bec <__kernel_rem_pio2f+0x37c> - 8012e2c: 2900 cmp r1, #0 - 8012e2e: d1e9 bne.n 8012e04 <__kernel_rem_pio2f+0x594> - 8012e30: 9801 ldr r0, [sp, #4] - 8012e32: 9a2e ldr r2, [sp, #184] ; 0xb8 - 8012e34: 9b2f ldr r3, [sp, #188] ; 0xbc - 8012e36: edc0 7a02 vstr s15, [r0, #8] - 8012e3a: 6002 str r2, [r0, #0] - 8012e3c: 6043 str r3, [r0, #4] - 8012e3e: e74f b.n 8012ce0 <__kernel_rem_pio2f+0x470> - 8012e40: eebd 0ac0 vcvt.s32.f32 s0, s0 - 8012e44: a806 add r0, sp, #24 - 8012e46: ee10 2a10 vmov r2, s0 - 8012e4a: 4623 mov r3, r4 - 8012e4c: f840 2024 str.w r2, [r0, r4, lsl #2] - 8012e50: e692 b.n 8012b78 <__kernel_rem_pio2f+0x308> - 8012e52: bf00 nop - ... - -08012e60 <__kernel_sinf>: - 8012e60: ee10 3a10 vmov r3, s0 - 8012e64: f023 4300 bic.w r3, r3, #2147483648 ; 0x80000000 - 8012e68: f1b3 5f48 cmp.w r3, #838860800 ; 0x32000000 - 8012e6c: da04 bge.n 8012e78 <__kernel_sinf+0x18> - 8012e6e: eefd 7ac0 vcvt.s32.f32 s15, s0 - 8012e72: ee17 3a90 vmov r3, s15 - 8012e76: b323 cbz r3, 8012ec2 <__kernel_sinf+0x62> - 8012e78: ee60 7a00 vmul.f32 s15, s0, s0 - 8012e7c: ed9f 5a15 vldr s10, [pc, #84] ; 8012ed4 <__kernel_sinf+0x74> - 8012e80: eddf 5a15 vldr s11, [pc, #84] ; 8012ed8 <__kernel_sinf+0x78> - 8012e84: ed9f 6a15 vldr s12, [pc, #84] ; 8012edc <__kernel_sinf+0x7c> - 8012e88: eddf 6a15 vldr s13, [pc, #84] ; 8012ee0 <__kernel_sinf+0x80> - 8012e8c: ed9f 7a15 vldr s14, [pc, #84] ; 8012ee4 <__kernel_sinf+0x84> - 8012e90: eee7 5a85 vfma.f32 s11, s15, s10 - 8012e94: ee27 5a80 vmul.f32 s10, s15, s0 - 8012e98: eea5 6aa7 vfma.f32 s12, s11, s15 - 8012e9c: eee6 6a27 vfma.f32 s13, s12, s15 - 8012ea0: eea6 7aa7 vfma.f32 s14, s13, s15 - 8012ea4: b170 cbz r0, 8012ec4 <__kernel_sinf+0x64> - 8012ea6: ee27 7a45 vnmul.f32 s14, s14, s10 - 8012eaa: eef6 6a00 vmov.f32 s13, #96 ; 0x60 - 8012eae: eea0 7aa6 vfma.f32 s14, s1, s13 - 8012eb2: eddf 6a0d vldr s13, [pc, #52] ; 8012ee8 <__kernel_sinf+0x88> - 8012eb6: eed7 0a27 vfnms.f32 s1, s14, s15 - 8012eba: eee5 0a26 vfma.f32 s1, s10, s13 - 8012ebe: ee30 0a60 vsub.f32 s0, s0, s1 - 8012ec2: 4770 bx lr - 8012ec4: eddf 6a09 vldr s13, [pc, #36] ; 8012eec <__kernel_sinf+0x8c> - 8012ec8: eee7 6a87 vfma.f32 s13, s15, s14 - 8012ecc: eea6 0a85 vfma.f32 s0, s13, s10 - 8012ed0: 4770 bx lr - 8012ed2: bf00 nop - 8012ed4: 2f2ec9d3 .word 0x2f2ec9d3 - 8012ed8: b2d72f34 .word 0xb2d72f34 - 8012edc: 3638ef1b .word 0x3638ef1b - 8012ee0: b9500d01 .word 0xb9500d01 - 8012ee4: 3c088889 .word 0x3c088889 - 8012ee8: 3e2aaaab .word 0x3e2aaaab - 8012eec: be2aaaab .word 0xbe2aaaab - -08012ef0 : - 8012ef0: 2000 movs r0, #0 - 8012ef2: 4770 bx lr - ... - -08012f00 : - 8012f00: ee10 3a10 vmov r3, s0 - 8012f04: f023 4300 bic.w r3, r3, #2147483648 ; 0x80000000 - 8012f08: ee00 3a10 vmov s0, r3 - 8012f0c: 4770 bx lr - 8012f0e: bf00 nop - -08012f10 : - 8012f10: ee10 2a10 vmov r2, s0 - 8012f14: f022 4100 bic.w r1, r2, #2147483648 ; 0x80000000 - 8012f18: 0dcb lsrs r3, r1, #23 - 8012f1a: 3b7f subs r3, #127 ; 0x7f - 8012f1c: 2b16 cmp r3, #22 - 8012f1e: dc17 bgt.n 8012f50 - 8012f20: 2b00 cmp r3, #0 - 8012f22: ee10 0a10 vmov r0, s0 - 8012f26: db19 blt.n 8012f5c - 8012f28: 491a ldr r1, [pc, #104] ; (8012f94 ) - 8012f2a: 4119 asrs r1, r3 - 8012f2c: 4211 tst r1, r2 - 8012f2e: d022 beq.n 8012f76 - 8012f30: eddf 7a19 vldr s15, [pc, #100] ; 8012f98 - 8012f34: ee70 7a27 vadd.f32 s15, s0, s15 - 8012f38: eef5 7ac0 vcmpe.f32 s15, #0.0 - 8012f3c: eef1 fa10 vmrs APSR_nzcv, fpscr - 8012f40: dd19 ble.n 8012f76 - 8012f42: 2a00 cmp r2, #0 - 8012f44: db18 blt.n 8012f78 - 8012f46: ea20 0301 bic.w r3, r0, r1 - 8012f4a: ee00 3a10 vmov s0, r3 - 8012f4e: 4770 bx lr - 8012f50: f1b1 4fff cmp.w r1, #2139095040 ; 0x7f800000 - 8012f54: d30f bcc.n 8012f76 - 8012f56: ee30 0a00 vadd.f32 s0, s0, s0 - 8012f5a: 4770 bx lr - 8012f5c: eddf 7a0e vldr s15, [pc, #56] ; 8012f98 - 8012f60: ee70 7a27 vadd.f32 s15, s0, s15 - 8012f64: eef5 7ac0 vcmpe.f32 s15, #0.0 - 8012f68: eef1 fa10 vmrs APSR_nzcv, fpscr - 8012f6c: dd03 ble.n 8012f76 - 8012f6e: 2a00 cmp r2, #0 - 8012f70: db08 blt.n 8012f84 - 8012f72: ed9f 0a0a vldr s0, [pc, #40] ; 8012f9c - 8012f76: 4770 bx lr - 8012f78: f44f 0200 mov.w r2, #8388608 ; 0x800000 - 8012f7c: fa42 f303 asr.w r3, r2, r3 - 8012f80: 4418 add r0, r3 - 8012f82: e7e0 b.n 8012f46 - 8012f84: 2900 cmp r1, #0 - 8012f86: eeff 7a00 vmov.f32 s15, #240 ; 0xf0 - 8012f8a: bf18 it ne - 8012f8c: eeb0 0a67 vmovne.f32 s0, s15 - 8012f90: 4770 bx lr - 8012f92: bf00 nop - 8012f94: 007fffff .word 0x007fffff - 8012f98: 7149f2ca .word 0x7149f2ca - 8012f9c: 00000000 .word 0x00000000 - -08012fa0 <__fpclassifyf>: - 8012fa0: ee10 3a10 vmov r3, s0 - 8012fa4: f033 4000 bics.w r0, r3, #2147483648 ; 0x80000000 - 8012fa8: d101 bne.n 8012fae <__fpclassifyf+0xe> - 8012faa: 2002 movs r0, #2 - 8012fac: 4770 bx lr - 8012fae: f5a0 0300 sub.w r3, r0, #8388608 ; 0x800000 - 8012fb2: f1b3 4ffe cmp.w r3, #2130706432 ; 0x7f000000 - 8012fb6: d201 bcs.n 8012fbc <__fpclassifyf+0x1c> - 8012fb8: 2004 movs r0, #4 - 8012fba: 4770 bx lr - 8012fbc: 4b05 ldr r3, [pc, #20] ; (8012fd4 <__fpclassifyf+0x34>) - 8012fbe: 1e42 subs r2, r0, #1 - 8012fc0: 429a cmp r2, r3 - 8012fc2: d801 bhi.n 8012fc8 <__fpclassifyf+0x28> - 8012fc4: 2003 movs r0, #3 - 8012fc6: 4770 bx lr - 8012fc8: f1a0 40ff sub.w r0, r0, #2139095040 ; 0x7f800000 - 8012fcc: fab0 f080 clz r0, r0 - 8012fd0: 0940 lsrs r0, r0, #5 - 8012fd2: 4770 bx lr - 8012fd4: 007ffffe .word 0x007ffffe - ... - -08012fe0 : - 8012fe0: b508 push {r3, lr} - 8012fe2: ee10 3a10 vmov r3, s0 - 8012fe6: f033 4200 bics.w r2, r3, #2147483648 ; 0x80000000 - 8012fea: ed2d 8b02 vpush {d8} - 8012fee: d011 beq.n 8013014 - 8012ff0: f1b2 4fff cmp.w r2, #2139095040 ; 0x7f800000 - 8012ff4: d211 bcs.n 801301a - 8012ff6: f5b2 0f00 cmp.w r2, #8388608 ; 0x800000 - 8012ffa: d313 bcc.n 8013024 - 8012ffc: 0dd2 lsrs r2, r2, #23 - 8012ffe: 4402 add r2, r0 - 8013000: 2afe cmp r2, #254 ; 0xfe - 8013002: dc2e bgt.n 8013062 - 8013004: 2a00 cmp r2, #0 - 8013006: dd1a ble.n 801303e - 8013008: f023 43ff bic.w r3, r3, #2139095040 ; 0x7f800000 - 801300c: ea43 53c2 orr.w r3, r3, r2, lsl #23 - 8013010: ee00 3a10 vmov s0, r3 - 8013014: ecbd 8b02 vpop {d8} - 8013018: bd08 pop {r3, pc} - 801301a: ecbd 8b02 vpop {d8} - 801301e: ee30 0a00 vadd.f32 s0, s0, s0 - 8013022: bd08 pop {r3, pc} - 8013024: 4b1d ldr r3, [pc, #116] ; (801309c ) - 8013026: eddf 7a1e vldr s15, [pc, #120] ; 80130a0 - 801302a: 4298 cmp r0, r3 - 801302c: ee20 0a27 vmul.f32 s0, s0, s15 - 8013030: db22 blt.n 8013078 - 8013032: ee10 3a10 vmov r3, s0 - 8013036: f3c3 52c7 ubfx r2, r3, #23, #8 - 801303a: 3a19 subs r2, #25 - 801303c: e7df b.n 8012ffe - 801303e: f112 0f16 cmn.w r2, #22 - 8013042: da1e bge.n 8013082 - 8013044: f24c 3350 movw r3, #50000 ; 0xc350 - 8013048: 4298 cmp r0, r3 - 801304a: dc0a bgt.n 8013062 - 801304c: ed9f 8a15 vldr s16, [pc, #84] ; 80130a4 - 8013050: eef0 0a40 vmov.f32 s1, s0 - 8013054: eeb0 0a48 vmov.f32 s0, s16 - 8013058: f000 f82a bl 80130b0 - 801305c: ee20 0a08 vmul.f32 s0, s0, s16 - 8013060: e7d8 b.n 8013014 - 8013062: ed9f 8a11 vldr s16, [pc, #68] ; 80130a8 - 8013066: eef0 0a40 vmov.f32 s1, s0 - 801306a: eeb0 0a48 vmov.f32 s0, s16 - 801306e: f000 f81f bl 80130b0 - 8013072: ee20 0a08 vmul.f32 s0, s0, s16 - 8013076: e7cd b.n 8013014 - 8013078: eddf 0a0a vldr s1, [pc, #40] ; 80130a4 - 801307c: ee20 0a20 vmul.f32 s0, s0, s1 - 8013080: e7c8 b.n 8013014 - 8013082: 3219 adds r2, #25 - 8013084: f023 43ff bic.w r3, r3, #2139095040 ; 0x7f800000 - 8013088: ea43 53c2 orr.w r3, r3, r2, lsl #23 - 801308c: eddf 7a07 vldr s15, [pc, #28] ; 80130ac - 8013090: ee00 3a10 vmov s0, r3 - 8013094: ee20 0a27 vmul.f32 s0, s0, s15 - 8013098: e7bc b.n 8013014 - 801309a: bf00 nop - 801309c: ffff3cb0 .word 0xffff3cb0 - 80130a0: 4c000000 .word 0x4c000000 - 80130a4: 0da24260 .word 0x0da24260 - 80130a8: 7149f2ca .word 0x7149f2ca - 80130ac: 33000000 .word 0x33000000 - -080130b0 : - 80130b0: ee10 3a10 vmov r3, s0 - 80130b4: f023 4200 bic.w r2, r3, #2147483648 ; 0x80000000 - 80130b8: ee10 3a90 vmov r3, s1 - 80130bc: f003 4300 and.w r3, r3, #2147483648 ; 0x80000000 - 80130c0: 4313 orrs r3, r2 - 80130c2: ee00 3a10 vmov s0, r3 - 80130c6: 4770 bx lr - ... - -080130d0 <__errno>: - 80130d0: 4b01 ldr r3, [pc, #4] ; (80130d8 <__errno+0x8>) - 80130d2: 6818 ldr r0, [r3, #0] - 80130d4: 4770 bx lr - 80130d6: bf00 nop - 80130d8: 20000c38 .word 0x20000c38 - 80130dc: 00000000 .word 0x00000000 - -080130e0 : - 80130e0: b470 push {r4, r5, r6} - 80130e2: 0784 lsls r4, r0, #30 - 80130e4: d046 beq.n 8013174 - 80130e6: 1e54 subs r4, r2, #1 - 80130e8: 2a00 cmp r2, #0 - 80130ea: d041 beq.n 8013170 - 80130ec: b2cd uxtb r5, r1 - 80130ee: 4603 mov r3, r0 - 80130f0: e002 b.n 80130f8 - 80130f2: 1e62 subs r2, r4, #1 - 80130f4: b3e4 cbz r4, 8013170 - 80130f6: 4614 mov r4, r2 - 80130f8: f803 5b01 strb.w r5, [r3], #1 - 80130fc: 079a lsls r2, r3, #30 - 80130fe: d1f8 bne.n 80130f2 - 8013100: 2c03 cmp r4, #3 - 8013102: d92e bls.n 8013162 - 8013104: b2cd uxtb r5, r1 - 8013106: ea45 2505 orr.w r5, r5, r5, lsl #8 - 801310a: 2c0f cmp r4, #15 - 801310c: ea45 4505 orr.w r5, r5, r5, lsl #16 - 8013110: d919 bls.n 8013146 - 8013112: f103 0210 add.w r2, r3, #16 - 8013116: 4626 mov r6, r4 - 8013118: 3e10 subs r6, #16 - 801311a: 2e0f cmp r6, #15 - 801311c: f842 5c10 str.w r5, [r2, #-16] - 8013120: f842 5c0c str.w r5, [r2, #-12] - 8013124: f842 5c08 str.w r5, [r2, #-8] - 8013128: f842 5c04 str.w r5, [r2, #-4] - 801312c: f102 0210 add.w r2, r2, #16 - 8013130: d8f2 bhi.n 8013118 - 8013132: f1a4 0210 sub.w r2, r4, #16 - 8013136: f022 020f bic.w r2, r2, #15 - 801313a: f004 040f and.w r4, r4, #15 - 801313e: 3210 adds r2, #16 - 8013140: 2c03 cmp r4, #3 - 8013142: 4413 add r3, r2 - 8013144: d90d bls.n 8013162 - 8013146: 461e mov r6, r3 - 8013148: 4622 mov r2, r4 - 801314a: 3a04 subs r2, #4 - 801314c: 2a03 cmp r2, #3 - 801314e: f846 5b04 str.w r5, [r6], #4 - 8013152: d8fa bhi.n 801314a - 8013154: 1f22 subs r2, r4, #4 - 8013156: f022 0203 bic.w r2, r2, #3 - 801315a: 3204 adds r2, #4 - 801315c: 4413 add r3, r2 - 801315e: f004 0403 and.w r4, r4, #3 - 8013162: b12c cbz r4, 8013170 - 8013164: b2c9 uxtb r1, r1 - 8013166: 441c add r4, r3 - 8013168: f803 1b01 strb.w r1, [r3], #1 - 801316c: 42a3 cmp r3, r4 - 801316e: d1fb bne.n 8013168 - 8013170: bc70 pop {r4, r5, r6} - 8013172: 4770 bx lr - 8013174: 4614 mov r4, r2 - 8013176: 4603 mov r3, r0 - 8013178: e7c2 b.n 8013100 - 801317a: bf00 nop - 801317c: 0000 movs r0, r0 - 801317e: 0000 movs r0, r0 - 8013180: 656c6469 .word 0x656c6469 - ... - -08013190 : - 8013190: 6e69616d 18011600 08480404 1814100c main......H..... - 80131a0: 1e1d1c00 0000201f 00000000 00000000 ..... .......... - -080131b0 : - 80131b0: 0800d7f1 0800d7d1 0800d831 0800d811 ........1....... - 80131c0: 0800d821 0800d801 0800d7e1 0800d7c1 !............... - -080131d0 : - ... - -080131e0 : - ... - -080131f0 : - 80131f0: 00000001 00000000 00000000 00000000 ................ - -08013200 <_stm32_dma_streams>: - 8013200: 40026010 40026008 000b0000 40026028 .`.@.`.@....(`.@ - 8013210: 40026008 000c0106 40026040 40026008 .`.@....@`.@.`.@ - 8013220: 000d0210 40026058 40026008 000e0316 ....X`.@.`.@.... - 8013230: 40026070 4002600c 000f0400 40026088 p`.@.`.@.....`.@ - 8013240: 4002600c 00100506 400260a0 4002600c .`.@.....`.@.`.@ - 8013250: 00110610 400260b8 4002600c 002f0716 .....`.@.`.@../. - 8013260: 40026410 40026408 00380800 40026428 .d.@.d.@..8.(d.@ - 8013270: 40026408 00390906 40026440 40026408 .d.@..9.@d.@.d.@ - 8013280: 003a0a10 40026458 40026408 003b0b16 ..:.Xd.@.d.@..;. - 8013290: 40026470 4002640c 003c0c00 40026488 pd.@.d.@..<..d.@ - 80132a0: 4002640c 00440d06 400264a0 4002640c .d.@..D..d.@.d.@ - 80132b0: 00450e10 400264b8 4002640c 00460f16 ..E..d.@.d.@..F. - -080132c0 : - 80132c0: 00000080 00000140 00000003 00000000 ....@........... - 80132d0: 5f627375 5f646c6c 706d7570 00000000 usb_lld_pump.... - -080132e0 : - 80132e0: 00000000 0800dc01 0800df51 0800e021 ........Q...!... - 80132f0: 00400040 20001230 20001230 00000001 @.@.0.. 0.. .... - 8013300: 20001244 00000000 00000000 00000000 D.. ............ - -08013310 : - 8013310: 2aa0aa00 00000000 ffffabff 40010054 ...*........T..@ - 8013320: 0000ffff 55560000 000aaa00 00082080 ......VU..... .. - 8013330: 00000240 ffffffff 55514515 0000ffff @........EQU.... - 8013340: 04000000 00000040 02208001 00000000 ....@..... ..... - 8013350: ffffffff 54451554 0000ffff 60000000 ....T.ET.......` - 8013360: 00060600 55000100 00000000 ffffffff .......U........ - 8013370: 00555055 00000fff 00000000 00000000 UPU............. - 8013380: 00000040 00000000 ffffffff 00000000 @............... - 8013390: 0000ffff 00000000 00000000 00000000 ................ - 80133a0: 00000000 ffffffff 00000000 0000ffff ................ - ... - 80133c0: ffffffff 00000000 0000ffff 00000000 ................ - ... - 80133dc: ffffffff 00000000 0000ffff 00000000 ................ - ... - 80133f8: ffffffff 00000000 0000ffff 00000000 ................ - ... - 8013410: 6e69614d 72657020 69646f69 00000063 Main periodic... - 8013420: 74726175 20787220 636f7270 00737365 uart rx process. - -08013430 : - 8013430: 00897c32 7768d9ed 59000000 00000000 2|....hw...Y.... - 8013440: 00000000 a8dc9fd6 90aa1718 f6277343 ............Cs'. - 8013450: f4ed68b9 fe09d4de 841c1ce6 990be8dd .h.............. - 8013460: c44e2729 030f0000 00000000 33b79900 )'N............3 - 8013470: 1594763b 007cf300 9e142600 00008f98 ;v....|..&...... - 8013480: 16316a00 96058c8f 3fb7e700 00000036 .j1........?6... - 8013490: 00000000 d09e66af 6c8a5d38 2254b920 .....f..8].l .T" - 80134a0: 04ed7cae 7438804c facbed86 19dccb57 .|..L.8t....W... - 80134b0: df1d2ee2 cbe50655 a86dc301 83482fb5 ....U.....m../H. - 80134c0: 9a67007f 0000c8b2 00000000 00000000 ..g............. - ... - 801350c: 0000b125 00000000 69a30000 00000000 %..........i.... - 801351c: 00000000 55685a00 00b8825f aa31cc08 .....ZhU_.....1. - 801352c: 002e532c 7770636d 6974206d 0072656d ,S..mcpwm timer. - 801353c: 00000000 .... - -08013540 : - 8013540: 00000002 00000000 0800d971 0800d9e1 ........q....... - 8013550: 00400040 20002ca8 20002cbc 00000002 @.@..,. .,. .... - ... - -08013570 : - 8013570: 00000043 080135c0 00000000 00000000 C....5.......... - -08013580 : - 8013580: 00000003 00000000 0800da51 00000000 ........Q....... - 8013590: 00000010 20002a3c 00000000 00000001 ....<*. ........ - ... - -080135b0 : - 80135b0: 08010c41 08010c11 0800d931 00000000 A.......1....... - -080135c0 : - 80135c0: 00430209 c0000102 00040932 02020100 ..C.....2....... - 80135d0: 24050001 05011000 01000124 02022404 ...$....$....$.. - 80135e0: 00062405 82050701 ff000803 00010409 .$.............. - 80135f0: 00000a02 01050700 00004002 02810507 .........@...... - 8013600: 00000040 00000000 00000000 00000000 @............... - -08013610 : - 8013610: 01100112 40000002 57400483 02010200 .......@..@W.... - 8013620: 00000103 00000000 00000000 00000000 ................ - -08013630 : - 8013630: 04090304 00000000 00000000 00000000 ................ - -08013640 : - 8013640: 00530326 004d0054 00630069 006f0072 &.S.T.M.i.c.r.o. - 8013650: 006c0065 00630065 00720074 006e006f e.l.e.c.t.r.o.n. - 8013660: 00630069 00000073 00000000 00000000 i.c.s........... - -08013670 : - 8013670: 00430338 00690068 00690062 0053004f 8.C.h.i.b.i.O.S. - 8013680: 0052002f 00200054 00690056 00740072 /.R.T. .V.i.r.t. - 8013690: 00610075 0020006c 004f0043 0020004d u.a.l. .C.O.M. . - 80136a0: 006f0050 00740072 00000000 00000000 P.o.r.t......... - -080136b0 : - 80136b0: 00330308 00310030 00000000 00000000 ..3.0.1......... - -080136c0 : - 80136c0: 00000004 08013630 00000026 08013640 ....06..&...@6.. - 80136d0: 00000038 08013670 00000008 080136b0 8...p6.......6.. - -080136e0 : - 80136e0: 20000fb0 00020101 00000000 00000000 ... ............ - -080136f0 : - 80136f0: 00000012 08013610 00000000 00000000 .....6.......... - -08013700 : - 8013700: 00080000 00180010 00280020 00380030 ........ .(.0.8. - 8013710: 00480040 00580050 00000000 00000000 @.H.P.X......... - -08013720 : - 8013720: 08000000 08004000 08008000 0800c000 .....@.......... - 8013730: 08010000 08020000 08040000 08060000 ................ - 8013740: 08080000 080a0000 080c0000 080e0000 ................ - 8013750: 74727173 00000066 00000000 00000000 sqrtf........... - -08013760 : - 8013760: 3fc90f00 40490f00 4096cb00 40c90f00 ...?..I@...@...@ - 8013770: 40fb5300 4116cb00 412fed00 41490f00 .S.@...A../A..IA - 8013780: 41623100 417b5300 418a3a00 4196cb00 .1bA.S{A.:.A...A - 8013790: 41a35c00 41afed00 41bc7e00 41c90f00 .\.A...A.~.A...A - 80137a0: 41d5a000 41e23100 41eec200 41fb5300 ...A.1.A...A.S.A - 80137b0: 4203f200 420a3a00 42108300 4216cb00 ...B.:.B...B...B - 80137c0: 421d1400 42235c00 4229a500 422fed00 ...B.\#B..)B../B - 80137d0: 42363600 423c7e00 4242c700 42490f00 .66B.~: - 80137e0: 000000a2 000000f9 00000083 0000006e ............n... - 80137f0: 0000004e 00000044 00000015 00000029 N...D.......)... - 8013800: 000000fc 00000027 00000057 000000d1 ....'...W....... - 8013810: 000000f5 00000034 000000dd 000000c0 ....4........... - 8013820: 000000db 00000062 00000095 00000099 ....b........... - 8013830: 0000003c 00000043 00000090 00000041 <...C.......A... - 8013840: 000000fe 00000051 00000063 000000ab ....Q...c....... - 8013850: 000000de 000000bb 000000c5 00000061 ............a... - 8013860: 000000b7 00000024 0000006e 0000003a ....$...n...:... - 8013870: 00000042 0000004d 000000d2 000000e0 B...M........... - 8013880: 00000006 00000049 0000002e 000000ea ....I........... - 8013890: 00000009 000000d1 00000092 0000001c ................ - 80138a0: 000000fe 0000001d 000000eb 0000001c ................ - 80138b0: 000000b1 00000029 000000a7 0000003e ....).......>... - 80138c0: 000000e8 00000082 00000035 000000f5 ........5....... - 80138d0: 0000002e 000000bb 00000044 00000084 ........D....... - 80138e0: 000000e9 0000009c 00000070 00000026 ........p...&... - 80138f0: 000000b4 0000005f 0000007e 00000041 ...._...~...A... - 8013900: 00000039 00000091 000000d6 00000039 9...........9... - 8013910: 00000083 00000053 00000039 000000f4 ....S...9....... - 8013920: 0000009c 00000084 0000005f 0000008b ........_....... - 8013930: 000000bd 000000f9 00000028 0000003b ........(...;... - 8013940: 0000001f 000000f8 00000097 000000ff ................ - 8013950: 000000de 00000005 00000098 0000000f ................ - 8013960: 000000ef 0000002f 00000011 0000008b ..../........... - 8013970: 0000005a 0000000a 0000006d 0000001f Z.......m....... - 8013980: 0000006d 00000036 0000007e 000000cf m...6...~....... - 8013990: 00000027 000000cb 00000009 000000b7 '............... - 80139a0: 0000004f 00000046 0000003f 00000066 O...F...?...f... - 80139b0: 0000009e 0000005f 000000ea 0000002d ...._.......-... - 80139c0: 00000075 00000027 000000ba 000000c7 u...'........... - 80139d0: 000000eb 000000e5 000000f1 0000007b ............{... - 80139e0: 0000003d 00000007 00000039 000000f7 =.......9....... - 80139f0: 0000008a 00000052 00000092 000000ea ....R........... - 8013a00: 0000006b 000000fb 0000005f 000000b1 k......._....... - 8013a10: 0000001f 0000008d 0000005d 00000008 ........]....... - 8013a20: 00000056 00000003 00000030 00000046 V.......0...F... - 8013a30: 000000fc 0000007b 0000006b 000000ab ....{...k....... - 8013a40: 000000f0 000000cf 000000bc 00000020 ............ ... - 8013a50: 0000009a 000000f4 00000036 0000001d ........6....... - 8013a60: 000000a9 000000e3 00000091 00000061 ............a... - 8013a70: 0000005e 000000e6 0000001b 00000008 ^............... - 8013a80: 00000065 00000099 00000085 0000005f e..........._... - 8013a90: 00000014 000000a0 00000068 00000040 ........h...@... - 8013aa0: 0000008d 000000ff 000000d8 00000080 ................ - 8013ab0: 0000004d 00000073 00000027 00000031 M...s...'...1... - 8013ac0: 00000006 00000006 00000015 00000056 ............V... - 8013ad0: 000000ca 00000073 000000a8 000000c9 ....s........... - 8013ae0: 00000060 000000e2 0000007b 000000c0 `.......{....... - 8013af0: 0000008c 0000006b 00000000 00000000 ....k........... - -08013b00 : - 8013b00: 00000004 00000007 00000009 00000000 ................ - -08013b10 : - 8013b10: 3fc90000 39f00000 37da0000 33a20000 ...?...9...7...3 - 8013b20: 2e840000 2b500000 27c20000 22d00000 ......P+...'..." - 8013b30: 1fc40000 1bc60000 17440000 00000000 ..........D..... - 8013b40: 00000043 C... diff --git a/oroca_bldc_FW/build/oroca_bldc.map b/oroca_bldc_FW/build/oroca_bldc.map deleted file mode 100755 index f36227b..0000000 --- a/oroca_bldc_FW/build/oroca_bldc.map +++ /dev/null @@ -1,5678 +0,0 @@ -Archive member included because of file (symbol) - -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - build/obj/mcpwm.o (cosf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - build/obj/mcpwm.o (sinf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - build/obj/utils.o (fmodf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - build/obj/mcpwm.o (sqrtf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) (__ieee754_fmodf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) (__ieee754_rem_pio2f) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) (__ieee754_sqrtf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) (__kernel_cosf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) (__kernel_rem_pio2f) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) (__kernel_sinf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_lib_ver.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) (__fdlib_version) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) (matherr) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) (fabsf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) (floorf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) (__fpclassifyf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) (scalbnf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) (copysignf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - build/obj/chprintf.o (__aeabi_dsub) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) - build/obj/chprintf.o (__aeabi_dmul) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_fixdfsi.o) - build/obj/chprintf.o (__aeabi_d2iz) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_truncdfsf2.o) - build/obj/chprintf.o (__aeabi_d2f) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) (__errno) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) (_impure_ptr) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memcpy.o) - build/obj/bldc.o (memcpy) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - build/obj/usb.o (memset) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - build/obj/usb_uart.o (vsnprintf) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) (_svfprintf_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (_dtoa_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (_localeconv_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (_malloc_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (memchr) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) (__malloc_lock) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) (_Balloc) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (__fpclassifyd) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strcmp.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) (strcmp) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (strlen) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (__ssprint_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) (_calloc_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) (_free_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) (memmove) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) (_realloc_r) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (__aeabi_dcmpeq) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) (__aeabi_uldivmod) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) (__gnu_uldivmod_helper) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_dvmd_tls.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) (__aeabi_ldiv0) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) (__divdi3) -/Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) (__udivdi3) - -Discarded input sections - - .data 0x0000000000000000 0x0 build/obj/crt0_v7m.o - .bss 0x0000000000000000 0x0 build/obj/crt0_v7m.o - .data 0x0000000000000000 0x0 build/obj/chcoreasm_v7m.o - .bss 0x0000000000000000 0x0 build/obj/chcoreasm_v7m.o - .text 0x0000000000000000 0x0 build/obj/crt1.o - .data 0x0000000000000000 0x0 build/obj/crt1.o - .bss 0x0000000000000000 0x0 build/obj/crt1.o - .text.__early_init - 0x0000000000000000 0x10 build/obj/crt1.o - .text 0x0000000000000000 0x0 build/obj/vectors.o - .data 0x0000000000000000 0x0 build/obj/vectors.o - .bss 0x0000000000000000 0x0 build/obj/vectors.o - .text 0x0000000000000000 0x0 build/obj/chsys.o - .data 0x0000000000000000 0x0 build/obj/chsys.o - .bss 0x0000000000000000 0x0 build/obj/chsys.o - .text.chSysHalt - 0x0000000000000000 0x10 build/obj/chsys.o - .text.chSysIntegrityCheckI - 0x0000000000000000 0xc0 build/obj/chsys.o - .text.chSysGetStatusAndLockX - 0x0000000000000000 0x20 build/obj/chsys.o - .text.chSysRestoreStatusX - 0x0000000000000000 0x20 build/obj/chsys.o - .text.chSysIsCounterWithinX - 0x0000000000000000 0x10 build/obj/chsys.o - .text 0x0000000000000000 0x0 build/obj/chdebug.o - .data 0x0000000000000000 0x0 build/obj/chdebug.o - .bss 0x0000000000000000 0x0 build/obj/chdebug.o - .debug_info 0x0000000000000000 0x719 build/obj/chdebug.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/chdebug.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/chdebug.o - .debug_line 0x0000000000000000 0x1c1 build/obj/chdebug.o - .debug_str 0x0000000000000000 0x5a4 build/obj/chdebug.o - .comment 0x0000000000000000 0x71 build/obj/chdebug.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chdebug.o - .text 0x0000000000000000 0x0 build/obj/chvt.o - .data 0x0000000000000000 0x0 build/obj/chvt.o - .bss 0x0000000000000000 0x0 build/obj/chvt.o - .text 0x0000000000000000 0x0 build/obj/chschd.o - .data 0x0000000000000000 0x0 build/obj/chschd.o - .bss 0x0000000000000000 0x0 build/obj/chschd.o - .text 0x0000000000000000 0x0 build/obj/chthreads.o - .data 0x0000000000000000 0x0 build/obj/chthreads.o - .bss 0x0000000000000000 0x0 build/obj/chthreads.o - .text.chThdStart - 0x0000000000000000 0x20 build/obj/chthreads.o - .text.chThdSetPriority - 0x0000000000000000 0x30 build/obj/chthreads.o - .text.chThdTerminate - 0x0000000000000000 0x20 build/obj/chthreads.o - .text.chThdSleepUntil - 0x0000000000000000 0x30 build/obj/chthreads.o - .text.chThdSleepUntilWindowed - 0x0000000000000000 0x30 build/obj/chthreads.o - .text.chThdYield - 0x0000000000000000 0x30 build/obj/chthreads.o - .text.chThdWait - 0x0000000000000000 0x40 build/obj/chthreads.o - .text.chThdSuspendTimeoutS - 0x0000000000000000 0x20 build/obj/chthreads.o - .text.chThdResumeS - 0x0000000000000000 0x10 build/obj/chthreads.o - .text.chThdResume - 0x0000000000000000 0x30 build/obj/chthreads.o - .text.chThdDequeueNextI - 0x0000000000000000 0x20 build/obj/chthreads.o - .text 0x0000000000000000 0x0 build/obj/chtm.o - .data 0x0000000000000000 0x0 build/obj/chtm.o - .bss 0x0000000000000000 0x0 build/obj/chtm.o - .text.chTMObjectInit - 0x0000000000000000 0x20 build/obj/chtm.o - .text.chTMChainMeasurementToX - 0x0000000000000000 0x40 build/obj/chtm.o - .text 0x0000000000000000 0x0 build/obj/chstats.o - .data 0x0000000000000000 0x0 build/obj/chstats.o - .bss 0x0000000000000000 0x0 build/obj/chstats.o - .debug_info 0x0000000000000000 0x719 build/obj/chstats.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/chstats.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/chstats.o - .debug_line 0x0000000000000000 0x1c1 build/obj/chstats.o - .debug_str 0x0000000000000000 0x5a4 build/obj/chstats.o - .comment 0x0000000000000000 0x71 build/obj/chstats.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chstats.o - .text 0x0000000000000000 0x0 build/obj/chdynamic.o - .data 0x0000000000000000 0x0 build/obj/chdynamic.o - .bss 0x0000000000000000 0x0 build/obj/chdynamic.o - .text.chThdAddRef - 0x0000000000000000 0x20 build/obj/chdynamic.o - .text.chThdRelease - 0x0000000000000000 0x50 build/obj/chdynamic.o - .text.chThdCreateFromHeap - 0x0000000000000000 0x40 build/obj/chdynamic.o - .text.chThdCreateFromMemoryPool - 0x0000000000000000 0x50 build/obj/chdynamic.o - .debug_info 0x0000000000000000 0xdca build/obj/chdynamic.o - .debug_abbrev 0x0000000000000000 0x304 build/obj/chdynamic.o - .debug_loc 0x0000000000000000 0x223 build/obj/chdynamic.o - .debug_aranges - 0x0000000000000000 0x38 build/obj/chdynamic.o - .debug_ranges 0x0000000000000000 0x28 build/obj/chdynamic.o - .debug_line 0x0000000000000000 0x351 build/obj/chdynamic.o - .debug_str 0x0000000000000000 0x742 build/obj/chdynamic.o - .comment 0x0000000000000000 0x71 build/obj/chdynamic.o - .debug_frame 0x0000000000000000 0x84 build/obj/chdynamic.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chdynamic.o - .text 0x0000000000000000 0x0 build/obj/chregistry.o - .data 0x0000000000000000 0x0 build/obj/chregistry.o - .bss 0x0000000000000000 0x0 build/obj/chregistry.o - .text.chRegFirstThread - 0x0000000000000000 0x20 build/obj/chregistry.o - .text.chRegNextThread - 0x0000000000000000 0x30 build/obj/chregistry.o - .text 0x0000000000000000 0x0 build/obj/chsem.o - .data 0x0000000000000000 0x0 build/obj/chsem.o - .bss 0x0000000000000000 0x0 build/obj/chsem.o - .text.chSemObjectInit - 0x0000000000000000 0x10 build/obj/chsem.o - .text.chSemResetI - 0x0000000000000000 0x30 build/obj/chsem.o - .text.chSemReset - 0x0000000000000000 0x20 build/obj/chsem.o - .text.chSemWait - 0x0000000000000000 0x50 build/obj/chsem.o - .text.chSemWaitS - 0x0000000000000000 0x40 build/obj/chsem.o - .text.chSemWaitTimeoutS - 0x0000000000000000 0x40 build/obj/chsem.o - .text.chSemWaitTimeout - 0x0000000000000000 0x20 build/obj/chsem.o - .text.chSemSignal - 0x0000000000000000 0x40 build/obj/chsem.o - .text.chSemSignalI - 0x0000000000000000 0x20 build/obj/chsem.o - .text.chSemAddCounterI - 0x0000000000000000 0x30 build/obj/chsem.o - .text.chSemSignalWait - 0x0000000000000000 0x70 build/obj/chsem.o - .debug_info 0x0000000000000000 0x1173 build/obj/chsem.o - .debug_abbrev 0x0000000000000000 0x437 build/obj/chsem.o - .debug_loc 0x0000000000000000 0x5a8 build/obj/chsem.o - .debug_aranges - 0x0000000000000000 0x70 build/obj/chsem.o - .debug_ranges 0x0000000000000000 0x168 build/obj/chsem.o - .debug_line 0x0000000000000000 0x455 build/obj/chsem.o - .debug_str 0x0000000000000000 0x71e build/obj/chsem.o - .comment 0x0000000000000000 0x71 build/obj/chsem.o - .debug_frame 0x0000000000000000 0x14c build/obj/chsem.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chsem.o - .text 0x0000000000000000 0x0 build/obj/chmtx.o - .data 0x0000000000000000 0x0 build/obj/chmtx.o - .bss 0x0000000000000000 0x0 build/obj/chmtx.o - .text.chMtxLockS - 0x0000000000000000 0xd0 build/obj/chmtx.o - .text.chMtxLock - 0x0000000000000000 0x20 build/obj/chmtx.o - .text.chMtxTryLock - 0x0000000000000000 0x30 build/obj/chmtx.o - .text.chMtxTryLockS - 0x0000000000000000 0x20 build/obj/chmtx.o - .text.chMtxUnlock - 0x0000000000000000 0x70 build/obj/chmtx.o - .text.chMtxUnlockS - 0x0000000000000000 0x50 build/obj/chmtx.o - .text.chMtxUnlockAll - 0x0000000000000000 0x60 build/obj/chmtx.o - .text 0x0000000000000000 0x0 build/obj/chcond.o - .data 0x0000000000000000 0x0 build/obj/chcond.o - .bss 0x0000000000000000 0x0 build/obj/chcond.o - .text.chCondObjectInit - 0x0000000000000000 0x10 build/obj/chcond.o - .text.chCondSignal - 0x0000000000000000 0x30 build/obj/chcond.o - .text.chCondSignalI - 0x0000000000000000 0x20 build/obj/chcond.o - .text.chCondBroadcastI - 0x0000000000000000 0x30 build/obj/chcond.o - .text.chCondBroadcast - 0x0000000000000000 0x20 build/obj/chcond.o - .text.chCondWaitS - 0x0000000000000000 0x50 build/obj/chcond.o - .text.chCondWait - 0x0000000000000000 0x20 build/obj/chcond.o - .text.chCondWaitTimeoutS - 0x0000000000000000 0x50 build/obj/chcond.o - .text.chCondWaitTimeout - 0x0000000000000000 0x20 build/obj/chcond.o - .debug_info 0x0000000000000000 0xfff build/obj/chcond.o - .debug_abbrev 0x0000000000000000 0x3cb build/obj/chcond.o - .debug_loc 0x0000000000000000 0x377 build/obj/chcond.o - .debug_aranges - 0x0000000000000000 0x60 build/obj/chcond.o - .debug_ranges 0x0000000000000000 0xc0 build/obj/chcond.o - .debug_line 0x0000000000000000 0x3f2 build/obj/chcond.o - .debug_str 0x0000000000000000 0x774 build/obj/chcond.o - .comment 0x0000000000000000 0x71 build/obj/chcond.o - .debug_frame 0x0000000000000000 0x108 build/obj/chcond.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chcond.o - .text 0x0000000000000000 0x0 build/obj/chevents.o - .data 0x0000000000000000 0x0 build/obj/chevents.o - .bss 0x0000000000000000 0x0 build/obj/chevents.o - .text.chEvtRegisterMaskWithFlags - 0x0000000000000000 0x30 build/obj/chevents.o - .text.chEvtUnregister - 0x0000000000000000 0x30 build/obj/chevents.o - .text.chEvtGetAndClearEvents - 0x0000000000000000 0x20 build/obj/chevents.o - .text.chEvtAddEvents - 0x0000000000000000 0x20 build/obj/chevents.o - .text.chEvtGetAndClearFlags - 0x0000000000000000 0x20 build/obj/chevents.o - .text.chEvtSignal - 0x0000000000000000 0x20 build/obj/chevents.o - .text.chEvtBroadcastFlags - 0x0000000000000000 0x20 build/obj/chevents.o - .text.chEvtGetAndClearFlagsI - 0x0000000000000000 0x10 build/obj/chevents.o - .text.chEvtDispatch - 0x0000000000000000 0x40 build/obj/chevents.o - .text.chEvtWaitOne - 0x0000000000000000 0x40 build/obj/chevents.o - .text.chEvtWaitAny - 0x0000000000000000 0x40 build/obj/chevents.o - .text.chEvtWaitAll - 0x0000000000000000 0x40 build/obj/chevents.o - .text.chEvtWaitOneTimeout - 0x0000000000000000 0x50 build/obj/chevents.o - .text.chEvtWaitAnyTimeout - 0x0000000000000000 0x50 build/obj/chevents.o - .text.chEvtWaitAllTimeout - 0x0000000000000000 0x50 build/obj/chevents.o - .text 0x0000000000000000 0x0 build/obj/chmsg.o - .data 0x0000000000000000 0x0 build/obj/chmsg.o - .bss 0x0000000000000000 0x0 build/obj/chmsg.o - .text.chMsgSend - 0x0000000000000000 0x40 build/obj/chmsg.o - .text.chMsgWait - 0x0000000000000000 0x40 build/obj/chmsg.o - .text.chMsgRelease - 0x0000000000000000 0x20 build/obj/chmsg.o - .debug_info 0x0000000000000000 0xb97 build/obj/chmsg.o - .debug_abbrev 0x0000000000000000 0x31f build/obj/chmsg.o - .debug_loc 0x0000000000000000 0x179 build/obj/chmsg.o - .debug_aranges - 0x0000000000000000 0x30 build/obj/chmsg.o - .debug_ranges 0x0000000000000000 0x80 build/obj/chmsg.o - .debug_line 0x0000000000000000 0x2dc build/obj/chmsg.o - .debug_str 0x0000000000000000 0x676 build/obj/chmsg.o - .comment 0x0000000000000000 0x71 build/obj/chmsg.o - .debug_frame 0x0000000000000000 0x68 build/obj/chmsg.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chmsg.o - .text 0x0000000000000000 0x0 build/obj/chmboxes.o - .data 0x0000000000000000 0x0 build/obj/chmboxes.o - .bss 0x0000000000000000 0x0 build/obj/chmboxes.o - .text.chMBObjectInit - 0x0000000000000000 0x30 build/obj/chmboxes.o - .text.chMBResetI - 0x0000000000000000 0x30 build/obj/chmboxes.o - .text.chMBReset - 0x0000000000000000 0x20 build/obj/chmboxes.o - .text.chMBPostS - 0x0000000000000000 0x40 build/obj/chmboxes.o - .text.chMBPost - 0x0000000000000000 0x20 build/obj/chmboxes.o - .text.chMBPostI - 0x0000000000000000 0x40 build/obj/chmboxes.o - .text.chMBPostAheadS - 0x0000000000000000 0x40 build/obj/chmboxes.o - .text.chMBPostAhead - 0x0000000000000000 0x20 build/obj/chmboxes.o - .text.chMBPostAheadI - 0x0000000000000000 0x30 build/obj/chmboxes.o - .text.chMBFetchS - 0x0000000000000000 0x40 build/obj/chmboxes.o - .text.chMBFetch - 0x0000000000000000 0x20 build/obj/chmboxes.o - .text.chMBFetchI - 0x0000000000000000 0x40 build/obj/chmboxes.o - .debug_info 0x0000000000000000 0x11c1 build/obj/chmboxes.o - .debug_abbrev 0x0000000000000000 0x3c8 build/obj/chmboxes.o - .debug_loc 0x0000000000000000 0x64c build/obj/chmboxes.o - .debug_aranges - 0x0000000000000000 0x78 build/obj/chmboxes.o - .debug_ranges 0x0000000000000000 0xc8 build/obj/chmboxes.o - .debug_line 0x0000000000000000 0x3e6 build/obj/chmboxes.o - .debug_str 0x0000000000000000 0x744 build/obj/chmboxes.o - .comment 0x0000000000000000 0x71 build/obj/chmboxes.o - .debug_frame 0x0000000000000000 0x180 build/obj/chmboxes.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chmboxes.o - .text 0x0000000000000000 0x0 build/obj/chqueues.o - .data 0x0000000000000000 0x0 build/obj/chqueues.o - .bss 0x0000000000000000 0x0 build/obj/chqueues.o - .text.chIQPutI - 0x0000000000000000 0x40 build/obj/chqueues.o - .text.chOQGetI - 0x0000000000000000 0x40 build/obj/chqueues.o - .text 0x0000000000000000 0x0 build/obj/chmemcore.o - .data 0x0000000000000000 0x0 build/obj/chmemcore.o - .bss 0x0000000000000000 0x0 build/obj/chmemcore.o - .text.chCoreAllocI - 0x0000000000000000 0x30 build/obj/chmemcore.o - .text.chCoreGetStatusX - 0x0000000000000000 0x20 build/obj/chmemcore.o - .text 0x0000000000000000 0x0 build/obj/chheap.o - .data 0x0000000000000000 0x0 build/obj/chheap.o - .bss 0x0000000000000000 0x0 build/obj/chheap.o - .text.chHeapObjectInit - 0x0000000000000000 0x20 build/obj/chheap.o - .text.chHeapAlloc - 0x0000000000000000 0x90 build/obj/chheap.o - .text.chHeapFree - 0x0000000000000000 0xa0 build/obj/chheap.o - .text.chHeapStatus - 0x0000000000000000 0x50 build/obj/chheap.o - .text 0x0000000000000000 0x0 build/obj/chmempools.o - .data 0x0000000000000000 0x0 build/obj/chmempools.o - .bss 0x0000000000000000 0x0 build/obj/chmempools.o - .text.chPoolObjectInit - 0x0000000000000000 0x10 build/obj/chmempools.o - .text.chPoolLoadArray - 0x0000000000000000 0x30 build/obj/chmempools.o - .text.chPoolAllocI - 0x0000000000000000 0x20 build/obj/chmempools.o - .text.chPoolAlloc - 0x0000000000000000 0x30 build/obj/chmempools.o - .text.chPoolFreeI - 0x0000000000000000 0x10 build/obj/chmempools.o - .text.chPoolFree - 0x0000000000000000 0x20 build/obj/chmempools.o - .debug_info 0x0000000000000000 0xcaa build/obj/chmempools.o - .debug_abbrev 0x0000000000000000 0x31b build/obj/chmempools.o - .debug_loc 0x0000000000000000 0x1f7 build/obj/chmempools.o - .debug_aranges - 0x0000000000000000 0x48 build/obj/chmempools.o - .debug_ranges 0x0000000000000000 0xe0 build/obj/chmempools.o - .debug_line 0x0000000000000000 0x358 build/obj/chmempools.o - .debug_str 0x0000000000000000 0x6b7 build/obj/chmempools.o - .comment 0x0000000000000000 0x71 build/obj/chmempools.o - .debug_frame 0x0000000000000000 0x8c build/obj/chmempools.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chmempools.o - .text 0x0000000000000000 0x0 build/obj/chcore.o - .data 0x0000000000000000 0x0 build/obj/chcore.o - .bss 0x0000000000000000 0x0 build/obj/chcore.o - .debug_info 0x0000000000000000 0x719 build/obj/chcore.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/chcore.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/chcore.o - .debug_line 0x0000000000000000 0x1c1 build/obj/chcore.o - .debug_str 0x0000000000000000 0x5ac build/obj/chcore.o - .comment 0x0000000000000000 0x71 build/obj/chcore.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chcore.o - .text 0x0000000000000000 0x0 build/obj/chcore_v7m.o - .data 0x0000000000000000 0x0 build/obj/chcore_v7m.o - .bss 0x0000000000000000 0x0 build/obj/chcore_v7m.o - .text 0x0000000000000000 0x0 build/obj/osal.o - .data 0x0000000000000000 0x0 build/obj/osal.o - .bss 0x0000000000000000 0x0 build/obj/osal.o - .debug_info 0x0000000000000000 0x719 build/obj/osal.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/osal.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/osal.o - .debug_line 0x0000000000000000 0x1c1 build/obj/osal.o - .debug_str 0x0000000000000000 0x5a6 build/obj/osal.o - .comment 0x0000000000000000 0x71 build/obj/osal.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/osal.o - .text 0x0000000000000000 0x0 build/obj/hal.o - .data 0x0000000000000000 0x0 build/obj/hal.o - .bss 0x0000000000000000 0x0 build/obj/hal.o - .text 0x0000000000000000 0x0 build/obj/hal_queues.o - .data 0x0000000000000000 0x0 build/obj/hal_queues.o - .bss 0x0000000000000000 0x0 build/obj/hal_queues.o - .debug_info 0x0000000000000000 0x720 build/obj/hal_queues.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/hal_queues.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/hal_queues.o - .debug_line 0x0000000000000000 0x1c1 build/obj/hal_queues.o - .debug_str 0x0000000000000000 0x5ae build/obj/hal_queues.o - .comment 0x0000000000000000 0x71 build/obj/hal_queues.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/hal_queues.o - .text 0x0000000000000000 0x0 build/obj/hal_mmcsd.o - .data 0x0000000000000000 0x0 build/obj/hal_mmcsd.o - .bss 0x0000000000000000 0x0 build/obj/hal_mmcsd.o - .debug_info 0x0000000000000000 0x720 build/obj/hal_mmcsd.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/hal_mmcsd.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/hal_mmcsd.o - .debug_line 0x0000000000000000 0x1c1 build/obj/hal_mmcsd.o - .debug_str 0x0000000000000000 0x5ad build/obj/hal_mmcsd.o - .comment 0x0000000000000000 0x71 build/obj/hal_mmcsd.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/hal_mmcsd.o - .text 0x0000000000000000 0x0 build/obj/adc.o - .data 0x0000000000000000 0x0 build/obj/adc.o - .bss 0x0000000000000000 0x0 build/obj/adc.o - .debug_info 0x0000000000000000 0x720 build/obj/adc.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/adc.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/adc.o - .debug_line 0x0000000000000000 0x1c1 build/obj/adc.o - .debug_str 0x0000000000000000 0x5a7 build/obj/adc.o - .comment 0x0000000000000000 0x71 build/obj/adc.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/adc.o - .text 0x0000000000000000 0x0 build/obj/can.o - .data 0x0000000000000000 0x0 build/obj/can.o - .bss 0x0000000000000000 0x0 build/obj/can.o - .text.canStart - 0x0000000000000000 0x20 build/obj/can.o - .text.canStop 0x0000000000000000 0x40 build/obj/can.o - .text.canTransmit - 0x0000000000000000 0x50 build/obj/can.o - .text.canReceive - 0x0000000000000000 0x50 build/obj/can.o - .text.canSleep - 0x0000000000000000 0x40 build/obj/can.o - .text.canWakeup - 0x0000000000000000 0x40 build/obj/can.o - .text 0x0000000000000000 0x0 build/obj/dac.o - .data 0x0000000000000000 0x0 build/obj/dac.o - .bss 0x0000000000000000 0x0 build/obj/dac.o - .debug_info 0x0000000000000000 0x720 build/obj/dac.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/dac.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/dac.o - .debug_line 0x0000000000000000 0x1c1 build/obj/dac.o - .debug_str 0x0000000000000000 0x5a7 build/obj/dac.o - .comment 0x0000000000000000 0x71 build/obj/dac.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/dac.o - .text 0x0000000000000000 0x0 build/obj/ext.o - .data 0x0000000000000000 0x0 build/obj/ext.o - .bss 0x0000000000000000 0x0 build/obj/ext.o - .debug_info 0x0000000000000000 0x720 build/obj/ext.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/ext.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/ext.o - .debug_line 0x0000000000000000 0x1c1 build/obj/ext.o - .debug_str 0x0000000000000000 0x5a7 build/obj/ext.o - .comment 0x0000000000000000 0x71 build/obj/ext.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/ext.o - .text 0x0000000000000000 0x0 build/obj/gpt.o - .data 0x0000000000000000 0x0 build/obj/gpt.o - .bss 0x0000000000000000 0x0 build/obj/gpt.o - .debug_info 0x0000000000000000 0x720 build/obj/gpt.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/gpt.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/gpt.o - .debug_line 0x0000000000000000 0x1c1 build/obj/gpt.o - .debug_str 0x0000000000000000 0x5a7 build/obj/gpt.o - .comment 0x0000000000000000 0x71 build/obj/gpt.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/gpt.o - .text 0x0000000000000000 0x0 build/obj/i2c.o - .data 0x0000000000000000 0x0 build/obj/i2c.o - .bss 0x0000000000000000 0x0 build/obj/i2c.o - .text.i2cStart - 0x0000000000000000 0x20 build/obj/i2c.o - .text.i2cStop 0x0000000000000000 0x20 build/obj/i2c.o - .text.i2cGetErrors - 0x0000000000000000 0x10 build/obj/i2c.o - .text.i2cMasterTransmitTimeout - 0x0000000000000000 0x40 build/obj/i2c.o - .text.i2cMasterReceiveTimeout - 0x0000000000000000 0x30 build/obj/i2c.o - .text.i2cAcquireBus - 0x0000000000000000 0x10 build/obj/i2c.o - .text.i2cReleaseBus - 0x0000000000000000 0x10 build/obj/i2c.o - .text 0x0000000000000000 0x0 build/obj/i2s.o - .data 0x0000000000000000 0x0 build/obj/i2s.o - .bss 0x0000000000000000 0x0 build/obj/i2s.o - .debug_info 0x0000000000000000 0x720 build/obj/i2s.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/i2s.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/i2s.o - .debug_line 0x0000000000000000 0x1c1 build/obj/i2s.o - .debug_str 0x0000000000000000 0x5a7 build/obj/i2s.o - .comment 0x0000000000000000 0x71 build/obj/i2s.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/i2s.o - .text 0x0000000000000000 0x0 build/obj/icu.o - .data 0x0000000000000000 0x0 build/obj/icu.o - .bss 0x0000000000000000 0x0 build/obj/icu.o - .text.icuStart - 0x0000000000000000 0x20 build/obj/icu.o - .text.icuStop 0x0000000000000000 0x20 build/obj/icu.o - .text.icuStartCapture - 0x0000000000000000 0x20 build/obj/icu.o - .text.icuWaitCapture - 0x0000000000000000 0x20 build/obj/icu.o - .text.icuStopCapture - 0x0000000000000000 0x20 build/obj/icu.o - .text.icuEnableNotifications - 0x0000000000000000 0x20 build/obj/icu.o - .text.icuDisableNotifications - 0x0000000000000000 0x20 build/obj/icu.o - .text 0x0000000000000000 0x0 build/obj/mac.o - .data 0x0000000000000000 0x0 build/obj/mac.o - .bss 0x0000000000000000 0x0 build/obj/mac.o - .debug_info 0x0000000000000000 0x720 build/obj/mac.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/mac.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/mac.o - .debug_line 0x0000000000000000 0x1c1 build/obj/mac.o - .debug_str 0x0000000000000000 0x5a7 build/obj/mac.o - .comment 0x0000000000000000 0x71 build/obj/mac.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/mac.o - .text 0x0000000000000000 0x0 build/obj/mmc_spi.o - .data 0x0000000000000000 0x0 build/obj/mmc_spi.o - .bss 0x0000000000000000 0x0 build/obj/mmc_spi.o - .debug_info 0x0000000000000000 0x720 build/obj/mmc_spi.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/mmc_spi.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/mmc_spi.o - .debug_line 0x0000000000000000 0x1c1 build/obj/mmc_spi.o - .debug_str 0x0000000000000000 0x5ab build/obj/mmc_spi.o - .comment 0x0000000000000000 0x71 build/obj/mmc_spi.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/mmc_spi.o - .text 0x0000000000000000 0x0 build/obj/pal.o - .data 0x0000000000000000 0x0 build/obj/pal.o - .bss 0x0000000000000000 0x0 build/obj/pal.o - .text.palReadBus - 0x0000000000000000 0x10 build/obj/pal.o - .text.palWriteBus - 0x0000000000000000 0x20 build/obj/pal.o - .text.palSetBusMode - 0x0000000000000000 0x10 build/obj/pal.o - .debug_info 0x0000000000000000 0x9a3 build/obj/pal.o - .debug_abbrev 0x0000000000000000 0x1cd build/obj/pal.o - .debug_loc 0x0000000000000000 0xb0 build/obj/pal.o - .debug_aranges - 0x0000000000000000 0x30 build/obj/pal.o - .debug_ranges 0x0000000000000000 0x20 build/obj/pal.o - .debug_line 0x0000000000000000 0x284 build/obj/pal.o - .debug_str 0x0000000000000000 0x68b build/obj/pal.o - .comment 0x0000000000000000 0x71 build/obj/pal.o - .debug_frame 0x0000000000000000 0x50 build/obj/pal.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/pal.o - .text 0x0000000000000000 0x0 build/obj/pwm.o - .data 0x0000000000000000 0x0 build/obj/pwm.o - .bss 0x0000000000000000 0x0 build/obj/pwm.o - .debug_info 0x0000000000000000 0x720 build/obj/pwm.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/pwm.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/pwm.o - .debug_line 0x0000000000000000 0x1c1 build/obj/pwm.o - .debug_str 0x0000000000000000 0x5a7 build/obj/pwm.o - .comment 0x0000000000000000 0x71 build/obj/pwm.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/pwm.o - .text 0x0000000000000000 0x0 build/obj/rtc.o - .data 0x0000000000000000 0x0 build/obj/rtc.o - .bss 0x0000000000000000 0x0 build/obj/rtc.o - .debug_info 0x0000000000000000 0x720 build/obj/rtc.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/rtc.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/rtc.o - .debug_line 0x0000000000000000 0x1c1 build/obj/rtc.o - .debug_str 0x0000000000000000 0x5a7 build/obj/rtc.o - .comment 0x0000000000000000 0x71 build/obj/rtc.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/rtc.o - .text 0x0000000000000000 0x0 build/obj/sdc.o - .data 0x0000000000000000 0x0 build/obj/sdc.o - .bss 0x0000000000000000 0x0 build/obj/sdc.o - .debug_info 0x0000000000000000 0x720 build/obj/sdc.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/sdc.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/sdc.o - .debug_line 0x0000000000000000 0x1c1 build/obj/sdc.o - .debug_str 0x0000000000000000 0x5a7 build/obj/sdc.o - .comment 0x0000000000000000 0x71 build/obj/sdc.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/sdc.o - .text 0x0000000000000000 0x0 build/obj/serial.o - .data 0x0000000000000000 0x0 build/obj/serial.o - .bss 0x0000000000000000 0x0 build/obj/serial.o - .debug_info 0x0000000000000000 0x720 build/obj/serial.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/serial.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/serial.o - .debug_line 0x0000000000000000 0x1c1 build/obj/serial.o - .debug_str 0x0000000000000000 0x5aa build/obj/serial.o - .comment 0x0000000000000000 0x71 build/obj/serial.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/serial.o - .text 0x0000000000000000 0x0 build/obj/serial_usb.o - .data 0x0000000000000000 0x0 build/obj/serial_usb.o - .bss 0x0000000000000000 0x0 build/obj/serial_usb.o - .text.sduStop 0x0000000000000000 0x60 build/obj/serial_usb.o - .text 0x0000000000000000 0x0 build/obj/spi.o - .data 0x0000000000000000 0x0 build/obj/spi.o - .bss 0x0000000000000000 0x0 build/obj/spi.o - .debug_info 0x0000000000000000 0x720 build/obj/spi.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/spi.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/spi.o - .debug_line 0x0000000000000000 0x1c1 build/obj/spi.o - .debug_str 0x0000000000000000 0x5a7 build/obj/spi.o - .comment 0x0000000000000000 0x71 build/obj/spi.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/spi.o - .text 0x0000000000000000 0x0 build/obj/st.o - .data 0x0000000000000000 0x0 build/obj/st.o - .bss 0x0000000000000000 0x0 build/obj/st.o - .text.stStartAlarm - 0x0000000000000000 0x10 build/obj/st.o - .text.stStopAlarm - 0x0000000000000000 0x10 build/obj/st.o - .text.stSetAlarm - 0x0000000000000000 0x10 build/obj/st.o - .text.stGetAlarm - 0x0000000000000000 0x10 build/obj/st.o - .text 0x0000000000000000 0x0 build/obj/uart.o - .data 0x0000000000000000 0x0 build/obj/uart.o - .bss 0x0000000000000000 0x0 build/obj/uart.o - .text.uartStart - 0x0000000000000000 0x20 build/obj/uart.o - .text.uartStop - 0x0000000000000000 0x20 build/obj/uart.o - .text.uartStartSend - 0x0000000000000000 0x20 build/obj/uart.o - .text.uartStartSendI - 0x0000000000000000 0x10 build/obj/uart.o - .text.uartStopSend - 0x0000000000000000 0x30 build/obj/uart.o - .text.uartStopSendI - 0x0000000000000000 0x20 build/obj/uart.o - .text.uartStartReceive - 0x0000000000000000 0x20 build/obj/uart.o - .text.uartStartReceiveI - 0x0000000000000000 0x10 build/obj/uart.o - .text.uartStopReceive - 0x0000000000000000 0x30 build/obj/uart.o - .text.uartStopReceiveI - 0x0000000000000000 0x20 build/obj/uart.o - .text 0x0000000000000000 0x0 build/obj/usb.o - .data 0x0000000000000000 0x0 build/obj/usb.o - .bss 0x0000000000000000 0x0 build/obj/usb.o - .text.usbStop 0x0000000000000000 0x20 build/obj/usb.o - .text.usbDisableEndpointsI - 0x0000000000000000 0x30 build/obj/usb.o - .text.usbPrepareReceive - 0x0000000000000000 0x20 build/obj/usb.o - .text.usbPrepareTransmit - 0x0000000000000000 0x20 build/obj/usb.o - .text.usbStallReceiveI - 0x0000000000000000 0x20 build/obj/usb.o - .text.usbStallTransmitI - 0x0000000000000000 0x20 build/obj/usb.o - .text 0x0000000000000000 0x0 build/obj/nvic.o - .data 0x0000000000000000 0x0 build/obj/nvic.o - .bss 0x0000000000000000 0x0 build/obj/nvic.o - .text.nvicDisableVector - 0x0000000000000000 0x30 build/obj/nvic.o - .text.nvicClearPending - 0x0000000000000000 0x20 build/obj/nvic.o - .text 0x0000000000000000 0x0 build/obj/stm32_dma.o - .data 0x0000000000000000 0x0 build/obj/stm32_dma.o - .bss 0x0000000000000000 0x0 build/obj/stm32_dma.o - .text.dmaStreamRelease - 0x0000000000000000 0x50 build/obj/stm32_dma.o - .text 0x0000000000000000 0x0 build/obj/hal_lld.o - .data 0x0000000000000000 0x0 build/obj/hal_lld.o - .bss 0x0000000000000000 0x0 build/obj/hal_lld.o - .data.SystemCoreClock - 0x0000000000000000 0x4 build/obj/hal_lld.o - .text 0x0000000000000000 0x0 build/obj/adc_lld.o - .data 0x0000000000000000 0x0 build/obj/adc_lld.o - .bss 0x0000000000000000 0x0 build/obj/adc_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/adc_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/adc_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/adc_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/adc_lld.o - .debug_str 0x0000000000000000 0x5bd build/obj/adc_lld.o - .comment 0x0000000000000000 0x71 build/obj/adc_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/adc_lld.o - .text 0x0000000000000000 0x0 build/obj/ext_lld_isr.o - .data 0x0000000000000000 0x0 build/obj/ext_lld_isr.o - .bss 0x0000000000000000 0x0 build/obj/ext_lld_isr.o - .debug_info 0x0000000000000000 0x720 build/obj/ext_lld_isr.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/ext_lld_isr.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/ext_lld_isr.o - .debug_line 0x0000000000000000 0x1c1 build/obj/ext_lld_isr.o - .debug_str 0x0000000000000000 0x5c1 build/obj/ext_lld_isr.o - .comment 0x0000000000000000 0x71 build/obj/ext_lld_isr.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/ext_lld_isr.o - .text 0x0000000000000000 0x0 build/obj/can_lld.o - .data 0x0000000000000000 0x0 build/obj/can_lld.o - .bss 0x0000000000000000 0x0 build/obj/can_lld.o - .text.can_lld_start - 0x0000000000000000 0x70 build/obj/can_lld.o - .text.can_lld_stop - 0x0000000000000000 0x50 build/obj/can_lld.o - .text.can_lld_is_tx_empty - 0x0000000000000000 0x40 build/obj/can_lld.o - .text.can_lld_transmit - 0x0000000000000000 0x80 build/obj/can_lld.o - .text.can_lld_is_rx_nonempty - 0x0000000000000000 0x40 build/obj/can_lld.o - .text.can_lld_receive - 0x0000000000000000 0xd0 build/obj/can_lld.o - .text.can_lld_sleep - 0x0000000000000000 0x10 build/obj/can_lld.o - .text.can_lld_wakeup - 0x0000000000000000 0x10 build/obj/can_lld.o - .text.canSTM32SetFilters - 0x0000000000000000 0x10 build/obj/can_lld.o - .text 0x0000000000000000 0x0 build/obj/ext_lld.o - .data 0x0000000000000000 0x0 build/obj/ext_lld.o - .bss 0x0000000000000000 0x0 build/obj/ext_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/ext_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/ext_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/ext_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/ext_lld.o - .debug_str 0x0000000000000000 0x5b7 build/obj/ext_lld.o - .comment 0x0000000000000000 0x71 build/obj/ext_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/ext_lld.o - .text 0x0000000000000000 0x0 build/obj/mac_lld.o - .data 0x0000000000000000 0x0 build/obj/mac_lld.o - .bss 0x0000000000000000 0x0 build/obj/mac_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/mac_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/mac_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/mac_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/mac_lld.o - .debug_str 0x0000000000000000 0x5b7 build/obj/mac_lld.o - .comment 0x0000000000000000 0x71 build/obj/mac_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/mac_lld.o - .text 0x0000000000000000 0x0 build/obj/sdc_lld.o - .data 0x0000000000000000 0x0 build/obj/sdc_lld.o - .bss 0x0000000000000000 0x0 build/obj/sdc_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/sdc_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/sdc_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/sdc_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/sdc_lld.o - .debug_str 0x0000000000000000 0x5b7 build/obj/sdc_lld.o - .comment 0x0000000000000000 0x71 build/obj/sdc_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/sdc_lld.o - .text 0x0000000000000000 0x0 build/obj/dac_lld.o - .data 0x0000000000000000 0x0 build/obj/dac_lld.o - .bss 0x0000000000000000 0x0 build/obj/dac_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/dac_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/dac_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/dac_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/dac_lld.o - .debug_str 0x0000000000000000 0x5bd build/obj/dac_lld.o - .comment 0x0000000000000000 0x71 build/obj/dac_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/dac_lld.o - .text 0x0000000000000000 0x0 build/obj/pal_lld.o - .data 0x0000000000000000 0x0 build/obj/pal_lld.o - .bss 0x0000000000000000 0x0 build/obj/pal_lld.o - .text 0x0000000000000000 0x0 build/obj/i2c_lld.o - .data 0x0000000000000000 0x0 build/obj/i2c_lld.o - .bss 0x0000000000000000 0x0 build/obj/i2c_lld.o - .text.i2c_lld_serve_tx_end_irq - 0x0000000000000000 0x40 build/obj/i2c_lld.o - .text.i2c_lld_serve_rx_end_irq - 0x0000000000000000 0x70 build/obj/i2c_lld.o - .text.i2c_lld_start - 0x0000000000000000 0x180 build/obj/i2c_lld.o - .text.i2c_lld_stop - 0x0000000000000000 0x90 build/obj/i2c_lld.o - .text.i2c_lld_master_receive_timeout - 0x0000000000000000 0x80 build/obj/i2c_lld.o - .text.i2c_lld_master_transmit_timeout - 0x0000000000000000 0x90 build/obj/i2c_lld.o - .rodata.str1.4 - 0x0000000000000000 0xc build/obj/i2c_lld.o - .text 0x0000000000000000 0x0 build/obj/usb_lld.o - .data 0x0000000000000000 0x0 build/obj/usb_lld.o - .bss 0x0000000000000000 0x0 build/obj/usb_lld.o - .text.usb_lld_stop - 0x0000000000000000 0x50 build/obj/usb_lld.o - .text.usb_lld_disable_endpoints - 0x0000000000000000 0x10 build/obj/usb_lld.o - .text 0x0000000000000000 0x0 build/obj/rtc_lld.o - .data 0x0000000000000000 0x0 build/obj/rtc_lld.o - .bss 0x0000000000000000 0x0 build/obj/rtc_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/rtc_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/rtc_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/rtc_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/rtc_lld.o - .debug_str 0x0000000000000000 0x5bd build/obj/rtc_lld.o - .comment 0x0000000000000000 0x71 build/obj/rtc_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/rtc_lld.o - .text 0x0000000000000000 0x0 build/obj/i2s_lld.o - .data 0x0000000000000000 0x0 build/obj/i2s_lld.o - .bss 0x0000000000000000 0x0 build/obj/i2s_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/i2s_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/i2s_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/i2s_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/i2s_lld.o - .debug_str 0x0000000000000000 0x5bd build/obj/i2s_lld.o - .comment 0x0000000000000000 0x71 build/obj/i2s_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/i2s_lld.o - .text 0x0000000000000000 0x0 build/obj/spi_lld.o - .data 0x0000000000000000 0x0 build/obj/spi_lld.o - .bss 0x0000000000000000 0x0 build/obj/spi_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/spi_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/spi_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/spi_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/spi_lld.o - .debug_str 0x0000000000000000 0x5bd build/obj/spi_lld.o - .comment 0x0000000000000000 0x71 build/obj/spi_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/spi_lld.o - .text 0x0000000000000000 0x0 build/obj/gpt_lld.o - .data 0x0000000000000000 0x0 build/obj/gpt_lld.o - .bss 0x0000000000000000 0x0 build/obj/gpt_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/gpt_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/gpt_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/gpt_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/gpt_lld.o - .debug_str 0x0000000000000000 0x5bd build/obj/gpt_lld.o - .comment 0x0000000000000000 0x71 build/obj/gpt_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/gpt_lld.o - .text 0x0000000000000000 0x0 build/obj/icu_lld.o - .data 0x0000000000000000 0x0 build/obj/icu_lld.o - .bss 0x0000000000000000 0x0 build/obj/icu_lld.o - .text.icu_lld_wait_edge.isra.0 - 0x0000000000000000 0x40 build/obj/icu_lld.o - .text.icu_lld_start - 0x0000000000000000 0xc0 build/obj/icu_lld.o - .text.icu_lld_stop - 0x0000000000000000 0x40 build/obj/icu_lld.o - .text.icu_lld_start_capture - 0x0000000000000000 0x20 build/obj/icu_lld.o - .text.icu_lld_wait_capture - 0x0000000000000000 0x30 build/obj/icu_lld.o - .text.icu_lld_stop_capture - 0x0000000000000000 0x10 build/obj/icu_lld.o - .text.icu_lld_enable_notifications - 0x0000000000000000 0x40 build/obj/icu_lld.o - .text.icu_lld_disable_notifications - 0x0000000000000000 0x10 build/obj/icu_lld.o - .text 0x0000000000000000 0x0 build/obj/pwm_lld.o - .data 0x0000000000000000 0x0 build/obj/pwm_lld.o - .bss 0x0000000000000000 0x0 build/obj/pwm_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/pwm_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/pwm_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/pwm_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/pwm_lld.o - .debug_str 0x0000000000000000 0x5bd build/obj/pwm_lld.o - .comment 0x0000000000000000 0x71 build/obj/pwm_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/pwm_lld.o - .text 0x0000000000000000 0x0 build/obj/st_lld.o - .data 0x0000000000000000 0x0 build/obj/st_lld.o - .bss 0x0000000000000000 0x0 build/obj/st_lld.o - .text 0x0000000000000000 0x0 build/obj/serial_lld.o - .data 0x0000000000000000 0x0 build/obj/serial_lld.o - .bss 0x0000000000000000 0x0 build/obj/serial_lld.o - .debug_info 0x0000000000000000 0x720 build/obj/serial_lld.o - .debug_abbrev 0x0000000000000000 0x125 build/obj/serial_lld.o - .debug_aranges - 0x0000000000000000 0x18 build/obj/serial_lld.o - .debug_line 0x0000000000000000 0x1c1 build/obj/serial_lld.o - .debug_str 0x0000000000000000 0x5c2 build/obj/serial_lld.o - .comment 0x0000000000000000 0x71 build/obj/serial_lld.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/serial_lld.o - .text 0x0000000000000000 0x0 build/obj/uart_lld.o - .data 0x0000000000000000 0x0 build/obj/uart_lld.o - .bss 0x0000000000000000 0x0 build/obj/uart_lld.o - .text.usart_stop - 0x0000000000000000 0x50 build/obj/uart_lld.o - .text.uart_lld_serve_tx_end_irq - 0x0000000000000000 0x50 build/obj/uart_lld.o - .text.uart_lld_serve_rx_end_irq - 0x0000000000000000 0x90 build/obj/uart_lld.o - .text.uart_lld_start - 0x0000000000000000 0x160 build/obj/uart_lld.o - .text.uart_lld_stop - 0x0000000000000000 0x60 build/obj/uart_lld.o - .text.uart_lld_start_send - 0x0000000000000000 0x40 build/obj/uart_lld.o - .text.uart_lld_stop_send - 0x0000000000000000 0x20 build/obj/uart_lld.o - .text.uart_lld_start_receive - 0x0000000000000000 0x40 build/obj/uart_lld.o - .text.uart_lld_stop_receive - 0x0000000000000000 0x50 build/obj/uart_lld.o - .rodata.str1.4 - 0x0000000000000000 0xc build/obj/uart_lld.o - .text 0x0000000000000000 0x0 build/obj/board.o - .data 0x0000000000000000 0x0 build/obj/board.o - .bss 0x0000000000000000 0x0 build/obj/board.o - .text 0x0000000000000000 0x0 build/obj/chprintf.o - .data 0x0000000000000000 0x0 build/obj/chprintf.o - .bss 0x0000000000000000 0x0 build/obj/chprintf.o - .text.long_to_string_with_divisor - 0x0000000000000000 0x50 build/obj/chprintf.o - .text.chvprintf - 0x0000000000000000 0x410 build/obj/chprintf.o - .text.chsnprintf - 0x0000000000000000 0x60 build/obj/chprintf.o - .rodata.str1.4 - 0x0000000000000000 0x8 build/obj/chprintf.o - .rodata.pow10 0x0000000000000000 0x24 build/obj/chprintf.o - .debug_info 0x0000000000000000 0xd77 build/obj/chprintf.o - .debug_abbrev 0x0000000000000000 0x32b build/obj/chprintf.o - .debug_loc 0x0000000000000000 0xa64 build/obj/chprintf.o - .debug_aranges - 0x0000000000000000 0x30 build/obj/chprintf.o - .debug_ranges 0x0000000000000000 0x50 build/obj/chprintf.o - .debug_line 0x0000000000000000 0x3ea build/obj/chprintf.o - .debug_str 0x0000000000000000 0x6ff build/obj/chprintf.o - .comment 0x0000000000000000 0x71 build/obj/chprintf.o - .debug_frame 0x0000000000000000 0xdc build/obj/chprintf.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/chprintf.o - .text 0x0000000000000000 0x0 build/obj/syscalls.o - .data 0x0000000000000000 0x0 build/obj/syscalls.o - .bss 0x0000000000000000 0x0 build/obj/syscalls.o - .text._read_r 0x0000000000000000 0x10 build/obj/syscalls.o - .text._lseek_r - 0x0000000000000000 0x10 build/obj/syscalls.o - .text._write_r - 0x0000000000000000 0x10 build/obj/syscalls.o - .text._close_r - 0x0000000000000000 0x10 build/obj/syscalls.o - .text._sbrk_r 0x0000000000000000 0x20 build/obj/syscalls.o - .text._fstat_r - 0x0000000000000000 0x20 build/obj/syscalls.o - .text._isatty_r - 0x0000000000000000 0x10 build/obj/syscalls.o - .debug_info 0x0000000000000000 0x12bc build/obj/syscalls.o - .debug_abbrev 0x0000000000000000 0x24b build/obj/syscalls.o - .debug_loc 0x0000000000000000 0x183 build/obj/syscalls.o - .debug_aranges - 0x0000000000000000 0x50 build/obj/syscalls.o - .debug_ranges 0x0000000000000000 0x40 build/obj/syscalls.o - .debug_line 0x0000000000000000 0x343 build/obj/syscalls.o - .debug_str 0x0000000000000000 0xab5 build/obj/syscalls.o - .comment 0x0000000000000000 0x71 build/obj/syscalls.o - .debug_frame 0x0000000000000000 0x98 build/obj/syscalls.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/syscalls.o - .text 0x0000000000000000 0x0 build/obj/bldc.o - .data 0x0000000000000000 0x0 build/obj/bldc.o - .bss 0x0000000000000000 0x0 build/obj/bldc.o - .bss.dbg_AccumTheta - 0x0000000000000000 0x2 build/obj/bldc.o - .data.qVelRef 0x0000000000000000 0x4 build/obj/bldc.o - .bss.dbg_fMea 0x0000000000000000 0x4 build/obj/bldc.o - .bss.dbg_fTheta - 0x0000000000000000 0x4 build/obj/bldc.o - .text 0x0000000000000000 0x0 build/obj/mcpwm.o - .data 0x0000000000000000 0x0 build/obj/mcpwm.o - .bss 0x0000000000000000 0x0 build/obj/mcpwm.o - .text.fputc 0x0000000000000000 0x30 build/obj/mcpwm.o - .text.SetupParm - 0x0000000000000000 0x70 build/obj/mcpwm.o - .text.InitPI 0x0000000000000000 0x10 build/obj/mcpwm.o - .text.DoControl - 0x0000000000000000 0x20 build/obj/mcpwm.o - .text.MeasCompCurr - 0x0000000000000000 0x50 build/obj/mcpwm.o - .text.InitMeasCompCurr - 0x0000000000000000 0x10 build/obj/mcpwm.o - .text.CalcRefVec - 0x0000000000000000 0x50 build/obj/mcpwm.o - .text.stop_pwm_hw - 0x0000000000000000 0x70 build/obj/mcpwm.o - .bss.HallPLLA1 - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Wpll1 0x0000000000000000 0x4 build/obj/mcpwm.o - .data.Kpll 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLdef1 - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Init_Charge_cnt - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.State_Index - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Drive_Status - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Futi 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.count 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLdef - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLlead1 - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Wplli 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Init_Charge_cnt_EN - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLde - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Wpllp 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.SpeedReference - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Hall_KA 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Hall_KB 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.FdWeakParm - 0x0000000000000000 0x5c build/obj/mcpwm.o - .bss.Seq 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Theta_error - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLlead - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.ThetaCal 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLB_filtered - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.VelReq 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLA_old - 0x0000000000000000 0x4 build/obj/mcpwm.o - .data.Ipll 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLqe - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLA_filtered - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.AccumTheta - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLB_old - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLlead2 - 0x0000000000000000 0x4 build/obj/mcpwm.o - .data.Init_Charge_Time - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.HallPLLde1 - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Fault_seq - 0x0000000000000000 0x4 build/obj/mcpwm.o - .bss.Wpll 0x0000000000000000 0x4 build/obj/mcpwm.o - .text 0x0000000000000000 0x0 build/obj/usb_uart.o - .data 0x0000000000000000 0x0 build/obj/usb_uart.o - .bss 0x0000000000000000 0x0 build/obj/usb_uart.o - .text.usb_uart_isActive - 0x0000000000000000 0x20 build/obj/usb_uart.o - .text.usb_uart_printf - 0x0000000000000000 0x40 build/obj/usb_uart.o - .bss.print_buffer.9331 - 0x0000000000000000 0x100 build/obj/usb_uart.o - .text 0x0000000000000000 0x0 build/obj/irq_handlers.o - .data 0x0000000000000000 0x0 build/obj/irq_handlers.o - .bss 0x0000000000000000 0x0 build/obj/irq_handlers.o - .text 0x0000000000000000 0x0 build/obj/comm_usb.o - .data 0x0000000000000000 0x0 build/obj/comm_usb.o - .bss 0x0000000000000000 0x0 build/obj/comm_usb.o - .text 0x0000000000000000 0x0 build/obj/servo_dec.o - .data 0x0000000000000000 0x0 build/obj/servo_dec.o - .bss 0x0000000000000000 0x0 build/obj/servo_dec.o - .text.icuperiodcb - 0x0000000000000000 0x10 build/obj/servo_dec.o - .text.icuwidthcb - 0x0000000000000000 0x170 build/obj/servo_dec.o - .text.servodec_init - 0x0000000000000000 0x50 build/obj/servo_dec.o - .text.servodec_set_pulse_options - 0x0000000000000000 0x20 build/obj/servo_dec.o - .text.servodec_get_servo - 0x0000000000000000 0x20 build/obj/servo_dec.o - .text.servodec_get_time_since_update - 0x0000000000000000 0x20 build/obj/servo_dec.o - .text.servodec_get_last_pulse_len - 0x0000000000000000 0x20 build/obj/servo_dec.o - .data.c2.8829 0x0000000000000000 0x4 build/obj/servo_dec.o - .bss.servo_pos - 0x0000000000000000 0x4 build/obj/servo_dec.o - .data.c1.8828 0x0000000000000000 0x4 build/obj/servo_dec.o - .data.pulse_end - 0x0000000000000000 0x4 build/obj/servo_dec.o - .bss.last_update_time - 0x0000000000000000 0x4 build/obj/servo_dec.o - .bss.last_len_received - 0x0000000000000000 0x4 build/obj/servo_dec.o - .bss.use_median_filter - 0x0000000000000000 0x1 build/obj/servo_dec.o - .data.pulse_start - 0x0000000000000000 0x4 build/obj/servo_dec.o - .bss.done_func - 0x0000000000000000 0x4 build/obj/servo_dec.o - .data.icucfg 0x0000000000000000 0x1c build/obj/servo_dec.o - .debug_info 0x0000000000000000 0x100c build/obj/servo_dec.o - .debug_abbrev 0x0000000000000000 0x3af build/obj/servo_dec.o - .debug_loc 0x0000000000000000 0x138 build/obj/servo_dec.o - .debug_aranges - 0x0000000000000000 0x50 build/obj/servo_dec.o - .debug_ranges 0x0000000000000000 0xc0 build/obj/servo_dec.o - .debug_line 0x0000000000000000 0x3ff build/obj/servo_dec.o - .debug_str 0x0000000000000000 0x994 build/obj/servo_dec.o - .comment 0x0000000000000000 0x71 build/obj/servo_dec.o - .debug_frame 0x0000000000000000 0xe4 build/obj/servo_dec.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/servo_dec.o - .text 0x0000000000000000 0x0 build/obj/utils.o - .data 0x0000000000000000 0x0 build/obj/utils.o - .bss 0x0000000000000000 0x0 build/obj/utils.o - .text.utils_step_towards - 0x0000000000000000 0x40 build/obj/utils.o - .text.utils_calc_ratio - 0x0000000000000000 0x10 build/obj/utils.o - .text.utils_norm_angle - 0x0000000000000000 0x40 build/obj/utils.o - .text.utils_truncate_number - 0x0000000000000000 0x30 build/obj/utils.o - .text.utils_map - 0x0000000000000000 0x20 build/obj/utils.o - .text.utils_deadband - 0x0000000000000000 0x50 build/obj/utils.o - .text.utils_angle_difference - 0x0000000000000000 0x60 build/obj/utils.o - .text 0x0000000000000000 0x0 build/obj/conf_general.o - .data 0x0000000000000000 0x0 build/obj/conf_general.o - .bss 0x0000000000000000 0x0 build/obj/conf_general.o - .text.conf_general_store_app_configuration - 0x0000000000000000 0x60 build/obj/conf_general.o - .text.conf_general_store_mc_configuration - 0x0000000000000000 0x60 build/obj/conf_general.o - .text.conf_general_detect_motor_param - 0x0000000000000000 0x10 build/obj/conf_general.o - .text 0x0000000000000000 0x0 build/obj/eeprom.o - .data 0x0000000000000000 0x0 build/obj/eeprom.o - .bss 0x0000000000000000 0x0 build/obj/eeprom.o - .text.EE_WriteVariable - 0x0000000000000000 0xc0 build/obj/eeprom.o - .text 0x0000000000000000 0x0 build/obj/flash_helper.o - .data 0x0000000000000000 0x0 build/obj/flash_helper.o - .bss 0x0000000000000000 0x0 build/obj/flash_helper.o - .text.flash_helper_erase_new_app - 0x0000000000000000 0x70 build/obj/flash_helper.o - .text.flash_helper_write_new_app_data - 0x0000000000000000 0x60 build/obj/flash_helper.o - .text.flash_helper_jump_to_bootloader - 0x0000000000000000 0x90 build/obj/flash_helper.o - .text 0x0000000000000000 0x0 build/obj/hw_oroca.o - .data 0x0000000000000000 0x0 build/obj/hw_oroca.o - .bss 0x0000000000000000 0x0 build/obj/hw_oroca.o - .text.hw_start_i2c - 0x0000000000000000 0x50 build/obj/hw_oroca.o - .text.hw_stop_i2c - 0x0000000000000000 0x50 build/obj/hw_oroca.o - .text.hw_try_restore_i2c - 0x0000000000000000 0xd0 build/obj/hw_oroca.o - .bss.i2c_running - 0x0000000000000000 0x1 build/obj/hw_oroca.o - .rodata.i2cfg 0x0000000000000000 0xc build/obj/hw_oroca.o - .text 0x0000000000000000 0x0 build/obj/misc.o - .data 0x0000000000000000 0x0 build/obj/misc.o - .bss 0x0000000000000000 0x0 build/obj/misc.o - .text.NVIC_PriorityGroupConfig - 0x0000000000000000 0x20 build/obj/misc.o - .text.NVIC_SetVectorTable - 0x0000000000000000 0x20 build/obj/misc.o - .text.NVIC_SystemLPConfig - 0x0000000000000000 0x20 build/obj/misc.o - .text.SysTick_CLKSourceConfig - 0x0000000000000000 0x20 build/obj/misc.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_adc.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_adc.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_adc.o - .text.ADC_DeInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_StructInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_CommonStructInit - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_AnalogWatchdogCmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_AnalogWatchdogThresholdsConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_AnalogWatchdogSingleChannelConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_TempSensorVrefintCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_VBATCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_SoftwareStartConv - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_GetSoftwareStartConvStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_EOCOnEachRegularChannelCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_ContinuousModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_DiscModeChannelCountConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_DiscModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_GetConversionValue - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_GetMultiModeConversionValue - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_DMACmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_DMARequestAfterLastTransferCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_SetInjectedOffset - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_SoftwareStartInjectedConv - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_GetSoftwareStartInjectedConvCmdStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_AutoInjectedConvCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_InjectedDiscModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text.ADC_GetFlagStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_ClearFlag - 0x0000000000000000 0x10 build/obj/stm32f4xx_adc.o - .text.ADC_GetITStatus - 0x0000000000000000 0x20 build/obj/stm32f4xx_adc.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_dma.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_dma.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_dma.o - .text.DMA_DeInit - 0x0000000000000000 0x130 build/obj/stm32f4xx_dma.o - .text.DMA_StructInit - 0x0000000000000000 0x30 build/obj/stm32f4xx_dma.o - .text.DMA_PeriphIncOffsetSizeConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_dma.o - .text.DMA_FlowControllerConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_dma.o - .text.DMA_SetCurrDataCounter - 0x0000000000000000 0x10 build/obj/stm32f4xx_dma.o - .text.DMA_GetCurrDataCounter - 0x0000000000000000 0x10 build/obj/stm32f4xx_dma.o - .text.DMA_DoubleBufferModeConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_dma.o - .text.DMA_DoubleBufferModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_dma.o - .text.DMA_MemoryTargetConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_dma.o - .text.DMA_GetCurrentMemoryTarget - 0x0000000000000000 0x10 build/obj/stm32f4xx_dma.o - .text.DMA_GetCmdStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_dma.o - .text.DMA_GetFIFOStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_dma.o - .text.DMA_GetFlagStatus - 0x0000000000000000 0x40 build/obj/stm32f4xx_dma.o - .text.DMA_ClearFlag - 0x0000000000000000 0x40 build/obj/stm32f4xx_dma.o - .text.DMA_GetITStatus - 0x0000000000000000 0x50 build/obj/stm32f4xx_dma.o - .text.DMA_ClearITPendingBit - 0x0000000000000000 0x40 build/obj/stm32f4xx_dma.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_exti.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_exti.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_exti.o - .text.EXTI_DeInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_exti.o - .text.EXTI_Init - 0x0000000000000000 0x80 build/obj/stm32f4xx_exti.o - .text.EXTI_StructInit - 0x0000000000000000 0x10 build/obj/stm32f4xx_exti.o - .text.EXTI_GenerateSWInterrupt - 0x0000000000000000 0x10 build/obj/stm32f4xx_exti.o - .text.EXTI_GetFlagStatus - 0x0000000000000000 0x20 build/obj/stm32f4xx_exti.o - .text.EXTI_ClearFlag - 0x0000000000000000 0x10 build/obj/stm32f4xx_exti.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_flash.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_flash.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_flash.o - .text.FLASH_SetLatency - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_PrefetchBufferCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_InstructionCacheCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_DataCacheCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_InstructionCacheReset - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_DataCacheReset - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_Lock - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_Unlock - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_Lock - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_PCROPSelectionConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_BootConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_BORConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_GetUser - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_GetWRP - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_GetWRP1 - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_GetPCROP - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_GetPCROP1 - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_GetRDP - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_GetBOR - 0x0000000000000000 0x10 build/obj/stm32f4xx_flash.o - .text.FLASH_ITConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_GetFlagStatus - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_EraseAllSectors - 0x0000000000000000 0x60 build/obj/stm32f4xx_flash.o - .text.FLASH_EraseAllBank1Sectors - 0x0000000000000000 0x60 build/obj/stm32f4xx_flash.o - .text.FLASH_EraseAllBank2Sectors - 0x0000000000000000 0x60 build/obj/stm32f4xx_flash.o - .text.FLASH_ProgramDoubleWord - 0x0000000000000000 0x50 build/obj/stm32f4xx_flash.o - .text.FLASH_ProgramWord - 0x0000000000000000 0x40 build/obj/stm32f4xx_flash.o - .text.FLASH_ProgramByte - 0x0000000000000000 0x40 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_WRPConfig - 0x0000000000000000 0x30 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_WRP1Config - 0x0000000000000000 0x30 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_PCROPConfig - 0x0000000000000000 0x30 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_PCROP1Config - 0x0000000000000000 0x30 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_RDPConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_UserConfig - 0x0000000000000000 0x30 build/obj/stm32f4xx_flash.o - .text.FLASH_OB_Launch - 0x0000000000000000 0x20 build/obj/stm32f4xx_flash.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_rcc.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_rcc.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_rcc.o - .text.RCC_DeInit - 0x0000000000000000 0x40 build/obj/stm32f4xx_rcc.o - .text.RCC_HSEConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_WaitForHSEStartUp - 0x0000000000000000 0x40 build/obj/stm32f4xx_rcc.o - .text.RCC_AdjustHSICalibrationValue - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_HSICmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_LSEConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_LSICmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_PLLCmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_PLLI2SCmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_PLLSAICmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_ClockSecuritySystemCmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_MCO1Config - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_MCO2Config - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_SYSCLKConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_GetSYSCLKSource - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_HCLKConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_PCLK1Config - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_PCLK2Config - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_GetClocksFreq - 0x0000000000000000 0xa0 build/obj/stm32f4xx_rcc.o - .text.RCC_RTCCLKConfig - 0x0000000000000000 0x30 build/obj/stm32f4xx_rcc.o - .text.RCC_RTCCLKCmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_BackupResetCmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_TIMCLKPresConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_AHB2PeriphClockCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_AHB1PeriphResetCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_AHB2PeriphResetCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_AHB1PeriphClockLPModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_AHB2PeriphClockLPModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_APB1PeriphClockLPModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_APB2PeriphClockLPModeCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_LSEModeConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_ITConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_GetFlagStatus - 0x0000000000000000 0x40 build/obj/stm32f4xx_rcc.o - .text.RCC_ClearFlag - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text.RCC_GetITStatus - 0x0000000000000000 0x20 build/obj/stm32f4xx_rcc.o - .text.RCC_ClearITPendingBit - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .data.APBAHBPrescTable - 0x0000000000000000 0x10 build/obj/stm32f4xx_rcc.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_syscfg.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_syscfg.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_syscfg.o - .text.SYSCFG_DeInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_syscfg.o - .text.SYSCFG_MemoryRemapConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_syscfg.o - .text.SYSCFG_MemorySwappingBank - 0x0000000000000000 0x10 build/obj/stm32f4xx_syscfg.o - .text.SYSCFG_EXTILineConfig - 0x0000000000000000 0x30 build/obj/stm32f4xx_syscfg.o - .text.SYSCFG_ETH_MediaInterfaceConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_syscfg.o - .text.SYSCFG_CompensationCellCmd - 0x0000000000000000 0x10 build/obj/stm32f4xx_syscfg.o - .text.SYSCFG_GetCompensationCellStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_syscfg.o - .debug_info 0x0000000000000000 0x2d8 build/obj/stm32f4xx_syscfg.o - .debug_abbrev 0x0000000000000000 0x169 build/obj/stm32f4xx_syscfg.o - .debug_loc 0x0000000000000000 0xa6 build/obj/stm32f4xx_syscfg.o - .debug_aranges - 0x0000000000000000 0x50 build/obj/stm32f4xx_syscfg.o - .debug_ranges 0x0000000000000000 0x40 build/obj/stm32f4xx_syscfg.o - .debug_line 0x0000000000000000 0x22f build/obj/stm32f4xx_syscfg.o - .debug_str 0x0000000000000000 0x3e8 build/obj/stm32f4xx_syscfg.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_syscfg.o - .debug_frame 0x0000000000000000 0x9c build/obj/stm32f4xx_syscfg.o - .ARM.attributes - 0x0000000000000000 0x39 build/obj/stm32f4xx_syscfg.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_tim.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_tim.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_tim.o - .text.TIM_TimeBaseStructInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_PrescalerConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_CounterModeConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_SetCounter - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_SetAutoreload - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_GetCounter - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_GetPrescaler - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_UpdateDisableConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_UpdateRequestConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SelectOnePulseMode - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SetClockDivision - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_OCStructInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SelectOCxM - 0x0000000000000000 0x50 build/obj/stm32f4xx_tim.o - .text.TIM_SetCompare1 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_SetCompare2 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_SetCompare3 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_SetCompare4 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ForcedOC1Config - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ForcedOC2Config - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_ForcedOC3Config - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ForcedOC4Config - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_OC1FastConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_OC2FastConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_OC3FastConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_OC4FastConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_ClearOC1Ref - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ClearOC2Ref - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ClearOC3Ref - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ClearOC4Ref - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_OC1PolarityConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_OC1NPolarityConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_OC2PolarityConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_OC2NPolarityConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_OC3PolarityConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_OC3NPolarityConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_OC4PolarityConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_CCxCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_CCxNCmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_ICInit - 0x0000000000000000 0x140 build/obj/stm32f4xx_tim.o - .text.TIM_ICStructInit - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_PWMIConfig - 0x0000000000000000 0x150 build/obj/stm32f4xx_tim.o - .text.TIM_GetCapture1 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_GetCapture2 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_GetCapture3 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_GetCapture4 - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_SetIC1Prescaler - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SetIC2Prescaler - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SetIC3Prescaler - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SetIC4Prescaler - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_BDTRStructInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SelectCOM - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_ITConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_GenerateEvent - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_GetFlagStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ClearFlag - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_GetITStatus - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_DMAConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_DMACmd - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_SelectCCDMA - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_InternalClockConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text.TIM_ITRxExternalClockConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_TIxExternalClockConfig - 0x0000000000000000 0x80 build/obj/stm32f4xx_tim.o - .text.TIM_ETRClockMode1Config - 0x0000000000000000 0x30 build/obj/stm32f4xx_tim.o - .text.TIM_ETRClockMode2Config - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_ETRConfig - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_EncoderInterfaceConfig - 0x0000000000000000 0x40 build/obj/stm32f4xx_tim.o - .text.TIM_SelectHallSensor - 0x0000000000000000 0x20 build/obj/stm32f4xx_tim.o - .text.TIM_RemapConfig - 0x0000000000000000 0x10 build/obj/stm32f4xx_tim.o - .text 0x0000000000000000 0x0 build/obj/stm32f4xx_wwdg.o - .data 0x0000000000000000 0x0 build/obj/stm32f4xx_wwdg.o - .bss 0x0000000000000000 0x0 build/obj/stm32f4xx_wwdg.o - .text.WWDG_DeInit - 0x0000000000000000 0x20 build/obj/stm32f4xx_wwdg.o - .text.WWDG_EnableIT - 0x0000000000000000 0x10 build/obj/stm32f4xx_wwdg.o - .text.WWDG_GetFlagStatus - 0x0000000000000000 0x10 build/obj/stm32f4xx_wwdg.o - .text.WWDG_ClearFlag - 0x0000000000000000 0x10 build/obj/stm32f4xx_wwdg.o - .text 0x0000000000000000 0x0 build/obj/main.o - .data 0x0000000000000000 0x0 build/obj/main.o - .bss 0x0000000000000000 0x0 build/obj/main.o - .text._ZN5cTest5printEv - 0x0000000000000000 0x10 build/obj/main.o - .text._Z9main_initv - 0x0000000000000000 0x10 build/obj/main.o - .bss.test 0x0000000000000000 0x4 build/obj/main.o - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - .text.fmodf 0x0000000000000000 0xcc /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - .rodata.str1.4 - 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - .debug_frame 0x0000000000000000 0x50 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - .text.__ieee754_fmodf - 0x0000000000000000 0x11c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - .rodata.Zero 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - .debug_frame 0x0000000000000000 0x3c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_lib_ver.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_lib_ver.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_lib_ver.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) - .text 0x0000000000000000 0x50 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_fixdfsi.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_fixdfsi.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_fixdfsi.o) - .ARM.attributes - 0x0000000000000000 0x22 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_fixdfsi.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_truncdfsf2.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_truncdfsf2.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - .rodata._global_impure_ptr - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memcpy.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memcpy.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - .text._vsnprintf_r - 0x0000000000000000 0x74 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - .text.vsnprintf - 0x0000000000000000 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - .debug_frame 0x0000000000000000 0x60 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .text._svfprintf_r - 0x0000000000000000 0x14d0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .rodata.zeroes.6916 - 0x0000000000000000 0x10 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .rodata.str1.4 - 0x0000000000000000 0x44 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .rodata.blanks.6915 - 0x0000000000000000 0x10 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .debug_frame 0x0000000000000000 0x40 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .text.quorem 0x0000000000000000 0x12c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .text._dtoa_r 0x0000000000000000 0xea8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .rodata.str1.4 - 0x0000000000000000 0x14 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .debug_frame 0x0000000000000000 0x88 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text._setlocale_r - 0x0000000000000000 0x44 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text.__locale_charset - 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text.__locale_mb_cur_max - 0x0000000000000000 0xc /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text.__locale_msgcharset - 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text.__locale_cjk_lang - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text._localeconv_r - 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text.setlocale - 0x0000000000000000 0x10 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text.localeconv - 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .data.lc_message_charset - 0x0000000000000000 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .bss._PathLocale - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .bss.__nlocale_changed - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .bss.__mlocale_changed - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .data.lconv 0x0000000000000000 0x38 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .rodata.str1.4 - 0x0000000000000000 0x14 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .data.lc_ctype_charset - 0x0000000000000000 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .data.__mb_cur_max - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .debug_frame 0x0000000000000000 0x9c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .text._malloc_r - 0x0000000000000000 0x524 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .data.__malloc_av_ - 0x0000000000000000 0x408 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .data.__malloc_trim_threshold - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .bss.__malloc_max_total_mem - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .bss.__malloc_max_sbrked_mem - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .bss.__malloc_top_pad - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .bss.__malloc_current_mallinfo - 0x0000000000000000 0x28 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .data.__malloc_sbrk_base - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .debug_frame 0x0000000000000000 0x58 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - .text.memchr 0x0000000000000000 0x94 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - .debug_frame 0x0000000000000000 0x3c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - .text.__malloc_lock - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - .text.__malloc_unlock - 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - .debug_frame 0x0000000000000000 0x30 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text._Balloc 0x0000000000000000 0x4c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text._Bfree 0x0000000000000000 0x14 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__multadd - 0x0000000000000000 0x84 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__s2b 0x0000000000000000 0x98 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__hi0bits - 0x0000000000000000 0x40 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__lo0bits - 0x0000000000000000 0x5c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__i2b 0x0000000000000000 0x14 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__multiply - 0x0000000000000000 0x134 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__pow5mult - 0x0000000000000000 0xa0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__lshift - 0x0000000000000000 0xac /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__mcmp 0x0000000000000000 0x48 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__mdiff 0x0000000000000000 0xd4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__ulp 0x0000000000000000 0x50 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__b2d 0x0000000000000000 0xc4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__d2b 0x0000000000000000 0xbc /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__ratio 0x0000000000000000 0x60 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text._mprec_log10 - 0x0000000000000000 0x38 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__copybits - 0x0000000000000000 0x48 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text.__any_on - 0x0000000000000000 0x60 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .rodata.p05.5296 - 0x0000000000000000 0xc /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .rodata.__mprec_tens - 0x0000000000000000 0xc8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .rodata.__mprec_bigtens - 0x0000000000000000 0x28 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .rodata.__mprec_tinytens - 0x0000000000000000 0x28 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .debug_frame 0x0000000000000000 0x268 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - .text.__fpclassifyd - 0x0000000000000000 0x5c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - .debug_frame 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - .text 0x0000000000000000 0x2e0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strcmp.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strcmp.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strcmp.o) - .eh_frame 0x0000000000000000 0x70 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strcmp.o) - .ARM.attributes - 0x0000000000000000 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strcmp.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - .text.strlen 0x0000000000000000 0x5c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - .debug_frame 0x0000000000000000 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .text.__ssprint_r - 0x0000000000000000 0x104 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .text._svfiprintf_r - 0x0000000000000000 0xa94 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .rodata.str1.4 - 0x0000000000000000 0x30 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .rodata.blanks.6859 - 0x0000000000000000 0x10 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .rodata.zeroes.6860 - 0x0000000000000000 0x10 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .debug_frame 0x0000000000000000 0x78 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - .text._calloc_r - 0x0000000000000000 0x60 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - .debug_frame 0x0000000000000000 0x28 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - .text._malloc_trim_r - 0x0000000000000000 0x9c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - .text._free_r 0x0000000000000000 0x1b0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - .debug_frame 0x0000000000000000 0x74 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - .text.memmove 0x0000000000000000 0xc8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - .debug_frame 0x0000000000000000 0x30 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - .text 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - .text._realloc_r - 0x0000000000000000 0x3ec /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - .debug_frame 0x0000000000000000 0x60 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - .text 0x0000000000000000 0x110 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - .ARM.attributes - 0x0000000000000000 0x22 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - .text 0x0000000000000000 0x30 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) - .debug_frame 0x0000000000000000 0x28 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) - .ARM.attributes - 0x0000000000000000 0x22 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) - .text 0x0000000000000000 0x60 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) - .debug_frame 0x0000000000000000 0x50 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) - .text 0x0000000000000000 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_dvmd_tls.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_dvmd_tls.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_dvmd_tls.o) - .ARM.attributes - 0x0000000000000000 0x22 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_dvmd_tls.o) - .text 0x0000000000000000 0x29c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - .ARM.extab 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - .ARM.exidx 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - .debug_frame 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - .text 0x0000000000000000 0x26c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - .data 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - .bss 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - .ARM.extab 0x0000000000000000 0x0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - .ARM.exidx 0x0000000000000000 0x8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - .debug_frame 0x0000000000000000 0x30 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - .ARM.attributes - 0x0000000000000000 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - -Memory Configuration - -Name Origin Length Attributes -flash 0x0000000008000000 0x0000000000004000 -flash2 0x000000000800c000 0x0000000000078000 -ram0 0x0000000020000000 0x0000000000020000 -ram1 0x0000000020000000 0x000000000001c000 -ram2 0x000000002001c000 0x0000000000004000 -ram3 0x0000000000000000 0x0000000000000000 -ram4 0x0000000010000000 0x0000000000010000 -ram5 0x0000000040024000 0x0000000000001000 -ram6 0x0000000000000000 0x0000000000000000 -ram7 0x0000000000000000 0x0000000000000000 -*default* 0x0000000000000000 0xffffffffffffffff - -Linker script and memory map - -LOAD build/obj/crt0_v7m.o -LOAD build/obj/chcoreasm_v7m.o -LOAD build/obj/crt1.o -LOAD build/obj/vectors.o -LOAD build/obj/chsys.o -LOAD build/obj/chdebug.o -LOAD build/obj/chvt.o -LOAD build/obj/chschd.o -LOAD build/obj/chthreads.o -LOAD build/obj/chtm.o -LOAD build/obj/chstats.o -LOAD build/obj/chdynamic.o -LOAD build/obj/chregistry.o -LOAD build/obj/chsem.o -LOAD build/obj/chmtx.o -LOAD build/obj/chcond.o -LOAD build/obj/chevents.o -LOAD build/obj/chmsg.o -LOAD build/obj/chmboxes.o -LOAD build/obj/chqueues.o -LOAD build/obj/chmemcore.o -LOAD build/obj/chheap.o -LOAD build/obj/chmempools.o -LOAD build/obj/chcore.o -LOAD build/obj/chcore_v7m.o -LOAD build/obj/osal.o -LOAD build/obj/hal.o -LOAD build/obj/hal_queues.o -LOAD build/obj/hal_mmcsd.o -LOAD build/obj/adc.o -LOAD build/obj/can.o -LOAD build/obj/dac.o -LOAD build/obj/ext.o -LOAD build/obj/gpt.o -LOAD build/obj/i2c.o -LOAD build/obj/i2s.o -LOAD build/obj/icu.o -LOAD build/obj/mac.o -LOAD build/obj/mmc_spi.o -LOAD build/obj/pal.o -LOAD build/obj/pwm.o -LOAD build/obj/rtc.o -LOAD build/obj/sdc.o -LOAD build/obj/serial.o -LOAD build/obj/serial_usb.o -LOAD build/obj/spi.o -LOAD build/obj/st.o -LOAD build/obj/uart.o -LOAD build/obj/usb.o -LOAD build/obj/nvic.o -LOAD build/obj/stm32_dma.o -LOAD build/obj/hal_lld.o -LOAD build/obj/adc_lld.o -LOAD build/obj/ext_lld_isr.o -LOAD build/obj/can_lld.o -LOAD build/obj/ext_lld.o -LOAD build/obj/mac_lld.o -LOAD build/obj/sdc_lld.o -LOAD build/obj/dac_lld.o -LOAD build/obj/pal_lld.o -LOAD build/obj/i2c_lld.o -LOAD build/obj/usb_lld.o -LOAD build/obj/rtc_lld.o -LOAD build/obj/i2s_lld.o -LOAD build/obj/spi_lld.o -LOAD build/obj/gpt_lld.o -LOAD build/obj/icu_lld.o -LOAD build/obj/pwm_lld.o -LOAD build/obj/st_lld.o -LOAD build/obj/serial_lld.o -LOAD build/obj/uart_lld.o -LOAD build/obj/board.o -LOAD build/obj/chprintf.o -LOAD build/obj/syscalls.o -LOAD build/obj/bldc.o -LOAD build/obj/mcpwm.o -LOAD build/obj/usb_uart.o -LOAD build/obj/irq_handlers.o -LOAD build/obj/comm_usb.o -LOAD build/obj/servo_dec.o -LOAD build/obj/utils.o -LOAD build/obj/conf_general.o -LOAD build/obj/eeprom.o -LOAD build/obj/flash_helper.o -LOAD build/obj/hw_oroca.o -LOAD build/obj/misc.o -LOAD build/obj/stm32f4xx_adc.o -LOAD build/obj/stm32f4xx_dma.o -LOAD build/obj/stm32f4xx_exti.o -LOAD build/obj/stm32f4xx_flash.o -LOAD build/obj/stm32f4xx_rcc.o -LOAD build/obj/stm32f4xx_syscfg.o -LOAD build/obj/stm32f4xx_tim.o -LOAD build/obj/stm32f4xx_wwdg.o -LOAD build/obj/main.o - 0x0000000020000000 __ram0_start__ = ORIGIN (ram0) - 0x0000000000020000 __ram0_size__ = 0x20000 - 0x0000000020020000 __ram0_end__ = (__ram0_start__ + __ram0_size__) - 0x0000000020000000 __ram1_start__ = ORIGIN (ram1) - 0x000000000001c000 __ram1_size__ = 0x1c000 - 0x000000002001c000 __ram1_end__ = (__ram1_start__ + __ram1_size__) - 0x000000002001c000 __ram2_start__ = ORIGIN (ram2) - 0x0000000000004000 __ram2_size__ = 0x4000 - 0x0000000020020000 __ram2_end__ = (__ram2_start__ + __ram2_size__) - 0x0000000000000000 __ram3_start__ = ORIGIN (ram3) - 0x0000000000000000 __ram3_size__ = 0x0 - 0x0000000000000000 __ram3_end__ = (__ram3_start__ + __ram3_size__) - 0x0000000010000000 __ram4_start__ = ORIGIN (ram4) - 0x0000000000010000 __ram4_size__ = 0x10000 - 0x0000000010010000 __ram4_end__ = (__ram4_start__ + __ram4_size__) - 0x0000000040024000 __ram5_start__ = ORIGIN (ram5) - 0x0000000000001000 __ram5_size__ = 0x1000 - 0x0000000040025000 __ram5_end__ = (__ram5_start__ + __ram5_size__) - 0x0000000000000000 __ram6_start__ = ORIGIN (ram6) - 0x0000000000000000 __ram6_size__ = 0x0 - 0x0000000000000000 __ram6_end__ = (__ram6_start__ + __ram6_size__) - 0x0000000000000000 __ram7_start__ = ORIGIN (ram7) - 0x0000000000000000 __ram7_size__ = 0x0 - 0x0000000000000000 __ram7_end__ = (__ram7_start__ + __ram7_size__) - 0x0000000000000000 . = 0x0 - 0x0000000000000000 _text = . - -startup 0x0000000008000000 0x1c0 - *(.vectors) - .vectors 0x0000000008000000 0x1c0 build/obj/vectors.o - 0x0000000008000000 _vectors - -constructors 0x000000000800c000 0x0 - 0x000000000800c000 PROVIDE (__init_array_start, .) - *(SORT(.init_array.*)) - *(.init_array) - 0x000000000800c000 PROVIDE (__init_array_end, .) - -destructors 0x000000000800c000 0x0 - 0x000000000800c000 PROVIDE (__fini_array_start, .) - *(.fini_array) - *(SORT(.fini_array.*)) - 0x000000000800c000 PROVIDE (__fini_array_end, .) - -.text 0x000000000800c000 0x7b44 - *(.text) - .text 0x000000000800c000 0x108 build/obj/crt0_v7m.o - 0x000000000800c000 Reset_Handler - *fill* 0x000000000800c108 0x8 - .text 0x000000000800c110 0x30 build/obj/chcoreasm_v7m.o - 0x000000000800c110 _port_switch - 0x000000000800c128 _port_thread_start - 0x000000000800c138 _port_switch_from_isr - 0x000000000800c13c _port_exit_from_isr - .text 0x000000000800c140 0x370 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - 0x000000000800c140 __aeabi_drsub - 0x000000000800c148 __subdf3 - 0x000000000800c148 __aeabi_dsub - 0x000000000800c14c __aeabi_dadd - 0x000000000800c14c __adddf3 - 0x000000000800c3c4 __aeabi_ui2d - 0x000000000800c3c4 __floatunsidf - 0x000000000800c3e4 __floatsidf - 0x000000000800c3e4 __aeabi_i2d - 0x000000000800c408 __extendsfdf2 - 0x000000000800c408 __aeabi_f2d - 0x000000000800c444 __aeabi_ul2d - 0x000000000800c444 __floatundidf - 0x000000000800c454 __aeabi_l2d - 0x000000000800c454 __floatdidf - .text 0x000000000800c4b0 0x424 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) - 0x000000000800c4b0 __aeabi_dmul - 0x000000000800c4b0 __muldf3 - 0x000000000800c704 __aeabi_ddiv - 0x000000000800c704 __divdf3 - *fill* 0x000000000800c8d4 0xc - .text 0x000000000800c8e0 0xa0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_truncdfsf2.o) - 0x000000000800c8e0 __aeabi_d2f - 0x000000000800c8e0 __truncdfsf2 - .text 0x000000000800c980 0x134 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memcpy.o) - 0x000000000800c980 memcpy - *(.text.*) - *fill* 0x000000000800cab4 0xc - .text.__core_init - 0x000000000800cac0 0x10 build/obj/crt1.o - 0x000000000800cac0 __core_init - .text.__late_init - 0x000000000800cad0 0x10 build/obj/crt1.o - 0x000000000800cad0 __late_init - .text.__default_exit - 0x000000000800cae0 0x10 build/obj/crt1.o - 0x000000000800cae0 __default_exit - .text._unhandled_exception - 0x000000000800caf0 0x10 build/obj/vectors.o - 0x000000000800caf0 Vector174 - 0x000000000800caf0 VectorE8 - 0x000000000800caf0 Vector9C - 0x000000000800caf0 VectorAC - 0x000000000800caf0 DebugMon_Handler - 0x000000000800caf0 Vector1A0 - 0x000000000800caf0 Vector5C - 0x000000000800caf0 HardFault_Handler - 0x000000000800caf0 Vector1B8 - 0x000000000800caf0 Vector19C - 0x000000000800caf0 PendSV_Handler - 0x000000000800caf0 Vector168 - 0x000000000800caf0 NMI_Handler - 0x000000000800caf0 Vector110 - 0x000000000800caf0 VectorA8 - 0x000000000800caf0 Vector160 - 0x000000000800caf0 Vector1B0 - 0x000000000800caf0 UsageFault_Handler - 0x000000000800caf0 VectorEC - 0x000000000800caf0 Vector40 - 0x000000000800caf0 VectorF8 - 0x000000000800caf0 Vector108 - 0x000000000800caf0 VectorBC - 0x000000000800caf0 Vector190 - 0x000000000800caf0 Vector148 - 0x000000000800caf0 Vector188 - 0x000000000800caf0 Vector198 - 0x000000000800caf0 Vector118 - 0x000000000800caf0 Vector64 - 0x000000000800caf0 VectorCC - 0x000000000800caf0 Vector54 - 0x000000000800caf0 VectorD8 - 0x000000000800caf0 Vector138 - 0x000000000800caf0 Vector24 - 0x000000000800caf0 Vector1AC - 0x000000000800caf0 Vector178 - 0x000000000800caf0 Vector1A4 - 0x000000000800caf0 VectorD0 - 0x000000000800caf0 Vector1B4 - 0x000000000800caf0 Vector140 - 0x000000000800caf0 VectorE4 - 0x000000000800caf0 VectorC0 - 0x000000000800caf0 Vector134 - 0x000000000800caf0 VectorF0 - 0x000000000800caf0 Vector13C - 0x000000000800caf0 Vector100 - 0x000000000800caf0 VectorF4 - 0x000000000800caf0 MemManage_Handler - 0x000000000800caf0 VectorA0 - 0x000000000800caf0 Vector180 - 0x000000000800caf0 VectorB0 - 0x000000000800caf0 Vector114 - 0x000000000800caf0 Vector164 - 0x000000000800caf0 Vector60 - 0x000000000800caf0 Vector1C - 0x000000000800caf0 Vector1BC - 0x000000000800caf0 Vector17C - 0x000000000800caf0 Vector48 - 0x000000000800caf0 Vector1A8 - 0x000000000800caf0 Vector16C - 0x000000000800caf0 VectorD4 - 0x000000000800caf0 Vector4C - 0x000000000800caf0 Vector144 - 0x000000000800caf0 Vector68 - 0x000000000800caf0 _unhandled_exception - 0x000000000800caf0 Vector170 - 0x000000000800caf0 Vector104 - 0x000000000800caf0 Vector184 - 0x000000000800caf0 Vector10C - 0x000000000800caf0 BusFault_Handler - 0x000000000800caf0 Vector50 - 0x000000000800caf0 Vector194 - 0x000000000800caf0 Vector44 - 0x000000000800caf0 Vector28 - 0x000000000800caf0 VectorB8 - 0x000000000800caf0 Vector34 - 0x000000000800caf0 VectorA4 - 0x000000000800caf0 Vector20 - 0x000000000800caf0 Vector18C - 0x000000000800caf0 Vector58 - .text._idle_thread - 0x000000000800cb00 0x10 build/obj/chsys.o - .text.chSysInit - 0x000000000800cb10 0xb0 build/obj/chsys.o - 0x000000000800cb10 chSysInit - .text.chSysTimerHandlerI - 0x000000000800cbc0 0x60 build/obj/chsys.o - 0x000000000800cbc0 chSysTimerHandlerI - .text.chSysPolledDelayX - 0x000000000800cc20 0x20 build/obj/chsys.o - 0x000000000800cc20 chSysPolledDelayX - .text._vt_init - 0x000000000800cc40 0x20 build/obj/chvt.o - 0x000000000800cc40 _vt_init - .text.chVTDoSetI - 0x000000000800cc60 0x40 build/obj/chvt.o - 0x000000000800cc60 chVTDoSetI - .text.chVTDoResetI - 0x000000000800cca0 0x30 build/obj/chvt.o - 0x000000000800cca0 chVTDoResetI - .text.wakeup 0x000000000800ccd0 0x70 build/obj/chschd.o - .text._scheduler_init - 0x000000000800cd40 0x20 build/obj/chschd.o - 0x000000000800cd40 _scheduler_init - .text.chSchReadyI - 0x000000000800cd60 0x30 build/obj/chschd.o - 0x000000000800cd60 chSchReadyI - .text.chSchGoSleepS - 0x000000000800cd90 0x30 build/obj/chschd.o - 0x000000000800cd90 chSchGoSleepS - .text.chSchGoSleepTimeoutS - 0x000000000800cdc0 0x50 build/obj/chschd.o - 0x000000000800cdc0 chSchGoSleepTimeoutS - .text.chSchWakeupS - 0x000000000800ce10 0x60 build/obj/chschd.o - 0x000000000800ce10 chSchWakeupS - .text.chSchIsPreemptionRequired - 0x000000000800ce70 0x30 build/obj/chschd.o - 0x000000000800ce70 chSchIsPreemptionRequired - .text.chSchDoRescheduleBehind - 0x000000000800cea0 0x40 build/obj/chschd.o - 0x000000000800cea0 chSchDoRescheduleBehind - .text.chSchDoRescheduleAhead - 0x000000000800cee0 0x40 build/obj/chschd.o - 0x000000000800cee0 chSchDoRescheduleAhead - .text.chSchRescheduleS - 0x000000000800cf20 0x20 build/obj/chschd.o - 0x000000000800cf20 chSchRescheduleS - .text.chSchDoReschedule - 0x000000000800cf40 0x20 build/obj/chschd.o - 0x000000000800cf40 chSchDoReschedule - .text._thread_init - 0x000000000800cf60 0x50 build/obj/chthreads.o - 0x000000000800cf60 _thread_init - .text.chThdCreateI - 0x000000000800cfb0 0x70 build/obj/chthreads.o - 0x000000000800cfb0 chThdCreateI - .text.chThdCreateStatic - 0x000000000800d020 0x80 build/obj/chthreads.o - 0x000000000800d020 chThdCreateStatic - .text.chThdSleep - 0x000000000800d0a0 0x20 build/obj/chthreads.o - 0x000000000800d0a0 chThdSleep - .text.chThdExitS - 0x000000000800d0c0 0x40 build/obj/chthreads.o - 0x000000000800d0c0 chThdExitS - .text.chThdExit - 0x000000000800d100 0x10 build/obj/chthreads.o - 0x000000000800d100 chThdExit - .text.chThdSuspendS - 0x000000000800d110 0x20 build/obj/chthreads.o - 0x000000000800d110 chThdSuspendS - .text.chThdResumeI - 0x000000000800d130 0x20 build/obj/chthreads.o - 0x000000000800d130 chThdResumeI - .text.chThdEnqueueTimeoutS - 0x000000000800d150 0x30 build/obj/chthreads.o - 0x000000000800d150 chThdEnqueueTimeoutS - .text.chThdDequeueAllI - 0x000000000800d180 0x30 build/obj/chthreads.o - 0x000000000800d180 chThdDequeueAllI - .text.chTMStartMeasurementX - 0x000000000800d1b0 0x10 build/obj/chtm.o - 0x000000000800d1b0 chTMStartMeasurementX - .text.chTMStopMeasurementX - 0x000000000800d1c0 0x50 build/obj/chtm.o - 0x000000000800d1c0 chTMStopMeasurementX - .text._tm_init - 0x000000000800d210 0x40 build/obj/chtm.o - 0x000000000800d210 _tm_init - .text.chMtxObjectInit - 0x000000000800d250 0x10 build/obj/chmtx.o - 0x000000000800d250 chMtxObjectInit - .text.chEvtSignalI - 0x000000000800d260 0x30 build/obj/chevents.o - 0x000000000800d260 chEvtSignalI - .text.chEvtBroadcastFlagsI - 0x000000000800d290 0x30 build/obj/chevents.o - 0x000000000800d290 chEvtBroadcastFlagsI - .text.chIQObjectInit - 0x000000000800d2c0 0x20 build/obj/chqueues.o - 0x000000000800d2c0 chIQObjectInit - .text.chIQResetI - 0x000000000800d2e0 0x20 build/obj/chqueues.o - 0x000000000800d2e0 chIQResetI - .text.chIQGetTimeout - 0x000000000800d300 0x50 build/obj/chqueues.o - 0x000000000800d300 chIQGetTimeout - .text.chIQReadTimeout - 0x000000000800d350 0x80 build/obj/chqueues.o - 0x000000000800d350 chIQReadTimeout - .text.chOQObjectInit - 0x000000000800d3d0 0x20 build/obj/chqueues.o - 0x000000000800d3d0 chOQObjectInit - .text.chOQResetI - 0x000000000800d3f0 0x20 build/obj/chqueues.o - 0x000000000800d3f0 chOQResetI - .text.chOQPutTimeout - 0x000000000800d410 0x60 build/obj/chqueues.o - 0x000000000800d410 chOQPutTimeout - .text.chOQWriteTimeout - 0x000000000800d470 0x90 build/obj/chqueues.o - 0x000000000800d470 chOQWriteTimeout - .text._core_init - 0x000000000800d500 0x30 build/obj/chmemcore.o - 0x000000000800d500 _core_init - .text.chCoreAlloc - 0x000000000800d530 0x40 build/obj/chmemcore.o - 0x000000000800d530 chCoreAlloc - .text._heap_init - 0x000000000800d570 0x20 build/obj/chheap.o - 0x000000000800d570 _heap_init - .text.SVC_Handler - 0x000000000800d590 0x20 build/obj/chcore_v7m.o - 0x000000000800d590 SVC_Handler - .text._port_irq_epilogue - 0x000000000800d5b0 0x60 build/obj/chcore_v7m.o - 0x000000000800d5b0 _port_irq_epilogue - .text.halInit 0x000000000800d610 0x40 build/obj/hal.o - 0x000000000800d610 halInit - .text.canInit 0x000000000800d650 0x10 build/obj/can.o - 0x000000000800d650 canInit - .text.canObjectInit - 0x000000000800d660 0x50 build/obj/can.o - 0x000000000800d660 canObjectInit - .text.i2cInit 0x000000000800d6b0 0x10 build/obj/i2c.o - 0x000000000800d6b0 i2cInit - .text.i2cObjectInit - 0x000000000800d6c0 0x10 build/obj/i2c.o - 0x000000000800d6c0 i2cObjectInit - .text.icuInit 0x000000000800d6d0 0x10 build/obj/icu.o - 0x000000000800d6d0 icuInit - .text.icuObjectInit - 0x000000000800d6e0 0x10 build/obj/icu.o - 0x000000000800d6e0 icuObjectInit - .text.onotify 0x000000000800d6f0 0x60 build/obj/serial_usb.o - .text.inotify 0x000000000800d750 0x70 build/obj/serial_usb.o - .text.readt 0x000000000800d7c0 0x10 build/obj/serial_usb.o - .text.read 0x000000000800d7d0 0x10 build/obj/serial_usb.o - .text.writet 0x000000000800d7e0 0x10 build/obj/serial_usb.o - .text.write 0x000000000800d7f0 0x10 build/obj/serial_usb.o - .text.gett 0x000000000800d800 0x10 build/obj/serial_usb.o - .text.get 0x000000000800d810 0x10 build/obj/serial_usb.o - .text.putt 0x000000000800d820 0x10 build/obj/serial_usb.o - .text.put 0x000000000800d830 0x10 build/obj/serial_usb.o - .text.sduInit 0x000000000800d840 0x10 build/obj/serial_usb.o - 0x000000000800d840 sduInit - .text.sduObjectInit - 0x000000000800d850 0x50 build/obj/serial_usb.o - 0x000000000800d850 sduObjectInit - .text.sduStart - 0x000000000800d8a0 0x40 build/obj/serial_usb.o - 0x000000000800d8a0 sduStart - .text.sduConfigureHookI - 0x000000000800d8e0 0x50 build/obj/serial_usb.o - 0x000000000800d8e0 sduConfigureHookI - .text.sduRequestsHook - 0x000000000800d930 0x40 build/obj/serial_usb.o - 0x000000000800d930 sduRequestsHook - .text.sduDataTransmitted - 0x000000000800d970 0x70 build/obj/serial_usb.o - 0x000000000800d970 sduDataTransmitted - .text.sduDataReceived - 0x000000000800d9e0 0x70 build/obj/serial_usb.o - 0x000000000800d9e0 sduDataReceived - .text.sduInterruptTransmitted - 0x000000000800da50 0x10 build/obj/serial_usb.o - 0x000000000800da50 sduInterruptTransmitted - .text.stInit 0x000000000800da60 0x10 build/obj/st.o - 0x000000000800da60 stInit - .text.uartInit - 0x000000000800da70 0x10 build/obj/uart.o - 0x000000000800da70 uartInit - .text.uartObjectInit - 0x000000000800da80 0x10 build/obj/uart.o - 0x000000000800da80 uartObjectInit - .text.usbInit 0x000000000800da90 0x10 build/obj/usb.o - 0x000000000800da90 usbInit - .text.usbObjectInit - 0x000000000800daa0 0x20 build/obj/usb.o - 0x000000000800daa0 usbObjectInit - .text.usbStart - 0x000000000800dac0 0x30 build/obj/usb.o - 0x000000000800dac0 usbStart - .text.usbInitEndpointI - 0x000000000800daf0 0x40 build/obj/usb.o - 0x000000000800daf0 usbInitEndpointI - .text.usbPrepareQueuedReceive - 0x000000000800db30 0x20 build/obj/usb.o - 0x000000000800db30 usbPrepareQueuedReceive - .text.usbPrepareQueuedTransmit - 0x000000000800db50 0x20 build/obj/usb.o - 0x000000000800db50 usbPrepareQueuedTransmit - .text.usbStartReceiveI - 0x000000000800db70 0x30 build/obj/usb.o - 0x000000000800db70 usbStartReceiveI - .text.usbStartTransmitI - 0x000000000800dba0 0x30 build/obj/usb.o - 0x000000000800dba0 usbStartTransmitI - .text._usb_reset - 0x000000000800dbd0 0x30 build/obj/usb.o - 0x000000000800dbd0 _usb_reset - .text._usb_ep0setup - 0x000000000800dc00 0x350 build/obj/usb.o - 0x000000000800dc00 _usb_ep0setup - .text._usb_ep0in - 0x000000000800df50 0xd0 build/obj/usb.o - 0x000000000800df50 _usb_ep0in - .text._usb_ep0out - 0x000000000800e020 0x90 build/obj/usb.o - 0x000000000800e020 _usb_ep0out - .text.nvicEnableVector - 0x000000000800e0b0 0x40 build/obj/nvic.o - 0x000000000800e0b0 nvicEnableVector - .text.nvicSetSystemHandlerPriority - 0x000000000800e0f0 0x10 build/obj/nvic.o - 0x000000000800e0f0 nvicSetSystemHandlerPriority - .text.Vector6C - 0x000000000800e100 0x30 build/obj/stm32_dma.o - 0x000000000800e100 Vector6C - .text.Vector70 - 0x000000000800e130 0x30 build/obj/stm32_dma.o - 0x000000000800e130 Vector70 - .text.Vector74 - 0x000000000800e160 0x30 build/obj/stm32_dma.o - 0x000000000800e160 Vector74 - .text.Vector78 - 0x000000000800e190 0x30 build/obj/stm32_dma.o - 0x000000000800e190 Vector78 - .text.Vector7C - 0x000000000800e1c0 0x30 build/obj/stm32_dma.o - 0x000000000800e1c0 Vector7C - .text.Vector80 - 0x000000000800e1f0 0x30 build/obj/stm32_dma.o - 0x000000000800e1f0 Vector80 - .text.Vector84 - 0x000000000800e220 0x30 build/obj/stm32_dma.o - 0x000000000800e220 Vector84 - .text.VectorFC - 0x000000000800e250 0x30 build/obj/stm32_dma.o - 0x000000000800e250 VectorFC - .text.Vector120 - 0x000000000800e280 0x30 build/obj/stm32_dma.o - 0x000000000800e280 Vector120 - .text.Vector124 - 0x000000000800e2b0 0x30 build/obj/stm32_dma.o - 0x000000000800e2b0 Vector124 - .text.Vector128 - 0x000000000800e2e0 0x30 build/obj/stm32_dma.o - 0x000000000800e2e0 Vector128 - .text.Vector12C - 0x000000000800e310 0x30 build/obj/stm32_dma.o - 0x000000000800e310 Vector12C - .text.Vector130 - 0x000000000800e340 0x30 build/obj/stm32_dma.o - 0x000000000800e340 Vector130 - .text.Vector150 - 0x000000000800e370 0x30 build/obj/stm32_dma.o - 0x000000000800e370 Vector150 - .text.Vector154 - 0x000000000800e3a0 0x30 build/obj/stm32_dma.o - 0x000000000800e3a0 Vector154 - .text.Vector158 - 0x000000000800e3d0 0x30 build/obj/stm32_dma.o - 0x000000000800e3d0 Vector158 - .text.dmaInit 0x000000000800e400 0x50 build/obj/stm32_dma.o - 0x000000000800e400 dmaInit - .text.dmaStreamAllocate - 0x000000000800e450 0x90 build/obj/stm32_dma.o - 0x000000000800e450 dmaStreamAllocate - .text.hal_lld_init - 0x000000000800e4e0 0x70 build/obj/hal_lld.o - 0x000000000800e4e0 hal_lld_init - .text.stm32_clock_init - 0x000000000800e550 0xd0 build/obj/hal_lld.o - 0x000000000800e550 stm32_clock_init - .text.can_lld_set_filters - 0x000000000800e620 0x120 build/obj/can_lld.o - .text.Vector8C - 0x000000000800e740 0x40 build/obj/can_lld.o - 0x000000000800e740 Vector8C - .text.Vector90 - 0x000000000800e780 0x70 build/obj/can_lld.o - 0x000000000800e780 Vector90 - .text.Vector94 - 0x000000000800e7f0 0x70 build/obj/can_lld.o - 0x000000000800e7f0 Vector94 - .text.Vector98 - 0x000000000800e860 0x80 build/obj/can_lld.o - 0x000000000800e860 Vector98 - .text.can_lld_init - 0x000000000800e8e0 0x30 build/obj/can_lld.o - 0x000000000800e8e0 can_lld_init - .text._pal_lld_init - 0x000000000800e910 0x1d0 build/obj/pal_lld.o - 0x000000000800e910 _pal_lld_init - .text._pal_lld_setgroupmode - 0x000000000800eae0 0xb0 build/obj/pal_lld.o - 0x000000000800eae0 _pal_lld_setgroupmode - .text.VectorC4 - 0x000000000800eb90 0x100 build/obj/i2c_lld.o - 0x000000000800eb90 VectorC4 - .text.VectorC8 - 0x000000000800ec90 0xe0 build/obj/i2c_lld.o - 0x000000000800ec90 VectorC8 - .text.i2c_lld_init - 0x000000000800ed70 0x30 build/obj/i2c_lld.o - 0x000000000800ed70 i2c_lld_init - .text.usb_lld_pump - 0x000000000800eda0 0x330 build/obj/usb_lld.o - 0x000000000800eda0 usb_lld_pump - .text.otg_disable_ep.isra.0 - 0x000000000800f0d0 0x80 build/obj/usb_lld.o - .text.usb_lld_init - 0x000000000800f150 0x30 build/obj/usb_lld.o - 0x000000000800f150 usb_lld_init - .text.usb_lld_start - 0x000000000800f180 0xf0 build/obj/usb_lld.o - 0x000000000800f180 usb_lld_start - .text.usb_lld_reset - 0x000000000800f270 0xd0 build/obj/usb_lld.o - 0x000000000800f270 usb_lld_reset - .text.usb_lld_set_address - 0x000000000800f340 0x20 build/obj/usb_lld.o - 0x000000000800f340 usb_lld_set_address - .text.usb_lld_init_endpoint - 0x000000000800f360 0x160 build/obj/usb_lld.o - 0x000000000800f360 usb_lld_init_endpoint - .text.usb_lld_get_status_out - 0x000000000800f4c0 0x20 build/obj/usb_lld.o - 0x000000000800f4c0 usb_lld_get_status_out - .text.usb_lld_get_status_in - 0x000000000800f4e0 0x20 build/obj/usb_lld.o - 0x000000000800f4e0 usb_lld_get_status_in - .text.usb_lld_read_setup - 0x000000000800f500 0x20 build/obj/usb_lld.o - 0x000000000800f500 usb_lld_read_setup - .text.usb_lld_prepare_receive - 0x000000000800f520 0x50 build/obj/usb_lld.o - 0x000000000800f520 usb_lld_prepare_receive - .text.otg_epout_handler.constprop.7 - 0x000000000800f570 0xb0 build/obj/usb_lld.o - .text.usb_lld_prepare_transmit - 0x000000000800f620 0x50 build/obj/usb_lld.o - 0x000000000800f620 usb_lld_prepare_transmit - .text.otg_epin_handler.constprop.8 - 0x000000000800f670 0xd0 build/obj/usb_lld.o - .text.Vector14C - 0x000000000800f740 0x100 build/obj/usb_lld.o - 0x000000000800f740 Vector14C - .text.usb_lld_start_out - 0x000000000800f840 0x20 build/obj/usb_lld.o - 0x000000000800f840 usb_lld_start_out - .text.usb_lld_start_in - 0x000000000800f860 0x30 build/obj/usb_lld.o - 0x000000000800f860 usb_lld_start_in - .text.usb_lld_stall_out - 0x000000000800f890 0x20 build/obj/usb_lld.o - 0x000000000800f890 usb_lld_stall_out - .text.usb_lld_stall_in - 0x000000000800f8b0 0x20 build/obj/usb_lld.o - 0x000000000800f8b0 usb_lld_stall_in - .text.usb_lld_clear_out - 0x000000000800f8d0 0x20 build/obj/usb_lld.o - 0x000000000800f8d0 usb_lld_clear_out - .text.usb_lld_clear_in - 0x000000000800f8f0 0x20 build/obj/usb_lld.o - 0x000000000800f8f0 usb_lld_clear_in - .text.VectorB4 - 0x000000000800f910 0xa0 build/obj/icu_lld.o - 0x000000000800f910 VectorB4 - .text.icu_lld_init - 0x000000000800f9b0 0x20 build/obj/icu_lld.o - 0x000000000800f9b0 icu_lld_init - .text.SysTick_Handler - 0x000000000800f9d0 0x20 build/obj/st_lld.o - 0x000000000800f9d0 SysTick_Handler - .text.st_lld_init - 0x000000000800f9f0 0x20 build/obj/st_lld.o - 0x000000000800f9f0 st_lld_init - .text.serve_usart_irq - 0x000000000800fa10 0x80 build/obj/uart_lld.o - .text.VectorDC - 0x000000000800fa90 0x20 build/obj/uart_lld.o - 0x000000000800fa90 VectorDC - .text.Vector15C - 0x000000000800fab0 0x20 build/obj/uart_lld.o - 0x000000000800fab0 Vector15C - .text.uart_lld_init - 0x000000000800fad0 0x50 build/obj/uart_lld.o - 0x000000000800fad0 uart_lld_init - .text.__early_init - 0x000000000800fb20 0x10 build/obj/board.o - 0x000000000800fb20 __early_init - .text.boardInit - 0x000000000800fb30 0x10 build/obj/board.o - 0x000000000800fb30 boardInit - .text.periodic_thread - 0x000000000800fb40 0x20 build/obj/bldc.o - .text.bldc_init - 0x000000000800fb60 0x40 build/obj/bldc.o - 0x000000000800fb60 bldc_init - .text.bldc_start - 0x000000000800fba0 0x40 build/obj/bldc.o - 0x000000000800fba0 bldc_start - .text.send 0x000000000800fbe0 0xf0 build/obj/bldc.o - 0x000000000800fbe0 send - .text.recv 0x000000000800fcd0 0x210 build/obj/bldc.o - 0x000000000800fcd0 recv - .text.uart_process_thread - 0x000000000800fee0 0x30 build/obj/bldc.o - .text.SEQUENCE_thread - 0x000000000800ff10 0x20 build/obj/mcpwm.o - .text.mcpwm_adc_int_handler - 0x000000000800ff30 0x20 build/obj/mcpwm.o - 0x000000000800ff30 mcpwm_adc_int_handler - .text.ClarkePark - 0x000000000800ff50 0x70 build/obj/mcpwm.o - 0x000000000800ff50 ClarkePark - .text.CalcPI 0x000000000800ffc0 0x60 build/obj/mcpwm.o - 0x000000000800ffc0 CalcPI - .text.SetupControlParameters - 0x0000000008010020 0xa0 build/obj/mcpwm.o - 0x0000000008010020 SetupControlParameters - .text.mcpwm_init - 0x00000000080100c0 0x4d0 build/obj/mcpwm.o - 0x00000000080100c0 mcpwm_init - .text.VoltRippleComp - 0x0000000008010590 0x60 build/obj/mcpwm.o - 0x0000000008010590 VoltRippleComp - .text.DoControl.part.1 - 0x00000000080105f0 0x110 build/obj/mcpwm.o - .text.InvPark 0x0000000008010700 0x50 build/obj/mcpwm.o - 0x0000000008010700 InvPark - .text.CalcTimes - 0x0000000008010750 0x70 build/obj/mcpwm.o - 0x0000000008010750 CalcTimes - .text.update_timer_Duty - 0x00000000080107c0 0x50 build/obj/mcpwm.o - 0x00000000080107c0 update_timer_Duty - .text.CalcSVGen - 0x0000000008010810 0x110 build/obj/mcpwm.o - 0x0000000008010810 CalcSVGen - .text.SMC_HallSensor_Estimation - 0x0000000008010920 0x1a0 build/obj/mcpwm.o - 0x0000000008010920 SMC_HallSensor_Estimation - .text.mcpwm_adc_inj_int_handler - 0x0000000008010ac0 0x150 build/obj/mcpwm.o - 0x0000000008010ac0 mcpwm_adc_inj_int_handler - .text.get_descriptor - 0x0000000008010c10 0x30 build/obj/usb_uart.o - .text.usb_event - 0x0000000008010c40 0x40 build/obj/usb_uart.o - .text.usb_uart_init - 0x0000000008010c80 0x50 build/obj/usb_uart.o - 0x0000000008010c80 usb_uart_init - .text.usb_uart_write - 0x0000000008010cd0 0x20 build/obj/usb_uart.o - 0x0000000008010cd0 usb_uart_write - .text.usb_uart_getch - 0x0000000008010cf0 0x20 build/obj/usb_uart.o - 0x0000000008010cf0 usb_uart_getch - .text.Vector11C - 0x0000000008010d10 0x20 build/obj/irq_handlers.o - 0x0000000008010d10 Vector11C - .text.Vector88 - 0x0000000008010d30 0x20 build/obj/irq_handlers.o - 0x0000000008010d30 Vector88 - .text.VectorE0 - 0x0000000008010d50 0x30 build/obj/irq_handlers.o - 0x0000000008010d50 VectorE0 - .text.comm_usb_init - 0x0000000008010d80 0x20 build/obj/comm_usb.o - 0x0000000008010d80 comm_usb_init - .text.utils_sys_lock_cnt - 0x0000000008010da0 0x20 build/obj/utils.o - 0x0000000008010da0 utils_sys_lock_cnt - .text.utils_sys_unlock_cnt - 0x0000000008010dc0 0x20 build/obj/utils.o - 0x0000000008010dc0 utils_sys_unlock_cnt - .text.conf_general_init - 0x0000000008010de0 0x60 build/obj/conf_general.o - 0x0000000008010de0 conf_general_init - .text.conf_general_read_app_configuration - 0x0000000008010e40 0x130 build/obj/conf_general.o - 0x0000000008010e40 conf_general_read_app_configuration - .text.conf_general_read_mc_configuration - 0x0000000008010f70 0x1a0 build/obj/conf_general.o - 0x0000000008010f70 conf_general_read_mc_configuration - .text.EE_VerifyPageFullWriteVariable - 0x0000000008011110 0x80 build/obj/eeprom.o - .text.EE_EraseSectorIfNotEmpty.constprop.1 - 0x0000000008011190 0x30 build/obj/eeprom.o - .text.EE_Format - 0x00000000080111c0 0x30 build/obj/eeprom.o - .text.EE_ReadVariable - 0x00000000080111f0 0x70 build/obj/eeprom.o - 0x00000000080111f0 EE_ReadVariable - .text.EE_Init 0x0000000008011260 0x140 build/obj/eeprom.o - 0x0000000008011260 EE_Init - .text.flash_helper_get_sector_address - 0x00000000080113a0 0x30 build/obj/flash_helper.o - 0x00000000080113a0 flash_helper_get_sector_address - .text.hw_init_gpio - 0x00000000080113d0 0x190 build/obj/hw_oroca.o - 0x00000000080113d0 hw_init_gpio - .text.hw_setup_adc_channels - 0x0000000008011560 0xc0 build/obj/hw_oroca.o - 0x0000000008011560 hw_setup_adc_channels - .text.NVIC_Init - 0x0000000008011620 0x70 build/obj/misc.o - 0x0000000008011620 NVIC_Init - .text.ADC_Init - 0x0000000008011690 0x50 build/obj/stm32f4xx_adc.o - 0x0000000008011690 ADC_Init - .text.ADC_CommonInit - 0x00000000080116e0 0x30 build/obj/stm32f4xx_adc.o - 0x00000000080116e0 ADC_CommonInit - .text.ADC_Cmd 0x0000000008011710 0x20 build/obj/stm32f4xx_adc.o - 0x0000000008011710 ADC_Cmd - .text.ADC_RegularChannelConfig - 0x0000000008011730 0x90 build/obj/stm32f4xx_adc.o - 0x0000000008011730 ADC_RegularChannelConfig - .text.ADC_MultiModeDMARequestAfterLastTransferCmd - 0x00000000080117c0 0x20 build/obj/stm32f4xx_adc.o - 0x00000000080117c0 ADC_MultiModeDMARequestAfterLastTransferCmd - .text.ADC_InjectedChannelConfig - 0x00000000080117e0 0x60 build/obj/stm32f4xx_adc.o - 0x00000000080117e0 ADC_InjectedChannelConfig - .text.ADC_InjectedSequencerLengthConfig - 0x0000000008011840 0x10 build/obj/stm32f4xx_adc.o - 0x0000000008011840 ADC_InjectedSequencerLengthConfig - .text.ADC_ExternalTrigInjectedConvConfig - 0x0000000008011850 0x10 build/obj/stm32f4xx_adc.o - 0x0000000008011850 ADC_ExternalTrigInjectedConvConfig - .text.ADC_ExternalTrigInjectedConvEdgeConfig - 0x0000000008011860 0x10 build/obj/stm32f4xx_adc.o - 0x0000000008011860 ADC_ExternalTrigInjectedConvEdgeConfig - .text.ADC_GetInjectedConversionValue - 0x0000000008011870 0x20 build/obj/stm32f4xx_adc.o - 0x0000000008011870 ADC_GetInjectedConversionValue - .text.ADC_ITConfig - 0x0000000008011890 0x20 build/obj/stm32f4xx_adc.o - 0x0000000008011890 ADC_ITConfig - .text.ADC_ClearITPendingBit - 0x00000000080118b0 0x10 build/obj/stm32f4xx_adc.o - 0x00000000080118b0 ADC_ClearITPendingBit - .text.DMA_Init - 0x00000000080118c0 0x70 build/obj/stm32f4xx_dma.o - 0x00000000080118c0 DMA_Init - .text.DMA_Cmd 0x0000000008011930 0x20 build/obj/stm32f4xx_dma.o - 0x0000000008011930 DMA_Cmd - .text.DMA_ITConfig - 0x0000000008011950 0x40 build/obj/stm32f4xx_dma.o - 0x0000000008011950 DMA_ITConfig - .text.EXTI_GetITStatus - 0x0000000008011990 0x20 build/obj/stm32f4xx_exti.o - 0x0000000008011990 EXTI_GetITStatus - .text.EXTI_ClearITPendingBit - 0x00000000080119b0 0x10 build/obj/stm32f4xx_exti.o - 0x00000000080119b0 EXTI_ClearITPendingBit - .text.FLASH_Unlock - 0x00000000080119c0 0x20 build/obj/stm32f4xx_flash.o - 0x00000000080119c0 FLASH_Unlock - .text.FLASH_ClearFlag - 0x00000000080119e0 0x10 build/obj/stm32f4xx_flash.o - 0x00000000080119e0 FLASH_ClearFlag - .text.FLASH_GetStatus - 0x00000000080119f0 0x40 build/obj/stm32f4xx_flash.o - 0x00000000080119f0 FLASH_GetStatus - .text.FLASH_WaitForLastOperation - 0x0000000008011a30 0x30 build/obj/stm32f4xx_flash.o - 0x0000000008011a30 FLASH_WaitForLastOperation - .text.FLASH_EraseSector - 0x0000000008011a60 0x80 build/obj/stm32f4xx_flash.o - 0x0000000008011a60 FLASH_EraseSector - .text.FLASH_ProgramHalfWord - 0x0000000008011ae0 0x40 build/obj/stm32f4xx_flash.o - 0x0000000008011ae0 FLASH_ProgramHalfWord - .text.RCC_AHB1PeriphClockCmd - 0x0000000008011b20 0x20 build/obj/stm32f4xx_rcc.o - 0x0000000008011b20 RCC_AHB1PeriphClockCmd - .text.RCC_APB1PeriphClockCmd - 0x0000000008011b40 0x20 build/obj/stm32f4xx_rcc.o - 0x0000000008011b40 RCC_APB1PeriphClockCmd - .text.RCC_APB2PeriphClockCmd - 0x0000000008011b60 0x20 build/obj/stm32f4xx_rcc.o - 0x0000000008011b60 RCC_APB2PeriphClockCmd - .text.RCC_APB1PeriphResetCmd - 0x0000000008011b80 0x20 build/obj/stm32f4xx_rcc.o - 0x0000000008011b80 RCC_APB1PeriphResetCmd - .text.RCC_APB2PeriphResetCmd - 0x0000000008011ba0 0x20 build/obj/stm32f4xx_rcc.o - 0x0000000008011ba0 RCC_APB2PeriphResetCmd - .text.TIM_DeInit - 0x0000000008011bc0 0x1c0 build/obj/stm32f4xx_tim.o - 0x0000000008011bc0 TIM_DeInit - .text.TIM_TimeBaseInit - 0x0000000008011d80 0xa0 build/obj/stm32f4xx_tim.o - 0x0000000008011d80 TIM_TimeBaseInit - .text.TIM_ARRPreloadConfig - 0x0000000008011e20 0x20 build/obj/stm32f4xx_tim.o - 0x0000000008011e20 TIM_ARRPreloadConfig - .text.TIM_Cmd 0x0000000008011e40 0x20 build/obj/stm32f4xx_tim.o - 0x0000000008011e40 TIM_Cmd - .text.TIM_OC1Init - 0x0000000008011e60 0x80 build/obj/stm32f4xx_tim.o - 0x0000000008011e60 TIM_OC1Init - .text.TIM_OC2Init - 0x0000000008011ee0 0xa0 build/obj/stm32f4xx_tim.o - 0x0000000008011ee0 TIM_OC2Init - .text.TIM_OC3Init - 0x0000000008011f80 0x90 build/obj/stm32f4xx_tim.o - 0x0000000008011f80 TIM_OC3Init - .text.TIM_OC4Init - 0x0000000008012010 0x80 build/obj/stm32f4xx_tim.o - 0x0000000008012010 TIM_OC4Init - .text.TIM_OC1PreloadConfig - 0x0000000008012090 0x10 build/obj/stm32f4xx_tim.o - 0x0000000008012090 TIM_OC1PreloadConfig - .text.TIM_OC2PreloadConfig - 0x00000000080120a0 0x20 build/obj/stm32f4xx_tim.o - 0x00000000080120a0 TIM_OC2PreloadConfig - .text.TIM_OC3PreloadConfig - 0x00000000080120c0 0x10 build/obj/stm32f4xx_tim.o - 0x00000000080120c0 TIM_OC3PreloadConfig - .text.TIM_OC4PreloadConfig - 0x00000000080120d0 0x20 build/obj/stm32f4xx_tim.o - 0x00000000080120d0 TIM_OC4PreloadConfig - .text.TIM_BDTRConfig - 0x00000000080120f0 0x30 build/obj/stm32f4xx_tim.o - 0x00000000080120f0 TIM_BDTRConfig - .text.TIM_CtrlPWMOutputs - 0x0000000008012120 0x20 build/obj/stm32f4xx_tim.o - 0x0000000008012120 TIM_CtrlPWMOutputs - .text.TIM_CCPreloadControl - 0x0000000008012140 0x20 build/obj/stm32f4xx_tim.o - 0x0000000008012140 TIM_CCPreloadControl - .text.TIM_ClearITPendingBit - 0x0000000008012160 0x10 build/obj/stm32f4xx_tim.o - 0x0000000008012160 TIM_ClearITPendingBit - .text.TIM_SelectInputTrigger - 0x0000000008012170 0x10 build/obj/stm32f4xx_tim.o - 0x0000000008012170 TIM_SelectInputTrigger - .text.TIM_SelectOutputTrigger - 0x0000000008012180 0x20 build/obj/stm32f4xx_tim.o - 0x0000000008012180 TIM_SelectOutputTrigger - .text.TIM_SelectSlaveMode - 0x00000000080121a0 0x20 build/obj/stm32f4xx_tim.o - 0x00000000080121a0 TIM_SelectSlaveMode - .text.TIM_SelectMasterSlaveMode - 0x00000000080121c0 0x20 build/obj/stm32f4xx_tim.o - 0x00000000080121c0 TIM_SelectMasterSlaveMode - .text.WWDG_SetPrescaler - 0x00000000080121e0 0x20 build/obj/stm32f4xx_wwdg.o - 0x00000000080121e0 WWDG_SetPrescaler - .text.WWDG_SetWindowValue - 0x0000000008012200 0x30 build/obj/stm32f4xx_wwdg.o - 0x0000000008012200 WWDG_SetWindowValue - .text.WWDG_SetCounter - 0x0000000008012230 0x10 build/obj/stm32f4xx_wwdg.o - 0x0000000008012230 WWDG_SetCounter - .text.WWDG_Enable - 0x0000000008012240 0x10 build/obj/stm32f4xx_wwdg.o - 0x0000000008012240 WWDG_Enable - .text.startup.main - 0x0000000008012250 0x10 build/obj/main.o - 0x0000000008012250 main - .text.cosf 0x0000000008012260 0x78 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - 0x0000000008012260 cosf - *fill* 0x00000000080122d8 0x8 - .text.sinf 0x00000000080122e0 0x7c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - 0x00000000080122e0 sinf - *fill* 0x000000000801235c 0x4 - .text.sqrtf 0x0000000008012360 0xb8 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - 0x0000000008012360 sqrtf - *fill* 0x0000000008012418 0x8 - .text.__ieee754_rem_pio2f - 0x0000000008012420 0x290 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - 0x0000000008012420 __ieee754_rem_pio2f - .text.__ieee754_sqrtf - 0x00000000080126b0 0xa4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - 0x00000000080126b0 __ieee754_sqrtf - *fill* 0x0000000008012754 0xc - .text.__kernel_cosf - 0x0000000008012760 0x104 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - 0x0000000008012760 __kernel_cosf - *fill* 0x0000000008012864 0xc - .text.__kernel_rem_pio2f - 0x0000000008012870 0x5e4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - 0x0000000008012870 __kernel_rem_pio2f - *fill* 0x0000000008012e54 0xc - .text.__kernel_sinf - 0x0000000008012e60 0x90 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - 0x0000000008012e60 __kernel_sinf - .text.matherr 0x0000000008012ef0 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - 0x0000000008012ef0 matherr - *fill* 0x0000000008012ef4 0xc - .text.fabsf 0x0000000008012f00 0x10 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - 0x0000000008012f00 fabsf - .text.floorf 0x0000000008012f10 0x90 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - 0x0000000008012f10 floorf - .text.__fpclassifyf - 0x0000000008012fa0 0x38 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - 0x0000000008012fa0 __fpclassifyf - *fill* 0x0000000008012fd8 0x8 - .text.scalbnf 0x0000000008012fe0 0xd0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - 0x0000000008012fe0 scalbnf - .text.copysignf - 0x00000000080130b0 0x18 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - 0x00000000080130b0 copysignf - *fill* 0x00000000080130c8 0x8 - .text.__errno 0x00000000080130d0 0xc /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - 0x00000000080130d0 __errno - *fill* 0x00000000080130dc 0x4 - .text.memset 0x00000000080130e0 0x9c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - 0x00000000080130e0 memset - *(.rodata) - *(.rodata.*) - *fill* 0x000000000801317c 0x4 - .rodata.str1.4 - 0x0000000008013180 0x5 build/obj/chsys.o - 0x8 (size before relaxing) - *fill* 0x0000000008013185 0xb - .rodata.ch_debug - 0x0000000008013190 0x18 build/obj/chregistry.o - 0x0000000008013190 ch_debug - *fill* 0x00000000080131a8 0x8 - .rodata.vmt 0x00000000080131b0 0x20 build/obj/serial_usb.o - .rodata.zero_status - 0x00000000080131d0 0x4 build/obj/usb.o - *fill* 0x00000000080131d4 0xc - .rodata.active_status - 0x00000000080131e0 0x4 build/obj/usb.o - *fill* 0x00000000080131e4 0xc - .rodata.halted_status - 0x00000000080131f0 0x4 build/obj/usb.o - *fill* 0x00000000080131f4 0xc - .rodata._stm32_dma_streams - 0x0000000008013200 0xc0 build/obj/stm32_dma.o - 0x0000000008013200 _stm32_dma_streams - .rodata.fsparams - 0x00000000080132c0 0xc build/obj/usb_lld.o - *fill* 0x00000000080132cc 0x4 - .rodata.str1.4 - 0x00000000080132d0 0xd build/obj/usb_lld.o - 0x10 (size before relaxing) - *fill* 0x00000000080132dd 0x3 - .rodata.ep0config - 0x00000000080132e0 0x24 build/obj/usb_lld.o - *fill* 0x0000000008013304 0xc - .rodata.pal_default_config - 0x0000000008013310 0xfc build/obj/board.o - 0x0000000008013310 pal_default_config - *fill* 0x000000000801340c 0x4 - .rodata.str1.4 - 0x0000000008013410 0x20 build/obj/bldc.o - .rodata.mavlink_message_crcs.11197 - 0x0000000008013430 0x100 build/obj/bldc.o - .rodata.str1.4 - 0x0000000008013530 0xc build/obj/mcpwm.o - *fill* 0x000000000801353c 0x4 - .rodata.ep1config - 0x0000000008013540 0x24 build/obj/usb_uart.o - *fill* 0x0000000008013564 0xc - .rodata.vcom_configuration_descriptor - 0x0000000008013570 0x8 build/obj/usb_uart.o - *fill* 0x0000000008013578 0x8 - .rodata.ep2config - 0x0000000008013580 0x24 build/obj/usb_uart.o - *fill* 0x00000000080135a4 0xc - .rodata.usbcfg - 0x00000000080135b0 0x10 build/obj/usb_uart.o - .rodata.vcom_configuration_descriptor_data - 0x00000000080135c0 0x44 build/obj/usb_uart.o - *fill* 0x0000000008013604 0xc - .rodata.vcom_device_descriptor_data - 0x0000000008013610 0x14 build/obj/usb_uart.o - *fill* 0x0000000008013624 0xc - .rodata.vcom_string0 - 0x0000000008013630 0x4 build/obj/usb_uart.o - *fill* 0x0000000008013634 0xc - .rodata.vcom_string1 - 0x0000000008013640 0x28 build/obj/usb_uart.o - *fill* 0x0000000008013668 0x8 - .rodata.vcom_string2 - 0x0000000008013670 0x38 build/obj/usb_uart.o - *fill* 0x00000000080136a8 0x8 - .rodata.vcom_string3 - 0x00000000080136b0 0x8 build/obj/usb_uart.o - *fill* 0x00000000080136b8 0x8 - .rodata.vcom_strings - 0x00000000080136c0 0x20 build/obj/usb_uart.o - .rodata.serusbcfg - 0x00000000080136e0 0x8 build/obj/usb_uart.o - 0x00000000080136e0 serusbcfg - *fill* 0x00000000080136e8 0x8 - .rodata.vcom_device_descriptor - 0x00000000080136f0 0x8 build/obj/usb_uart.o - *fill* 0x00000000080136f8 0x8 - .rodata.flash_sector - 0x0000000008013700 0x18 build/obj/flash_helper.o - *fill* 0x0000000008013718 0x8 - .rodata.flash_addr - 0x0000000008013720 0x30 build/obj/flash_helper.o - .rodata.str1.4 - 0x0000000008013750 0x6 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - 0x8 (size before relaxing) - *fill* 0x0000000008013756 0xa - .rodata.npio2_hw - 0x0000000008013760 0x80 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - .rodata.two_over_pi - 0x00000000080137e0 0x318 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - *fill* 0x0000000008013af8 0x8 - .rodata.init_jk - 0x0000000008013b00 0xc /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - *fill* 0x0000000008013b0c 0x4 - .rodata.PIo2 0x0000000008013b10 0x2c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - *fill* 0x0000000008013b3c 0x4 - .rodata.str1.4 - 0x0000000008013b40 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - *(.glue_7t) - .glue_7t 0x0000000000000000 0x0 linker stubs - *(.glue_7) - .glue_7 0x0000000000000000 0x0 linker stubs - *(.gcc*) - -.vfp11_veneer 0x0000000008013b44 0x0 - .vfp11_veneer 0x0000000000000000 0x0 linker stubs - -.v4_bx 0x0000000008013b44 0x0 - .v4_bx 0x0000000000000000 0x0 linker stubs - -.iplt 0x0000000008013b44 0x0 - .iplt 0x0000000000000000 0x0 build/obj/crt0_v7m.o - -.rel.dyn 0x0000000008013b44 0x0 - .rel.iplt 0x0000000000000000 0x0 build/obj/crt0_v7m.o - -.ARM.extab - *(.ARM.extab* .gnu.linkonce.armextab.*) - -.ARM.exidx 0x0000000008013b44 0x0 - 0x0000000008013b44 PROVIDE (__exidx_start, .) - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - 0x0000000008013b44 PROVIDE (__exidx_end, .) - -.eh_frame_hdr - *(.eh_frame_hdr) - -.eh_frame - *(.eh_frame) - -.textalign 0x0000000008013b44 0x4 - 0x0000000008013b48 . = ALIGN (0x8) - *fill* 0x0000000008013b44 0x4 - 0x0000000008013b48 . = ALIGN (0x4) - 0x0000000008013b48 _etext = . - 0x0000000008013b48 _textdata = _etext - -.mstack 0x0000000020000000 0x400 - 0x0000000020000000 . = ALIGN (0x8) - 0x0000000020000000 __main_stack_base__ = . - 0x0000000020000400 . = (. + __main_stack_size__) - *fill* 0x0000000020000000 0x400 - 0x0000000020000400 . = ALIGN (0x8) - 0x0000000020000400 __main_stack_end__ = . - -.pstack 0x0000000020000400 0x400 - 0x0000000020000400 __process_stack_base__ = . - 0x0000000020000400 __main_thread_stack_base__ = . - 0x0000000020000800 . = (. + __process_stack_size__) - *fill* 0x0000000020000400 0x400 - 0x0000000020000800 . = ALIGN (0x8) - 0x0000000020000800 __process_stack_end__ = . - 0x0000000020000800 __main_thread_stack_end__ = . - -.data 0x0000000020000800 0x43c load address 0x0000000008013b48 - 0x0000000020000800 . = ALIGN (0x4) - 0x0000000020000800 PROVIDE (_data, .) - *(.data) - *(.data.*) - .data.linecoding - 0x0000000020000800 0x8 build/obj/serial_usb.o - .data.switching_frequency_now - 0x0000000020000808 0x4 build/obj/mcpwm.o - 0x0000000020000808 switching_frequency_now - .data.__fdlib_version - 0x000000002000080c 0x1 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_lib_ver.o) - 0x000000002000080c __fdlib_version - *fill* 0x000000002000080d 0x3 - .data.impure_data - 0x0000000020000810 0x428 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - .data._impure_ptr - 0x0000000020000c38 0x4 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - 0x0000000020000c38 _impure_ptr - *(.ramtext) - 0x0000000020000c3c . = ALIGN (0x4) - 0x0000000020000c3c PROVIDE (_edata, .) - -.igot.plt 0x0000000020000c3c 0x0 load address 0x0000000008013f84 - .igot.plt 0x0000000000000000 0x0 build/obj/crt0_v7m.o - -.bss 0x0000000020000c40 0x21e8 load address 0x0000000008013f84 - 0x0000000020000c40 . = ALIGN (0x4) - 0x0000000020000c40 PROVIDE (_bss_start, .) - *(.bss) - *(.bss.*) - .bss.ch 0x0000000020000c40 0x258 build/obj/chschd.o - 0x0000000020000c40 ch - .bss.endmem 0x0000000020000e98 0x4 build/obj/chmemcore.o - .bss.nextmem 0x0000000020000e9c 0x4 build/obj/chmemcore.o - .bss.default_heap - 0x0000000020000ea0 0x20 build/obj/chheap.o - .bss.dma_isr_redir - 0x0000000020000ec0 0x80 build/obj/stm32_dma.o - .bss.dma_streams_mask - 0x0000000020000f40 0x4 build/obj/stm32_dma.o - .bss.CAND1 0x0000000020000f44 0x30 build/obj/can_lld.o - 0x0000000020000f44 CAND1 - .bss.I2CD2 0x0000000020000f74 0x38 build/obj/i2c_lld.o - 0x0000000020000f74 I2CD2 - *fill* 0x0000000020000fac 0x4 - .bss.USBD1 0x0000000020000fb0 0x280 build/obj/usb_lld.o - 0x0000000020000fb0 USBD1 - .bss.ep0_state - 0x0000000020001230 0x14 build/obj/usb_lld.o - .bss.ep0setup_buffer - 0x0000000020001244 0x8 build/obj/usb_lld.o - .bss.ICUD3 0x000000002000124c 0x18 build/obj/icu_lld.o - 0x000000002000124c ICUD3 - .bss.UARTD3 0x0000000020001264 0x1c build/obj/uart_lld.o - 0x0000000020001264 UARTD3 - .bss.UARTD6 0x0000000020001280 0x1c build/obj/uart_lld.o - 0x0000000020001280 UARTD6 - .bss.Ch 0x000000002000129c 0x1 build/obj/bldc.o - 0x000000002000129c Ch - *fill* 0x000000002000129d 0x3 - .bss.m_mavlink_buffer.11151 - 0x00000000200012a0 0x440 build/obj/bldc.o - .bss.uart_thread_wa - 0x00000000200016e0 0x218 build/obj/bldc.o - .bss.m_mavlink_status.11147 - 0x00000000200018f8 0x30 build/obj/bldc.o - .bss.periodic_thread_wa - 0x0000000020001928 0x598 build/obj/bldc.o - .bss.curr0_offset - 0x0000000020001ec0 0x4 build/obj/mcpwm.o - .bss.ADC_Value - 0x0000000020001ec4 0x18 build/obj/mcpwm.o - 0x0000000020001ec4 ADC_Value - .bss.CtrlParm 0x0000000020001edc 0xc build/obj/mcpwm.o - 0x0000000020001edc CtrlParm - .bss.PIParmD 0x0000000020001ee8 0x24 build/obj/mcpwm.o - 0x0000000020001ee8 PIParmD - .bss.curr1_sum - 0x0000000020001f0c 0x4 build/obj/mcpwm.o - .bss.PIParmW 0x0000000020001f10 0x24 build/obj/mcpwm.o - 0x0000000020001f10 PIParmW - *fill* 0x0000000020001f34 0x4 - .bss.SEQUENCE_thread_wa - 0x0000000020001f38 0x998 build/obj/mcpwm.o - .bss.PIParmQ 0x00000000200028d0 0x24 build/obj/mcpwm.o - 0x00000000200028d0 PIParmQ - .bss.uGF 0x00000000200028f4 0x4 build/obj/mcpwm.o - 0x00000000200028f4 uGF - .bss.curr_start_samples - 0x00000000200028f8 0x4 build/obj/mcpwm.o - .bss.Hall_CosSin - 0x00000000200028fc 0x4 build/obj/mcpwm.o - 0x00000000200028fc Hall_CosSin - .bss.dccal_done - 0x0000000020002900 0x1 build/obj/mcpwm.o - *fill* 0x0000000020002901 0x3 - .bss.Hall_Err0 - 0x0000000020002904 0x4 build/obj/mcpwm.o - .bss.Hall_SinCos - 0x0000000020002908 0x4 build/obj/mcpwm.o - 0x0000000020002908 Hall_SinCos - .bss.PIParmPLL - 0x000000002000290c 0x24 build/obj/mcpwm.o - 0x000000002000290c PIParmPLL - .bss.sinth 0x0000000020002930 0x4 build/obj/mcpwm.o - 0x0000000020002930 sinth - .bss.qVdSquared - 0x0000000020002934 0x4 build/obj/mcpwm.o - .bss.DCbus 0x0000000020002938 0x4 build/obj/mcpwm.o - .bss.TargetDCbus - 0x000000002000293c 0x4 build/obj/mcpwm.o - .bss.AccumThetaCnt - 0x0000000020002940 0x2 build/obj/mcpwm.o - 0x0000000020002940 AccumThetaCnt - *fill* 0x0000000020002942 0x2 - .bss.Theta 0x0000000020002944 0x4 build/obj/mcpwm.o - .bss.smc1 0x0000000020002948 0x64 build/obj/mcpwm.o - 0x0000000020002948 smc1 - .bss.ParkParm 0x00000000200029ac 0x40 build/obj/mcpwm.o - 0x00000000200029ac ParkParm - .bss.costh 0x00000000200029ec 0x4 build/obj/mcpwm.o - 0x00000000200029ec costh - .bss.SVGenParm - 0x00000000200029f0 0x24 build/obj/mcpwm.o - 0x00000000200029f0 SVGenParm - .bss.curr1_offset - 0x0000000020002a14 0x4 build/obj/mcpwm.o - .bss.curr0_sum - 0x0000000020002a18 0x4 build/obj/mcpwm.o - .bss.Hall_PIout - 0x0000000020002a1c 0x4 build/obj/mcpwm.o - .bss.fault_now - 0x0000000020002a20 0x1 build/obj/mcpwm.o - *fill* 0x0000000020002a21 0x3 - .bss.HallPLLA 0x0000000020002a24 0x4 build/obj/mcpwm.o - 0x0000000020002a24 HallPLLA - .bss.HallPLLB 0x0000000020002a28 0x4 build/obj/mcpwm.o - 0x0000000020002a28 HallPLLB - .bss.MeasCurrParm - 0x0000000020002a2c 0x10 build/obj/mcpwm.o - .bss.ep2instate - 0x0000000020002a3c 0x14 build/obj/usb_uart.o - .bss.SDU1 0x0000000020002a50 0x258 build/obj/usb_uart.o - 0x0000000020002a50 SDU1 - .bss.ep1instate - 0x0000000020002ca8 0x14 build/obj/usb_uart.o - .bss.ep1outstate - 0x0000000020002cbc 0x14 build/obj/usb_uart.o - .bss.send_mutex - 0x0000000020002cd0 0x10 build/obj/comm_usb.o - .bss.sys_lock_cnt - 0x0000000020002ce0 0x4 build/obj/utils.o - .bss.VirtAddVarTab - 0x0000000020002ce4 0x140 build/obj/conf_general.o - 0x0000000020002ce4 VirtAddVarTab - .bss.DataVar 0x0000000020002e24 0x2 build/obj/eeprom.o - 0x0000000020002e24 DataVar - *(COMMON) - 0x0000000020002e28 . = ALIGN (0x4) - *fill* 0x0000000020002e26 0x2 - 0x0000000020002e28 PROVIDE (_bss_end, .) - 0x0000000020002e28 PROVIDE (end, .) - -.ram0 0x0000000020002e28 0x0 load address 0x0000000008013f84 - 0x0000000020002e28 . = ALIGN (0x4) - *(.ram0) - *(.ram0.*) - 0x0000000020002e28 . = ALIGN (0x4) - 0x0000000020002e28 __ram0_free__ = . - -.ram1 0x0000000020000000 0x0 - 0x0000000020000000 . = ALIGN (0x4) - *(.ram1) - *(.ram1.*) - 0x0000000020000000 . = ALIGN (0x4) - 0x0000000020000000 __ram1_free__ = . - -.ram2 0x000000002001c000 0x0 - 0x000000002001c000 . = ALIGN (0x4) - *(.ram2) - *(.ram2.*) - 0x000000002001c000 . = ALIGN (0x4) - 0x000000002001c000 __ram2_free__ = . - -.ram3 0x0000000000000000 0x0 - 0x0000000000000000 . = ALIGN (0x4) - *(.ram3) - *(.ram3.*) - 0x0000000000000000 . = ALIGN (0x4) - 0x0000000000000000 __ram3_free__ = . - -.ram4 0x0000000010000000 0x0 - 0x0000000010000000 . = ALIGN (0x4) - *(.ram4) - *(.ram4.*) - 0x0000000010000000 . = ALIGN (0x4) - 0x0000000010000000 __ram4_free__ = . - -.ram5 0x0000000040024000 0x0 - 0x0000000040024000 . = ALIGN (0x4) - *(.ram5) - *(.ram5.*) - 0x0000000040024000 . = ALIGN (0x4) - 0x0000000040024000 __ram5_free__ = . - -.ram6 0x0000000000000000 0x0 - 0x0000000000000000 . = ALIGN (0x4) - *(.ram6) - *(.ram6.*) - 0x0000000000000000 . = ALIGN (0x4) - 0x0000000000000000 __ram6_free__ = . - -.ram7 0x0000000000000000 0x0 - 0x0000000000000000 . = ALIGN (0x4) - *(.ram7) - *(.ram7.*) - 0x0000000000000000 . = ALIGN (0x4) - 0x0000000000000000 __ram7_free__ = . - 0x0000000020002e28 __heap_base__ = __ram0_free__ - 0x0000000020020000 __heap_end__ = __ram0_end__ - 0x0000000000000400 __process_stack_size__ = 0x400 - 0x0000000000000400 __main_stack_size__ = 0x400 -LOAD /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++.a -LOAD /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a -START GROUP -LOAD /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a -LOAD /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a -LOAD /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc.a -END GROUP -OUTPUT(build/oroca_bldc.elf elf32-littlearm) - -.ARM.attributes - 0x0000000000000000 0x35 - .ARM.attributes - 0x0000000000000000 0x25 build/obj/crt0_v7m.o - .ARM.attributes - 0x0000000000000025 0x25 build/obj/chcoreasm_v7m.o - .ARM.attributes - 0x000000000000004a 0x39 build/obj/crt1.o - .ARM.attributes - 0x0000000000000083 0x39 build/obj/vectors.o - .ARM.attributes - 0x00000000000000bc 0x39 build/obj/chsys.o - .ARM.attributes - 0x00000000000000f5 0x39 build/obj/chvt.o - .ARM.attributes - 0x000000000000012e 0x39 build/obj/chschd.o - .ARM.attributes - 0x0000000000000167 0x39 build/obj/chthreads.o - .ARM.attributes - 0x00000000000001a0 0x39 build/obj/chtm.o - .ARM.attributes - 0x00000000000001d9 0x39 build/obj/chregistry.o - .ARM.attributes - 0x0000000000000212 0x39 build/obj/chmtx.o - .ARM.attributes - 0x000000000000024b 0x39 build/obj/chevents.o - .ARM.attributes - 0x0000000000000284 0x39 build/obj/chqueues.o - .ARM.attributes - 0x00000000000002bd 0x39 build/obj/chmemcore.o - .ARM.attributes - 0x00000000000002f6 0x39 build/obj/chheap.o - .ARM.attributes - 0x000000000000032f 0x39 build/obj/chcore_v7m.o - .ARM.attributes - 0x0000000000000368 0x39 build/obj/hal.o - .ARM.attributes - 0x00000000000003a1 0x39 build/obj/can.o - .ARM.attributes - 0x00000000000003da 0x39 build/obj/i2c.o - .ARM.attributes - 0x0000000000000413 0x39 build/obj/icu.o - .ARM.attributes - 0x000000000000044c 0x39 build/obj/serial_usb.o - .ARM.attributes - 0x0000000000000485 0x39 build/obj/st.o - .ARM.attributes - 0x00000000000004be 0x39 build/obj/uart.o - .ARM.attributes - 0x00000000000004f7 0x39 build/obj/usb.o - .ARM.attributes - 0x0000000000000530 0x39 build/obj/nvic.o - .ARM.attributes - 0x0000000000000569 0x39 build/obj/stm32_dma.o - .ARM.attributes - 0x00000000000005a2 0x39 build/obj/hal_lld.o - .ARM.attributes - 0x00000000000005db 0x39 build/obj/can_lld.o - .ARM.attributes - 0x0000000000000614 0x39 build/obj/pal_lld.o - .ARM.attributes - 0x000000000000064d 0x39 build/obj/i2c_lld.o - .ARM.attributes - 0x0000000000000686 0x39 build/obj/usb_lld.o - .ARM.attributes - 0x00000000000006bf 0x39 build/obj/icu_lld.o - .ARM.attributes - 0x00000000000006f8 0x39 build/obj/st_lld.o - .ARM.attributes - 0x0000000000000731 0x39 build/obj/uart_lld.o - .ARM.attributes - 0x000000000000076a 0x39 build/obj/board.o - .ARM.attributes - 0x00000000000007a3 0x39 build/obj/bldc.o - .ARM.attributes - 0x00000000000007dc 0x39 build/obj/mcpwm.o - .ARM.attributes - 0x0000000000000815 0x39 build/obj/usb_uart.o - .ARM.attributes - 0x000000000000084e 0x39 build/obj/irq_handlers.o - .ARM.attributes - 0x0000000000000887 0x39 build/obj/comm_usb.o - .ARM.attributes - 0x00000000000008c0 0x39 build/obj/utils.o - .ARM.attributes - 0x00000000000008f9 0x39 build/obj/conf_general.o - .ARM.attributes - 0x0000000000000932 0x39 build/obj/eeprom.o - .ARM.attributes - 0x000000000000096b 0x39 build/obj/flash_helper.o - .ARM.attributes - 0x00000000000009a4 0x39 build/obj/hw_oroca.o - .ARM.attributes - 0x00000000000009dd 0x39 build/obj/misc.o - .ARM.attributes - 0x0000000000000a16 0x39 build/obj/stm32f4xx_adc.o - .ARM.attributes - 0x0000000000000a4f 0x39 build/obj/stm32f4xx_dma.o - .ARM.attributes - 0x0000000000000a88 0x39 build/obj/stm32f4xx_exti.o - .ARM.attributes - 0x0000000000000ac1 0x39 build/obj/stm32f4xx_flash.o - .ARM.attributes - 0x0000000000000afa 0x39 build/obj/stm32f4xx_rcc.o - .ARM.attributes - 0x0000000000000b33 0x39 build/obj/stm32f4xx_tim.o - .ARM.attributes - 0x0000000000000b6c 0x39 build/obj/stm32f4xx_wwdg.o - .ARM.attributes - 0x0000000000000ba5 0x39 build/obj/main.o - .ARM.attributes - 0x0000000000000bde 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - .ARM.attributes - 0x0000000000000c12 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - .ARM.attributes - 0x0000000000000c46 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - .ARM.attributes - 0x0000000000000c7a 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - .ARM.attributes - 0x0000000000000cae 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - .ARM.attributes - 0x0000000000000ce2 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - .ARM.attributes - 0x0000000000000d16 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - .ARM.attributes - 0x0000000000000d4a 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - .ARM.attributes - 0x0000000000000d7e 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_lib_ver.o) - .ARM.attributes - 0x0000000000000db2 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - .ARM.attributes - 0x0000000000000de6 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - .ARM.attributes - 0x0000000000000e1a 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - .ARM.attributes - 0x0000000000000e4e 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - .ARM.attributes - 0x0000000000000e82 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - .ARM.attributes - 0x0000000000000eb6 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - .ARM.attributes - 0x0000000000000eea 0x22 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - .ARM.attributes - 0x0000000000000f0c 0x22 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) - .ARM.attributes - 0x0000000000000f2e 0x22 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_truncdfsf2.o) - .ARM.attributes - 0x0000000000000f50 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - .ARM.attributes - 0x0000000000000f84 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - .ARM.attributes - 0x0000000000000fb8 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memcpy.o) - .ARM.attributes - 0x0000000000000fd8 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - -.comment 0x0000000000000000 0x70 - .comment 0x0000000000000000 0x70 build/obj/crt1.o - 0x71 (size before relaxing) - .comment 0x0000000000000000 0x71 build/obj/vectors.o - .comment 0x0000000000000000 0x71 build/obj/chsys.o - .comment 0x0000000000000000 0x71 build/obj/chvt.o - .comment 0x0000000000000000 0x71 build/obj/chschd.o - .comment 0x0000000000000000 0x71 build/obj/chthreads.o - .comment 0x0000000000000000 0x71 build/obj/chtm.o - .comment 0x0000000000000000 0x71 build/obj/chregistry.o - .comment 0x0000000000000000 0x71 build/obj/chmtx.o - .comment 0x0000000000000000 0x71 build/obj/chevents.o - .comment 0x0000000000000000 0x71 build/obj/chqueues.o - .comment 0x0000000000000000 0x71 build/obj/chmemcore.o - .comment 0x0000000000000000 0x71 build/obj/chheap.o - .comment 0x0000000000000000 0x71 build/obj/chcore_v7m.o - .comment 0x0000000000000000 0x71 build/obj/hal.o - .comment 0x0000000000000000 0x71 build/obj/can.o - .comment 0x0000000000000000 0x71 build/obj/i2c.o - .comment 0x0000000000000000 0x71 build/obj/icu.o - .comment 0x0000000000000000 0x71 build/obj/serial_usb.o - .comment 0x0000000000000000 0x71 build/obj/st.o - .comment 0x0000000000000000 0x71 build/obj/uart.o - .comment 0x0000000000000000 0x71 build/obj/usb.o - .comment 0x0000000000000000 0x71 build/obj/nvic.o - .comment 0x0000000000000000 0x71 build/obj/stm32_dma.o - .comment 0x0000000000000000 0x71 build/obj/hal_lld.o - .comment 0x0000000000000000 0x71 build/obj/can_lld.o - .comment 0x0000000000000000 0x71 build/obj/pal_lld.o - .comment 0x0000000000000000 0x71 build/obj/i2c_lld.o - .comment 0x0000000000000000 0x71 build/obj/usb_lld.o - .comment 0x0000000000000000 0x71 build/obj/icu_lld.o - .comment 0x0000000000000000 0x71 build/obj/st_lld.o - .comment 0x0000000000000000 0x71 build/obj/uart_lld.o - .comment 0x0000000000000000 0x71 build/obj/board.o - .comment 0x0000000000000000 0x71 build/obj/bldc.o - .comment 0x0000000000000000 0x71 build/obj/mcpwm.o - .comment 0x0000000000000000 0x71 build/obj/usb_uart.o - .comment 0x0000000000000000 0x71 build/obj/irq_handlers.o - .comment 0x0000000000000000 0x71 build/obj/comm_usb.o - .comment 0x0000000000000000 0x71 build/obj/utils.o - .comment 0x0000000000000000 0x71 build/obj/conf_general.o - .comment 0x0000000000000000 0x71 build/obj/eeprom.o - .comment 0x0000000000000000 0x71 build/obj/flash_helper.o - .comment 0x0000000000000000 0x71 build/obj/hw_oroca.o - .comment 0x0000000000000000 0x71 build/obj/misc.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_adc.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_dma.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_exti.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_flash.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_rcc.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_tim.o - .comment 0x0000000000000000 0x71 build/obj/stm32f4xx_wwdg.o - .comment 0x0000000000000000 0x71 build/obj/main.o - -.debug_info 0x0000000000000000 0x3a757 - .debug_info 0x0000000000000000 0xde build/obj/crt1.o - .debug_info 0x00000000000000de 0x1e7 build/obj/vectors.o - .debug_info 0x00000000000002c5 0x17e3 build/obj/chsys.o - .debug_info 0x0000000000001aa8 0x7fd build/obj/chvt.o - .debug_info 0x00000000000022a5 0xe6f build/obj/chschd.o - .debug_info 0x0000000000003114 0x1b65 build/obj/chthreads.o - .debug_info 0x0000000000004c79 0xaac build/obj/chtm.o - .debug_info 0x0000000000005725 0xa5c build/obj/chregistry.o - .debug_info 0x0000000000006181 0x10e3 build/obj/chmtx.o - .debug_info 0x0000000000007264 0x16a1 build/obj/chevents.o - .debug_info 0x0000000000008905 0x123c build/obj/chqueues.o - .debug_info 0x0000000000009b41 0x947 build/obj/chmemcore.o - .debug_info 0x000000000000a488 0xaab build/obj/chheap.o - .debug_info 0x000000000000af33 0xcc7 build/obj/chcore_v7m.o - .debug_info 0x000000000000bbfa 0x8f4 build/obj/hal.o - .debug_info 0x000000000000c4ee 0x1ac4 build/obj/can.o - .debug_info 0x000000000000dfb2 0x1232 build/obj/i2c.o - .debug_info 0x000000000000f1e4 0x1232 build/obj/icu.o - .debug_info 0x0000000000010416 0x2832 build/obj/serial_usb.o - .debug_info 0x0000000000012c48 0x9e5 build/obj/st.o - .debug_info 0x000000000001362d 0x1411 build/obj/uart.o - .debug_info 0x0000000000014a3e 0x2977 build/obj/usb.o - .debug_info 0x00000000000173b5 0xabd build/obj/nvic.o - .debug_info 0x0000000000017e72 0x10dc build/obj/stm32_dma.o - .debug_info 0x0000000000018f4e 0x9e1 build/obj/hal_lld.o - .debug_info 0x000000000001992f 0x1e5e build/obj/can_lld.o - .debug_info 0x000000000001b78d 0xd5b build/obj/pal_lld.o - .debug_info 0x000000000001c4e8 0x1db5 build/obj/i2c_lld.o - .debug_info 0x000000000001e29d 0x31d8 build/obj/usb_lld.o - .debug_info 0x0000000000021475 0xfd6 build/obj/icu_lld.o - .debug_info 0x000000000002244b 0x92b build/obj/st_lld.o - .debug_info 0x0000000000022d76 0x139a build/obj/uart_lld.o - .debug_info 0x0000000000024110 0x869 build/obj/board.o - .debug_info 0x0000000000024979 0x1ef6 build/obj/bldc.o - .debug_info 0x000000000002686f 0x3d10 build/obj/mcpwm.o - .debug_info 0x000000000002a57f 0x1cb1 build/obj/usb_uart.o - .debug_info 0x000000000002c230 0xac8 build/obj/irq_handlers.o - .debug_info 0x000000000002ccf8 0x16df build/obj/comm_usb.o - .debug_info 0x000000000002e3d7 0xab6 build/obj/utils.o - .debug_info 0x000000000002ee8d 0x12b0 build/obj/conf_general.o - .debug_info 0x000000000003013d 0xe99 build/obj/eeprom.o - .debug_info 0x0000000000030fd6 0x1fd4 build/obj/flash_helper.o - .debug_info 0x0000000000032faa 0x15ee build/obj/hw_oroca.o - .debug_info 0x0000000000034598 0x545 build/obj/misc.o - .debug_info 0x0000000000034add 0xc6c build/obj/stm32f4xx_adc.o - .debug_info 0x0000000000035749 0x73a build/obj/stm32f4xx_dma.o - .debug_info 0x0000000000035e83 0x33b build/obj/stm32f4xx_exti.o - .debug_info 0x00000000000361be 0xa5f build/obj/stm32f4xx_flash.o - .debug_info 0x0000000000036c1d 0xc05 build/obj/stm32f4xx_rcc.o - .debug_info 0x0000000000037822 0x2406 build/obj/stm32f4xx_tim.o - .debug_info 0x0000000000039c28 0x29e build/obj/stm32f4xx_wwdg.o - .debug_info 0x0000000000039ec6 0x891 build/obj/main.o - -.debug_abbrev 0x0000000000000000 0x94f6 - .debug_abbrev 0x0000000000000000 0x67 build/obj/crt1.o - .debug_abbrev 0x0000000000000067 0xc7 build/obj/vectors.o - .debug_abbrev 0x000000000000012e 0x4e9 build/obj/chsys.o - .debug_abbrev 0x0000000000000617 0x1b1 build/obj/chvt.o - .debug_abbrev 0x00000000000007c8 0x3d3 build/obj/chschd.o - .debug_abbrev 0x0000000000000b9b 0x475 build/obj/chthreads.o - .debug_abbrev 0x0000000000001010 0x277 build/obj/chtm.o - .debug_abbrev 0x0000000000001287 0x238 build/obj/chregistry.o - .debug_abbrev 0x00000000000014bf 0x3d2 build/obj/chmtx.o - .debug_abbrev 0x0000000000001891 0x3b8 build/obj/chevents.o - .debug_abbrev 0x0000000000001c49 0x3e0 build/obj/chqueues.o - .debug_abbrev 0x0000000000002029 0x282 build/obj/chmemcore.o - .debug_abbrev 0x00000000000022ab 0x292 build/obj/chheap.o - .debug_abbrev 0x000000000000253d 0x231 build/obj/chcore_v7m.o - .debug_abbrev 0x000000000000276e 0x1a0 build/obj/hal.o - .debug_abbrev 0x000000000000290e 0x430 build/obj/can.o - .debug_abbrev 0x0000000000002d3e 0x345 build/obj/i2c.o - .debug_abbrev 0x0000000000003083 0x2c9 build/obj/icu.o - .debug_abbrev 0x000000000000334c 0x541 build/obj/serial_usb.o - .debug_abbrev 0x000000000000388d 0x217 build/obj/st.o - .debug_abbrev 0x0000000000003aa4 0x392 build/obj/uart.o - .debug_abbrev 0x0000000000003e36 0x469 build/obj/usb.o - .debug_abbrev 0x000000000000429f 0x1ba build/obj/nvic.o - .debug_abbrev 0x0000000000004459 0x278 build/obj/stm32_dma.o - .debug_abbrev 0x00000000000046d1 0x1c3 build/obj/hal_lld.o - .debug_abbrev 0x0000000000004894 0x481 build/obj/can_lld.o - .debug_abbrev 0x0000000000004d15 0x20c build/obj/pal_lld.o - .debug_abbrev 0x0000000000004f21 0x40e build/obj/i2c_lld.o - .debug_abbrev 0x000000000000532f 0x51c build/obj/usb_lld.o - .debug_abbrev 0x000000000000584b 0x39d build/obj/icu_lld.o - .debug_abbrev 0x0000000000005be8 0x208 build/obj/st_lld.o - .debug_abbrev 0x0000000000005df0 0x428 build/obj/uart_lld.o - .debug_abbrev 0x0000000000006218 0x18b build/obj/board.o - .debug_abbrev 0x00000000000063a3 0x3fc build/obj/bldc.o - .debug_abbrev 0x000000000000679f 0x58b build/obj/mcpwm.o - .debug_abbrev 0x0000000000006d2a 0x3fe build/obj/usb_uart.o - .debug_abbrev 0x0000000000007128 0x206 build/obj/irq_handlers.o - .debug_abbrev 0x000000000000732e 0x26b build/obj/comm_usb.o - .debug_abbrev 0x0000000000007599 0x270 build/obj/utils.o - .debug_abbrev 0x0000000000007809 0x32b build/obj/conf_general.o - .debug_abbrev 0x0000000000007b34 0x336 build/obj/eeprom.o - .debug_abbrev 0x0000000000007e6a 0x3cd build/obj/flash_helper.o - .debug_abbrev 0x0000000000008237 0x236 build/obj/hw_oroca.o - .debug_abbrev 0x000000000000846d 0x156 build/obj/misc.o - .debug_abbrev 0x00000000000085c3 0x1a5 build/obj/stm32f4xx_adc.o - .debug_abbrev 0x0000000000008768 0x175 build/obj/stm32f4xx_dma.o - .debug_abbrev 0x00000000000088dd 0x1b8 build/obj/stm32f4xx_exti.o - .debug_abbrev 0x0000000000008a95 0x1bf build/obj/stm32f4xx_flash.o - .debug_abbrev 0x0000000000008c54 0x260 build/obj/stm32f4xx_rcc.o - .debug_abbrev 0x0000000000008eb4 0x291 build/obj/stm32f4xx_tim.o - .debug_abbrev 0x0000000000009145 0x178 build/obj/stm32f4xx_wwdg.o - .debug_abbrev 0x00000000000092bd 0x239 build/obj/main.o - -.debug_aranges 0x0000000000000000 0x17b8 - .debug_aranges - 0x0000000000000000 0x38 build/obj/crt1.o - .debug_aranges - 0x0000000000000038 0x20 build/obj/vectors.o - .debug_aranges - 0x0000000000000058 0x60 build/obj/chsys.o - .debug_aranges - 0x00000000000000b8 0x30 build/obj/chvt.o - .debug_aranges - 0x00000000000000e8 0x70 build/obj/chschd.o - .debug_aranges - 0x0000000000000158 0xc0 build/obj/chthreads.o - .debug_aranges - 0x0000000000000218 0x40 build/obj/chtm.o - .debug_aranges - 0x0000000000000258 0x28 build/obj/chregistry.o - .debug_aranges - 0x0000000000000280 0x58 build/obj/chmtx.o - .debug_aranges - 0x00000000000002d8 0xa0 build/obj/chevents.o - .debug_aranges - 0x0000000000000378 0x68 build/obj/chqueues.o - .debug_aranges - 0x00000000000003e0 0x38 build/obj/chmemcore.o - .debug_aranges - 0x0000000000000418 0x40 build/obj/chheap.o - .debug_aranges - 0x0000000000000458 0x28 build/obj/chcore_v7m.o - .debug_aranges - 0x0000000000000480 0x20 build/obj/hal.o - .debug_aranges - 0x00000000000004a0 0x58 build/obj/can.o - .debug_aranges - 0x00000000000004f8 0x60 build/obj/i2c.o - .debug_aranges - 0x0000000000000558 0x60 build/obj/icu.o - .debug_aranges - 0x00000000000005b8 0xb0 build/obj/serial_usb.o - .debug_aranges - 0x0000000000000668 0x40 build/obj/st.o - .debug_aranges - 0x00000000000006a8 0x78 build/obj/uart.o - .debug_aranges - 0x0000000000000720 0xa8 build/obj/usb.o - .debug_aranges - 0x00000000000007c8 0x38 build/obj/nvic.o - .debug_aranges - 0x0000000000000800 0xb0 build/obj/stm32_dma.o - .debug_aranges - 0x00000000000008b0 0x28 build/obj/hal_lld.o - .debug_aranges - 0x00000000000008d8 0x90 build/obj/can_lld.o - .debug_aranges - 0x0000000000000968 0x28 build/obj/pal_lld.o - .debug_aranges - 0x0000000000000990 0x60 build/obj/i2c_lld.o - .debug_aranges - 0x00000000000009f0 0xd0 build/obj/usb_lld.o - .debug_aranges - 0x0000000000000ac0 0x68 build/obj/icu_lld.o - .debug_aranges - 0x0000000000000b28 0x28 build/obj/st_lld.o - .debug_aranges - 0x0000000000000b50 0x80 build/obj/uart_lld.o - .debug_aranges - 0x0000000000000bd0 0x28 build/obj/board.o - .debug_aranges - 0x0000000000000bf8 0x48 build/obj/bldc.o - .debug_aranges - 0x0000000000000c40 0xc8 build/obj/mcpwm.o - .debug_aranges - 0x0000000000000d08 0x50 build/obj/usb_uart.o - .debug_aranges - 0x0000000000000d58 0x30 build/obj/irq_handlers.o - .debug_aranges - 0x0000000000000d88 0x20 build/obj/comm_usb.o - .debug_aranges - 0x0000000000000da8 0x60 build/obj/utils.o - .debug_aranges - 0x0000000000000e08 0x48 build/obj/conf_general.o - .debug_aranges - 0x0000000000000e50 0x48 build/obj/eeprom.o - .debug_aranges - 0x0000000000000e98 0x38 build/obj/flash_helper.o - .debug_aranges - 0x0000000000000ed0 0x40 build/obj/hw_oroca.o - .debug_aranges - 0x0000000000000f10 0x40 build/obj/misc.o - .debug_aranges - 0x0000000000000f50 0x148 build/obj/stm32f4xx_adc.o - .debug_aranges - 0x0000000000001098 0xb0 build/obj/stm32f4xx_dma.o - .debug_aranges - 0x0000000000001148 0x58 build/obj/stm32f4xx_exti.o - .debug_aranges - 0x00000000000011a0 0x158 build/obj/stm32f4xx_flash.o - .debug_aranges - 0x00000000000012f8 0x160 build/obj/stm32f4xx_rcc.o - .debug_aranges - 0x0000000000001458 0x2d8 build/obj/stm32f4xx_tim.o - .debug_aranges - 0x0000000000001730 0x58 build/obj/stm32f4xx_wwdg.o - .debug_aranges - 0x0000000000001788 0x30 build/obj/main.o - -.debug_ranges 0x0000000000000000 0x2950 - .debug_ranges 0x0000000000000000 0x28 build/obj/crt1.o - .debug_ranges 0x0000000000000028 0x10 build/obj/vectors.o - .debug_ranges 0x0000000000000038 0x148 build/obj/chsys.o - .debug_ranges 0x0000000000000180 0x20 build/obj/chvt.o - .debug_ranges 0x00000000000001a0 0x1c0 build/obj/chschd.o - .debug_ranges 0x0000000000000360 0x218 build/obj/chthreads.o - .debug_ranges 0x0000000000000578 0xc0 build/obj/chtm.o - .debug_ranges 0x0000000000000638 0x18 build/obj/chregistry.o - .debug_ranges 0x0000000000000650 0x1a0 build/obj/chmtx.o - .debug_ranges 0x00000000000007f0 0xd8 build/obj/chevents.o - .debug_ranges 0x00000000000008c8 0x148 build/obj/chqueues.o - .debug_ranges 0x0000000000000a10 0x28 build/obj/chmemcore.o - .debug_ranges 0x0000000000000a38 0x30 build/obj/chheap.o - .debug_ranges 0x0000000000000a68 0x18 build/obj/chcore_v7m.o - .debug_ranges 0x0000000000000a80 0x10 build/obj/hal.o - .debug_ranges 0x0000000000000a90 0xd8 build/obj/can.o - .debug_ranges 0x0000000000000b68 0x80 build/obj/i2c.o - .debug_ranges 0x0000000000000be8 0xc8 build/obj/icu.o - .debug_ranges 0x0000000000000cb0 0xd8 build/obj/serial_usb.o - .debug_ranges 0x0000000000000d88 0x30 build/obj/st.o - .debug_ranges 0x0000000000000db8 0xf8 build/obj/uart.o - .debug_ranges 0x0000000000000eb0 0x170 build/obj/usb.o - .debug_ranges 0x0000000000001020 0x28 build/obj/nvic.o - .debug_ranges 0x0000000000001048 0xa0 build/obj/stm32_dma.o - .debug_ranges 0x00000000000010e8 0x38 build/obj/hal_lld.o - .debug_ranges 0x0000000000001120 0xf8 build/obj/can_lld.o - .debug_ranges 0x0000000000001218 0x120 build/obj/pal_lld.o - .debug_ranges 0x0000000000001338 0x1d8 build/obj/i2c_lld.o - .debug_ranges 0x0000000000001510 0x358 build/obj/usb_lld.o - .debug_ranges 0x0000000000001868 0x70 build/obj/icu_lld.o - .debug_ranges 0x00000000000018d8 0x18 build/obj/st_lld.o - .debug_ranges 0x00000000000018f0 0x118 build/obj/uart_lld.o - .debug_ranges 0x0000000000001a08 0x18 build/obj/board.o - .debug_ranges 0x0000000000001a20 0x2c0 build/obj/bldc.o - .debug_ranges 0x0000000000001ce0 0x158 build/obj/mcpwm.o - .debug_ranges 0x0000000000001e38 0x40 build/obj/usb_uart.o - .debug_ranges 0x0000000000001e78 0x20 build/obj/irq_handlers.o - .debug_ranges 0x0000000000001e98 0x10 build/obj/comm_usb.o - .debug_ranges 0x0000000000001ea8 0x50 build/obj/utils.o - .debug_ranges 0x0000000000001ef8 0x68 build/obj/conf_general.o - .debug_ranges 0x0000000000001f60 0x80 build/obj/eeprom.o - .debug_ranges 0x0000000000001fe0 0x58 build/obj/flash_helper.o - .debug_ranges 0x0000000000002038 0x48 build/obj/hw_oroca.o - .debug_ranges 0x0000000000002080 0x30 build/obj/misc.o - .debug_ranges 0x00000000000020b0 0x138 build/obj/stm32f4xx_adc.o - .debug_ranges 0x00000000000021e8 0xa0 build/obj/stm32f4xx_dma.o - .debug_ranges 0x0000000000002288 0x48 build/obj/stm32f4xx_exti.o - .debug_ranges 0x00000000000022d0 0x148 build/obj/stm32f4xx_flash.o - .debug_ranges 0x0000000000002418 0x170 build/obj/stm32f4xx_rcc.o - .debug_ranges 0x0000000000002588 0x360 build/obj/stm32f4xx_tim.o - .debug_ranges 0x00000000000028e8 0x48 build/obj/stm32f4xx_wwdg.o - .debug_ranges 0x0000000000002930 0x20 build/obj/main.o - -.debug_line 0x0000000000000000 0xe328 - .debug_line 0x0000000000000000 0x168 build/obj/crt1.o - .debug_line 0x0000000000000168 0x13d build/obj/vectors.o - .debug_line 0x00000000000002a5 0x4f3 build/obj/chsys.o - .debug_line 0x0000000000000798 0x255 build/obj/chvt.o - .debug_line 0x00000000000009ed 0x4ed build/obj/chschd.o - .debug_line 0x0000000000000eda 0x6d7 build/obj/chthreads.o - .debug_line 0x00000000000015b1 0x2d3 build/obj/chtm.o - .debug_line 0x0000000000001884 0x2cd build/obj/chregistry.o - .debug_line 0x0000000000001b51 0x474 build/obj/chmtx.o - .debug_line 0x0000000000001fc5 0x506 build/obj/chevents.o - .debug_line 0x00000000000024cb 0x4d0 build/obj/chqueues.o - .debug_line 0x000000000000299b 0x2c5 build/obj/chmemcore.o - .debug_line 0x0000000000002c60 0x32e build/obj/chheap.o - .debug_line 0x0000000000002f8e 0x254 build/obj/chcore_v7m.o - .debug_line 0x00000000000031e2 0x354 build/obj/hal.o - .debug_line 0x0000000000003536 0x489 build/obj/can.o - .debug_line 0x00000000000039bf 0x47d build/obj/i2c.o - .debug_line 0x0000000000003e3c 0x3fb build/obj/icu.o - .debug_line 0x0000000000004237 0x5e4 build/obj/serial_usb.o - .debug_line 0x000000000000481b 0x2a0 build/obj/st.o - .debug_line 0x0000000000004abb 0x50c build/obj/uart.o - .debug_line 0x0000000000004fc7 0x6d1 build/obj/usb.o - .debug_line 0x0000000000005698 0x24a build/obj/nvic.o - .debug_line 0x00000000000058e2 0x505 build/obj/stm32_dma.o - .debug_line 0x0000000000005de7 0x317 build/obj/hal_lld.o - .debug_line 0x00000000000060fe 0x630 build/obj/can_lld.o - .debug_line 0x000000000000672e 0x2e6 build/obj/pal_lld.o - .debug_line 0x0000000000006a14 0x6e0 build/obj/i2c_lld.o - .debug_line 0x00000000000070f4 0x94d build/obj/usb_lld.o - .debug_line 0x0000000000007a41 0x480 build/obj/icu_lld.o - .debug_line 0x0000000000007ec1 0x2bb build/obj/st_lld.o - .debug_line 0x000000000000817c 0x6a7 build/obj/uart_lld.o - .debug_line 0x0000000000008823 0x2ea build/obj/board.o - .debug_line 0x0000000000008b0d 0x6a2 build/obj/bldc.o - .debug_line 0x00000000000091af 0x9b1 build/obj/mcpwm.o - .debug_line 0x0000000000009b60 0x3c7 build/obj/usb_uart.o - .debug_line 0x0000000000009f27 0x2d1 build/obj/irq_handlers.o - .debug_line 0x000000000000a1f8 0x2ea build/obj/comm_usb.o - .debug_line 0x000000000000a4e2 0x326 build/obj/utils.o - .debug_line 0x000000000000a808 0x4a6 build/obj/conf_general.o - .debug_line 0x000000000000acae 0x403 build/obj/eeprom.o - .debug_line 0x000000000000b0b1 0x4e7 build/obj/flash_helper.o - .debug_line 0x000000000000b598 0x4a5 build/obj/hw_oroca.o - .debug_line 0x000000000000ba3d 0x203 build/obj/misc.o - .debug_line 0x000000000000bc40 0x54c build/obj/stm32f4xx_adc.o - .debug_line 0x000000000000c18c 0x3fd build/obj/stm32f4xx_dma.o - .debug_line 0x000000000000c589 0x26b build/obj/stm32f4xx_exti.o - .debug_line 0x000000000000c7f4 0x54e build/obj/stm32f4xx_flash.o - .debug_line 0x000000000000cd42 0x52d build/obj/stm32f4xx_rcc.o - .debug_line 0x000000000000d26f 0xbe7 build/obj/stm32f4xx_tim.o - .debug_line 0x000000000000de56 0x23c build/obj/stm32f4xx_wwdg.o - .debug_line 0x000000000000e092 0x296 build/obj/main.o - -.debug_str 0x0000000000000000 0x83e7 - .debug_str 0x0000000000000000 0x22e build/obj/crt1.o - 0x26a (size before relaxing) - .debug_str 0x000000000000022e 0x16e build/obj/vectors.o - 0x377 (size before relaxing) - .debug_str 0x000000000000039c 0xdb3 build/obj/chsys.o - 0x1064 (size before relaxing) - .debug_str 0x000000000000114f 0x48 build/obj/chvt.o - 0x5de (size before relaxing) - .debug_str 0x0000000000001197 0x13c build/obj/chschd.o - 0x78b (size before relaxing) - .debug_str 0x00000000000012d3 0x223 build/obj/chthreads.o - 0x8c7 (size before relaxing) - .debug_str 0x00000000000014f6 0xc0 build/obj/chtm.o - 0x71c (size before relaxing) - .debug_str 0x00000000000015b6 0x4a build/obj/chregistry.o - 0x728 (size before relaxing) - .debug_str 0x0000000000001600 0xb2 build/obj/chmtx.o - 0x6ec (size before relaxing) - .debug_str 0x00000000000016b2 0x1f9 build/obj/chevents.o - 0x819 (size before relaxing) - .debug_str 0x00000000000018ab 0x17b build/obj/chqueues.o - 0x7a4 (size before relaxing) - .debug_str 0x0000000000001a26 0x7c build/obj/chmemcore.o - 0x65a (size before relaxing) - .debug_str 0x0000000000001aa2 0xc4 build/obj/chheap.o - 0x692 (size before relaxing) - .debug_str 0x0000000000001b66 0xd4 build/obj/chcore_v7m.o - 0x729 (size before relaxing) - .debug_str 0x0000000000001c3a 0x125 build/obj/hal.o - 0x6a9 (size before relaxing) - .debug_str 0x0000000000001d5f 0x358 build/obj/can.o - 0xa90 (size before relaxing) - .debug_str 0x00000000000020b7 0x30a build/obj/i2c.o - 0x968 (size before relaxing) - .debug_str 0x00000000000023c1 0x28f build/obj/icu.o - 0x89d (size before relaxing) - .debug_str 0x0000000000002650 0x818 build/obj/serial_usb.o - 0x10e8 (size before relaxing) - .debug_str 0x0000000000002e68 0xac build/obj/st.o - 0x681 (size before relaxing) - .debug_str 0x0000000000002f14 0x282 build/obj/uart.o - 0x919 (size before relaxing) - .debug_str 0x0000000000003196 0x2c6 build/obj/usb.o - 0x1072 (size before relaxing) - .debug_str 0x000000000000345c 0x85 build/obj/nvic.o - 0x6d6 (size before relaxing) - .debug_str 0x00000000000034e1 0x246 build/obj/stm32_dma.o - 0xdb7 (size before relaxing) - .debug_str 0x0000000000003727 0xa4 build/obj/hal_lld.o - 0x745 (size before relaxing) - .debug_str 0x00000000000037cb 0x134 build/obj/can_lld.o - 0xc14 (size before relaxing) - .debug_str 0x00000000000038ff 0xd5 build/obj/pal_lld.o - 0x809 (size before relaxing) - .debug_str 0x00000000000039d4 0x170 build/obj/i2c_lld.o - 0x113c (size before relaxing) - .debug_str 0x0000000000003b44 0x218 build/obj/usb_lld.o - 0x1329 (size before relaxing) - .debug_str 0x0000000000003d5c 0x72 build/obj/icu_lld.o - 0x995 (size before relaxing) - .debug_str 0x0000000000003dce 0x6f build/obj/st_lld.o - 0x6ea (size before relaxing) - .debug_str 0x0000000000003e3d 0xe6 build/obj/uart_lld.o - 0xa7c (size before relaxing) - .debug_str 0x0000000000003f23 0x3d build/obj/board.o - 0x684 (size before relaxing) - .debug_str 0x0000000000003f60 0xe48 build/obj/bldc.o - 0x14c9 (size before relaxing) - .debug_str 0x0000000000004da8 0x131d build/obj/mcpwm.o - 0x23f3 (size before relaxing) - .debug_str 0x00000000000060c5 0x19e build/obj/usb_uart.o - 0x1055 (size before relaxing) - .debug_str 0x0000000000006263 0x88 build/obj/irq_handlers.o - 0x712 (size before relaxing) - .debug_str 0x00000000000062eb 0x91 build/obj/comm_usb.o - 0xe61 (size before relaxing) - .debug_str 0x000000000000637c 0xdc build/obj/utils.o - 0x70b (size before relaxing) - .debug_str 0x0000000000006458 0x18a build/obj/conf_general.o - 0x103a (size before relaxing) - .debug_str 0x00000000000065e2 0x18b build/obj/eeprom.o - 0x82f (size before relaxing) - .debug_str 0x000000000000676d 0x131 build/obj/flash_helper.o - 0x121b (size before relaxing) - .debug_str 0x000000000000689e 0x87 build/obj/hw_oroca.o - 0x96e (size before relaxing) - .debug_str 0x0000000000006925 0xfe build/obj/misc.o - 0x491 (size before relaxing) - .debug_str 0x0000000000006a23 0x3d9 build/obj/stm32f4xx_adc.o - 0x8de (size before relaxing) - .debug_str 0x0000000000006dfc 0x214 build/obj/stm32f4xx_dma.o - 0x605 (size before relaxing) - .debug_str 0x0000000000007010 0x198 build/obj/stm32f4xx_exti.o - 0x40f (size before relaxing) - .debug_str 0x00000000000071a8 0x38c build/obj/stm32f4xx_flash.o - 0x762 (size before relaxing) - .debug_str 0x0000000000007534 0x489 build/obj/stm32f4xx_rcc.o - 0x898 (size before relaxing) - .debug_str 0x00000000000079bd 0x7d2 build/obj/stm32f4xx_tim.o - 0xe26 (size before relaxing) - .debug_str 0x000000000000818f 0x95 build/obj/stm32f4xx_wwdg.o - 0x361 (size before relaxing) - .debug_str 0x0000000000008224 0x1c3 build/obj/main.o - 0x68d (size before relaxing) - -.debug_frame 0x0000000000000000 0x4428 - .debug_frame 0x0000000000000000 0x50 build/obj/crt1.o - .debug_frame 0x0000000000000050 0x20 build/obj/vectors.o - .debug_frame 0x0000000000000070 0xfc build/obj/chsys.o - .debug_frame 0x000000000000016c 0x68 build/obj/chvt.o - .debug_frame 0x00000000000001d4 0x164 build/obj/chschd.o - .debug_frame 0x0000000000000338 0x274 build/obj/chthreads.o - .debug_frame 0x00000000000005ac 0xc8 build/obj/chtm.o - .debug_frame 0x0000000000000674 0x3c build/obj/chregistry.o - .debug_frame 0x00000000000006b0 0xf8 build/obj/chmtx.o - .debug_frame 0x00000000000007a8 0x1d0 build/obj/chevents.o - .debug_frame 0x0000000000000978 0x168 build/obj/chqueues.o - .debug_frame 0x0000000000000ae0 0x68 build/obj/chmemcore.o - .debug_frame 0x0000000000000b48 0xc0 build/obj/chheap.o - .debug_frame 0x0000000000000c08 0x3c build/obj/chcore_v7m.o - .debug_frame 0x0000000000000c44 0x30 build/obj/hal.o - .debug_frame 0x0000000000000c74 0x104 build/obj/can.o - .debug_frame 0x0000000000000d78 0xe8 build/obj/i2c.o - .debug_frame 0x0000000000000e60 0xf4 build/obj/icu.o - .debug_frame 0x0000000000000f54 0x1d8 build/obj/serial_usb.o - .debug_frame 0x000000000000112c 0x60 build/obj/st.o - .debug_frame 0x000000000000118c 0x148 build/obj/uart.o - .debug_frame 0x00000000000012d4 0x234 build/obj/usb.o - .debug_frame 0x0000000000001508 0x68 build/obj/nvic.o - .debug_frame 0x0000000000001570 0x274 build/obj/stm32_dma.o - .debug_frame 0x00000000000017e4 0x3c build/obj/hal_lld.o - .debug_frame 0x0000000000001820 0x1d4 build/obj/can_lld.o - .debug_frame 0x00000000000019f4 0x70 build/obj/pal_lld.o - .debug_frame 0x0000000000001a64 0x1d0 build/obj/i2c_lld.o - .debug_frame 0x0000000000001c34 0x2c4 build/obj/usb_lld.o - .debug_frame 0x0000000000001ef8 0x130 build/obj/icu_lld.o - .debug_frame 0x0000000000002028 0x40 build/obj/st_lld.o - .debug_frame 0x0000000000002068 0x1d4 build/obj/uart_lld.o - .debug_frame 0x000000000000223c 0x30 build/obj/board.o - .debug_frame 0x000000000000226c 0xe0 build/obj/bldc.o - .debug_frame 0x000000000000234c 0x32c build/obj/mcpwm.o - .debug_frame 0x0000000000002678 0x100 build/obj/usb_uart.o - .debug_frame 0x0000000000002778 0x70 build/obj/irq_handlers.o - .debug_frame 0x00000000000027e8 0x30 build/obj/comm_usb.o - .debug_frame 0x0000000000002818 0xcc build/obj/utils.o - .debug_frame 0x00000000000028e4 0xf0 build/obj/conf_general.o - .debug_frame 0x00000000000029d4 0x110 build/obj/eeprom.o - .debug_frame 0x0000000000002ae4 0x90 build/obj/flash_helper.o - .debug_frame 0x0000000000002b74 0xfc build/obj/hw_oroca.o - .debug_frame 0x0000000000002c70 0x7c build/obj/misc.o - .debug_frame 0x0000000000002cec 0x308 build/obj/stm32f4xx_adc.o - .debug_frame 0x0000000000002ff4 0x1d0 build/obj/stm32f4xx_dma.o - .debug_frame 0x00000000000031c4 0xc4 build/obj/stm32f4xx_exti.o - .debug_frame 0x0000000000003288 0x380 build/obj/stm32f4xx_flash.o - .debug_frame 0x0000000000003608 0x2b8 build/obj/stm32f4xx_rcc.o - .debug_frame 0x00000000000038c0 0x770 build/obj/stm32f4xx_tim.o - .debug_frame 0x0000000000004030 0xa8 build/obj/stm32f4xx_wwdg.o - .debug_frame 0x00000000000040d8 0x4c build/obj/main.o - .debug_frame 0x0000000000004124 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - .debug_frame 0x0000000000004158 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - .debug_frame 0x000000000000418c 0x50 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - .debug_frame 0x00000000000041dc 0x3c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - .debug_frame 0x0000000000004218 0x3c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - .debug_frame 0x0000000000004254 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - .debug_frame 0x0000000000004274 0x5c /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - .debug_frame 0x00000000000042d0 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - .debug_frame 0x00000000000042f0 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - .debug_frame 0x0000000000004310 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - .debug_frame 0x0000000000004330 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - .debug_frame 0x0000000000004350 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - .debug_frame 0x0000000000004370 0x44 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - .debug_frame 0x00000000000043b4 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - .debug_frame 0x00000000000043d4 0x20 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - .debug_frame 0x00000000000043f4 0x34 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - -.debug_loc 0x0000000000000000 0xe02b - .debug_loc 0x0000000000000000 0x303 build/obj/chsys.o - .debug_loc 0x0000000000000303 0x9f build/obj/chvt.o - .debug_loc 0x00000000000003a2 0x371 build/obj/chschd.o - .debug_loc 0x0000000000000713 0xa5a build/obj/chthreads.o - .debug_loc 0x000000000000116d 0xb7 build/obj/chtm.o - .debug_loc 0x0000000000001224 0x3f build/obj/chregistry.o - .debug_loc 0x0000000000001263 0x5d6 build/obj/chmtx.o - .debug_loc 0x0000000000001839 0x61d build/obj/chevents.o - .debug_loc 0x0000000000001e56 0x653 build/obj/chqueues.o - .debug_loc 0x00000000000024a9 0xb0 build/obj/chmemcore.o - .debug_loc 0x0000000000002559 0x387 build/obj/chheap.o - .debug_loc 0x00000000000028e0 0xc7 build/obj/chcore_v7m.o - .debug_loc 0x00000000000029a7 0x2bc build/obj/can.o - .debug_loc 0x0000000000002c63 0x29a build/obj/i2c.o - .debug_loc 0x0000000000002efd 0xf9 build/obj/icu.o - .debug_loc 0x0000000000002ff6 0x92d build/obj/serial_usb.o - .debug_loc 0x0000000000003923 0x335 build/obj/uart.o - .debug_loc 0x0000000000003c58 0xde1 build/obj/usb.o - .debug_loc 0x0000000000004a39 0xee build/obj/nvic.o - .debug_loc 0x0000000000004b27 0x276 build/obj/stm32_dma.o - .debug_loc 0x0000000000004d9d 0x636 build/obj/can_lld.o - .debug_loc 0x00000000000053d3 0x129 build/obj/pal_lld.o - .debug_loc 0x00000000000054fc 0xaa9 build/obj/i2c_lld.o - .debug_loc 0x0000000000005fa5 0x112c build/obj/usb_lld.o - .debug_loc 0x00000000000070d1 0x2a3 build/obj/icu_lld.o - .debug_loc 0x0000000000007374 0x3ef build/obj/uart_lld.o - .debug_loc 0x0000000000007763 0x98b build/obj/bldc.o - .debug_loc 0x00000000000080ee 0x3df build/obj/mcpwm.o - .debug_loc 0x00000000000084cd 0x1b9 build/obj/usb_uart.o - .debug_loc 0x0000000000008686 0x296 build/obj/utils.o - .debug_loc 0x000000000000891c 0x2c9 build/obj/conf_general.o - .debug_loc 0x0000000000008be5 0x8a1 build/obj/eeprom.o - .debug_loc 0x0000000000009486 0x24c build/obj/flash_helper.o - .debug_loc 0x00000000000096d2 0x41 build/obj/hw_oroca.o - .debug_loc 0x0000000000009713 0x161 build/obj/misc.o - .debug_loc 0x0000000000009874 0xa81 build/obj/stm32f4xx_adc.o - .debug_loc 0x000000000000a2f5 0x480 build/obj/stm32f4xx_dma.o - .debug_loc 0x000000000000a775 0x1a1 build/obj/stm32f4xx_exti.o - .debug_loc 0x000000000000a916 0x8b7 build/obj/stm32f4xx_flash.o - .debug_loc 0x000000000000b1cd 0x9f2 build/obj/stm32f4xx_rcc.o - .debug_loc 0x000000000000bbbf 0x239b build/obj/stm32f4xx_tim.o - .debug_loc 0x000000000000df5a 0xd1 build/obj/stm32f4xx_wwdg.o - -Cross Reference Table - -Symbol File -ADC_AnalogWatchdogCmd build/obj/stm32f4xx_adc.o -ADC_AnalogWatchdogSingleChannelConfig build/obj/stm32f4xx_adc.o -ADC_AnalogWatchdogThresholdsConfig build/obj/stm32f4xx_adc.o -ADC_AutoInjectedConvCmd build/obj/stm32f4xx_adc.o -ADC_ClearFlag build/obj/stm32f4xx_adc.o -ADC_ClearITPendingBit build/obj/stm32f4xx_adc.o - build/obj/irq_handlers.o -ADC_Cmd build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_CommonInit build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_CommonStructInit build/obj/stm32f4xx_adc.o -ADC_ContinuousModeCmd build/obj/stm32f4xx_adc.o -ADC_DMACmd build/obj/stm32f4xx_adc.o -ADC_DMARequestAfterLastTransferCmd build/obj/stm32f4xx_adc.o -ADC_DeInit build/obj/stm32f4xx_adc.o -ADC_DiscModeChannelCountConfig build/obj/stm32f4xx_adc.o -ADC_DiscModeCmd build/obj/stm32f4xx_adc.o -ADC_EOCOnEachRegularChannelCmd build/obj/stm32f4xx_adc.o -ADC_ExternalTrigInjectedConvConfig build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_ExternalTrigInjectedConvEdgeConfig build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_GetConversionValue build/obj/stm32f4xx_adc.o -ADC_GetFlagStatus build/obj/stm32f4xx_adc.o -ADC_GetITStatus build/obj/stm32f4xx_adc.o -ADC_GetInjectedConversionValue build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_GetMultiModeConversionValue build/obj/stm32f4xx_adc.o -ADC_GetSoftwareStartConvStatus build/obj/stm32f4xx_adc.o -ADC_GetSoftwareStartInjectedConvCmdStatus build/obj/stm32f4xx_adc.o -ADC_ITConfig build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_Init build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_InjectedChannelConfig build/obj/stm32f4xx_adc.o - build/obj/hw_oroca.o -ADC_InjectedDiscModeCmd build/obj/stm32f4xx_adc.o -ADC_InjectedSequencerLengthConfig build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_MultiModeDMARequestAfterLastTransferCmd build/obj/stm32f4xx_adc.o - build/obj/mcpwm.o -ADC_RegularChannelConfig build/obj/stm32f4xx_adc.o - build/obj/hw_oroca.o -ADC_SetInjectedOffset build/obj/stm32f4xx_adc.o -ADC_SoftwareStartConv build/obj/stm32f4xx_adc.o -ADC_SoftwareStartInjectedConv build/obj/stm32f4xx_adc.o -ADC_StructInit build/obj/stm32f4xx_adc.o -ADC_TempSensorVrefintCmd build/obj/stm32f4xx_adc.o -ADC_VBATCmd build/obj/stm32f4xx_adc.o -ADC_Value build/obj/mcpwm.o -AccumTheta build/obj/mcpwm.o -AccumThetaCnt build/obj/mcpwm.o -BusFault_Handler build/obj/vectors.o -CAND1 build/obj/can_lld.o -CalcPI build/obj/mcpwm.o -CalcRefVec build/obj/mcpwm.o -CalcSVGen build/obj/mcpwm.o -CalcTimes build/obj/mcpwm.o -Ch build/obj/bldc.o -ClarkePark build/obj/mcpwm.o -CtrlParm build/obj/mcpwm.o -DMA_ClearFlag build/obj/stm32f4xx_dma.o -DMA_ClearITPendingBit build/obj/stm32f4xx_dma.o -DMA_Cmd build/obj/stm32f4xx_dma.o - build/obj/mcpwm.o -DMA_DeInit build/obj/stm32f4xx_dma.o -DMA_DoubleBufferModeCmd build/obj/stm32f4xx_dma.o -DMA_DoubleBufferModeConfig build/obj/stm32f4xx_dma.o -DMA_FlowControllerConfig build/obj/stm32f4xx_dma.o -DMA_GetCmdStatus build/obj/stm32f4xx_dma.o -DMA_GetCurrDataCounter build/obj/stm32f4xx_dma.o -DMA_GetCurrentMemoryTarget build/obj/stm32f4xx_dma.o -DMA_GetFIFOStatus build/obj/stm32f4xx_dma.o -DMA_GetFlagStatus build/obj/stm32f4xx_dma.o -DMA_GetITStatus build/obj/stm32f4xx_dma.o -DMA_ITConfig build/obj/stm32f4xx_dma.o - build/obj/mcpwm.o -DMA_Init build/obj/stm32f4xx_dma.o - build/obj/mcpwm.o -DMA_MemoryTargetConfig build/obj/stm32f4xx_dma.o -DMA_PeriphIncOffsetSizeConfig build/obj/stm32f4xx_dma.o -DMA_SetCurrDataCounter build/obj/stm32f4xx_dma.o -DMA_StructInit build/obj/stm32f4xx_dma.o -DataVar build/obj/eeprom.o -DebugMon_Handler build/obj/vectors.o -DoControl build/obj/mcpwm.o -Drive_Status build/obj/mcpwm.o -EE_Init build/obj/eeprom.o - build/obj/conf_general.o -EE_ReadVariable build/obj/eeprom.o - build/obj/conf_general.o -EE_WriteVariable build/obj/eeprom.o - build/obj/conf_general.o -EXTI_ClearFlag build/obj/stm32f4xx_exti.o -EXTI_ClearITPendingBit build/obj/stm32f4xx_exti.o - build/obj/irq_handlers.o -EXTI_DeInit build/obj/stm32f4xx_exti.o -EXTI_GenerateSWInterrupt build/obj/stm32f4xx_exti.o -EXTI_GetFlagStatus build/obj/stm32f4xx_exti.o -EXTI_GetITStatus build/obj/stm32f4xx_exti.o - build/obj/irq_handlers.o -EXTI_Init build/obj/stm32f4xx_exti.o -EXTI_StructInit build/obj/stm32f4xx_exti.o -FLASH_ClearFlag build/obj/stm32f4xx_flash.o - build/obj/flash_helper.o - build/obj/conf_general.o -FLASH_DataCacheCmd build/obj/stm32f4xx_flash.o -FLASH_DataCacheReset build/obj/stm32f4xx_flash.o -FLASH_EraseAllBank1Sectors build/obj/stm32f4xx_flash.o -FLASH_EraseAllBank2Sectors build/obj/stm32f4xx_flash.o -FLASH_EraseAllSectors build/obj/stm32f4xx_flash.o -FLASH_EraseSector build/obj/stm32f4xx_flash.o - build/obj/flash_helper.o - build/obj/eeprom.o -FLASH_GetFlagStatus build/obj/stm32f4xx_flash.o -FLASH_GetStatus build/obj/stm32f4xx_flash.o -FLASH_ITConfig build/obj/stm32f4xx_flash.o -FLASH_InstructionCacheCmd build/obj/stm32f4xx_flash.o -FLASH_InstructionCacheReset build/obj/stm32f4xx_flash.o -FLASH_Lock build/obj/stm32f4xx_flash.o -FLASH_OB_BORConfig build/obj/stm32f4xx_flash.o -FLASH_OB_BootConfig build/obj/stm32f4xx_flash.o -FLASH_OB_GetBOR build/obj/stm32f4xx_flash.o -FLASH_OB_GetPCROP build/obj/stm32f4xx_flash.o -FLASH_OB_GetPCROP1 build/obj/stm32f4xx_flash.o -FLASH_OB_GetRDP build/obj/stm32f4xx_flash.o -FLASH_OB_GetUser build/obj/stm32f4xx_flash.o -FLASH_OB_GetWRP build/obj/stm32f4xx_flash.o -FLASH_OB_GetWRP1 build/obj/stm32f4xx_flash.o -FLASH_OB_Launch build/obj/stm32f4xx_flash.o -FLASH_OB_Lock build/obj/stm32f4xx_flash.o -FLASH_OB_PCROP1Config build/obj/stm32f4xx_flash.o -FLASH_OB_PCROPConfig build/obj/stm32f4xx_flash.o -FLASH_OB_PCROPSelectionConfig build/obj/stm32f4xx_flash.o -FLASH_OB_RDPConfig build/obj/stm32f4xx_flash.o -FLASH_OB_Unlock build/obj/stm32f4xx_flash.o -FLASH_OB_UserConfig build/obj/stm32f4xx_flash.o -FLASH_OB_WRP1Config build/obj/stm32f4xx_flash.o -FLASH_OB_WRPConfig build/obj/stm32f4xx_flash.o -FLASH_PrefetchBufferCmd build/obj/stm32f4xx_flash.o -FLASH_ProgramByte build/obj/stm32f4xx_flash.o - build/obj/flash_helper.o -FLASH_ProgramDoubleWord build/obj/stm32f4xx_flash.o -FLASH_ProgramHalfWord build/obj/stm32f4xx_flash.o - build/obj/eeprom.o -FLASH_ProgramWord build/obj/stm32f4xx_flash.o -FLASH_SetLatency build/obj/stm32f4xx_flash.o -FLASH_Unlock build/obj/stm32f4xx_flash.o - build/obj/flash_helper.o - build/obj/conf_general.o -FLASH_WaitForLastOperation build/obj/stm32f4xx_flash.o -Fault_seq build/obj/mcpwm.o -FdWeakParm build/obj/mcpwm.o -HallPLLA build/obj/mcpwm.o -HallPLLA1 build/obj/mcpwm.o -HallPLLA_filtered build/obj/mcpwm.o -HallPLLA_old build/obj/mcpwm.o -HallPLLB build/obj/mcpwm.o -HallPLLB_filtered build/obj/mcpwm.o -HallPLLB_old build/obj/mcpwm.o -HallPLLde build/obj/mcpwm.o -HallPLLde1 build/obj/mcpwm.o -HallPLLdef build/obj/mcpwm.o -HallPLLdef1 build/obj/mcpwm.o -HallPLLlead build/obj/mcpwm.o -HallPLLlead1 build/obj/mcpwm.o -HallPLLlead2 build/obj/mcpwm.o -HallPLLqe build/obj/mcpwm.o -Hall_CosSin build/obj/mcpwm.o -Hall_SinCos build/obj/mcpwm.o -HardFault_Handler build/obj/vectors.o -I2CD2 build/obj/i2c_lld.o - build/obj/hw_oroca.o -ICUD3 build/obj/icu_lld.o - build/obj/servo_dec.o -InitMeasCompCurr build/obj/mcpwm.o -InitPI build/obj/mcpwm.o -Init_Charge_Time build/obj/mcpwm.o -Init_Charge_cnt build/obj/mcpwm.o -Init_Charge_cnt_EN build/obj/mcpwm.o -InvPark build/obj/mcpwm.o -Ipll build/obj/mcpwm.o -Kpll build/obj/mcpwm.o -MeasCompCurr build/obj/mcpwm.o -MemManage_Handler build/obj/vectors.o -NMI_Handler build/obj/vectors.o -NVIC_Init build/obj/misc.o - build/obj/mcpwm.o -NVIC_PriorityGroupConfig build/obj/misc.o -NVIC_SetVectorTable build/obj/misc.o -NVIC_SystemLPConfig build/obj/misc.o -PIParmD build/obj/mcpwm.o -PIParmPLL build/obj/mcpwm.o -PIParmQ build/obj/mcpwm.o -PIParmW build/obj/mcpwm.o -ParkParm build/obj/mcpwm.o -PendSV_Handler build/obj/vectors.o -RCC_AHB1PeriphClockCmd build/obj/stm32f4xx_rcc.o - build/obj/hw_oroca.o - build/obj/mcpwm.o -RCC_AHB1PeriphClockLPModeCmd build/obj/stm32f4xx_rcc.o -RCC_AHB1PeriphResetCmd build/obj/stm32f4xx_rcc.o -RCC_AHB2PeriphClockCmd build/obj/stm32f4xx_rcc.o -RCC_AHB2PeriphClockLPModeCmd build/obj/stm32f4xx_rcc.o -RCC_AHB2PeriphResetCmd build/obj/stm32f4xx_rcc.o -RCC_APB1PeriphClockCmd build/obj/stm32f4xx_rcc.o - build/obj/flash_helper.o - build/obj/conf_general.o - build/obj/mcpwm.o -RCC_APB1PeriphClockLPModeCmd build/obj/stm32f4xx_rcc.o -RCC_APB1PeriphResetCmd build/obj/stm32f4xx_rcc.o - build/obj/stm32f4xx_wwdg.o - build/obj/stm32f4xx_tim.o -RCC_APB2PeriphClockCmd build/obj/stm32f4xx_rcc.o - build/obj/mcpwm.o -RCC_APB2PeriphClockLPModeCmd build/obj/stm32f4xx_rcc.o -RCC_APB2PeriphResetCmd build/obj/stm32f4xx_rcc.o - build/obj/stm32f4xx_tim.o - build/obj/stm32f4xx_syscfg.o - build/obj/stm32f4xx_adc.o -RCC_AdjustHSICalibrationValue build/obj/stm32f4xx_rcc.o -RCC_BackupResetCmd build/obj/stm32f4xx_rcc.o -RCC_ClearFlag build/obj/stm32f4xx_rcc.o -RCC_ClearITPendingBit build/obj/stm32f4xx_rcc.o -RCC_ClockSecuritySystemCmd build/obj/stm32f4xx_rcc.o -RCC_DeInit build/obj/stm32f4xx_rcc.o -RCC_GetClocksFreq build/obj/stm32f4xx_rcc.o -RCC_GetFlagStatus build/obj/stm32f4xx_rcc.o -RCC_GetITStatus build/obj/stm32f4xx_rcc.o -RCC_GetSYSCLKSource build/obj/stm32f4xx_rcc.o -RCC_HCLKConfig build/obj/stm32f4xx_rcc.o -RCC_HSEConfig build/obj/stm32f4xx_rcc.o -RCC_HSICmd build/obj/stm32f4xx_rcc.o -RCC_ITConfig build/obj/stm32f4xx_rcc.o -RCC_LSEConfig build/obj/stm32f4xx_rcc.o -RCC_LSEModeConfig build/obj/stm32f4xx_rcc.o -RCC_LSICmd build/obj/stm32f4xx_rcc.o -RCC_MCO1Config build/obj/stm32f4xx_rcc.o -RCC_MCO2Config build/obj/stm32f4xx_rcc.o -RCC_PCLK1Config build/obj/stm32f4xx_rcc.o -RCC_PCLK2Config build/obj/stm32f4xx_rcc.o -RCC_PLLCmd build/obj/stm32f4xx_rcc.o -RCC_PLLI2SCmd build/obj/stm32f4xx_rcc.o -RCC_PLLSAICmd build/obj/stm32f4xx_rcc.o -RCC_RTCCLKCmd build/obj/stm32f4xx_rcc.o -RCC_RTCCLKConfig build/obj/stm32f4xx_rcc.o -RCC_SYSCLKConfig build/obj/stm32f4xx_rcc.o -RCC_TIMCLKPresConfig build/obj/stm32f4xx_rcc.o -RCC_WaitForHSEStartUp build/obj/stm32f4xx_rcc.o -Reset_Handler build/obj/crt0_v7m.o -SDU1 build/obj/usb_uart.o -SMC_HallSensor_Estimation build/obj/mcpwm.o -SVC_Handler build/obj/chcore_v7m.o - build/obj/vectors.o -SVGenParm build/obj/mcpwm.o -SYSCFG_CompensationCellCmd build/obj/stm32f4xx_syscfg.o -SYSCFG_DeInit build/obj/stm32f4xx_syscfg.o -SYSCFG_ETH_MediaInterfaceConfig build/obj/stm32f4xx_syscfg.o -SYSCFG_EXTILineConfig build/obj/stm32f4xx_syscfg.o -SYSCFG_GetCompensationCellStatus build/obj/stm32f4xx_syscfg.o -SYSCFG_MemoryRemapConfig build/obj/stm32f4xx_syscfg.o -SYSCFG_MemorySwappingBank build/obj/stm32f4xx_syscfg.o -Seq build/obj/mcpwm.o -SetupControlParameters build/obj/mcpwm.o -SetupParm build/obj/mcpwm.o -SpeedReference build/obj/mcpwm.o -State_Index build/obj/mcpwm.o -SysTick_CLKSourceConfig build/obj/misc.o -SysTick_Handler build/obj/st_lld.o - build/obj/vectors.o -SystemCoreClock build/obj/hal_lld.o -TIM_ARRPreloadConfig build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_BDTRConfig build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_BDTRStructInit build/obj/stm32f4xx_tim.o -TIM_CCPreloadControl build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_CCxCmd build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_CCxNCmd build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_ClearFlag build/obj/stm32f4xx_tim.o -TIM_ClearITPendingBit build/obj/stm32f4xx_tim.o - build/obj/irq_handlers.o -TIM_ClearOC1Ref build/obj/stm32f4xx_tim.o -TIM_ClearOC2Ref build/obj/stm32f4xx_tim.o -TIM_ClearOC3Ref build/obj/stm32f4xx_tim.o -TIM_ClearOC4Ref build/obj/stm32f4xx_tim.o -TIM_Cmd build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_CounterModeConfig build/obj/stm32f4xx_tim.o -TIM_CtrlPWMOutputs build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_DMACmd build/obj/stm32f4xx_tim.o -TIM_DMAConfig build/obj/stm32f4xx_tim.o -TIM_DeInit build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_ETRClockMode1Config build/obj/stm32f4xx_tim.o -TIM_ETRClockMode2Config build/obj/stm32f4xx_tim.o -TIM_ETRConfig build/obj/stm32f4xx_tim.o -TIM_EncoderInterfaceConfig build/obj/stm32f4xx_tim.o -TIM_ForcedOC1Config build/obj/stm32f4xx_tim.o -TIM_ForcedOC2Config build/obj/stm32f4xx_tim.o -TIM_ForcedOC3Config build/obj/stm32f4xx_tim.o -TIM_ForcedOC4Config build/obj/stm32f4xx_tim.o -TIM_GenerateEvent build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_GetCapture1 build/obj/stm32f4xx_tim.o -TIM_GetCapture2 build/obj/stm32f4xx_tim.o -TIM_GetCapture3 build/obj/stm32f4xx_tim.o -TIM_GetCapture4 build/obj/stm32f4xx_tim.o -TIM_GetCounter build/obj/stm32f4xx_tim.o -TIM_GetFlagStatus build/obj/stm32f4xx_tim.o -TIM_GetITStatus build/obj/stm32f4xx_tim.o -TIM_GetPrescaler build/obj/stm32f4xx_tim.o -TIM_ICInit build/obj/stm32f4xx_tim.o -TIM_ICStructInit build/obj/stm32f4xx_tim.o -TIM_ITConfig build/obj/stm32f4xx_tim.o -TIM_ITRxExternalClockConfig build/obj/stm32f4xx_tim.o -TIM_InternalClockConfig build/obj/stm32f4xx_tim.o -TIM_OC1FastConfig build/obj/stm32f4xx_tim.o -TIM_OC1Init build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OC1NPolarityConfig build/obj/stm32f4xx_tim.o -TIM_OC1PolarityConfig build/obj/stm32f4xx_tim.o -TIM_OC1PreloadConfig build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OC2FastConfig build/obj/stm32f4xx_tim.o -TIM_OC2Init build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OC2NPolarityConfig build/obj/stm32f4xx_tim.o -TIM_OC2PolarityConfig build/obj/stm32f4xx_tim.o -TIM_OC2PreloadConfig build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OC3FastConfig build/obj/stm32f4xx_tim.o -TIM_OC3Init build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OC3NPolarityConfig build/obj/stm32f4xx_tim.o -TIM_OC3PolarityConfig build/obj/stm32f4xx_tim.o -TIM_OC3PreloadConfig build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OC4FastConfig build/obj/stm32f4xx_tim.o -TIM_OC4Init build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OC4PolarityConfig build/obj/stm32f4xx_tim.o -TIM_OC4PreloadConfig build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_OCStructInit build/obj/stm32f4xx_tim.o -TIM_PWMIConfig build/obj/stm32f4xx_tim.o -TIM_PrescalerConfig build/obj/stm32f4xx_tim.o -TIM_RemapConfig build/obj/stm32f4xx_tim.o -TIM_SelectCCDMA build/obj/stm32f4xx_tim.o -TIM_SelectCOM build/obj/stm32f4xx_tim.o -TIM_SelectHallSensor build/obj/stm32f4xx_tim.o -TIM_SelectInputTrigger build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_SelectMasterSlaveMode build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_SelectOCxM build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_SelectOnePulseMode build/obj/stm32f4xx_tim.o -TIM_SelectOutputTrigger build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_SelectSlaveMode build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_SetAutoreload build/obj/stm32f4xx_tim.o -TIM_SetClockDivision build/obj/stm32f4xx_tim.o -TIM_SetCompare1 build/obj/stm32f4xx_tim.o -TIM_SetCompare2 build/obj/stm32f4xx_tim.o -TIM_SetCompare3 build/obj/stm32f4xx_tim.o -TIM_SetCompare4 build/obj/stm32f4xx_tim.o -TIM_SetCounter build/obj/stm32f4xx_tim.o -TIM_SetIC1Prescaler build/obj/stm32f4xx_tim.o -TIM_SetIC2Prescaler build/obj/stm32f4xx_tim.o -TIM_SetIC3Prescaler build/obj/stm32f4xx_tim.o -TIM_SetIC4Prescaler build/obj/stm32f4xx_tim.o -TIM_TIxExternalClockConfig build/obj/stm32f4xx_tim.o -TIM_TimeBaseInit build/obj/stm32f4xx_tim.o - build/obj/mcpwm.o -TIM_TimeBaseStructInit build/obj/stm32f4xx_tim.o -TIM_UpdateDisableConfig build/obj/stm32f4xx_tim.o -TIM_UpdateRequestConfig build/obj/stm32f4xx_tim.o -UARTD3 build/obj/uart_lld.o - build/obj/flash_helper.o -UARTD6 build/obj/uart_lld.o -USBD1 build/obj/usb_lld.o - build/obj/flash_helper.o - build/obj/usb_uart.o -UsageFault_Handler build/obj/vectors.o -Vector100 build/obj/vectors.o -Vector104 build/obj/vectors.o -Vector108 build/obj/vectors.o -Vector10C build/obj/vectors.o -Vector110 build/obj/vectors.o -Vector114 build/obj/vectors.o -Vector118 build/obj/vectors.o -Vector11C build/obj/irq_handlers.o - build/obj/vectors.o -Vector120 build/obj/stm32_dma.o - build/obj/vectors.o -Vector124 build/obj/stm32_dma.o - build/obj/vectors.o -Vector128 build/obj/stm32_dma.o - build/obj/vectors.o -Vector12C build/obj/stm32_dma.o - build/obj/vectors.o -Vector130 build/obj/stm32_dma.o - build/obj/vectors.o -Vector134 build/obj/vectors.o -Vector138 build/obj/vectors.o -Vector13C build/obj/vectors.o -Vector140 build/obj/vectors.o -Vector144 build/obj/vectors.o -Vector148 build/obj/vectors.o -Vector14C build/obj/usb_lld.o - build/obj/vectors.o -Vector150 build/obj/stm32_dma.o - build/obj/vectors.o -Vector154 build/obj/stm32_dma.o - build/obj/vectors.o -Vector158 build/obj/stm32_dma.o - build/obj/vectors.o -Vector15C build/obj/uart_lld.o - build/obj/vectors.o -Vector160 build/obj/vectors.o -Vector164 build/obj/vectors.o -Vector168 build/obj/vectors.o -Vector16C build/obj/vectors.o -Vector170 build/obj/vectors.o -Vector174 build/obj/vectors.o -Vector178 build/obj/vectors.o -Vector17C build/obj/vectors.o -Vector180 build/obj/vectors.o -Vector184 build/obj/vectors.o -Vector188 build/obj/vectors.o -Vector18C build/obj/vectors.o -Vector190 build/obj/vectors.o -Vector194 build/obj/vectors.o -Vector198 build/obj/vectors.o -Vector19C build/obj/vectors.o -Vector1A0 build/obj/vectors.o -Vector1A4 build/obj/vectors.o -Vector1A8 build/obj/vectors.o -Vector1AC build/obj/vectors.o -Vector1B0 build/obj/vectors.o -Vector1B4 build/obj/vectors.o -Vector1B8 build/obj/vectors.o -Vector1BC build/obj/vectors.o -Vector1C build/obj/vectors.o -Vector20 build/obj/vectors.o -Vector24 build/obj/vectors.o -Vector28 build/obj/vectors.o -Vector34 build/obj/vectors.o -Vector40 build/obj/vectors.o -Vector44 build/obj/vectors.o -Vector48 build/obj/vectors.o -Vector4C build/obj/vectors.o -Vector50 build/obj/vectors.o -Vector54 build/obj/vectors.o -Vector58 build/obj/vectors.o -Vector5C build/obj/vectors.o -Vector60 build/obj/vectors.o -Vector64 build/obj/vectors.o -Vector68 build/obj/vectors.o -Vector6C build/obj/stm32_dma.o - build/obj/vectors.o -Vector70 build/obj/stm32_dma.o - build/obj/vectors.o -Vector74 build/obj/stm32_dma.o - build/obj/vectors.o -Vector78 build/obj/stm32_dma.o - build/obj/vectors.o -Vector7C build/obj/stm32_dma.o - build/obj/vectors.o -Vector80 build/obj/stm32_dma.o - build/obj/vectors.o -Vector84 build/obj/stm32_dma.o - build/obj/vectors.o -Vector88 build/obj/irq_handlers.o - build/obj/vectors.o -Vector8C build/obj/can_lld.o - build/obj/vectors.o -Vector90 build/obj/can_lld.o - build/obj/vectors.o -Vector94 build/obj/can_lld.o - build/obj/vectors.o -Vector98 build/obj/can_lld.o - build/obj/vectors.o -Vector9C build/obj/vectors.o -VectorA0 build/obj/vectors.o -VectorA4 build/obj/vectors.o -VectorA8 build/obj/vectors.o -VectorAC build/obj/vectors.o -VectorB0 build/obj/vectors.o -VectorB4 build/obj/icu_lld.o - build/obj/vectors.o -VectorB8 build/obj/vectors.o -VectorBC build/obj/vectors.o -VectorC0 build/obj/vectors.o -VectorC4 build/obj/i2c_lld.o - build/obj/vectors.o -VectorC8 build/obj/i2c_lld.o - build/obj/vectors.o -VectorCC build/obj/vectors.o -VectorD0 build/obj/vectors.o -VectorD4 build/obj/vectors.o -VectorD8 build/obj/vectors.o -VectorDC build/obj/uart_lld.o - build/obj/vectors.o -VectorE0 build/obj/irq_handlers.o - build/obj/vectors.o -VectorE4 build/obj/vectors.o -VectorE8 build/obj/vectors.o -VectorEC build/obj/vectors.o -VectorF0 build/obj/vectors.o -VectorF4 build/obj/vectors.o -VectorF8 build/obj/vectors.o -VectorFC build/obj/stm32_dma.o - build/obj/vectors.o -VelReq build/obj/mcpwm.o -VirtAddVarTab build/obj/conf_general.o - build/obj/eeprom.o -VoltRippleComp build/obj/mcpwm.o -WWDG_ClearFlag build/obj/stm32f4xx_wwdg.o -WWDG_DeInit build/obj/stm32f4xx_wwdg.o -WWDG_Enable build/obj/stm32f4xx_wwdg.o - build/obj/mcpwm.o -WWDG_EnableIT build/obj/stm32f4xx_wwdg.o -WWDG_GetFlagStatus build/obj/stm32f4xx_wwdg.o -WWDG_SetCounter build/obj/stm32f4xx_wwdg.o - build/obj/mcpwm.o -WWDG_SetPrescaler build/obj/stm32f4xx_wwdg.o - build/obj/mcpwm.o -WWDG_SetWindowValue build/obj/stm32f4xx_wwdg.o - build/obj/mcpwm.o -Wpll build/obj/mcpwm.o -Wpll1 build/obj/mcpwm.o -Wplli build/obj/mcpwm.o -Wpllp build/obj/mcpwm.o -_Balloc /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -_Bfree /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -_PathLocale /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__adddf3 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__aeabi_cdcmpeq /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__aeabi_cdcmple /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__aeabi_cdrcmple /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__aeabi_d2f /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_truncdfsf2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - build/obj/chprintf.o -__aeabi_d2iz /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_fixdfsi.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - build/obj/chprintf.o -__aeabi_dadd /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__aeabi_dcmpeq /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -__aeabi_dcmpge /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__aeabi_dcmpgt /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__aeabi_dcmple /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__aeabi_dcmplt /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -__aeabi_ddiv /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) -__aeabi_dmul /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - build/obj/chprintf.o -__aeabi_drsub /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__aeabi_dsub /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - build/obj/chprintf.o -__aeabi_f2d /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - build/obj/servo_dec.o - build/obj/chprintf.o -__aeabi_i2d /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - build/obj/chprintf.o -__aeabi_idiv0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_dvmd_tls.o) -__aeabi_l2d /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__aeabi_ldiv0 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_dvmd_tls.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) -__aeabi_ui2d /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - build/obj/chprintf.o -__aeabi_ul2d /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__aeabi_uldivmod /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -__any_on /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -__b2d /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -__cmpdf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__copybits /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -__core_init build/obj/crt1.o - build/obj/crt0_v7m.o -__d2b /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__default_exit build/obj/crt1.o - build/obj/crt0_v7m.o -__divdf3 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) -__divdi3 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_divdi3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) -__early_init build/obj/board.o - build/obj/crt1.o - build/obj/crt0_v7m.o -__eqdf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__errno /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) -__extendsfdf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__fdlib_version /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_lib_ver.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) -__fini_array_end build/obj/crt0_v7m.o -__fini_array_start build/obj/crt0_v7m.o -__fixdfsi /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_fixdfsi.o) -__floatdidf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__floatsidf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__floatundidf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__floatunsidf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__fpclassifyd /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-s_fpclassify.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -__fpclassifyf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fpclassify.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) -__gedf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__gnu_ldivmod_helper /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) -__gnu_uldivmod_helper /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_aeabi_uldivmod.o) -__gtdf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__heap_base__ build/obj/chmemcore.o -__heap_end__ build/obj/chmemcore.o -__hi0bits /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__i2b /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__ieee754_fmodf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_fmod.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) -__ieee754_rem_pio2f /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) -__ieee754_sqrtf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) -__init_array_end build/obj/crt0_v7m.o -__init_array_start build/obj/crt0_v7m.o -__kernel_cosf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_cos.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) -__kernel_rem_pio2f /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) -__kernel_sinf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_sin.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) -__late_init build/obj/crt1.o - build/obj/crt0_v7m.o -__ledf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__lo0bits /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -__locale_charset /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__locale_cjk_lang /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__locale_mb_cur_max /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__locale_msgcharset /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__lshift /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__ltdf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__main_stack_base__ build/obj/crt0_v7m.o -__main_stack_end__ build/obj/vectors.o - build/obj/crt0_v7m.o -__malloc_av_ /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) -__malloc_current_mallinfo /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) -__malloc_lock /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) -__malloc_max_sbrked_mem /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) -__malloc_max_total_mem /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) -__malloc_sbrk_base /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) -__malloc_top_pad /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) -__malloc_trim_threshold /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) -__malloc_unlock /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mlock.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) -__mb_cur_max /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__mcmp /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__mdiff /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__mlocale_changed /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__mprec_bigtens /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__mprec_tens /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__mprec_tinytens /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -__muldf3 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_muldivdf3.o) -__multadd /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__multiply /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__nedf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_cmpdf2.o) -__nlocale_changed /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -__pow5mult /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) -__process_stack_base__ build/obj/crt0_v7m.o -__process_stack_end__ build/obj/crt0_v7m.o -__ratio /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -__s2b /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -__ssprint_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -__subdf3 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_addsubdf3.o) -__truncdfsf2 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_arm_truncdfsf2.o) -__udivdi3 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(_udivdi3.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/armv7e-m/fpu/libgcc.a(bpabi.o) -__ulp /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -_bss_end build/obj/crt0_v7m.o -_bss_start build/obj/crt0_v7m.o -_calloc_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -_close_r build/obj/syscalls.o -_core_init build/obj/chmemcore.o - build/obj/chsys.o -_data build/obj/crt0_v7m.o -_dtoa_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -_edata build/obj/crt0_v7m.o -_free_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) -_fstat_r build/obj/syscalls.o -_global_impure_ptr /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) -_heap_init build/obj/chheap.o - build/obj/chsys.o -_impure_ptr /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-impure.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-errno.o) -_isatty_r build/obj/syscalls.o -_localeconv_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -_lseek_r build/obj/syscalls.o -_malloc_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -_malloc_trim_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) -_mprec_log10 /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) -_pal_lld_init build/obj/pal_lld.o - build/obj/hal.o -_pal_lld_setgroupmode build/obj/pal_lld.o - build/obj/hw_oroca.o - build/obj/flash_helper.o - build/obj/servo_dec.o - build/obj/pal.o -_port_exit_from_isr build/obj/chcoreasm_v7m.o - build/obj/chcore_v7m.o -_port_irq_epilogue build/obj/chcore_v7m.o - build/obj/irq_handlers.o - build/obj/uart_lld.o - build/obj/st_lld.o - build/obj/icu_lld.o - build/obj/usb_lld.o - build/obj/i2c_lld.o - build/obj/can_lld.o - build/obj/stm32_dma.o -_port_switch build/obj/chcoreasm_v7m.o - build/obj/chschd.o -_port_switch_from_isr build/obj/chcoreasm_v7m.o - build/obj/chcore_v7m.o -_port_thread_start build/obj/chcoreasm_v7m.o - build/obj/chthreads.o -_read_r build/obj/syscalls.o -_realloc_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) -_sbrk_r build/obj/syscalls.o - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-freer.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mallocr.o) -_scheduler_init build/obj/chschd.o - build/obj/chsys.o -_setlocale_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -_stm32_dma_streams build/obj/stm32_dma.o - build/obj/mcpwm.o - build/obj/uart_lld.o - build/obj/i2c_lld.o -_svfiprintf_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) -_svfprintf_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) -_textdata build/obj/crt0_v7m.o -_thread_init build/obj/chthreads.o - build/obj/chsys.o -_tm_init build/obj/chtm.o - build/obj/chsys.o -_unhandled_exception build/obj/vectors.o -_usb_ep0in build/obj/usb.o - build/obj/usb_lld.o -_usb_ep0out build/obj/usb.o - build/obj/usb_lld.o -_usb_ep0setup build/obj/usb.o - build/obj/usb_lld.o -_usb_reset build/obj/usb.o - build/obj/usb_lld.o -_vectors build/obj/vectors.o -_vsnprintf_r /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) -_vt_init build/obj/chvt.o - build/obj/chsys.o -_write_r build/obj/syscalls.o -bldc_init build/obj/bldc.o - build/obj/main.o -bldc_start build/obj/bldc.o - build/obj/main.o -boardInit build/obj/board.o - build/obj/hal.o -cTest::print() build/obj/main.o -canInit build/obj/can.o - build/obj/hal.o -canObjectInit build/obj/can.o - build/obj/can_lld.o -canReceive build/obj/can.o -canSTM32SetFilters build/obj/can_lld.o -canSleep build/obj/can.o -canStart build/obj/can.o -canStop build/obj/can.o -canTransmit build/obj/can.o -canWakeup build/obj/can.o -can_lld_init build/obj/can_lld.o - build/obj/can.o -can_lld_is_rx_nonempty build/obj/can_lld.o - build/obj/can.o -can_lld_is_tx_empty build/obj/can_lld.o - build/obj/can.o -can_lld_receive build/obj/can_lld.o - build/obj/can.o -can_lld_sleep build/obj/can_lld.o - build/obj/can.o -can_lld_start build/obj/can_lld.o - build/obj/can.o -can_lld_stop build/obj/can_lld.o - build/obj/can.o -can_lld_transmit build/obj/can_lld.o - build/obj/can.o -can_lld_wakeup build/obj/can_lld.o - build/obj/can.o -ch build/obj/chschd.o - build/obj/servo_dec.o - build/obj/mcpwm.o - build/obj/bldc.o - build/obj/usb_lld.o - build/obj/i2c_lld.o - build/obj/chmsg.o - build/obj/chevents.o - build/obj/chcond.o - build/obj/chmtx.o - build/obj/chsem.o - build/obj/chregistry.o - build/obj/chtm.o - build/obj/chthreads.o - build/obj/chvt.o - build/obj/chsys.o -chCondBroadcast build/obj/chcond.o -chCondBroadcastI build/obj/chcond.o -chCondObjectInit build/obj/chcond.o -chCondSignal build/obj/chcond.o -chCondSignalI build/obj/chcond.o -chCondWait build/obj/chcond.o -chCondWaitS build/obj/chcond.o -chCondWaitTimeout build/obj/chcond.o -chCondWaitTimeoutS build/obj/chcond.o -chCoreAlloc build/obj/chmemcore.o - build/obj/syscalls.o - build/obj/chheap.o -chCoreAllocI build/obj/chmemcore.o -chCoreGetStatusX build/obj/chmemcore.o -chEvtAddEvents build/obj/chevents.o -chEvtBroadcastFlags build/obj/chevents.o -chEvtBroadcastFlagsI build/obj/chevents.o - build/obj/can_lld.o - build/obj/serial_usb.o - build/obj/can.o -chEvtDispatch build/obj/chevents.o -chEvtGetAndClearEvents build/obj/chevents.o -chEvtGetAndClearFlags build/obj/chevents.o -chEvtGetAndClearFlagsI build/obj/chevents.o -chEvtRegisterMaskWithFlags build/obj/chevents.o -chEvtSignal build/obj/chevents.o -chEvtSignalI build/obj/chevents.o -chEvtUnregister build/obj/chevents.o -chEvtWaitAll build/obj/chevents.o -chEvtWaitAllTimeout build/obj/chevents.o -chEvtWaitAny build/obj/chevents.o -chEvtWaitAnyTimeout build/obj/chevents.o -chEvtWaitOne build/obj/chevents.o -chEvtWaitOneTimeout build/obj/chevents.o -chHeapAlloc build/obj/chheap.o - build/obj/chdynamic.o -chHeapFree build/obj/chheap.o - build/obj/chdynamic.o -chHeapObjectInit build/obj/chheap.o -chHeapStatus build/obj/chheap.o -chIQGetTimeout build/obj/chqueues.o - build/obj/serial_usb.o -chIQObjectInit build/obj/chqueues.o - build/obj/serial_usb.o -chIQPutI build/obj/chqueues.o -chIQReadTimeout build/obj/chqueues.o - build/obj/serial_usb.o -chIQResetI build/obj/chqueues.o - build/obj/serial_usb.o -chMBFetch build/obj/chmboxes.o -chMBFetchI build/obj/chmboxes.o -chMBFetchS build/obj/chmboxes.o -chMBObjectInit build/obj/chmboxes.o -chMBPost build/obj/chmboxes.o -chMBPostAhead build/obj/chmboxes.o -chMBPostAheadI build/obj/chmboxes.o -chMBPostAheadS build/obj/chmboxes.o -chMBPostI build/obj/chmboxes.o -chMBPostS build/obj/chmboxes.o -chMBReset build/obj/chmboxes.o -chMBResetI build/obj/chmboxes.o -chMsgRelease build/obj/chmsg.o -chMsgSend build/obj/chmsg.o -chMsgWait build/obj/chmsg.o -chMtxLock build/obj/chmtx.o - build/obj/i2c.o - build/obj/chheap.o -chMtxLockS build/obj/chmtx.o - build/obj/chcond.o -chMtxObjectInit build/obj/chmtx.o - build/obj/comm_usb.o - build/obj/i2c.o - build/obj/chheap.o -chMtxTryLock build/obj/chmtx.o -chMtxTryLockS build/obj/chmtx.o -chMtxUnlock build/obj/chmtx.o - build/obj/i2c.o - build/obj/chheap.o -chMtxUnlockAll build/obj/chmtx.o -chMtxUnlockS build/obj/chmtx.o - build/obj/chcond.o -chOQGetI build/obj/chqueues.o -chOQObjectInit build/obj/chqueues.o - build/obj/serial_usb.o -chOQPutTimeout build/obj/chqueues.o - build/obj/serial_usb.o -chOQResetI build/obj/chqueues.o - build/obj/serial_usb.o -chOQWriteTimeout build/obj/chqueues.o - build/obj/serial_usb.o -chPoolAlloc build/obj/chmempools.o - build/obj/chdynamic.o -chPoolAllocI build/obj/chmempools.o -chPoolFree build/obj/chmempools.o - build/obj/chdynamic.o -chPoolFreeI build/obj/chmempools.o -chPoolLoadArray build/obj/chmempools.o -chPoolObjectInit build/obj/chmempools.o -chRegFirstThread build/obj/chregistry.o -chRegNextThread build/obj/chregistry.o -chSchDoReschedule build/obj/chschd.o - build/obj/chcoreasm_v7m.o -chSchDoRescheduleAhead build/obj/chschd.o -chSchDoRescheduleBehind build/obj/chschd.o - build/obj/chthreads.o -chSchGoSleepS build/obj/chschd.o - build/obj/chmsg.o - build/obj/chevents.o - build/obj/chcond.o - build/obj/chmtx.o - build/obj/chsem.o - build/obj/chthreads.o -chSchGoSleepTimeoutS build/obj/chschd.o - build/obj/can_lld.o - build/obj/chevents.o - build/obj/chcond.o - build/obj/chsem.o - build/obj/chthreads.o -chSchIsPreemptionRequired build/obj/chschd.o - build/obj/chcore_v7m.o -chSchReadyI build/obj/chschd.o - build/obj/usb_lld.o - build/obj/chmsg.o - build/obj/chevents.o - build/obj/chcond.o - build/obj/chmtx.o - build/obj/chsem.o - build/obj/chthreads.o -chSchRescheduleS build/obj/chschd.o - build/obj/usb_lld.o - build/obj/serial_usb.o - build/obj/can.o - build/obj/chmboxes.o - build/obj/chevents.o - build/obj/chcond.o - build/obj/chmtx.o - build/obj/chsem.o - build/obj/chthreads.o - build/obj/chsys.o -chSchWakeupS build/obj/chschd.o - build/obj/chmsg.o - build/obj/chcond.o - build/obj/chsem.o - build/obj/chdynamic.o - build/obj/chthreads.o -chSemAddCounterI build/obj/chsem.o -chSemObjectInit build/obj/chsem.o - build/obj/chmboxes.o -chSemReset build/obj/chsem.o -chSemResetI build/obj/chsem.o - build/obj/chmboxes.o -chSemSignal build/obj/chsem.o -chSemSignalI build/obj/chsem.o - build/obj/chmboxes.o -chSemSignalWait build/obj/chsem.o -chSemWait build/obj/chsem.o -chSemWaitS build/obj/chsem.o -chSemWaitTimeout build/obj/chsem.o -chSemWaitTimeoutS build/obj/chsem.o - build/obj/chmboxes.o -chSysGetStatusAndLockX build/obj/chsys.o -chSysHalt build/obj/chsys.o - build/obj/uart_lld.o - build/obj/i2c_lld.o -chSysInit build/obj/chsys.o - build/obj/bldc.o -chSysIntegrityCheckI build/obj/chsys.o -chSysIsCounterWithinX build/obj/chsys.o -chSysPolledDelayX build/obj/chsys.o - build/obj/usb_lld.o -chSysRestoreStatusX build/obj/chsys.o -chSysTimerHandlerI build/obj/chsys.o - build/obj/st_lld.o -chTMChainMeasurementToX build/obj/chtm.o -chTMObjectInit build/obj/chtm.o -chTMStartMeasurementX build/obj/chtm.o -chTMStopMeasurementX build/obj/chtm.o -chThdAddRef build/obj/chdynamic.o -chThdCreateFromHeap build/obj/chdynamic.o -chThdCreateFromMemoryPool build/obj/chdynamic.o -chThdCreateI build/obj/chthreads.o - build/obj/usb_lld.o - build/obj/chdynamic.o -chThdCreateStatic build/obj/chthreads.o - build/obj/mcpwm.o - build/obj/bldc.o - build/obj/chsys.o -chThdDequeueAllI build/obj/chthreads.o - build/obj/usb_lld.o - build/obj/can_lld.o - build/obj/can.o - build/obj/chqueues.o -chThdDequeueNextI build/obj/chthreads.o - build/obj/chqueues.o -chThdEnqueueTimeoutS build/obj/chthreads.o - build/obj/can.o - build/obj/chqueues.o -chThdExit build/obj/chthreads.o - build/obj/chcoreasm_v7m.o -chThdExitS build/obj/chthreads.o -chThdRelease build/obj/chdynamic.o - build/obj/chregistry.o - build/obj/chthreads.o -chThdResume build/obj/chthreads.o -chThdResumeI build/obj/chthreads.o - build/obj/usb_lld.o - build/obj/i2c_lld.o -chThdResumeS build/obj/chthreads.o -chThdSetPriority build/obj/chthreads.o -chThdSleep build/obj/chthreads.o - build/obj/hw_oroca.o - build/obj/usb_uart.o - build/obj/mcpwm.o - build/obj/bldc.o -chThdSleepUntil build/obj/chthreads.o -chThdSleepUntilWindowed build/obj/chthreads.o -chThdStart build/obj/chthreads.o -chThdSuspendS build/obj/chthreads.o - build/obj/usb_lld.o -chThdSuspendTimeoutS build/obj/chthreads.o - build/obj/i2c_lld.o -chThdTerminate build/obj/chthreads.o -chThdWait build/obj/chthreads.o -chThdYield build/obj/chthreads.o -chVTDoResetI build/obj/chvt.o - build/obj/chschd.o -chVTDoSetI build/obj/chvt.o - build/obj/chschd.o -ch_debug build/obj/chregistry.o - build/obj/chsys.o -chsnprintf build/obj/chprintf.o -chvprintf build/obj/chprintf.o -comm_usb_init build/obj/comm_usb.o - build/obj/bldc.o -conf_general_detect_motor_param build/obj/conf_general.o -conf_general_init build/obj/conf_general.o - build/obj/bldc.o -conf_general_read_app_configuration build/obj/conf_general.o - build/obj/bldc.o -conf_general_read_mc_configuration build/obj/conf_general.o - build/obj/bldc.o -conf_general_store_app_configuration build/obj/conf_general.o -conf_general_store_mc_configuration build/obj/conf_general.o -copysignf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_copysign.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) -cosf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_cos.o) - build/obj/mcpwm.o -costh build/obj/mcpwm.o -count build/obj/mcpwm.o -dbg_AccumTheta build/obj/bldc.o -dbg_fMea build/obj/bldc.o -dbg_fTheta build/obj/bldc.o -dmaInit build/obj/stm32_dma.o - build/obj/hal_lld.o -dmaStreamAllocate build/obj/stm32_dma.o - build/obj/mcpwm.o - build/obj/uart_lld.o - build/obj/i2c_lld.o -dmaStreamRelease build/obj/stm32_dma.o - build/obj/uart_lld.o - build/obj/i2c_lld.o -fabsf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_fabs.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-ef_rem_pio2.o) -flash_helper_erase_new_app build/obj/flash_helper.o -flash_helper_get_sector_address build/obj/flash_helper.o - build/obj/eeprom.o -flash_helper_jump_to_bootloader build/obj/flash_helper.o -flash_helper_write_new_app_data build/obj/flash_helper.o -floorf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_floor.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) -fmodf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) - build/obj/utils.o -fputc build/obj/mcpwm.o -halInit build/obj/hal.o - build/obj/bldc.o -hal_lld_init build/obj/hal_lld.o - build/obj/hal.o -hw_init_gpio build/obj/hw_oroca.o - build/obj/bldc.o -hw_setup_adc_channels build/obj/hw_oroca.o - build/obj/mcpwm.o -hw_start_i2c build/obj/hw_oroca.o -hw_stop_i2c build/obj/hw_oroca.o -hw_try_restore_i2c build/obj/hw_oroca.o -i2cAcquireBus build/obj/i2c.o - build/obj/hw_oroca.o -i2cGetErrors build/obj/i2c.o -i2cInit build/obj/i2c.o - build/obj/hal.o -i2cMasterReceiveTimeout build/obj/i2c.o -i2cMasterTransmitTimeout build/obj/i2c.o -i2cObjectInit build/obj/i2c.o - build/obj/i2c_lld.o -i2cReleaseBus build/obj/i2c.o - build/obj/hw_oroca.o -i2cStart build/obj/i2c.o - build/obj/hw_oroca.o -i2cStop build/obj/i2c.o - build/obj/hw_oroca.o -i2c_lld_init build/obj/i2c_lld.o - build/obj/i2c.o -i2c_lld_master_receive_timeout build/obj/i2c_lld.o - build/obj/i2c.o -i2c_lld_master_transmit_timeout build/obj/i2c_lld.o - build/obj/i2c.o -i2c_lld_start build/obj/i2c_lld.o - build/obj/i2c.o -i2c_lld_stop build/obj/i2c_lld.o - build/obj/i2c.o -icuDisableNotifications build/obj/icu.o -icuEnableNotifications build/obj/icu.o - build/obj/servo_dec.o -icuInit build/obj/icu.o - build/obj/hal.o -icuObjectInit build/obj/icu.o - build/obj/icu_lld.o -icuStart build/obj/icu.o - build/obj/servo_dec.o -icuStartCapture build/obj/icu.o - build/obj/servo_dec.o -icuStop build/obj/icu.o -icuStopCapture build/obj/icu.o -icuWaitCapture build/obj/icu.o -icu_lld_disable_notifications build/obj/icu_lld.o - build/obj/icu.o -icu_lld_enable_notifications build/obj/icu_lld.o - build/obj/icu.o -icu_lld_init build/obj/icu_lld.o - build/obj/icu.o -icu_lld_start build/obj/icu_lld.o - build/obj/icu.o -icu_lld_start_capture build/obj/icu_lld.o - build/obj/icu.o -icu_lld_stop build/obj/icu_lld.o - build/obj/icu.o -icu_lld_stop_capture build/obj/icu_lld.o - build/obj/icu.o -icu_lld_wait_capture build/obj/icu_lld.o - build/obj/icu.o -localeconv /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -main build/obj/main.o - build/obj/crt0_v7m.o -main_init() build/obj/main.o -matherr /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-s_matherr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_fmod.o) -mc_interface_release_motor build/obj/flash_helper.o -mc_interface_unlock build/obj/flash_helper.o -mcpwm_adc_inj_int_handler build/obj/mcpwm.o - build/obj/irq_handlers.o -mcpwm_adc_int_handler build/obj/mcpwm.o -mcpwm_init build/obj/mcpwm.o - build/obj/bldc.o -memchr /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memchr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -memcpy /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memcpy.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-mprec.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-dtoa.o) - build/obj/bldc.o -memmove /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memmove.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-reallocr.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) -memset /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-memset.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-callocr.o) - build/obj/conf_general.o - build/obj/syscalls.o - build/obj/usb.o -msObjectInit build/obj/chprintf.o -nvicClearPending build/obj/nvic.o -nvicDisableVector build/obj/nvic.o - build/obj/uart_lld.o - build/obj/icu_lld.o - build/obj/usb_lld.o - build/obj/i2c_lld.o - build/obj/can_lld.o - build/obj/stm32_dma.o -nvicEnableVector build/obj/nvic.o - build/obj/uart_lld.o - build/obj/icu_lld.o - build/obj/usb_lld.o - build/obj/i2c_lld.o - build/obj/can_lld.o - build/obj/stm32_dma.o -nvicSetSystemHandlerPriority build/obj/nvic.o - build/obj/st_lld.o -palReadBus build/obj/pal.o -palSetBusMode build/obj/pal.o -palWriteBus build/obj/pal.o -pal_default_config build/obj/board.o - build/obj/hal.o -qVelRef build/obj/bldc.o -recv build/obj/bldc.o -scalbnf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_scalbn.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-kf_rem_pio2.o) -sduConfigureHookI build/obj/serial_usb.o - build/obj/usb_uart.o -sduDataReceived build/obj/serial_usb.o - build/obj/usb_uart.o -sduDataTransmitted build/obj/serial_usb.o - build/obj/usb_uart.o -sduInit build/obj/serial_usb.o - build/obj/hal.o -sduInterruptTransmitted build/obj/serial_usb.o - build/obj/usb_uart.o -sduObjectInit build/obj/serial_usb.o - build/obj/usb_uart.o -sduRequestsHook build/obj/serial_usb.o - build/obj/usb_uart.o -sduStart build/obj/serial_usb.o - build/obj/usb_uart.o -sduStop build/obj/serial_usb.o -send build/obj/bldc.o -serusbcfg build/obj/usb_uart.o -servodec_get_last_pulse_len build/obj/servo_dec.o -servodec_get_servo build/obj/servo_dec.o -servodec_get_time_since_update build/obj/servo_dec.o -servodec_init build/obj/servo_dec.o -servodec_set_pulse_options build/obj/servo_dec.o -setlocale /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -sinf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-sf_sin.o) - build/obj/mcpwm.o -sinth build/obj/mcpwm.o -smc1 build/obj/mcpwm.o -sqrtf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libm.a(lib_a-wf_sqrt.o) - build/obj/mcpwm.o -stGetAlarm build/obj/st.o -stInit build/obj/st.o - build/obj/hal.o -stSetAlarm build/obj/st.o -stStartAlarm build/obj/st.o -stStopAlarm build/obj/st.o -st_lld_init build/obj/st_lld.o - build/obj/st.o -stm32_clock_init build/obj/hal_lld.o - build/obj/board.o -stop_pwm_hw build/obj/mcpwm.o -strcmp /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strcmp.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-locale.o) -strlen /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-strlen.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfiprintf.o) - /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-svfprintf.o) -switching_frequency_now build/obj/mcpwm.o -test build/obj/main.o -uGF build/obj/mcpwm.o -uartInit build/obj/uart.o - build/obj/hal.o -uartObjectInit build/obj/uart.o - build/obj/uart_lld.o -uartStart build/obj/uart.o -uartStartReceive build/obj/uart.o -uartStartReceiveI build/obj/uart.o -uartStartSend build/obj/uart.o -uartStartSendI build/obj/uart.o -uartStop build/obj/uart.o - build/obj/flash_helper.o -uartStopReceive build/obj/uart.o -uartStopReceiveI build/obj/uart.o -uartStopSend build/obj/uart.o -uartStopSendI build/obj/uart.o -uart_lld_init build/obj/uart_lld.o - build/obj/uart.o -uart_lld_start build/obj/uart_lld.o - build/obj/uart.o -uart_lld_start_receive build/obj/uart_lld.o - build/obj/uart.o -uart_lld_start_send build/obj/uart_lld.o - build/obj/uart.o -uart_lld_stop build/obj/uart_lld.o - build/obj/uart.o -uart_lld_stop_receive build/obj/uart_lld.o - build/obj/uart.o -uart_lld_stop_send build/obj/uart_lld.o - build/obj/uart.o -update_timer_Duty build/obj/mcpwm.o -usbDisableEndpointsI build/obj/usb.o -usbInit build/obj/usb.o - build/obj/hal.o -usbInitEndpointI build/obj/usb.o - build/obj/usb_uart.o -usbObjectInit build/obj/usb.o - build/obj/usb_lld.o -usbPrepareQueuedReceive build/obj/usb.o - build/obj/serial_usb.o -usbPrepareQueuedTransmit build/obj/usb.o - build/obj/serial_usb.o -usbPrepareReceive build/obj/usb.o -usbPrepareTransmit build/obj/usb.o -usbStallReceiveI build/obj/usb.o -usbStallTransmitI build/obj/usb.o -usbStart build/obj/usb.o - build/obj/usb_uart.o -usbStartReceiveI build/obj/usb.o - build/obj/serial_usb.o -usbStartTransmitI build/obj/usb.o - build/obj/serial_usb.o -usbStop build/obj/usb.o - build/obj/flash_helper.o -usb_lld_clear_in build/obj/usb_lld.o - build/obj/usb.o -usb_lld_clear_out build/obj/usb_lld.o - build/obj/usb.o -usb_lld_disable_endpoints build/obj/usb_lld.o - build/obj/usb.o -usb_lld_get_status_in build/obj/usb_lld.o - build/obj/usb.o -usb_lld_get_status_out build/obj/usb_lld.o - build/obj/usb.o -usb_lld_init build/obj/usb_lld.o - build/obj/usb.o -usb_lld_init_endpoint build/obj/usb_lld.o - build/obj/usb.o -usb_lld_prepare_receive build/obj/usb_lld.o - build/obj/usb.o -usb_lld_prepare_transmit build/obj/usb_lld.o - build/obj/usb.o -usb_lld_pump build/obj/usb_lld.o -usb_lld_read_setup build/obj/usb_lld.o - build/obj/usb.o -usb_lld_reset build/obj/usb_lld.o - build/obj/usb.o -usb_lld_set_address build/obj/usb_lld.o - build/obj/usb.o -usb_lld_stall_in build/obj/usb_lld.o - build/obj/usb.o -usb_lld_stall_out build/obj/usb_lld.o - build/obj/usb.o -usb_lld_start build/obj/usb_lld.o - build/obj/usb.o -usb_lld_start_in build/obj/usb_lld.o - build/obj/usb.o -usb_lld_start_out build/obj/usb_lld.o - build/obj/usb.o -usb_lld_stop build/obj/usb_lld.o - build/obj/usb.o -usb_uart_getch build/obj/usb_uart.o - build/obj/bldc.o -usb_uart_init build/obj/usb_uart.o - build/obj/comm_usb.o -usb_uart_isActive build/obj/usb_uart.o -usb_uart_printf build/obj/usb_uart.o -usb_uart_write build/obj/usb_uart.o - build/obj/bldc.o -utils_angle_difference build/obj/utils.o -utils_calc_ratio build/obj/utils.o -utils_deadband build/obj/utils.o -utils_map build/obj/utils.o -utils_middle_of_3 build/obj/servo_dec.o -utils_norm_angle build/obj/utils.o -utils_step_towards build/obj/utils.o -utils_sys_lock_cnt build/obj/utils.o - build/obj/flash_helper.o - build/obj/conf_general.o - build/obj/mcpwm.o -utils_sys_unlock_cnt build/obj/utils.o - build/obj/flash_helper.o - build/obj/conf_general.o - build/obj/mcpwm.o -utils_truncate_number build/obj/utils.o -vsnprintf /Users/Baram/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/libg.a(lib_a-vsnprintf.o) - build/obj/usb_uart.o diff --git a/oroca_bldc_FW/doc/05715872.pdf b/oroca_bldc_FW/doc/05715872.pdf new file mode 100644 index 0000000..93ba7d7 Binary files /dev/null and b/oroca_bldc_FW/doc/05715872.pdf differ diff --git a/oroca_bldc_FW/doc/Book1.xlsx b/oroca_bldc_FW/doc/Book1.xlsx new file mode 100644 index 0000000..2f214c3 Binary files /dev/null and b/oroca_bldc_FW/doc/Book1.xlsx differ diff --git a/oroca_bldc_FW/halconf.h b/oroca_bldc_FW/halconf.h index e473f75..b5f61dc 100755 --- a/oroca_bldc_FW/halconf.h +++ b/oroca_bldc_FW/halconf.h @@ -69,7 +69,7 @@ * @brief Enables the GPT subsystem. */ #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE +#define HAL_USE_GPT TRUE #endif /** @@ -132,14 +132,14 @@ * @brief Enables the SERIAL subsystem. */ #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE +#define HAL_USE_SERIAL TRUE #endif /** * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB TRUE +#define HAL_USE_SERIAL_USB FALSE #endif /** @@ -153,7 +153,7 @@ * @brief Enables the UART subsystem. */ #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART TRUE +#define HAL_USE_UART FALSE #endif /** @@ -280,7 +280,7 @@ * default configuration. */ #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 +#define SERIAL_DEFAULT_BITRATE 115200 #endif /** @@ -291,7 +291,7 @@ * buffers. */ #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 +#define SERIAL_BUFFERS_SIZE 256 #endif /*===========================================================================*/ diff --git a/oroca_bldc_FW/lib/ChibiOS_3.0.2/os/hal/src/uart.c b/oroca_bldc_FW/lib/ChibiOS_3.0.2/os/hal/src/uart.c index f5e28fd..93af9f4 100755 --- a/oroca_bldc_FW/lib/ChibiOS_3.0.2/os/hal/src/uart.c +++ b/oroca_bldc_FW/lib/ChibiOS_3.0.2/os/hal/src/uart.c @@ -336,3 +336,6 @@ size_t uartStopReceiveI(UARTDriver *uartp) { #endif /* HAL_USE_UART == TRUE */ /** @} */ + + + diff --git a/oroca_bldc_FW/lib/hwconf/hw.h b/oroca_bldc_FW/lib/hwconf/hw.h index 227855e..fbddf20 100755 --- a/oroca_bldc_FW/lib/hwconf/hw.h +++ b/oroca_bldc_FW/lib/hwconf/hw.h @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,13 +19,18 @@ * hw.h * * Created on: 12 apr 2014 - * Author: benjamin + * Author: bakchajang */ #ifndef HW_H_ #define HW_H_ -#include "conf_general.h" + +//#include "conf_general.h" + +#define HW_VERSION_OROCA + + #ifdef HW_VERSION_40 #include "hw_40.h" diff --git a/oroca_bldc_FW/lib/hwconf/hw_oroca.c b/oroca_bldc_FW/lib/hwconf/hw_oroca.c index 517fbbf..5e70c92 100755 --- a/oroca_bldc_FW/lib/hwconf/hw_oroca.c +++ b/oroca_bldc_FW/lib/hwconf/hw_oroca.c @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * hw_46.c * * Created on: 22 nov 2014 - * Author: benjamin + * Author: bakchajang */ #include "hw.h" @@ -48,10 +48,10 @@ void hw_init_gpio(void) { // LEDs palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); +// palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); palClearPad(GPIOB, 6); - palClearPad(GPIOB, 7); +// palClearPad(GPIOB, 7); // GPIOC (ENABLE_GATE) palSetPadMode(GPIOC, 6,PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); @@ -106,13 +106,13 @@ void hw_init_gpio(void) { void hw_setup_adc_channels(void) { // ADC1 regular channels ADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_15Cycles); - ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 2, ADC_SampleTime_15Cycles); + ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 2, ADC_SampleTime_15Cycles); ADC_RegularChannelConfig(ADC1, ADC_Channel_10, 3, ADC_SampleTime_15Cycles); ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 4, ADC_SampleTime_15Cycles); // ADC2 regular channels ADC_RegularChannelConfig(ADC2, ADC_Channel_1, 1, ADC_SampleTime_15Cycles); - ADC_RegularChannelConfig(ADC2, ADC_Channel_8, 2, ADC_SampleTime_15Cycles); + ADC_RegularChannelConfig(ADC2, ADC_Channel_9, 2, ADC_SampleTime_15Cycles); ADC_RegularChannelConfig(ADC2, ADC_Channel_11, 3, ADC_SampleTime_15Cycles); ADC_RegularChannelConfig(ADC2, ADC_Channel_15, 4, ADC_SampleTime_15Cycles); @@ -123,8 +123,8 @@ void hw_setup_adc_channels(void) { ADC_RegularChannelConfig(ADC3, ADC_Channel_5, 4, ADC_SampleTime_15Cycles); // Injected channels - ADC_InjectedChannelConfig(ADC1, ADC_Channel_8, 1, ADC_SampleTime_15Cycles); - ADC_InjectedChannelConfig(ADC2, ADC_Channel_9, 1, ADC_SampleTime_15Cycles); +//== ADC_InjectedChannelConfig(ADC1, ADC_Channel_8, 1, ADC_SampleTime_15Cycles); +//== ADC_InjectedChannelConfig(ADC2, ADC_Channel_9, 1, ADC_SampleTime_15Cycles); } void hw_start_i2c(void) { diff --git a/oroca_bldc_FW/lib/hwconf/hw_oroca.h b/oroca_bldc_FW/lib/hwconf/hw_oroca.h index d18bae2..64c7eb7 100755 --- a/oroca_bldc_FW/lib/hwconf/hw_oroca.h +++ b/oroca_bldc_FW/lib/hwconf/hw_oroca.h @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * hw_40.6 * * Created on: 22 nov 2014 - * Author: benjamin + * Author: bakchajang */ #ifndef HW_OROCA_H_ @@ -40,8 +40,8 @@ #define LED_GREEN_ON() palSetPad(GPIOB, 6) #define LED_GREEN_OFF() palClearPad(GPIOB, 6) -#define LED_RED_ON() palSetPad(GPIOB, 7) -#define LED_RED_OFF() palClearPad(GPIOB, 7) +//#define LED_RED_ON() palSetPad(GPIOB, 7) +//#define LED_RED_OFF() palClearPad(GPIOB, 7) /* * ADC Vector @@ -121,11 +121,13 @@ #define HW_UART_RX_PIN 11 // ICU Peripheral for servo decoding -#define HW_ICU_DEV ICUD3 +#define HW_ICU_DEV ICUD4 #define HW_ICU_CHANNEL ICU_CHANNEL_2 -#define HW_ICU_GPIO_AF GPIO_AF_TIM3 -#define HW_ICU_GPIO GPIOB -#define HW_ICU_PIN 5 +#define HW_ICU_GPIO_AF GPIO_AF_TIM4 +//#define HW_ICU_GPIO GPIOC +//#define HW_ICU_PIN 9 +#define HW_ICU_GPIO GPIOB +#define HW_ICU_PIN 7 // I2C Peripheral #define HW_I2C_DEV I2CD2 diff --git a/oroca_bldc_FW/lib/hwconf/hwconf.mk b/oroca_bldc_FW/lib/hwconf/hwconf.mk deleted file mode 100755 index c99b562..0000000 --- a/oroca_bldc_FW/lib/hwconf/hwconf.mk +++ /dev/null @@ -1,3 +0,0 @@ -HWSRC = $(LIBDIR)/hwconf/hw_oroca.c - -HWINC = $(LIBDIR)/hwconf diff --git a/oroca_bldc_FW/lib/mavlink/common/common.h b/oroca_bldc_FW/lib/mavlink/common/common.h index df3d44b..e7f9048 100755 --- a/oroca_bldc_FW/lib/mavlink/common/common.h +++ b/oroca_bldc_FW/lib/mavlink/common/common.h @@ -1,7 +1,8 @@ /** @file - * @brief MAVLink comm protocol generated from common.xml - * @see http://mavlink.org + * @brief MAVLink comm protocol generated from common.xml + * @see http://mavlink.org */ +#pragma once #ifndef MAVLINK_COMMON_H #define MAVLINK_COMMON_H @@ -9,6 +10,9 @@ #error Wrong include order: MAVLINK_COMMON.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call. #endif +#undef MAVLINK_THIS_XML_IDX +#define MAVLINK_THIS_XML_IDX 1 + #ifdef __cplusplus extern "C" { #endif @@ -23,10 +27,6 @@ extern "C" { #define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 59, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 0, 8, 204, 49, 170, 44, 83, 46, 0} #endif -#ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, MAVLINK_MESSAGE_INFO_FOLLOW_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS, MAVLINK_MESSAGE_INFO_WIND_COV, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} -#endif - #include "../protocol.h" #define MAVLINK_ENABLED_COMMON @@ -39,25 +39,25 @@ extern "C" { #define HAVE_ENUM_MAV_AUTOPILOT typedef enum MAV_AUTOPILOT { - MAV_AUTOPILOT_GENERIC=0, /* Generic autopilot, full support for everything | */ - MAV_AUTOPILOT_RESERVED=1, /* Reserved for future use. | */ - MAV_AUTOPILOT_SLUGS=2, /* SLUGS autopilot, http://slugsuav.soe.ucsc.edu | */ - MAV_AUTOPILOT_ARDUPILOTMEGA=3, /* ArduPilotMega / ArduCopter, http://diydrones.com | */ - MAV_AUTOPILOT_OPENPILOT=4, /* OpenPilot, http://openpilot.org | */ - MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY=5, /* Generic autopilot only supporting simple waypoints | */ - MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY=6, /* Generic autopilot supporting waypoints and other simple navigation commands | */ - MAV_AUTOPILOT_GENERIC_MISSION_FULL=7, /* Generic autopilot supporting the full mission command set | */ - MAV_AUTOPILOT_INVALID=8, /* No valid autopilot, e.g. a GCS or other MAVLink component | */ - MAV_AUTOPILOT_PPZ=9, /* PPZ UAV - http://nongnu.org/paparazzi | */ - MAV_AUTOPILOT_UDB=10, /* UAV Dev Board | */ - MAV_AUTOPILOT_FP=11, /* FlexiPilot | */ - MAV_AUTOPILOT_PX4=12, /* PX4 Autopilot - http://pixhawk.ethz.ch/px4/ | */ - MAV_AUTOPILOT_SMACCMPILOT=13, /* SMACCMPilot - http://smaccmpilot.org | */ - MAV_AUTOPILOT_AUTOQUAD=14, /* AutoQuad -- http://autoquad.org | */ - MAV_AUTOPILOT_ARMAZILA=15, /* Armazila -- http://armazila.com | */ - MAV_AUTOPILOT_AEROB=16, /* Aerob -- http://aerob.ru | */ - MAV_AUTOPILOT_ASLUAV=17, /* ASLUAV autopilot -- http://www.asl.ethz.ch | */ - MAV_AUTOPILOT_ENUM_END=18, /* | */ + MAV_AUTOPILOT_GENERIC=0, /* Generic autopilot, full support for everything | */ + MAV_AUTOPILOT_RESERVED=1, /* Reserved for future use. | */ + MAV_AUTOPILOT_SLUGS=2, /* SLUGS autopilot, http://slugsuav.soe.ucsc.edu | */ + MAV_AUTOPILOT_ARDUPILOTMEGA=3, /* ArduPilotMega / ArduCopter, http://diydrones.com | */ + MAV_AUTOPILOT_OPENPILOT=4, /* OpenPilot, http://openpilot.org | */ + MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY=5, /* Generic autopilot only supporting simple waypoints | */ + MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY=6, /* Generic autopilot supporting waypoints and other simple navigation commands | */ + MAV_AUTOPILOT_GENERIC_MISSION_FULL=7, /* Generic autopilot supporting the full mission command set | */ + MAV_AUTOPILOT_INVALID=8, /* No valid autopilot, e.g. a GCS or other MAVLink component | */ + MAV_AUTOPILOT_PPZ=9, /* PPZ UAV - http://nongnu.org/paparazzi | */ + MAV_AUTOPILOT_UDB=10, /* UAV Dev Board | */ + MAV_AUTOPILOT_FP=11, /* FlexiPilot | */ + MAV_AUTOPILOT_PX4=12, /* PX4 Autopilot - http://pixhawk.ethz.ch/px4/ | */ + MAV_AUTOPILOT_SMACCMPILOT=13, /* SMACCMPilot - http://smaccmpilot.org | */ + MAV_AUTOPILOT_AUTOQUAD=14, /* AutoQuad -- http://autoquad.org | */ + MAV_AUTOPILOT_ARMAZILA=15, /* Armazila -- http://armazila.com | */ + MAV_AUTOPILOT_AEROB=16, /* Aerob -- http://aerob.ru | */ + MAV_AUTOPILOT_ASLUAV=17, /* ASLUAV autopilot -- http://www.asl.ethz.ch | */ + MAV_AUTOPILOT_ENUM_END=18, /* | */ } MAV_AUTOPILOT; #endif @@ -66,35 +66,35 @@ typedef enum MAV_AUTOPILOT #define HAVE_ENUM_MAV_TYPE typedef enum MAV_TYPE { - MAV_TYPE_GENERIC=0, /* Generic micro air vehicle. | */ - MAV_TYPE_FIXED_WING=1, /* Fixed wing aircraft. | */ - MAV_TYPE_QUADROTOR=2, /* Quadrotor | */ - MAV_TYPE_COAXIAL=3, /* Coaxial helicopter | */ - MAV_TYPE_HELICOPTER=4, /* Normal helicopter with tail rotor. | */ - MAV_TYPE_ANTENNA_TRACKER=5, /* Ground installation | */ - MAV_TYPE_GCS=6, /* Operator control unit / ground control station | */ - MAV_TYPE_AIRSHIP=7, /* Airship, controlled | */ - MAV_TYPE_FREE_BALLOON=8, /* Free balloon, uncontrolled | */ - MAV_TYPE_ROCKET=9, /* Rocket | */ - MAV_TYPE_GROUND_ROVER=10, /* Ground rover | */ - MAV_TYPE_SURFACE_BOAT=11, /* Surface vessel, boat, ship | */ - MAV_TYPE_SUBMARINE=12, /* Submarine | */ - MAV_TYPE_HEXAROTOR=13, /* Hexarotor | */ - MAV_TYPE_OCTOROTOR=14, /* Octorotor | */ - MAV_TYPE_TRICOPTER=15, /* Octorotor | */ - MAV_TYPE_FLAPPING_WING=16, /* Flapping wing | */ - MAV_TYPE_KITE=17, /* Flapping wing | */ - MAV_TYPE_ONBOARD_CONTROLLER=18, /* Onboard companion controller | */ - MAV_TYPE_VTOL_DUOROTOR=19, /* Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. | */ - MAV_TYPE_VTOL_QUADROTOR=20, /* Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. | */ - MAV_TYPE_VTOL_TILTROTOR=21, /* Tiltrotor VTOL | */ - MAV_TYPE_VTOL_RESERVED2=22, /* VTOL reserved 2 | */ - MAV_TYPE_VTOL_RESERVED3=23, /* VTOL reserved 3 | */ - MAV_TYPE_VTOL_RESERVED4=24, /* VTOL reserved 4 | */ - MAV_TYPE_VTOL_RESERVED5=25, /* VTOL reserved 5 | */ - MAV_TYPE_GIMBAL=26, /* Onboard gimbal | */ - MAV_TYPE_ADSB=27, /* Onboard ADSB peripheral | */ - MAV_TYPE_ENUM_END=28, /* | */ + MAV_TYPE_GENERIC=0, /* Generic micro air vehicle. | */ + MAV_TYPE_FIXED_WING=1, /* Fixed wing aircraft. | */ + MAV_TYPE_QUADROTOR=2, /* Quadrotor | */ + MAV_TYPE_COAXIAL=3, /* Coaxial helicopter | */ + MAV_TYPE_HELICOPTER=4, /* Normal helicopter with tail rotor. | */ + MAV_TYPE_ANTENNA_TRACKER=5, /* Ground installation | */ + MAV_TYPE_GCS=6, /* Operator control unit / ground control station | */ + MAV_TYPE_AIRSHIP=7, /* Airship, controlled | */ + MAV_TYPE_FREE_BALLOON=8, /* Free balloon, uncontrolled | */ + MAV_TYPE_ROCKET=9, /* Rocket | */ + MAV_TYPE_GROUND_ROVER=10, /* Ground rover | */ + MAV_TYPE_SURFACE_BOAT=11, /* Surface vessel, boat, ship | */ + MAV_TYPE_SUBMARINE=12, /* Submarine | */ + MAV_TYPE_HEXAROTOR=13, /* Hexarotor | */ + MAV_TYPE_OCTOROTOR=14, /* Octorotor | */ + MAV_TYPE_TRICOPTER=15, /* Octorotor | */ + MAV_TYPE_FLAPPING_WING=16, /* Flapping wing | */ + MAV_TYPE_KITE=17, /* Flapping wing | */ + MAV_TYPE_ONBOARD_CONTROLLER=18, /* Onboard companion controller | */ + MAV_TYPE_VTOL_DUOROTOR=19, /* Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. | */ + MAV_TYPE_VTOL_QUADROTOR=20, /* Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. | */ + MAV_TYPE_VTOL_TILTROTOR=21, /* Tiltrotor VTOL | */ + MAV_TYPE_VTOL_RESERVED2=22, /* VTOL reserved 2 | */ + MAV_TYPE_VTOL_RESERVED3=23, /* VTOL reserved 3 | */ + MAV_TYPE_VTOL_RESERVED4=24, /* VTOL reserved 4 | */ + MAV_TYPE_VTOL_RESERVED5=25, /* VTOL reserved 5 | */ + MAV_TYPE_GIMBAL=26, /* Onboard gimbal | */ + MAV_TYPE_ADSB=27, /* Onboard ADSB peripheral | */ + MAV_TYPE_ENUM_END=28, /* | */ } MAV_TYPE; #endif @@ -103,12 +103,12 @@ typedef enum MAV_TYPE #define HAVE_ENUM_FIRMWARE_VERSION_TYPE typedef enum FIRMWARE_VERSION_TYPE { - FIRMWARE_VERSION_TYPE_DEV=0, /* development release | */ - FIRMWARE_VERSION_TYPE_ALPHA=64, /* alpha release | */ - FIRMWARE_VERSION_TYPE_BETA=128, /* beta release | */ - FIRMWARE_VERSION_TYPE_RC=192, /* release candidate | */ - FIRMWARE_VERSION_TYPE_OFFICIAL=255, /* official stable release | */ - FIRMWARE_VERSION_TYPE_ENUM_END=256, /* | */ + FIRMWARE_VERSION_TYPE_DEV=0, /* development release | */ + FIRMWARE_VERSION_TYPE_ALPHA=64, /* alpha release | */ + FIRMWARE_VERSION_TYPE_BETA=128, /* beta release | */ + FIRMWARE_VERSION_TYPE_RC=192, /* release candidate | */ + FIRMWARE_VERSION_TYPE_OFFICIAL=255, /* official stable release | */ + FIRMWARE_VERSION_TYPE_ENUM_END=256, /* | */ } FIRMWARE_VERSION_TYPE; #endif @@ -117,15 +117,15 @@ typedef enum FIRMWARE_VERSION_TYPE #define HAVE_ENUM_MAV_MODE_FLAG typedef enum MAV_MODE_FLAG { - MAV_MODE_FLAG_CUSTOM_MODE_ENABLED=1, /* 0b00000001 Reserved for future use. | */ - MAV_MODE_FLAG_TEST_ENABLED=2, /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ - MAV_MODE_FLAG_AUTO_ENABLED=4, /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ - MAV_MODE_FLAG_GUIDED_ENABLED=8, /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */ - MAV_MODE_FLAG_STABILIZE_ENABLED=16, /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */ - MAV_MODE_FLAG_HIL_ENABLED=32, /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */ - MAV_MODE_FLAG_MANUAL_INPUT_ENABLED=64, /* 0b01000000 remote control input is enabled. | */ - MAV_MODE_FLAG_SAFETY_ARMED=128, /* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. | */ - MAV_MODE_FLAG_ENUM_END=129, /* | */ + MAV_MODE_FLAG_CUSTOM_MODE_ENABLED=1, /* 0b00000001 Reserved for future use. | */ + MAV_MODE_FLAG_TEST_ENABLED=2, /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ + MAV_MODE_FLAG_AUTO_ENABLED=4, /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ + MAV_MODE_FLAG_GUIDED_ENABLED=8, /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */ + MAV_MODE_FLAG_STABILIZE_ENABLED=16, /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */ + MAV_MODE_FLAG_HIL_ENABLED=32, /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */ + MAV_MODE_FLAG_MANUAL_INPUT_ENABLED=64, /* 0b01000000 remote control input is enabled. | */ + MAV_MODE_FLAG_SAFETY_ARMED=128, /* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. | */ + MAV_MODE_FLAG_ENUM_END=129, /* | */ } MAV_MODE_FLAG; #endif @@ -134,15 +134,15 @@ typedef enum MAV_MODE_FLAG #define HAVE_ENUM_MAV_MODE_FLAG_DECODE_POSITION typedef enum MAV_MODE_FLAG_DECODE_POSITION { - MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE=1, /* Eighth bit: 00000001 | */ - MAV_MODE_FLAG_DECODE_POSITION_TEST=2, /* Seventh bit: 00000010 | */ - MAV_MODE_FLAG_DECODE_POSITION_AUTO=4, /* Sixt bit: 00000100 | */ - MAV_MODE_FLAG_DECODE_POSITION_GUIDED=8, /* Fifth bit: 00001000 | */ - MAV_MODE_FLAG_DECODE_POSITION_STABILIZE=16, /* Fourth bit: 00010000 | */ - MAV_MODE_FLAG_DECODE_POSITION_HIL=32, /* Third bit: 00100000 | */ - MAV_MODE_FLAG_DECODE_POSITION_MANUAL=64, /* Second bit: 01000000 | */ - MAV_MODE_FLAG_DECODE_POSITION_SAFETY=128, /* First bit: 10000000 | */ - MAV_MODE_FLAG_DECODE_POSITION_ENUM_END=129, /* | */ + MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE=1, /* Eighth bit: 00000001 | */ + MAV_MODE_FLAG_DECODE_POSITION_TEST=2, /* Seventh bit: 00000010 | */ + MAV_MODE_FLAG_DECODE_POSITION_AUTO=4, /* Sixt bit: 00000100 | */ + MAV_MODE_FLAG_DECODE_POSITION_GUIDED=8, /* Fifth bit: 00001000 | */ + MAV_MODE_FLAG_DECODE_POSITION_STABILIZE=16, /* Fourth bit: 00010000 | */ + MAV_MODE_FLAG_DECODE_POSITION_HIL=32, /* Third bit: 00100000 | */ + MAV_MODE_FLAG_DECODE_POSITION_MANUAL=64, /* Second bit: 01000000 | */ + MAV_MODE_FLAG_DECODE_POSITION_SAFETY=128, /* First bit: 10000000 | */ + MAV_MODE_FLAG_DECODE_POSITION_ENUM_END=129, /* | */ } MAV_MODE_FLAG_DECODE_POSITION; #endif @@ -151,11 +151,11 @@ typedef enum MAV_MODE_FLAG_DECODE_POSITION #define HAVE_ENUM_MAV_GOTO typedef enum MAV_GOTO { - MAV_GOTO_DO_HOLD=0, /* Hold at the current position. | */ - MAV_GOTO_DO_CONTINUE=1, /* Continue with the next item in mission execution. | */ - MAV_GOTO_HOLD_AT_CURRENT_POSITION=2, /* Hold at the current position of the system | */ - MAV_GOTO_HOLD_AT_SPECIFIED_POSITION=3, /* Hold at the position specified in the parameters of the DO_HOLD action | */ - MAV_GOTO_ENUM_END=4, /* | */ + MAV_GOTO_DO_HOLD=0, /* Hold at the current position. | */ + MAV_GOTO_DO_CONTINUE=1, /* Continue with the next item in mission execution. | */ + MAV_GOTO_HOLD_AT_CURRENT_POSITION=2, /* Hold at the current position of the system | */ + MAV_GOTO_HOLD_AT_SPECIFIED_POSITION=3, /* Hold at the position specified in the parameters of the DO_HOLD action | */ + MAV_GOTO_ENUM_END=4, /* | */ } MAV_GOTO; #endif @@ -165,18 +165,18 @@ typedef enum MAV_GOTO #define HAVE_ENUM_MAV_MODE typedef enum MAV_MODE { - MAV_MODE_PREFLIGHT=0, /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */ - MAV_MODE_MANUAL_DISARMED=64, /* System is allowed to be active, under manual (RC) control, no stabilization | */ - MAV_MODE_TEST_DISARMED=66, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ - MAV_MODE_STABILIZE_DISARMED=80, /* System is allowed to be active, under assisted RC control. | */ - MAV_MODE_GUIDED_DISARMED=88, /* System is allowed to be active, under autonomous control, manual setpoint | */ - MAV_MODE_AUTO_DISARMED=92, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ - MAV_MODE_MANUAL_ARMED=192, /* System is allowed to be active, under manual (RC) control, no stabilization | */ - MAV_MODE_TEST_ARMED=194, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ - MAV_MODE_STABILIZE_ARMED=208, /* System is allowed to be active, under assisted RC control. | */ - MAV_MODE_GUIDED_ARMED=216, /* System is allowed to be active, under autonomous control, manual setpoint | */ - MAV_MODE_AUTO_ARMED=220, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ - MAV_MODE_ENUM_END=221, /* | */ + MAV_MODE_PREFLIGHT=0, /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */ + MAV_MODE_MANUAL_DISARMED=64, /* System is allowed to be active, under manual (RC) control, no stabilization | */ + MAV_MODE_TEST_DISARMED=66, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ + MAV_MODE_STABILIZE_DISARMED=80, /* System is allowed to be active, under assisted RC control. | */ + MAV_MODE_GUIDED_DISARMED=88, /* System is allowed to be active, under autonomous control, manual setpoint | */ + MAV_MODE_AUTO_DISARMED=92, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ + MAV_MODE_MANUAL_ARMED=192, /* System is allowed to be active, under manual (RC) control, no stabilization | */ + MAV_MODE_TEST_ARMED=194, /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ + MAV_MODE_STABILIZE_ARMED=208, /* System is allowed to be active, under assisted RC control. | */ + MAV_MODE_GUIDED_ARMED=216, /* System is allowed to be active, under autonomous control, manual setpoint | */ + MAV_MODE_AUTO_ARMED=220, /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ + MAV_MODE_ENUM_END=221, /* | */ } MAV_MODE; #endif @@ -185,15 +185,15 @@ typedef enum MAV_MODE #define HAVE_ENUM_MAV_STATE typedef enum MAV_STATE { - MAV_STATE_UNINIT=0, /* Uninitialized system, state is unknown. | */ - MAV_STATE_BOOT=1, /* System is booting up. | */ - MAV_STATE_CALIBRATING=2, /* System is calibrating and not flight-ready. | */ - MAV_STATE_STANDBY=3, /* System is grounded and on standby. It can be launched any time. | */ - MAV_STATE_ACTIVE=4, /* System is active and might be already airborne. Motors are engaged. | */ - MAV_STATE_CRITICAL=5, /* System is in a non-normal flight mode. It can however still navigate. | */ - MAV_STATE_EMERGENCY=6, /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ - MAV_STATE_POWEROFF=7, /* System just initialized its power-down sequence, will shut down now. | */ - MAV_STATE_ENUM_END=8, /* | */ + MAV_STATE_UNINIT=0, /* Uninitialized system, state is unknown. | */ + MAV_STATE_BOOT=1, /* System is booting up. | */ + MAV_STATE_CALIBRATING=2, /* System is calibrating and not flight-ready. | */ + MAV_STATE_STANDBY=3, /* System is grounded and on standby. It can be launched any time. | */ + MAV_STATE_ACTIVE=4, /* System is active and might be already airborne. Motors are engaged. | */ + MAV_STATE_CRITICAL=5, /* System is in a non-normal flight mode. It can however still navigate. | */ + MAV_STATE_EMERGENCY=6, /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ + MAV_STATE_POWEROFF=7, /* System just initialized its power-down sequence, will shut down now. | */ + MAV_STATE_ENUM_END=8, /* | */ } MAV_STATE; #endif @@ -202,38 +202,38 @@ typedef enum MAV_STATE #define HAVE_ENUM_MAV_COMPONENT typedef enum MAV_COMPONENT { - MAV_COMP_ID_ALL=0, /* | */ - MAV_COMP_ID_CAMERA=100, /* | */ - MAV_COMP_ID_SERVO1=140, /* | */ - MAV_COMP_ID_SERVO2=141, /* | */ - MAV_COMP_ID_SERVO3=142, /* | */ - MAV_COMP_ID_SERVO4=143, /* | */ - MAV_COMP_ID_SERVO5=144, /* | */ - MAV_COMP_ID_SERVO6=145, /* | */ - MAV_COMP_ID_SERVO7=146, /* | */ - MAV_COMP_ID_SERVO8=147, /* | */ - MAV_COMP_ID_SERVO9=148, /* | */ - MAV_COMP_ID_SERVO10=149, /* | */ - MAV_COMP_ID_SERVO11=150, /* | */ - MAV_COMP_ID_SERVO12=151, /* | */ - MAV_COMP_ID_SERVO13=152, /* | */ - MAV_COMP_ID_SERVO14=153, /* | */ - MAV_COMP_ID_GIMBAL=154, /* | */ - MAV_COMP_ID_LOG=155, /* | */ - MAV_COMP_ID_ADSB=156, /* | */ - MAV_COMP_ID_OSD=157, /* On Screen Display (OSD) devices for video links | */ - MAV_COMP_ID_PERIPHERAL=158, /* Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol | */ - MAV_COMP_ID_MAPPER=180, /* | */ - MAV_COMP_ID_MISSIONPLANNER=190, /* | */ - MAV_COMP_ID_PATHPLANNER=195, /* | */ - MAV_COMP_ID_IMU=200, /* | */ - MAV_COMP_ID_IMU_2=201, /* | */ - MAV_COMP_ID_IMU_3=202, /* | */ - MAV_COMP_ID_GPS=220, /* | */ - MAV_COMP_ID_UDP_BRIDGE=240, /* | */ - MAV_COMP_ID_UART_BRIDGE=241, /* | */ - MAV_COMP_ID_SYSTEM_CONTROL=250, /* | */ - MAV_COMPONENT_ENUM_END=251, /* | */ + MAV_COMP_ID_ALL=0, /* | */ + MAV_COMP_ID_CAMERA=100, /* | */ + MAV_COMP_ID_SERVO1=140, /* | */ + MAV_COMP_ID_SERVO2=141, /* | */ + MAV_COMP_ID_SERVO3=142, /* | */ + MAV_COMP_ID_SERVO4=143, /* | */ + MAV_COMP_ID_SERVO5=144, /* | */ + MAV_COMP_ID_SERVO6=145, /* | */ + MAV_COMP_ID_SERVO7=146, /* | */ + MAV_COMP_ID_SERVO8=147, /* | */ + MAV_COMP_ID_SERVO9=148, /* | */ + MAV_COMP_ID_SERVO10=149, /* | */ + MAV_COMP_ID_SERVO11=150, /* | */ + MAV_COMP_ID_SERVO12=151, /* | */ + MAV_COMP_ID_SERVO13=152, /* | */ + MAV_COMP_ID_SERVO14=153, /* | */ + MAV_COMP_ID_GIMBAL=154, /* | */ + MAV_COMP_ID_LOG=155, /* | */ + MAV_COMP_ID_ADSB=156, /* | */ + MAV_COMP_ID_OSD=157, /* On Screen Display (OSD) devices for video links | */ + MAV_COMP_ID_PERIPHERAL=158, /* Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol | */ + MAV_COMP_ID_MAPPER=180, /* | */ + MAV_COMP_ID_MISSIONPLANNER=190, /* | */ + MAV_COMP_ID_PATHPLANNER=195, /* | */ + MAV_COMP_ID_IMU=200, /* | */ + MAV_COMP_ID_IMU_2=201, /* | */ + MAV_COMP_ID_IMU_3=202, /* | */ + MAV_COMP_ID_GPS=220, /* | */ + MAV_COMP_ID_UDP_BRIDGE=240, /* | */ + MAV_COMP_ID_UART_BRIDGE=241, /* | */ + MAV_COMP_ID_SYSTEM_CONTROL=250, /* | */ + MAV_COMPONENT_ENUM_END=251, /* | */ } MAV_COMPONENT; #endif @@ -242,31 +242,31 @@ typedef enum MAV_COMPONENT #define HAVE_ENUM_MAV_SYS_STATUS_SENSOR typedef enum MAV_SYS_STATUS_SENSOR { - MAV_SYS_STATUS_SENSOR_3D_GYRO=1, /* 0x01 3D gyro | */ - MAV_SYS_STATUS_SENSOR_3D_ACCEL=2, /* 0x02 3D accelerometer | */ - MAV_SYS_STATUS_SENSOR_3D_MAG=4, /* 0x04 3D magnetometer | */ - MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE=8, /* 0x08 absolute pressure | */ - MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE=16, /* 0x10 differential pressure | */ - MAV_SYS_STATUS_SENSOR_GPS=32, /* 0x20 GPS | */ - MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW=64, /* 0x40 optical flow | */ - MAV_SYS_STATUS_SENSOR_VISION_POSITION=128, /* 0x80 computer vision position | */ - MAV_SYS_STATUS_SENSOR_LASER_POSITION=256, /* 0x100 laser based position | */ - MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH=512, /* 0x200 external ground truth (Vicon or Leica) | */ - MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL=1024, /* 0x400 3D angular rate control | */ - MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION=2048, /* 0x800 attitude stabilization | */ - MAV_SYS_STATUS_SENSOR_YAW_POSITION=4096, /* 0x1000 yaw position | */ - MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL=8192, /* 0x2000 z/altitude control | */ - MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL=16384, /* 0x4000 x/y position control | */ - MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS=32768, /* 0x8000 motor outputs / control | */ - MAV_SYS_STATUS_SENSOR_RC_RECEIVER=65536, /* 0x10000 rc receiver | */ - MAV_SYS_STATUS_SENSOR_3D_GYRO2=131072, /* 0x20000 2nd 3D gyro | */ - MAV_SYS_STATUS_SENSOR_3D_ACCEL2=262144, /* 0x40000 2nd 3D accelerometer | */ - MAV_SYS_STATUS_SENSOR_3D_MAG2=524288, /* 0x80000 2nd 3D magnetometer | */ - MAV_SYS_STATUS_GEOFENCE=1048576, /* 0x100000 geofence | */ - MAV_SYS_STATUS_AHRS=2097152, /* 0x200000 AHRS subsystem health | */ - MAV_SYS_STATUS_TERRAIN=4194304, /* 0x400000 Terrain subsystem health | */ - MAV_SYS_STATUS_REVERSE_MOTOR=8388608, /* 0x800000 Motors are reversed | */ - MAV_SYS_STATUS_SENSOR_ENUM_END=8388609, /* | */ + MAV_SYS_STATUS_SENSOR_3D_GYRO=1, /* 0x01 3D gyro | */ + MAV_SYS_STATUS_SENSOR_3D_ACCEL=2, /* 0x02 3D accelerometer | */ + MAV_SYS_STATUS_SENSOR_3D_MAG=4, /* 0x04 3D magnetometer | */ + MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE=8, /* 0x08 absolute pressure | */ + MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE=16, /* 0x10 differential pressure | */ + MAV_SYS_STATUS_SENSOR_GPS=32, /* 0x20 GPS | */ + MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW=64, /* 0x40 optical flow | */ + MAV_SYS_STATUS_SENSOR_VISION_POSITION=128, /* 0x80 computer vision position | */ + MAV_SYS_STATUS_SENSOR_LASER_POSITION=256, /* 0x100 laser based position | */ + MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH=512, /* 0x200 external ground truth (Vicon or Leica) | */ + MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL=1024, /* 0x400 3D angular rate control | */ + MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION=2048, /* 0x800 attitude stabilization | */ + MAV_SYS_STATUS_SENSOR_YAW_POSITION=4096, /* 0x1000 yaw position | */ + MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL=8192, /* 0x2000 z/altitude control | */ + MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL=16384, /* 0x4000 x/y position control | */ + MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS=32768, /* 0x8000 motor outputs / control | */ + MAV_SYS_STATUS_SENSOR_RC_RECEIVER=65536, /* 0x10000 rc receiver | */ + MAV_SYS_STATUS_SENSOR_3D_GYRO2=131072, /* 0x20000 2nd 3D gyro | */ + MAV_SYS_STATUS_SENSOR_3D_ACCEL2=262144, /* 0x40000 2nd 3D accelerometer | */ + MAV_SYS_STATUS_SENSOR_3D_MAG2=524288, /* 0x80000 2nd 3D magnetometer | */ + MAV_SYS_STATUS_GEOFENCE=1048576, /* 0x100000 geofence | */ + MAV_SYS_STATUS_AHRS=2097152, /* 0x200000 AHRS subsystem health | */ + MAV_SYS_STATUS_TERRAIN=4194304, /* 0x400000 Terrain subsystem health | */ + MAV_SYS_STATUS_REVERSE_MOTOR=8388608, /* 0x800000 Motors are reversed | */ + MAV_SYS_STATUS_SENSOR_ENUM_END=8388609, /* | */ } MAV_SYS_STATUS_SENSOR; #endif @@ -275,19 +275,19 @@ typedef enum MAV_SYS_STATUS_SENSOR #define HAVE_ENUM_MAV_FRAME typedef enum MAV_FRAME { - MAV_FRAME_GLOBAL=0, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */ - MAV_FRAME_LOCAL_NED=1, /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */ - MAV_FRAME_MISSION=2, /* NOT a coordinate frame, indicates a mission command. | */ - MAV_FRAME_GLOBAL_RELATIVE_ALT=3, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ - MAV_FRAME_LOCAL_ENU=4, /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */ - MAV_FRAME_GLOBAL_INT=5, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) | */ - MAV_FRAME_GLOBAL_RELATIVE_ALT_INT=6, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. | */ - MAV_FRAME_LOCAL_OFFSET_NED=7, /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ - MAV_FRAME_BODY_NED=8, /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ - MAV_FRAME_BODY_OFFSET_NED=9, /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ - MAV_FRAME_GLOBAL_TERRAIN_ALT=10, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ - MAV_FRAME_GLOBAL_TERRAIN_ALT_INT=11, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ - MAV_FRAME_ENUM_END=12, /* | */ + MAV_FRAME_GLOBAL=0, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */ + MAV_FRAME_LOCAL_NED=1, /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */ + MAV_FRAME_MISSION=2, /* NOT a coordinate frame, indicates a mission command. | */ + MAV_FRAME_GLOBAL_RELATIVE_ALT=3, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ + MAV_FRAME_LOCAL_ENU=4, /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */ + MAV_FRAME_GLOBAL_INT=5, /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) | */ + MAV_FRAME_GLOBAL_RELATIVE_ALT_INT=6, /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. | */ + MAV_FRAME_LOCAL_OFFSET_NED=7, /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ + MAV_FRAME_BODY_NED=8, /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ + MAV_FRAME_BODY_OFFSET_NED=9, /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ + MAV_FRAME_GLOBAL_TERRAIN_ALT=10, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ + MAV_FRAME_GLOBAL_TERRAIN_ALT_INT=11, /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ + MAV_FRAME_ENUM_END=12, /* | */ } MAV_FRAME; #endif @@ -296,13 +296,13 @@ typedef enum MAV_FRAME #define HAVE_ENUM_MAVLINK_DATA_STREAM_TYPE typedef enum MAVLINK_DATA_STREAM_TYPE { - MAVLINK_DATA_STREAM_IMG_JPEG=1, /* | */ - MAVLINK_DATA_STREAM_IMG_BMP=2, /* | */ - MAVLINK_DATA_STREAM_IMG_RAW8U=3, /* | */ - MAVLINK_DATA_STREAM_IMG_RAW32U=4, /* | */ - MAVLINK_DATA_STREAM_IMG_PGM=5, /* | */ - MAVLINK_DATA_STREAM_IMG_PNG=6, /* | */ - MAVLINK_DATA_STREAM_TYPE_ENUM_END=7, /* | */ + MAVLINK_DATA_STREAM_IMG_JPEG=1, /* | */ + MAVLINK_DATA_STREAM_IMG_BMP=2, /* | */ + MAVLINK_DATA_STREAM_IMG_RAW8U=3, /* | */ + MAVLINK_DATA_STREAM_IMG_RAW32U=4, /* | */ + MAVLINK_DATA_STREAM_IMG_PGM=5, /* | */ + MAVLINK_DATA_STREAM_IMG_PNG=6, /* | */ + MAVLINK_DATA_STREAM_TYPE_ENUM_END=7, /* | */ } MAVLINK_DATA_STREAM_TYPE; #endif @@ -311,11 +311,11 @@ typedef enum MAVLINK_DATA_STREAM_TYPE #define HAVE_ENUM_FENCE_ACTION typedef enum FENCE_ACTION { - FENCE_ACTION_NONE=0, /* Disable fenced mode | */ - FENCE_ACTION_GUIDED=1, /* Switched to guided mode to return point (fence point 0) | */ - FENCE_ACTION_REPORT=2, /* Report fence breach, but don't take action | */ - FENCE_ACTION_GUIDED_THR_PASS=3, /* Switched to guided mode to return point (fence point 0) with manual throttle control | */ - FENCE_ACTION_ENUM_END=4, /* | */ + FENCE_ACTION_NONE=0, /* Disable fenced mode | */ + FENCE_ACTION_GUIDED=1, /* Switched to guided mode to return point (fence point 0) | */ + FENCE_ACTION_REPORT=2, /* Report fence breach, but don't take action | */ + FENCE_ACTION_GUIDED_THR_PASS=3, /* Switched to guided mode to return point (fence point 0) with manual throttle control | */ + FENCE_ACTION_ENUM_END=4, /* | */ } FENCE_ACTION; #endif @@ -324,11 +324,11 @@ typedef enum FENCE_ACTION #define HAVE_ENUM_FENCE_BREACH typedef enum FENCE_BREACH { - FENCE_BREACH_NONE=0, /* No last fence breach | */ - FENCE_BREACH_MINALT=1, /* Breached minimum altitude | */ - FENCE_BREACH_MAXALT=2, /* Breached maximum altitude | */ - FENCE_BREACH_BOUNDARY=3, /* Breached fence boundary | */ - FENCE_BREACH_ENUM_END=4, /* | */ + FENCE_BREACH_NONE=0, /* No last fence breach | */ + FENCE_BREACH_MINALT=1, /* Breached minimum altitude | */ + FENCE_BREACH_MAXALT=2, /* Breached maximum altitude | */ + FENCE_BREACH_BOUNDARY=3, /* Breached fence boundary | */ + FENCE_BREACH_ENUM_END=4, /* | */ } FENCE_BREACH; #endif @@ -337,12 +337,12 @@ typedef enum FENCE_BREACH #define HAVE_ENUM_MAV_MOUNT_MODE typedef enum MAV_MOUNT_MODE { - MAV_MOUNT_MODE_RETRACT=0, /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */ - MAV_MOUNT_MODE_NEUTRAL=1, /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */ - MAV_MOUNT_MODE_MAVLINK_TARGETING=2, /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ - MAV_MOUNT_MODE_RC_TARGETING=3, /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ - MAV_MOUNT_MODE_GPS_POINT=4, /* Load neutral position and start to point to Lat,Lon,Alt | */ - MAV_MOUNT_MODE_ENUM_END=5, /* | */ + MAV_MOUNT_MODE_RETRACT=0, /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */ + MAV_MOUNT_MODE_NEUTRAL=1, /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */ + MAV_MOUNT_MODE_MAVLINK_TARGETING=2, /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ + MAV_MOUNT_MODE_RC_TARGETING=3, /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ + MAV_MOUNT_MODE_GPS_POINT=4, /* Load neutral position and start to point to Lat,Lon,Alt | */ + MAV_MOUNT_MODE_ENUM_END=5, /* | */ } MAV_MOUNT_MODE; #endif @@ -351,100 +351,100 @@ typedef enum MAV_MOUNT_MODE #define HAVE_ENUM_MAV_CMD typedef enum MAV_CMD { - MAV_CMD_NAV_WAYPOINT=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_RETURN_TO_LAUNCH=20, /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_NAV_LAND=21, /* Land at location |Abort Alt| Empty| Empty| Desired yaw angle| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_LAND_LOCAL=23, /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position [m] - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate [ms^-1]| Desired yaw angle [rad]| Y-axis position [m]| X-axis position [m]| Z-axis / ground level position [m]| */ - MAV_CMD_NAV_TAKEOFF_LOCAL=24, /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor [rad]| Empty| Takeoff ascend rate [ms^-1]| Yaw angle [rad] (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position [m]| X-axis position [m]| Z-axis position [m]| */ - MAV_CMD_NAV_FOLLOW=25, /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT=30, /* Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. | Empty| Empty| Empty| Empty| Empty| Desired altitude in meters| */ - MAV_CMD_NAV_LOITER_TO_ALT=31, /* Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. |Heading Required (0 = False)| Radius in meters. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location| Latitude| Longitude| Altitude| */ - MAV_CMD_DO_FOLLOW=32, /* Being following a target |System ID (the system ID of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode| RESERVED| RESERVED| altitude flag: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home| altitude| RESERVED| TTL in seconds in which the MAV should go to the default position hold mode after a message rx timeout| */ - MAV_CMD_DO_FOLLOW_REPOSITION=33, /* Reposition the MAV after a follow target command has been sent |Camera q1 (where 0 is on the ray from the camera to the tracking device)| Camera q2| Camera q3| Camera q4| altitude offset from target (m)| X offset from target (m)| Y offset from target (m)| */ - MAV_CMD_NAV_ROI=80, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - MAV_CMD_NAV_PATHPLANNING=81, /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - MAV_CMD_NAV_SPLINE_WAYPOINT=82, /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - MAV_CMD_NAV_VTOL_TAKEOFF=84, /* Takeoff from ground using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_VTOL_LAND=85, /* Land using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude| */ - MAV_CMD_NAV_GUIDED_ENABLE=92, /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_NAV_DELAY=93, /* Delay the next navigation command a number of seconds or until a specified time |Delay in seconds (decimal, -1 to enable time-of-day fields)| hour (24h format, UTC, -1 to ignore)| minute (24h format, UTC, -1 to ignore)| second (24h format, UTC)| Empty| Empty| Empty| */ - MAV_CMD_NAV_LAST=95, /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_DELAY=112, /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_CHANGE_ALT=113, /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ - MAV_CMD_CONDITION_DISTANCE=114, /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_YAW=115, /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ - MAV_CMD_CONDITION_LAST=159, /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_JUMP=177, /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| absolute or relative [0,1]| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_HOME=179, /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ - MAV_CMD_DO_SET_PARAMETER=180, /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_RELAY=181, /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_REPEAT_RELAY=182, /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_SERVO=183, /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_REPEAT_SERVO=184, /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ - MAV_CMD_DO_FLIGHTTERMINATION=185, /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_LAND_START=189, /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty| */ - MAV_CMD_DO_RALLY_LAND=190, /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_GO_AROUND=191, /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_REPOSITION=192, /* Reposition the vehicle to a specific WGS84 global position. |Ground speed, less than 0 (-1) for default| Bitmask of option flags, see the MAV_DO_REPOSITION_FLAGS enum.| Reserved| Yaw heading, NaN for unchanged. For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| Latitude (deg * 1E7)| Longitude (deg * 1E7)| Altitude (meters)| */ - MAV_CMD_DO_PAUSE_CONTINUE=193, /* If in a GPS controlled position mode, hold the current position or continue. |0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - MAV_CMD_DO_CONTROL_VIDEO=200, /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ - MAV_CMD_DO_SET_ROI=201, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ - MAV_CMD_DO_DIGICAM_CONTROL=203, /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ - MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ - MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch or lat in degrees, depending on mount mode.| roll or lon in degrees depending on mount mode| yaw or alt (in meters) depending on mount mode| reserved| reserved| reserved| MAV_MOUNT_MODE enum value| */ - MAV_CMD_DO_SET_CAM_TRIGG_DIST=206, /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_FENCE_ENABLE=207, /* Mission command to enable the geofence |enable? (0=disable, 1=enable, 2=disable_floor_only)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_PARACHUTE=208, /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_INVERTED_FLIGHT=210, /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_MOUNT_CONTROL_QUAT=220, /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */ - MAV_CMD_DO_GUIDED_MASTER=221, /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_DO_GUIDED_LIMITS=222, /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */ - MAV_CMD_DO_LAST=240, /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Accelerometer calibration: 0: no, 1: yes| Compass/Motor interference calibration: 0: no, 1: yes| Empty| */ - MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS=242, /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ - MAV_CMD_PREFLIGHT_UAVCAN=243, /* Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. |1: Trigger actuator ID assignment and direction mapping.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: start logging with rate of param 3 in Hz (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty| */ - MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| Reserved, send 0| Reserved, send 0| Reserved, send 0| Reserved, send 0| Reserved, send 0| */ - MAV_CMD_OVERRIDE_GOTO=252, /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */ - MAV_CMD_MISSION_START=300, /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */ - MAV_CMD_COMPONENT_ARM_DISARM=400, /* Arms / Disarms a component |1 to arm, 0 to disarm| */ - MAV_CMD_GET_HOME_POSITION=410, /* Request the home position from the vehicle. |Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - MAV_CMD_START_RX_PAIR=500, /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */ - MAV_CMD_GET_MESSAGE_INTERVAL=510, /* Request the interval between messages for a particular MAVLink message ID |The MAVLink message ID| */ - MAV_CMD_SET_MESSAGE_INTERVAL=511, /* Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM |The MAVLink message ID| The interval between two messages, in microseconds. Set to -1 to disable and 0 to request default rate.| */ - MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES=520, /* Request autopilot capabilities |1: Request autopilot version| Reserved (all remaining params)| */ - MAV_CMD_IMAGE_START_CAPTURE=2000, /* Start image capture sequence |Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ - MAV_CMD_IMAGE_STOP_CAPTURE=2001, /* Stop image capture sequence |Reserved| Reserved| */ - MAV_CMD_DO_TRIGGER_CONTROL=2003, /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start)| Shutter integration time (in ms)| Reserved| */ - MAV_CMD_VIDEO_START_CAPTURE=2500, /* Starts video capture |Camera ID (0 for all cameras), 1 for first, 2 for second, etc.| Frames per second| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ - MAV_CMD_VIDEO_STOP_CAPTURE=2501, /* Stop the current video capture |Reserved| Reserved| */ - MAV_CMD_PANORAMA_CREATE=2800, /* Create a panorama at the current position |Viewing angle horizontal of the panorama (in degrees, +- 0.5 the total angle)| Viewing angle vertical of panorama (in degrees)| Speed of the horizontal rotation (in degrees per second)| Speed of the vertical rotation (in degrees per second)| */ - MAV_CMD_DO_VTOL_TRANSITION=3000, /* Request VTOL transition |The target VTOL state, as defined by ENUM MAV_VTOL_STATE. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| */ - MAV_CMD_PAYLOAD_PREPARE_DEPLOY=30001, /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters AMSL| */ - MAV_CMD_PAYLOAD_CONTROL_DEPLOY=30002, /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - MAV_CMD_WAYPOINT_USER_1=31000, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_2=31001, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_3=31002, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_4=31003, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_WAYPOINT_USER_5=31004, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_1=31005, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_2=31006, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_3=31007, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_4=31008, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_SPATIAL_USER_5=31009, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - MAV_CMD_USER_1=31010, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - MAV_CMD_USER_2=31011, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - MAV_CMD_USER_3=31012, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - MAV_CMD_USER_4=31013, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - MAV_CMD_USER_5=31014, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - MAV_CMD_ENUM_END=31015, /* | */ + MAV_CMD_NAV_WAYPOINT=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_RETURN_TO_LAUNCH=20, /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_NAV_LAND=21, /* Land at location |Abort Alt| Empty| Empty| Desired yaw angle| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_LAND_LOCAL=23, /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position [m] - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate [ms^-1]| Desired yaw angle [rad]| Y-axis position [m]| X-axis position [m]| Z-axis / ground level position [m]| */ + MAV_CMD_NAV_TAKEOFF_LOCAL=24, /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor [rad]| Empty| Takeoff ascend rate [ms^-1]| Yaw angle [rad] (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position [m]| X-axis position [m]| Z-axis position [m]| */ + MAV_CMD_NAV_FOLLOW=25, /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT=30, /* Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. | Empty| Empty| Empty| Empty| Empty| Desired altitude in meters| */ + MAV_CMD_NAV_LOITER_TO_ALT=31, /* Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. |Heading Required (0 = False)| Radius in meters. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location| Latitude| Longitude| Altitude| */ + MAV_CMD_DO_FOLLOW=32, /* Being following a target |System ID (the system ID of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode| RESERVED| RESERVED| altitude flag: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home| altitude| RESERVED| TTL in seconds in which the MAV should go to the default position hold mode after a message rx timeout| */ + MAV_CMD_DO_FOLLOW_REPOSITION=33, /* Reposition the MAV after a follow target command has been sent |Camera q1 (where 0 is on the ray from the camera to the tracking device)| Camera q2| Camera q3| Camera q4| altitude offset from target (m)| X offset from target (m)| Y offset from target (m)| */ + MAV_CMD_NAV_ROI=80, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ + MAV_CMD_NAV_PATHPLANNING=81, /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + MAV_CMD_NAV_SPLINE_WAYPOINT=82, /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + MAV_CMD_NAV_VTOL_TAKEOFF=84, /* Takeoff from ground using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_VTOL_LAND=85, /* Land using VTOL mode |Empty| Empty| Empty| Yaw angle in degrees| Latitude| Longitude| Altitude| */ + MAV_CMD_NAV_GUIDED_ENABLE=92, /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_NAV_DELAY=93, /* Delay the next navigation command a number of seconds or until a specified time |Delay in seconds (decimal, -1 to enable time-of-day fields)| hour (24h format, UTC, -1 to ignore)| minute (24h format, UTC, -1 to ignore)| second (24h format, UTC)| Empty| Empty| Empty| */ + MAV_CMD_NAV_LAST=95, /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_CONDITION_DELAY=112, /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_CONDITION_CHANGE_ALT=113, /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ + MAV_CMD_CONDITION_DISTANCE=114, /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_CONDITION_YAW=115, /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ + MAV_CMD_CONDITION_LAST=159, /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_JUMP=177, /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| absolute or relative [0,1]| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_HOME=179, /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ + MAV_CMD_DO_SET_PARAMETER=180, /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_RELAY=181, /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_REPEAT_RELAY=182, /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_SERVO=183, /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_REPEAT_SERVO=184, /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ + MAV_CMD_DO_FLIGHTTERMINATION=185, /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_LAND_START=189, /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty| */ + MAV_CMD_DO_RALLY_LAND=190, /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_GO_AROUND=191, /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_REPOSITION=192, /* Reposition the vehicle to a specific WGS84 global position. |Ground speed, less than 0 (-1) for default| Bitmask of option flags, see the MAV_DO_REPOSITION_FLAGS enum.| Reserved| Yaw heading, NaN for unchanged. For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| Latitude (deg * 1E7)| Longitude (deg * 1E7)| Altitude (meters)| */ + MAV_CMD_DO_PAUSE_CONTINUE=193, /* If in a GPS controlled position mode, hold the current position or continue. |0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + MAV_CMD_DO_CONTROL_VIDEO=200, /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ + MAV_CMD_DO_SET_ROI=201, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ + MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ + MAV_CMD_DO_DIGICAM_CONTROL=203, /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ + MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ + MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch or lat in degrees, depending on mount mode.| roll or lon in degrees depending on mount mode| yaw or alt (in meters) depending on mount mode| reserved| reserved| reserved| MAV_MOUNT_MODE enum value| */ + MAV_CMD_DO_SET_CAM_TRIGG_DIST=206, /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_FENCE_ENABLE=207, /* Mission command to enable the geofence |enable? (0=disable, 1=enable, 2=disable_floor_only)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_PARACHUTE=208, /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_INVERTED_FLIGHT=210, /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_MOUNT_CONTROL_QUAT=220, /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */ + MAV_CMD_DO_GUIDED_MASTER=221, /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_DO_GUIDED_LIMITS=222, /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */ + MAV_CMD_DO_LAST=240, /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Accelerometer calibration: 0: no, 1: yes| Compass/Motor interference calibration: 0: no, 1: yes| Empty| */ + MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS=242, /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ + MAV_CMD_PREFLIGHT_UAVCAN=243, /* Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. |1: Trigger actuator ID assignment and direction mapping.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: start logging with rate of param 3 in Hz (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty| */ + MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| Reserved, send 0| Reserved, send 0| Reserved, send 0| Reserved, send 0| Reserved, send 0| */ + MAV_CMD_OVERRIDE_GOTO=252, /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */ + MAV_CMD_MISSION_START=300, /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */ + MAV_CMD_COMPONENT_ARM_DISARM=400, /* Arms / Disarms a component |1 to arm, 0 to disarm| */ + MAV_CMD_GET_HOME_POSITION=410, /* Request the home position from the vehicle. |Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + MAV_CMD_START_RX_PAIR=500, /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */ + MAV_CMD_GET_MESSAGE_INTERVAL=510, /* Request the interval between messages for a particular MAVLink message ID |The MAVLink message ID| */ + MAV_CMD_SET_MESSAGE_INTERVAL=511, /* Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM |The MAVLink message ID| The interval between two messages, in microseconds. Set to -1 to disable and 0 to request default rate.| */ + MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES=520, /* Request autopilot capabilities |1: Request autopilot version| Reserved (all remaining params)| */ + MAV_CMD_IMAGE_START_CAPTURE=2000, /* Start image capture sequence |Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ + MAV_CMD_IMAGE_STOP_CAPTURE=2001, /* Stop image capture sequence |Reserved| Reserved| */ + MAV_CMD_DO_TRIGGER_CONTROL=2003, /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start)| Shutter integration time (in ms)| Reserved| */ + MAV_CMD_VIDEO_START_CAPTURE=2500, /* Starts video capture |Camera ID (0 for all cameras), 1 for first, 2 for second, etc.| Frames per second| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ + MAV_CMD_VIDEO_STOP_CAPTURE=2501, /* Stop the current video capture |Reserved| Reserved| */ + MAV_CMD_PANORAMA_CREATE=2800, /* Create a panorama at the current position |Viewing angle horizontal of the panorama (in degrees, +- 0.5 the total angle)| Viewing angle vertical of panorama (in degrees)| Speed of the horizontal rotation (in degrees per second)| Speed of the vertical rotation (in degrees per second)| */ + MAV_CMD_DO_VTOL_TRANSITION=3000, /* Request VTOL transition |The target VTOL state, as defined by ENUM MAV_VTOL_STATE. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| */ + MAV_CMD_PAYLOAD_PREPARE_DEPLOY=30001, /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters AMSL| */ + MAV_CMD_PAYLOAD_CONTROL_DEPLOY=30002, /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + MAV_CMD_WAYPOINT_USER_1=31000, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_WAYPOINT_USER_2=31001, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_WAYPOINT_USER_3=31002, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_WAYPOINT_USER_4=31003, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_WAYPOINT_USER_5=31004, /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_SPATIAL_USER_1=31005, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_SPATIAL_USER_2=31006, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_SPATIAL_USER_3=31007, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_SPATIAL_USER_4=31008, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_SPATIAL_USER_5=31009, /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ + MAV_CMD_USER_1=31010, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + MAV_CMD_USER_2=31011, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + MAV_CMD_USER_3=31012, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + MAV_CMD_USER_4=31013, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + MAV_CMD_USER_5=31014, /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + MAV_CMD_ENUM_END=31015, /* | */ } MAV_CMD; #endif @@ -455,16 +455,16 @@ typedef enum MAV_CMD #define HAVE_ENUM_MAV_DATA_STREAM typedef enum MAV_DATA_STREAM { - MAV_DATA_STREAM_ALL=0, /* Enable all data streams | */ - MAV_DATA_STREAM_RAW_SENSORS=1, /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ - MAV_DATA_STREAM_EXTENDED_STATUS=2, /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ - MAV_DATA_STREAM_RC_CHANNELS=3, /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ - MAV_DATA_STREAM_RAW_CONTROLLER=4, /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ - MAV_DATA_STREAM_POSITION=6, /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ - MAV_DATA_STREAM_EXTRA1=10, /* Dependent on the autopilot | */ - MAV_DATA_STREAM_EXTRA2=11, /* Dependent on the autopilot | */ - MAV_DATA_STREAM_EXTRA3=12, /* Dependent on the autopilot | */ - MAV_DATA_STREAM_ENUM_END=13, /* | */ + MAV_DATA_STREAM_ALL=0, /* Enable all data streams | */ + MAV_DATA_STREAM_RAW_SENSORS=1, /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ + MAV_DATA_STREAM_EXTENDED_STATUS=2, /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ + MAV_DATA_STREAM_RC_CHANNELS=3, /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ + MAV_DATA_STREAM_RAW_CONTROLLER=4, /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ + MAV_DATA_STREAM_POSITION=6, /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ + MAV_DATA_STREAM_EXTRA1=10, /* Dependent on the autopilot | */ + MAV_DATA_STREAM_EXTRA2=11, /* Dependent on the autopilot | */ + MAV_DATA_STREAM_EXTRA3=12, /* Dependent on the autopilot | */ + MAV_DATA_STREAM_ENUM_END=13, /* | */ } MAV_DATA_STREAM; #endif @@ -475,12 +475,12 @@ typedef enum MAV_DATA_STREAM #define HAVE_ENUM_MAV_ROI typedef enum MAV_ROI { - MAV_ROI_NONE=0, /* No region of interest. | */ - MAV_ROI_WPNEXT=1, /* Point toward next MISSION. | */ - MAV_ROI_WPINDEX=2, /* Point toward given MISSION. | */ - MAV_ROI_LOCATION=3, /* Point toward fixed location. | */ - MAV_ROI_TARGET=4, /* Point toward of given id. | */ - MAV_ROI_ENUM_END=5, /* | */ + MAV_ROI_NONE=0, /* No region of interest. | */ + MAV_ROI_WPNEXT=1, /* Point toward next MISSION. | */ + MAV_ROI_WPINDEX=2, /* Point toward given MISSION. | */ + MAV_ROI_LOCATION=3, /* Point toward fixed location. | */ + MAV_ROI_TARGET=4, /* Point toward of given id. | */ + MAV_ROI_ENUM_END=5, /* | */ } MAV_ROI; #endif @@ -489,16 +489,16 @@ typedef enum MAV_ROI #define HAVE_ENUM_MAV_CMD_ACK typedef enum MAV_CMD_ACK { - MAV_CMD_ACK_OK=1, /* Command / mission item is ok. | */ - MAV_CMD_ACK_ERR_FAIL=2, /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */ - MAV_CMD_ACK_ERR_ACCESS_DENIED=3, /* The system is refusing to accept this command from this source / communication partner. | */ - MAV_CMD_ACK_ERR_NOT_SUPPORTED=4, /* Command or mission item is not supported, other commands would be accepted. | */ - MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED=5, /* The coordinate frame of this command / mission item is not supported. | */ - MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE=6, /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | */ - MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE=7, /* The X or latitude value is out of range. | */ - MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE=8, /* The Y or longitude value is out of range. | */ - MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE=9, /* The Z or altitude value is out of range. | */ - MAV_CMD_ACK_ENUM_END=10, /* | */ + MAV_CMD_ACK_OK=1, /* Command / mission item is ok. | */ + MAV_CMD_ACK_ERR_FAIL=2, /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */ + MAV_CMD_ACK_ERR_ACCESS_DENIED=3, /* The system is refusing to accept this command from this source / communication partner. | */ + MAV_CMD_ACK_ERR_NOT_SUPPORTED=4, /* Command or mission item is not supported, other commands would be accepted. | */ + MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED=5, /* The coordinate frame of this command / mission item is not supported. | */ + MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE=6, /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | */ + MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE=7, /* The X or latitude value is out of range. | */ + MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE=8, /* The Y or longitude value is out of range. | */ + MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE=9, /* The Z or altitude value is out of range. | */ + MAV_CMD_ACK_ENUM_END=10, /* | */ } MAV_CMD_ACK; #endif @@ -507,17 +507,17 @@ typedef enum MAV_CMD_ACK #define HAVE_ENUM_MAV_PARAM_TYPE typedef enum MAV_PARAM_TYPE { - MAV_PARAM_TYPE_UINT8=1, /* 8-bit unsigned integer | */ - MAV_PARAM_TYPE_INT8=2, /* 8-bit signed integer | */ - MAV_PARAM_TYPE_UINT16=3, /* 16-bit unsigned integer | */ - MAV_PARAM_TYPE_INT16=4, /* 16-bit signed integer | */ - MAV_PARAM_TYPE_UINT32=5, /* 32-bit unsigned integer | */ - MAV_PARAM_TYPE_INT32=6, /* 32-bit signed integer | */ - MAV_PARAM_TYPE_UINT64=7, /* 64-bit unsigned integer | */ - MAV_PARAM_TYPE_INT64=8, /* 64-bit signed integer | */ - MAV_PARAM_TYPE_REAL32=9, /* 32-bit floating-point | */ - MAV_PARAM_TYPE_REAL64=10, /* 64-bit floating-point | */ - MAV_PARAM_TYPE_ENUM_END=11, /* | */ + MAV_PARAM_TYPE_UINT8=1, /* 8-bit unsigned integer | */ + MAV_PARAM_TYPE_INT8=2, /* 8-bit signed integer | */ + MAV_PARAM_TYPE_UINT16=3, /* 16-bit unsigned integer | */ + MAV_PARAM_TYPE_INT16=4, /* 16-bit signed integer | */ + MAV_PARAM_TYPE_UINT32=5, /* 32-bit unsigned integer | */ + MAV_PARAM_TYPE_INT32=6, /* 32-bit signed integer | */ + MAV_PARAM_TYPE_UINT64=7, /* 64-bit unsigned integer | */ + MAV_PARAM_TYPE_INT64=8, /* 64-bit signed integer | */ + MAV_PARAM_TYPE_REAL32=9, /* 32-bit floating-point | */ + MAV_PARAM_TYPE_REAL64=10, /* 64-bit floating-point | */ + MAV_PARAM_TYPE_ENUM_END=11, /* | */ } MAV_PARAM_TYPE; #endif @@ -526,12 +526,12 @@ typedef enum MAV_PARAM_TYPE #define HAVE_ENUM_MAV_RESULT typedef enum MAV_RESULT { - MAV_RESULT_ACCEPTED=0, /* Command ACCEPTED and EXECUTED | */ - MAV_RESULT_TEMPORARILY_REJECTED=1, /* Command TEMPORARY REJECTED/DENIED | */ - MAV_RESULT_DENIED=2, /* Command PERMANENTLY DENIED | */ - MAV_RESULT_UNSUPPORTED=3, /* Command UNKNOWN/UNSUPPORTED | */ - MAV_RESULT_FAILED=4, /* Command executed, but failed | */ - MAV_RESULT_ENUM_END=5, /* | */ + MAV_RESULT_ACCEPTED=0, /* Command ACCEPTED and EXECUTED | */ + MAV_RESULT_TEMPORARILY_REJECTED=1, /* Command TEMPORARY REJECTED/DENIED | */ + MAV_RESULT_DENIED=2, /* Command PERMANENTLY DENIED | */ + MAV_RESULT_UNSUPPORTED=3, /* Command UNKNOWN/UNSUPPORTED | */ + MAV_RESULT_FAILED=4, /* Command executed, but failed | */ + MAV_RESULT_ENUM_END=5, /* | */ } MAV_RESULT; #endif @@ -540,22 +540,22 @@ typedef enum MAV_RESULT #define HAVE_ENUM_MAV_MISSION_RESULT typedef enum MAV_MISSION_RESULT { - MAV_MISSION_ACCEPTED=0, /* mission accepted OK | */ - MAV_MISSION_ERROR=1, /* generic error / not accepting mission commands at all right now | */ - MAV_MISSION_UNSUPPORTED_FRAME=2, /* coordinate frame is not supported | */ - MAV_MISSION_UNSUPPORTED=3, /* command is not supported | */ - MAV_MISSION_NO_SPACE=4, /* mission item exceeds storage space | */ - MAV_MISSION_INVALID=5, /* one of the parameters has an invalid value | */ - MAV_MISSION_INVALID_PARAM1=6, /* param1 has an invalid value | */ - MAV_MISSION_INVALID_PARAM2=7, /* param2 has an invalid value | */ - MAV_MISSION_INVALID_PARAM3=8, /* param3 has an invalid value | */ - MAV_MISSION_INVALID_PARAM4=9, /* param4 has an invalid value | */ - MAV_MISSION_INVALID_PARAM5_X=10, /* x/param5 has an invalid value | */ - MAV_MISSION_INVALID_PARAM6_Y=11, /* y/param6 has an invalid value | */ - MAV_MISSION_INVALID_PARAM7=12, /* param7 has an invalid value | */ - MAV_MISSION_INVALID_SEQUENCE=13, /* received waypoint out of sequence | */ - MAV_MISSION_DENIED=14, /* not accepting any mission commands from this communication partner | */ - MAV_MISSION_RESULT_ENUM_END=15, /* | */ + MAV_MISSION_ACCEPTED=0, /* mission accepted OK | */ + MAV_MISSION_ERROR=1, /* generic error / not accepting mission commands at all right now | */ + MAV_MISSION_UNSUPPORTED_FRAME=2, /* coordinate frame is not supported | */ + MAV_MISSION_UNSUPPORTED=3, /* command is not supported | */ + MAV_MISSION_NO_SPACE=4, /* mission item exceeds storage space | */ + MAV_MISSION_INVALID=5, /* one of the parameters has an invalid value | */ + MAV_MISSION_INVALID_PARAM1=6, /* param1 has an invalid value | */ + MAV_MISSION_INVALID_PARAM2=7, /* param2 has an invalid value | */ + MAV_MISSION_INVALID_PARAM3=8, /* param3 has an invalid value | */ + MAV_MISSION_INVALID_PARAM4=9, /* param4 has an invalid value | */ + MAV_MISSION_INVALID_PARAM5_X=10, /* x/param5 has an invalid value | */ + MAV_MISSION_INVALID_PARAM6_Y=11, /* y/param6 has an invalid value | */ + MAV_MISSION_INVALID_PARAM7=12, /* param7 has an invalid value | */ + MAV_MISSION_INVALID_SEQUENCE=13, /* received waypoint out of sequence | */ + MAV_MISSION_DENIED=14, /* not accepting any mission commands from this communication partner | */ + MAV_MISSION_RESULT_ENUM_END=15, /* | */ } MAV_MISSION_RESULT; #endif @@ -564,15 +564,15 @@ typedef enum MAV_MISSION_RESULT #define HAVE_ENUM_MAV_SEVERITY typedef enum MAV_SEVERITY { - MAV_SEVERITY_EMERGENCY=0, /* System is unusable. This is a "panic" condition. | */ - MAV_SEVERITY_ALERT=1, /* Action should be taken immediately. Indicates error in non-critical systems. | */ - MAV_SEVERITY_CRITICAL=2, /* Action must be taken immediately. Indicates failure in a primary system. | */ - MAV_SEVERITY_ERROR=3, /* Indicates an error in secondary/redundant systems. | */ - MAV_SEVERITY_WARNING=4, /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */ - MAV_SEVERITY_NOTICE=5, /* An unusual event has occured, though not an error condition. This should be investigated for the root cause. | */ - MAV_SEVERITY_INFO=6, /* Normal operational messages. Useful for logging. No action is required for these messages. | */ - MAV_SEVERITY_DEBUG=7, /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */ - MAV_SEVERITY_ENUM_END=8, /* | */ + MAV_SEVERITY_EMERGENCY=0, /* System is unusable. This is a "panic" condition. | */ + MAV_SEVERITY_ALERT=1, /* Action should be taken immediately. Indicates error in non-critical systems. | */ + MAV_SEVERITY_CRITICAL=2, /* Action must be taken immediately. Indicates failure in a primary system. | */ + MAV_SEVERITY_ERROR=3, /* Indicates an error in secondary/redundant systems. | */ + MAV_SEVERITY_WARNING=4, /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */ + MAV_SEVERITY_NOTICE=5, /* An unusual event has occured, though not an error condition. This should be investigated for the root cause. | */ + MAV_SEVERITY_INFO=6, /* Normal operational messages. Useful for logging. No action is required for these messages. | */ + MAV_SEVERITY_DEBUG=7, /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */ + MAV_SEVERITY_ENUM_END=8, /* | */ } MAV_SEVERITY; #endif @@ -581,13 +581,13 @@ typedef enum MAV_SEVERITY #define HAVE_ENUM_MAV_POWER_STATUS typedef enum MAV_POWER_STATUS { - MAV_POWER_STATUS_BRICK_VALID=1, /* main brick power supply valid | */ - MAV_POWER_STATUS_SERVO_VALID=2, /* main servo power supply valid for FMU | */ - MAV_POWER_STATUS_USB_CONNECTED=4, /* USB power is connected | */ - MAV_POWER_STATUS_PERIPH_OVERCURRENT=8, /* peripheral supply is in over-current state | */ - MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT=16, /* hi-power peripheral supply is in over-current state | */ - MAV_POWER_STATUS_CHANGED=32, /* Power status has changed since boot | */ - MAV_POWER_STATUS_ENUM_END=33, /* | */ + MAV_POWER_STATUS_BRICK_VALID=1, /* main brick power supply valid | */ + MAV_POWER_STATUS_SERVO_VALID=2, /* main servo power supply valid for FMU | */ + MAV_POWER_STATUS_USB_CONNECTED=4, /* USB power is connected | */ + MAV_POWER_STATUS_PERIPH_OVERCURRENT=8, /* peripheral supply is in over-current state | */ + MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT=16, /* hi-power peripheral supply is in over-current state | */ + MAV_POWER_STATUS_CHANGED=32, /* Power status has changed since boot | */ + MAV_POWER_STATUS_ENUM_END=33, /* | */ } MAV_POWER_STATUS; #endif @@ -596,12 +596,12 @@ typedef enum MAV_POWER_STATUS #define HAVE_ENUM_SERIAL_CONTROL_DEV typedef enum SERIAL_CONTROL_DEV { - SERIAL_CONTROL_DEV_TELEM1=0, /* First telemetry port | */ - SERIAL_CONTROL_DEV_TELEM2=1, /* Second telemetry port | */ - SERIAL_CONTROL_DEV_GPS1=2, /* First GPS port | */ - SERIAL_CONTROL_DEV_GPS2=3, /* Second GPS port | */ - SERIAL_CONTROL_DEV_SHELL=10, /* system shell | */ - SERIAL_CONTROL_DEV_ENUM_END=11, /* | */ + SERIAL_CONTROL_DEV_TELEM1=0, /* First telemetry port | */ + SERIAL_CONTROL_DEV_TELEM2=1, /* Second telemetry port | */ + SERIAL_CONTROL_DEV_GPS1=2, /* First GPS port | */ + SERIAL_CONTROL_DEV_GPS2=3, /* Second GPS port | */ + SERIAL_CONTROL_DEV_SHELL=10, /* system shell | */ + SERIAL_CONTROL_DEV_ENUM_END=11, /* | */ } SERIAL_CONTROL_DEV; #endif @@ -610,12 +610,12 @@ typedef enum SERIAL_CONTROL_DEV #define HAVE_ENUM_SERIAL_CONTROL_FLAG typedef enum SERIAL_CONTROL_FLAG { - SERIAL_CONTROL_FLAG_REPLY=1, /* Set if this is a reply | */ - SERIAL_CONTROL_FLAG_RESPOND=2, /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */ - SERIAL_CONTROL_FLAG_EXCLUSIVE=4, /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */ - SERIAL_CONTROL_FLAG_BLOCKING=8, /* Block on writes to the serial port | */ - SERIAL_CONTROL_FLAG_MULTI=16, /* Send multiple replies until port is drained | */ - SERIAL_CONTROL_FLAG_ENUM_END=17, /* | */ + SERIAL_CONTROL_FLAG_REPLY=1, /* Set if this is a reply | */ + SERIAL_CONTROL_FLAG_RESPOND=2, /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */ + SERIAL_CONTROL_FLAG_EXCLUSIVE=4, /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */ + SERIAL_CONTROL_FLAG_BLOCKING=8, /* Block on writes to the serial port | */ + SERIAL_CONTROL_FLAG_MULTI=16, /* Send multiple replies until port is drained | */ + SERIAL_CONTROL_FLAG_ENUM_END=17, /* | */ } SERIAL_CONTROL_FLAG; #endif @@ -624,10 +624,10 @@ typedef enum SERIAL_CONTROL_FLAG #define HAVE_ENUM_MAV_DISTANCE_SENSOR typedef enum MAV_DISTANCE_SENSOR { - MAV_DISTANCE_SENSOR_LASER=0, /* Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units | */ - MAV_DISTANCE_SENSOR_ULTRASOUND=1, /* Ultrasound rangefinder, e.g. MaxBotix units | */ - MAV_DISTANCE_SENSOR_INFRARED=2, /* Infrared rangefinder, e.g. Sharp units | */ - MAV_DISTANCE_SENSOR_ENUM_END=3, /* | */ + MAV_DISTANCE_SENSOR_LASER=0, /* Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units | */ + MAV_DISTANCE_SENSOR_ULTRASOUND=1, /* Ultrasound rangefinder, e.g. MaxBotix units | */ + MAV_DISTANCE_SENSOR_INFRARED=2, /* Infrared rangefinder, e.g. Sharp units | */ + MAV_DISTANCE_SENSOR_ENUM_END=3, /* | */ } MAV_DISTANCE_SENSOR; #endif @@ -636,46 +636,46 @@ typedef enum MAV_DISTANCE_SENSOR #define HAVE_ENUM_MAV_SENSOR_ORIENTATION typedef enum MAV_SENSOR_ORIENTATION { - MAV_SENSOR_ROTATION_NONE=0, /* Roll: 0, Pitch: 0, Yaw: 0 | */ - MAV_SENSOR_ROTATION_YAW_45=1, /* Roll: 0, Pitch: 0, Yaw: 45 | */ - MAV_SENSOR_ROTATION_YAW_90=2, /* Roll: 0, Pitch: 0, Yaw: 90 | */ - MAV_SENSOR_ROTATION_YAW_135=3, /* Roll: 0, Pitch: 0, Yaw: 135 | */ - MAV_SENSOR_ROTATION_YAW_180=4, /* Roll: 0, Pitch: 0, Yaw: 180 | */ - MAV_SENSOR_ROTATION_YAW_225=5, /* Roll: 0, Pitch: 0, Yaw: 225 | */ - MAV_SENSOR_ROTATION_YAW_270=6, /* Roll: 0, Pitch: 0, Yaw: 270 | */ - MAV_SENSOR_ROTATION_YAW_315=7, /* Roll: 0, Pitch: 0, Yaw: 315 | */ - MAV_SENSOR_ROTATION_ROLL_180=8, /* Roll: 180, Pitch: 0, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_180_YAW_45=9, /* Roll: 180, Pitch: 0, Yaw: 45 | */ - MAV_SENSOR_ROTATION_ROLL_180_YAW_90=10, /* Roll: 180, Pitch: 0, Yaw: 90 | */ - MAV_SENSOR_ROTATION_ROLL_180_YAW_135=11, /* Roll: 180, Pitch: 0, Yaw: 135 | */ - MAV_SENSOR_ROTATION_PITCH_180=12, /* Roll: 0, Pitch: 180, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_180_YAW_225=13, /* Roll: 180, Pitch: 0, Yaw: 225 | */ - MAV_SENSOR_ROTATION_ROLL_180_YAW_270=14, /* Roll: 180, Pitch: 0, Yaw: 270 | */ - MAV_SENSOR_ROTATION_ROLL_180_YAW_315=15, /* Roll: 180, Pitch: 0, Yaw: 315 | */ - MAV_SENSOR_ROTATION_ROLL_90=16, /* Roll: 90, Pitch: 0, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_90_YAW_45=17, /* Roll: 90, Pitch: 0, Yaw: 45 | */ - MAV_SENSOR_ROTATION_ROLL_90_YAW_90=18, /* Roll: 90, Pitch: 0, Yaw: 90 | */ - MAV_SENSOR_ROTATION_ROLL_90_YAW_135=19, /* Roll: 90, Pitch: 0, Yaw: 135 | */ - MAV_SENSOR_ROTATION_ROLL_270=20, /* Roll: 270, Pitch: 0, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_270_YAW_45=21, /* Roll: 270, Pitch: 0, Yaw: 45 | */ - MAV_SENSOR_ROTATION_ROLL_270_YAW_90=22, /* Roll: 270, Pitch: 0, Yaw: 90 | */ - MAV_SENSOR_ROTATION_ROLL_270_YAW_135=23, /* Roll: 270, Pitch: 0, Yaw: 135 | */ - MAV_SENSOR_ROTATION_PITCH_90=24, /* Roll: 0, Pitch: 90, Yaw: 0 | */ - MAV_SENSOR_ROTATION_PITCH_270=25, /* Roll: 0, Pitch: 270, Yaw: 0 | */ - MAV_SENSOR_ROTATION_PITCH_180_YAW_90=26, /* Roll: 0, Pitch: 180, Yaw: 90 | */ - MAV_SENSOR_ROTATION_PITCH_180_YAW_270=27, /* Roll: 0, Pitch: 180, Yaw: 270 | */ - MAV_SENSOR_ROTATION_ROLL_90_PITCH_90=28, /* Roll: 90, Pitch: 90, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_180_PITCH_90=29, /* Roll: 180, Pitch: 90, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_270_PITCH_90=30, /* Roll: 270, Pitch: 90, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_90_PITCH_180=31, /* Roll: 90, Pitch: 180, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_270_PITCH_180=32, /* Roll: 270, Pitch: 180, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_90_PITCH_270=33, /* Roll: 90, Pitch: 270, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_180_PITCH_270=34, /* Roll: 180, Pitch: 270, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_270_PITCH_270=35, /* Roll: 270, Pitch: 270, Yaw: 0 | */ - MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90=36, /* Roll: 90, Pitch: 180, Yaw: 90 | */ - MAV_SENSOR_ROTATION_ROLL_90_YAW_270=37, /* Roll: 90, Pitch: 0, Yaw: 270 | */ - MAV_SENSOR_ROTATION_ROLL_315_PITCH_315_YAW_315=38, /* Roll: 315, Pitch: 315, Yaw: 315 | */ - MAV_SENSOR_ORIENTATION_ENUM_END=39, /* | */ + MAV_SENSOR_ROTATION_NONE=0, /* Roll: 0, Pitch: 0, Yaw: 0 | */ + MAV_SENSOR_ROTATION_YAW_45=1, /* Roll: 0, Pitch: 0, Yaw: 45 | */ + MAV_SENSOR_ROTATION_YAW_90=2, /* Roll: 0, Pitch: 0, Yaw: 90 | */ + MAV_SENSOR_ROTATION_YAW_135=3, /* Roll: 0, Pitch: 0, Yaw: 135 | */ + MAV_SENSOR_ROTATION_YAW_180=4, /* Roll: 0, Pitch: 0, Yaw: 180 | */ + MAV_SENSOR_ROTATION_YAW_225=5, /* Roll: 0, Pitch: 0, Yaw: 225 | */ + MAV_SENSOR_ROTATION_YAW_270=6, /* Roll: 0, Pitch: 0, Yaw: 270 | */ + MAV_SENSOR_ROTATION_YAW_315=7, /* Roll: 0, Pitch: 0, Yaw: 315 | */ + MAV_SENSOR_ROTATION_ROLL_180=8, /* Roll: 180, Pitch: 0, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_180_YAW_45=9, /* Roll: 180, Pitch: 0, Yaw: 45 | */ + MAV_SENSOR_ROTATION_ROLL_180_YAW_90=10, /* Roll: 180, Pitch: 0, Yaw: 90 | */ + MAV_SENSOR_ROTATION_ROLL_180_YAW_135=11, /* Roll: 180, Pitch: 0, Yaw: 135 | */ + MAV_SENSOR_ROTATION_PITCH_180=12, /* Roll: 0, Pitch: 180, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_180_YAW_225=13, /* Roll: 180, Pitch: 0, Yaw: 225 | */ + MAV_SENSOR_ROTATION_ROLL_180_YAW_270=14, /* Roll: 180, Pitch: 0, Yaw: 270 | */ + MAV_SENSOR_ROTATION_ROLL_180_YAW_315=15, /* Roll: 180, Pitch: 0, Yaw: 315 | */ + MAV_SENSOR_ROTATION_ROLL_90=16, /* Roll: 90, Pitch: 0, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_90_YAW_45=17, /* Roll: 90, Pitch: 0, Yaw: 45 | */ + MAV_SENSOR_ROTATION_ROLL_90_YAW_90=18, /* Roll: 90, Pitch: 0, Yaw: 90 | */ + MAV_SENSOR_ROTATION_ROLL_90_YAW_135=19, /* Roll: 90, Pitch: 0, Yaw: 135 | */ + MAV_SENSOR_ROTATION_ROLL_270=20, /* Roll: 270, Pitch: 0, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_270_YAW_45=21, /* Roll: 270, Pitch: 0, Yaw: 45 | */ + MAV_SENSOR_ROTATION_ROLL_270_YAW_90=22, /* Roll: 270, Pitch: 0, Yaw: 90 | */ + MAV_SENSOR_ROTATION_ROLL_270_YAW_135=23, /* Roll: 270, Pitch: 0, Yaw: 135 | */ + MAV_SENSOR_ROTATION_PITCH_90=24, /* Roll: 0, Pitch: 90, Yaw: 0 | */ + MAV_SENSOR_ROTATION_PITCH_270=25, /* Roll: 0, Pitch: 270, Yaw: 0 | */ + MAV_SENSOR_ROTATION_PITCH_180_YAW_90=26, /* Roll: 0, Pitch: 180, Yaw: 90 | */ + MAV_SENSOR_ROTATION_PITCH_180_YAW_270=27, /* Roll: 0, Pitch: 180, Yaw: 270 | */ + MAV_SENSOR_ROTATION_ROLL_90_PITCH_90=28, /* Roll: 90, Pitch: 90, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_180_PITCH_90=29, /* Roll: 180, Pitch: 90, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_270_PITCH_90=30, /* Roll: 270, Pitch: 90, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_90_PITCH_180=31, /* Roll: 90, Pitch: 180, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_270_PITCH_180=32, /* Roll: 270, Pitch: 180, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_90_PITCH_270=33, /* Roll: 90, Pitch: 270, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_180_PITCH_270=34, /* Roll: 180, Pitch: 270, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_270_PITCH_270=35, /* Roll: 270, Pitch: 270, Yaw: 0 | */ + MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90=36, /* Roll: 90, Pitch: 180, Yaw: 90 | */ + MAV_SENSOR_ROTATION_ROLL_90_YAW_270=37, /* Roll: 90, Pitch: 0, Yaw: 270 | */ + MAV_SENSOR_ROTATION_ROLL_315_PITCH_315_YAW_315=38, /* Roll: 315, Pitch: 315, Yaw: 315 | */ + MAV_SENSOR_ORIENTATION_ENUM_END=39, /* | */ } MAV_SENSOR_ORIENTATION; #endif @@ -684,20 +684,20 @@ typedef enum MAV_SENSOR_ORIENTATION #define HAVE_ENUM_MAV_PROTOCOL_CAPABILITY typedef enum MAV_PROTOCOL_CAPABILITY { - MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT=1, /* Autopilot supports MISSION float message type. | */ - MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT=2, /* Autopilot supports the new param float message type. | */ - MAV_PROTOCOL_CAPABILITY_MISSION_INT=4, /* Autopilot supports MISSION_INT scaled integer message type. | */ - MAV_PROTOCOL_CAPABILITY_COMMAND_INT=8, /* Autopilot supports COMMAND_INT scaled integer message type. | */ - MAV_PROTOCOL_CAPABILITY_PARAM_UNION=16, /* Autopilot supports the new param union message type. | */ - MAV_PROTOCOL_CAPABILITY_FTP=32, /* Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. | */ - MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET=64, /* Autopilot supports commanding attitude offboard. | */ - MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED=128, /* Autopilot supports commanding position and velocity targets in local NED frame. | */ - MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT=256, /* Autopilot supports commanding position and velocity targets in global scaled integers. | */ - MAV_PROTOCOL_CAPABILITY_TERRAIN=512, /* Autopilot supports terrain protocol / data handling. | */ - MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET=1024, /* Autopilot supports direct actuator control. | */ - MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION=2048, /* Autopilot supports the flight termination command. | */ - MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION=4096, /* Autopilot supports onboard compass calibration. | */ - MAV_PROTOCOL_CAPABILITY_ENUM_END=4097, /* | */ + MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT=1, /* Autopilot supports MISSION float message type. | */ + MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT=2, /* Autopilot supports the new param float message type. | */ + MAV_PROTOCOL_CAPABILITY_MISSION_INT=4, /* Autopilot supports MISSION_INT scaled integer message type. | */ + MAV_PROTOCOL_CAPABILITY_COMMAND_INT=8, /* Autopilot supports COMMAND_INT scaled integer message type. | */ + MAV_PROTOCOL_CAPABILITY_PARAM_UNION=16, /* Autopilot supports the new param union message type. | */ + MAV_PROTOCOL_CAPABILITY_FTP=32, /* Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. | */ + MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET=64, /* Autopilot supports commanding attitude offboard. | */ + MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED=128, /* Autopilot supports commanding position and velocity targets in local NED frame. | */ + MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT=256, /* Autopilot supports commanding position and velocity targets in global scaled integers. | */ + MAV_PROTOCOL_CAPABILITY_TERRAIN=512, /* Autopilot supports terrain protocol / data handling. | */ + MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET=1024, /* Autopilot supports direct actuator control. | */ + MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION=2048, /* Autopilot supports the flight termination command. | */ + MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION=4096, /* Autopilot supports onboard compass calibration. | */ + MAV_PROTOCOL_CAPABILITY_ENUM_END=4097, /* | */ } MAV_PROTOCOL_CAPABILITY; #endif @@ -706,12 +706,12 @@ typedef enum MAV_PROTOCOL_CAPABILITY #define HAVE_ENUM_MAV_ESTIMATOR_TYPE typedef enum MAV_ESTIMATOR_TYPE { - MAV_ESTIMATOR_TYPE_NAIVE=1, /* This is a naive estimator without any real covariance feedback. | */ - MAV_ESTIMATOR_TYPE_VISION=2, /* Computer vision based estimate. Might be up to scale. | */ - MAV_ESTIMATOR_TYPE_VIO=3, /* Visual-inertial estimate. | */ - MAV_ESTIMATOR_TYPE_GPS=4, /* Plain GPS estimate. | */ - MAV_ESTIMATOR_TYPE_GPS_INS=5, /* Estimator integrating GPS and inertial sensing. | */ - MAV_ESTIMATOR_TYPE_ENUM_END=6, /* | */ + MAV_ESTIMATOR_TYPE_NAIVE=1, /* This is a naive estimator without any real covariance feedback. | */ + MAV_ESTIMATOR_TYPE_VISION=2, /* Computer vision based estimate. Might be up to scale. | */ + MAV_ESTIMATOR_TYPE_VIO=3, /* Visual-inertial estimate. | */ + MAV_ESTIMATOR_TYPE_GPS=4, /* Plain GPS estimate. | */ + MAV_ESTIMATOR_TYPE_GPS_INS=5, /* Estimator integrating GPS and inertial sensing. | */ + MAV_ESTIMATOR_TYPE_ENUM_END=6, /* | */ } MAV_ESTIMATOR_TYPE; #endif @@ -720,12 +720,12 @@ typedef enum MAV_ESTIMATOR_TYPE #define HAVE_ENUM_MAV_BATTERY_TYPE typedef enum MAV_BATTERY_TYPE { - MAV_BATTERY_TYPE_UNKNOWN=0, /* Not specified. | */ - MAV_BATTERY_TYPE_LIPO=1, /* Lithium polymer battery | */ - MAV_BATTERY_TYPE_LIFE=2, /* Lithium-iron-phosphate battery | */ - MAV_BATTERY_TYPE_LION=3, /* Lithium-ION battery | */ - MAV_BATTERY_TYPE_NIMH=4, /* Nickel metal hydride battery | */ - MAV_BATTERY_TYPE_ENUM_END=5, /* | */ + MAV_BATTERY_TYPE_UNKNOWN=0, /* Not specified. | */ + MAV_BATTERY_TYPE_LIPO=1, /* Lithium polymer battery | */ + MAV_BATTERY_TYPE_LIFE=2, /* Lithium-iron-phosphate battery | */ + MAV_BATTERY_TYPE_LION=3, /* Lithium-ION battery | */ + MAV_BATTERY_TYPE_NIMH=4, /* Nickel metal hydride battery | */ + MAV_BATTERY_TYPE_ENUM_END=5, /* | */ } MAV_BATTERY_TYPE; #endif @@ -734,12 +734,12 @@ typedef enum MAV_BATTERY_TYPE #define HAVE_ENUM_MAV_BATTERY_FUNCTION typedef enum MAV_BATTERY_FUNCTION { - MAV_BATTERY_FUNCTION_UNKNOWN=0, /* Battery function is unknown | */ - MAV_BATTERY_FUNCTION_ALL=1, /* Battery supports all flight systems | */ - MAV_BATTERY_FUNCTION_PROPULSION=2, /* Battery for the propulsion system | */ - MAV_BATTERY_FUNCTION_AVIONICS=3, /* Avionics battery | */ - MAV_BATTERY_TYPE_PAYLOAD=4, /* Payload battery | */ - MAV_BATTERY_FUNCTION_ENUM_END=5, /* | */ + MAV_BATTERY_FUNCTION_UNKNOWN=0, /* Battery function is unknown | */ + MAV_BATTERY_FUNCTION_ALL=1, /* Battery supports all flight systems | */ + MAV_BATTERY_FUNCTION_PROPULSION=2, /* Battery for the propulsion system | */ + MAV_BATTERY_FUNCTION_AVIONICS=3, /* Avionics battery | */ + MAV_BATTERY_TYPE_PAYLOAD=4, /* Payload battery | */ + MAV_BATTERY_FUNCTION_ENUM_END=5, /* | */ } MAV_BATTERY_FUNCTION; #endif @@ -748,12 +748,12 @@ typedef enum MAV_BATTERY_FUNCTION #define HAVE_ENUM_MAV_VTOL_STATE typedef enum MAV_VTOL_STATE { - MAV_VTOL_STATE_UNDEFINED=0, /* MAV is not configured as VTOL | */ - MAV_VTOL_STATE_TRANSITION_TO_FW=1, /* VTOL is in transition from multicopter to fixed-wing | */ - MAV_VTOL_STATE_TRANSITION_TO_MC=2, /* VTOL is in transition from fixed-wing to multicopter | */ - MAV_VTOL_STATE_MC=3, /* VTOL is in multicopter state | */ - MAV_VTOL_STATE_FW=4, /* VTOL is in fixed-wing state | */ - MAV_VTOL_STATE_ENUM_END=5, /* | */ + MAV_VTOL_STATE_UNDEFINED=0, /* MAV is not configured as VTOL | */ + MAV_VTOL_STATE_TRANSITION_TO_FW=1, /* VTOL is in transition from multicopter to fixed-wing | */ + MAV_VTOL_STATE_TRANSITION_TO_MC=2, /* VTOL is in transition from fixed-wing to multicopter | */ + MAV_VTOL_STATE_MC=3, /* VTOL is in multicopter state | */ + MAV_VTOL_STATE_FW=4, /* VTOL is in fixed-wing state | */ + MAV_VTOL_STATE_ENUM_END=5, /* | */ } MAV_VTOL_STATE; #endif @@ -762,10 +762,10 @@ typedef enum MAV_VTOL_STATE #define HAVE_ENUM_MAV_LANDED_STATE typedef enum MAV_LANDED_STATE { - MAV_LANDED_STATE_UNDEFINED=0, /* MAV landed state is unknown | */ - MAV_LANDED_STATE_ON_GROUND=1, /* MAV is landed (on ground) | */ - MAV_LANDED_STATE_IN_AIR=2, /* MAV is in air | */ - MAV_LANDED_STATE_ENUM_END=3, /* | */ + MAV_LANDED_STATE_UNDEFINED=0, /* MAV landed state is unknown | */ + MAV_LANDED_STATE_ON_GROUND=1, /* MAV is landed (on ground) | */ + MAV_LANDED_STATE_IN_AIR=2, /* MAV is in air | */ + MAV_LANDED_STATE_ENUM_END=3, /* | */ } MAV_LANDED_STATE; #endif @@ -774,9 +774,9 @@ typedef enum MAV_LANDED_STATE #define HAVE_ENUM_ADSB_ALTITUDE_TYPE typedef enum ADSB_ALTITUDE_TYPE { - ADSB_ALTITUDE_TYPE_PRESSURE_QNH=0, /* Altitude reported from a Baro source using QNH reference | */ - ADSB_ALTITUDE_TYPE_GEOMETRIC=1, /* Altitude reported from a GNSS source | */ - ADSB_ALTITUDE_TYPE_ENUM_END=2, /* | */ + ADSB_ALTITUDE_TYPE_PRESSURE_QNH=0, /* Altitude reported from a Baro source using QNH reference | */ + ADSB_ALTITUDE_TYPE_GEOMETRIC=1, /* Altitude reported from a GNSS source | */ + ADSB_ALTITUDE_TYPE_ENUM_END=2, /* | */ } ADSB_ALTITUDE_TYPE; #endif @@ -785,27 +785,27 @@ typedef enum ADSB_ALTITUDE_TYPE #define HAVE_ENUM_ADSB_EMITTER_TYPE typedef enum ADSB_EMITTER_TYPE { - ADSB_EMITTER_TYPE_NO_INFO=0, /* | */ - ADSB_EMITTER_TYPE_LIGHT=1, /* | */ - ADSB_EMITTER_TYPE_SMALL=2, /* | */ - ADSB_EMITTER_TYPE_LARGE=3, /* | */ - ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE=4, /* | */ - ADSB_EMITTER_TYPE_HEAVY=5, /* | */ - ADSB_EMITTER_TYPE_HIGHLY_MANUV=6, /* | */ - ADSB_EMITTER_TYPE_ROTOCRAFT=7, /* | */ - ADSB_EMITTER_TYPE_UNASSIGNED=8, /* | */ - ADSB_EMITTER_TYPE_GLIDER=9, /* | */ - ADSB_EMITTER_TYPE_LIGHTER_AIR=10, /* | */ - ADSB_EMITTER_TYPE_PARACHUTE=11, /* | */ - ADSB_EMITTER_TYPE_ULTRA_LIGHT=12, /* | */ - ADSB_EMITTER_TYPE_UNASSIGNED2=13, /* | */ - ADSB_EMITTER_TYPE_UAV=14, /* | */ - ADSB_EMITTER_TYPE_SPACE=15, /* | */ - ADSB_EMITTER_TYPE_UNASSGINED3=16, /* | */ - ADSB_EMITTER_TYPE_EMERGENCY_SURFACE=17, /* | */ - ADSB_EMITTER_TYPE_SERVICE_SURFACE=18, /* | */ - ADSB_EMITTER_TYPE_POINT_OBSTACLE=19, /* | */ - ADSB_EMITTER_TYPE_ENUM_END=20, /* | */ + ADSB_EMITTER_TYPE_NO_INFO=0, /* | */ + ADSB_EMITTER_TYPE_LIGHT=1, /* | */ + ADSB_EMITTER_TYPE_SMALL=2, /* | */ + ADSB_EMITTER_TYPE_LARGE=3, /* | */ + ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE=4, /* | */ + ADSB_EMITTER_TYPE_HEAVY=5, /* | */ + ADSB_EMITTER_TYPE_HIGHLY_MANUV=6, /* | */ + ADSB_EMITTER_TYPE_ROTOCRAFT=7, /* | */ + ADSB_EMITTER_TYPE_UNASSIGNED=8, /* | */ + ADSB_EMITTER_TYPE_GLIDER=9, /* | */ + ADSB_EMITTER_TYPE_LIGHTER_AIR=10, /* | */ + ADSB_EMITTER_TYPE_PARACHUTE=11, /* | */ + ADSB_EMITTER_TYPE_ULTRA_LIGHT=12, /* | */ + ADSB_EMITTER_TYPE_UNASSIGNED2=13, /* | */ + ADSB_EMITTER_TYPE_UAV=14, /* | */ + ADSB_EMITTER_TYPE_SPACE=15, /* | */ + ADSB_EMITTER_TYPE_UNASSGINED3=16, /* | */ + ADSB_EMITTER_TYPE_EMERGENCY_SURFACE=17, /* | */ + ADSB_EMITTER_TYPE_SERVICE_SURFACE=18, /* | */ + ADSB_EMITTER_TYPE_POINT_OBSTACLE=19, /* | */ + ADSB_EMITTER_TYPE_ENUM_END=20, /* | */ } ADSB_EMITTER_TYPE; #endif @@ -814,14 +814,14 @@ typedef enum ADSB_EMITTER_TYPE #define HAVE_ENUM_ADSB_FLAGS typedef enum ADSB_FLAGS { - ADSB_FLAGS_VALID_COORDS=1, /* | */ - ADSB_FLAGS_VALID_ALTITUDE=2, /* | */ - ADSB_FLAGS_VALID_HEADING=4, /* | */ - ADSB_FLAGS_VALID_VELOCITY=8, /* | */ - ADSB_FLAGS_VALID_CALLSIGN=16, /* | */ - ADSB_FLAGS_VALID_SQUAWK=32, /* | */ - ADSB_FLAGS_SIMULATED=64, /* | */ - ADSB_FLAGS_ENUM_END=65, /* | */ + ADSB_FLAGS_VALID_COORDS=1, /* | */ + ADSB_FLAGS_VALID_ALTITUDE=2, /* | */ + ADSB_FLAGS_VALID_HEADING=4, /* | */ + ADSB_FLAGS_VALID_VELOCITY=8, /* | */ + ADSB_FLAGS_VALID_CALLSIGN=16, /* | */ + ADSB_FLAGS_VALID_SQUAWK=32, /* | */ + ADSB_FLAGS_SIMULATED=64, /* | */ + ADSB_FLAGS_ENUM_END=65, /* | */ } ADSB_FLAGS; #endif @@ -830,8 +830,8 @@ typedef enum ADSB_FLAGS #define HAVE_ENUM_MAV_DO_REPOSITION_FLAGS typedef enum MAV_DO_REPOSITION_FLAGS { - MAV_DO_REPOSITION_FLAGS_CHANGE_MODE=1, /* The aircraft should immediately transition into guided. This should not be set for follow me applications | */ - MAV_DO_REPOSITION_FLAGS_ENUM_END=2, /* | */ + MAV_DO_REPOSITION_FLAGS_CHANGE_MODE=1, /* The aircraft should immediately transition into guided. This should not be set for follow me applications | */ + MAV_DO_REPOSITION_FLAGS_ENUM_END=2, /* | */ } MAV_DO_REPOSITION_FLAGS; #endif @@ -840,23 +840,21 @@ typedef enum MAV_DO_REPOSITION_FLAGS #define HAVE_ENUM_ESTIMATOR_STATUS_FLAGS typedef enum ESTIMATOR_STATUS_FLAGS { - ESTIMATOR_ATTITUDE=1, /* True if the attitude estimate is good | */ - ESTIMATOR_VELOCITY_HORIZ=2, /* True if the horizontal velocity estimate is good | */ - ESTIMATOR_VELOCITY_VERT=4, /* True if the vertical velocity estimate is good | */ - ESTIMATOR_POS_HORIZ_REL=8, /* True if the horizontal position (relative) estimate is good | */ - ESTIMATOR_POS_HORIZ_ABS=16, /* True if the horizontal position (absolute) estimate is good | */ - ESTIMATOR_POS_VERT_ABS=32, /* True if the vertical position (absolute) estimate is good | */ - ESTIMATOR_POS_VERT_AGL=64, /* True if the vertical position (above ground) estimate is good | */ - ESTIMATOR_CONST_POS_MODE=128, /* True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow) | */ - ESTIMATOR_PRED_POS_HORIZ_REL=256, /* True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate | */ - ESTIMATOR_PRED_POS_HORIZ_ABS=512, /* True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate | */ - ESTIMATOR_GPS_GLITCH=1024, /* True if the EKF has detected a GPS glitch | */ - ESTIMATOR_STATUS_FLAGS_ENUM_END=1025, /* | */ + ESTIMATOR_ATTITUDE=1, /* True if the attitude estimate is good | */ + ESTIMATOR_VELOCITY_HORIZ=2, /* True if the horizontal velocity estimate is good | */ + ESTIMATOR_VELOCITY_VERT=4, /* True if the vertical velocity estimate is good | */ + ESTIMATOR_POS_HORIZ_REL=8, /* True if the horizontal position (relative) estimate is good | */ + ESTIMATOR_POS_HORIZ_ABS=16, /* True if the horizontal position (absolute) estimate is good | */ + ESTIMATOR_POS_VERT_ABS=32, /* True if the vertical position (absolute) estimate is good | */ + ESTIMATOR_POS_VERT_AGL=64, /* True if the vertical position (above ground) estimate is good | */ + ESTIMATOR_CONST_POS_MODE=128, /* True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow) | */ + ESTIMATOR_PRED_POS_HORIZ_REL=256, /* True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate | */ + ESTIMATOR_PRED_POS_HORIZ_ABS=512, /* True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate | */ + ESTIMATOR_GPS_GLITCH=1024, /* True if the EKF has detected a GPS glitch | */ + ESTIMATOR_STATUS_FLAGS_ENUM_END=1025, /* | */ } ESTIMATOR_STATUS_FLAGS; #endif - - // MAVLINK VERSION #ifndef MAVLINK_VERSION @@ -1001,6 +999,19 @@ typedef enum ESTIMATOR_STATUS_FLAGS #include "./mavlink_msg_statustext.h" #include "./mavlink_msg_debug.h" +// base include + + +#undef MAVLINK_THIS_XML_IDX +#define MAVLINK_THIS_XML_IDX 1 + +#if MAVLINK_THIS_XML_IDX == MAVLINK_PRIMARY_XML_IDX +# define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, MAVLINK_MESSAGE_INFO_FOLLOW_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS, MAVLINK_MESSAGE_INFO_WIND_COV, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} +# if MAVLINK_COMMAND_24BIT +# include "../mavlink_get_info.h" +# endif +#endif + #ifdef __cplusplus } #endif // __cplusplus diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink.h b/oroca_bldc_FW/lib/mavlink/common/mavlink.h index 3c79e3d..e3789c0 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink.h @@ -1,10 +1,13 @@ /** @file - * @brief MAVLink comm protocol built from common.xml - * @see http://mavlink.org + * @brief MAVLink comm protocol built from common.xml + * @see http://mavlink.org */ +#pragma once #ifndef MAVLINK_H #define MAVLINK_H +#define MAVLINK_PRIMARY_XML_IDX 1 + #ifndef MAVLINK_STX #define MAVLINK_STX 254 #endif @@ -21,6 +24,10 @@ #define MAVLINK_CRC_EXTRA 1 #endif +#ifndef MAVLINK_COMMAND_24BIT +#define MAVLINK_COMMAND_24BIT 0 +#endif + #include "version.h" #include "common.h" diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_actuator_control_target.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_actuator_control_target.h index 22f8ced..a1ac675 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_actuator_control_target.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_actuator_control_target.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE ACTUATOR_CONTROL_TARGET PACKING #define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET 140 -typedef struct __mavlink_actuator_control_target_t -{ +MAVPACKED( +typedef struct __mavlink_actuator_control_target_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/ uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/ -} mavlink_actuator_control_target_t; +}) mavlink_actuator_control_target_t; #define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 41 +#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN 41 #define MAVLINK_MSG_ID_140_LEN 41 +#define MAVLINK_MSG_ID_140_MIN_LEN 41 #define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC 181 #define MAVLINK_MSG_ID_140_CRC 181 #define MAVLINK_MSG_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \ - "ACTUATOR_CONTROL_TARGET", \ - 3, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \ + 140, \ + "ACTUATOR_CONTROL_TARGET", \ + 3, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \ { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \ { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \ + "ACTUATOR_CONTROL_TARGET", \ + 3, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \ + { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \ + { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \ + } \ +} +#endif /** * @brief Pack a actuator_control_target message @@ -39,28 +53,24 @@ typedef struct __mavlink_actuator_control_target_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t group_mlx, const float *controls) + uint64_t time_usec, uint8_t group_mlx, const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_float_array(buf, 8, controls, 8); + char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_float_array(buf, 8, controls, 8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); #else - mavlink_actuator_control_target_t packet; - packet.time_usec = time_usec; - packet.group_mlx = group_mlx; - mav_array_memcpy(packet.controls, controls, sizeof(float)*8); + mavlink_actuator_control_target_t packet; + packet.time_usec = time_usec; + packet.group_mlx = group_mlx; + mav_array_memcpy(packet.controls, controls, sizeof(float)*8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); } /** @@ -75,29 +85,25 @@ static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_i * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t group_mlx,const float *controls) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t group_mlx,const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_float_array(buf, 8, controls, 8); + char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_float_array(buf, 8, controls, 8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); #else - mavlink_actuator_control_target_t packet; - packet.time_usec = time_usec; - packet.group_mlx = group_mlx; - mav_array_memcpy(packet.controls, controls, sizeof(float)*8); + mavlink_actuator_control_target_t packet; + packet.time_usec = time_usec; + packet.group_mlx = group_mlx; + mav_array_memcpy(packet.controls, controls, sizeof(float)*8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); } /** @@ -110,7 +116,7 @@ static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t sys */ static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target) { - return mavlink_msg_actuator_control_target_pack(system_id, component_id, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls); + return mavlink_msg_actuator_control_target_pack(system_id, component_id, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls); } /** @@ -124,7 +130,7 @@ static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system */ static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target) { - return mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, chan, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls); + return mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, chan, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls); } /** @@ -140,25 +146,31 @@ static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t s static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_float_array(buf, 8, controls, 8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); + char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_float_array(buf, 8, controls, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); + mavlink_actuator_control_target_t packet; + packet.time_usec = time_usec; + packet.group_mlx = group_mlx; + mav_array_memcpy(packet.controls, controls, sizeof(float)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); #endif +} + +/** + * @brief Send a actuator_control_target message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_actuator_control_target_send_struct(mavlink_channel_t chan, const mavlink_actuator_control_target_t* actuator_control_target) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_actuator_control_target_send(chan, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls); #else - mavlink_actuator_control_target_t packet; - packet.time_usec = time_usec; - packet.group_mlx = group_mlx; - mav_array_memcpy(packet.controls, controls, sizeof(float)*8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)actuator_control_target, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); #endif } @@ -173,25 +185,17 @@ static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t ch static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_float_array(buf, 8, controls, 8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_float_array(buf, 8, controls, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); -#endif -#else - mavlink_actuator_control_target_t *packet = (mavlink_actuator_control_target_t *)msgbuf; - packet->time_usec = time_usec; - packet->group_mlx = group_mlx; - mav_array_memcpy(packet->controls, controls, sizeof(float)*8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); -#endif + mavlink_actuator_control_target_t *packet = (mavlink_actuator_control_target_t *)msgbuf; + packet->time_usec = time_usec; + packet->group_mlx = group_mlx; + mav_array_memcpy(packet->controls, controls, sizeof(float)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC); #endif } #endif @@ -208,7 +212,7 @@ static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_ */ static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -218,7 +222,7 @@ static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const m */ static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 40); + return _MAV_RETURN_uint8_t(msg, 40); } /** @@ -228,7 +232,7 @@ static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const ma */ static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls) { - return _MAV_RETURN_float_array(msg, controls, 8, 8); + return _MAV_RETURN_float_array(msg, controls, 8, 8); } /** @@ -239,11 +243,13 @@ static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const ma */ static inline void mavlink_msg_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_actuator_control_target_t* actuator_control_target) { -#if MAVLINK_NEED_BYTE_SWAP - actuator_control_target->time_usec = mavlink_msg_actuator_control_target_get_time_usec(msg); - mavlink_msg_actuator_control_target_get_controls(msg, actuator_control_target->controls); - actuator_control_target->group_mlx = mavlink_msg_actuator_control_target_get_group_mlx(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + actuator_control_target->time_usec = mavlink_msg_actuator_control_target_get_time_usec(msg); + mavlink_msg_actuator_control_target_get_controls(msg, actuator_control_target->controls); + actuator_control_target->group_mlx = mavlink_msg_actuator_control_target_get_group_mlx(msg); #else - memcpy(actuator_control_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN; + memset(actuator_control_target, 0, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN); + memcpy(actuator_control_target, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_adsb_vehicle.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_adsb_vehicle.h index 542e02e..bab74e9 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_adsb_vehicle.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_adsb_vehicle.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE ADSB_VEHICLE PACKING #define MAVLINK_MSG_ID_ADSB_VEHICLE 246 -typedef struct __mavlink_adsb_vehicle_t -{ +MAVPACKED( +typedef struct __mavlink_adsb_vehicle_t { uint32_t ICAO_address; /*< ICAO address*/ int32_t lat; /*< Latitude, expressed as degrees * 1E7*/ int32_t lon; /*< Longitude, expressed as degrees * 1E7*/ @@ -17,20 +18,24 @@ typedef struct __mavlink_adsb_vehicle_t char callsign[9]; /*< The callsign, 8+null*/ uint8_t emitter_type; /*< Type from ADSB_EMITTER_TYPE enum*/ uint8_t tslc; /*< Time since last communication in seconds*/ -} mavlink_adsb_vehicle_t; +}) mavlink_adsb_vehicle_t; #define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 38 +#define MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN 38 #define MAVLINK_MSG_ID_246_LEN 38 +#define MAVLINK_MSG_ID_246_MIN_LEN 38 #define MAVLINK_MSG_ID_ADSB_VEHICLE_CRC 184 #define MAVLINK_MSG_ID_246_CRC 184 #define MAVLINK_MSG_ADSB_VEHICLE_FIELD_CALLSIGN_LEN 9 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \ - "ADSB_VEHICLE", \ - 13, \ - { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \ + 246, \ + "ADSB_VEHICLE", \ + 13, \ + { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \ @@ -45,7 +50,26 @@ typedef struct __mavlink_adsb_vehicle_t { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \ + "ADSB_VEHICLE", \ + 13, \ + { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \ + { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \ + { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \ + { "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \ + { "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \ + { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \ + { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \ + { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \ + { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \ + { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \ + } \ +} +#endif /** * @brief Pack a adsb_vehicle message @@ -69,48 +93,44 @@ typedef struct __mavlink_adsb_vehicle_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk) + uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; - _mav_put_uint32_t(buf, 0, ICAO_address); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, altitude); - _mav_put_uint16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, hor_velocity); - _mav_put_int16_t(buf, 20, ver_velocity); - _mav_put_uint16_t(buf, 22, flags); - _mav_put_uint16_t(buf, 24, squawk); - _mav_put_uint8_t(buf, 26, altitude_type); - _mav_put_uint8_t(buf, 36, emitter_type); - _mav_put_uint8_t(buf, 37, tslc); - _mav_put_char_array(buf, 27, callsign, 9); + char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; + _mav_put_uint32_t(buf, 0, ICAO_address); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, altitude); + _mav_put_uint16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, hor_velocity); + _mav_put_int16_t(buf, 20, ver_velocity); + _mav_put_uint16_t(buf, 22, flags); + _mav_put_uint16_t(buf, 24, squawk); + _mav_put_uint8_t(buf, 26, altitude_type); + _mav_put_uint8_t(buf, 36, emitter_type); + _mav_put_uint8_t(buf, 37, tslc); + _mav_put_char_array(buf, 27, callsign, 9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); #else - mavlink_adsb_vehicle_t packet; - packet.ICAO_address = ICAO_address; - packet.lat = lat; - packet.lon = lon; - packet.altitude = altitude; - packet.heading = heading; - packet.hor_velocity = hor_velocity; - packet.ver_velocity = ver_velocity; - packet.flags = flags; - packet.squawk = squawk; - packet.altitude_type = altitude_type; - packet.emitter_type = emitter_type; - packet.tslc = tslc; - mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9); + mavlink_adsb_vehicle_t packet; + packet.ICAO_address = ICAO_address; + packet.lat = lat; + packet.lon = lon; + packet.altitude = altitude; + packet.heading = heading; + packet.hor_velocity = hor_velocity; + packet.ver_velocity = ver_velocity; + packet.flags = flags; + packet.squawk = squawk; + packet.altitude_type = altitude_type; + packet.emitter_type = emitter_type; + packet.tslc = tslc; + mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); } /** @@ -135,49 +155,45 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,int32_t altitude,uint16_t heading,uint16_t hor_velocity,int16_t ver_velocity,const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags,uint16_t squawk) + mavlink_message_t* msg, + uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,int32_t altitude,uint16_t heading,uint16_t hor_velocity,int16_t ver_velocity,const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags,uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; - _mav_put_uint32_t(buf, 0, ICAO_address); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, altitude); - _mav_put_uint16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, hor_velocity); - _mav_put_int16_t(buf, 20, ver_velocity); - _mav_put_uint16_t(buf, 22, flags); - _mav_put_uint16_t(buf, 24, squawk); - _mav_put_uint8_t(buf, 26, altitude_type); - _mav_put_uint8_t(buf, 36, emitter_type); - _mav_put_uint8_t(buf, 37, tslc); - _mav_put_char_array(buf, 27, callsign, 9); + char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; + _mav_put_uint32_t(buf, 0, ICAO_address); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, altitude); + _mav_put_uint16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, hor_velocity); + _mav_put_int16_t(buf, 20, ver_velocity); + _mav_put_uint16_t(buf, 22, flags); + _mav_put_uint16_t(buf, 24, squawk); + _mav_put_uint8_t(buf, 26, altitude_type); + _mav_put_uint8_t(buf, 36, emitter_type); + _mav_put_uint8_t(buf, 37, tslc); + _mav_put_char_array(buf, 27, callsign, 9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); #else - mavlink_adsb_vehicle_t packet; - packet.ICAO_address = ICAO_address; - packet.lat = lat; - packet.lon = lon; - packet.altitude = altitude; - packet.heading = heading; - packet.hor_velocity = hor_velocity; - packet.ver_velocity = ver_velocity; - packet.flags = flags; - packet.squawk = squawk; - packet.altitude_type = altitude_type; - packet.emitter_type = emitter_type; - packet.tslc = tslc; - mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9); + mavlink_adsb_vehicle_t packet; + packet.ICAO_address = ICAO_address; + packet.lat = lat; + packet.lon = lon; + packet.altitude = altitude; + packet.heading = heading; + packet.hor_velocity = hor_velocity; + packet.ver_velocity = ver_velocity; + packet.flags = flags; + packet.squawk = squawk; + packet.altitude_type = altitude_type; + packet.emitter_type = emitter_type; + packet.tslc = tslc; + mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); } /** @@ -190,7 +206,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle) { - return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk); + return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk); } /** @@ -204,7 +220,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle) { - return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk); + return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk); } /** @@ -230,45 +246,51 @@ static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, u static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; - _mav_put_uint32_t(buf, 0, ICAO_address); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, altitude); - _mav_put_uint16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, hor_velocity); - _mav_put_int16_t(buf, 20, ver_velocity); - _mav_put_uint16_t(buf, 22, flags); - _mav_put_uint16_t(buf, 24, squawk); - _mav_put_uint8_t(buf, 26, altitude_type); - _mav_put_uint8_t(buf, 36, emitter_type); - _mav_put_uint8_t(buf, 37, tslc); - _mav_put_char_array(buf, 27, callsign, 9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); + char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; + _mav_put_uint32_t(buf, 0, ICAO_address); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, altitude); + _mav_put_uint16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, hor_velocity); + _mav_put_int16_t(buf, 20, ver_velocity); + _mav_put_uint16_t(buf, 22, flags); + _mav_put_uint16_t(buf, 24, squawk); + _mav_put_uint8_t(buf, 26, altitude_type); + _mav_put_uint8_t(buf, 36, emitter_type); + _mav_put_uint8_t(buf, 37, tslc); + _mav_put_char_array(buf, 27, callsign, 9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); + mavlink_adsb_vehicle_t packet; + packet.ICAO_address = ICAO_address; + packet.lat = lat; + packet.lon = lon; + packet.altitude = altitude; + packet.heading = heading; + packet.hor_velocity = hor_velocity; + packet.ver_velocity = ver_velocity; + packet.flags = flags; + packet.squawk = squawk; + packet.altitude_type = altitude_type; + packet.emitter_type = emitter_type; + packet.tslc = tslc; + mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)&packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); #endif +} + +/** + * @brief Send a adsb_vehicle message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_adsb_vehicle_send_struct(mavlink_channel_t chan, const mavlink_adsb_vehicle_t* adsb_vehicle) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_adsb_vehicle_send(chan, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk); #else - mavlink_adsb_vehicle_t packet; - packet.ICAO_address = ICAO_address; - packet.lat = lat; - packet.lon = lon; - packet.altitude = altitude; - packet.heading = heading; - packet.hor_velocity = hor_velocity; - packet.ver_velocity = ver_velocity; - packet.flags = flags; - packet.squawk = squawk; - packet.altitude_type = altitude_type; - packet.emitter_type = emitter_type; - packet.tslc = tslc; - mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)&packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)&packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)adsb_vehicle, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); #endif } @@ -283,45 +305,37 @@ static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_ static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, ICAO_address); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, altitude); - _mav_put_uint16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, hor_velocity); - _mav_put_int16_t(buf, 20, ver_velocity); - _mav_put_uint16_t(buf, 22, flags); - _mav_put_uint16_t(buf, 24, squawk); - _mav_put_uint8_t(buf, 26, altitude_type); - _mav_put_uint8_t(buf, 36, emitter_type); - _mav_put_uint8_t(buf, 37, tslc); - _mav_put_char_array(buf, 27, callsign, 9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, ICAO_address); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, altitude); + _mav_put_uint16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, hor_velocity); + _mav_put_int16_t(buf, 20, ver_velocity); + _mav_put_uint16_t(buf, 22, flags); + _mav_put_uint16_t(buf, 24, squawk); + _mav_put_uint8_t(buf, 26, altitude_type); + _mav_put_uint8_t(buf, 36, emitter_type); + _mav_put_uint8_t(buf, 37, tslc); + _mav_put_char_array(buf, 27, callsign, 9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); -#endif -#else - mavlink_adsb_vehicle_t *packet = (mavlink_adsb_vehicle_t *)msgbuf; - packet->ICAO_address = ICAO_address; - packet->lat = lat; - packet->lon = lon; - packet->altitude = altitude; - packet->heading = heading; - packet->hor_velocity = hor_velocity; - packet->ver_velocity = ver_velocity; - packet->flags = flags; - packet->squawk = squawk; - packet->altitude_type = altitude_type; - packet->emitter_type = emitter_type; - packet->tslc = tslc; - mav_array_memcpy(packet->callsign, callsign, sizeof(char)*9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); -#endif + mavlink_adsb_vehicle_t *packet = (mavlink_adsb_vehicle_t *)msgbuf; + packet->ICAO_address = ICAO_address; + packet->lat = lat; + packet->lon = lon; + packet->altitude = altitude; + packet->heading = heading; + packet->hor_velocity = hor_velocity; + packet->ver_velocity = ver_velocity; + packet->flags = flags; + packet->squawk = squawk; + packet->altitude_type = altitude_type; + packet->emitter_type = emitter_type; + packet->tslc = tslc; + mav_array_memcpy(packet->callsign, callsign, sizeof(char)*9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); #endif } #endif @@ -338,7 +352,7 @@ static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, */ static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -348,7 +362,7 @@ static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_m */ static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -358,7 +372,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* */ static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -368,7 +382,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* */ static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 26); + return _MAV_RETURN_uint8_t(msg, 26); } /** @@ -378,7 +392,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_m */ static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -388,7 +402,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_messag */ static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 16); + return _MAV_RETURN_uint16_t(msg, 16); } /** @@ -398,7 +412,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_messag */ static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -408,7 +422,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_m */ static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -418,7 +432,7 @@ static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_me */ static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_message_t* msg, char *callsign) { - return _MAV_RETURN_char_array(msg, callsign, 9, 27); + return _MAV_RETURN_char_array(msg, callsign, 9, 27); } /** @@ -428,7 +442,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_messa */ static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 36); + return _MAV_RETURN_uint8_t(msg, 36); } /** @@ -438,7 +452,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_me */ static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 37); + return _MAV_RETURN_uint8_t(msg, 37); } /** @@ -448,7 +462,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* */ static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 22); + return _MAV_RETURN_uint16_t(msg, 22); } /** @@ -458,7 +472,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_ */ static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -469,21 +483,23 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(const mavlink_message */ static inline void mavlink_msg_adsb_vehicle_decode(const mavlink_message_t* msg, mavlink_adsb_vehicle_t* adsb_vehicle) { -#if MAVLINK_NEED_BYTE_SWAP - adsb_vehicle->ICAO_address = mavlink_msg_adsb_vehicle_get_ICAO_address(msg); - adsb_vehicle->lat = mavlink_msg_adsb_vehicle_get_lat(msg); - adsb_vehicle->lon = mavlink_msg_adsb_vehicle_get_lon(msg); - adsb_vehicle->altitude = mavlink_msg_adsb_vehicle_get_altitude(msg); - adsb_vehicle->heading = mavlink_msg_adsb_vehicle_get_heading(msg); - adsb_vehicle->hor_velocity = mavlink_msg_adsb_vehicle_get_hor_velocity(msg); - adsb_vehicle->ver_velocity = mavlink_msg_adsb_vehicle_get_ver_velocity(msg); - adsb_vehicle->flags = mavlink_msg_adsb_vehicle_get_flags(msg); - adsb_vehicle->squawk = mavlink_msg_adsb_vehicle_get_squawk(msg); - adsb_vehicle->altitude_type = mavlink_msg_adsb_vehicle_get_altitude_type(msg); - mavlink_msg_adsb_vehicle_get_callsign(msg, adsb_vehicle->callsign); - adsb_vehicle->emitter_type = mavlink_msg_adsb_vehicle_get_emitter_type(msg); - adsb_vehicle->tslc = mavlink_msg_adsb_vehicle_get_tslc(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + adsb_vehicle->ICAO_address = mavlink_msg_adsb_vehicle_get_ICAO_address(msg); + adsb_vehicle->lat = mavlink_msg_adsb_vehicle_get_lat(msg); + adsb_vehicle->lon = mavlink_msg_adsb_vehicle_get_lon(msg); + adsb_vehicle->altitude = mavlink_msg_adsb_vehicle_get_altitude(msg); + adsb_vehicle->heading = mavlink_msg_adsb_vehicle_get_heading(msg); + adsb_vehicle->hor_velocity = mavlink_msg_adsb_vehicle_get_hor_velocity(msg); + adsb_vehicle->ver_velocity = mavlink_msg_adsb_vehicle_get_ver_velocity(msg); + adsb_vehicle->flags = mavlink_msg_adsb_vehicle_get_flags(msg); + adsb_vehicle->squawk = mavlink_msg_adsb_vehicle_get_squawk(msg); + adsb_vehicle->altitude_type = mavlink_msg_adsb_vehicle_get_altitude_type(msg); + mavlink_msg_adsb_vehicle_get_callsign(msg, adsb_vehicle->callsign); + adsb_vehicle->emitter_type = mavlink_msg_adsb_vehicle_get_emitter_type(msg); + adsb_vehicle->tslc = mavlink_msg_adsb_vehicle_get_tslc(msg); #else - memcpy(adsb_vehicle, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ADSB_VEHICLE_LEN? msg->len : MAVLINK_MSG_ID_ADSB_VEHICLE_LEN; + memset(adsb_vehicle, 0, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); + memcpy(adsb_vehicle, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_altitude.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_altitude.h index 073acbd..6fca89a 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_altitude.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_altitude.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE ALTITUDE PACKING #define MAVLINK_MSG_ID_ALTITUDE 141 -typedef struct __mavlink_altitude_t -{ +MAVPACKED( +typedef struct __mavlink_altitude_t { uint64_t time_usec; /*< Timestamp (milliseconds since system boot)*/ float altitude_monotonic; /*< This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.*/ float altitude_amsl; /*< This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_altitude_t float altitude_relative; /*< This is the altitude above the home position. It resets on each change of the current home position.*/ float altitude_terrain; /*< This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.*/ float bottom_clearance; /*< This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.*/ -} mavlink_altitude_t; +}) mavlink_altitude_t; #define MAVLINK_MSG_ID_ALTITUDE_LEN 32 +#define MAVLINK_MSG_ID_ALTITUDE_MIN_LEN 32 #define MAVLINK_MSG_ID_141_LEN 32 +#define MAVLINK_MSG_ID_141_MIN_LEN 32 #define MAVLINK_MSG_ID_ALTITUDE_CRC 47 #define MAVLINK_MSG_ID_141_CRC 47 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ALTITUDE { \ - "ALTITUDE", \ - 7, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \ + 141, \ + "ALTITUDE", \ + 7, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \ { "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \ { "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \ { "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_altitude_t { "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ALTITUDE { \ + "ALTITUDE", \ + 7, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \ + { "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \ + { "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \ + { "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \ + { "altitude_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_altitude_t, altitude_relative) }, \ + { "altitude_terrain", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_altitude_t, altitude_terrain) }, \ + { "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \ + } \ +} +#endif /** * @brief Pack a altitude message @@ -51,38 +69,34 @@ typedef struct __mavlink_altitude_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_altitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance) + uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ALTITUDE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, altitude_monotonic); - _mav_put_float(buf, 12, altitude_amsl); - _mav_put_float(buf, 16, altitude_local); - _mav_put_float(buf, 20, altitude_relative); - _mav_put_float(buf, 24, altitude_terrain); - _mav_put_float(buf, 28, bottom_clearance); + char buf[MAVLINK_MSG_ID_ALTITUDE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, altitude_monotonic); + _mav_put_float(buf, 12, altitude_amsl); + _mav_put_float(buf, 16, altitude_local); + _mav_put_float(buf, 20, altitude_relative); + _mav_put_float(buf, 24, altitude_terrain); + _mav_put_float(buf, 28, bottom_clearance); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN); #else - mavlink_altitude_t packet; - packet.time_usec = time_usec; - packet.altitude_monotonic = altitude_monotonic; - packet.altitude_amsl = altitude_amsl; - packet.altitude_local = altitude_local; - packet.altitude_relative = altitude_relative; - packet.altitude_terrain = altitude_terrain; - packet.bottom_clearance = bottom_clearance; + mavlink_altitude_t packet; + packet.time_usec = time_usec; + packet.altitude_monotonic = altitude_monotonic; + packet.altitude_amsl = altitude_amsl; + packet.altitude_local = altitude_local; + packet.altitude_relative = altitude_relative; + packet.altitude_terrain = altitude_terrain; + packet.bottom_clearance = bottom_clearance; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ALTITUDE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ALTITUDE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ALTITUDE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_altitude_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_altitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float altitude_monotonic,float altitude_amsl,float altitude_local,float altitude_relative,float altitude_terrain,float bottom_clearance) + mavlink_message_t* msg, + uint64_t time_usec,float altitude_monotonic,float altitude_amsl,float altitude_local,float altitude_relative,float altitude_terrain,float bottom_clearance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ALTITUDE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, altitude_monotonic); - _mav_put_float(buf, 12, altitude_amsl); - _mav_put_float(buf, 16, altitude_local); - _mav_put_float(buf, 20, altitude_relative); - _mav_put_float(buf, 24, altitude_terrain); - _mav_put_float(buf, 28, bottom_clearance); + char buf[MAVLINK_MSG_ID_ALTITUDE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, altitude_monotonic); + _mav_put_float(buf, 12, altitude_amsl); + _mav_put_float(buf, 16, altitude_local); + _mav_put_float(buf, 20, altitude_relative); + _mav_put_float(buf, 24, altitude_terrain); + _mav_put_float(buf, 28, bottom_clearance); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN); #else - mavlink_altitude_t packet; - packet.time_usec = time_usec; - packet.altitude_monotonic = altitude_monotonic; - packet.altitude_amsl = altitude_amsl; - packet.altitude_local = altitude_local; - packet.altitude_relative = altitude_relative; - packet.altitude_terrain = altitude_terrain; - packet.bottom_clearance = bottom_clearance; + mavlink_altitude_t packet; + packet.time_usec = time_usec; + packet.altitude_monotonic = altitude_monotonic; + packet.altitude_amsl = altitude_amsl; + packet.altitude_local = altitude_local; + packet.altitude_relative = altitude_relative; + packet.altitude_terrain = altitude_terrain; + packet.bottom_clearance = bottom_clearance; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ALTITUDE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ALTITUDE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ALTITUDE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_altitude_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_altitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_altitude_t* altitude) { - return mavlink_msg_altitude_pack(system_id, component_id, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance); + return mavlink_msg_altitude_pack(system_id, component_id, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_altitude_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_altitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_altitude_t* altitude) { - return mavlink_msg_altitude_pack_chan(system_id, component_id, chan, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance); + return mavlink_msg_altitude_pack_chan(system_id, component_id, chan, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_altitude_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_altitude_send(mavlink_channel_t chan, uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ALTITUDE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, altitude_monotonic); - _mav_put_float(buf, 12, altitude_amsl); - _mav_put_float(buf, 16, altitude_local); - _mav_put_float(buf, 20, altitude_relative); - _mav_put_float(buf, 24, altitude_terrain); - _mav_put_float(buf, 28, bottom_clearance); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); + char buf[MAVLINK_MSG_ID_ALTITUDE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, altitude_monotonic); + _mav_put_float(buf, 12, altitude_amsl); + _mav_put_float(buf, 16, altitude_local); + _mav_put_float(buf, 20, altitude_relative); + _mav_put_float(buf, 24, altitude_terrain); + _mav_put_float(buf, 28, bottom_clearance); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_LEN); + mavlink_altitude_t packet; + packet.time_usec = time_usec; + packet.altitude_monotonic = altitude_monotonic; + packet.altitude_amsl = altitude_amsl; + packet.altitude_local = altitude_local; + packet.altitude_relative = altitude_relative; + packet.altitude_terrain = altitude_terrain; + packet.bottom_clearance = bottom_clearance; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); #endif +} + +/** + * @brief Send a altitude message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_altitude_send_struct(mavlink_channel_t chan, const mavlink_altitude_t* altitude) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_altitude_send(chan, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance); #else - mavlink_altitude_t packet; - packet.time_usec = time_usec; - packet.altitude_monotonic = altitude_monotonic; - packet.altitude_amsl = altitude_amsl; - packet.altitude_local = altitude_local; - packet.altitude_relative = altitude_relative; - packet.altitude_terrain = altitude_terrain; - packet.bottom_clearance = bottom_clearance; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ALTITUDE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)altitude, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_altitude_send(mavlink_channel_t chan, uint64_t ti static inline void mavlink_msg_altitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, altitude_monotonic); - _mav_put_float(buf, 12, altitude_amsl); - _mav_put_float(buf, 16, altitude_local); - _mav_put_float(buf, 20, altitude_relative); - _mav_put_float(buf, 24, altitude_terrain); - _mav_put_float(buf, 28, bottom_clearance); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_LEN); -#endif -#else - mavlink_altitude_t *packet = (mavlink_altitude_t *)msgbuf; - packet->time_usec = time_usec; - packet->altitude_monotonic = altitude_monotonic; - packet->altitude_amsl = altitude_amsl; - packet->altitude_local = altitude_local; - packet->altitude_relative = altitude_relative; - packet->altitude_terrain = altitude_terrain; - packet->bottom_clearance = bottom_clearance; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)packet, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, altitude_monotonic); + _mav_put_float(buf, 12, altitude_amsl); + _mav_put_float(buf, 16, altitude_local); + _mav_put_float(buf, 20, altitude_relative); + _mav_put_float(buf, 24, altitude_terrain); + _mav_put_float(buf, 28, bottom_clearance); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)packet, MAVLINK_MSG_ID_ALTITUDE_LEN); -#endif + mavlink_altitude_t *packet = (mavlink_altitude_t *)msgbuf; + packet->time_usec = time_usec; + packet->altitude_monotonic = altitude_monotonic; + packet->altitude_amsl = altitude_amsl; + packet->altitude_local = altitude_local; + packet->altitude_relative = altitude_relative; + packet->altitude_terrain = altitude_terrain; + packet->bottom_clearance = bottom_clearance; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_altitude_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint64_t mavlink_msg_altitude_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint64_t mavlink_msg_altitude_get_time_usec(const mavlink_message_ */ static inline float mavlink_msg_altitude_get_altitude_monotonic(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_altitude_get_altitude_monotonic(const mavlink_me */ static inline float mavlink_msg_altitude_get_altitude_amsl(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_altitude_get_altitude_amsl(const mavlink_message */ static inline float mavlink_msg_altitude_get_altitude_local(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_altitude_get_altitude_local(const mavlink_messag */ static inline float mavlink_msg_altitude_get_altitude_relative(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_altitude_get_altitude_relative(const mavlink_mes */ static inline float mavlink_msg_altitude_get_altitude_terrain(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_altitude_get_altitude_terrain(const mavlink_mess */ static inline float mavlink_msg_altitude_get_bottom_clearance(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_altitude_get_bottom_clearance(const mavlink_mess */ static inline void mavlink_msg_altitude_decode(const mavlink_message_t* msg, mavlink_altitude_t* altitude) { -#if MAVLINK_NEED_BYTE_SWAP - altitude->time_usec = mavlink_msg_altitude_get_time_usec(msg); - altitude->altitude_monotonic = mavlink_msg_altitude_get_altitude_monotonic(msg); - altitude->altitude_amsl = mavlink_msg_altitude_get_altitude_amsl(msg); - altitude->altitude_local = mavlink_msg_altitude_get_altitude_local(msg); - altitude->altitude_relative = mavlink_msg_altitude_get_altitude_relative(msg); - altitude->altitude_terrain = mavlink_msg_altitude_get_altitude_terrain(msg); - altitude->bottom_clearance = mavlink_msg_altitude_get_bottom_clearance(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + altitude->time_usec = mavlink_msg_altitude_get_time_usec(msg); + altitude->altitude_monotonic = mavlink_msg_altitude_get_altitude_monotonic(msg); + altitude->altitude_amsl = mavlink_msg_altitude_get_altitude_amsl(msg); + altitude->altitude_local = mavlink_msg_altitude_get_altitude_local(msg); + altitude->altitude_relative = mavlink_msg_altitude_get_altitude_relative(msg); + altitude->altitude_terrain = mavlink_msg_altitude_get_altitude_terrain(msg); + altitude->bottom_clearance = mavlink_msg_altitude_get_bottom_clearance(msg); #else - memcpy(altitude, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ALTITUDE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ALTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ALTITUDE_LEN; + memset(altitude, 0, MAVLINK_MSG_ID_ALTITUDE_LEN); + memcpy(altitude, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_att_pos_mocap.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_att_pos_mocap.h index 5b15838..b747a9a 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_att_pos_mocap.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_att_pos_mocap.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE ATT_POS_MOCAP PACKING #define MAVLINK_MSG_ID_ATT_POS_MOCAP 138 -typedef struct __mavlink_att_pos_mocap_t -{ +MAVPACKED( +typedef struct __mavlink_att_pos_mocap_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ float x; /*< X position in meters (NED)*/ float y; /*< Y position in meters (NED)*/ float z; /*< Z position in meters (NED)*/ -} mavlink_att_pos_mocap_t; +}) mavlink_att_pos_mocap_t; #define MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN 36 +#define MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN 36 #define MAVLINK_MSG_ID_138_LEN 36 +#define MAVLINK_MSG_ID_138_MIN_LEN 36 #define MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC 109 #define MAVLINK_MSG_ID_138_CRC 109 #define MAVLINK_MSG_ATT_POS_MOCAP_FIELD_Q_LEN 4 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \ - "ATT_POS_MOCAP", \ - 5, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \ + 138, \ + "ATT_POS_MOCAP", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \ + "ATT_POS_MOCAP", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \ + { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \ + } \ +} +#endif /** * @brief Pack a att_pos_mocap message @@ -45,32 +61,28 @@ typedef struct __mavlink_att_pos_mocap_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, const float *q, float x, float y, float z) + uint64_t time_usec, const float *q, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, x); - _mav_put_float(buf, 28, y); - _mav_put_float(buf, 32, z); - _mav_put_float_array(buf, 8, q, 4); + char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, x); + _mav_put_float(buf, 28, y); + _mav_put_float(buf, 32, z); + _mav_put_float_array(buf, 8, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); #else - mavlink_att_pos_mocap_t packet; - packet.time_usec = time_usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_att_pos_mocap_t packet; + packet.time_usec = time_usec; + packet.x = x; + packet.y = y; + packet.z = z; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); } /** @@ -87,33 +99,29 @@ static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_att_pos_mocap_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,const float *q,float x,float y,float z) + mavlink_message_t* msg, + uint64_t time_usec,const float *q,float x,float y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, x); - _mav_put_float(buf, 28, y); - _mav_put_float(buf, 32, z); - _mav_put_float_array(buf, 8, q, 4); + char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, x); + _mav_put_float(buf, 28, y); + _mav_put_float(buf, 32, z); + _mav_put_float_array(buf, 8, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); #else - mavlink_att_pos_mocap_t packet; - packet.time_usec = time_usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_att_pos_mocap_t packet; + packet.time_usec = time_usec; + packet.x = x; + packet.y = y; + packet.z = z; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); } /** @@ -126,7 +134,7 @@ static inline uint16_t mavlink_msg_att_pos_mocap_pack_chan(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_att_pos_mocap_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap) { - return mavlink_msg_att_pos_mocap_pack(system_id, component_id, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z); + return mavlink_msg_att_pos_mocap_pack(system_id, component_id, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z); } /** @@ -140,7 +148,7 @@ static inline uint16_t mavlink_msg_att_pos_mocap_encode(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap) { - return mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, chan, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z); + return mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, chan, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z); } /** @@ -158,29 +166,35 @@ static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id, static inline void mavlink_msg_att_pos_mocap_send(mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, x); - _mav_put_float(buf, 28, y); - _mav_put_float(buf, 32, z); - _mav_put_float_array(buf, 8, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); + char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, x); + _mav_put_float(buf, 28, y); + _mav_put_float(buf, 32, z); + _mav_put_float_array(buf, 8, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); + mavlink_att_pos_mocap_t packet; + packet.time_usec = time_usec; + packet.x = x; + packet.y = y; + packet.z = z; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); #endif +} + +/** + * @brief Send a att_pos_mocap message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_att_pos_mocap_send_struct(mavlink_channel_t chan, const mavlink_att_pos_mocap_t* att_pos_mocap) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_att_pos_mocap_send(chan, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z); #else - mavlink_att_pos_mocap_t packet; - packet.time_usec = time_usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)att_pos_mocap, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); #endif } @@ -195,29 +209,21 @@ static inline void mavlink_msg_att_pos_mocap_send(mavlink_channel_t chan, uint64 static inline void mavlink_msg_att_pos_mocap_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, x); - _mav_put_float(buf, 28, y); - _mav_put_float(buf, 32, z); - _mav_put_float_array(buf, 8, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, x); + _mav_put_float(buf, 28, y); + _mav_put_float(buf, 32, z); + _mav_put_float_array(buf, 8, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); -#endif -#else - mavlink_att_pos_mocap_t *packet = (mavlink_att_pos_mocap_t *)msgbuf; - packet->time_usec = time_usec; - packet->x = x; - packet->y = y; - packet->z = z; - mav_array_memcpy(packet->q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); -#endif + mavlink_att_pos_mocap_t *packet = (mavlink_att_pos_mocap_t *)msgbuf; + packet->time_usec = time_usec; + packet->x = x; + packet->y = y; + packet->z = z; + mav_array_memcpy(packet->q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC); #endif } #endif @@ -234,7 +240,7 @@ static inline void mavlink_msg_att_pos_mocap_send_buf(mavlink_message_t *msgbuf, */ static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -244,7 +250,7 @@ static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_mes */ static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* msg, float *q) { - return _MAV_RETURN_float_array(msg, q, 4, 8); + return _MAV_RETURN_float_array(msg, q, 4, 8); } /** @@ -254,7 +260,7 @@ static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* */ static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -264,7 +270,7 @@ static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg */ static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -274,7 +280,7 @@ static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg */ static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -285,13 +291,15 @@ static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg */ static inline void mavlink_msg_att_pos_mocap_decode(const mavlink_message_t* msg, mavlink_att_pos_mocap_t* att_pos_mocap) { -#if MAVLINK_NEED_BYTE_SWAP - att_pos_mocap->time_usec = mavlink_msg_att_pos_mocap_get_time_usec(msg); - mavlink_msg_att_pos_mocap_get_q(msg, att_pos_mocap->q); - att_pos_mocap->x = mavlink_msg_att_pos_mocap_get_x(msg); - att_pos_mocap->y = mavlink_msg_att_pos_mocap_get_y(msg); - att_pos_mocap->z = mavlink_msg_att_pos_mocap_get_z(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + att_pos_mocap->time_usec = mavlink_msg_att_pos_mocap_get_time_usec(msg); + mavlink_msg_att_pos_mocap_get_q(msg, att_pos_mocap->q); + att_pos_mocap->x = mavlink_msg_att_pos_mocap_get_x(msg); + att_pos_mocap->y = mavlink_msg_att_pos_mocap_get_y(msg); + att_pos_mocap->z = mavlink_msg_att_pos_mocap_get_z(msg); #else - memcpy(att_pos_mocap, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN? msg->len : MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN; + memset(att_pos_mocap, 0, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN); + memcpy(att_pos_mocap, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude.h index c2e4158..9d3addd 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE ATTITUDE PACKING #define MAVLINK_MSG_ID_ATTITUDE 30 -typedef struct __mavlink_attitude_t -{ +MAVPACKED( +typedef struct __mavlink_attitude_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float roll; /*< Roll angle (rad, -pi..+pi)*/ float pitch; /*< Pitch angle (rad, -pi..+pi)*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_attitude_t float rollspeed; /*< Roll angular speed (rad/s)*/ float pitchspeed; /*< Pitch angular speed (rad/s)*/ float yawspeed; /*< Yaw angular speed (rad/s)*/ -} mavlink_attitude_t; +}) mavlink_attitude_t; #define MAVLINK_MSG_ID_ATTITUDE_LEN 28 +#define MAVLINK_MSG_ID_ATTITUDE_MIN_LEN 28 #define MAVLINK_MSG_ID_30_LEN 28 +#define MAVLINK_MSG_ID_30_MIN_LEN 28 #define MAVLINK_MSG_ID_ATTITUDE_CRC 39 #define MAVLINK_MSG_ID_30_CRC 39 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ATTITUDE { \ - "ATTITUDE", \ - 7, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \ + 30, \ + "ATTITUDE", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \ { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_attitude_t { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ATTITUDE { \ + "ATTITUDE", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \ + { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, rollspeed) }, \ + { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, pitchspeed) }, \ + { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \ + } \ +} +#endif /** * @brief Pack a attitude message @@ -51,38 +69,34 @@ typedef struct __mavlink_attitude_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) + uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, rollspeed); - _mav_put_float(buf, 20, pitchspeed); - _mav_put_float(buf, 24, yawspeed); + char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, rollspeed); + _mav_put_float(buf, 20, pitchspeed); + _mav_put_float(buf, 24, yawspeed); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN); #else - mavlink_attitude_t packet; - packet.time_boot_ms = time_boot_ms; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; + mavlink_attitude_t packet; + packet.time_boot_ms = time_boot_ms; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed) + mavlink_message_t* msg, + uint32_t time_boot_ms,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, rollspeed); - _mav_put_float(buf, 20, pitchspeed); - _mav_put_float(buf, 24, yawspeed); + char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, rollspeed); + _mav_put_float(buf, 20, pitchspeed); + _mav_put_float(buf, 24, yawspeed); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN); #else - mavlink_attitude_t packet; - packet.time_boot_ms = time_boot_ms; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; + mavlink_attitude_t packet; + packet.time_boot_ms = time_boot_ms; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_t* attitude) { - return mavlink_msg_attitude_pack(system_id, component_id, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed); + return mavlink_msg_attitude_pack(system_id, component_id, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_attitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_t* attitude) { - return mavlink_msg_attitude_pack_chan(system_id, component_id, chan, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed); + return mavlink_msg_attitude_pack_chan(system_id, component_id, chan, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_attitude_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, rollspeed); - _mav_put_float(buf, 20, pitchspeed); - _mav_put_float(buf, 24, yawspeed); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); + char buf[MAVLINK_MSG_ID_ATTITUDE_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, rollspeed); + _mav_put_float(buf, 20, pitchspeed); + _mav_put_float(buf, 24, yawspeed); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_LEN); + mavlink_attitude_t packet; + packet.time_boot_ms = time_boot_ms; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); #endif +} + +/** + * @brief Send a attitude message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_attitude_send_struct(mavlink_channel_t chan, const mavlink_attitude_t* attitude) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_attitude_send(chan, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed); #else - mavlink_attitude_t packet; - packet.time_boot_ms = time_boot_ms; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)attitude, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t ti static inline void mavlink_msg_attitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, rollspeed); - _mav_put_float(buf, 20, pitchspeed); - _mav_put_float(buf, 24, yawspeed); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_LEN); -#endif -#else - mavlink_attitude_t *packet = (mavlink_attitude_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - packet->rollspeed = rollspeed; - packet->pitchspeed = pitchspeed; - packet->yawspeed = yawspeed; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, rollspeed); + _mav_put_float(buf, 20, pitchspeed); + _mav_put_float(buf, 24, yawspeed); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_LEN); -#endif + mavlink_attitude_t *packet = (mavlink_attitude_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + packet->rollspeed = rollspeed; + packet->pitchspeed = pitchspeed; + packet->yawspeed = yawspeed; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_attitude_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_messa */ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg) */ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg) */ static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg) */ static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* */ static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* */ static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* m */ static inline void mavlink_msg_attitude_decode(const mavlink_message_t* msg, mavlink_attitude_t* attitude) { -#if MAVLINK_NEED_BYTE_SWAP - attitude->time_boot_ms = mavlink_msg_attitude_get_time_boot_ms(msg); - attitude->roll = mavlink_msg_attitude_get_roll(msg); - attitude->pitch = mavlink_msg_attitude_get_pitch(msg); - attitude->yaw = mavlink_msg_attitude_get_yaw(msg); - attitude->rollspeed = mavlink_msg_attitude_get_rollspeed(msg); - attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg); - attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + attitude->time_boot_ms = mavlink_msg_attitude_get_time_boot_ms(msg); + attitude->roll = mavlink_msg_attitude_get_roll(msg); + attitude->pitch = mavlink_msg_attitude_get_pitch(msg); + attitude->yaw = mavlink_msg_attitude_get_yaw(msg); + attitude->rollspeed = mavlink_msg_attitude_get_rollspeed(msg); + attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg); + attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg); #else - memcpy(attitude, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_LEN; + memset(attitude, 0, MAVLINK_MSG_ID_ATTITUDE_LEN); + memcpy(attitude, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion.h index 023dc12..72b6e95 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE ATTITUDE_QUATERNION PACKING #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION 31 -typedef struct __mavlink_attitude_quaternion_t -{ +MAVPACKED( +typedef struct __mavlink_attitude_quaternion_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float q1; /*< Quaternion component 1, w (1 in null-rotation)*/ float q2; /*< Quaternion component 2, x (0 in null-rotation)*/ @@ -12,20 +13,24 @@ typedef struct __mavlink_attitude_quaternion_t float rollspeed; /*< Roll angular speed (rad/s)*/ float pitchspeed; /*< Pitch angular speed (rad/s)*/ float yawspeed; /*< Yaw angular speed (rad/s)*/ -} mavlink_attitude_quaternion_t; +}) mavlink_attitude_quaternion_t; #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN 32 +#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN 32 #define MAVLINK_MSG_ID_31_LEN 32 +#define MAVLINK_MSG_ID_31_MIN_LEN 32 #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC 246 #define MAVLINK_MSG_ID_31_CRC 246 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \ - "ATTITUDE_QUATERNION", \ - 8, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \ + 31, \ + "ATTITUDE_QUATERNION", \ + 8, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \ { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \ { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \ { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \ @@ -35,7 +40,21 @@ typedef struct __mavlink_attitude_quaternion_t { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \ + "ATTITUDE_QUATERNION", \ + 8, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \ + { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \ + { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \ + { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \ + { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_quaternion_t, q4) }, \ + { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_t, rollspeed) }, \ + { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_t, pitchspeed) }, \ + { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \ + } \ +} +#endif /** * @brief Pack a attitude_quaternion message @@ -54,40 +73,36 @@ typedef struct __mavlink_attitude_quaternion_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed) + uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, q1); - _mav_put_float(buf, 8, q2); - _mav_put_float(buf, 12, q3); - _mav_put_float(buf, 16, q4); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, q1); + _mav_put_float(buf, 8, q2); + _mav_put_float(buf, 12, q3); + _mav_put_float(buf, 16, q4); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #else - mavlink_attitude_quaternion_t packet; - packet.time_boot_ms = time_boot_ms; - packet.q1 = q1; - packet.q2 = q2; - packet.q3 = q3; - packet.q4 = q4; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; + mavlink_attitude_quaternion_t packet; + packet.time_boot_ms = time_boot_ms; + packet.q1 = q1; + packet.q2 = q2; + packet.q3 = q3; + packet.q4 = q4; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); } /** @@ -107,41 +122,37 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float q1,float q2,float q3,float q4,float rollspeed,float pitchspeed,float yawspeed) + mavlink_message_t* msg, + uint32_t time_boot_ms,float q1,float q2,float q3,float q4,float rollspeed,float pitchspeed,float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, q1); - _mav_put_float(buf, 8, q2); - _mav_put_float(buf, 12, q3); - _mav_put_float(buf, 16, q4); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, q1); + _mav_put_float(buf, 8, q2); + _mav_put_float(buf, 12, q3); + _mav_put_float(buf, 16, q4); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #else - mavlink_attitude_quaternion_t packet; - packet.time_boot_ms = time_boot_ms; - packet.q1 = q1; - packet.q2 = q2; - packet.q3 = q3; - packet.q4 = q4; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; + mavlink_attitude_quaternion_t packet; + packet.time_boot_ms = time_boot_ms; + packet.q1 = q1; + packet.q2 = q2; + packet.q3 = q3; + packet.q4 = q4; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); } /** @@ -154,7 +165,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_ */ static inline uint16_t mavlink_msg_attitude_quaternion_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion) { - return mavlink_msg_attitude_quaternion_pack(system_id, component_id, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed); + return mavlink_msg_attitude_quaternion_pack(system_id, component_id, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed); } /** @@ -168,7 +179,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_attitude_quaternion_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion) { - return mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, chan, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed); + return mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, chan, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed); } /** @@ -189,37 +200,43 @@ static inline uint16_t mavlink_msg_attitude_quaternion_encode_chan(uint8_t syste static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, q1); - _mav_put_float(buf, 8, q2); - _mav_put_float(buf, 12, q3); - _mav_put_float(buf, 16, q4); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, q1); + _mav_put_float(buf, 8, q2); + _mav_put_float(buf, 12, q3); + _mav_put_float(buf, 16, q4); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); + mavlink_attitude_quaternion_t packet; + packet.time_boot_ms = time_boot_ms; + packet.q1 = q1; + packet.q2 = q2; + packet.q3 = q3; + packet.q4 = q4; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); #endif +} + +/** + * @brief Send a attitude_quaternion message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_attitude_quaternion_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_t* attitude_quaternion) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_attitude_quaternion_send(chan, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed); #else - mavlink_attitude_quaternion_t packet; - packet.time_boot_ms = time_boot_ms; - packet.q1 = q1; - packet.q2 = q2; - packet.q3 = q3; - packet.q4 = q4; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)attitude_quaternion, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); #endif } @@ -234,37 +251,29 @@ static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, static inline void mavlink_msg_attitude_quaternion_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, q1); - _mav_put_float(buf, 8, q2); - _mav_put_float(buf, 12, q3); - _mav_put_float(buf, 16, q4); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); -#endif -#else - mavlink_attitude_quaternion_t *packet = (mavlink_attitude_quaternion_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->q1 = q1; - packet->q2 = q2; - packet->q3 = q3; - packet->q4 = q4; - packet->rollspeed = rollspeed; - packet->pitchspeed = pitchspeed; - packet->yawspeed = yawspeed; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, q1); + _mav_put_float(buf, 8, q2); + _mav_put_float(buf, 12, q3); + _mav_put_float(buf, 16, q4); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); -#endif + mavlink_attitude_quaternion_t *packet = (mavlink_attitude_quaternion_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->q1 = q1; + packet->q2 = q2; + packet->q3 = q3; + packet->q4 = q4; + packet->rollspeed = rollspeed; + packet->pitchspeed = pitchspeed; + packet->yawspeed = yawspeed; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC); #endif } #endif @@ -281,7 +290,7 @@ static inline void mavlink_msg_attitude_quaternion_send_buf(mavlink_message_t *m */ static inline uint32_t mavlink_msg_attitude_quaternion_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -291,7 +300,7 @@ static inline uint32_t mavlink_msg_attitude_quaternion_get_time_boot_ms(const ma */ static inline float mavlink_msg_attitude_quaternion_get_q1(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -301,7 +310,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q1(const mavlink_message */ static inline float mavlink_msg_attitude_quaternion_get_q2(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -311,7 +320,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q2(const mavlink_message */ static inline float mavlink_msg_attitude_quaternion_get_q3(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -321,7 +330,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q3(const mavlink_message */ static inline float mavlink_msg_attitude_quaternion_get_q4(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -331,7 +340,7 @@ static inline float mavlink_msg_attitude_quaternion_get_q4(const mavlink_message */ static inline float mavlink_msg_attitude_quaternion_get_rollspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -341,7 +350,7 @@ static inline float mavlink_msg_attitude_quaternion_get_rollspeed(const mavlink_ */ static inline float mavlink_msg_attitude_quaternion_get_pitchspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -351,7 +360,7 @@ static inline float mavlink_msg_attitude_quaternion_get_pitchspeed(const mavlink */ static inline float mavlink_msg_attitude_quaternion_get_yawspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -362,16 +371,18 @@ static inline float mavlink_msg_attitude_quaternion_get_yawspeed(const mavlink_m */ static inline void mavlink_msg_attitude_quaternion_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_t* attitude_quaternion) { -#if MAVLINK_NEED_BYTE_SWAP - attitude_quaternion->time_boot_ms = mavlink_msg_attitude_quaternion_get_time_boot_ms(msg); - attitude_quaternion->q1 = mavlink_msg_attitude_quaternion_get_q1(msg); - attitude_quaternion->q2 = mavlink_msg_attitude_quaternion_get_q2(msg); - attitude_quaternion->q3 = mavlink_msg_attitude_quaternion_get_q3(msg); - attitude_quaternion->q4 = mavlink_msg_attitude_quaternion_get_q4(msg); - attitude_quaternion->rollspeed = mavlink_msg_attitude_quaternion_get_rollspeed(msg); - attitude_quaternion->pitchspeed = mavlink_msg_attitude_quaternion_get_pitchspeed(msg); - attitude_quaternion->yawspeed = mavlink_msg_attitude_quaternion_get_yawspeed(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + attitude_quaternion->time_boot_ms = mavlink_msg_attitude_quaternion_get_time_boot_ms(msg); + attitude_quaternion->q1 = mavlink_msg_attitude_quaternion_get_q1(msg); + attitude_quaternion->q2 = mavlink_msg_attitude_quaternion_get_q2(msg); + attitude_quaternion->q3 = mavlink_msg_attitude_quaternion_get_q3(msg); + attitude_quaternion->q4 = mavlink_msg_attitude_quaternion_get_q4(msg); + attitude_quaternion->rollspeed = mavlink_msg_attitude_quaternion_get_rollspeed(msg); + attitude_quaternion->pitchspeed = mavlink_msg_attitude_quaternion_get_pitchspeed(msg); + attitude_quaternion->yawspeed = mavlink_msg_attitude_quaternion_get_yawspeed(msg); #else - memcpy(attitude_quaternion, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN; + memset(attitude_quaternion, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN); + memcpy(attitude_quaternion, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion_cov.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion_cov.h index 6564e03..380fe63 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion_cov.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_quaternion_cov.h @@ -1,19 +1,22 @@ +#pragma once // MESSAGE ATTITUDE_QUATERNION_COV PACKING #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV 61 -typedef struct __mavlink_attitude_quaternion_cov_t -{ +MAVPACKED( +typedef struct __mavlink_attitude_quaternion_cov_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/ float rollspeed; /*< Roll angular speed (rad/s)*/ float pitchspeed; /*< Pitch angular speed (rad/s)*/ float yawspeed; /*< Yaw angular speed (rad/s)*/ float covariance[9]; /*< Attitude covariance*/ -} mavlink_attitude_quaternion_cov_t; +}) mavlink_attitude_quaternion_cov_t; #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN 68 +#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN 68 #define MAVLINK_MSG_ID_61_LEN 68 +#define MAVLINK_MSG_ID_61_MIN_LEN 68 #define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC 153 #define MAVLINK_MSG_ID_61_CRC 153 @@ -21,10 +24,12 @@ typedef struct __mavlink_attitude_quaternion_cov_t #define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_Q_LEN 4 #define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_COVARIANCE_LEN 9 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \ - "ATTITUDE_QUATERNION_COV", \ - 6, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_boot_ms) }, \ + 61, \ + "ATTITUDE_QUATERNION_COV", \ + 6, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_boot_ms) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \ { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \ { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \ @@ -32,7 +37,19 @@ typedef struct __mavlink_attitude_quaternion_cov_t { "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 32, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \ + "ATTITUDE_QUATERNION_COV", \ + 6, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_boot_ms) }, \ + { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \ + { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \ + { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \ + { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_cov_t, yawspeed) }, \ + { "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 32, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \ + } \ +} +#endif /** * @brief Pack a attitude_quaternion_cov message @@ -49,34 +66,30 @@ typedef struct __mavlink_attitude_quaternion_cov_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance) + uint32_t time_boot_ms, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_float_array(buf, 4, q, 4); - _mav_put_float_array(buf, 32, covariance, 9); + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_float_array(buf, 4, q, 4); + _mav_put_float_array(buf, 32, covariance, 9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); #else - mavlink_attitude_quaternion_cov_t packet; - packet.time_boot_ms = time_boot_ms; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - mav_array_memcpy(packet.q, q, sizeof(float)*4); - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9); + mavlink_attitude_quaternion_cov_t packet; + packet.time_boot_ms = time_boot_ms; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); } /** @@ -94,35 +107,31 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_i * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,const float *q,float rollspeed,float pitchspeed,float yawspeed,const float *covariance) + mavlink_message_t* msg, + uint32_t time_boot_ms,const float *q,float rollspeed,float pitchspeed,float yawspeed,const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_float_array(buf, 4, q, 4); - _mav_put_float_array(buf, 32, covariance, 9); + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_float_array(buf, 4, q, 4); + _mav_put_float_array(buf, 32, covariance, 9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); #else - mavlink_attitude_quaternion_cov_t packet; - packet.time_boot_ms = time_boot_ms; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - mav_array_memcpy(packet.q, q, sizeof(float)*4); - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9); + mavlink_attitude_quaternion_cov_t packet; + packet.time_boot_ms = time_boot_ms; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); } /** @@ -135,7 +144,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack_chan(uint8_t sys */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov) { - return mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, msg, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance); + return mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, msg, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance); } /** @@ -149,7 +158,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode(uint8_t system */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov) { - return mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, chan, msg, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance); + return mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, chan, msg, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance); } /** @@ -168,31 +177,37 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode_chan(uint8_t s static inline void mavlink_msg_attitude_quaternion_cov_send(mavlink_channel_t chan, uint32_t time_boot_ms, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_float_array(buf, 4, q, 4); - _mav_put_float_array(buf, 32, covariance, 9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); + char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_float_array(buf, 4, q, 4); + _mav_put_float_array(buf, 32, covariance, 9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); + mavlink_attitude_quaternion_cov_t packet; + packet.time_boot_ms = time_boot_ms; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); #endif +} + +/** + * @brief Send a attitude_quaternion_cov message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_attitude_quaternion_cov_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_attitude_quaternion_cov_send(chan, attitude_quaternion_cov->time_boot_ms, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance); #else - mavlink_attitude_quaternion_cov_t packet; - packet.time_boot_ms = time_boot_ms; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - mav_array_memcpy(packet.q, q, sizeof(float)*4); - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)attitude_quaternion_cov, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); #endif } @@ -207,31 +222,23 @@ static inline void mavlink_msg_attitude_quaternion_cov_send(mavlink_channel_t ch static inline void mavlink_msg_attitude_quaternion_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_float_array(buf, 4, q, 4); - _mav_put_float_array(buf, 32, covariance, 9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_float_array(buf, 4, q, 4); + _mav_put_float_array(buf, 32, covariance, 9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); -#endif -#else - mavlink_attitude_quaternion_cov_t *packet = (mavlink_attitude_quaternion_cov_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->rollspeed = rollspeed; - packet->pitchspeed = pitchspeed; - packet->yawspeed = yawspeed; - mav_array_memcpy(packet->q, q, sizeof(float)*4); - mav_array_memcpy(packet->covariance, covariance, sizeof(float)*9); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); -#endif + mavlink_attitude_quaternion_cov_t *packet = (mavlink_attitude_quaternion_cov_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->rollspeed = rollspeed; + packet->pitchspeed = pitchspeed; + packet->yawspeed = yawspeed; + mav_array_memcpy(packet->q, q, sizeof(float)*4); + mav_array_memcpy(packet->covariance, covariance, sizeof(float)*9); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC); #endif } #endif @@ -248,7 +255,7 @@ static inline void mavlink_msg_attitude_quaternion_cov_send_buf(mavlink_message_ */ static inline uint32_t mavlink_msg_attitude_quaternion_cov_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -258,7 +265,7 @@ static inline uint32_t mavlink_msg_attitude_quaternion_cov_get_time_boot_ms(cons */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_message_t* msg, float *q) { - return _MAV_RETURN_float_array(msg, q, 4, 4); + return _MAV_RETURN_float_array(msg, q, 4, 4); } /** @@ -268,7 +275,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_m */ static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -278,7 +285,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavl */ static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -288,7 +295,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mav */ static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -298,7 +305,7 @@ static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavli */ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_covariance(const mavlink_message_t* msg, float *covariance) { - return _MAV_RETURN_float_array(msg, covariance, 9, 32); + return _MAV_RETURN_float_array(msg, covariance, 9, 32); } /** @@ -309,14 +316,16 @@ static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_covariance(const */ static inline void mavlink_msg_attitude_quaternion_cov_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov) { -#if MAVLINK_NEED_BYTE_SWAP - attitude_quaternion_cov->time_boot_ms = mavlink_msg_attitude_quaternion_cov_get_time_boot_ms(msg); - mavlink_msg_attitude_quaternion_cov_get_q(msg, attitude_quaternion_cov->q); - attitude_quaternion_cov->rollspeed = mavlink_msg_attitude_quaternion_cov_get_rollspeed(msg); - attitude_quaternion_cov->pitchspeed = mavlink_msg_attitude_quaternion_cov_get_pitchspeed(msg); - attitude_quaternion_cov->yawspeed = mavlink_msg_attitude_quaternion_cov_get_yawspeed(msg); - mavlink_msg_attitude_quaternion_cov_get_covariance(msg, attitude_quaternion_cov->covariance); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + attitude_quaternion_cov->time_boot_ms = mavlink_msg_attitude_quaternion_cov_get_time_boot_ms(msg); + mavlink_msg_attitude_quaternion_cov_get_q(msg, attitude_quaternion_cov->q); + attitude_quaternion_cov->rollspeed = mavlink_msg_attitude_quaternion_cov_get_rollspeed(msg); + attitude_quaternion_cov->pitchspeed = mavlink_msg_attitude_quaternion_cov_get_pitchspeed(msg); + attitude_quaternion_cov->yawspeed = mavlink_msg_attitude_quaternion_cov_get_yawspeed(msg); + mavlink_msg_attitude_quaternion_cov_get_covariance(msg, attitude_quaternion_cov->covariance); #else - memcpy(attitude_quaternion_cov, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN; + memset(attitude_quaternion_cov, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN); + memcpy(attitude_quaternion_cov, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_target.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_target.h index 1144ea1..36642fb 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_target.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_attitude_target.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE ATTITUDE_TARGET PACKING #define MAVLINK_MSG_ID_ATTITUDE_TARGET 83 -typedef struct __mavlink_attitude_target_t -{ +MAVPACKED( +typedef struct __mavlink_attitude_target_t { uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ float body_roll_rate; /*< Body roll rate in radians per second*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_attitude_target_t float body_yaw_rate; /*< Body roll rate in radians per second*/ float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/ uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude*/ -} mavlink_attitude_target_t; +}) mavlink_attitude_target_t; #define MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN 37 +#define MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN 37 #define MAVLINK_MSG_ID_83_LEN 37 +#define MAVLINK_MSG_ID_83_MIN_LEN 37 #define MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC 22 #define MAVLINK_MSG_ID_83_CRC 22 #define MAVLINK_MSG_ATTITUDE_TARGET_FIELD_Q_LEN 4 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \ - "ATTITUDE_TARGET", \ - 7, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \ + 83, \ + "ATTITUDE_TARGET", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \ { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \ { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_attitude_target_t { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \ + "ATTITUDE_TARGET", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \ + { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \ + { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \ + { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \ + { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \ + { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \ + } \ +} +#endif /** * @brief Pack a attitude_target message @@ -51,36 +69,32 @@ typedef struct __mavlink_attitude_target_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) + uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, type_mask); - _mav_put_float_array(buf, 4, q, 4); + char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, type_mask); + _mav_put_float_array(buf, 4, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); #else - mavlink_attitude_target_t packet; - packet.time_boot_ms = time_boot_ms; - packet.body_roll_rate = body_roll_rate; - packet.body_pitch_rate = body_pitch_rate; - packet.body_yaw_rate = body_yaw_rate; - packet.thrust = thrust; - packet.type_mask = type_mask; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_attitude_target_t packet; + packet.time_boot_ms = time_boot_ms; + packet.body_roll_rate = body_roll_rate; + packet.body_pitch_rate = body_pitch_rate; + packet.body_yaw_rate = body_yaw_rate; + packet.thrust = thrust; + packet.type_mask = type_mask; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); } /** @@ -99,37 +113,33 @@ static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, type_mask); - _mav_put_float_array(buf, 4, q, 4); + char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, type_mask); + _mav_put_float_array(buf, 4, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); #else - mavlink_attitude_target_t packet; - packet.time_boot_ms = time_boot_ms; - packet.body_roll_rate = body_roll_rate; - packet.body_pitch_rate = body_pitch_rate; - packet.body_yaw_rate = body_yaw_rate; - packet.thrust = thrust; - packet.type_mask = type_mask; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_attitude_target_t packet; + packet.time_boot_ms = time_boot_ms; + packet.body_roll_rate = body_roll_rate; + packet.body_pitch_rate = body_pitch_rate; + packet.body_yaw_rate = body_yaw_rate; + packet.thrust = thrust; + packet.type_mask = type_mask; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); } /** @@ -142,7 +152,7 @@ static inline uint16_t mavlink_msg_attitude_target_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_attitude_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target) { - return mavlink_msg_attitude_target_pack(system_id, component_id, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust); + return mavlink_msg_attitude_target_pack(system_id, component_id, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust); } /** @@ -156,7 +166,7 @@ static inline uint16_t mavlink_msg_attitude_target_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_attitude_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target) { - return mavlink_msg_attitude_target_pack_chan(system_id, component_id, chan, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust); + return mavlink_msg_attitude_target_pack_chan(system_id, component_id, chan, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust); } /** @@ -176,33 +186,39 @@ static inline uint16_t mavlink_msg_attitude_target_encode_chan(uint8_t system_id static inline void mavlink_msg_attitude_target_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, type_mask); - _mav_put_float_array(buf, 4, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); + char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, type_mask); + _mav_put_float_array(buf, 4, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); + mavlink_attitude_target_t packet; + packet.time_boot_ms = time_boot_ms; + packet.body_roll_rate = body_roll_rate; + packet.body_pitch_rate = body_pitch_rate; + packet.body_yaw_rate = body_yaw_rate; + packet.thrust = thrust; + packet.type_mask = type_mask; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); #endif +} + +/** + * @brief Send a attitude_target message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_attitude_target_send_struct(mavlink_channel_t chan, const mavlink_attitude_target_t* attitude_target) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_attitude_target_send(chan, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust); #else - mavlink_attitude_target_t packet; - packet.time_boot_ms = time_boot_ms; - packet.body_roll_rate = body_roll_rate; - packet.body_pitch_rate = body_pitch_rate; - packet.body_yaw_rate = body_yaw_rate; - packet.thrust = thrust; - packet.type_mask = type_mask; - mav_array_memcpy(packet.q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)attitude_target, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); #endif } @@ -217,33 +233,25 @@ static inline void mavlink_msg_attitude_target_send(mavlink_channel_t chan, uint static inline void mavlink_msg_attitude_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, type_mask); - _mav_put_float_array(buf, 4, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); -#endif -#else - mavlink_attitude_target_t *packet = (mavlink_attitude_target_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->body_roll_rate = body_roll_rate; - packet->body_pitch_rate = body_pitch_rate; - packet->body_yaw_rate = body_yaw_rate; - packet->thrust = thrust; - packet->type_mask = type_mask; - mav_array_memcpy(packet->q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, type_mask); + _mav_put_float_array(buf, 4, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); -#endif + mavlink_attitude_target_t *packet = (mavlink_attitude_target_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->body_roll_rate = body_roll_rate; + packet->body_pitch_rate = body_pitch_rate; + packet->body_yaw_rate = body_yaw_rate; + packet->thrust = thrust; + packet->type_mask = type_mask; + mav_array_memcpy(packet->q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC); #endif } #endif @@ -260,7 +268,7 @@ static inline void mavlink_msg_attitude_target_send_buf(mavlink_message_t *msgbu */ static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -270,7 +278,7 @@ static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlin */ static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 36); + return _MAV_RETURN_uint8_t(msg, 36); } /** @@ -280,7 +288,7 @@ static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_me */ static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t* msg, float *q) { - return _MAV_RETURN_float_array(msg, q, 4, 4); + return _MAV_RETURN_float_array(msg, q, 4, 4); } /** @@ -290,7 +298,7 @@ static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t */ static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -300,7 +308,7 @@ static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink */ static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -310,7 +318,7 @@ static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlin */ static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -320,7 +328,7 @@ static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_ */ static inline float mavlink_msg_attitude_target_get_thrust(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -331,15 +339,17 @@ static inline float mavlink_msg_attitude_target_get_thrust(const mavlink_message */ static inline void mavlink_msg_attitude_target_decode(const mavlink_message_t* msg, mavlink_attitude_target_t* attitude_target) { -#if MAVLINK_NEED_BYTE_SWAP - attitude_target->time_boot_ms = mavlink_msg_attitude_target_get_time_boot_ms(msg); - mavlink_msg_attitude_target_get_q(msg, attitude_target->q); - attitude_target->body_roll_rate = mavlink_msg_attitude_target_get_body_roll_rate(msg); - attitude_target->body_pitch_rate = mavlink_msg_attitude_target_get_body_pitch_rate(msg); - attitude_target->body_yaw_rate = mavlink_msg_attitude_target_get_body_yaw_rate(msg); - attitude_target->thrust = mavlink_msg_attitude_target_get_thrust(msg); - attitude_target->type_mask = mavlink_msg_attitude_target_get_type_mask(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + attitude_target->time_boot_ms = mavlink_msg_attitude_target_get_time_boot_ms(msg); + mavlink_msg_attitude_target_get_q(msg, attitude_target->q); + attitude_target->body_roll_rate = mavlink_msg_attitude_target_get_body_roll_rate(msg); + attitude_target->body_pitch_rate = mavlink_msg_attitude_target_get_body_pitch_rate(msg); + attitude_target->body_yaw_rate = mavlink_msg_attitude_target_get_body_yaw_rate(msg); + attitude_target->thrust = mavlink_msg_attitude_target_get_thrust(msg); + attitude_target->type_mask = mavlink_msg_attitude_target_get_type_mask(msg); #else - memcpy(attitude_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN; + memset(attitude_target, 0, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN); + memcpy(attitude_target, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_auth_key.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_auth_key.h index 1a2c82d..c561aad 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_auth_key.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_auth_key.h @@ -1,27 +1,39 @@ +#pragma once // MESSAGE AUTH_KEY PACKING #define MAVLINK_MSG_ID_AUTH_KEY 7 -typedef struct __mavlink_auth_key_t -{ +MAVPACKED( +typedef struct __mavlink_auth_key_t { char key[32]; /*< key*/ -} mavlink_auth_key_t; +}) mavlink_auth_key_t; #define MAVLINK_MSG_ID_AUTH_KEY_LEN 32 +#define MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN 32 #define MAVLINK_MSG_ID_7_LEN 32 +#define MAVLINK_MSG_ID_7_MIN_LEN 32 #define MAVLINK_MSG_ID_AUTH_KEY_CRC 119 #define MAVLINK_MSG_ID_7_CRC 119 #define MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN 32 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_AUTH_KEY { \ - "AUTH_KEY", \ - 1, \ - { { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \ + 7, \ + "AUTH_KEY", \ + 1, \ + { { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \ + "AUTH_KEY", \ + 1, \ + { { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \ + } \ +} +#endif /** * @brief Pack a auth_key message @@ -33,26 +45,22 @@ typedef struct __mavlink_auth_key_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const char *key) + const char *key) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; + char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; - _mav_put_char_array(buf, 0, key, 32); + _mav_put_char_array(buf, 0, key, 32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN); #else - mavlink_auth_key_t packet; + mavlink_auth_key_t packet; - mav_array_memcpy(packet.key, key, sizeof(char)*32); + mav_array_memcpy(packet.key, key, sizeof(char)*32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); } /** @@ -65,27 +73,23 @@ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const char *key) + mavlink_message_t* msg, + const char *key) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; + char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; - _mav_put_char_array(buf, 0, key, 32); + _mav_put_char_array(buf, 0, key, 32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN); #else - mavlink_auth_key_t packet; + mavlink_auth_key_t packet; - mav_array_memcpy(packet.key, key, sizeof(char)*32); + mav_array_memcpy(packet.key, key, sizeof(char)*32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); } /** @@ -98,7 +102,7 @@ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key) { - return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->key); + return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->key); } /** @@ -112,7 +116,7 @@ static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_auth_key_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key) { - return mavlink_msg_auth_key_pack_chan(system_id, component_id, chan, msg, auth_key->key); + return mavlink_msg_auth_key_pack_chan(system_id, component_id, chan, msg, auth_key->key); } /** @@ -126,23 +130,29 @@ static inline uint16_t mavlink_msg_auth_key_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; + char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN]; - _mav_put_char_array(buf, 0, key, 32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); + _mav_put_char_array(buf, 0, key, 32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN); + mavlink_auth_key_t packet; + + mav_array_memcpy(packet.key, key, sizeof(char)*32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); #endif -#else - mavlink_auth_key_t packet; +} - mav_array_memcpy(packet.key, key, sizeof(char)*32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); +/** + * @brief Send a auth_key message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_auth_key_send_struct(mavlink_channel_t chan, const mavlink_auth_key_t* auth_key) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_auth_key_send(chan, auth_key->key); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)auth_key, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); #endif } @@ -157,23 +167,15 @@ static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char static inline void mavlink_msg_auth_key_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *key) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; + char *buf = (char *)msgbuf; - _mav_put_char_array(buf, 0, key, 32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN); -#endif + _mav_put_char_array(buf, 0, key, 32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); #else - mavlink_auth_key_t *packet = (mavlink_auth_key_t *)msgbuf; + mavlink_auth_key_t *packet = (mavlink_auth_key_t *)msgbuf; - mav_array_memcpy(packet->key, key, sizeof(char)*32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_LEN); -#endif + mav_array_memcpy(packet->key, key, sizeof(char)*32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC); #endif } #endif @@ -190,7 +192,7 @@ static inline void mavlink_msg_auth_key_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key) { - return _MAV_RETURN_char_array(msg, key, 32, 0); + return _MAV_RETURN_char_array(msg, key, 32, 0); } /** @@ -201,9 +203,11 @@ static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg */ static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mavlink_auth_key_t* auth_key) { -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_auth_key_get_key(msg, auth_key->key); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_auth_key_get_key(msg, auth_key->key); #else - memcpy(auth_key, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_AUTH_KEY_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_AUTH_KEY_LEN? msg->len : MAVLINK_MSG_ID_AUTH_KEY_LEN; + memset(auth_key, 0, MAVLINK_MSG_ID_AUTH_KEY_LEN); + memcpy(auth_key, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_autopilot_version.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_autopilot_version.h index 214b14d..55e46ef 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_autopilot_version.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_autopilot_version.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE AUTOPILOT_VERSION PACKING #define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148 -typedef struct __mavlink_autopilot_version_t -{ +MAVPACKED( +typedef struct __mavlink_autopilot_version_t { uint64_t capabilities; /*< bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)*/ uint64_t uid; /*< UID if provided by hardware*/ uint32_t flight_sw_version; /*< Firmware version number*/ @@ -15,10 +16,12 @@ typedef struct __mavlink_autopilot_version_t uint8_t flight_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ uint8_t middleware_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ uint8_t os_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/ -} mavlink_autopilot_version_t; +}) mavlink_autopilot_version_t; #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 60 +#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60 #define MAVLINK_MSG_ID_148_LEN 60 +#define MAVLINK_MSG_ID_148_MIN_LEN 60 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178 #define MAVLINK_MSG_ID_148_CRC 178 @@ -27,10 +30,12 @@ typedef struct __mavlink_autopilot_version_t #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \ - "AUTOPILOT_VERSION", \ - 11, \ - { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \ + 148, \ + "AUTOPILOT_VERSION", \ + 11, \ + { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \ { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \ { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \ { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \ @@ -43,7 +48,24 @@ typedef struct __mavlink_autopilot_version_t { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \ + "AUTOPILOT_VERSION", \ + 11, \ + { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \ + { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \ + { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \ + { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \ + { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \ + { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \ + { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \ + { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \ + { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \ + { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \ + { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \ + } \ +} +#endif /** * @brief Pack a autopilot_version message @@ -65,44 +87,40 @@ typedef struct __mavlink_autopilot_version_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid) + uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN]; - _mav_put_uint64_t(buf, 0, capabilities); - _mav_put_uint64_t(buf, 8, uid); - _mav_put_uint32_t(buf, 16, flight_sw_version); - _mav_put_uint32_t(buf, 20, middleware_sw_version); - _mav_put_uint32_t(buf, 24, os_sw_version); - _mav_put_uint32_t(buf, 28, board_version); - _mav_put_uint16_t(buf, 32, vendor_id); - _mav_put_uint16_t(buf, 34, product_id); - _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); - _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); - _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); + char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN]; + _mav_put_uint64_t(buf, 0, capabilities); + _mav_put_uint64_t(buf, 8, uid); + _mav_put_uint32_t(buf, 16, flight_sw_version); + _mav_put_uint32_t(buf, 20, middleware_sw_version); + _mav_put_uint32_t(buf, 24, os_sw_version); + _mav_put_uint32_t(buf, 28, board_version); + _mav_put_uint16_t(buf, 32, vendor_id); + _mav_put_uint16_t(buf, 34, product_id); + _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); + _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); + _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); #else - mavlink_autopilot_version_t packet; - packet.capabilities = capabilities; - packet.uid = uid; - packet.flight_sw_version = flight_sw_version; - packet.middleware_sw_version = middleware_sw_version; - packet.os_sw_version = os_sw_version; - packet.board_version = board_version; - packet.vendor_id = vendor_id; - packet.product_id = product_id; - mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8); + mavlink_autopilot_version_t packet; + packet.capabilities = capabilities; + packet.uid = uid; + packet.flight_sw_version = flight_sw_version; + packet.middleware_sw_version = middleware_sw_version; + packet.os_sw_version = os_sw_version; + packet.board_version = board_version; + packet.vendor_id = vendor_id; + packet.product_id = product_id; + mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); } /** @@ -125,45 +143,41 @@ static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t capabilities,uint32_t flight_sw_version,uint32_t middleware_sw_version,uint32_t os_sw_version,uint32_t board_version,const uint8_t *flight_custom_version,const uint8_t *middleware_custom_version,const uint8_t *os_custom_version,uint16_t vendor_id,uint16_t product_id,uint64_t uid) + mavlink_message_t* msg, + uint64_t capabilities,uint32_t flight_sw_version,uint32_t middleware_sw_version,uint32_t os_sw_version,uint32_t board_version,const uint8_t *flight_custom_version,const uint8_t *middleware_custom_version,const uint8_t *os_custom_version,uint16_t vendor_id,uint16_t product_id,uint64_t uid) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN]; - _mav_put_uint64_t(buf, 0, capabilities); - _mav_put_uint64_t(buf, 8, uid); - _mav_put_uint32_t(buf, 16, flight_sw_version); - _mav_put_uint32_t(buf, 20, middleware_sw_version); - _mav_put_uint32_t(buf, 24, os_sw_version); - _mav_put_uint32_t(buf, 28, board_version); - _mav_put_uint16_t(buf, 32, vendor_id); - _mav_put_uint16_t(buf, 34, product_id); - _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); - _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); - _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); + char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN]; + _mav_put_uint64_t(buf, 0, capabilities); + _mav_put_uint64_t(buf, 8, uid); + _mav_put_uint32_t(buf, 16, flight_sw_version); + _mav_put_uint32_t(buf, 20, middleware_sw_version); + _mav_put_uint32_t(buf, 24, os_sw_version); + _mav_put_uint32_t(buf, 28, board_version); + _mav_put_uint16_t(buf, 32, vendor_id); + _mav_put_uint16_t(buf, 34, product_id); + _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); + _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); + _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); #else - mavlink_autopilot_version_t packet; - packet.capabilities = capabilities; - packet.uid = uid; - packet.flight_sw_version = flight_sw_version; - packet.middleware_sw_version = middleware_sw_version; - packet.os_sw_version = os_sw_version; - packet.board_version = board_version; - packet.vendor_id = vendor_id; - packet.product_id = product_id; - mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8); + mavlink_autopilot_version_t packet; + packet.capabilities = capabilities; + packet.uid = uid; + packet.flight_sw_version = flight_sw_version; + packet.middleware_sw_version = middleware_sw_version; + packet.os_sw_version = os_sw_version; + packet.board_version = board_version; + packet.vendor_id = vendor_id; + packet.product_id = product_id; + mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); } /** @@ -176,7 +190,7 @@ static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id */ static inline uint16_t mavlink_msg_autopilot_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version) { - return mavlink_msg_autopilot_version_pack(system_id, component_id, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid); + return mavlink_msg_autopilot_version_pack(system_id, component_id, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid); } /** @@ -190,7 +204,7 @@ static inline uint16_t mavlink_msg_autopilot_version_encode(uint8_t system_id, u */ static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version) { - return mavlink_msg_autopilot_version_pack_chan(system_id, component_id, chan, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid); + return mavlink_msg_autopilot_version_pack_chan(system_id, component_id, chan, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid); } /** @@ -214,41 +228,47 @@ static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_ static inline void mavlink_msg_autopilot_version_send(mavlink_channel_t chan, uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN]; - _mav_put_uint64_t(buf, 0, capabilities); - _mav_put_uint64_t(buf, 8, uid); - _mav_put_uint32_t(buf, 16, flight_sw_version); - _mav_put_uint32_t(buf, 20, middleware_sw_version); - _mav_put_uint32_t(buf, 24, os_sw_version); - _mav_put_uint32_t(buf, 28, board_version); - _mav_put_uint16_t(buf, 32, vendor_id); - _mav_put_uint16_t(buf, 34, product_id); - _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); - _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); - _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); + char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN]; + _mav_put_uint64_t(buf, 0, capabilities); + _mav_put_uint64_t(buf, 8, uid); + _mav_put_uint32_t(buf, 16, flight_sw_version); + _mav_put_uint32_t(buf, 20, middleware_sw_version); + _mav_put_uint32_t(buf, 24, os_sw_version); + _mav_put_uint32_t(buf, 28, board_version); + _mav_put_uint16_t(buf, 32, vendor_id); + _mav_put_uint16_t(buf, 34, product_id); + _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); + _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); + _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); + mavlink_autopilot_version_t packet; + packet.capabilities = capabilities; + packet.uid = uid; + packet.flight_sw_version = flight_sw_version; + packet.middleware_sw_version = middleware_sw_version; + packet.os_sw_version = os_sw_version; + packet.board_version = board_version; + packet.vendor_id = vendor_id; + packet.product_id = product_id; + mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); #endif +} + +/** + * @brief Send a autopilot_version message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_autopilot_version_send_struct(mavlink_channel_t chan, const mavlink_autopilot_version_t* autopilot_version) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_autopilot_version_send(chan, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid); #else - mavlink_autopilot_version_t packet; - packet.capabilities = capabilities; - packet.uid = uid; - packet.flight_sw_version = flight_sw_version; - packet.middleware_sw_version = middleware_sw_version; - packet.os_sw_version = os_sw_version; - packet.board_version = board_version; - packet.vendor_id = vendor_id; - packet.product_id = product_id; - mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)autopilot_version, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); #endif } @@ -263,41 +283,33 @@ static inline void mavlink_msg_autopilot_version_send(mavlink_channel_t chan, ui static inline void mavlink_msg_autopilot_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, capabilities); - _mav_put_uint64_t(buf, 8, uid); - _mav_put_uint32_t(buf, 16, flight_sw_version); - _mav_put_uint32_t(buf, 20, middleware_sw_version); - _mav_put_uint32_t(buf, 24, os_sw_version); - _mav_put_uint32_t(buf, 28, board_version); - _mav_put_uint16_t(buf, 32, vendor_id); - _mav_put_uint16_t(buf, 34, product_id); - _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); - _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); - _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, capabilities); + _mav_put_uint64_t(buf, 8, uid); + _mav_put_uint32_t(buf, 16, flight_sw_version); + _mav_put_uint32_t(buf, 20, middleware_sw_version); + _mav_put_uint32_t(buf, 24, os_sw_version); + _mav_put_uint32_t(buf, 28, board_version); + _mav_put_uint16_t(buf, 32, vendor_id); + _mav_put_uint16_t(buf, 34, product_id); + _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8); + _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8); + _mav_put_uint8_t_array(buf, 52, os_custom_version, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); -#endif -#else - mavlink_autopilot_version_t *packet = (mavlink_autopilot_version_t *)msgbuf; - packet->capabilities = capabilities; - packet->uid = uid; - packet->flight_sw_version = flight_sw_version; - packet->middleware_sw_version = middleware_sw_version; - packet->os_sw_version = os_sw_version; - packet->board_version = board_version; - packet->vendor_id = vendor_id; - packet->product_id = product_id; - mav_array_memcpy(packet->flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet->middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet->os_custom_version, os_custom_version, sizeof(uint8_t)*8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); -#endif + mavlink_autopilot_version_t *packet = (mavlink_autopilot_version_t *)msgbuf; + packet->capabilities = capabilities; + packet->uid = uid; + packet->flight_sw_version = flight_sw_version; + packet->middleware_sw_version = middleware_sw_version; + packet->os_sw_version = os_sw_version; + packet->board_version = board_version; + packet->vendor_id = vendor_id; + packet->product_id = product_id; + mav_array_memcpy(packet->flight_custom_version, flight_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet->middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet->os_custom_version, os_custom_version, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC); #endif } #endif @@ -314,7 +326,7 @@ static inline void mavlink_msg_autopilot_version_send_buf(mavlink_message_t *msg */ static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -324,7 +336,7 @@ static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavl */ static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 16); + return _MAV_RETURN_uint32_t(msg, 16); } /** @@ -334,7 +346,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const */ static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 20); + return _MAV_RETURN_uint32_t(msg, 20); } /** @@ -344,7 +356,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(c */ static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 24); + return _MAV_RETURN_uint32_t(msg, 24); } /** @@ -354,7 +366,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mav */ static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 28); + return _MAV_RETURN_uint32_t(msg, 28); } /** @@ -364,7 +376,7 @@ static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mav */ static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t* msg, uint8_t *flight_custom_version) { - return _MAV_RETURN_uint8_t_array(msg, flight_custom_version, 8, 36); + return _MAV_RETURN_uint8_t_array(msg, flight_custom_version, 8, 36); } /** @@ -374,7 +386,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(c */ static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t* msg, uint8_t *middleware_custom_version) { - return _MAV_RETURN_uint8_t_array(msg, middleware_custom_version, 8, 44); + return _MAV_RETURN_uint8_t_array(msg, middleware_custom_version, 8, 44); } /** @@ -384,7 +396,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_versi */ static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t* msg, uint8_t *os_custom_version) { - return _MAV_RETURN_uint8_t_array(msg, os_custom_version, 8, 52); + return _MAV_RETURN_uint8_t_array(msg, os_custom_version, 8, 52); } /** @@ -394,7 +406,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const */ static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 32); + return _MAV_RETURN_uint16_t(msg, 32); } /** @@ -404,7 +416,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink */ static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 34); + return _MAV_RETURN_uint16_t(msg, 34); } /** @@ -414,7 +426,7 @@ static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlin */ static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 8); + return _MAV_RETURN_uint64_t(msg, 8); } /** @@ -425,19 +437,21 @@ static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_messa */ static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t* msg, mavlink_autopilot_version_t* autopilot_version) { -#if MAVLINK_NEED_BYTE_SWAP - autopilot_version->capabilities = mavlink_msg_autopilot_version_get_capabilities(msg); - autopilot_version->uid = mavlink_msg_autopilot_version_get_uid(msg); - autopilot_version->flight_sw_version = mavlink_msg_autopilot_version_get_flight_sw_version(msg); - autopilot_version->middleware_sw_version = mavlink_msg_autopilot_version_get_middleware_sw_version(msg); - autopilot_version->os_sw_version = mavlink_msg_autopilot_version_get_os_sw_version(msg); - autopilot_version->board_version = mavlink_msg_autopilot_version_get_board_version(msg); - autopilot_version->vendor_id = mavlink_msg_autopilot_version_get_vendor_id(msg); - autopilot_version->product_id = mavlink_msg_autopilot_version_get_product_id(msg); - mavlink_msg_autopilot_version_get_flight_custom_version(msg, autopilot_version->flight_custom_version); - mavlink_msg_autopilot_version_get_middleware_custom_version(msg, autopilot_version->middleware_custom_version); - mavlink_msg_autopilot_version_get_os_custom_version(msg, autopilot_version->os_custom_version); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + autopilot_version->capabilities = mavlink_msg_autopilot_version_get_capabilities(msg); + autopilot_version->uid = mavlink_msg_autopilot_version_get_uid(msg); + autopilot_version->flight_sw_version = mavlink_msg_autopilot_version_get_flight_sw_version(msg); + autopilot_version->middleware_sw_version = mavlink_msg_autopilot_version_get_middleware_sw_version(msg); + autopilot_version->os_sw_version = mavlink_msg_autopilot_version_get_os_sw_version(msg); + autopilot_version->board_version = mavlink_msg_autopilot_version_get_board_version(msg); + autopilot_version->vendor_id = mavlink_msg_autopilot_version_get_vendor_id(msg); + autopilot_version->product_id = mavlink_msg_autopilot_version_get_product_id(msg); + mavlink_msg_autopilot_version_get_flight_custom_version(msg, autopilot_version->flight_custom_version); + mavlink_msg_autopilot_version_get_middleware_custom_version(msg, autopilot_version->middleware_custom_version); + mavlink_msg_autopilot_version_get_os_custom_version(msg, autopilot_version->os_custom_version); #else - memcpy(autopilot_version, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN? msg->len : MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN; + memset(autopilot_version, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN); + memcpy(autopilot_version, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_battery_status.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_battery_status.h index 2a8f23a..793cd49 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_battery_status.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_battery_status.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE BATTERY_STATUS PACKING #define MAVLINK_MSG_ID_BATTERY_STATUS 147 -typedef struct __mavlink_battery_status_t -{ +MAVPACKED( +typedef struct __mavlink_battery_status_t { int32_t current_consumed; /*< Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate*/ int32_t energy_consumed; /*< Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate*/ int16_t temperature; /*< Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.*/ @@ -13,20 +14,24 @@ typedef struct __mavlink_battery_status_t uint8_t battery_function; /*< Function of the battery*/ uint8_t type; /*< Type (chemistry) of the battery*/ int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery*/ -} mavlink_battery_status_t; +}) mavlink_battery_status_t; #define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 36 +#define MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN 36 #define MAVLINK_MSG_ID_147_LEN 36 +#define MAVLINK_MSG_ID_147_MIN_LEN 36 #define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 154 #define MAVLINK_MSG_ID_147_CRC 154 #define MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN 10 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \ - "BATTERY_STATUS", \ - 9, \ - { { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ + 147, \ + "BATTERY_STATUS", \ + 9, \ + { { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \ { "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \ @@ -37,7 +42,22 @@ typedef struct __mavlink_battery_status_t { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \ + "BATTERY_STATUS", \ + 9, \ + { { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ + { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \ + { "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \ + { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \ + { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \ + { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \ + { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \ + } \ +} +#endif /** * @brief Pack a battery_status message @@ -57,40 +77,36 @@ typedef struct __mavlink_battery_status_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining) + uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; - _mav_put_int32_t(buf, 0, current_consumed); - _mav_put_int32_t(buf, 4, energy_consumed); - _mav_put_int16_t(buf, 8, temperature); - _mav_put_int16_t(buf, 30, current_battery); - _mav_put_uint8_t(buf, 32, id); - _mav_put_uint8_t(buf, 33, battery_function); - _mav_put_uint8_t(buf, 34, type); - _mav_put_int8_t(buf, 35, battery_remaining); - _mav_put_uint16_t_array(buf, 10, voltages, 10); + char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; + _mav_put_int32_t(buf, 0, current_consumed); + _mav_put_int32_t(buf, 4, energy_consumed); + _mav_put_int16_t(buf, 8, temperature); + _mav_put_int16_t(buf, 30, current_battery); + _mav_put_uint8_t(buf, 32, id); + _mav_put_uint8_t(buf, 33, battery_function); + _mav_put_uint8_t(buf, 34, type); + _mav_put_int8_t(buf, 35, battery_remaining); + _mav_put_uint16_t_array(buf, 10, voltages, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #else - mavlink_battery_status_t packet; - packet.current_consumed = current_consumed; - packet.energy_consumed = energy_consumed; - packet.temperature = temperature; - packet.current_battery = current_battery; - packet.id = id; - packet.battery_function = battery_function; - packet.type = type; - packet.battery_remaining = battery_remaining; - mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10); + mavlink_battery_status_t packet; + packet.current_consumed = current_consumed; + packet.energy_consumed = energy_consumed; + packet.temperature = temperature; + packet.current_battery = current_battery; + packet.id = id; + packet.battery_function = battery_function; + packet.type = type; + packet.battery_remaining = battery_remaining; + mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); } /** @@ -111,41 +127,37 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_ * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t id,uint8_t battery_function,uint8_t type,int16_t temperature,const uint16_t *voltages,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining) + mavlink_message_t* msg, + uint8_t id,uint8_t battery_function,uint8_t type,int16_t temperature,const uint16_t *voltages,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; - _mav_put_int32_t(buf, 0, current_consumed); - _mav_put_int32_t(buf, 4, energy_consumed); - _mav_put_int16_t(buf, 8, temperature); - _mav_put_int16_t(buf, 30, current_battery); - _mav_put_uint8_t(buf, 32, id); - _mav_put_uint8_t(buf, 33, battery_function); - _mav_put_uint8_t(buf, 34, type); - _mav_put_int8_t(buf, 35, battery_remaining); - _mav_put_uint16_t_array(buf, 10, voltages, 10); + char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; + _mav_put_int32_t(buf, 0, current_consumed); + _mav_put_int32_t(buf, 4, energy_consumed); + _mav_put_int16_t(buf, 8, temperature); + _mav_put_int16_t(buf, 30, current_battery); + _mav_put_uint8_t(buf, 32, id); + _mav_put_uint8_t(buf, 33, battery_function); + _mav_put_uint8_t(buf, 34, type); + _mav_put_int8_t(buf, 35, battery_remaining); + _mav_put_uint16_t_array(buf, 10, voltages, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #else - mavlink_battery_status_t packet; - packet.current_consumed = current_consumed; - packet.energy_consumed = energy_consumed; - packet.temperature = temperature; - packet.current_battery = current_battery; - packet.id = id; - packet.battery_function = battery_function; - packet.type = type; - packet.battery_remaining = battery_remaining; - mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10); + mavlink_battery_status_t packet; + packet.current_consumed = current_consumed; + packet.energy_consumed = energy_consumed; + packet.temperature = temperature; + packet.current_battery = current_battery; + packet.id = id; + packet.battery_function = battery_function; + packet.type = type; + packet.battery_remaining = battery_remaining; + mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); } /** @@ -158,7 +170,7 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u */ static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status) { - return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining); + return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining); } /** @@ -172,7 +184,7 @@ static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status) { - return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining); + return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining); } /** @@ -194,37 +206,43 @@ static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; - _mav_put_int32_t(buf, 0, current_consumed); - _mav_put_int32_t(buf, 4, energy_consumed); - _mav_put_int16_t(buf, 8, temperature); - _mav_put_int16_t(buf, 30, current_battery); - _mav_put_uint8_t(buf, 32, id); - _mav_put_uint8_t(buf, 33, battery_function); - _mav_put_uint8_t(buf, 34, type); - _mav_put_int8_t(buf, 35, battery_remaining); - _mav_put_uint16_t_array(buf, 10, voltages, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); + char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN]; + _mav_put_int32_t(buf, 0, current_consumed); + _mav_put_int32_t(buf, 4, energy_consumed); + _mav_put_int16_t(buf, 8, temperature); + _mav_put_int16_t(buf, 30, current_battery); + _mav_put_uint8_t(buf, 32, id); + _mav_put_uint8_t(buf, 33, battery_function); + _mav_put_uint8_t(buf, 34, type); + _mav_put_int8_t(buf, 35, battery_remaining); + _mav_put_uint16_t_array(buf, 10, voltages, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); + mavlink_battery_status_t packet; + packet.current_consumed = current_consumed; + packet.energy_consumed = energy_consumed; + packet.temperature = temperature; + packet.current_battery = current_battery; + packet.id = id; + packet.battery_function = battery_function; + packet.type = type; + packet.battery_remaining = battery_remaining; + mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); #endif +} + +/** + * @brief Send a battery_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_battery_status_send_struct(mavlink_channel_t chan, const mavlink_battery_status_t* battery_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_battery_status_send(chan, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining); #else - mavlink_battery_status_t packet; - packet.current_consumed = current_consumed; - packet.energy_consumed = energy_consumed; - packet.temperature = temperature; - packet.current_battery = current_battery; - packet.id = id; - packet.battery_function = battery_function; - packet.type = type; - packet.battery_remaining = battery_remaining; - mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)battery_status, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); #endif } @@ -239,37 +257,29 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8 static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, current_consumed); - _mav_put_int32_t(buf, 4, energy_consumed); - _mav_put_int16_t(buf, 8, temperature); - _mav_put_int16_t(buf, 30, current_battery); - _mav_put_uint8_t(buf, 32, id); - _mav_put_uint8_t(buf, 33, battery_function); - _mav_put_uint8_t(buf, 34, type); - _mav_put_int8_t(buf, 35, battery_remaining); - _mav_put_uint16_t_array(buf, 10, voltages, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); -#endif -#else - mavlink_battery_status_t *packet = (mavlink_battery_status_t *)msgbuf; - packet->current_consumed = current_consumed; - packet->energy_consumed = energy_consumed; - packet->temperature = temperature; - packet->current_battery = current_battery; - packet->id = id; - packet->battery_function = battery_function; - packet->type = type; - packet->battery_remaining = battery_remaining; - mav_array_memcpy(packet->voltages, voltages, sizeof(uint16_t)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, current_consumed); + _mav_put_int32_t(buf, 4, energy_consumed); + _mav_put_int16_t(buf, 8, temperature); + _mav_put_int16_t(buf, 30, current_battery); + _mav_put_uint8_t(buf, 32, id); + _mav_put_uint8_t(buf, 33, battery_function); + _mav_put_uint8_t(buf, 34, type); + _mav_put_int8_t(buf, 35, battery_remaining); + _mav_put_uint16_t_array(buf, 10, voltages, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); -#endif + mavlink_battery_status_t *packet = (mavlink_battery_status_t *)msgbuf; + packet->current_consumed = current_consumed; + packet->energy_consumed = energy_consumed; + packet->temperature = temperature; + packet->current_battery = current_battery; + packet->id = id; + packet->battery_function = battery_function; + packet->type = type; + packet->battery_remaining = battery_remaining; + mav_array_memcpy(packet->voltages, voltages, sizeof(uint16_t)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC); #endif } #endif @@ -286,7 +296,7 @@ static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf */ static inline uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -296,7 +306,7 @@ static inline uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t* */ static inline uint8_t mavlink_msg_battery_status_get_battery_function(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 33); + return _MAV_RETURN_uint8_t(msg, 33); } /** @@ -306,7 +316,7 @@ static inline uint8_t mavlink_msg_battery_status_get_battery_function(const mavl */ static inline uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -316,7 +326,7 @@ static inline uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_ */ static inline int16_t mavlink_msg_battery_status_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 8); + return _MAV_RETURN_int16_t(msg, 8); } /** @@ -326,7 +336,7 @@ static inline int16_t mavlink_msg_battery_status_get_temperature(const mavlink_m */ static inline uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_message_t* msg, uint16_t *voltages) { - return _MAV_RETURN_uint16_t_array(msg, voltages, 10, 10); + return _MAV_RETURN_uint16_t_array(msg, voltages, 10, 10); } /** @@ -336,7 +346,7 @@ static inline uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_mes */ static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 30); + return _MAV_RETURN_int16_t(msg, 30); } /** @@ -346,7 +356,7 @@ static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavli */ static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -356,7 +366,7 @@ static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavl */ static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -366,7 +376,7 @@ static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavli */ static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t* msg) { - return _MAV_RETURN_int8_t(msg, 35); + return _MAV_RETURN_int8_t(msg, 35); } /** @@ -377,17 +387,19 @@ static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavl */ static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* msg, mavlink_battery_status_t* battery_status) { -#if MAVLINK_NEED_BYTE_SWAP - battery_status->current_consumed = mavlink_msg_battery_status_get_current_consumed(msg); - battery_status->energy_consumed = mavlink_msg_battery_status_get_energy_consumed(msg); - battery_status->temperature = mavlink_msg_battery_status_get_temperature(msg); - mavlink_msg_battery_status_get_voltages(msg, battery_status->voltages); - battery_status->current_battery = mavlink_msg_battery_status_get_current_battery(msg); - battery_status->id = mavlink_msg_battery_status_get_id(msg); - battery_status->battery_function = mavlink_msg_battery_status_get_battery_function(msg); - battery_status->type = mavlink_msg_battery_status_get_type(msg); - battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + battery_status->current_consumed = mavlink_msg_battery_status_get_current_consumed(msg); + battery_status->energy_consumed = mavlink_msg_battery_status_get_energy_consumed(msg); + battery_status->temperature = mavlink_msg_battery_status_get_temperature(msg); + mavlink_msg_battery_status_get_voltages(msg, battery_status->voltages); + battery_status->current_battery = mavlink_msg_battery_status_get_current_battery(msg); + battery_status->id = mavlink_msg_battery_status_get_id(msg); + battery_status->battery_function = mavlink_msg_battery_status_get_battery_function(msg); + battery_status->type = mavlink_msg_battery_status_get_type(msg); + battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg); #else - memcpy(battery_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_BATTERY_STATUS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_BATTERY_STATUS_LEN? msg->len : MAVLINK_MSG_ID_BATTERY_STATUS_LEN; + memset(battery_status, 0, MAVLINK_MSG_ID_BATTERY_STATUS_LEN); + memcpy(battery_status, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_camera_trigger.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_camera_trigger.h index c771e70..93664bd 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_camera_trigger.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_camera_trigger.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE CAMERA_TRIGGER PACKING #define MAVLINK_MSG_ID_CAMERA_TRIGGER 112 -typedef struct __mavlink_camera_trigger_t -{ +MAVPACKED( +typedef struct __mavlink_camera_trigger_t { uint64_t time_usec; /*< Timestamp for the image frame in microseconds*/ uint32_t seq; /*< Image frame sequence*/ -} mavlink_camera_trigger_t; +}) mavlink_camera_trigger_t; #define MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN 12 +#define MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN 12 #define MAVLINK_MSG_ID_112_LEN 12 +#define MAVLINK_MSG_ID_112_MIN_LEN 12 #define MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC 174 #define MAVLINK_MSG_ID_112_CRC 174 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \ - "CAMERA_TRIGGER", \ - 2, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \ + 112, \ + "CAMERA_TRIGGER", \ + 2, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \ { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \ + "CAMERA_TRIGGER", \ + 2, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \ + } \ +} +#endif /** * @brief Pack a camera_trigger message @@ -36,28 +49,24 @@ typedef struct __mavlink_camera_trigger_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint32_t seq) + uint64_t time_usec, uint32_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); + char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); #else - mavlink_camera_trigger_t packet; - packet.time_usec = time_usec; - packet.seq = seq; + mavlink_camera_trigger_t packet; + packet.time_usec = time_usec; + packet.seq = seq; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_ * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_camera_trigger_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint32_t seq) + mavlink_message_t* msg, + uint64_t time_usec,uint32_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); + char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); #else - mavlink_camera_trigger_t packet; - packet.time_usec = time_usec; - packet.seq = seq; + mavlink_camera_trigger_t packet; + packet.time_usec = time_usec; + packet.seq = seq; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_camera_trigger_pack_chan(uint8_t system_id, u */ static inline uint16_t mavlink_msg_camera_trigger_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger) { - return mavlink_msg_camera_trigger_pack(system_id, component_id, msg, camera_trigger->time_usec, camera_trigger->seq); + return mavlink_msg_camera_trigger_pack(system_id, component_id, msg, camera_trigger->time_usec, camera_trigger->seq); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_camera_trigger_encode(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger) { - return mavlink_msg_camera_trigger_pack_chan(system_id, component_id, chan, msg, camera_trigger->time_usec, camera_trigger->seq); + return mavlink_msg_camera_trigger_pack_chan(system_id, component_id, chan, msg, camera_trigger->time_usec, camera_trigger->seq); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id, static inline void mavlink_msg_camera_trigger_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); + char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); + mavlink_camera_trigger_t packet; + packet.time_usec = time_usec; + packet.seq = seq; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); #endif -#else - mavlink_camera_trigger_t packet; - packet.time_usec = time_usec; - packet.seq = seq; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); +/** + * @brief Send a camera_trigger message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_camera_trigger_send_struct(mavlink_channel_t chan, const mavlink_camera_trigger_t* camera_trigger) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_camera_trigger_send(chan, camera_trigger->time_usec, camera_trigger->seq); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)camera_trigger, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_camera_trigger_send(mavlink_channel_t chan, uint6 static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint32_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); #else - mavlink_camera_trigger_t *packet = (mavlink_camera_trigger_t *)msgbuf; - packet->time_usec = time_usec; - packet->seq = seq; + mavlink_camera_trigger_t *packet = (mavlink_camera_trigger_t *)msgbuf; + packet->time_usec = time_usec; + packet->seq = seq; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t *msgbuf */ static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_me */ static inline uint32_t mavlink_msg_camera_trigger_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -224,10 +227,12 @@ static inline uint32_t mavlink_msg_camera_trigger_get_seq(const mavlink_message_ */ static inline void mavlink_msg_camera_trigger_decode(const mavlink_message_t* msg, mavlink_camera_trigger_t* camera_trigger) { -#if MAVLINK_NEED_BYTE_SWAP - camera_trigger->time_usec = mavlink_msg_camera_trigger_get_time_usec(msg); - camera_trigger->seq = mavlink_msg_camera_trigger_get_seq(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + camera_trigger->time_usec = mavlink_msg_camera_trigger_get_time_usec(msg); + camera_trigger->seq = mavlink_msg_camera_trigger_get_seq(msg); #else - memcpy(camera_trigger, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN; + memset(camera_trigger, 0, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN); + memcpy(camera_trigger, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control.h index 3603e4e..1fdadde 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE CHANGE_OPERATOR_CONTROL PACKING #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL 5 -typedef struct __mavlink_change_operator_control_t -{ +MAVPACKED( +typedef struct __mavlink_change_operator_control_t { uint8_t target_system; /*< System the GCS requests control for*/ uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/ uint8_t version; /*< 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.*/ char passkey[25]; /*< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"*/ -} mavlink_change_operator_control_t; +}) mavlink_change_operator_control_t; #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28 +#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN 28 #define MAVLINK_MSG_ID_5_LEN 28 +#define MAVLINK_MSG_ID_5_MIN_LEN 28 #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC 217 #define MAVLINK_MSG_ID_5_CRC 217 #define MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_PASSKEY_LEN 25 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \ - "CHANGE_OPERATOR_CONTROL", \ - 4, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \ + 5, \ + "CHANGE_OPERATOR_CONTROL", \ + 4, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \ { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \ { "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \ { "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \ + "CHANGE_OPERATOR_CONTROL", \ + 4, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \ + { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \ + { "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \ + { "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \ + } \ +} +#endif /** * @brief Pack a change_operator_control message @@ -42,30 +57,26 @@ typedef struct __mavlink_change_operator_control_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) + uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, version); - _mav_put_char_array(buf, 3, passkey, 25); + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, version); + _mav_put_char_array(buf, 3, passkey, 25); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #else - mavlink_change_operator_control_t packet; - packet.target_system = target_system; - packet.control_request = control_request; - packet.version = version; - mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); + mavlink_change_operator_control_t packet; + packet.target_system = target_system; + packet.control_request = control_request; + packet.version = version; + mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); } /** @@ -81,31 +92,27 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey) + mavlink_message_t* msg, + uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, version); - _mav_put_char_array(buf, 3, passkey, 25); + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, version); + _mav_put_char_array(buf, 3, passkey, 25); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #else - mavlink_change_operator_control_t packet; - packet.target_system = target_system; - packet.control_request = control_request; - packet.version = version; - mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); + mavlink_change_operator_control_t packet; + packet.target_system = target_system; + packet.control_request = control_request; + packet.version = version; + mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); } /** @@ -118,7 +125,7 @@ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t sys */ static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control) { - return mavlink_msg_change_operator_control_pack(system_id, component_id, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey); + return mavlink_msg_change_operator_control_pack(system_id, component_id, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey); } /** @@ -132,7 +139,7 @@ static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system */ static inline uint16_t mavlink_msg_change_operator_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control) { - return mavlink_msg_change_operator_control_pack_chan(system_id, component_id, chan, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey); + return mavlink_msg_change_operator_control_pack_chan(system_id, component_id, chan, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey); } /** @@ -149,27 +156,33 @@ static inline uint16_t mavlink_msg_change_operator_control_encode_chan(uint8_t s static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, version); - _mav_put_char_array(buf, 3, passkey, 25); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, version); + _mav_put_char_array(buf, 3, passkey, 25); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); + mavlink_change_operator_control_t packet; + packet.target_system = target_system; + packet.control_request = control_request; + packet.version = version; + mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); #endif +} + +/** + * @brief Send a change_operator_control message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_change_operator_control_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_t* change_operator_control) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_change_operator_control_send(chan, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey); #else - mavlink_change_operator_control_t packet; - packet.target_system = target_system; - packet.control_request = control_request; - packet.version = version; - mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)change_operator_control, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); #endif } @@ -184,27 +197,19 @@ static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t ch static inline void mavlink_msg_change_operator_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, version); - _mav_put_char_array(buf, 3, passkey, 25); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, version); + _mav_put_char_array(buf, 3, passkey, 25); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); -#endif -#else - mavlink_change_operator_control_t *packet = (mavlink_change_operator_control_t *)msgbuf; - packet->target_system = target_system; - packet->control_request = control_request; - packet->version = version; - mav_array_memcpy(packet->passkey, passkey, sizeof(char)*25); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); -#endif + mavlink_change_operator_control_t *packet = (mavlink_change_operator_control_t *)msgbuf; + packet->target_system = target_system; + packet->control_request = control_request; + packet->version = version; + mav_array_memcpy(packet->passkey, passkey, sizeof(char)*25); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC); #endif } #endif @@ -221,7 +226,7 @@ static inline void mavlink_msg_change_operator_control_send_buf(mavlink_message_ */ static inline uint8_t mavlink_msg_change_operator_control_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -231,7 +236,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_target_system(cons */ static inline uint8_t mavlink_msg_change_operator_control_get_control_request(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -241,7 +246,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_control_request(co */ static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -251,7 +256,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavl */ static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mavlink_message_t* msg, char *passkey) { - return _MAV_RETURN_char_array(msg, passkey, 25, 3); + return _MAV_RETURN_char_array(msg, passkey, 25, 3); } /** @@ -262,12 +267,14 @@ static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mav */ static inline void mavlink_msg_change_operator_control_decode(const mavlink_message_t* msg, mavlink_change_operator_control_t* change_operator_control) { -#if MAVLINK_NEED_BYTE_SWAP - change_operator_control->target_system = mavlink_msg_change_operator_control_get_target_system(msg); - change_operator_control->control_request = mavlink_msg_change_operator_control_get_control_request(msg); - change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg); - mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + change_operator_control->target_system = mavlink_msg_change_operator_control_get_target_system(msg); + change_operator_control->control_request = mavlink_msg_change_operator_control_get_control_request(msg); + change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg); + mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey); #else - memcpy(change_operator_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN; + memset(change_operator_control, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN); + memcpy(change_operator_control, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control_ack.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control_ack.h index 942555f..ba5f4e6 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control_ack.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_change_operator_control_ack.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE CHANGE_OPERATOR_CONTROL_ACK PACKING #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK 6 -typedef struct __mavlink_change_operator_control_ack_t -{ +MAVPACKED( +typedef struct __mavlink_change_operator_control_ack_t { uint8_t gcs_system_id; /*< ID of the GCS this message */ uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/ uint8_t ack; /*< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control*/ -} mavlink_change_operator_control_ack_t; +}) mavlink_change_operator_control_ack_t; #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3 +#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN 3 #define MAVLINK_MSG_ID_6_LEN 3 +#define MAVLINK_MSG_ID_6_MIN_LEN 3 #define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC 104 #define MAVLINK_MSG_ID_6_CRC 104 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \ - "CHANGE_OPERATOR_CONTROL_ACK", \ - 3, \ - { { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \ + 6, \ + "CHANGE_OPERATOR_CONTROL_ACK", \ + 3, \ + { { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \ { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \ { "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \ + "CHANGE_OPERATOR_CONTROL_ACK", \ + 3, \ + { { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \ + { "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \ + { "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \ + } \ +} +#endif /** * @brief Pack a change_operator_control_ack message @@ -39,30 +53,26 @@ typedef struct __mavlink_change_operator_control_ack_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) + uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; - _mav_put_uint8_t(buf, 0, gcs_system_id); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, ack); + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; + _mav_put_uint8_t(buf, 0, gcs_system_id); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, ack); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #else - mavlink_change_operator_control_ack_t packet; - packet.gcs_system_id = gcs_system_id; - packet.control_request = control_request; - packet.ack = ack; + mavlink_change_operator_control_ack_t packet; + packet.gcs_system_id = gcs_system_id; + packet.control_request = control_request; + packet.ack = ack; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t syst * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t gcs_system_id,uint8_t control_request,uint8_t ack) + mavlink_message_t* msg, + uint8_t gcs_system_id,uint8_t control_request,uint8_t ack) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; - _mav_put_uint8_t(buf, 0, gcs_system_id); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, ack); + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; + _mav_put_uint8_t(buf, 0, gcs_system_id); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, ack); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #else - mavlink_change_operator_control_ack_t packet; - packet.gcs_system_id = gcs_system_id; - packet.control_request = control_request; - packet.ack = ack; + mavlink_change_operator_control_ack_t packet; + packet.gcs_system_id = gcs_system_id; + packet.control_request = control_request; + packet.ack = ack; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t */ static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack) { - return mavlink_msg_change_operator_control_ack_pack(system_id, component_id, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack); + return mavlink_msg_change_operator_control_ack_pack(system_id, component_id, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t sy */ static inline uint16_t mavlink_msg_change_operator_control_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack) { - return mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, chan, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack); + return mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, chan, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_encode_chan(uint8 static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; - _mav_put_uint8_t(buf, 0, gcs_system_id); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, ack); + char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN]; + _mav_put_uint8_t(buf, 0, gcs_system_id); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, ack); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); + mavlink_change_operator_control_ack_t packet; + packet.gcs_system_id = gcs_system_id; + packet.control_request = control_request; + packet.ack = ack; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); #endif -#else - mavlink_change_operator_control_ack_t packet; - packet.gcs_system_id = gcs_system_id; - packet.control_request = control_request; - packet.ack = ack; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); +/** + * @brief Send a change_operator_control_ack message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_change_operator_control_ack_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_ack_t* change_operator_control_ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_change_operator_control_ack_send(chan, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)change_operator_control_ack, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_ static inline void mavlink_msg_change_operator_control_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, gcs_system_id); - _mav_put_uint8_t(buf, 1, control_request); - _mav_put_uint8_t(buf, 2, ack); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, gcs_system_id); + _mav_put_uint8_t(buf, 1, control_request); + _mav_put_uint8_t(buf, 2, ack); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); #else - mavlink_change_operator_control_ack_t *packet = (mavlink_change_operator_control_ack_t *)msgbuf; - packet->gcs_system_id = gcs_system_id; - packet->control_request = control_request; - packet->ack = ack; + mavlink_change_operator_control_ack_t *packet = (mavlink_change_operator_control_ack_t *)msgbuf; + packet->gcs_system_id = gcs_system_id; + packet->control_request = control_request; + packet->ack = ack; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_change_operator_control_ack_send_buf(mavlink_mess */ static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id( */ static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_request(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_reques */ static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -247,11 +251,13 @@ static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavl */ static inline void mavlink_msg_change_operator_control_ack_decode(const mavlink_message_t* msg, mavlink_change_operator_control_ack_t* change_operator_control_ack) { -#if MAVLINK_NEED_BYTE_SWAP - change_operator_control_ack->gcs_system_id = mavlink_msg_change_operator_control_ack_get_gcs_system_id(msg); - change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg); - change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + change_operator_control_ack->gcs_system_id = mavlink_msg_change_operator_control_ack_get_gcs_system_id(msg); + change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg); + change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg); #else - memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN; + memset(change_operator_control_ack, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN); + memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_ack.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_ack.h index f59e19a..a7875f9 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_ack.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_ack.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE COMMAND_ACK PACKING #define MAVLINK_MSG_ID_COMMAND_ACK 77 -typedef struct __mavlink_command_ack_t -{ +MAVPACKED( +typedef struct __mavlink_command_ack_t { uint16_t command; /*< Command ID, as defined by MAV_CMD enum.*/ uint8_t result; /*< See MAV_RESULT enum*/ -} mavlink_command_ack_t; +}) mavlink_command_ack_t; #define MAVLINK_MSG_ID_COMMAND_ACK_LEN 3 +#define MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN 3 #define MAVLINK_MSG_ID_77_LEN 3 +#define MAVLINK_MSG_ID_77_MIN_LEN 3 #define MAVLINK_MSG_ID_COMMAND_ACK_CRC 143 #define MAVLINK_MSG_ID_77_CRC 143 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \ - "COMMAND_ACK", \ - 2, \ - { { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \ + 77, \ + "COMMAND_ACK", \ + 2, \ + { { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \ { "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \ + "COMMAND_ACK", \ + 2, \ + { { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \ + { "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \ + } \ +} +#endif /** * @brief Pack a command_ack message @@ -36,28 +49,24 @@ typedef struct __mavlink_command_ack_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t command, uint8_t result) + uint16_t command, uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; - _mav_put_uint16_t(buf, 0, command); - _mav_put_uint8_t(buf, 2, result); + char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; + _mav_put_uint16_t(buf, 0, command); + _mav_put_uint8_t(buf, 2, result); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #else - mavlink_command_ack_t packet; - packet.command = command; - packet.result = result; + mavlink_command_ack_t packet; + packet.command = command; + packet.result = result; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t command,uint8_t result) + mavlink_message_t* msg, + uint16_t command,uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; - _mav_put_uint16_t(buf, 0, command); - _mav_put_uint8_t(buf, 2, result); + char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; + _mav_put_uint16_t(buf, 0, command); + _mav_put_uint8_t(buf, 2, result); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #else - mavlink_command_ack_t packet; - packet.command = command; - packet.result = result; + mavlink_command_ack_t packet; + packet.command = command; + packet.result = result; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack) { - return mavlink_msg_command_ack_pack(system_id, component_id, msg, command_ack->command, command_ack->result); + return mavlink_msg_command_ack_pack(system_id, component_id, msg, command_ack->command, command_ack->result); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_command_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack) { - return mavlink_msg_command_ack_pack_chan(system_id, component_id, chan, msg, command_ack->command, command_ack->result); + return mavlink_msg_command_ack_pack_chan(system_id, component_id, chan, msg, command_ack->command, command_ack->result); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_command_ack_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t command, uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; - _mav_put_uint16_t(buf, 0, command); - _mav_put_uint8_t(buf, 2, result); + char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN]; + _mav_put_uint16_t(buf, 0, command); + _mav_put_uint8_t(buf, 2, result); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN); + mavlink_command_ack_t packet; + packet.command = command; + packet.result = result; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); #endif -#else - mavlink_command_ack_t packet; - packet.command = command; - packet.result = result; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); +/** + * @brief Send a command_ack message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_command_ack_send_struct(mavlink_channel_t chan, const mavlink_command_ack_t* command_ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_command_ack_send(chan, command_ack->command, command_ack->result); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)command_ack, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t static inline void mavlink_msg_command_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t command, uint8_t result) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, command); - _mav_put_uint8_t(buf, 2, result); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, command); + _mav_put_uint8_t(buf, 2, result); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); #else - mavlink_command_ack_t *packet = (mavlink_command_ack_t *)msgbuf; - packet->command = command; - packet->result = result; + mavlink_command_ack_t *packet = (mavlink_command_ack_t *)msgbuf; + packet->command = command; + packet->result = result; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_command_ack_send_buf(mavlink_message_t *msgbuf, m */ static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message */ static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -224,10 +227,12 @@ static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t */ static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg, mavlink_command_ack_t* command_ack) { -#if MAVLINK_NEED_BYTE_SWAP - command_ack->command = mavlink_msg_command_ack_get_command(msg); - command_ack->result = mavlink_msg_command_ack_get_result(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + command_ack->command = mavlink_msg_command_ack_get_command(msg); + command_ack->result = mavlink_msg_command_ack_get_result(msg); #else - memcpy(command_ack, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_COMMAND_ACK_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_ACK_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_ACK_LEN; + memset(command_ack, 0, MAVLINK_MSG_ID_COMMAND_ACK_LEN); + memcpy(command_ack, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_int.h index d7deb4b..0f062e4 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_int.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE COMMAND_INT PACKING #define MAVLINK_MSG_ID_COMMAND_INT 75 -typedef struct __mavlink_command_int_t -{ +MAVPACKED( +typedef struct __mavlink_command_int_t { float param1; /*< PARAM1, see MAV_CMD enum*/ float param2; /*< PARAM2, see MAV_CMD enum*/ float param3; /*< PARAM3, see MAV_CMD enum*/ @@ -17,20 +18,24 @@ typedef struct __mavlink_command_int_t uint8_t frame; /*< The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h*/ uint8_t current; /*< false:0, true:1*/ uint8_t autocontinue; /*< autocontinue to next wp*/ -} mavlink_command_int_t; +}) mavlink_command_int_t; #define MAVLINK_MSG_ID_COMMAND_INT_LEN 35 +#define MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN 35 #define MAVLINK_MSG_ID_75_LEN 35 +#define MAVLINK_MSG_ID_75_MIN_LEN 35 #define MAVLINK_MSG_ID_COMMAND_INT_CRC 158 #define MAVLINK_MSG_ID_75_CRC 158 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_COMMAND_INT { \ - "COMMAND_INT", \ - 13, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \ + 75, \ + "COMMAND_INT", \ + 13, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \ @@ -45,7 +50,26 @@ typedef struct __mavlink_command_int_t { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \ + "COMMAND_INT", \ + 13, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \ + { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \ + { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \ + { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \ + { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \ + } \ +} +#endif /** * @brief Pack a command_int message @@ -69,50 +93,46 @@ typedef struct __mavlink_command_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) + uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, frame); - _mav_put_uint8_t(buf, 33, current); - _mav_put_uint8_t(buf, 34, autocontinue); + char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, frame); + _mav_put_uint8_t(buf, 33, current); + _mav_put_uint8_t(buf, 34, autocontinue); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN); #else - mavlink_command_int_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; + mavlink_command_int_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_COMMAND_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_COMMAND_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); } /** @@ -137,51 +157,47 @@ static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, frame); - _mav_put_uint8_t(buf, 33, current); - _mav_put_uint8_t(buf, 34, autocontinue); + char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, frame); + _mav_put_uint8_t(buf, 33, current); + _mav_put_uint8_t(buf, 34, autocontinue); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN); #else - mavlink_command_int_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; + mavlink_command_int_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_COMMAND_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_COMMAND_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); } /** @@ -194,7 +210,7 @@ static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_command_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_int_t* command_int) { - return mavlink_msg_command_int_pack(system_id, component_id, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z); + return mavlink_msg_command_int_pack(system_id, component_id, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z); } /** @@ -208,7 +224,7 @@ static inline uint16_t mavlink_msg_command_int_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_int_t* command_int) { - return mavlink_msg_command_int_pack_chan(system_id, component_id, chan, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z); + return mavlink_msg_command_int_pack_chan(system_id, component_id, chan, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z); } /** @@ -234,47 +250,53 @@ static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_command_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, frame); - _mav_put_uint8_t(buf, 33, current); - _mav_put_uint8_t(buf, 34, autocontinue); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); + char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, frame); + _mav_put_uint8_t(buf, 33, current); + _mav_put_uint8_t(buf, 34, autocontinue); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN); + mavlink_command_int_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); #endif +} + +/** + * @brief Send a command_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_command_int_send_struct(mavlink_channel_t chan, const mavlink_command_int_t* command_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_command_int_send(chan, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z); #else - mavlink_command_int_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)command_int, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); #endif } @@ -289,47 +311,39 @@ static inline void mavlink_msg_command_int_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, frame); - _mav_put_uint8_t(buf, 33, current); - _mav_put_uint8_t(buf, 34, autocontinue); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, frame); + _mav_put_uint8_t(buf, 33, current); + _mav_put_uint8_t(buf, 34, autocontinue); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN); -#endif -#else - mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf; - packet->param1 = param1; - packet->param2 = param2; - packet->param3 = param3; - packet->param4 = param4; - packet->x = x; - packet->y = y; - packet->z = z; - packet->command = command; - packet->target_system = target_system; - packet->target_component = target_component; - packet->frame = frame; - packet->current = current; - packet->autocontinue = autocontinue; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_LEN); -#endif + mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf; + packet->param1 = param1; + packet->param2 = param2; + packet->param3 = param3; + packet->param4 = param4; + packet->x = x; + packet->y = y; + packet->z = z; + packet->command = command; + packet->target_system = target_system; + packet->target_component = target_component; + packet->frame = frame; + packet->current = current; + packet->autocontinue = autocontinue; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC); #endif } #endif @@ -346,7 +360,7 @@ static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, m */ static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 30); + return _MAV_RETURN_uint8_t(msg, 30); } /** @@ -356,7 +370,7 @@ static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_me */ static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 31); + return _MAV_RETURN_uint8_t(msg, 31); } /** @@ -366,7 +380,7 @@ static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink */ static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -376,7 +390,7 @@ static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* */ static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -386,7 +400,7 @@ static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message */ static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 33); + return _MAV_RETURN_uint8_t(msg, 33); } /** @@ -396,7 +410,7 @@ static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_ */ static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -406,7 +420,7 @@ static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_mes */ static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -416,7 +430,7 @@ static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* */ static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -426,7 +440,7 @@ static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* */ static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -436,7 +450,7 @@ static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* */ static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -446,7 +460,7 @@ static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* */ static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -456,7 +470,7 @@ static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg */ static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 20); + return _MAV_RETURN_int32_t(msg, 20); } /** @@ -466,7 +480,7 @@ static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg */ static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -477,21 +491,23 @@ static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg) */ static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int) { -#if MAVLINK_NEED_BYTE_SWAP - command_int->param1 = mavlink_msg_command_int_get_param1(msg); - command_int->param2 = mavlink_msg_command_int_get_param2(msg); - command_int->param3 = mavlink_msg_command_int_get_param3(msg); - command_int->param4 = mavlink_msg_command_int_get_param4(msg); - command_int->x = mavlink_msg_command_int_get_x(msg); - command_int->y = mavlink_msg_command_int_get_y(msg); - command_int->z = mavlink_msg_command_int_get_z(msg); - command_int->command = mavlink_msg_command_int_get_command(msg); - command_int->target_system = mavlink_msg_command_int_get_target_system(msg); - command_int->target_component = mavlink_msg_command_int_get_target_component(msg); - command_int->frame = mavlink_msg_command_int_get_frame(msg); - command_int->current = mavlink_msg_command_int_get_current(msg); - command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + command_int->param1 = mavlink_msg_command_int_get_param1(msg); + command_int->param2 = mavlink_msg_command_int_get_param2(msg); + command_int->param3 = mavlink_msg_command_int_get_param3(msg); + command_int->param4 = mavlink_msg_command_int_get_param4(msg); + command_int->x = mavlink_msg_command_int_get_x(msg); + command_int->y = mavlink_msg_command_int_get_y(msg); + command_int->z = mavlink_msg_command_int_get_z(msg); + command_int->command = mavlink_msg_command_int_get_command(msg); + command_int->target_system = mavlink_msg_command_int_get_target_system(msg); + command_int->target_component = mavlink_msg_command_int_get_target_component(msg); + command_int->frame = mavlink_msg_command_int_get_frame(msg); + command_int->current = mavlink_msg_command_int_get_current(msg); + command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg); #else - memcpy(command_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_COMMAND_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_INT_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_INT_LEN; + memset(command_int, 0, MAVLINK_MSG_ID_COMMAND_INT_LEN); + memcpy(command_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_long.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_long.h index 70ec442..a90d66c 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_long.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_command_long.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE COMMAND_LONG PACKING #define MAVLINK_MSG_ID_COMMAND_LONG 76 -typedef struct __mavlink_command_long_t -{ +MAVPACKED( +typedef struct __mavlink_command_long_t { float param1; /*< Parameter 1, as defined by MAV_CMD enum.*/ float param2; /*< Parameter 2, as defined by MAV_CMD enum.*/ float param3; /*< Parameter 3, as defined by MAV_CMD enum.*/ @@ -15,20 +16,24 @@ typedef struct __mavlink_command_long_t uint8_t target_system; /*< System which should execute the command*/ uint8_t target_component; /*< Component which should execute the command, 0 for all components*/ uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/ -} mavlink_command_long_t; +}) mavlink_command_long_t; #define MAVLINK_MSG_ID_COMMAND_LONG_LEN 33 +#define MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN 33 #define MAVLINK_MSG_ID_76_LEN 33 +#define MAVLINK_MSG_ID_76_MIN_LEN 33 #define MAVLINK_MSG_ID_COMMAND_LONG_CRC 152 #define MAVLINK_MSG_ID_76_CRC 152 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \ - "COMMAND_LONG", \ - 11, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \ + 76, \ + "COMMAND_LONG", \ + 11, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \ @@ -41,7 +46,24 @@ typedef struct __mavlink_command_long_t { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \ + "COMMAND_LONG", \ + 11, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \ + { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \ + { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \ + { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \ + { "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \ + { "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \ + { "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \ + { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \ + } \ +} +#endif /** * @brief Pack a command_long message @@ -63,46 +85,42 @@ typedef struct __mavlink_command_long_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7) + uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, param5); - _mav_put_float(buf, 20, param6); - _mav_put_float(buf, 24, param7); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, confirmation); + char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, param5); + _mav_put_float(buf, 20, param6); + _mav_put_float(buf, 24, param7); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, confirmation); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #else - mavlink_command_long_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.param5 = param5; - packet.param6 = param6; - packet.param7 = param7; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.confirmation = confirmation; + mavlink_command_long_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.param5 = param5; + packet.param6 = param6; + packet.param7 = param7; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.confirmation = confirmation; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); } /** @@ -125,47 +143,43 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, param5); - _mav_put_float(buf, 20, param6); - _mav_put_float(buf, 24, param7); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, confirmation); + char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, param5); + _mav_put_float(buf, 20, param6); + _mav_put_float(buf, 24, param7); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, confirmation); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #else - mavlink_command_long_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.param5 = param5; - packet.param6 = param6; - packet.param7 = param7; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.confirmation = confirmation; + mavlink_command_long_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.param5 = param5; + packet.param6 = param6; + packet.param7 = param7; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.confirmation = confirmation; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); } /** @@ -178,7 +192,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_long_t* command_long) { - return mavlink_msg_command_long_pack(system_id, component_id, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7); + return mavlink_msg_command_long_pack(system_id, component_id, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7); } /** @@ -192,7 +206,7 @@ static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_long_t* command_long) { - return mavlink_msg_command_long_pack_chan(system_id, component_id, chan, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7); + return mavlink_msg_command_long_pack_chan(system_id, component_id, chan, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7); } /** @@ -216,43 +230,49 @@ static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, u static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, param5); - _mav_put_float(buf, 20, param6); - _mav_put_float(buf, 24, param7); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, confirmation); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); + char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, param5); + _mav_put_float(buf, 20, param6); + _mav_put_float(buf, 24, param7); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, confirmation); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN); + mavlink_command_long_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.param5 = param5; + packet.param6 = param6; + packet.param7 = param7; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.confirmation = confirmation; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); #endif +} + +/** + * @brief Send a command_long message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_command_long_send_struct(mavlink_channel_t chan, const mavlink_command_long_t* command_long) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_command_long_send(chan, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7); #else - mavlink_command_long_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.param5 = param5; - packet.param6 = param6; - packet.param7 = param7; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.confirmation = confirmation; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)command_long, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); #endif } @@ -267,43 +287,35 @@ static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_command_long_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, param5); - _mav_put_float(buf, 20, param6); - _mav_put_float(buf, 24, param7); - _mav_put_uint16_t(buf, 28, command); - _mav_put_uint8_t(buf, 30, target_system); - _mav_put_uint8_t(buf, 31, target_component); - _mav_put_uint8_t(buf, 32, confirmation); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, param5); + _mav_put_float(buf, 20, param6); + _mav_put_float(buf, 24, param7); + _mav_put_uint16_t(buf, 28, command); + _mav_put_uint8_t(buf, 30, target_system); + _mav_put_uint8_t(buf, 31, target_component); + _mav_put_uint8_t(buf, 32, confirmation); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN); -#endif -#else - mavlink_command_long_t *packet = (mavlink_command_long_t *)msgbuf; - packet->param1 = param1; - packet->param2 = param2; - packet->param3 = param3; - packet->param4 = param4; - packet->param5 = param5; - packet->param6 = param6; - packet->param7 = param7; - packet->command = command; - packet->target_system = target_system; - packet->target_component = target_component; - packet->confirmation = confirmation; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN); -#endif + mavlink_command_long_t *packet = (mavlink_command_long_t *)msgbuf; + packet->param1 = param1; + packet->param2 = param2; + packet->param3 = param3; + packet->param4 = param4; + packet->param5 = param5; + packet->param6 = param6; + packet->param7 = param7; + packet->command = command; + packet->target_system = target_system; + packet->target_component = target_component; + packet->confirmation = confirmation; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC); #endif } #endif @@ -320,7 +332,7 @@ static inline void mavlink_msg_command_long_send_buf(mavlink_message_t *msgbuf, */ static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 30); + return _MAV_RETURN_uint8_t(msg, 30); } /** @@ -330,7 +342,7 @@ static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_m */ static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 31); + return _MAV_RETURN_uint8_t(msg, 31); } /** @@ -340,7 +352,7 @@ static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlin */ static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -350,7 +362,7 @@ static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_messag */ static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -360,7 +372,7 @@ static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_me */ static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -370,7 +382,7 @@ static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* */ static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -380,7 +392,7 @@ static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* */ static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -390,7 +402,7 @@ static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* */ static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -400,7 +412,7 @@ static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* */ static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -410,7 +422,7 @@ static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* */ static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -420,7 +432,7 @@ static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* */ static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -431,19 +443,21 @@ static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* */ static inline void mavlink_msg_command_long_decode(const mavlink_message_t* msg, mavlink_command_long_t* command_long) { -#if MAVLINK_NEED_BYTE_SWAP - command_long->param1 = mavlink_msg_command_long_get_param1(msg); - command_long->param2 = mavlink_msg_command_long_get_param2(msg); - command_long->param3 = mavlink_msg_command_long_get_param3(msg); - command_long->param4 = mavlink_msg_command_long_get_param4(msg); - command_long->param5 = mavlink_msg_command_long_get_param5(msg); - command_long->param6 = mavlink_msg_command_long_get_param6(msg); - command_long->param7 = mavlink_msg_command_long_get_param7(msg); - command_long->command = mavlink_msg_command_long_get_command(msg); - command_long->target_system = mavlink_msg_command_long_get_target_system(msg); - command_long->target_component = mavlink_msg_command_long_get_target_component(msg); - command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + command_long->param1 = mavlink_msg_command_long_get_param1(msg); + command_long->param2 = mavlink_msg_command_long_get_param2(msg); + command_long->param3 = mavlink_msg_command_long_get_param3(msg); + command_long->param4 = mavlink_msg_command_long_get_param4(msg); + command_long->param5 = mavlink_msg_command_long_get_param5(msg); + command_long->param6 = mavlink_msg_command_long_get_param6(msg); + command_long->param7 = mavlink_msg_command_long_get_param7(msg); + command_long->command = mavlink_msg_command_long_get_command(msg); + command_long->target_system = mavlink_msg_command_long_get_target_system(msg); + command_long->target_component = mavlink_msg_command_long_get_target_component(msg); + command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg); #else - memcpy(command_long, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_COMMAND_LONG_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_LONG_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_LONG_LEN; + memset(command_long, 0, MAVLINK_MSG_ID_COMMAND_LONG_LEN); + memcpy(command_long, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_control_system_state.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_control_system_state.h index bde354b..2afcbf1 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_control_system_state.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_control_system_state.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE CONTROL_SYSTEM_STATE PACKING #define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE 146 -typedef struct __mavlink_control_system_state_t -{ +MAVPACKED( +typedef struct __mavlink_control_system_state_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float x_acc; /*< X acceleration in body frame*/ float y_acc; /*< Y acceleration in body frame*/ @@ -21,10 +22,12 @@ typedef struct __mavlink_control_system_state_t float roll_rate; /*< Angular rate in roll axis*/ float pitch_rate; /*< Angular rate in pitch axis*/ float yaw_rate; /*< Angular rate in yaw axis*/ -} mavlink_control_system_state_t; +}) mavlink_control_system_state_t; #define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN 100 +#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN 100 #define MAVLINK_MSG_ID_146_LEN 100 +#define MAVLINK_MSG_ID_146_MIN_LEN 100 #define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC 103 #define MAVLINK_MSG_ID_146_CRC 103 @@ -33,10 +36,12 @@ typedef struct __mavlink_control_system_state_t #define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_POS_VARIANCE_LEN 3 #define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_Q_LEN 4 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \ - "CONTROL_SYSTEM_STATE", \ - 17, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \ + 146, \ + "CONTROL_SYSTEM_STATE", \ + 17, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \ { "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \ { "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \ { "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \ @@ -55,7 +60,30 @@ typedef struct __mavlink_control_system_state_t { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \ + "CONTROL_SYSTEM_STATE", \ + 17, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \ + { "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \ + { "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \ + { "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \ + { "x_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_control_system_state_t, x_vel) }, \ + { "y_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_control_system_state_t, y_vel) }, \ + { "z_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_control_system_state_t, z_vel) }, \ + { "x_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_control_system_state_t, x_pos) }, \ + { "y_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_control_system_state_t, y_pos) }, \ + { "z_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_control_system_state_t, z_pos) }, \ + { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_control_system_state_t, airspeed) }, \ + { "vel_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 48, offsetof(mavlink_control_system_state_t, vel_variance) }, \ + { "pos_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 60, offsetof(mavlink_control_system_state_t, pos_variance) }, \ + { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 72, offsetof(mavlink_control_system_state_t, q) }, \ + { "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_control_system_state_t, roll_rate) }, \ + { "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_control_system_state_t, pitch_rate) }, \ + { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \ + } \ +} +#endif /** * @brief Pack a control_system_state message @@ -83,56 +111,52 @@ typedef struct __mavlink_control_system_state_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_control_system_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate) + uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x_acc); - _mav_put_float(buf, 12, y_acc); - _mav_put_float(buf, 16, z_acc); - _mav_put_float(buf, 20, x_vel); - _mav_put_float(buf, 24, y_vel); - _mav_put_float(buf, 28, z_vel); - _mav_put_float(buf, 32, x_pos); - _mav_put_float(buf, 36, y_pos); - _mav_put_float(buf, 40, z_pos); - _mav_put_float(buf, 44, airspeed); - _mav_put_float(buf, 88, roll_rate); - _mav_put_float(buf, 92, pitch_rate); - _mav_put_float(buf, 96, yaw_rate); - _mav_put_float_array(buf, 48, vel_variance, 3); - _mav_put_float_array(buf, 60, pos_variance, 3); - _mav_put_float_array(buf, 72, q, 4); + char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x_acc); + _mav_put_float(buf, 12, y_acc); + _mav_put_float(buf, 16, z_acc); + _mav_put_float(buf, 20, x_vel); + _mav_put_float(buf, 24, y_vel); + _mav_put_float(buf, 28, z_vel); + _mav_put_float(buf, 32, x_pos); + _mav_put_float(buf, 36, y_pos); + _mav_put_float(buf, 40, z_pos); + _mav_put_float(buf, 44, airspeed); + _mav_put_float(buf, 88, roll_rate); + _mav_put_float(buf, 92, pitch_rate); + _mav_put_float(buf, 96, yaw_rate); + _mav_put_float_array(buf, 48, vel_variance, 3); + _mav_put_float_array(buf, 60, pos_variance, 3); + _mav_put_float_array(buf, 72, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); #else - mavlink_control_system_state_t packet; - packet.time_usec = time_usec; - packet.x_acc = x_acc; - packet.y_acc = y_acc; - packet.z_acc = z_acc; - packet.x_vel = x_vel; - packet.y_vel = y_vel; - packet.z_vel = z_vel; - packet.x_pos = x_pos; - packet.y_pos = y_pos; - packet.z_pos = z_pos; - packet.airspeed = airspeed; - packet.roll_rate = roll_rate; - packet.pitch_rate = pitch_rate; - packet.yaw_rate = yaw_rate; - mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3); - mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3); - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_control_system_state_t packet; + packet.time_usec = time_usec; + packet.x_acc = x_acc; + packet.y_acc = y_acc; + packet.z_acc = z_acc; + packet.x_vel = x_vel; + packet.y_vel = y_vel; + packet.z_vel = z_vel; + packet.x_pos = x_pos; + packet.y_pos = y_pos; + packet.z_pos = z_pos; + packet.airspeed = airspeed; + packet.roll_rate = roll_rate; + packet.pitch_rate = pitch_rate; + packet.yaw_rate = yaw_rate; + mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3); + mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3); + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); } /** @@ -161,57 +185,53 @@ static inline uint16_t mavlink_msg_control_system_state_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_control_system_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float x_acc,float y_acc,float z_acc,float x_vel,float y_vel,float z_vel,float x_pos,float y_pos,float z_pos,float airspeed,const float *vel_variance,const float *pos_variance,const float *q,float roll_rate,float pitch_rate,float yaw_rate) + mavlink_message_t* msg, + uint64_t time_usec,float x_acc,float y_acc,float z_acc,float x_vel,float y_vel,float z_vel,float x_pos,float y_pos,float z_pos,float airspeed,const float *vel_variance,const float *pos_variance,const float *q,float roll_rate,float pitch_rate,float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x_acc); - _mav_put_float(buf, 12, y_acc); - _mav_put_float(buf, 16, z_acc); - _mav_put_float(buf, 20, x_vel); - _mav_put_float(buf, 24, y_vel); - _mav_put_float(buf, 28, z_vel); - _mav_put_float(buf, 32, x_pos); - _mav_put_float(buf, 36, y_pos); - _mav_put_float(buf, 40, z_pos); - _mav_put_float(buf, 44, airspeed); - _mav_put_float(buf, 88, roll_rate); - _mav_put_float(buf, 92, pitch_rate); - _mav_put_float(buf, 96, yaw_rate); - _mav_put_float_array(buf, 48, vel_variance, 3); - _mav_put_float_array(buf, 60, pos_variance, 3); - _mav_put_float_array(buf, 72, q, 4); + char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x_acc); + _mav_put_float(buf, 12, y_acc); + _mav_put_float(buf, 16, z_acc); + _mav_put_float(buf, 20, x_vel); + _mav_put_float(buf, 24, y_vel); + _mav_put_float(buf, 28, z_vel); + _mav_put_float(buf, 32, x_pos); + _mav_put_float(buf, 36, y_pos); + _mav_put_float(buf, 40, z_pos); + _mav_put_float(buf, 44, airspeed); + _mav_put_float(buf, 88, roll_rate); + _mav_put_float(buf, 92, pitch_rate); + _mav_put_float(buf, 96, yaw_rate); + _mav_put_float_array(buf, 48, vel_variance, 3); + _mav_put_float_array(buf, 60, pos_variance, 3); + _mav_put_float_array(buf, 72, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); #else - mavlink_control_system_state_t packet; - packet.time_usec = time_usec; - packet.x_acc = x_acc; - packet.y_acc = y_acc; - packet.z_acc = z_acc; - packet.x_vel = x_vel; - packet.y_vel = y_vel; - packet.z_vel = z_vel; - packet.x_pos = x_pos; - packet.y_pos = y_pos; - packet.z_pos = z_pos; - packet.airspeed = airspeed; - packet.roll_rate = roll_rate; - packet.pitch_rate = pitch_rate; - packet.yaw_rate = yaw_rate; - mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3); - mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3); - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_control_system_state_t packet; + packet.time_usec = time_usec; + packet.x_acc = x_acc; + packet.y_acc = y_acc; + packet.z_acc = z_acc; + packet.x_vel = x_vel; + packet.y_vel = y_vel; + packet.z_vel = z_vel; + packet.x_pos = x_pos; + packet.y_pos = y_pos; + packet.z_pos = z_pos; + packet.airspeed = airspeed; + packet.roll_rate = roll_rate; + packet.pitch_rate = pitch_rate; + packet.yaw_rate = yaw_rate; + mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3); + mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3); + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); } /** @@ -224,7 +244,7 @@ static inline uint16_t mavlink_msg_control_system_state_pack_chan(uint8_t system */ static inline uint16_t mavlink_msg_control_system_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state) { - return mavlink_msg_control_system_state_pack(system_id, component_id, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate); + return mavlink_msg_control_system_state_pack(system_id, component_id, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate); } /** @@ -238,7 +258,7 @@ static inline uint16_t mavlink_msg_control_system_state_encode(uint8_t system_id */ static inline uint16_t mavlink_msg_control_system_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state) { - return mavlink_msg_control_system_state_pack_chan(system_id, component_id, chan, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate); + return mavlink_msg_control_system_state_pack_chan(system_id, component_id, chan, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate); } /** @@ -268,53 +288,59 @@ static inline uint16_t mavlink_msg_control_system_state_encode_chan(uint8_t syst static inline void mavlink_msg_control_system_state_send(mavlink_channel_t chan, uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x_acc); - _mav_put_float(buf, 12, y_acc); - _mav_put_float(buf, 16, z_acc); - _mav_put_float(buf, 20, x_vel); - _mav_put_float(buf, 24, y_vel); - _mav_put_float(buf, 28, z_vel); - _mav_put_float(buf, 32, x_pos); - _mav_put_float(buf, 36, y_pos); - _mav_put_float(buf, 40, z_pos); - _mav_put_float(buf, 44, airspeed); - _mav_put_float(buf, 88, roll_rate); - _mav_put_float(buf, 92, pitch_rate); - _mav_put_float(buf, 96, yaw_rate); - _mav_put_float_array(buf, 48, vel_variance, 3); - _mav_put_float_array(buf, 60, pos_variance, 3); - _mav_put_float_array(buf, 72, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); + char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x_acc); + _mav_put_float(buf, 12, y_acc); + _mav_put_float(buf, 16, z_acc); + _mav_put_float(buf, 20, x_vel); + _mav_put_float(buf, 24, y_vel); + _mav_put_float(buf, 28, z_vel); + _mav_put_float(buf, 32, x_pos); + _mav_put_float(buf, 36, y_pos); + _mav_put_float(buf, 40, z_pos); + _mav_put_float(buf, 44, airspeed); + _mav_put_float(buf, 88, roll_rate); + _mav_put_float(buf, 92, pitch_rate); + _mav_put_float(buf, 96, yaw_rate); + _mav_put_float_array(buf, 48, vel_variance, 3); + _mav_put_float_array(buf, 60, pos_variance, 3); + _mav_put_float_array(buf, 72, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); + mavlink_control_system_state_t packet; + packet.time_usec = time_usec; + packet.x_acc = x_acc; + packet.y_acc = y_acc; + packet.z_acc = z_acc; + packet.x_vel = x_vel; + packet.y_vel = y_vel; + packet.z_vel = z_vel; + packet.x_pos = x_pos; + packet.y_pos = y_pos; + packet.z_pos = z_pos; + packet.airspeed = airspeed; + packet.roll_rate = roll_rate; + packet.pitch_rate = pitch_rate; + packet.yaw_rate = yaw_rate; + mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3); + mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3); + mav_array_memcpy(packet.q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)&packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); #endif +} + +/** + * @brief Send a control_system_state message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_control_system_state_send_struct(mavlink_channel_t chan, const mavlink_control_system_state_t* control_system_state) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_control_system_state_send(chan, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate); #else - mavlink_control_system_state_t packet; - packet.time_usec = time_usec; - packet.x_acc = x_acc; - packet.y_acc = y_acc; - packet.z_acc = z_acc; - packet.x_vel = x_vel; - packet.y_vel = y_vel; - packet.z_vel = z_vel; - packet.x_pos = x_pos; - packet.y_pos = y_pos; - packet.z_pos = z_pos; - packet.airspeed = airspeed; - packet.roll_rate = roll_rate; - packet.pitch_rate = pitch_rate; - packet.yaw_rate = yaw_rate; - mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3); - mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3); - mav_array_memcpy(packet.q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)&packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)&packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)control_system_state, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); #endif } @@ -329,53 +355,45 @@ static inline void mavlink_msg_control_system_state_send(mavlink_channel_t chan, static inline void mavlink_msg_control_system_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x_acc); - _mav_put_float(buf, 12, y_acc); - _mav_put_float(buf, 16, z_acc); - _mav_put_float(buf, 20, x_vel); - _mav_put_float(buf, 24, y_vel); - _mav_put_float(buf, 28, z_vel); - _mav_put_float(buf, 32, x_pos); - _mav_put_float(buf, 36, y_pos); - _mav_put_float(buf, 40, z_pos); - _mav_put_float(buf, 44, airspeed); - _mav_put_float(buf, 88, roll_rate); - _mav_put_float(buf, 92, pitch_rate); - _mav_put_float(buf, 96, yaw_rate); - _mav_put_float_array(buf, 48, vel_variance, 3); - _mav_put_float_array(buf, 60, pos_variance, 3); - _mav_put_float_array(buf, 72, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x_acc); + _mav_put_float(buf, 12, y_acc); + _mav_put_float(buf, 16, z_acc); + _mav_put_float(buf, 20, x_vel); + _mav_put_float(buf, 24, y_vel); + _mav_put_float(buf, 28, z_vel); + _mav_put_float(buf, 32, x_pos); + _mav_put_float(buf, 36, y_pos); + _mav_put_float(buf, 40, z_pos); + _mav_put_float(buf, 44, airspeed); + _mav_put_float(buf, 88, roll_rate); + _mav_put_float(buf, 92, pitch_rate); + _mav_put_float(buf, 96, yaw_rate); + _mav_put_float_array(buf, 48, vel_variance, 3); + _mav_put_float_array(buf, 60, pos_variance, 3); + _mav_put_float_array(buf, 72, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); -#endif -#else - mavlink_control_system_state_t *packet = (mavlink_control_system_state_t *)msgbuf; - packet->time_usec = time_usec; - packet->x_acc = x_acc; - packet->y_acc = y_acc; - packet->z_acc = z_acc; - packet->x_vel = x_vel; - packet->y_vel = y_vel; - packet->z_vel = z_vel; - packet->x_pos = x_pos; - packet->y_pos = y_pos; - packet->z_pos = z_pos; - packet->airspeed = airspeed; - packet->roll_rate = roll_rate; - packet->pitch_rate = pitch_rate; - packet->yaw_rate = yaw_rate; - mav_array_memcpy(packet->vel_variance, vel_variance, sizeof(float)*3); - mav_array_memcpy(packet->pos_variance, pos_variance, sizeof(float)*3); - mav_array_memcpy(packet->q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); -#endif + mavlink_control_system_state_t *packet = (mavlink_control_system_state_t *)msgbuf; + packet->time_usec = time_usec; + packet->x_acc = x_acc; + packet->y_acc = y_acc; + packet->z_acc = z_acc; + packet->x_vel = x_vel; + packet->y_vel = y_vel; + packet->z_vel = z_vel; + packet->x_pos = x_pos; + packet->y_pos = y_pos; + packet->z_pos = z_pos; + packet->airspeed = airspeed; + packet->roll_rate = roll_rate; + packet->pitch_rate = pitch_rate; + packet->yaw_rate = yaw_rate; + mav_array_memcpy(packet->vel_variance, vel_variance, sizeof(float)*3); + mav_array_memcpy(packet->pos_variance, pos_variance, sizeof(float)*3); + mav_array_memcpy(packet->q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC); #endif } #endif @@ -392,7 +410,7 @@ static inline void mavlink_msg_control_system_state_send_buf(mavlink_message_t * */ static inline uint64_t mavlink_msg_control_system_state_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -402,7 +420,7 @@ static inline uint64_t mavlink_msg_control_system_state_get_time_usec(const mavl */ static inline float mavlink_msg_control_system_state_get_x_acc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -412,7 +430,7 @@ static inline float mavlink_msg_control_system_state_get_x_acc(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_y_acc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -422,7 +440,7 @@ static inline float mavlink_msg_control_system_state_get_y_acc(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_z_acc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -432,7 +450,7 @@ static inline float mavlink_msg_control_system_state_get_z_acc(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_x_vel(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -442,7 +460,7 @@ static inline float mavlink_msg_control_system_state_get_x_vel(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_y_vel(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -452,7 +470,7 @@ static inline float mavlink_msg_control_system_state_get_y_vel(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_z_vel(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -462,7 +480,7 @@ static inline float mavlink_msg_control_system_state_get_z_vel(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_x_pos(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -472,7 +490,7 @@ static inline float mavlink_msg_control_system_state_get_x_pos(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_y_pos(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -482,7 +500,7 @@ static inline float mavlink_msg_control_system_state_get_y_pos(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_z_pos(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -492,7 +510,7 @@ static inline float mavlink_msg_control_system_state_get_z_pos(const mavlink_mes */ static inline float mavlink_msg_control_system_state_get_airspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -502,7 +520,7 @@ static inline float mavlink_msg_control_system_state_get_airspeed(const mavlink_ */ static inline uint16_t mavlink_msg_control_system_state_get_vel_variance(const mavlink_message_t* msg, float *vel_variance) { - return _MAV_RETURN_float_array(msg, vel_variance, 3, 48); + return _MAV_RETURN_float_array(msg, vel_variance, 3, 48); } /** @@ -512,7 +530,7 @@ static inline uint16_t mavlink_msg_control_system_state_get_vel_variance(const m */ static inline uint16_t mavlink_msg_control_system_state_get_pos_variance(const mavlink_message_t* msg, float *pos_variance) { - return _MAV_RETURN_float_array(msg, pos_variance, 3, 60); + return _MAV_RETURN_float_array(msg, pos_variance, 3, 60); } /** @@ -522,7 +540,7 @@ static inline uint16_t mavlink_msg_control_system_state_get_pos_variance(const m */ static inline uint16_t mavlink_msg_control_system_state_get_q(const mavlink_message_t* msg, float *q) { - return _MAV_RETURN_float_array(msg, q, 4, 72); + return _MAV_RETURN_float_array(msg, q, 4, 72); } /** @@ -532,7 +550,7 @@ static inline uint16_t mavlink_msg_control_system_state_get_q(const mavlink_mess */ static inline float mavlink_msg_control_system_state_get_roll_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 88); + return _MAV_RETURN_float(msg, 88); } /** @@ -542,7 +560,7 @@ static inline float mavlink_msg_control_system_state_get_roll_rate(const mavlink */ static inline float mavlink_msg_control_system_state_get_pitch_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 92); + return _MAV_RETURN_float(msg, 92); } /** @@ -552,7 +570,7 @@ static inline float mavlink_msg_control_system_state_get_pitch_rate(const mavlin */ static inline float mavlink_msg_control_system_state_get_yaw_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 96); + return _MAV_RETURN_float(msg, 96); } /** @@ -563,25 +581,27 @@ static inline float mavlink_msg_control_system_state_get_yaw_rate(const mavlink_ */ static inline void mavlink_msg_control_system_state_decode(const mavlink_message_t* msg, mavlink_control_system_state_t* control_system_state) { -#if MAVLINK_NEED_BYTE_SWAP - control_system_state->time_usec = mavlink_msg_control_system_state_get_time_usec(msg); - control_system_state->x_acc = mavlink_msg_control_system_state_get_x_acc(msg); - control_system_state->y_acc = mavlink_msg_control_system_state_get_y_acc(msg); - control_system_state->z_acc = mavlink_msg_control_system_state_get_z_acc(msg); - control_system_state->x_vel = mavlink_msg_control_system_state_get_x_vel(msg); - control_system_state->y_vel = mavlink_msg_control_system_state_get_y_vel(msg); - control_system_state->z_vel = mavlink_msg_control_system_state_get_z_vel(msg); - control_system_state->x_pos = mavlink_msg_control_system_state_get_x_pos(msg); - control_system_state->y_pos = mavlink_msg_control_system_state_get_y_pos(msg); - control_system_state->z_pos = mavlink_msg_control_system_state_get_z_pos(msg); - control_system_state->airspeed = mavlink_msg_control_system_state_get_airspeed(msg); - mavlink_msg_control_system_state_get_vel_variance(msg, control_system_state->vel_variance); - mavlink_msg_control_system_state_get_pos_variance(msg, control_system_state->pos_variance); - mavlink_msg_control_system_state_get_q(msg, control_system_state->q); - control_system_state->roll_rate = mavlink_msg_control_system_state_get_roll_rate(msg); - control_system_state->pitch_rate = mavlink_msg_control_system_state_get_pitch_rate(msg); - control_system_state->yaw_rate = mavlink_msg_control_system_state_get_yaw_rate(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + control_system_state->time_usec = mavlink_msg_control_system_state_get_time_usec(msg); + control_system_state->x_acc = mavlink_msg_control_system_state_get_x_acc(msg); + control_system_state->y_acc = mavlink_msg_control_system_state_get_y_acc(msg); + control_system_state->z_acc = mavlink_msg_control_system_state_get_z_acc(msg); + control_system_state->x_vel = mavlink_msg_control_system_state_get_x_vel(msg); + control_system_state->y_vel = mavlink_msg_control_system_state_get_y_vel(msg); + control_system_state->z_vel = mavlink_msg_control_system_state_get_z_vel(msg); + control_system_state->x_pos = mavlink_msg_control_system_state_get_x_pos(msg); + control_system_state->y_pos = mavlink_msg_control_system_state_get_y_pos(msg); + control_system_state->z_pos = mavlink_msg_control_system_state_get_z_pos(msg); + control_system_state->airspeed = mavlink_msg_control_system_state_get_airspeed(msg); + mavlink_msg_control_system_state_get_vel_variance(msg, control_system_state->vel_variance); + mavlink_msg_control_system_state_get_pos_variance(msg, control_system_state->pos_variance); + mavlink_msg_control_system_state_get_q(msg, control_system_state->q); + control_system_state->roll_rate = mavlink_msg_control_system_state_get_roll_rate(msg); + control_system_state->pitch_rate = mavlink_msg_control_system_state_get_pitch_rate(msg); + control_system_state->yaw_rate = mavlink_msg_control_system_state_get_yaw_rate(msg); #else - memcpy(control_system_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN? msg->len : MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN; + memset(control_system_state, 0, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN); + memcpy(control_system_state, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_stream.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_stream.h index 7878a3d..a164d3b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_stream.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_stream.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE DATA_STREAM PACKING #define MAVLINK_MSG_ID_DATA_STREAM 67 -typedef struct __mavlink_data_stream_t -{ +MAVPACKED( +typedef struct __mavlink_data_stream_t { uint16_t message_rate; /*< The message rate*/ uint8_t stream_id; /*< The ID of the requested data stream*/ uint8_t on_off; /*< 1 stream is enabled, 0 stream is stopped.*/ -} mavlink_data_stream_t; +}) mavlink_data_stream_t; #define MAVLINK_MSG_ID_DATA_STREAM_LEN 4 +#define MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN 4 #define MAVLINK_MSG_ID_67_LEN 4 +#define MAVLINK_MSG_ID_67_MIN_LEN 4 #define MAVLINK_MSG_ID_DATA_STREAM_CRC 21 #define MAVLINK_MSG_ID_67_CRC 21 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_DATA_STREAM { \ - "DATA_STREAM", \ - 3, \ - { { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ + 67, \ + "DATA_STREAM", \ + 3, \ + { { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \ { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_DATA_STREAM { \ + "DATA_STREAM", \ + 3, \ + { { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ + { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \ + { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \ + } \ +} +#endif /** * @brief Pack a data_stream message @@ -39,30 +53,26 @@ typedef struct __mavlink_data_stream_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t stream_id, uint16_t message_rate, uint8_t on_off) + uint8_t stream_id, uint16_t message_rate, uint8_t on_off) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; - _mav_put_uint16_t(buf, 0, message_rate); - _mav_put_uint8_t(buf, 2, stream_id); - _mav_put_uint8_t(buf, 3, on_off); + char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; + _mav_put_uint16_t(buf, 0, message_rate); + _mav_put_uint8_t(buf, 2, stream_id); + _mav_put_uint8_t(buf, 3, on_off); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN); #else - mavlink_data_stream_t packet; - packet.message_rate = message_rate; - packet.stream_id = stream_id; - packet.on_off = on_off; + mavlink_data_stream_t packet; + packet.message_rate = message_rate; + packet.stream_id = stream_id; + packet.on_off = on_off; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t stream_id,uint16_t message_rate,uint8_t on_off) + mavlink_message_t* msg, + uint8_t stream_id,uint16_t message_rate,uint8_t on_off) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; - _mav_put_uint16_t(buf, 0, message_rate); - _mav_put_uint8_t(buf, 2, stream_id); - _mav_put_uint8_t(buf, 3, on_off); + char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; + _mav_put_uint16_t(buf, 0, message_rate); + _mav_put_uint8_t(buf, 2, stream_id); + _mav_put_uint8_t(buf, 3, on_off); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN); #else - mavlink_data_stream_t packet; - packet.message_rate = message_rate; - packet.stream_id = stream_id; - packet.on_off = on_off; + mavlink_data_stream_t packet; + packet.message_rate = message_rate; + packet.stream_id = stream_id; + packet.on_off = on_off; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream) { - return mavlink_msg_data_stream_pack(system_id, component_id, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off); + return mavlink_msg_data_stream_pack(system_id, component_id, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream) { - return mavlink_msg_data_stream_pack_chan(system_id, component_id, chan, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off); + return mavlink_msg_data_stream_pack_chan(system_id, component_id, chan, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; - _mav_put_uint16_t(buf, 0, message_rate); - _mav_put_uint8_t(buf, 2, stream_id); - _mav_put_uint8_t(buf, 3, on_off); + char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN]; + _mav_put_uint16_t(buf, 0, message_rate); + _mav_put_uint8_t(buf, 2, stream_id); + _mav_put_uint8_t(buf, 3, on_off); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN); + mavlink_data_stream_t packet; + packet.message_rate = message_rate; + packet.stream_id = stream_id; + packet.on_off = on_off; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); #endif -#else - mavlink_data_stream_t packet; - packet.message_rate = message_rate; - packet.stream_id = stream_id; - packet.on_off = on_off; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); +/** + * @brief Send a data_stream message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_data_stream_send_struct(mavlink_channel_t chan, const mavlink_data_stream_t* data_stream) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_data_stream_send(chan, data_stream->stream_id, data_stream->message_rate, data_stream->on_off); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)data_stream, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_data_stream_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, message_rate); - _mav_put_uint8_t(buf, 2, stream_id); - _mav_put_uint8_t(buf, 3, on_off); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, message_rate); + _mav_put_uint8_t(buf, 2, stream_id); + _mav_put_uint8_t(buf, 3, on_off); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); #else - mavlink_data_stream_t *packet = (mavlink_data_stream_t *)msgbuf; - packet->message_rate = message_rate; - packet->stream_id = stream_id; - packet->on_off = on_off; + mavlink_data_stream_t *packet = (mavlink_data_stream_t *)msgbuf; + packet->message_rate = message_rate; + packet->stream_id = stream_id; + packet->on_off = on_off; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_data_stream_send_buf(mavlink_message_t *msgbuf, m */ static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_messag */ static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -236,7 +240,7 @@ static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_me */ static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -247,11 +251,13 @@ static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t */ static inline void mavlink_msg_data_stream_decode(const mavlink_message_t* msg, mavlink_data_stream_t* data_stream) { -#if MAVLINK_NEED_BYTE_SWAP - data_stream->message_rate = mavlink_msg_data_stream_get_message_rate(msg); - data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg); - data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + data_stream->message_rate = mavlink_msg_data_stream_get_message_rate(msg); + data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg); + data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg); #else - memcpy(data_stream, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA_STREAM_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_STREAM_LEN? msg->len : MAVLINK_MSG_ID_DATA_STREAM_LEN; + memset(data_stream, 0, MAVLINK_MSG_ID_DATA_STREAM_LEN); + memcpy(data_stream, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_transmission_handshake.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_transmission_handshake.h index cbe7153..75207ed 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_transmission_handshake.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_data_transmission_handshake.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE DATA_TRANSMISSION_HANDSHAKE PACKING #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 130 -typedef struct __mavlink_data_transmission_handshake_t -{ +MAVPACKED( +typedef struct __mavlink_data_transmission_handshake_t { uint32_t size; /*< total data size in bytes (set on ACK only)*/ uint16_t width; /*< Width of a matrix or image*/ uint16_t height; /*< Height of a matrix or image*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_data_transmission_handshake_t uint8_t type; /*< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)*/ uint8_t payload; /*< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)*/ uint8_t jpg_quality; /*< JPEG quality out of [1,100]*/ -} mavlink_data_transmission_handshake_t; +}) mavlink_data_transmission_handshake_t; #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 13 +#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN 13 #define MAVLINK_MSG_ID_130_LEN 13 +#define MAVLINK_MSG_ID_130_MIN_LEN 13 #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC 29 #define MAVLINK_MSG_ID_130_CRC 29 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \ - "DATA_TRANSMISSION_HANDSHAKE", \ - 7, \ - { { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \ + 130, \ + "DATA_TRANSMISSION_HANDSHAKE", \ + 7, \ + { { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \ { "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \ { "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \ { "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_data_transmission_handshake_t { "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \ + "DATA_TRANSMISSION_HANDSHAKE", \ + 7, \ + { { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \ + { "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \ + { "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \ + { "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \ + { "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \ + { "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \ + } \ +} +#endif /** * @brief Pack a data_transmission_handshake message @@ -51,38 +69,34 @@ typedef struct __mavlink_data_transmission_handshake_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality) + uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN]; - _mav_put_uint32_t(buf, 0, size); - _mav_put_uint16_t(buf, 4, width); - _mav_put_uint16_t(buf, 6, height); - _mav_put_uint16_t(buf, 8, packets); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, payload); - _mav_put_uint8_t(buf, 12, jpg_quality); + char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN]; + _mav_put_uint32_t(buf, 0, size); + _mav_put_uint16_t(buf, 4, width); + _mav_put_uint16_t(buf, 6, height); + _mav_put_uint16_t(buf, 8, packets); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, payload); + _mav_put_uint8_t(buf, 12, jpg_quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); #else - mavlink_data_transmission_handshake_t packet; - packet.size = size; - packet.width = width; - packet.height = height; - packet.packets = packets; - packet.type = type; - packet.payload = payload; - packet.jpg_quality = jpg_quality; + mavlink_data_transmission_handshake_t packet; + packet.size = size; + packet.width = width; + packet.height = height; + packet.packets = packets; + packet.type = type; + packet.payload = payload; + packet.jpg_quality = jpg_quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t syst * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t type,uint32_t size,uint16_t width,uint16_t height,uint16_t packets,uint8_t payload,uint8_t jpg_quality) + mavlink_message_t* msg, + uint8_t type,uint32_t size,uint16_t width,uint16_t height,uint16_t packets,uint8_t payload,uint8_t jpg_quality) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN]; - _mav_put_uint32_t(buf, 0, size); - _mav_put_uint16_t(buf, 4, width); - _mav_put_uint16_t(buf, 6, height); - _mav_put_uint16_t(buf, 8, packets); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, payload); - _mav_put_uint8_t(buf, 12, jpg_quality); + char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN]; + _mav_put_uint32_t(buf, 0, size); + _mav_put_uint16_t(buf, 4, width); + _mav_put_uint16_t(buf, 6, height); + _mav_put_uint16_t(buf, 8, packets); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, payload); + _mav_put_uint8_t(buf, 12, jpg_quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); #else - mavlink_data_transmission_handshake_t packet; - packet.size = size; - packet.width = width; - packet.height = height; - packet.packets = packets; - packet.type = type; - packet.payload = payload; - packet.jpg_quality = jpg_quality; + mavlink_data_transmission_handshake_t packet; + packet.size = size; + packet.width = width; + packet.height = height; + packet.packets = packets; + packet.type = type; + packet.payload = payload; + packet.jpg_quality = jpg_quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t */ static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake) { - return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality); + return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t sy */ static inline uint16_t mavlink_msg_data_transmission_handshake_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake) { - return mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, chan, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality); + return mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, chan, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_encode_chan(uint8 static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN]; - _mav_put_uint32_t(buf, 0, size); - _mav_put_uint16_t(buf, 4, width); - _mav_put_uint16_t(buf, 6, height); - _mav_put_uint16_t(buf, 8, packets); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, payload); - _mav_put_uint8_t(buf, 12, jpg_quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); + char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN]; + _mav_put_uint32_t(buf, 0, size); + _mav_put_uint16_t(buf, 4, width); + _mav_put_uint16_t(buf, 6, height); + _mav_put_uint16_t(buf, 8, packets); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, payload); + _mav_put_uint8_t(buf, 12, jpg_quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); + mavlink_data_transmission_handshake_t packet; + packet.size = size; + packet.width = width; + packet.height = height; + packet.packets = packets; + packet.type = type; + packet.payload = payload; + packet.jpg_quality = jpg_quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); #endif +} + +/** + * @brief Send a data_transmission_handshake message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_data_transmission_handshake_send_struct(mavlink_channel_t chan, const mavlink_data_transmission_handshake_t* data_transmission_handshake) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_data_transmission_handshake_send(chan, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality); #else - mavlink_data_transmission_handshake_t packet; - packet.size = size; - packet.width = width; - packet.height = height; - packet.packets = packets; - packet.type = type; - packet.payload = payload; - packet.jpg_quality = jpg_quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)data_transmission_handshake, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_ static inline void mavlink_msg_data_transmission_handshake_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, size); - _mav_put_uint16_t(buf, 4, width); - _mav_put_uint16_t(buf, 6, height); - _mav_put_uint16_t(buf, 8, packets); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, payload); - _mav_put_uint8_t(buf, 12, jpg_quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); -#endif -#else - mavlink_data_transmission_handshake_t *packet = (mavlink_data_transmission_handshake_t *)msgbuf; - packet->size = size; - packet->width = width; - packet->height = height; - packet->packets = packets; - packet->type = type; - packet->payload = payload; - packet->jpg_quality = jpg_quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, size); + _mav_put_uint16_t(buf, 4, width); + _mav_put_uint16_t(buf, 6, height); + _mav_put_uint16_t(buf, 8, packets); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, payload); + _mav_put_uint8_t(buf, 12, jpg_quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); -#endif + mavlink_data_transmission_handshake_t *packet = (mavlink_data_transmission_handshake_t *)msgbuf; + packet->size = size; + packet->width = width; + packet->height = height; + packet->packets = packets; + packet->type = type; + packet->payload = payload; + packet->jpg_quality = jpg_quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_data_transmission_handshake_send_buf(mavlink_mess */ static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 10); + return _MAV_RETURN_uint8_t(msg, 10); } /** @@ -278,7 +286,7 @@ static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mav */ static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -288,7 +296,7 @@ static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const ma */ static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -298,7 +306,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const m */ static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 6); + return _MAV_RETURN_uint16_t(msg, 6); } /** @@ -308,7 +316,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const */ static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -318,7 +326,7 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const */ static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 11); + return _MAV_RETURN_uint8_t(msg, 11); } /** @@ -328,7 +336,7 @@ static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const */ static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 12); + return _MAV_RETURN_uint8_t(msg, 12); } /** @@ -339,15 +347,17 @@ static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(co */ static inline void mavlink_msg_data_transmission_handshake_decode(const mavlink_message_t* msg, mavlink_data_transmission_handshake_t* data_transmission_handshake) { -#if MAVLINK_NEED_BYTE_SWAP - data_transmission_handshake->size = mavlink_msg_data_transmission_handshake_get_size(msg); - data_transmission_handshake->width = mavlink_msg_data_transmission_handshake_get_width(msg); - data_transmission_handshake->height = mavlink_msg_data_transmission_handshake_get_height(msg); - data_transmission_handshake->packets = mavlink_msg_data_transmission_handshake_get_packets(msg); - data_transmission_handshake->type = mavlink_msg_data_transmission_handshake_get_type(msg); - data_transmission_handshake->payload = mavlink_msg_data_transmission_handshake_get_payload(msg); - data_transmission_handshake->jpg_quality = mavlink_msg_data_transmission_handshake_get_jpg_quality(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + data_transmission_handshake->size = mavlink_msg_data_transmission_handshake_get_size(msg); + data_transmission_handshake->width = mavlink_msg_data_transmission_handshake_get_width(msg); + data_transmission_handshake->height = mavlink_msg_data_transmission_handshake_get_height(msg); + data_transmission_handshake->packets = mavlink_msg_data_transmission_handshake_get_packets(msg); + data_transmission_handshake->type = mavlink_msg_data_transmission_handshake_get_type(msg); + data_transmission_handshake->payload = mavlink_msg_data_transmission_handshake_get_payload(msg); + data_transmission_handshake->jpg_quality = mavlink_msg_data_transmission_handshake_get_jpg_quality(msg); #else - memcpy(data_transmission_handshake, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN? msg->len : MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN; + memset(data_transmission_handshake, 0, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN); + memcpy(data_transmission_handshake, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug.h index 86ac59b..556664d 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE DEBUG PACKING #define MAVLINK_MSG_ID_DEBUG 254 -typedef struct __mavlink_debug_t -{ +MAVPACKED( +typedef struct __mavlink_debug_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float value; /*< DEBUG value*/ uint8_t ind; /*< index of debug variable*/ -} mavlink_debug_t; +}) mavlink_debug_t; #define MAVLINK_MSG_ID_DEBUG_LEN 9 +#define MAVLINK_MSG_ID_DEBUG_MIN_LEN 9 #define MAVLINK_MSG_ID_254_LEN 9 +#define MAVLINK_MSG_ID_254_MIN_LEN 9 #define MAVLINK_MSG_ID_DEBUG_CRC 46 #define MAVLINK_MSG_ID_254_CRC 46 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_DEBUG { \ - "DEBUG", \ - 3, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \ + 254, \ + "DEBUG", \ + 3, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \ { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \ { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_DEBUG { \ + "DEBUG", \ + 3, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \ + { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \ + { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \ + } \ +} +#endif /** * @brief Pack a debug message @@ -39,30 +53,26 @@ typedef struct __mavlink_debug_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t ind, float value) + uint32_t time_boot_ms, uint8_t ind, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DEBUG_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_uint8_t(buf, 8, ind); + char buf[MAVLINK_MSG_ID_DEBUG_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_uint8_t(buf, 8, ind); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN); #else - mavlink_debug_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - packet.ind = ind; + mavlink_debug_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + packet.ind = ind; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DEBUG; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DEBUG; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t compone * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t ind,float value) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t ind,float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DEBUG_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_uint8_t(buf, 8, ind); + char buf[MAVLINK_MSG_ID_DEBUG_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_uint8_t(buf, 8, ind); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN); #else - mavlink_debug_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - packet.ind = ind; + mavlink_debug_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + packet.ind = ind; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DEBUG; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DEBUG; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_t* debug) { - return mavlink_msg_debug_pack(system_id, component_id, msg, debug->time_boot_ms, debug->ind, debug->value); + return mavlink_msg_debug_pack(system_id, component_id, msg, debug->time_boot_ms, debug->ind, debug->value); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t compo */ static inline uint16_t mavlink_msg_debug_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_t* debug) { - return mavlink_msg_debug_pack_chan(system_id, component_id, chan, msg, debug->time_boot_ms, debug->ind, debug->value); + return mavlink_msg_debug_pack_chan(system_id, component_id, chan, msg, debug->time_boot_ms, debug->ind, debug->value); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_debug_encode_chan(uint8_t system_id, uint8_t static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DEBUG_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_uint8_t(buf, 8, ind); + char buf[MAVLINK_MSG_ID_DEBUG_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_uint8_t(buf, 8, ind); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_LEN); + mavlink_debug_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + packet.ind = ind; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); #endif -#else - mavlink_debug_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - packet.ind = ind; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); +/** + * @brief Send a debug message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_debug_send_struct(mavlink_channel_t chan, const mavlink_debug_t* debug) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_debug_send(chan, debug->time_boot_ms, debug->ind, debug->value); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)debug, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_ static inline void mavlink_msg_debug_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_uint8_t(buf, 8, ind); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_uint8_t(buf, 8, ind); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); #else - mavlink_debug_t *packet = (mavlink_debug_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->value = value; - packet->ind = ind; + mavlink_debug_t *packet = (mavlink_debug_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->value = value; + packet->ind = ind; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)packet, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)packet, MAVLINK_MSG_ID_DEBUG_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_debug_send_buf(mavlink_message_t *msgbuf, mavlink */ static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -226,7 +230,7 @@ static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_ */ static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 8); + return _MAV_RETURN_uint8_t(msg, 8); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg) */ static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -247,11 +251,13 @@ static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg) */ static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlink_debug_t* debug) { -#if MAVLINK_NEED_BYTE_SWAP - debug->time_boot_ms = mavlink_msg_debug_get_time_boot_ms(msg); - debug->value = mavlink_msg_debug_get_value(msg); - debug->ind = mavlink_msg_debug_get_ind(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + debug->time_boot_ms = mavlink_msg_debug_get_time_boot_ms(msg); + debug->value = mavlink_msg_debug_get_value(msg); + debug->ind = mavlink_msg_debug_get_ind(msg); #else - memcpy(debug, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DEBUG_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_LEN; + memset(debug, 0, MAVLINK_MSG_ID_DEBUG_LEN); + memcpy(debug, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug_vect.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug_vect.h index 0a8f5aa..bbf530b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug_vect.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_debug_vect.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE DEBUG_VECT PACKING #define MAVLINK_MSG_ID_DEBUG_VECT 250 -typedef struct __mavlink_debug_vect_t -{ +MAVPACKED( +typedef struct __mavlink_debug_vect_t { uint64_t time_usec; /*< Timestamp*/ float x; /*< x*/ float y; /*< y*/ float z; /*< z*/ char name[10]; /*< Name*/ -} mavlink_debug_vect_t; +}) mavlink_debug_vect_t; #define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30 +#define MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN 30 #define MAVLINK_MSG_ID_250_LEN 30 +#define MAVLINK_MSG_ID_250_MIN_LEN 30 #define MAVLINK_MSG_ID_DEBUG_VECT_CRC 49 #define MAVLINK_MSG_ID_250_CRC 49 #define MAVLINK_MSG_DEBUG_VECT_FIELD_NAME_LEN 10 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \ - "DEBUG_VECT", \ - 5, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \ + 250, \ + "DEBUG_VECT", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \ + "DEBUG_VECT", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \ + { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \ + } \ +} +#endif /** * @brief Pack a debug_vect message @@ -45,32 +61,28 @@ typedef struct __mavlink_debug_vect_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const char *name, uint64_t time_usec, float x, float y, float z) + const char *name, uint64_t time_usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_char_array(buf, 20, name, 10); + char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_char_array(buf, 20, name, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #else - mavlink_debug_vect_t packet; - packet.time_usec = time_usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.name, name, sizeof(char)*10); + mavlink_debug_vect_t packet; + packet.time_usec = time_usec; + packet.x = x; + packet.y = y; + packet.z = z; + mav_array_memcpy(packet.name, name, sizeof(char)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); } /** @@ -87,33 +99,29 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const char *name,uint64_t time_usec,float x,float y,float z) + mavlink_message_t* msg, + const char *name,uint64_t time_usec,float x,float y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_char_array(buf, 20, name, 10); + char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_char_array(buf, 20, name, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #else - mavlink_debug_vect_t packet; - packet.time_usec = time_usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.name, name, sizeof(char)*10); + mavlink_debug_vect_t packet; + packet.time_usec = time_usec; + packet.x = x; + packet.y = y; + packet.z = z; + mav_array_memcpy(packet.name, name, sizeof(char)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); } /** @@ -126,7 +134,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect) { - return mavlink_msg_debug_vect_pack(system_id, component_id, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z); + return mavlink_msg_debug_vect_pack(system_id, component_id, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z); } /** @@ -140,7 +148,7 @@ static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect) { - return mavlink_msg_debug_vect_pack_chan(system_id, component_id, chan, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z); + return mavlink_msg_debug_vect_pack_chan(system_id, component_id, chan, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z); } /** @@ -158,29 +166,35 @@ static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uin static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_char_array(buf, 20, name, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); + char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_char_array(buf, 20, name, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN); + mavlink_debug_vect_t packet; + packet.time_usec = time_usec; + packet.x = x; + packet.y = y; + packet.z = z; + mav_array_memcpy(packet.name, name, sizeof(char)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); #endif +} + +/** + * @brief Send a debug_vect message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_debug_vect_send_struct(mavlink_channel_t chan, const mavlink_debug_vect_t* debug_vect) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_debug_vect_send(chan, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z); #else - mavlink_debug_vect_t packet; - packet.time_usec = time_usec; - packet.x = x; - packet.y = y; - packet.z = z; - mav_array_memcpy(packet.name, name, sizeof(char)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)debug_vect, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); #endif } @@ -195,29 +209,21 @@ static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const cha static inline void mavlink_msg_debug_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_char_array(buf, 20, name, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_char_array(buf, 20, name, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN); -#endif -#else - mavlink_debug_vect_t *packet = (mavlink_debug_vect_t *)msgbuf; - packet->time_usec = time_usec; - packet->x = x; - packet->y = y; - packet->z = z; - mav_array_memcpy(packet->name, name, sizeof(char)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN); -#endif + mavlink_debug_vect_t *packet = (mavlink_debug_vect_t *)msgbuf; + packet->time_usec = time_usec; + packet->x = x; + packet->y = y; + packet->z = z; + mav_array_memcpy(packet->name, name, sizeof(char)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC); #endif } #endif @@ -234,7 +240,7 @@ static inline void mavlink_msg_debug_vect_send_buf(mavlink_message_t *msgbuf, ma */ static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name) { - return _MAV_RETURN_char_array(msg, name, 10, 20); + return _MAV_RETURN_char_array(msg, name, 10, 20); } /** @@ -244,7 +250,7 @@ static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* */ static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -254,7 +260,7 @@ static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_messag */ static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -264,7 +270,7 @@ static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg) */ static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -274,7 +280,7 @@ static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg) */ static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -285,13 +291,15 @@ static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg) */ static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, mavlink_debug_vect_t* debug_vect) { -#if MAVLINK_NEED_BYTE_SWAP - debug_vect->time_usec = mavlink_msg_debug_vect_get_time_usec(msg); - debug_vect->x = mavlink_msg_debug_vect_get_x(msg); - debug_vect->y = mavlink_msg_debug_vect_get_y(msg); - debug_vect->z = mavlink_msg_debug_vect_get_z(msg); - mavlink_msg_debug_vect_get_name(msg, debug_vect->name); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + debug_vect->time_usec = mavlink_msg_debug_vect_get_time_usec(msg); + debug_vect->x = mavlink_msg_debug_vect_get_x(msg); + debug_vect->y = mavlink_msg_debug_vect_get_y(msg); + debug_vect->z = mavlink_msg_debug_vect_get_z(msg); + mavlink_msg_debug_vect_get_name(msg, debug_vect->name); #else - memcpy(debug_vect, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DEBUG_VECT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_VECT_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_VECT_LEN; + memset(debug_vect, 0, MAVLINK_MSG_ID_DEBUG_VECT_LEN); + memcpy(debug_vect, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_distance_sensor.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_distance_sensor.h index 912a6fc..1da3c9a 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_distance_sensor.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_distance_sensor.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE DISTANCE_SENSOR PACKING #define MAVLINK_MSG_ID_DISTANCE_SENSOR 132 -typedef struct __mavlink_distance_sensor_t -{ +MAVPACKED( +typedef struct __mavlink_distance_sensor_t { uint32_t time_boot_ms; /*< Time since system boot*/ uint16_t min_distance; /*< Minimum distance the sensor can measure in centimeters*/ uint16_t max_distance; /*< Maximum distance the sensor can measure in centimeters*/ @@ -12,20 +13,24 @@ typedef struct __mavlink_distance_sensor_t uint8_t id; /*< Onboard ID of the sensor*/ uint8_t orientation; /*< Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.*/ uint8_t covariance; /*< Measurement covariance in centimeters, 0 for unknown / invalid readings*/ -} mavlink_distance_sensor_t; +}) mavlink_distance_sensor_t; #define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14 +#define MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN 14 #define MAVLINK_MSG_ID_132_LEN 14 +#define MAVLINK_MSG_ID_132_MIN_LEN 14 #define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85 #define MAVLINK_MSG_ID_132_CRC 85 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \ - "DISTANCE_SENSOR", \ - 8, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \ + 132, \ + "DISTANCE_SENSOR", \ + 8, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \ { "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \ { "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \ { "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \ @@ -35,7 +40,21 @@ typedef struct __mavlink_distance_sensor_t { "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \ + "DISTANCE_SENSOR", \ + 8, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \ + { "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \ + { "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \ + { "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \ + { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \ + { "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \ + { "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \ + } \ +} +#endif /** * @brief Pack a distance_sensor message @@ -54,40 +73,36 @@ typedef struct __mavlink_distance_sensor_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance) + uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, min_distance); - _mav_put_uint16_t(buf, 6, max_distance); - _mav_put_uint16_t(buf, 8, current_distance); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, id); - _mav_put_uint8_t(buf, 12, orientation); - _mav_put_uint8_t(buf, 13, covariance); + char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, min_distance); + _mav_put_uint16_t(buf, 6, max_distance); + _mav_put_uint16_t(buf, 8, current_distance); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, id); + _mav_put_uint8_t(buf, 12, orientation); + _mav_put_uint8_t(buf, 13, covariance); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); #else - mavlink_distance_sensor_t packet; - packet.time_boot_ms = time_boot_ms; - packet.min_distance = min_distance; - packet.max_distance = max_distance; - packet.current_distance = current_distance; - packet.type = type; - packet.id = id; - packet.orientation = orientation; - packet.covariance = covariance; + mavlink_distance_sensor_t packet; + packet.time_boot_ms = time_boot_ms; + packet.min_distance = min_distance; + packet.max_distance = max_distance; + packet.current_distance = current_distance; + packet.type = type; + packet.id = id; + packet.orientation = orientation; + packet.covariance = covariance; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); } /** @@ -107,41 +122,37 @@ static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t type,uint8_t id,uint8_t orientation,uint8_t covariance) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t type,uint8_t id,uint8_t orientation,uint8_t covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, min_distance); - _mav_put_uint16_t(buf, 6, max_distance); - _mav_put_uint16_t(buf, 8, current_distance); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, id); - _mav_put_uint8_t(buf, 12, orientation); - _mav_put_uint8_t(buf, 13, covariance); + char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, min_distance); + _mav_put_uint16_t(buf, 6, max_distance); + _mav_put_uint16_t(buf, 8, current_distance); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, id); + _mav_put_uint8_t(buf, 12, orientation); + _mav_put_uint8_t(buf, 13, covariance); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); #else - mavlink_distance_sensor_t packet; - packet.time_boot_ms = time_boot_ms; - packet.min_distance = min_distance; - packet.max_distance = max_distance; - packet.current_distance = current_distance; - packet.type = type; - packet.id = id; - packet.orientation = orientation; - packet.covariance = covariance; + mavlink_distance_sensor_t packet; + packet.time_boot_ms = time_boot_ms; + packet.min_distance = min_distance; + packet.max_distance = max_distance; + packet.current_distance = current_distance; + packet.type = type; + packet.id = id; + packet.orientation = orientation; + packet.covariance = covariance; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); } /** @@ -154,7 +165,7 @@ static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor) { - return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); + return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); } /** @@ -168,7 +179,7 @@ static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor) { - return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); + return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); } /** @@ -189,37 +200,43 @@ static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, min_distance); - _mav_put_uint16_t(buf, 6, max_distance); - _mav_put_uint16_t(buf, 8, current_distance); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, id); - _mav_put_uint8_t(buf, 12, orientation); - _mav_put_uint8_t(buf, 13, covariance); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); + char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, min_distance); + _mav_put_uint16_t(buf, 6, max_distance); + _mav_put_uint16_t(buf, 8, current_distance); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, id); + _mav_put_uint8_t(buf, 12, orientation); + _mav_put_uint8_t(buf, 13, covariance); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); + mavlink_distance_sensor_t packet; + packet.time_boot_ms = time_boot_ms; + packet.min_distance = min_distance; + packet.max_distance = max_distance; + packet.current_distance = current_distance; + packet.type = type; + packet.id = id; + packet.orientation = orientation; + packet.covariance = covariance; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); #endif +} + +/** + * @brief Send a distance_sensor message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_distance_sensor_send_struct(mavlink_channel_t chan, const mavlink_distance_sensor_t* distance_sensor) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_distance_sensor_send(chan, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance); #else - mavlink_distance_sensor_t packet; - packet.time_boot_ms = time_boot_ms; - packet.min_distance = min_distance; - packet.max_distance = max_distance; - packet.current_distance = current_distance; - packet.type = type; - packet.id = id; - packet.orientation = orientation; - packet.covariance = covariance; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)distance_sensor, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); #endif } @@ -234,37 +251,29 @@ static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, min_distance); - _mav_put_uint16_t(buf, 6, max_distance); - _mav_put_uint16_t(buf, 8, current_distance); - _mav_put_uint8_t(buf, 10, type); - _mav_put_uint8_t(buf, 11, id); - _mav_put_uint8_t(buf, 12, orientation); - _mav_put_uint8_t(buf, 13, covariance); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); -#endif -#else - mavlink_distance_sensor_t *packet = (mavlink_distance_sensor_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->min_distance = min_distance; - packet->max_distance = max_distance; - packet->current_distance = current_distance; - packet->type = type; - packet->id = id; - packet->orientation = orientation; - packet->covariance = covariance; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, min_distance); + _mav_put_uint16_t(buf, 6, max_distance); + _mav_put_uint16_t(buf, 8, current_distance); + _mav_put_uint8_t(buf, 10, type); + _mav_put_uint8_t(buf, 11, id); + _mav_put_uint8_t(buf, 12, orientation); + _mav_put_uint8_t(buf, 13, covariance); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); -#endif + mavlink_distance_sensor_t *packet = (mavlink_distance_sensor_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->min_distance = min_distance; + packet->max_distance = max_distance; + packet->current_distance = current_distance; + packet->type = type; + packet->id = id; + packet->orientation = orientation; + packet->covariance = covariance; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC); #endif } #endif @@ -281,7 +290,7 @@ static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbu */ static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -291,7 +300,7 @@ static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlin */ static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -301,7 +310,7 @@ static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(const mavlin */ static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 6); + return _MAV_RETURN_uint16_t(msg, 6); } /** @@ -311,7 +320,7 @@ static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(const mavlin */ static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -321,7 +330,7 @@ static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const ma */ static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 10); + return _MAV_RETURN_uint8_t(msg, 10); } /** @@ -331,7 +340,7 @@ static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message */ static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 11); + return _MAV_RETURN_uint8_t(msg, 11); } /** @@ -341,7 +350,7 @@ static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t */ static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 12); + return _MAV_RETURN_uint8_t(msg, 12); } /** @@ -351,7 +360,7 @@ static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_ */ static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 13); + return _MAV_RETURN_uint8_t(msg, 13); } /** @@ -362,16 +371,18 @@ static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_m */ static inline void mavlink_msg_distance_sensor_decode(const mavlink_message_t* msg, mavlink_distance_sensor_t* distance_sensor) { -#if MAVLINK_NEED_BYTE_SWAP - distance_sensor->time_boot_ms = mavlink_msg_distance_sensor_get_time_boot_ms(msg); - distance_sensor->min_distance = mavlink_msg_distance_sensor_get_min_distance(msg); - distance_sensor->max_distance = mavlink_msg_distance_sensor_get_max_distance(msg); - distance_sensor->current_distance = mavlink_msg_distance_sensor_get_current_distance(msg); - distance_sensor->type = mavlink_msg_distance_sensor_get_type(msg); - distance_sensor->id = mavlink_msg_distance_sensor_get_id(msg); - distance_sensor->orientation = mavlink_msg_distance_sensor_get_orientation(msg); - distance_sensor->covariance = mavlink_msg_distance_sensor_get_covariance(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + distance_sensor->time_boot_ms = mavlink_msg_distance_sensor_get_time_boot_ms(msg); + distance_sensor->min_distance = mavlink_msg_distance_sensor_get_min_distance(msg); + distance_sensor->max_distance = mavlink_msg_distance_sensor_get_max_distance(msg); + distance_sensor->current_distance = mavlink_msg_distance_sensor_get_current_distance(msg); + distance_sensor->type = mavlink_msg_distance_sensor_get_type(msg); + distance_sensor->id = mavlink_msg_distance_sensor_get_id(msg); + distance_sensor->orientation = mavlink_msg_distance_sensor_get_orientation(msg); + distance_sensor->covariance = mavlink_msg_distance_sensor_get_covariance(msg); #else - memcpy(distance_sensor, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN; + memset(distance_sensor, 0, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN); + memcpy(distance_sensor, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_encapsulated_data.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_encapsulated_data.h index 063956c..4410283 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_encapsulated_data.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_encapsulated_data.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE ENCAPSULATED_DATA PACKING #define MAVLINK_MSG_ID_ENCAPSULATED_DATA 131 -typedef struct __mavlink_encapsulated_data_t -{ +MAVPACKED( +typedef struct __mavlink_encapsulated_data_t { uint16_t seqnr; /*< sequence number (starting with 0 on every transmission)*/ uint8_t data[253]; /*< image data bytes*/ -} mavlink_encapsulated_data_t; +}) mavlink_encapsulated_data_t; #define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255 +#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN 255 #define MAVLINK_MSG_ID_131_LEN 255 +#define MAVLINK_MSG_ID_131_MIN_LEN 255 #define MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC 223 #define MAVLINK_MSG_ID_131_CRC 223 #define MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_DATA_LEN 253 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \ - "ENCAPSULATED_DATA", \ - 2, \ - { { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \ + 131, \ + "ENCAPSULATED_DATA", \ + 2, \ + { { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \ { "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \ + "ENCAPSULATED_DATA", \ + 2, \ + { { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \ + } \ +} +#endif /** * @brief Pack a encapsulated_data message @@ -36,26 +49,22 @@ typedef struct __mavlink_encapsulated_data_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t seqnr, const uint8_t *data) + uint16_t seqnr, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN]; - _mav_put_uint16_t(buf, 0, seqnr); - _mav_put_uint8_t_array(buf, 2, data, 253); + char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN]; + _mav_put_uint16_t(buf, 0, seqnr); + _mav_put_uint8_t_array(buf, 2, data, 253); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); #else - mavlink_encapsulated_data_t packet; - packet.seqnr = seqnr; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253); + mavlink_encapsulated_data_t packet; + packet.seqnr = seqnr; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); } /** @@ -69,27 +78,23 @@ static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t seqnr,const uint8_t *data) + mavlink_message_t* msg, + uint16_t seqnr,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN]; - _mav_put_uint16_t(buf, 0, seqnr); - _mav_put_uint8_t_array(buf, 2, data, 253); + char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN]; + _mav_put_uint16_t(buf, 0, seqnr); + _mav_put_uint8_t_array(buf, 2, data, 253); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); #else - mavlink_encapsulated_data_t packet; - packet.seqnr = seqnr; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253); + mavlink_encapsulated_data_t packet; + packet.seqnr = seqnr; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); } /** @@ -102,7 +107,7 @@ static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id */ static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data) { - return mavlink_msg_encapsulated_data_pack(system_id, component_id, msg, encapsulated_data->seqnr, encapsulated_data->data); + return mavlink_msg_encapsulated_data_pack(system_id, component_id, msg, encapsulated_data->seqnr, encapsulated_data->data); } /** @@ -116,7 +121,7 @@ static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, u */ static inline uint16_t mavlink_msg_encapsulated_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data) { - return mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, chan, msg, encapsulated_data->seqnr, encapsulated_data->data); + return mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, chan, msg, encapsulated_data->seqnr, encapsulated_data->data); } /** @@ -131,23 +136,29 @@ static inline uint16_t mavlink_msg_encapsulated_data_encode_chan(uint8_t system_ static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN]; - _mav_put_uint16_t(buf, 0, seqnr); - _mav_put_uint8_t_array(buf, 2, data, 253); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); + char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN]; + _mav_put_uint16_t(buf, 0, seqnr); + _mav_put_uint8_t_array(buf, 2, data, 253); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); + mavlink_encapsulated_data_t packet; + packet.seqnr = seqnr; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)&packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); #endif +} + +/** + * @brief Send a encapsulated_data message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_encapsulated_data_send_struct(mavlink_channel_t chan, const mavlink_encapsulated_data_t* encapsulated_data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_encapsulated_data_send(chan, encapsulated_data->seqnr, encapsulated_data->data); #else - mavlink_encapsulated_data_t packet; - packet.seqnr = seqnr; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)&packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)&packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)encapsulated_data, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); #endif } @@ -162,23 +173,15 @@ static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, ui static inline void mavlink_msg_encapsulated_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, seqnr); - _mav_put_uint8_t_array(buf, 2, data, 253); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); -#endif + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, seqnr); + _mav_put_uint8_t_array(buf, 2, data, 253); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); #else - mavlink_encapsulated_data_t *packet = (mavlink_encapsulated_data_t *)msgbuf; - packet->seqnr = seqnr; - mav_array_memcpy(packet->data, data, sizeof(uint8_t)*253); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); -#endif + mavlink_encapsulated_data_t *packet = (mavlink_encapsulated_data_t *)msgbuf; + packet->seqnr = seqnr; + mav_array_memcpy(packet->data, data, sizeof(uint8_t)*253); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC); #endif } #endif @@ -195,7 +198,7 @@ static inline void mavlink_msg_encapsulated_data_send_buf(mavlink_message_t *msg */ static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -205,7 +208,7 @@ static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_mes */ static inline uint16_t mavlink_msg_encapsulated_data_get_data(const mavlink_message_t* msg, uint8_t *data) { - return _MAV_RETURN_uint8_t_array(msg, data, 253, 2); + return _MAV_RETURN_uint8_t_array(msg, data, 253, 2); } /** @@ -216,10 +219,12 @@ static inline uint16_t mavlink_msg_encapsulated_data_get_data(const mavlink_mess */ static inline void mavlink_msg_encapsulated_data_decode(const mavlink_message_t* msg, mavlink_encapsulated_data_t* encapsulated_data) { -#if MAVLINK_NEED_BYTE_SWAP - encapsulated_data->seqnr = mavlink_msg_encapsulated_data_get_seqnr(msg); - mavlink_msg_encapsulated_data_get_data(msg, encapsulated_data->data); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + encapsulated_data->seqnr = mavlink_msg_encapsulated_data_get_seqnr(msg); + mavlink_msg_encapsulated_data_get_data(msg, encapsulated_data->data); #else - memcpy(encapsulated_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN? msg->len : MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN; + memset(encapsulated_data, 0, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN); + memcpy(encapsulated_data, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_estimator_status.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_estimator_status.h index 588b7eb..2ecd9d7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_estimator_status.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_estimator_status.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE ESTIMATOR_STATUS PACKING #define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230 -typedef struct __mavlink_estimator_status_t -{ +MAVPACKED( +typedef struct __mavlink_estimator_status_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float vel_ratio; /*< Velocity innovation test ratio*/ float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_estimator_status_t float pos_horiz_accuracy; /*< Horizontal position 1-STD accuracy relative to the EKF local origin (m)*/ float pos_vert_accuracy; /*< Vertical position 1-STD accuracy relative to the EKF local origin (m)*/ uint16_t flags; /*< Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.*/ -} mavlink_estimator_status_t; +}) mavlink_estimator_status_t; #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42 +#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN 42 #define MAVLINK_MSG_ID_230_LEN 42 +#define MAVLINK_MSG_ID_230_MIN_LEN 42 #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC 163 #define MAVLINK_MSG_ID_230_CRC 163 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \ - "ESTIMATOR_STATUS", \ - 10, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \ + 230, \ + "ESTIMATOR_STATUS", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \ { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \ { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \ { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_estimator_status_t { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \ + "ESTIMATOR_STATUS", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \ + { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \ + { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \ + { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \ + { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \ + { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \ + { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \ + { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \ + { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \ + } \ +} +#endif /** * @brief Pack a estimator_status message @@ -60,44 +81,40 @@ typedef struct __mavlink_estimator_status_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy) + uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vel_ratio); - _mav_put_float(buf, 12, pos_horiz_ratio); - _mav_put_float(buf, 16, pos_vert_ratio); - _mav_put_float(buf, 20, mag_ratio); - _mav_put_float(buf, 24, hagl_ratio); - _mav_put_float(buf, 28, tas_ratio); - _mav_put_float(buf, 32, pos_horiz_accuracy); - _mav_put_float(buf, 36, pos_vert_accuracy); - _mav_put_uint16_t(buf, 40, flags); + char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vel_ratio); + _mav_put_float(buf, 12, pos_horiz_ratio); + _mav_put_float(buf, 16, pos_vert_ratio); + _mav_put_float(buf, 20, mag_ratio); + _mav_put_float(buf, 24, hagl_ratio); + _mav_put_float(buf, 28, tas_ratio); + _mav_put_float(buf, 32, pos_horiz_accuracy); + _mav_put_float(buf, 36, pos_vert_accuracy); + _mav_put_uint16_t(buf, 40, flags); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); #else - mavlink_estimator_status_t packet; - packet.time_usec = time_usec; - packet.vel_ratio = vel_ratio; - packet.pos_horiz_ratio = pos_horiz_ratio; - packet.pos_vert_ratio = pos_vert_ratio; - packet.mag_ratio = mag_ratio; - packet.hagl_ratio = hagl_ratio; - packet.tas_ratio = tas_ratio; - packet.pos_horiz_accuracy = pos_horiz_accuracy; - packet.pos_vert_accuracy = pos_vert_accuracy; - packet.flags = flags; + mavlink_estimator_status_t packet; + packet.time_usec = time_usec; + packet.vel_ratio = vel_ratio; + packet.pos_horiz_ratio = pos_horiz_ratio; + packet.pos_vert_ratio = pos_vert_ratio; + packet.mag_ratio = mag_ratio; + packet.hagl_ratio = hagl_ratio; + packet.tas_ratio = tas_ratio; + packet.pos_horiz_accuracy = pos_horiz_accuracy; + packet.pos_vert_accuracy = pos_vert_accuracy; + packet.flags = flags; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint16_t flags,float vel_ratio,float pos_horiz_ratio,float pos_vert_ratio,float mag_ratio,float hagl_ratio,float tas_ratio,float pos_horiz_accuracy,float pos_vert_accuracy) + mavlink_message_t* msg, + uint64_t time_usec,uint16_t flags,float vel_ratio,float pos_horiz_ratio,float pos_vert_ratio,float mag_ratio,float hagl_ratio,float tas_ratio,float pos_horiz_accuracy,float pos_vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vel_ratio); - _mav_put_float(buf, 12, pos_horiz_ratio); - _mav_put_float(buf, 16, pos_vert_ratio); - _mav_put_float(buf, 20, mag_ratio); - _mav_put_float(buf, 24, hagl_ratio); - _mav_put_float(buf, 28, tas_ratio); - _mav_put_float(buf, 32, pos_horiz_accuracy); - _mav_put_float(buf, 36, pos_vert_accuracy); - _mav_put_uint16_t(buf, 40, flags); + char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vel_ratio); + _mav_put_float(buf, 12, pos_horiz_ratio); + _mav_put_float(buf, 16, pos_vert_ratio); + _mav_put_float(buf, 20, mag_ratio); + _mav_put_float(buf, 24, hagl_ratio); + _mav_put_float(buf, 28, tas_ratio); + _mav_put_float(buf, 32, pos_horiz_accuracy); + _mav_put_float(buf, 36, pos_vert_accuracy); + _mav_put_uint16_t(buf, 40, flags); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); #else - mavlink_estimator_status_t packet; - packet.time_usec = time_usec; - packet.vel_ratio = vel_ratio; - packet.pos_horiz_ratio = pos_horiz_ratio; - packet.pos_vert_ratio = pos_vert_ratio; - packet.mag_ratio = mag_ratio; - packet.hagl_ratio = hagl_ratio; - packet.tas_ratio = tas_ratio; - packet.pos_horiz_accuracy = pos_horiz_accuracy; - packet.pos_vert_accuracy = pos_vert_accuracy; - packet.flags = flags; + mavlink_estimator_status_t packet; + packet.time_usec = time_usec; + packet.vel_ratio = vel_ratio; + packet.pos_horiz_ratio = pos_horiz_ratio; + packet.pos_vert_ratio = pos_vert_ratio; + packet.mag_ratio = mag_ratio; + packet.hagl_ratio = hagl_ratio; + packet.tas_ratio = tas_ratio; + packet.pos_horiz_accuracy = pos_horiz_accuracy; + packet.pos_vert_accuracy = pos_vert_accuracy; + packet.flags = flags; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_estimator_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status) { - return mavlink_msg_estimator_status_pack(system_id, component_id, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy); + return mavlink_msg_estimator_status_pack(system_id, component_id, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_estimator_status_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status) { - return mavlink_msg_estimator_status_pack_chan(system_id, component_id, chan, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy); + return mavlink_msg_estimator_status_pack_chan(system_id, component_id, chan, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_i static inline void mavlink_msg_estimator_status_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vel_ratio); - _mav_put_float(buf, 12, pos_horiz_ratio); - _mav_put_float(buf, 16, pos_vert_ratio); - _mav_put_float(buf, 20, mag_ratio); - _mav_put_float(buf, 24, hagl_ratio); - _mav_put_float(buf, 28, tas_ratio); - _mav_put_float(buf, 32, pos_horiz_accuracy); - _mav_put_float(buf, 36, pos_vert_accuracy); - _mav_put_uint16_t(buf, 40, flags); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); + char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vel_ratio); + _mav_put_float(buf, 12, pos_horiz_ratio); + _mav_put_float(buf, 16, pos_vert_ratio); + _mav_put_float(buf, 20, mag_ratio); + _mav_put_float(buf, 24, hagl_ratio); + _mav_put_float(buf, 28, tas_ratio); + _mav_put_float(buf, 32, pos_horiz_accuracy); + _mav_put_float(buf, 36, pos_vert_accuracy); + _mav_put_uint16_t(buf, 40, flags); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); + mavlink_estimator_status_t packet; + packet.time_usec = time_usec; + packet.vel_ratio = vel_ratio; + packet.pos_horiz_ratio = pos_horiz_ratio; + packet.pos_vert_ratio = pos_vert_ratio; + packet.mag_ratio = mag_ratio; + packet.hagl_ratio = hagl_ratio; + packet.tas_ratio = tas_ratio; + packet.pos_horiz_accuracy = pos_horiz_accuracy; + packet.pos_vert_accuracy = pos_vert_accuracy; + packet.flags = flags; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); #endif +} + +/** + * @brief Send a estimator_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_estimator_status_send_struct(mavlink_channel_t chan, const mavlink_estimator_status_t* estimator_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_estimator_status_send(chan, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy); #else - mavlink_estimator_status_t packet; - packet.time_usec = time_usec; - packet.vel_ratio = vel_ratio; - packet.pos_horiz_ratio = pos_horiz_ratio; - packet.pos_vert_ratio = pos_vert_ratio; - packet.mag_ratio = mag_ratio; - packet.hagl_ratio = hagl_ratio; - packet.tas_ratio = tas_ratio; - packet.pos_horiz_accuracy = pos_horiz_accuracy; - packet.pos_vert_accuracy = pos_vert_accuracy; - packet.flags = flags; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)estimator_status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_estimator_status_send(mavlink_channel_t chan, uin static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vel_ratio); - _mav_put_float(buf, 12, pos_horiz_ratio); - _mav_put_float(buf, 16, pos_vert_ratio); - _mav_put_float(buf, 20, mag_ratio); - _mav_put_float(buf, 24, hagl_ratio); - _mav_put_float(buf, 28, tas_ratio); - _mav_put_float(buf, 32, pos_horiz_accuracy); - _mav_put_float(buf, 36, pos_vert_accuracy); - _mav_put_uint16_t(buf, 40, flags); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); -#endif -#else - mavlink_estimator_status_t *packet = (mavlink_estimator_status_t *)msgbuf; - packet->time_usec = time_usec; - packet->vel_ratio = vel_ratio; - packet->pos_horiz_ratio = pos_horiz_ratio; - packet->pos_vert_ratio = pos_vert_ratio; - packet->mag_ratio = mag_ratio; - packet->hagl_ratio = hagl_ratio; - packet->tas_ratio = tas_ratio; - packet->pos_horiz_accuracy = pos_horiz_accuracy; - packet->pos_vert_accuracy = pos_vert_accuracy; - packet->flags = flags; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vel_ratio); + _mav_put_float(buf, 12, pos_horiz_ratio); + _mav_put_float(buf, 16, pos_vert_ratio); + _mav_put_float(buf, 20, mag_ratio); + _mav_put_float(buf, 24, hagl_ratio); + _mav_put_float(buf, 28, tas_ratio); + _mav_put_float(buf, 32, pos_horiz_accuracy); + _mav_put_float(buf, 36, pos_vert_accuracy); + _mav_put_uint16_t(buf, 40, flags); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); -#endif + mavlink_estimator_status_t *packet = (mavlink_estimator_status_t *)msgbuf; + packet->time_usec = time_usec; + packet->vel_ratio = vel_ratio; + packet->pos_horiz_ratio = pos_horiz_ratio; + packet->pos_vert_ratio = pos_vert_ratio; + packet->mag_ratio = mag_ratio; + packet->hagl_ratio = hagl_ratio; + packet->tas_ratio = tas_ratio; + packet->pos_horiz_accuracy = pos_horiz_accuracy; + packet->pos_vert_accuracy = pos_vert_accuracy; + packet->flags = flags; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgb */ static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -317,7 +328,7 @@ static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_ */ static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 40); + return _MAV_RETURN_uint16_t(msg, 40); } /** @@ -327,7 +338,7 @@ static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_mess */ static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -337,7 +348,7 @@ static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_mes */ static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -347,7 +358,7 @@ static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavli */ static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -357,7 +368,7 @@ static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlin */ static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -367,7 +378,7 @@ static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_mes */ static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -377,7 +388,7 @@ static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_me */ static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -387,7 +398,7 @@ static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_mes */ static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -397,7 +408,7 @@ static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const ma */ static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -408,18 +419,20 @@ static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mav */ static inline void mavlink_msg_estimator_status_decode(const mavlink_message_t* msg, mavlink_estimator_status_t* estimator_status) { -#if MAVLINK_NEED_BYTE_SWAP - estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg); - estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg); - estimator_status->pos_horiz_ratio = mavlink_msg_estimator_status_get_pos_horiz_ratio(msg); - estimator_status->pos_vert_ratio = mavlink_msg_estimator_status_get_pos_vert_ratio(msg); - estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg); - estimator_status->hagl_ratio = mavlink_msg_estimator_status_get_hagl_ratio(msg); - estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg); - estimator_status->pos_horiz_accuracy = mavlink_msg_estimator_status_get_pos_horiz_accuracy(msg); - estimator_status->pos_vert_accuracy = mavlink_msg_estimator_status_get_pos_vert_accuracy(msg); - estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg); + estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg); + estimator_status->pos_horiz_ratio = mavlink_msg_estimator_status_get_pos_horiz_ratio(msg); + estimator_status->pos_vert_ratio = mavlink_msg_estimator_status_get_pos_vert_ratio(msg); + estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg); + estimator_status->hagl_ratio = mavlink_msg_estimator_status_get_hagl_ratio(msg); + estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg); + estimator_status->pos_horiz_accuracy = mavlink_msg_estimator_status_get_pos_horiz_accuracy(msg); + estimator_status->pos_vert_accuracy = mavlink_msg_estimator_status_get_pos_vert_accuracy(msg); + estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg); #else - memcpy(estimator_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN; + memset(estimator_status, 0, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN); + memcpy(estimator_status, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_extended_sys_state.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_extended_sys_state.h index b08ebea..525c92d 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_extended_sys_state.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_extended_sys_state.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE EXTENDED_SYS_STATE PACKING #define MAVLINK_MSG_ID_EXTENDED_SYS_STATE 245 -typedef struct __mavlink_extended_sys_state_t -{ +MAVPACKED( +typedef struct __mavlink_extended_sys_state_t { uint8_t vtol_state; /*< The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.*/ uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/ -} mavlink_extended_sys_state_t; +}) mavlink_extended_sys_state_t; #define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN 2 +#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN 2 #define MAVLINK_MSG_ID_245_LEN 2 +#define MAVLINK_MSG_ID_245_MIN_LEN 2 #define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC 130 #define MAVLINK_MSG_ID_245_CRC 130 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \ - "EXTENDED_SYS_STATE", \ - 2, \ - { { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \ + 245, \ + "EXTENDED_SYS_STATE", \ + 2, \ + { { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \ { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \ + "EXTENDED_SYS_STATE", \ + 2, \ + { { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \ + { "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \ + } \ +} +#endif /** * @brief Pack a extended_sys_state message @@ -36,28 +49,24 @@ typedef struct __mavlink_extended_sys_state_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_extended_sys_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t vtol_state, uint8_t landed_state) + uint8_t vtol_state, uint8_t landed_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN]; - _mav_put_uint8_t(buf, 0, vtol_state); - _mav_put_uint8_t(buf, 1, landed_state); + char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN]; + _mav_put_uint8_t(buf, 0, vtol_state); + _mav_put_uint8_t(buf, 1, landed_state); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); #else - mavlink_extended_sys_state_t packet; - packet.vtol_state = vtol_state; - packet.landed_state = landed_state; + mavlink_extended_sys_state_t packet; + packet.vtol_state = vtol_state; + packet.landed_state = landed_state; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_extended_sys_state_pack(uint8_t system_id, ui * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_extended_sys_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t vtol_state,uint8_t landed_state) + mavlink_message_t* msg, + uint8_t vtol_state,uint8_t landed_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN]; - _mav_put_uint8_t(buf, 0, vtol_state); - _mav_put_uint8_t(buf, 1, landed_state); + char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN]; + _mav_put_uint8_t(buf, 0, vtol_state); + _mav_put_uint8_t(buf, 1, landed_state); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); #else - mavlink_extended_sys_state_t packet; - packet.vtol_state = vtol_state; - packet.landed_state = landed_state; + mavlink_extended_sys_state_t packet; + packet.vtol_state = vtol_state; + packet.landed_state = landed_state; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_extended_sys_state_pack_chan(uint8_t system_i */ static inline uint16_t mavlink_msg_extended_sys_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state) { - return mavlink_msg_extended_sys_state_pack(system_id, component_id, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state); + return mavlink_msg_extended_sys_state_pack(system_id, component_id, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_extended_sys_state_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_extended_sys_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state) { - return mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, chan, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state); + return mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, chan, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_extended_sys_state_encode_chan(uint8_t system static inline void mavlink_msg_extended_sys_state_send(mavlink_channel_t chan, uint8_t vtol_state, uint8_t landed_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN]; - _mav_put_uint8_t(buf, 0, vtol_state); - _mav_put_uint8_t(buf, 1, landed_state); + char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN]; + _mav_put_uint8_t(buf, 0, vtol_state); + _mav_put_uint8_t(buf, 1, landed_state); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); + mavlink_extended_sys_state_t packet; + packet.vtol_state = vtol_state; + packet.landed_state = landed_state; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)&packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); #endif -#else - mavlink_extended_sys_state_t packet; - packet.vtol_state = vtol_state; - packet.landed_state = landed_state; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)&packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); +/** + * @brief Send a extended_sys_state message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_extended_sys_state_send_struct(mavlink_channel_t chan, const mavlink_extended_sys_state_t* extended_sys_state) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_extended_sys_state_send(chan, extended_sys_state->vtol_state, extended_sys_state->landed_state); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)&packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)extended_sys_state, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_extended_sys_state_send(mavlink_channel_t chan, u static inline void mavlink_msg_extended_sys_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t vtol_state, uint8_t landed_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, vtol_state); - _mav_put_uint8_t(buf, 1, landed_state); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, vtol_state); + _mav_put_uint8_t(buf, 1, landed_state); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); #else - mavlink_extended_sys_state_t *packet = (mavlink_extended_sys_state_t *)msgbuf; - packet->vtol_state = vtol_state; - packet->landed_state = landed_state; + mavlink_extended_sys_state_t *packet = (mavlink_extended_sys_state_t *)msgbuf; + packet->vtol_state = vtol_state; + packet->landed_state = landed_state; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_extended_sys_state_send_buf(mavlink_message_t *ms */ static inline uint8_t mavlink_msg_extended_sys_state_get_vtol_state(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint8_t mavlink_msg_extended_sys_state_get_vtol_state(const mavlin */ static inline uint8_t mavlink_msg_extended_sys_state_get_landed_state(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -224,10 +227,12 @@ static inline uint8_t mavlink_msg_extended_sys_state_get_landed_state(const mavl */ static inline void mavlink_msg_extended_sys_state_decode(const mavlink_message_t* msg, mavlink_extended_sys_state_t* extended_sys_state) { -#if MAVLINK_NEED_BYTE_SWAP - extended_sys_state->vtol_state = mavlink_msg_extended_sys_state_get_vtol_state(msg); - extended_sys_state->landed_state = mavlink_msg_extended_sys_state_get_landed_state(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + extended_sys_state->vtol_state = mavlink_msg_extended_sys_state_get_vtol_state(msg); + extended_sys_state->landed_state = mavlink_msg_extended_sys_state_get_landed_state(msg); #else - memcpy(extended_sys_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN? msg->len : MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN; + memset(extended_sys_state, 0, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN); + memcpy(extended_sys_state, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_file_transfer_protocol.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_file_transfer_protocol.h index cf65b3e..3616098 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_file_transfer_protocol.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_file_transfer_protocol.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE FILE_TRANSFER_PROTOCOL PACKING #define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL 110 -typedef struct __mavlink_file_transfer_protocol_t -{ +MAVPACKED( +typedef struct __mavlink_file_transfer_protocol_t { uint8_t target_network; /*< Network ID (0 for broadcast)*/ uint8_t target_system; /*< System ID (0 for broadcast)*/ uint8_t target_component; /*< Component ID (0 for broadcast)*/ uint8_t payload[251]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/ -} mavlink_file_transfer_protocol_t; +}) mavlink_file_transfer_protocol_t; #define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN 254 +#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN 254 #define MAVLINK_MSG_ID_110_LEN 254 +#define MAVLINK_MSG_ID_110_MIN_LEN 254 #define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC 84 #define MAVLINK_MSG_ID_110_CRC 84 #define MAVLINK_MSG_FILE_TRANSFER_PROTOCOL_FIELD_PAYLOAD_LEN 251 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \ - "FILE_TRANSFER_PROTOCOL", \ - 4, \ - { { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \ + 110, \ + "FILE_TRANSFER_PROTOCOL", \ + 4, \ + { { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \ { "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \ + "FILE_TRANSFER_PROTOCOL", \ + 4, \ + { { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \ + { "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \ + } \ +} +#endif /** * @brief Pack a file_transfer_protocol message @@ -42,30 +57,26 @@ typedef struct __mavlink_file_transfer_protocol_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_file_transfer_protocol_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload) + uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN]; - _mav_put_uint8_t(buf, 0, target_network); - _mav_put_uint8_t(buf, 1, target_system); - _mav_put_uint8_t(buf, 2, target_component); - _mav_put_uint8_t_array(buf, 3, payload, 251); + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN]; + _mav_put_uint8_t(buf, 0, target_network); + _mav_put_uint8_t(buf, 1, target_system); + _mav_put_uint8_t(buf, 2, target_component); + _mav_put_uint8_t_array(buf, 3, payload, 251); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); #else - mavlink_file_transfer_protocol_t packet; - packet.target_network = target_network; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251); + mavlink_file_transfer_protocol_t packet; + packet.target_network = target_network; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); } /** @@ -81,31 +92,27 @@ static inline uint16_t mavlink_msg_file_transfer_protocol_pack(uint8_t system_id * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_file_transfer_protocol_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_network,uint8_t target_system,uint8_t target_component,const uint8_t *payload) + mavlink_message_t* msg, + uint8_t target_network,uint8_t target_system,uint8_t target_component,const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN]; - _mav_put_uint8_t(buf, 0, target_network); - _mav_put_uint8_t(buf, 1, target_system); - _mav_put_uint8_t(buf, 2, target_component); - _mav_put_uint8_t_array(buf, 3, payload, 251); + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN]; + _mav_put_uint8_t(buf, 0, target_network); + _mav_put_uint8_t(buf, 1, target_system); + _mav_put_uint8_t(buf, 2, target_component); + _mav_put_uint8_t_array(buf, 3, payload, 251); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); #else - mavlink_file_transfer_protocol_t packet; - packet.target_network = target_network; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251); + mavlink_file_transfer_protocol_t packet; + packet.target_network = target_network; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); } /** @@ -118,7 +125,7 @@ static inline uint16_t mavlink_msg_file_transfer_protocol_pack_chan(uint8_t syst */ static inline uint16_t mavlink_msg_file_transfer_protocol_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol) { - return mavlink_msg_file_transfer_protocol_pack(system_id, component_id, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload); + return mavlink_msg_file_transfer_protocol_pack(system_id, component_id, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload); } /** @@ -132,7 +139,7 @@ static inline uint16_t mavlink_msg_file_transfer_protocol_encode(uint8_t system_ */ static inline uint16_t mavlink_msg_file_transfer_protocol_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol) { - return mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, chan, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload); + return mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, chan, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload); } /** @@ -149,27 +156,33 @@ static inline uint16_t mavlink_msg_file_transfer_protocol_encode_chan(uint8_t sy static inline void mavlink_msg_file_transfer_protocol_send(mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN]; - _mav_put_uint8_t(buf, 0, target_network); - _mav_put_uint8_t(buf, 1, target_system); - _mav_put_uint8_t(buf, 2, target_component); - _mav_put_uint8_t_array(buf, 3, payload, 251); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); + char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN]; + _mav_put_uint8_t(buf, 0, target_network); + _mav_put_uint8_t(buf, 1, target_system); + _mav_put_uint8_t(buf, 2, target_component); + _mav_put_uint8_t_array(buf, 3, payload, 251); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); + mavlink_file_transfer_protocol_t packet; + packet.target_network = target_network; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); #endif +} + +/** + * @brief Send a file_transfer_protocol message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_file_transfer_protocol_send_struct(mavlink_channel_t chan, const mavlink_file_transfer_protocol_t* file_transfer_protocol) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_file_transfer_protocol_send(chan, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload); #else - mavlink_file_transfer_protocol_t packet; - packet.target_network = target_network; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)file_transfer_protocol, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); #endif } @@ -184,27 +197,19 @@ static inline void mavlink_msg_file_transfer_protocol_send(mavlink_channel_t cha static inline void mavlink_msg_file_transfer_protocol_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_network); - _mav_put_uint8_t(buf, 1, target_system); - _mav_put_uint8_t(buf, 2, target_component); - _mav_put_uint8_t_array(buf, 3, payload, 251); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_network); + _mav_put_uint8_t(buf, 1, target_system); + _mav_put_uint8_t(buf, 2, target_component); + _mav_put_uint8_t_array(buf, 3, payload, 251); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); -#endif -#else - mavlink_file_transfer_protocol_t *packet = (mavlink_file_transfer_protocol_t *)msgbuf; - packet->target_network = target_network; - packet->target_system = target_system; - packet->target_component = target_component; - mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*251); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); -#endif + mavlink_file_transfer_protocol_t *packet = (mavlink_file_transfer_protocol_t *)msgbuf; + packet->target_network = target_network; + packet->target_system = target_system; + packet->target_component = target_component; + mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*251); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC); #endif } #endif @@ -221,7 +226,7 @@ static inline void mavlink_msg_file_transfer_protocol_send_buf(mavlink_message_t */ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_network(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -231,7 +236,7 @@ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_network(cons */ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -241,7 +246,7 @@ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_system(const */ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -251,7 +256,7 @@ static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_component(co */ static inline uint16_t mavlink_msg_file_transfer_protocol_get_payload(const mavlink_message_t* msg, uint8_t *payload) { - return _MAV_RETURN_uint8_t_array(msg, payload, 251, 3); + return _MAV_RETURN_uint8_t_array(msg, payload, 251, 3); } /** @@ -262,12 +267,14 @@ static inline uint16_t mavlink_msg_file_transfer_protocol_get_payload(const mavl */ static inline void mavlink_msg_file_transfer_protocol_decode(const mavlink_message_t* msg, mavlink_file_transfer_protocol_t* file_transfer_protocol) { -#if MAVLINK_NEED_BYTE_SWAP - file_transfer_protocol->target_network = mavlink_msg_file_transfer_protocol_get_target_network(msg); - file_transfer_protocol->target_system = mavlink_msg_file_transfer_protocol_get_target_system(msg); - file_transfer_protocol->target_component = mavlink_msg_file_transfer_protocol_get_target_component(msg); - mavlink_msg_file_transfer_protocol_get_payload(msg, file_transfer_protocol->payload); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + file_transfer_protocol->target_network = mavlink_msg_file_transfer_protocol_get_target_network(msg); + file_transfer_protocol->target_system = mavlink_msg_file_transfer_protocol_get_target_system(msg); + file_transfer_protocol->target_component = mavlink_msg_file_transfer_protocol_get_target_component(msg); + mavlink_msg_file_transfer_protocol_get_payload(msg, file_transfer_protocol->payload); #else - memcpy(file_transfer_protocol, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN? msg->len : MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN; + memset(file_transfer_protocol, 0, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN); + memcpy(file_transfer_protocol, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_follow_target.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_follow_target.h index 0b49726..84dc8ee 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_follow_target.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_follow_target.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE FOLLOW_TARGET PACKING #define MAVLINK_MSG_ID_FOLLOW_TARGET 144 -typedef struct __mavlink_follow_target_t -{ +MAVPACKED( +typedef struct __mavlink_follow_target_t { uint64_t timestamp; /*< Timestamp in milliseconds since system boot*/ uint64_t custom_state; /*< button states or switches of a tracker device*/ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ @@ -15,10 +16,12 @@ typedef struct __mavlink_follow_target_t float rates[3]; /*< (0 0 0 for unknown)*/ float position_cov[3]; /*< eph epv*/ uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/ -} mavlink_follow_target_t; +}) mavlink_follow_target_t; #define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 93 +#define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 93 #define MAVLINK_MSG_ID_144_LEN 93 +#define MAVLINK_MSG_ID_144_MIN_LEN 93 #define MAVLINK_MSG_ID_FOLLOW_TARGET_CRC 127 #define MAVLINK_MSG_ID_144_CRC 127 @@ -29,10 +32,12 @@ typedef struct __mavlink_follow_target_t #define MAVLINK_MSG_FOLLOW_TARGET_FIELD_RATES_LEN 3 #define MAVLINK_MSG_FOLLOW_TARGET_FIELD_POSITION_COV_LEN 3 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \ - "FOLLOW_TARGET", \ - 11, \ - { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \ + 144, \ + "FOLLOW_TARGET", \ + 11, \ + { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \ { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \ @@ -45,7 +50,24 @@ typedef struct __mavlink_follow_target_t { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \ + "FOLLOW_TARGET", \ + 11, \ + { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \ + { "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \ + { "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \ + { "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \ + { "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \ + { "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \ + { "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \ + { "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \ + } \ +} +#endif /** * @brief Pack a follow_target message @@ -67,44 +89,40 @@ typedef struct __mavlink_follow_target_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state) + uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, timestamp); - _mav_put_uint64_t(buf, 8, custom_state); - _mav_put_int32_t(buf, 16, lat); - _mav_put_int32_t(buf, 20, lon); - _mav_put_float(buf, 24, alt); - _mav_put_uint8_t(buf, 92, est_capabilities); - _mav_put_float_array(buf, 28, vel, 3); - _mav_put_float_array(buf, 40, acc, 3); - _mav_put_float_array(buf, 52, attitude_q, 4); - _mav_put_float_array(buf, 68, rates, 3); - _mav_put_float_array(buf, 80, position_cov, 3); + char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint64_t(buf, 8, custom_state); + _mav_put_int32_t(buf, 16, lat); + _mav_put_int32_t(buf, 20, lon); + _mav_put_float(buf, 24, alt); + _mav_put_uint8_t(buf, 92, est_capabilities); + _mav_put_float_array(buf, 28, vel, 3); + _mav_put_float_array(buf, 40, acc, 3); + _mav_put_float_array(buf, 52, attitude_q, 4); + _mav_put_float_array(buf, 68, rates, 3); + _mav_put_float_array(buf, 80, position_cov, 3); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); #else - mavlink_follow_target_t packet; - packet.timestamp = timestamp; - packet.custom_state = custom_state; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.est_capabilities = est_capabilities; - mav_array_memcpy(packet.vel, vel, sizeof(float)*3); - mav_array_memcpy(packet.acc, acc, sizeof(float)*3); - mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4); - mav_array_memcpy(packet.rates, rates, sizeof(float)*3); - mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3); + mavlink_follow_target_t packet; + packet.timestamp = timestamp; + packet.custom_state = custom_state; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.est_capabilities = est_capabilities; + mav_array_memcpy(packet.vel, vel, sizeof(float)*3); + mav_array_memcpy(packet.acc, acc, sizeof(float)*3); + mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4); + mav_array_memcpy(packet.rates, rates, sizeof(float)*3); + mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); } /** @@ -127,45 +145,41 @@ static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint64_t custom_state) + mavlink_message_t* msg, + uint64_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint64_t custom_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, timestamp); - _mav_put_uint64_t(buf, 8, custom_state); - _mav_put_int32_t(buf, 16, lat); - _mav_put_int32_t(buf, 20, lon); - _mav_put_float(buf, 24, alt); - _mav_put_uint8_t(buf, 92, est_capabilities); - _mav_put_float_array(buf, 28, vel, 3); - _mav_put_float_array(buf, 40, acc, 3); - _mav_put_float_array(buf, 52, attitude_q, 4); - _mav_put_float_array(buf, 68, rates, 3); - _mav_put_float_array(buf, 80, position_cov, 3); + char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint64_t(buf, 8, custom_state); + _mav_put_int32_t(buf, 16, lat); + _mav_put_int32_t(buf, 20, lon); + _mav_put_float(buf, 24, alt); + _mav_put_uint8_t(buf, 92, est_capabilities); + _mav_put_float_array(buf, 28, vel, 3); + _mav_put_float_array(buf, 40, acc, 3); + _mav_put_float_array(buf, 52, attitude_q, 4); + _mav_put_float_array(buf, 68, rates, 3); + _mav_put_float_array(buf, 80, position_cov, 3); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); #else - mavlink_follow_target_t packet; - packet.timestamp = timestamp; - packet.custom_state = custom_state; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.est_capabilities = est_capabilities; - mav_array_memcpy(packet.vel, vel, sizeof(float)*3); - mav_array_memcpy(packet.acc, acc, sizeof(float)*3); - mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4); - mav_array_memcpy(packet.rates, rates, sizeof(float)*3); - mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3); + mavlink_follow_target_t packet; + packet.timestamp = timestamp; + packet.custom_state = custom_state; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.est_capabilities = est_capabilities; + mav_array_memcpy(packet.vel, vel, sizeof(float)*3); + mav_array_memcpy(packet.acc, acc, sizeof(float)*3); + mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4); + mav_array_memcpy(packet.rates, rates, sizeof(float)*3); + mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); } /** @@ -178,7 +192,7 @@ static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target) { - return mavlink_msg_follow_target_pack(system_id, component_id, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state); + return mavlink_msg_follow_target_pack(system_id, component_id, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state); } /** @@ -192,7 +206,7 @@ static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target) { - return mavlink_msg_follow_target_pack_chan(system_id, component_id, chan, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state); + return mavlink_msg_follow_target_pack_chan(system_id, component_id, chan, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state); } /** @@ -216,41 +230,47 @@ static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, timestamp); - _mav_put_uint64_t(buf, 8, custom_state); - _mav_put_int32_t(buf, 16, lat); - _mav_put_int32_t(buf, 20, lon); - _mav_put_float(buf, 24, alt); - _mav_put_uint8_t(buf, 92, est_capabilities); - _mav_put_float_array(buf, 28, vel, 3); - _mav_put_float_array(buf, 40, acc, 3); - _mav_put_float_array(buf, 52, attitude_q, 4); - _mav_put_float_array(buf, 68, rates, 3); - _mav_put_float_array(buf, 80, position_cov, 3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); + char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint64_t(buf, 8, custom_state); + _mav_put_int32_t(buf, 16, lat); + _mav_put_int32_t(buf, 20, lon); + _mav_put_float(buf, 24, alt); + _mav_put_uint8_t(buf, 92, est_capabilities); + _mav_put_float_array(buf, 28, vel, 3); + _mav_put_float_array(buf, 40, acc, 3); + _mav_put_float_array(buf, 52, attitude_q, 4); + _mav_put_float_array(buf, 68, rates, 3); + _mav_put_float_array(buf, 80, position_cov, 3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); + mavlink_follow_target_t packet; + packet.timestamp = timestamp; + packet.custom_state = custom_state; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.est_capabilities = est_capabilities; + mav_array_memcpy(packet.vel, vel, sizeof(float)*3); + mav_array_memcpy(packet.acc, acc, sizeof(float)*3); + mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4); + mav_array_memcpy(packet.rates, rates, sizeof(float)*3); + mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)&packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); #endif +} + +/** + * @brief Send a follow_target message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_follow_target_send_struct(mavlink_channel_t chan, const mavlink_follow_target_t* follow_target) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_follow_target_send(chan, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state); #else - mavlink_follow_target_t packet; - packet.timestamp = timestamp; - packet.custom_state = custom_state; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.est_capabilities = est_capabilities; - mav_array_memcpy(packet.vel, vel, sizeof(float)*3); - mav_array_memcpy(packet.acc, acc, sizeof(float)*3); - mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4); - mav_array_memcpy(packet.rates, rates, sizeof(float)*3); - mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)&packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)&packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)follow_target, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); #endif } @@ -265,41 +285,33 @@ static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint64 static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, timestamp); - _mav_put_uint64_t(buf, 8, custom_state); - _mav_put_int32_t(buf, 16, lat); - _mav_put_int32_t(buf, 20, lon); - _mav_put_float(buf, 24, alt); - _mav_put_uint8_t(buf, 92, est_capabilities); - _mav_put_float_array(buf, 28, vel, 3); - _mav_put_float_array(buf, 40, acc, 3); - _mav_put_float_array(buf, 52, attitude_q, 4); - _mav_put_float_array(buf, 68, rates, 3); - _mav_put_float_array(buf, 80, position_cov, 3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, timestamp); + _mav_put_uint64_t(buf, 8, custom_state); + _mav_put_int32_t(buf, 16, lat); + _mav_put_int32_t(buf, 20, lon); + _mav_put_float(buf, 24, alt); + _mav_put_uint8_t(buf, 92, est_capabilities); + _mav_put_float_array(buf, 28, vel, 3); + _mav_put_float_array(buf, 40, acc, 3); + _mav_put_float_array(buf, 52, attitude_q, 4); + _mav_put_float_array(buf, 68, rates, 3); + _mav_put_float_array(buf, 80, position_cov, 3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); -#endif -#else - mavlink_follow_target_t *packet = (mavlink_follow_target_t *)msgbuf; - packet->timestamp = timestamp; - packet->custom_state = custom_state; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->est_capabilities = est_capabilities; - mav_array_memcpy(packet->vel, vel, sizeof(float)*3); - mav_array_memcpy(packet->acc, acc, sizeof(float)*3); - mav_array_memcpy(packet->attitude_q, attitude_q, sizeof(float)*4); - mav_array_memcpy(packet->rates, rates, sizeof(float)*3); - mav_array_memcpy(packet->position_cov, position_cov, sizeof(float)*3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); -#endif + mavlink_follow_target_t *packet = (mavlink_follow_target_t *)msgbuf; + packet->timestamp = timestamp; + packet->custom_state = custom_state; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->est_capabilities = est_capabilities; + mav_array_memcpy(packet->vel, vel, sizeof(float)*3); + mav_array_memcpy(packet->acc, acc, sizeof(float)*3); + mav_array_memcpy(packet->attitude_q, attitude_q, sizeof(float)*4); + mav_array_memcpy(packet->rates, rates, sizeof(float)*3); + mav_array_memcpy(packet->position_cov, position_cov, sizeof(float)*3); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC); #endif } #endif @@ -316,7 +328,7 @@ static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, */ static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -326,7 +338,7 @@ static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_mes */ static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 92); + return _MAV_RETURN_uint8_t(msg, 92); } /** @@ -336,7 +348,7 @@ static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavli */ static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -346,7 +358,7 @@ static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* */ static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 20); + return _MAV_RETURN_int32_t(msg, 20); } /** @@ -356,7 +368,7 @@ static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* */ static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -366,7 +378,7 @@ static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* m */ static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t* msg, float *vel) { - return _MAV_RETURN_float_array(msg, vel, 3, 28); + return _MAV_RETURN_float_array(msg, vel, 3, 28); } /** @@ -376,7 +388,7 @@ static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t */ static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t* msg, float *acc) { - return _MAV_RETURN_float_array(msg, acc, 3, 40); + return _MAV_RETURN_float_array(msg, acc, 3, 40); } /** @@ -386,7 +398,7 @@ static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t */ static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_message_t* msg, float *attitude_q) { - return _MAV_RETURN_float_array(msg, attitude_q, 4, 52); + return _MAV_RETURN_float_array(msg, attitude_q, 4, 52); } /** @@ -396,7 +408,7 @@ static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_me */ static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message_t* msg, float *rates) { - return _MAV_RETURN_float_array(msg, rates, 3, 68); + return _MAV_RETURN_float_array(msg, rates, 3, 68); } /** @@ -406,7 +418,7 @@ static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message */ static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_message_t* msg, float *position_cov) { - return _MAV_RETURN_float_array(msg, position_cov, 3, 80); + return _MAV_RETURN_float_array(msg, position_cov, 3, 80); } /** @@ -416,7 +428,7 @@ static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_ */ static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 8); + return _MAV_RETURN_uint64_t(msg, 8); } /** @@ -427,19 +439,21 @@ static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_ */ static inline void mavlink_msg_follow_target_decode(const mavlink_message_t* msg, mavlink_follow_target_t* follow_target) { -#if MAVLINK_NEED_BYTE_SWAP - follow_target->timestamp = mavlink_msg_follow_target_get_timestamp(msg); - follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg); - follow_target->lat = mavlink_msg_follow_target_get_lat(msg); - follow_target->lon = mavlink_msg_follow_target_get_lon(msg); - follow_target->alt = mavlink_msg_follow_target_get_alt(msg); - mavlink_msg_follow_target_get_vel(msg, follow_target->vel); - mavlink_msg_follow_target_get_acc(msg, follow_target->acc); - mavlink_msg_follow_target_get_attitude_q(msg, follow_target->attitude_q); - mavlink_msg_follow_target_get_rates(msg, follow_target->rates); - mavlink_msg_follow_target_get_position_cov(msg, follow_target->position_cov); - follow_target->est_capabilities = mavlink_msg_follow_target_get_est_capabilities(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + follow_target->timestamp = mavlink_msg_follow_target_get_timestamp(msg); + follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg); + follow_target->lat = mavlink_msg_follow_target_get_lat(msg); + follow_target->lon = mavlink_msg_follow_target_get_lon(msg); + follow_target->alt = mavlink_msg_follow_target_get_alt(msg); + mavlink_msg_follow_target_get_vel(msg, follow_target->vel); + mavlink_msg_follow_target_get_acc(msg, follow_target->acc); + mavlink_msg_follow_target_get_attitude_q(msg, follow_target->attitude_q); + mavlink_msg_follow_target_get_rates(msg, follow_target->rates); + mavlink_msg_follow_target_get_position_cov(msg, follow_target->position_cov); + follow_target->est_capabilities = mavlink_msg_follow_target_get_est_capabilities(msg); #else - memcpy(follow_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_FOLLOW_TARGET_LEN? msg->len : MAVLINK_MSG_ID_FOLLOW_TARGET_LEN; + memset(follow_target, 0, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN); + memcpy(follow_target, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int.h index 996505c..50328b7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE GLOBAL_POSITION_INT PACKING #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT 33 -typedef struct __mavlink_global_position_int_t -{ +MAVPACKED( +typedef struct __mavlink_global_position_int_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ int32_t lat; /*< Latitude, expressed as degrees * 1E7*/ int32_t lon; /*< Longitude, expressed as degrees * 1E7*/ @@ -13,20 +14,24 @@ typedef struct __mavlink_global_position_int_t int16_t vy; /*< Ground Y Speed (Longitude, positive east), expressed as m/s * 100*/ int16_t vz; /*< Ground Z Speed (Altitude, positive down), expressed as m/s * 100*/ uint16_t hdg; /*< Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ -} mavlink_global_position_int_t; +}) mavlink_global_position_int_t; #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 28 +#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN 28 #define MAVLINK_MSG_ID_33_LEN 28 +#define MAVLINK_MSG_ID_33_MIN_LEN 28 #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC 104 #define MAVLINK_MSG_ID_33_CRC 104 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \ - "GLOBAL_POSITION_INT", \ - 9, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \ + 33, \ + "GLOBAL_POSITION_INT", \ + 9, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \ @@ -37,7 +42,22 @@ typedef struct __mavlink_global_position_int_t { "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \ + "GLOBAL_POSITION_INT", \ + 9, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \ + { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_t, relative_alt) }, \ + { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_global_position_int_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_global_position_int_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_global_position_int_t, vz) }, \ + { "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \ + } \ +} +#endif /** * @brief Pack a global_position_int message @@ -57,42 +77,38 @@ typedef struct __mavlink_global_position_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg) + uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, alt); - _mav_put_int32_t(buf, 16, relative_alt); - _mav_put_int16_t(buf, 20, vx); - _mav_put_int16_t(buf, 22, vy); - _mav_put_int16_t(buf, 24, vz); - _mav_put_uint16_t(buf, 26, hdg); + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, alt); + _mav_put_int32_t(buf, 16, relative_alt); + _mav_put_int16_t(buf, 20, vx); + _mav_put_int16_t(buf, 22, vy); + _mav_put_int16_t(buf, 24, vz); + _mav_put_uint16_t(buf, 26, hdg); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #else - mavlink_global_position_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.relative_alt = relative_alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.hdg = hdg; + mavlink_global_position_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.relative_alt = relative_alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.hdg = hdg; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); } /** @@ -113,43 +129,39 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,int16_t vx,int16_t vy,int16_t vz,uint16_t hdg) + mavlink_message_t* msg, + uint32_t time_boot_ms,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,int16_t vx,int16_t vy,int16_t vz,uint16_t hdg) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, alt); - _mav_put_int32_t(buf, 16, relative_alt); - _mav_put_int16_t(buf, 20, vx); - _mav_put_int16_t(buf, 22, vy); - _mav_put_int16_t(buf, 24, vz); - _mav_put_uint16_t(buf, 26, hdg); + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, alt); + _mav_put_int32_t(buf, 16, relative_alt); + _mav_put_int16_t(buf, 20, vx); + _mav_put_int16_t(buf, 22, vy); + _mav_put_int16_t(buf, 24, vz); + _mav_put_uint16_t(buf, 26, hdg); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #else - mavlink_global_position_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.relative_alt = relative_alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.hdg = hdg; + mavlink_global_position_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.relative_alt = relative_alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.hdg = hdg; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); } /** @@ -162,7 +174,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_ */ static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int) { - return mavlink_msg_global_position_int_pack(system_id, component_id, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg); + return mavlink_msg_global_position_int_pack(system_id, component_id, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg); } /** @@ -176,7 +188,7 @@ static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_global_position_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int) { - return mavlink_msg_global_position_int_pack_chan(system_id, component_id, chan, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg); + return mavlink_msg_global_position_int_pack_chan(system_id, component_id, chan, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg); } /** @@ -198,39 +210,45 @@ static inline uint16_t mavlink_msg_global_position_int_encode_chan(uint8_t syste static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, alt); - _mav_put_int32_t(buf, 16, relative_alt); - _mav_put_int16_t(buf, 20, vx); - _mav_put_int16_t(buf, 22, vy); - _mav_put_int16_t(buf, 24, vz); - _mav_put_uint16_t(buf, 26, hdg); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, alt); + _mav_put_int32_t(buf, 16, relative_alt); + _mav_put_int16_t(buf, 20, vx); + _mav_put_int16_t(buf, 22, vy); + _mav_put_int16_t(buf, 24, vz); + _mav_put_uint16_t(buf, 26, hdg); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); + mavlink_global_position_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.relative_alt = relative_alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.hdg = hdg; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); #endif +} + +/** + * @brief Send a global_position_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_global_position_int_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_t* global_position_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_global_position_int_send(chan, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg); #else - mavlink_global_position_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.relative_alt = relative_alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.hdg = hdg; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)global_position_int, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); #endif } @@ -245,39 +263,31 @@ static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, static inline void mavlink_msg_global_position_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat); - _mav_put_int32_t(buf, 8, lon); - _mav_put_int32_t(buf, 12, alt); - _mav_put_int32_t(buf, 16, relative_alt); - _mav_put_int16_t(buf, 20, vx); - _mav_put_int16_t(buf, 22, vy); - _mav_put_int16_t(buf, 24, vz); - _mav_put_uint16_t(buf, 26, hdg); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); -#endif -#else - mavlink_global_position_int_t *packet = (mavlink_global_position_int_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->relative_alt = relative_alt; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->hdg = hdg; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat); + _mav_put_int32_t(buf, 8, lon); + _mav_put_int32_t(buf, 12, alt); + _mav_put_int32_t(buf, 16, relative_alt); + _mav_put_int16_t(buf, 20, vx); + _mav_put_int16_t(buf, 22, vy); + _mav_put_int16_t(buf, 24, vz); + _mav_put_uint16_t(buf, 26, hdg); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); -#endif + mavlink_global_position_int_t *packet = (mavlink_global_position_int_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->relative_alt = relative_alt; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->hdg = hdg; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC); #endif } #endif @@ -294,7 +304,7 @@ static inline void mavlink_msg_global_position_int_send_buf(mavlink_message_t *m */ static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -304,7 +314,7 @@ static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const ma */ static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -314,7 +324,7 @@ static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_mess */ static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -324,7 +334,7 @@ static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_mess */ static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -334,7 +344,7 @@ static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_mess */ static inline int32_t mavlink_msg_global_position_int_get_relative_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -344,7 +354,7 @@ static inline int32_t mavlink_msg_global_position_int_get_relative_alt(const mav */ static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -354,7 +364,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_messa */ static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 22); + return _MAV_RETURN_int16_t(msg, 22); } /** @@ -364,7 +374,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_messa */ static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 24); + return _MAV_RETURN_int16_t(msg, 24); } /** @@ -374,7 +384,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_messa */ static inline uint16_t mavlink_msg_global_position_int_get_hdg(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 26); + return _MAV_RETURN_uint16_t(msg, 26); } /** @@ -385,17 +395,19 @@ static inline uint16_t mavlink_msg_global_position_int_get_hdg(const mavlink_mes */ static inline void mavlink_msg_global_position_int_decode(const mavlink_message_t* msg, mavlink_global_position_int_t* global_position_int) { -#if MAVLINK_NEED_BYTE_SWAP - global_position_int->time_boot_ms = mavlink_msg_global_position_int_get_time_boot_ms(msg); - global_position_int->lat = mavlink_msg_global_position_int_get_lat(msg); - global_position_int->lon = mavlink_msg_global_position_int_get_lon(msg); - global_position_int->alt = mavlink_msg_global_position_int_get_alt(msg); - global_position_int->relative_alt = mavlink_msg_global_position_int_get_relative_alt(msg); - global_position_int->vx = mavlink_msg_global_position_int_get_vx(msg); - global_position_int->vy = mavlink_msg_global_position_int_get_vy(msg); - global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg); - global_position_int->hdg = mavlink_msg_global_position_int_get_hdg(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + global_position_int->time_boot_ms = mavlink_msg_global_position_int_get_time_boot_ms(msg); + global_position_int->lat = mavlink_msg_global_position_int_get_lat(msg); + global_position_int->lon = mavlink_msg_global_position_int_get_lon(msg); + global_position_int->alt = mavlink_msg_global_position_int_get_alt(msg); + global_position_int->relative_alt = mavlink_msg_global_position_int_get_relative_alt(msg); + global_position_int->vx = mavlink_msg_global_position_int_get_vx(msg); + global_position_int->vy = mavlink_msg_global_position_int_get_vy(msg); + global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg); + global_position_int->hdg = mavlink_msg_global_position_int_get_hdg(msg); #else - memcpy(global_position_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN; + memset(global_position_int, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN); + memcpy(global_position_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int_cov.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int_cov.h index 6eb4825..cc4fac0 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int_cov.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_position_int_cov.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE GLOBAL_POSITION_INT_COV PACKING #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63 -typedef struct __mavlink_global_position_int_cov_t -{ +MAVPACKED( +typedef struct __mavlink_global_position_int_cov_t { uint64_t time_utc; /*< Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.*/ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ int32_t lat; /*< Latitude, expressed as degrees * 1E7*/ @@ -15,20 +16,24 @@ typedef struct __mavlink_global_position_int_cov_t float vz; /*< Ground Z Speed (Altitude), expressed as m/s*/ float covariance[36]; /*< Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)*/ uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/ -} mavlink_global_position_int_cov_t; +}) mavlink_global_position_int_cov_t; #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN 185 +#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN 185 #define MAVLINK_MSG_ID_63_LEN 185 +#define MAVLINK_MSG_ID_63_MIN_LEN 185 #define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC 51 #define MAVLINK_MSG_ID_63_CRC 51 #define MAVLINK_MSG_GLOBAL_POSITION_INT_COV_FIELD_COVARIANCE_LEN 36 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \ - "GLOBAL_POSITION_INT_COV", \ - 11, \ - { { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_utc) }, \ + 63, \ + "GLOBAL_POSITION_INT_COV", \ + 11, \ + { { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_utc) }, \ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, time_boot_ms) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, lon) }, \ @@ -41,7 +46,24 @@ typedef struct __mavlink_global_position_int_cov_t { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 184, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \ + "GLOBAL_POSITION_INT_COV", \ + 11, \ + { { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_utc) }, \ + { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, time_boot_ms) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, alt) }, \ + { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \ + { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_global_position_int_cov_t, vz) }, \ + { "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 40, offsetof(mavlink_global_position_int_cov_t, covariance) }, \ + { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 184, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \ + } \ +} +#endif /** * @brief Pack a global_position_int_cov message @@ -63,44 +85,40 @@ typedef struct __mavlink_global_position_int_cov_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance) + uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_int32_t(buf, 12, lat); - _mav_put_int32_t(buf, 16, lon); - _mav_put_int32_t(buf, 20, alt); - _mav_put_int32_t(buf, 24, relative_alt); - _mav_put_float(buf, 28, vx); - _mav_put_float(buf, 32, vy); - _mav_put_float(buf, 36, vz); - _mav_put_uint8_t(buf, 184, estimator_type); - _mav_put_float_array(buf, 40, covariance, 36); + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_int32_t(buf, 12, lat); + _mav_put_int32_t(buf, 16, lon); + _mav_put_int32_t(buf, 20, alt); + _mav_put_int32_t(buf, 24, relative_alt); + _mav_put_float(buf, 28, vx); + _mav_put_float(buf, 32, vy); + _mav_put_float(buf, 36, vz); + _mav_put_uint8_t(buf, 184, estimator_type); + _mav_put_float_array(buf, 40, covariance, 36); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); #else - mavlink_global_position_int_cov_t packet; - packet.time_utc = time_utc; - packet.time_boot_ms = time_boot_ms; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.relative_alt = relative_alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.estimator_type = estimator_type; - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36); + mavlink_global_position_int_cov_t packet; + packet.time_utc = time_utc; + packet.time_boot_ms = time_boot_ms; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.relative_alt = relative_alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.estimator_type = estimator_type; + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); } /** @@ -123,45 +141,41 @@ static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_i * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint64_t time_utc,uint8_t estimator_type,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,float vx,float vy,float vz,const float *covariance) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint64_t time_utc,uint8_t estimator_type,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,float vx,float vy,float vz,const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_int32_t(buf, 12, lat); - _mav_put_int32_t(buf, 16, lon); - _mav_put_int32_t(buf, 20, alt); - _mav_put_int32_t(buf, 24, relative_alt); - _mav_put_float(buf, 28, vx); - _mav_put_float(buf, 32, vy); - _mav_put_float(buf, 36, vz); - _mav_put_uint8_t(buf, 184, estimator_type); - _mav_put_float_array(buf, 40, covariance, 36); + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_int32_t(buf, 12, lat); + _mav_put_int32_t(buf, 16, lon); + _mav_put_int32_t(buf, 20, alt); + _mav_put_int32_t(buf, 24, relative_alt); + _mav_put_float(buf, 28, vx); + _mav_put_float(buf, 32, vy); + _mav_put_float(buf, 36, vz); + _mav_put_uint8_t(buf, 184, estimator_type); + _mav_put_float_array(buf, 40, covariance, 36); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); #else - mavlink_global_position_int_cov_t packet; - packet.time_utc = time_utc; - packet.time_boot_ms = time_boot_ms; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.relative_alt = relative_alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.estimator_type = estimator_type; - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36); + mavlink_global_position_int_cov_t packet; + packet.time_utc = time_utc; + packet.time_boot_ms = time_boot_ms; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.relative_alt = relative_alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.estimator_type = estimator_type; + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); } /** @@ -174,7 +188,7 @@ static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t sys */ static inline uint16_t mavlink_msg_global_position_int_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov) { - return mavlink_msg_global_position_int_cov_pack(system_id, component_id, msg, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance); + return mavlink_msg_global_position_int_cov_pack(system_id, component_id, msg, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance); } /** @@ -188,7 +202,7 @@ static inline uint16_t mavlink_msg_global_position_int_cov_encode(uint8_t system */ static inline uint16_t mavlink_msg_global_position_int_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov) { - return mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, chan, msg, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance); + return mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, chan, msg, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance); } /** @@ -212,41 +226,47 @@ static inline uint16_t mavlink_msg_global_position_int_cov_encode_chan(uint8_t s static inline void mavlink_msg_global_position_int_cov_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_int32_t(buf, 12, lat); - _mav_put_int32_t(buf, 16, lon); - _mav_put_int32_t(buf, 20, alt); - _mav_put_int32_t(buf, 24, relative_alt); - _mav_put_float(buf, 28, vx); - _mav_put_float(buf, 32, vy); - _mav_put_float(buf, 36, vz); - _mav_put_uint8_t(buf, 184, estimator_type); - _mav_put_float_array(buf, 40, covariance, 36); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); + char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_int32_t(buf, 12, lat); + _mav_put_int32_t(buf, 16, lon); + _mav_put_int32_t(buf, 20, alt); + _mav_put_int32_t(buf, 24, relative_alt); + _mav_put_float(buf, 28, vx); + _mav_put_float(buf, 32, vy); + _mav_put_float(buf, 36, vz); + _mav_put_uint8_t(buf, 184, estimator_type); + _mav_put_float_array(buf, 40, covariance, 36); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); + mavlink_global_position_int_cov_t packet; + packet.time_utc = time_utc; + packet.time_boot_ms = time_boot_ms; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.relative_alt = relative_alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.estimator_type = estimator_type; + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); #endif +} + +/** + * @brief Send a global_position_int_cov message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_global_position_int_cov_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_cov_t* global_position_int_cov) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_global_position_int_cov_send(chan, global_position_int_cov->time_boot_ms, global_position_int_cov->time_utc, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance); #else - mavlink_global_position_int_cov_t packet; - packet.time_utc = time_utc; - packet.time_boot_ms = time_boot_ms; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.relative_alt = relative_alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.estimator_type = estimator_type; - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)global_position_int_cov, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); #endif } @@ -261,41 +281,33 @@ static inline void mavlink_msg_global_position_int_cov_send(mavlink_channel_t ch static inline void mavlink_msg_global_position_int_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_int32_t(buf, 12, lat); - _mav_put_int32_t(buf, 16, lon); - _mav_put_int32_t(buf, 20, alt); - _mav_put_int32_t(buf, 24, relative_alt); - _mav_put_float(buf, 28, vx); - _mav_put_float(buf, 32, vy); - _mav_put_float(buf, 36, vz); - _mav_put_uint8_t(buf, 184, estimator_type); - _mav_put_float_array(buf, 40, covariance, 36); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_int32_t(buf, 12, lat); + _mav_put_int32_t(buf, 16, lon); + _mav_put_int32_t(buf, 20, alt); + _mav_put_int32_t(buf, 24, relative_alt); + _mav_put_float(buf, 28, vx); + _mav_put_float(buf, 32, vy); + _mav_put_float(buf, 36, vz); + _mav_put_uint8_t(buf, 184, estimator_type); + _mav_put_float_array(buf, 40, covariance, 36); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); -#endif -#else - mavlink_global_position_int_cov_t *packet = (mavlink_global_position_int_cov_t *)msgbuf; - packet->time_utc = time_utc; - packet->time_boot_ms = time_boot_ms; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->relative_alt = relative_alt; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->estimator_type = estimator_type; - mav_array_memcpy(packet->covariance, covariance, sizeof(float)*36); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); -#endif + mavlink_global_position_int_cov_t *packet = (mavlink_global_position_int_cov_t *)msgbuf; + packet->time_utc = time_utc; + packet->time_boot_ms = time_boot_ms; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->relative_alt = relative_alt; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->estimator_type = estimator_type; + mav_array_memcpy(packet->covariance, covariance, sizeof(float)*36); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC); #endif } #endif @@ -312,7 +324,7 @@ static inline void mavlink_msg_global_position_int_cov_send_buf(mavlink_message_ */ static inline uint32_t mavlink_msg_global_position_int_cov_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -322,7 +334,7 @@ static inline uint32_t mavlink_msg_global_position_int_cov_get_time_boot_ms(cons */ static inline uint64_t mavlink_msg_global_position_int_cov_get_time_utc(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -332,7 +344,7 @@ static inline uint64_t mavlink_msg_global_position_int_cov_get_time_utc(const ma */ static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 184); + return _MAV_RETURN_uint8_t(msg, 184); } /** @@ -342,7 +354,7 @@ static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(con */ static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -352,7 +364,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_ */ static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -362,7 +374,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_ */ static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 20); + return _MAV_RETURN_int32_t(msg, 20); } /** @@ -372,7 +384,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_ */ static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 24); + return _MAV_RETURN_int32_t(msg, 24); } /** @@ -382,7 +394,7 @@ static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const */ static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -392,7 +404,7 @@ static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_mes */ static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -402,7 +414,7 @@ static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_mes */ static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -412,7 +424,7 @@ static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_mes */ static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const mavlink_message_t* msg, float *covariance) { - return _MAV_RETURN_float_array(msg, covariance, 36, 40); + return _MAV_RETURN_float_array(msg, covariance, 36, 40); } /** @@ -423,19 +435,21 @@ static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const */ static inline void mavlink_msg_global_position_int_cov_decode(const mavlink_message_t* msg, mavlink_global_position_int_cov_t* global_position_int_cov) { -#if MAVLINK_NEED_BYTE_SWAP - global_position_int_cov->time_utc = mavlink_msg_global_position_int_cov_get_time_utc(msg); - global_position_int_cov->time_boot_ms = mavlink_msg_global_position_int_cov_get_time_boot_ms(msg); - global_position_int_cov->lat = mavlink_msg_global_position_int_cov_get_lat(msg); - global_position_int_cov->lon = mavlink_msg_global_position_int_cov_get_lon(msg); - global_position_int_cov->alt = mavlink_msg_global_position_int_cov_get_alt(msg); - global_position_int_cov->relative_alt = mavlink_msg_global_position_int_cov_get_relative_alt(msg); - global_position_int_cov->vx = mavlink_msg_global_position_int_cov_get_vx(msg); - global_position_int_cov->vy = mavlink_msg_global_position_int_cov_get_vy(msg); - global_position_int_cov->vz = mavlink_msg_global_position_int_cov_get_vz(msg); - mavlink_msg_global_position_int_cov_get_covariance(msg, global_position_int_cov->covariance); - global_position_int_cov->estimator_type = mavlink_msg_global_position_int_cov_get_estimator_type(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + global_position_int_cov->time_utc = mavlink_msg_global_position_int_cov_get_time_utc(msg); + global_position_int_cov->time_boot_ms = mavlink_msg_global_position_int_cov_get_time_boot_ms(msg); + global_position_int_cov->lat = mavlink_msg_global_position_int_cov_get_lat(msg); + global_position_int_cov->lon = mavlink_msg_global_position_int_cov_get_lon(msg); + global_position_int_cov->alt = mavlink_msg_global_position_int_cov_get_alt(msg); + global_position_int_cov->relative_alt = mavlink_msg_global_position_int_cov_get_relative_alt(msg); + global_position_int_cov->vx = mavlink_msg_global_position_int_cov_get_vx(msg); + global_position_int_cov->vy = mavlink_msg_global_position_int_cov_get_vy(msg); + global_position_int_cov->vz = mavlink_msg_global_position_int_cov_get_vz(msg); + mavlink_msg_global_position_int_cov_get_covariance(msg, global_position_int_cov->covariance); + global_position_int_cov->estimator_type = mavlink_msg_global_position_int_cov_get_estimator_type(msg); #else - memcpy(global_position_int_cov, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN; + memset(global_position_int_cov, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN); + memcpy(global_position_int_cov, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_vision_position_estimate.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_vision_position_estimate.h index 3e44b87..32ec5d6 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_vision_position_estimate.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_global_vision_position_estimate.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE GLOBAL_VISION_POSITION_ESTIMATE PACKING #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101 -typedef struct __mavlink_global_vision_position_estimate_t -{ +MAVPACKED( +typedef struct __mavlink_global_vision_position_estimate_t { uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ float x; /*< Global X position*/ float y; /*< Global Y position*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_global_vision_position_estimate_t float roll; /*< Roll angle in rad*/ float pitch; /*< Pitch angle in rad*/ float yaw; /*< Yaw angle in rad*/ -} mavlink_global_vision_position_estimate_t; +}) mavlink_global_vision_position_estimate_t; #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 32 +#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN 32 #define MAVLINK_MSG_ID_101_LEN 32 +#define MAVLINK_MSG_ID_101_MIN_LEN 32 #define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC 102 #define MAVLINK_MSG_ID_101_CRC 102 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \ - "GLOBAL_VISION_POSITION_ESTIMATE", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \ + 101, \ + "GLOBAL_VISION_POSITION_ESTIMATE", \ + 7, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_global_vision_position_estimate_t { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \ + "GLOBAL_VISION_POSITION_ESTIMATE", \ + 7, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \ + } \ +} +#endif /** * @brief Pack a global_vision_position_estimate message @@ -51,38 +69,34 @@ typedef struct __mavlink_global_vision_position_estimate_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) + uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); + char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #else - mavlink_global_vision_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_global_vision_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) + mavlink_message_t* msg, + uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); + char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #else - mavlink_global_vision_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_global_vision_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin */ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate) { - return mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw); + return mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_ */ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate) { - return mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw); + return mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode_chan(u static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); + char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); + mavlink_global_vision_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); #endif +} + +/** + * @brief Send a global_vision_position_estimate message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_global_vision_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_global_vision_position_estimate_send(chan, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw); #else - mavlink_global_vision_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)global_vision_position_estimate, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_chan static inline void mavlink_msg_global_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); -#endif -#else - mavlink_global_vision_position_estimate_t *packet = (mavlink_global_vision_position_estimate_t *)msgbuf; - packet->usec = usec; - packet->x = x; - packet->y = y; - packet->z = z; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); -#endif + mavlink_global_vision_position_estimate_t *packet = (mavlink_global_vision_position_estimate_t *)msgbuf; + packet->usec = usec; + packet->x = x; + packet->y = y; + packet->z = z; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_global_vision_position_estimate_send_buf(mavlink_ */ static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(cons */ static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavl */ static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavl */ static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavl */ static inline float mavlink_msg_global_vision_position_estimate_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_roll(const m */ static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const */ static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const ma */ static inline void mavlink_msg_global_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_global_vision_position_estimate_t* global_vision_position_estimate) { -#if MAVLINK_NEED_BYTE_SWAP - global_vision_position_estimate->usec = mavlink_msg_global_vision_position_estimate_get_usec(msg); - global_vision_position_estimate->x = mavlink_msg_global_vision_position_estimate_get_x(msg); - global_vision_position_estimate->y = mavlink_msg_global_vision_position_estimate_get_y(msg); - global_vision_position_estimate->z = mavlink_msg_global_vision_position_estimate_get_z(msg); - global_vision_position_estimate->roll = mavlink_msg_global_vision_position_estimate_get_roll(msg); - global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg); - global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + global_vision_position_estimate->usec = mavlink_msg_global_vision_position_estimate_get_usec(msg); + global_vision_position_estimate->x = mavlink_msg_global_vision_position_estimate_get_x(msg); + global_vision_position_estimate->y = mavlink_msg_global_vision_position_estimate_get_y(msg); + global_vision_position_estimate->z = mavlink_msg_global_vision_position_estimate_get_z(msg); + global_vision_position_estimate->roll = mavlink_msg_global_vision_position_estimate_get_roll(msg); + global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg); + global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg); #else - memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN; + memset(global_vision_position_estimate, 0, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN); + memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_raw.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_raw.h index de903fd..42074db 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_raw.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_raw.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE GPS2_RAW PACKING #define MAVLINK_MSG_ID_GPS2_RAW 124 -typedef struct __mavlink_gps2_raw_t -{ +MAVPACKED( +typedef struct __mavlink_gps2_raw_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ @@ -16,20 +17,24 @@ typedef struct __mavlink_gps2_raw_t uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/ uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ uint8_t dgps_numch; /*< Number of DGPS satellites*/ -} mavlink_gps2_raw_t; +}) mavlink_gps2_raw_t; #define MAVLINK_MSG_ID_GPS2_RAW_LEN 35 +#define MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN 35 #define MAVLINK_MSG_ID_124_LEN 35 +#define MAVLINK_MSG_ID_124_MIN_LEN 35 #define MAVLINK_MSG_ID_GPS2_RAW_CRC 87 #define MAVLINK_MSG_ID_124_CRC 87 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GPS2_RAW { \ - "GPS2_RAW", \ - 12, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \ + 124, \ + "GPS2_RAW", \ + 12, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \ @@ -43,7 +48,25 @@ typedef struct __mavlink_gps2_raw_t { "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \ + "GPS2_RAW", \ + 12, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \ + { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \ + { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \ + { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \ + { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \ + { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \ + { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \ + { "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \ + } \ +} +#endif /** * @brief Pack a gps2_raw message @@ -66,48 +89,44 @@ typedef struct __mavlink_gps2_raw_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age) + uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint32_t(buf, 20, dgps_age); - _mav_put_uint16_t(buf, 24, eph); - _mav_put_uint16_t(buf, 26, epv); - _mav_put_uint16_t(buf, 28, vel); - _mav_put_uint16_t(buf, 30, cog); - _mav_put_uint8_t(buf, 32, fix_type); - _mav_put_uint8_t(buf, 33, satellites_visible); - _mav_put_uint8_t(buf, 34, dgps_numch); + char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint32_t(buf, 20, dgps_age); + _mav_put_uint16_t(buf, 24, eph); + _mav_put_uint16_t(buf, 26, epv); + _mav_put_uint16_t(buf, 28, vel); + _mav_put_uint16_t(buf, 30, cog); + _mav_put_uint8_t(buf, 32, fix_type); + _mav_put_uint8_t(buf, 33, satellites_visible); + _mav_put_uint8_t(buf, 34, dgps_numch); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN); #else - mavlink_gps2_raw_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.dgps_age = dgps_age; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; - packet.dgps_numch = dgps_numch; + mavlink_gps2_raw_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.dgps_age = dgps_age; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; + packet.dgps_numch = dgps_numch; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS2_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS2_RAW; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); } /** @@ -131,49 +150,45 @@ static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint32_t(buf, 20, dgps_age); - _mav_put_uint16_t(buf, 24, eph); - _mav_put_uint16_t(buf, 26, epv); - _mav_put_uint16_t(buf, 28, vel); - _mav_put_uint16_t(buf, 30, cog); - _mav_put_uint8_t(buf, 32, fix_type); - _mav_put_uint8_t(buf, 33, satellites_visible); - _mav_put_uint8_t(buf, 34, dgps_numch); + char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint32_t(buf, 20, dgps_age); + _mav_put_uint16_t(buf, 24, eph); + _mav_put_uint16_t(buf, 26, epv); + _mav_put_uint16_t(buf, 28, vel); + _mav_put_uint16_t(buf, 30, cog); + _mav_put_uint8_t(buf, 32, fix_type); + _mav_put_uint8_t(buf, 33, satellites_visible); + _mav_put_uint8_t(buf, 34, dgps_numch); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN); #else - mavlink_gps2_raw_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.dgps_age = dgps_age; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; - packet.dgps_numch = dgps_numch; + mavlink_gps2_raw_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.dgps_age = dgps_age; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; + packet.dgps_numch = dgps_numch; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS2_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS2_RAW; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); } /** @@ -186,7 +201,7 @@ static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_gps2_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw) { - return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age); + return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age); } /** @@ -200,7 +215,7 @@ static inline uint16_t mavlink_msg_gps2_raw_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw) { - return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age); + return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age); } /** @@ -225,45 +240,51 @@ static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint32_t(buf, 20, dgps_age); - _mav_put_uint16_t(buf, 24, eph); - _mav_put_uint16_t(buf, 26, epv); - _mav_put_uint16_t(buf, 28, vel); - _mav_put_uint16_t(buf, 30, cog); - _mav_put_uint8_t(buf, 32, fix_type); - _mav_put_uint8_t(buf, 33, satellites_visible); - _mav_put_uint8_t(buf, 34, dgps_numch); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); + char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint32_t(buf, 20, dgps_age); + _mav_put_uint16_t(buf, 24, eph); + _mav_put_uint16_t(buf, 26, epv); + _mav_put_uint16_t(buf, 28, vel); + _mav_put_uint16_t(buf, 30, cog); + _mav_put_uint8_t(buf, 32, fix_type); + _mav_put_uint8_t(buf, 33, satellites_visible); + _mav_put_uint8_t(buf, 34, dgps_numch); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN); + mavlink_gps2_raw_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.dgps_age = dgps_age; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; + packet.dgps_numch = dgps_numch; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); #endif +} + +/** + * @brief Send a gps2_raw message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_gps2_raw_send_struct(mavlink_channel_t chan, const mavlink_gps2_raw_t* gps2_raw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_gps2_raw_send(chan, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age); #else - mavlink_gps2_raw_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.dgps_age = dgps_age; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; - packet.dgps_numch = dgps_numch; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)gps2_raw, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); #endif } @@ -278,45 +299,37 @@ static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint64_t ti static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint32_t(buf, 20, dgps_age); - _mav_put_uint16_t(buf, 24, eph); - _mav_put_uint16_t(buf, 26, epv); - _mav_put_uint16_t(buf, 28, vel); - _mav_put_uint16_t(buf, 30, cog); - _mav_put_uint8_t(buf, 32, fix_type); - _mav_put_uint8_t(buf, 33, satellites_visible); - _mav_put_uint8_t(buf, 34, dgps_numch); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint32_t(buf, 20, dgps_age); + _mav_put_uint16_t(buf, 24, eph); + _mav_put_uint16_t(buf, 26, epv); + _mav_put_uint16_t(buf, 28, vel); + _mav_put_uint16_t(buf, 30, cog); + _mav_put_uint8_t(buf, 32, fix_type); + _mav_put_uint8_t(buf, 33, satellites_visible); + _mav_put_uint8_t(buf, 34, dgps_numch); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN); -#endif -#else - mavlink_gps2_raw_t *packet = (mavlink_gps2_raw_t *)msgbuf; - packet->time_usec = time_usec; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->dgps_age = dgps_age; - packet->eph = eph; - packet->epv = epv; - packet->vel = vel; - packet->cog = cog; - packet->fix_type = fix_type; - packet->satellites_visible = satellites_visible; - packet->dgps_numch = dgps_numch; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_LEN); -#endif + mavlink_gps2_raw_t *packet = (mavlink_gps2_raw_t *)msgbuf; + packet->time_usec = time_usec; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->dgps_age = dgps_age; + packet->eph = eph; + packet->epv = epv; + packet->vel = vel; + packet->cog = cog; + packet->fix_type = fix_type; + packet->satellites_visible = satellites_visible; + packet->dgps_numch = dgps_numch; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC); #endif } #endif @@ -333,7 +346,7 @@ static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -343,7 +356,7 @@ static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_ */ static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -353,7 +366,7 @@ static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* */ static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -363,7 +376,7 @@ static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg) */ static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -373,7 +386,7 @@ static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg) */ static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -383,7 +396,7 @@ static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg) */ static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -393,7 +406,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg */ static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 26); + return _MAV_RETURN_uint16_t(msg, 26); } /** @@ -403,7 +416,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg */ static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -413,7 +426,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg */ static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 30); + return _MAV_RETURN_uint16_t(msg, 30); } /** @@ -423,7 +436,7 @@ static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg */ static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 33); + return _MAV_RETURN_uint8_t(msg, 33); } /** @@ -433,7 +446,7 @@ static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_ */ static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -443,7 +456,7 @@ static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_ */ static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 20); + return _MAV_RETURN_uint32_t(msg, 20); } /** @@ -454,20 +467,22 @@ static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t */ static inline void mavlink_msg_gps2_raw_decode(const mavlink_message_t* msg, mavlink_gps2_raw_t* gps2_raw) { -#if MAVLINK_NEED_BYTE_SWAP - gps2_raw->time_usec = mavlink_msg_gps2_raw_get_time_usec(msg); - gps2_raw->lat = mavlink_msg_gps2_raw_get_lat(msg); - gps2_raw->lon = mavlink_msg_gps2_raw_get_lon(msg); - gps2_raw->alt = mavlink_msg_gps2_raw_get_alt(msg); - gps2_raw->dgps_age = mavlink_msg_gps2_raw_get_dgps_age(msg); - gps2_raw->eph = mavlink_msg_gps2_raw_get_eph(msg); - gps2_raw->epv = mavlink_msg_gps2_raw_get_epv(msg); - gps2_raw->vel = mavlink_msg_gps2_raw_get_vel(msg); - gps2_raw->cog = mavlink_msg_gps2_raw_get_cog(msg); - gps2_raw->fix_type = mavlink_msg_gps2_raw_get_fix_type(msg); - gps2_raw->satellites_visible = mavlink_msg_gps2_raw_get_satellites_visible(msg); - gps2_raw->dgps_numch = mavlink_msg_gps2_raw_get_dgps_numch(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + gps2_raw->time_usec = mavlink_msg_gps2_raw_get_time_usec(msg); + gps2_raw->lat = mavlink_msg_gps2_raw_get_lat(msg); + gps2_raw->lon = mavlink_msg_gps2_raw_get_lon(msg); + gps2_raw->alt = mavlink_msg_gps2_raw_get_alt(msg); + gps2_raw->dgps_age = mavlink_msg_gps2_raw_get_dgps_age(msg); + gps2_raw->eph = mavlink_msg_gps2_raw_get_eph(msg); + gps2_raw->epv = mavlink_msg_gps2_raw_get_epv(msg); + gps2_raw->vel = mavlink_msg_gps2_raw_get_vel(msg); + gps2_raw->cog = mavlink_msg_gps2_raw_get_cog(msg); + gps2_raw->fix_type = mavlink_msg_gps2_raw_get_fix_type(msg); + gps2_raw->satellites_visible = mavlink_msg_gps2_raw_get_satellites_visible(msg); + gps2_raw->dgps_numch = mavlink_msg_gps2_raw_get_dgps_numch(msg); #else - memcpy(gps2_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS2_RAW_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RAW_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RAW_LEN; + memset(gps2_raw, 0, MAVLINK_MSG_ID_GPS2_RAW_LEN); + memcpy(gps2_raw, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_rtk.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_rtk.h index e0f9b53..cdde523 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_rtk.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps2_rtk.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE GPS2_RTK PACKING #define MAVLINK_MSG_ID_GPS2_RTK 128 -typedef struct __mavlink_gps2_rtk_t -{ +MAVPACKED( +typedef struct __mavlink_gps2_rtk_t { uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/ uint32_t tow; /*< GPS Time of Week of last baseline*/ int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/ @@ -17,20 +18,24 @@ typedef struct __mavlink_gps2_rtk_t uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/ uint8_t nsats; /*< Current number of sats used for RTK calculation.*/ uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/ -} mavlink_gps2_rtk_t; +}) mavlink_gps2_rtk_t; #define MAVLINK_MSG_ID_GPS2_RTK_LEN 35 +#define MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN 35 #define MAVLINK_MSG_ID_128_LEN 35 +#define MAVLINK_MSG_ID_128_MIN_LEN 35 #define MAVLINK_MSG_ID_GPS2_RTK_CRC 226 #define MAVLINK_MSG_ID_128_CRC 226 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GPS2_RTK { \ - "GPS2_RTK", \ - 13, \ - { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \ + 128, \ + "GPS2_RTK", \ + 13, \ + { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \ { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \ { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \ { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \ @@ -45,7 +50,26 @@ typedef struct __mavlink_gps2_rtk_t { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GPS2_RTK { \ + "GPS2_RTK", \ + 13, \ + { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \ + { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \ + { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \ + { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \ + { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \ + { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \ + { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \ + { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \ + { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \ + { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \ + { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \ + { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \ + { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \ + } \ +} +#endif /** * @brief Pack a gps2_rtk message @@ -69,50 +93,46 @@ typedef struct __mavlink_gps2_rtk_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) + uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN]; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); + char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN]; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN); #else - mavlink_gps2_rtk_t packet; - packet.time_last_baseline_ms = time_last_baseline_ms; - packet.tow = tow; - packet.baseline_a_mm = baseline_a_mm; - packet.baseline_b_mm = baseline_b_mm; - packet.baseline_c_mm = baseline_c_mm; - packet.accuracy = accuracy; - packet.iar_num_hypotheses = iar_num_hypotheses; - packet.wn = wn; - packet.rtk_receiver_id = rtk_receiver_id; - packet.rtk_health = rtk_health; - packet.rtk_rate = rtk_rate; - packet.nsats = nsats; - packet.baseline_coords_type = baseline_coords_type; + mavlink_gps2_rtk_t packet; + packet.time_last_baseline_ms = time_last_baseline_ms; + packet.tow = tow; + packet.baseline_a_mm = baseline_a_mm; + packet.baseline_b_mm = baseline_b_mm; + packet.baseline_c_mm = baseline_c_mm; + packet.accuracy = accuracy; + packet.iar_num_hypotheses = iar_num_hypotheses; + packet.wn = wn; + packet.rtk_receiver_id = rtk_receiver_id; + packet.rtk_health = rtk_health; + packet.rtk_rate = rtk_rate; + packet.nsats = nsats; + packet.baseline_coords_type = baseline_coords_type; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS2_RTK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RTK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS2_RTK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); } /** @@ -137,51 +157,47 @@ static inline uint16_t mavlink_msg_gps2_rtk_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps2_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses) + mavlink_message_t* msg, + uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN]; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); + char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN]; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN); #else - mavlink_gps2_rtk_t packet; - packet.time_last_baseline_ms = time_last_baseline_ms; - packet.tow = tow; - packet.baseline_a_mm = baseline_a_mm; - packet.baseline_b_mm = baseline_b_mm; - packet.baseline_c_mm = baseline_c_mm; - packet.accuracy = accuracy; - packet.iar_num_hypotheses = iar_num_hypotheses; - packet.wn = wn; - packet.rtk_receiver_id = rtk_receiver_id; - packet.rtk_health = rtk_health; - packet.rtk_rate = rtk_rate; - packet.nsats = nsats; - packet.baseline_coords_type = baseline_coords_type; + mavlink_gps2_rtk_t packet; + packet.time_last_baseline_ms = time_last_baseline_ms; + packet.tow = tow; + packet.baseline_a_mm = baseline_a_mm; + packet.baseline_b_mm = baseline_b_mm; + packet.baseline_c_mm = baseline_c_mm; + packet.accuracy = accuracy; + packet.iar_num_hypotheses = iar_num_hypotheses; + packet.wn = wn; + packet.rtk_receiver_id = rtk_receiver_id; + packet.rtk_health = rtk_health; + packet.rtk_rate = rtk_rate; + packet.nsats = nsats; + packet.baseline_coords_type = baseline_coords_type; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS2_RTK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RTK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS2_RTK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); } /** @@ -194,7 +210,7 @@ static inline uint16_t mavlink_msg_gps2_rtk_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_gps2_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk) { - return mavlink_msg_gps2_rtk_pack(system_id, component_id, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses); + return mavlink_msg_gps2_rtk_pack(system_id, component_id, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses); } /** @@ -208,7 +224,7 @@ static inline uint16_t mavlink_msg_gps2_rtk_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_gps2_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk) { - return mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, chan, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses); + return mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, chan, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses); } /** @@ -234,47 +250,53 @@ static inline uint16_t mavlink_msg_gps2_rtk_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_gps2_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN]; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); + char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN]; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_LEN); + mavlink_gps2_rtk_t packet; + packet.time_last_baseline_ms = time_last_baseline_ms; + packet.tow = tow; + packet.baseline_a_mm = baseline_a_mm; + packet.baseline_b_mm = baseline_b_mm; + packet.baseline_c_mm = baseline_c_mm; + packet.accuracy = accuracy; + packet.iar_num_hypotheses = iar_num_hypotheses; + packet.wn = wn; + packet.rtk_receiver_id = rtk_receiver_id; + packet.rtk_health = rtk_health; + packet.rtk_rate = rtk_rate; + packet.nsats = nsats; + packet.baseline_coords_type = baseline_coords_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); #endif +} + +/** + * @brief Send a gps2_rtk message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_gps2_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps2_rtk_t* gps2_rtk) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_gps2_rtk_send(chan, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses); #else - mavlink_gps2_rtk_t packet; - packet.time_last_baseline_ms = time_last_baseline_ms; - packet.tow = tow; - packet.baseline_a_mm = baseline_a_mm; - packet.baseline_b_mm = baseline_b_mm; - packet.baseline_c_mm = baseline_c_mm; - packet.accuracy = accuracy; - packet.iar_num_hypotheses = iar_num_hypotheses; - packet.wn = wn; - packet.rtk_receiver_id = rtk_receiver_id; - packet.rtk_health = rtk_health; - packet.rtk_rate = rtk_rate; - packet.nsats = nsats; - packet.baseline_coords_type = baseline_coords_type; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RTK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)gps2_rtk, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); #endif } @@ -289,47 +311,39 @@ static inline void mavlink_msg_gps2_rtk_send(mavlink_channel_t chan, uint32_t ti static inline void mavlink_msg_gps2_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_LEN); -#endif -#else - mavlink_gps2_rtk_t *packet = (mavlink_gps2_rtk_t *)msgbuf; - packet->time_last_baseline_ms = time_last_baseline_ms; - packet->tow = tow; - packet->baseline_a_mm = baseline_a_mm; - packet->baseline_b_mm = baseline_b_mm; - packet->baseline_c_mm = baseline_c_mm; - packet->accuracy = accuracy; - packet->iar_num_hypotheses = iar_num_hypotheses; - packet->wn = wn; - packet->rtk_receiver_id = rtk_receiver_id; - packet->rtk_health = rtk_health; - packet->rtk_rate = rtk_rate; - packet->nsats = nsats; - packet->baseline_coords_type = baseline_coords_type; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS2_RTK_LEN); -#endif + mavlink_gps2_rtk_t *packet = (mavlink_gps2_rtk_t *)msgbuf; + packet->time_last_baseline_ms = time_last_baseline_ms; + packet->tow = tow; + packet->baseline_a_mm = baseline_a_mm; + packet->baseline_b_mm = baseline_b_mm; + packet->baseline_c_mm = baseline_c_mm; + packet->accuracy = accuracy; + packet->iar_num_hypotheses = iar_num_hypotheses; + packet->wn = wn; + packet->rtk_receiver_id = rtk_receiver_id; + packet->rtk_health = rtk_health; + packet->rtk_rate = rtk_rate; + packet->nsats = nsats; + packet->baseline_coords_type = baseline_coords_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC); #endif } #endif @@ -346,7 +360,7 @@ static inline void mavlink_msg_gps2_rtk_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint32_t mavlink_msg_gps2_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -356,7 +370,7 @@ static inline uint32_t mavlink_msg_gps2_rtk_get_time_last_baseline_ms(const mavl */ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_receiver_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 30); + return _MAV_RETURN_uint8_t(msg, 30); } /** @@ -366,7 +380,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_receiver_id(const mavlink_mes */ static inline uint16_t mavlink_msg_gps2_rtk_get_wn(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -376,7 +390,7 @@ static inline uint16_t mavlink_msg_gps2_rtk_get_wn(const mavlink_message_t* msg) */ static inline uint32_t mavlink_msg_gps2_rtk_get_tow(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 4); + return _MAV_RETURN_uint32_t(msg, 4); } /** @@ -386,7 +400,7 @@ static inline uint32_t mavlink_msg_gps2_rtk_get_tow(const mavlink_message_t* msg */ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_health(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 31); + return _MAV_RETURN_uint8_t(msg, 31); } /** @@ -396,7 +410,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_health(const mavlink_message_ */ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -406,7 +420,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_rate(const mavlink_message_t* */ static inline uint8_t mavlink_msg_gps2_rtk_get_nsats(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 33); + return _MAV_RETURN_uint8_t(msg, 33); } /** @@ -416,7 +430,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_nsats(const mavlink_message_t* ms */ static inline uint8_t mavlink_msg_gps2_rtk_get_baseline_coords_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -426,7 +440,7 @@ static inline uint8_t mavlink_msg_gps2_rtk_get_baseline_coords_type(const mavlin */ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_a_mm(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -436,7 +450,7 @@ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_a_mm(const mavlink_messa */ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_b_mm(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -446,7 +460,7 @@ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_b_mm(const mavlink_messa */ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_c_mm(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -456,7 +470,7 @@ static inline int32_t mavlink_msg_gps2_rtk_get_baseline_c_mm(const mavlink_messa */ static inline uint32_t mavlink_msg_gps2_rtk_get_accuracy(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 20); + return _MAV_RETURN_uint32_t(msg, 20); } /** @@ -466,7 +480,7 @@ static inline uint32_t mavlink_msg_gps2_rtk_get_accuracy(const mavlink_message_t */ static inline int32_t mavlink_msg_gps2_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 24); + return _MAV_RETURN_int32_t(msg, 24); } /** @@ -477,21 +491,23 @@ static inline int32_t mavlink_msg_gps2_rtk_get_iar_num_hypotheses(const mavlink_ */ static inline void mavlink_msg_gps2_rtk_decode(const mavlink_message_t* msg, mavlink_gps2_rtk_t* gps2_rtk) { -#if MAVLINK_NEED_BYTE_SWAP - gps2_rtk->time_last_baseline_ms = mavlink_msg_gps2_rtk_get_time_last_baseline_ms(msg); - gps2_rtk->tow = mavlink_msg_gps2_rtk_get_tow(msg); - gps2_rtk->baseline_a_mm = mavlink_msg_gps2_rtk_get_baseline_a_mm(msg); - gps2_rtk->baseline_b_mm = mavlink_msg_gps2_rtk_get_baseline_b_mm(msg); - gps2_rtk->baseline_c_mm = mavlink_msg_gps2_rtk_get_baseline_c_mm(msg); - gps2_rtk->accuracy = mavlink_msg_gps2_rtk_get_accuracy(msg); - gps2_rtk->iar_num_hypotheses = mavlink_msg_gps2_rtk_get_iar_num_hypotheses(msg); - gps2_rtk->wn = mavlink_msg_gps2_rtk_get_wn(msg); - gps2_rtk->rtk_receiver_id = mavlink_msg_gps2_rtk_get_rtk_receiver_id(msg); - gps2_rtk->rtk_health = mavlink_msg_gps2_rtk_get_rtk_health(msg); - gps2_rtk->rtk_rate = mavlink_msg_gps2_rtk_get_rtk_rate(msg); - gps2_rtk->nsats = mavlink_msg_gps2_rtk_get_nsats(msg); - gps2_rtk->baseline_coords_type = mavlink_msg_gps2_rtk_get_baseline_coords_type(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + gps2_rtk->time_last_baseline_ms = mavlink_msg_gps2_rtk_get_time_last_baseline_ms(msg); + gps2_rtk->tow = mavlink_msg_gps2_rtk_get_tow(msg); + gps2_rtk->baseline_a_mm = mavlink_msg_gps2_rtk_get_baseline_a_mm(msg); + gps2_rtk->baseline_b_mm = mavlink_msg_gps2_rtk_get_baseline_b_mm(msg); + gps2_rtk->baseline_c_mm = mavlink_msg_gps2_rtk_get_baseline_c_mm(msg); + gps2_rtk->accuracy = mavlink_msg_gps2_rtk_get_accuracy(msg); + gps2_rtk->iar_num_hypotheses = mavlink_msg_gps2_rtk_get_iar_num_hypotheses(msg); + gps2_rtk->wn = mavlink_msg_gps2_rtk_get_wn(msg); + gps2_rtk->rtk_receiver_id = mavlink_msg_gps2_rtk_get_rtk_receiver_id(msg); + gps2_rtk->rtk_health = mavlink_msg_gps2_rtk_get_rtk_health(msg); + gps2_rtk->rtk_rate = mavlink_msg_gps2_rtk_get_rtk_rate(msg); + gps2_rtk->nsats = mavlink_msg_gps2_rtk_get_nsats(msg); + gps2_rtk->baseline_coords_type = mavlink_msg_gps2_rtk_get_baseline_coords_type(msg); #else - memcpy(gps2_rtk, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS2_RTK_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RTK_LEN; + memset(gps2_rtk, 0, MAVLINK_MSG_ID_GPS2_RTK_LEN); + memcpy(gps2_rtk, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_global_origin.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_global_origin.h index b59ef95..0b8de80 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_global_origin.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_global_origin.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE GPS_GLOBAL_ORIGIN PACKING #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN 49 -typedef struct __mavlink_gps_global_origin_t -{ +MAVPACKED( +typedef struct __mavlink_gps_global_origin_t { int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ int32_t longitude; /*< Longitude (WGS84), in degrees * 1E7*/ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ -} mavlink_gps_global_origin_t; +}) mavlink_gps_global_origin_t; #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12 +#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN 12 #define MAVLINK_MSG_ID_49_LEN 12 +#define MAVLINK_MSG_ID_49_MIN_LEN 12 #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC 39 #define MAVLINK_MSG_ID_49_CRC 39 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \ - "GPS_GLOBAL_ORIGIN", \ - 3, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \ + 49, \ + "GPS_GLOBAL_ORIGIN", \ + 3, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \ + "GPS_GLOBAL_ORIGIN", \ + 3, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \ + { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \ + } \ +} +#endif /** * @brief Pack a gps_global_origin message @@ -39,30 +53,26 @@ typedef struct __mavlink_gps_global_origin_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t latitude, int32_t longitude, int32_t altitude) + int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); + char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #else - mavlink_gps_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; + mavlink_gps_global_origin_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t latitude,int32_t longitude,int32_t altitude) + mavlink_message_t* msg, + int32_t latitude,int32_t longitude,int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); + char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #else - mavlink_gps_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; + mavlink_gps_global_origin_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id */ static inline uint16_t mavlink_msg_gps_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin) { - return mavlink_msg_gps_global_origin_pack(system_id, component_id, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude); + return mavlink_msg_gps_global_origin_pack(system_id, component_id, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_gps_global_origin_encode(uint8_t system_id, u */ static inline uint16_t mavlink_msg_gps_global_origin_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin) { - return mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, chan, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude); + return mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, chan, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_gps_global_origin_encode_chan(uint8_t system_ static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); + char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); + mavlink_gps_global_origin_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); #endif -#else - mavlink_gps_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); +/** + * @brief Send a gps_global_origin message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_gps_global_origin_send_struct(mavlink_channel_t chan, const mavlink_gps_global_origin_t* gps_global_origin) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_gps_global_origin_send(chan, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)gps_global_origin, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, in static inline void mavlink_msg_gps_global_origin_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); #else - mavlink_gps_global_origin_t *packet = (mavlink_gps_global_origin_t *)msgbuf; - packet->latitude = latitude; - packet->longitude = longitude; - packet->altitude = altitude; + mavlink_gps_global_origin_t *packet = (mavlink_gps_global_origin_t *)msgbuf; + packet->latitude = latitude; + packet->longitude = longitude; + packet->altitude = altitude; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_gps_global_origin_send_buf(mavlink_message_t *msg */ static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -226,7 +230,7 @@ static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_m */ static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -236,7 +240,7 @@ static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_ */ static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -247,11 +251,13 @@ static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_m */ static inline void mavlink_msg_gps_global_origin_decode(const mavlink_message_t* msg, mavlink_gps_global_origin_t* gps_global_origin) { -#if MAVLINK_NEED_BYTE_SWAP - gps_global_origin->latitude = mavlink_msg_gps_global_origin_get_latitude(msg); - gps_global_origin->longitude = mavlink_msg_gps_global_origin_get_longitude(msg); - gps_global_origin->altitude = mavlink_msg_gps_global_origin_get_altitude(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + gps_global_origin->latitude = mavlink_msg_gps_global_origin_get_latitude(msg); + gps_global_origin->longitude = mavlink_msg_gps_global_origin_get_longitude(msg); + gps_global_origin->altitude = mavlink_msg_gps_global_origin_get_altitude(msg); #else - memcpy(gps_global_origin, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN? msg->len : MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN; + memset(gps_global_origin, 0, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN); + memcpy(gps_global_origin, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_inject_data.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_inject_data.h index 7f88824..2767a30 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_inject_data.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_inject_data.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE GPS_INJECT_DATA PACKING #define MAVLINK_MSG_ID_GPS_INJECT_DATA 123 -typedef struct __mavlink_gps_inject_data_t -{ +MAVPACKED( +typedef struct __mavlink_gps_inject_data_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ uint8_t len; /*< data length*/ uint8_t data[110]; /*< raw data (110 is enough for 12 satellites of RTCMv2)*/ -} mavlink_gps_inject_data_t; +}) mavlink_gps_inject_data_t; #define MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN 113 +#define MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN 113 #define MAVLINK_MSG_ID_123_LEN 113 +#define MAVLINK_MSG_ID_123_MIN_LEN 113 #define MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC 250 #define MAVLINK_MSG_ID_123_CRC 250 #define MAVLINK_MSG_GPS_INJECT_DATA_FIELD_DATA_LEN 110 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \ - "GPS_INJECT_DATA", \ - 4, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \ + 123, \ + "GPS_INJECT_DATA", \ + 4, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \ { "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \ { "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \ + "GPS_INJECT_DATA", \ + 4, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \ + { "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \ + } \ +} +#endif /** * @brief Pack a gps_inject_data message @@ -42,30 +57,26 @@ typedef struct __mavlink_gps_inject_data_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data) + uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, len); - _mav_put_uint8_t_array(buf, 3, data, 110); + char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, len); + _mav_put_uint8_t_array(buf, 3, data, 110); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); #else - mavlink_gps_inject_data_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.len = len; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110); + mavlink_gps_inject_data_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + packet.len = len; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); } /** @@ -81,31 +92,27 @@ static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_inject_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t len,const uint8_t *data) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint8_t len,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, len); - _mav_put_uint8_t_array(buf, 3, data, 110); + char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, len); + _mav_put_uint8_t_array(buf, 3, data, 110); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); #else - mavlink_gps_inject_data_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.len = len; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110); + mavlink_gps_inject_data_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + packet.len = len; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); } /** @@ -118,7 +125,7 @@ static inline uint16_t mavlink_msg_gps_inject_data_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_gps_inject_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data) { - return mavlink_msg_gps_inject_data_pack(system_id, component_id, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data); + return mavlink_msg_gps_inject_data_pack(system_id, component_id, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data); } /** @@ -132,7 +139,7 @@ static inline uint16_t mavlink_msg_gps_inject_data_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_gps_inject_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data) { - return mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, chan, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data); + return mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, chan, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data); } /** @@ -149,27 +156,33 @@ static inline uint16_t mavlink_msg_gps_inject_data_encode_chan(uint8_t system_id static inline void mavlink_msg_gps_inject_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, len); - _mav_put_uint8_t_array(buf, 3, data, 110); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); + char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, len); + _mav_put_uint8_t_array(buf, 3, data, 110); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); + mavlink_gps_inject_data_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + packet.len = len; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); #endif +} + +/** + * @brief Send a gps_inject_data message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_gps_inject_data_send_struct(mavlink_channel_t chan, const mavlink_gps_inject_data_t* gps_inject_data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_gps_inject_data_send(chan, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data); #else - mavlink_gps_inject_data_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.len = len; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)gps_inject_data, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); #endif } @@ -184,27 +197,19 @@ static inline void mavlink_msg_gps_inject_data_send(mavlink_channel_t chan, uint static inline void mavlink_msg_gps_inject_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, len); - _mav_put_uint8_t_array(buf, 3, data, 110); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, len); + _mav_put_uint8_t_array(buf, 3, data, 110); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); -#endif -#else - mavlink_gps_inject_data_t *packet = (mavlink_gps_inject_data_t *)msgbuf; - packet->target_system = target_system; - packet->target_component = target_component; - packet->len = len; - mav_array_memcpy(packet->data, data, sizeof(uint8_t)*110); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); -#endif + mavlink_gps_inject_data_t *packet = (mavlink_gps_inject_data_t *)msgbuf; + packet->target_system = target_system; + packet->target_component = target_component; + packet->len = len; + mav_array_memcpy(packet->data, data, sizeof(uint8_t)*110); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC); #endif } #endif @@ -221,7 +226,7 @@ static inline void mavlink_msg_gps_inject_data_send_buf(mavlink_message_t *msgbu */ static inline uint8_t mavlink_msg_gps_inject_data_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -231,7 +236,7 @@ static inline uint8_t mavlink_msg_gps_inject_data_get_target_system(const mavlin */ static inline uint8_t mavlink_msg_gps_inject_data_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -241,7 +246,7 @@ static inline uint8_t mavlink_msg_gps_inject_data_get_target_component(const mav */ static inline uint8_t mavlink_msg_gps_inject_data_get_len(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -251,7 +256,7 @@ static inline uint8_t mavlink_msg_gps_inject_data_get_len(const mavlink_message_ */ static inline uint16_t mavlink_msg_gps_inject_data_get_data(const mavlink_message_t* msg, uint8_t *data) { - return _MAV_RETURN_uint8_t_array(msg, data, 110, 3); + return _MAV_RETURN_uint8_t_array(msg, data, 110, 3); } /** @@ -262,12 +267,14 @@ static inline uint16_t mavlink_msg_gps_inject_data_get_data(const mavlink_messag */ static inline void mavlink_msg_gps_inject_data_decode(const mavlink_message_t* msg, mavlink_gps_inject_data_t* gps_inject_data) { -#if MAVLINK_NEED_BYTE_SWAP - gps_inject_data->target_system = mavlink_msg_gps_inject_data_get_target_system(msg); - gps_inject_data->target_component = mavlink_msg_gps_inject_data_get_target_component(msg); - gps_inject_data->len = mavlink_msg_gps_inject_data_get_len(msg); - mavlink_msg_gps_inject_data_get_data(msg, gps_inject_data->data); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + gps_inject_data->target_system = mavlink_msg_gps_inject_data_get_target_system(msg); + gps_inject_data->target_component = mavlink_msg_gps_inject_data_get_target_component(msg); + gps_inject_data->len = mavlink_msg_gps_inject_data_get_len(msg); + mavlink_msg_gps_inject_data_get_data(msg, gps_inject_data->data); #else - memcpy(gps_inject_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN? msg->len : MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN; + memset(gps_inject_data, 0, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN); + memcpy(gps_inject_data, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_raw_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_raw_int.h index 8f55495..3fe9c2d 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_raw_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_raw_int.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE GPS_RAW_INT PACKING #define MAVLINK_MSG_ID_GPS_RAW_INT 24 -typedef struct __mavlink_gps_raw_int_t -{ +MAVPACKED( +typedef struct __mavlink_gps_raw_int_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_gps_raw_int_t uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/ uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/ uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ -} mavlink_gps_raw_int_t; +}) mavlink_gps_raw_int_t; #define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 30 +#define MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN 30 #define MAVLINK_MSG_ID_24_LEN 30 +#define MAVLINK_MSG_ID_24_MIN_LEN 30 #define MAVLINK_MSG_ID_GPS_RAW_INT_CRC 24 #define MAVLINK_MSG_ID_24_CRC 24 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \ - "GPS_RAW_INT", \ - 10, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \ + 24, \ + "GPS_RAW_INT", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_gps_raw_int_t { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \ + "GPS_RAW_INT", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \ + { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \ + { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \ + { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \ + { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \ + { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \ + } \ +} +#endif /** * @brief Pack a gps_raw_int message @@ -60,44 +81,40 @@ typedef struct __mavlink_gps_raw_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible) + uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_uint16_t(buf, 26, cog); - _mav_put_uint8_t(buf, 28, fix_type); - _mav_put_uint8_t(buf, 29, satellites_visible); + char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_uint16_t(buf, 26, cog); + _mav_put_uint8_t(buf, 28, fix_type); + _mav_put_uint8_t(buf, 29, satellites_visible); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #else - mavlink_gps_raw_int_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; + mavlink_gps_raw_int_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_uint16_t(buf, 26, cog); - _mav_put_uint8_t(buf, 28, fix_type); - _mav_put_uint8_t(buf, 29, satellites_visible); + char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_uint16_t(buf, 26, cog); + _mav_put_uint8_t(buf, 28, fix_type); + _mav_put_uint8_t(buf, 29, satellites_visible); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #else - mavlink_gps_raw_int_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; + mavlink_gps_raw_int_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int) { - return mavlink_msg_gps_raw_int_pack(system_id, component_id, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible); + return mavlink_msg_gps_raw_int_pack(system_id, component_id, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int) { - return mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, chan, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible); + return mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, chan, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_uint16_t(buf, 26, cog); - _mav_put_uint8_t(buf, 28, fix_type); - _mav_put_uint8_t(buf, 29, satellites_visible); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); + char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_uint16_t(buf, 26, cog); + _mav_put_uint8_t(buf, 28, fix_type); + _mav_put_uint8_t(buf, 29, satellites_visible); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); + mavlink_gps_raw_int_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); #endif +} + +/** + * @brief Send a gps_raw_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_gps_raw_int_send_struct(mavlink_channel_t chan, const mavlink_gps_raw_int_t* gps_raw_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_gps_raw_int_send(chan, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible); #else - mavlink_gps_raw_int_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)gps_raw_int, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t static inline void mavlink_msg_gps_raw_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_uint16_t(buf, 26, cog); - _mav_put_uint8_t(buf, 28, fix_type); - _mav_put_uint8_t(buf, 29, satellites_visible); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); -#endif -#else - mavlink_gps_raw_int_t *packet = (mavlink_gps_raw_int_t *)msgbuf; - packet->time_usec = time_usec; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->eph = eph; - packet->epv = epv; - packet->vel = vel; - packet->cog = cog; - packet->fix_type = fix_type; - packet->satellites_visible = satellites_visible; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_uint16_t(buf, 26, cog); + _mav_put_uint8_t(buf, 28, fix_type); + _mav_put_uint8_t(buf, 29, satellites_visible); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); -#endif + mavlink_gps_raw_int_t *packet = (mavlink_gps_raw_int_t *)msgbuf; + packet->time_usec = time_usec; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->eph = eph; + packet->epv = epv; + packet->vel = vel; + packet->cog = cog; + packet->fix_type = fix_type; + packet->satellites_visible = satellites_visible; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_gps_raw_int_send_buf(mavlink_message_t *msgbuf, m */ static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -317,7 +328,7 @@ static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_messa */ static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 28); + return _MAV_RETURN_uint8_t(msg, 28); } /** @@ -327,7 +338,7 @@ static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message */ static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -337,7 +348,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* m */ static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -347,7 +358,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* m */ static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -357,7 +368,7 @@ static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* m */ static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 20); + return _MAV_RETURN_uint16_t(msg, 20); } /** @@ -367,7 +378,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* */ static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 22); + return _MAV_RETURN_uint16_t(msg, 22); } /** @@ -377,7 +388,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* */ static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -387,7 +398,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* */ static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 26); + return _MAV_RETURN_uint16_t(msg, 26); } /** @@ -397,7 +408,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* */ static inline uint8_t mavlink_msg_gps_raw_int_get_satellites_visible(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 29); + return _MAV_RETURN_uint8_t(msg, 29); } /** @@ -408,18 +419,20 @@ static inline uint8_t mavlink_msg_gps_raw_int_get_satellites_visible(const mavli */ static inline void mavlink_msg_gps_raw_int_decode(const mavlink_message_t* msg, mavlink_gps_raw_int_t* gps_raw_int) { -#if MAVLINK_NEED_BYTE_SWAP - gps_raw_int->time_usec = mavlink_msg_gps_raw_int_get_time_usec(msg); - gps_raw_int->lat = mavlink_msg_gps_raw_int_get_lat(msg); - gps_raw_int->lon = mavlink_msg_gps_raw_int_get_lon(msg); - gps_raw_int->alt = mavlink_msg_gps_raw_int_get_alt(msg); - gps_raw_int->eph = mavlink_msg_gps_raw_int_get_eph(msg); - gps_raw_int->epv = mavlink_msg_gps_raw_int_get_epv(msg); - gps_raw_int->vel = mavlink_msg_gps_raw_int_get_vel(msg); - gps_raw_int->cog = mavlink_msg_gps_raw_int_get_cog(msg); - gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg); - gps_raw_int->satellites_visible = mavlink_msg_gps_raw_int_get_satellites_visible(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + gps_raw_int->time_usec = mavlink_msg_gps_raw_int_get_time_usec(msg); + gps_raw_int->lat = mavlink_msg_gps_raw_int_get_lat(msg); + gps_raw_int->lon = mavlink_msg_gps_raw_int_get_lon(msg); + gps_raw_int->alt = mavlink_msg_gps_raw_int_get_alt(msg); + gps_raw_int->eph = mavlink_msg_gps_raw_int_get_eph(msg); + gps_raw_int->epv = mavlink_msg_gps_raw_int_get_epv(msg); + gps_raw_int->vel = mavlink_msg_gps_raw_int_get_vel(msg); + gps_raw_int->cog = mavlink_msg_gps_raw_int_get_cog(msg); + gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg); + gps_raw_int->satellites_visible = mavlink_msg_gps_raw_int_get_satellites_visible(msg); #else - memcpy(gps_raw_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_RAW_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RAW_INT_LEN? msg->len : MAVLINK_MSG_ID_GPS_RAW_INT_LEN; + memset(gps_raw_int, 0, MAVLINK_MSG_ID_GPS_RAW_INT_LEN); + memcpy(gps_raw_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_rtk.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_rtk.h index 658b76c..0dada2e 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_rtk.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_rtk.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE GPS_RTK PACKING #define MAVLINK_MSG_ID_GPS_RTK 127 -typedef struct __mavlink_gps_rtk_t -{ +MAVPACKED( +typedef struct __mavlink_gps_rtk_t { uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/ uint32_t tow; /*< GPS Time of Week of last baseline*/ int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/ @@ -17,20 +18,24 @@ typedef struct __mavlink_gps_rtk_t uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/ uint8_t nsats; /*< Current number of sats used for RTK calculation.*/ uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/ -} mavlink_gps_rtk_t; +}) mavlink_gps_rtk_t; #define MAVLINK_MSG_ID_GPS_RTK_LEN 35 +#define MAVLINK_MSG_ID_GPS_RTK_MIN_LEN 35 #define MAVLINK_MSG_ID_127_LEN 35 +#define MAVLINK_MSG_ID_127_MIN_LEN 35 #define MAVLINK_MSG_ID_GPS_RTK_CRC 25 #define MAVLINK_MSG_ID_127_CRC 25 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GPS_RTK { \ - "GPS_RTK", \ - 13, \ - { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \ + 127, \ + "GPS_RTK", \ + 13, \ + { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \ { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \ { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \ { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \ @@ -45,7 +50,26 @@ typedef struct __mavlink_gps_rtk_t { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GPS_RTK { \ + "GPS_RTK", \ + 13, \ + { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \ + { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \ + { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \ + { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \ + { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \ + { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \ + { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \ + { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \ + { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \ + { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \ + { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \ + { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \ + { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \ + } \ +} +#endif /** * @brief Pack a gps_rtk message @@ -69,50 +93,46 @@ typedef struct __mavlink_gps_rtk_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) + uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_RTK_LEN]; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); + char buf[MAVLINK_MSG_ID_GPS_RTK_LEN]; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN); #else - mavlink_gps_rtk_t packet; - packet.time_last_baseline_ms = time_last_baseline_ms; - packet.tow = tow; - packet.baseline_a_mm = baseline_a_mm; - packet.baseline_b_mm = baseline_b_mm; - packet.baseline_c_mm = baseline_c_mm; - packet.accuracy = accuracy; - packet.iar_num_hypotheses = iar_num_hypotheses; - packet.wn = wn; - packet.rtk_receiver_id = rtk_receiver_id; - packet.rtk_health = rtk_health; - packet.rtk_rate = rtk_rate; - packet.nsats = nsats; - packet.baseline_coords_type = baseline_coords_type; + mavlink_gps_rtk_t packet; + packet.time_last_baseline_ms = time_last_baseline_ms; + packet.tow = tow; + packet.baseline_a_mm = baseline_a_mm; + packet.baseline_b_mm = baseline_b_mm; + packet.baseline_c_mm = baseline_c_mm; + packet.accuracy = accuracy; + packet.iar_num_hypotheses = iar_num_hypotheses; + packet.wn = wn; + packet.rtk_receiver_id = rtk_receiver_id; + packet.rtk_health = rtk_health; + packet.rtk_rate = rtk_rate; + packet.nsats = nsats; + packet.baseline_coords_type = baseline_coords_type; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_RTK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_RTK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); } /** @@ -137,51 +157,47 @@ static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t compo * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses) + mavlink_message_t* msg, + uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_RTK_LEN]; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); + char buf[MAVLINK_MSG_ID_GPS_RTK_LEN]; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN); #else - mavlink_gps_rtk_t packet; - packet.time_last_baseline_ms = time_last_baseline_ms; - packet.tow = tow; - packet.baseline_a_mm = baseline_a_mm; - packet.baseline_b_mm = baseline_b_mm; - packet.baseline_c_mm = baseline_c_mm; - packet.accuracy = accuracy; - packet.iar_num_hypotheses = iar_num_hypotheses; - packet.wn = wn; - packet.rtk_receiver_id = rtk_receiver_id; - packet.rtk_health = rtk_health; - packet.rtk_rate = rtk_rate; - packet.nsats = nsats; - packet.baseline_coords_type = baseline_coords_type; + mavlink_gps_rtk_t packet; + packet.time_last_baseline_ms = time_last_baseline_ms; + packet.tow = tow; + packet.baseline_a_mm = baseline_a_mm; + packet.baseline_b_mm = baseline_b_mm; + packet.baseline_c_mm = baseline_c_mm; + packet.accuracy = accuracy; + packet.iar_num_hypotheses = iar_num_hypotheses; + packet.wn = wn; + packet.rtk_receiver_id = rtk_receiver_id; + packet.rtk_health = rtk_health; + packet.rtk_rate = rtk_rate; + packet.nsats = nsats; + packet.baseline_coords_type = baseline_coords_type; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_RTK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_RTK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); } /** @@ -194,7 +210,7 @@ static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_gps_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk) { - return mavlink_msg_gps_rtk_pack(system_id, component_id, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses); + return mavlink_msg_gps_rtk_pack(system_id, component_id, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses); } /** @@ -208,7 +224,7 @@ static inline uint16_t mavlink_msg_gps_rtk_encode(uint8_t system_id, uint8_t com */ static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk) { - return mavlink_msg_gps_rtk_pack_chan(system_id, component_id, chan, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses); + return mavlink_msg_gps_rtk_pack_chan(system_id, component_id, chan, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses); } /** @@ -234,47 +250,53 @@ static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id, uint8_ static inline void mavlink_msg_gps_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_RTK_LEN]; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); + char buf[MAVLINK_MSG_ID_GPS_RTK_LEN]; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN); + mavlink_gps_rtk_t packet; + packet.time_last_baseline_ms = time_last_baseline_ms; + packet.tow = tow; + packet.baseline_a_mm = baseline_a_mm; + packet.baseline_b_mm = baseline_b_mm; + packet.baseline_c_mm = baseline_c_mm; + packet.accuracy = accuracy; + packet.iar_num_hypotheses = iar_num_hypotheses; + packet.wn = wn; + packet.rtk_receiver_id = rtk_receiver_id; + packet.rtk_health = rtk_health; + packet.rtk_rate = rtk_rate; + packet.nsats = nsats; + packet.baseline_coords_type = baseline_coords_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); #endif +} + +/** + * @brief Send a gps_rtk message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_gps_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps_rtk_t* gps_rtk) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_gps_rtk_send(chan, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses); #else - mavlink_gps_rtk_t packet; - packet.time_last_baseline_ms = time_last_baseline_ms; - packet.tow = tow; - packet.baseline_a_mm = baseline_a_mm; - packet.baseline_b_mm = baseline_b_mm; - packet.baseline_c_mm = baseline_c_mm; - packet.accuracy = accuracy; - packet.iar_num_hypotheses = iar_num_hypotheses; - packet.wn = wn; - packet.rtk_receiver_id = rtk_receiver_id; - packet.rtk_health = rtk_health; - packet.rtk_rate = rtk_rate; - packet.nsats = nsats; - packet.baseline_coords_type = baseline_coords_type; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)gps_rtk, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); #endif } @@ -289,47 +311,39 @@ static inline void mavlink_msg_gps_rtk_send(mavlink_channel_t chan, uint32_t tim static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_last_baseline_ms); - _mav_put_uint32_t(buf, 4, tow); - _mav_put_int32_t(buf, 8, baseline_a_mm); - _mav_put_int32_t(buf, 12, baseline_b_mm); - _mav_put_int32_t(buf, 16, baseline_c_mm); - _mav_put_uint32_t(buf, 20, accuracy); - _mav_put_int32_t(buf, 24, iar_num_hypotheses); - _mav_put_uint16_t(buf, 28, wn); - _mav_put_uint8_t(buf, 30, rtk_receiver_id); - _mav_put_uint8_t(buf, 31, rtk_health); - _mav_put_uint8_t(buf, 32, rtk_rate); - _mav_put_uint8_t(buf, 33, nsats); - _mav_put_uint8_t(buf, 34, baseline_coords_type); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_last_baseline_ms); + _mav_put_uint32_t(buf, 4, tow); + _mav_put_int32_t(buf, 8, baseline_a_mm); + _mav_put_int32_t(buf, 12, baseline_b_mm); + _mav_put_int32_t(buf, 16, baseline_c_mm); + _mav_put_uint32_t(buf, 20, accuracy); + _mav_put_int32_t(buf, 24, iar_num_hypotheses); + _mav_put_uint16_t(buf, 28, wn); + _mav_put_uint8_t(buf, 30, rtk_receiver_id); + _mav_put_uint8_t(buf, 31, rtk_health); + _mav_put_uint8_t(buf, 32, rtk_rate); + _mav_put_uint8_t(buf, 33, nsats); + _mav_put_uint8_t(buf, 34, baseline_coords_type); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN); -#endif -#else - mavlink_gps_rtk_t *packet = (mavlink_gps_rtk_t *)msgbuf; - packet->time_last_baseline_ms = time_last_baseline_ms; - packet->tow = tow; - packet->baseline_a_mm = baseline_a_mm; - packet->baseline_b_mm = baseline_b_mm; - packet->baseline_c_mm = baseline_c_mm; - packet->accuracy = accuracy; - packet->iar_num_hypotheses = iar_num_hypotheses; - packet->wn = wn; - packet->rtk_receiver_id = rtk_receiver_id; - packet->rtk_health = rtk_health; - packet->rtk_rate = rtk_rate; - packet->nsats = nsats; - packet->baseline_coords_type = baseline_coords_type; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_LEN); -#endif + mavlink_gps_rtk_t *packet = (mavlink_gps_rtk_t *)msgbuf; + packet->time_last_baseline_ms = time_last_baseline_ms; + packet->tow = tow; + packet->baseline_a_mm = baseline_a_mm; + packet->baseline_b_mm = baseline_b_mm; + packet->baseline_c_mm = baseline_c_mm; + packet->accuracy = accuracy; + packet->iar_num_hypotheses = iar_num_hypotheses; + packet->wn = wn; + packet->rtk_receiver_id = rtk_receiver_id; + packet->rtk_health = rtk_health; + packet->rtk_rate = rtk_rate; + packet->nsats = nsats; + packet->baseline_coords_type = baseline_coords_type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC); #endif } #endif @@ -346,7 +360,7 @@ static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t *msgbuf, mavli */ static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -356,7 +370,7 @@ static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavli */ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 30); + return _MAV_RETURN_uint8_t(msg, 30); } /** @@ -366,7 +380,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_mess */ static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -376,7 +390,7 @@ static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg) */ static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 4); + return _MAV_RETURN_uint32_t(msg, 4); } /** @@ -386,7 +400,7 @@ static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg) */ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 31); + return _MAV_RETURN_uint8_t(msg, 31); } /** @@ -396,7 +410,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t */ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -406,7 +420,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* */ static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 33); + return _MAV_RETURN_uint8_t(msg, 33); } /** @@ -416,7 +430,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg */ static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -426,7 +440,7 @@ static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink */ static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -436,7 +450,7 @@ static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_messag */ static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -446,7 +460,7 @@ static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_messag */ static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -456,7 +470,7 @@ static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_messag */ static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 20); + return _MAV_RETURN_uint32_t(msg, 20); } /** @@ -466,7 +480,7 @@ static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* */ static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 24); + return _MAV_RETURN_int32_t(msg, 24); } /** @@ -477,21 +491,23 @@ static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_m */ static inline void mavlink_msg_gps_rtk_decode(const mavlink_message_t* msg, mavlink_gps_rtk_t* gps_rtk) { -#if MAVLINK_NEED_BYTE_SWAP - gps_rtk->time_last_baseline_ms = mavlink_msg_gps_rtk_get_time_last_baseline_ms(msg); - gps_rtk->tow = mavlink_msg_gps_rtk_get_tow(msg); - gps_rtk->baseline_a_mm = mavlink_msg_gps_rtk_get_baseline_a_mm(msg); - gps_rtk->baseline_b_mm = mavlink_msg_gps_rtk_get_baseline_b_mm(msg); - gps_rtk->baseline_c_mm = mavlink_msg_gps_rtk_get_baseline_c_mm(msg); - gps_rtk->accuracy = mavlink_msg_gps_rtk_get_accuracy(msg); - gps_rtk->iar_num_hypotheses = mavlink_msg_gps_rtk_get_iar_num_hypotheses(msg); - gps_rtk->wn = mavlink_msg_gps_rtk_get_wn(msg); - gps_rtk->rtk_receiver_id = mavlink_msg_gps_rtk_get_rtk_receiver_id(msg); - gps_rtk->rtk_health = mavlink_msg_gps_rtk_get_rtk_health(msg); - gps_rtk->rtk_rate = mavlink_msg_gps_rtk_get_rtk_rate(msg); - gps_rtk->nsats = mavlink_msg_gps_rtk_get_nsats(msg); - gps_rtk->baseline_coords_type = mavlink_msg_gps_rtk_get_baseline_coords_type(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + gps_rtk->time_last_baseline_ms = mavlink_msg_gps_rtk_get_time_last_baseline_ms(msg); + gps_rtk->tow = mavlink_msg_gps_rtk_get_tow(msg); + gps_rtk->baseline_a_mm = mavlink_msg_gps_rtk_get_baseline_a_mm(msg); + gps_rtk->baseline_b_mm = mavlink_msg_gps_rtk_get_baseline_b_mm(msg); + gps_rtk->baseline_c_mm = mavlink_msg_gps_rtk_get_baseline_c_mm(msg); + gps_rtk->accuracy = mavlink_msg_gps_rtk_get_accuracy(msg); + gps_rtk->iar_num_hypotheses = mavlink_msg_gps_rtk_get_iar_num_hypotheses(msg); + gps_rtk->wn = mavlink_msg_gps_rtk_get_wn(msg); + gps_rtk->rtk_receiver_id = mavlink_msg_gps_rtk_get_rtk_receiver_id(msg); + gps_rtk->rtk_health = mavlink_msg_gps_rtk_get_rtk_health(msg); + gps_rtk->rtk_rate = mavlink_msg_gps_rtk_get_rtk_rate(msg); + gps_rtk->nsats = mavlink_msg_gps_rtk_get_nsats(msg); + gps_rtk->baseline_coords_type = mavlink_msg_gps_rtk_get_baseline_coords_type(msg); #else - memcpy(gps_rtk, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_RTK_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS_RTK_LEN; + memset(gps_rtk, 0, MAVLINK_MSG_ID_GPS_RTK_LEN); + memcpy(gps_rtk, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_status.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_status.h index 0009a29..d38cf47 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_status.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_gps_status.h @@ -1,19 +1,22 @@ +#pragma once // MESSAGE GPS_STATUS PACKING #define MAVLINK_MSG_ID_GPS_STATUS 25 -typedef struct __mavlink_gps_status_t -{ +MAVPACKED( +typedef struct __mavlink_gps_status_t { uint8_t satellites_visible; /*< Number of satellites visible*/ uint8_t satellite_prn[20]; /*< Global satellite ID*/ uint8_t satellite_used[20]; /*< 0: Satellite not used, 1: used for localization*/ uint8_t satellite_elevation[20]; /*< Elevation (0: right on top of receiver, 90: on the horizon) of satellite*/ uint8_t satellite_azimuth[20]; /*< Direction of satellite, 0: 0 deg, 255: 360 deg.*/ uint8_t satellite_snr[20]; /*< Signal to noise ratio of satellite*/ -} mavlink_gps_status_t; +}) mavlink_gps_status_t; #define MAVLINK_MSG_ID_GPS_STATUS_LEN 101 +#define MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN 101 #define MAVLINK_MSG_ID_25_LEN 101 +#define MAVLINK_MSG_ID_25_MIN_LEN 101 #define MAVLINK_MSG_ID_GPS_STATUS_CRC 23 #define MAVLINK_MSG_ID_25_CRC 23 @@ -24,10 +27,12 @@ typedef struct __mavlink_gps_status_t #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_AZIMUTH_LEN 20 #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_SNR_LEN 20 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_GPS_STATUS { \ - "GPS_STATUS", \ - 6, \ - { { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \ + 25, \ + "GPS_STATUS", \ + 6, \ + { { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \ { "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \ { "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \ { "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \ @@ -35,7 +40,19 @@ typedef struct __mavlink_gps_status_t { "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_GPS_STATUS { \ + "GPS_STATUS", \ + 6, \ + { { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \ + { "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \ + { "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \ + { "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \ + { "satellite_azimuth", NULL, MAVLINK_TYPE_UINT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \ + { "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \ + } \ +} +#endif /** * @brief Pack a gps_status message @@ -52,34 +69,30 @@ typedef struct __mavlink_gps_status_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr) + uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; - _mav_put_uint8_t(buf, 0, satellites_visible); - _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); - _mav_put_uint8_t_array(buf, 21, satellite_used, 20); - _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); - _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); - _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); + char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; + _mav_put_uint8_t(buf, 0, satellites_visible); + _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); + _mav_put_uint8_t_array(buf, 21, satellite_used, 20); + _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); + _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); + _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN); #else - mavlink_gps_status_t packet; - packet.satellites_visible = satellites_visible; - mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); + mavlink_gps_status_t packet; + packet.satellites_visible = satellites_visible; + mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); } /** @@ -97,35 +110,31 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t satellites_visible,const uint8_t *satellite_prn,const uint8_t *satellite_used,const uint8_t *satellite_elevation,const uint8_t *satellite_azimuth,const uint8_t *satellite_snr) + mavlink_message_t* msg, + uint8_t satellites_visible,const uint8_t *satellite_prn,const uint8_t *satellite_used,const uint8_t *satellite_elevation,const uint8_t *satellite_azimuth,const uint8_t *satellite_snr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; - _mav_put_uint8_t(buf, 0, satellites_visible); - _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); - _mav_put_uint8_t_array(buf, 21, satellite_used, 20); - _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); - _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); - _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); + char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; + _mav_put_uint8_t(buf, 0, satellites_visible); + _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); + _mav_put_uint8_t_array(buf, 21, satellite_used, 20); + _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); + _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); + _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN); #else - mavlink_gps_status_t packet; - packet.satellites_visible = satellites_visible; - mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); + mavlink_gps_status_t packet; + packet.satellites_visible = satellites_visible; + mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_GPS_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); } /** @@ -138,7 +147,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_gps_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status) { - return mavlink_msg_gps_status_pack(system_id, component_id, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr); + return mavlink_msg_gps_status_pack(system_id, component_id, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr); } /** @@ -152,7 +161,7 @@ static inline uint16_t mavlink_msg_gps_status_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_gps_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status) { - return mavlink_msg_gps_status_pack_chan(system_id, component_id, chan, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr); + return mavlink_msg_gps_status_pack_chan(system_id, component_id, chan, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr); } /** @@ -171,31 +180,37 @@ static inline uint16_t mavlink_msg_gps_status_encode_chan(uint8_t system_id, uin static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; - _mav_put_uint8_t(buf, 0, satellites_visible); - _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); - _mav_put_uint8_t_array(buf, 21, satellite_used, 20); - _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); - _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); - _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); + char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN]; + _mav_put_uint8_t(buf, 0, satellites_visible); + _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); + _mav_put_uint8_t_array(buf, 21, satellite_used, 20); + _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); + _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); + _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_LEN); + mavlink_gps_status_t packet; + packet.satellites_visible = satellites_visible; + mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); + mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); #endif +} + +/** + * @brief Send a gps_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_gps_status_send_struct(mavlink_channel_t chan, const mavlink_gps_status_t* gps_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_gps_status_send(chan, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr); #else - mavlink_gps_status_t packet; - packet.satellites_visible = satellites_visible; - mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); - mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)gps_status, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); #endif } @@ -210,31 +225,23 @@ static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t s static inline void mavlink_msg_gps_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, satellites_visible); - _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); - _mav_put_uint8_t_array(buf, 21, satellite_used, 20); - _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); - _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); - _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, satellites_visible); + _mav_put_uint8_t_array(buf, 1, satellite_prn, 20); + _mav_put_uint8_t_array(buf, 21, satellite_used, 20); + _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20); + _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20); + _mav_put_uint8_t_array(buf, 81, satellite_snr, 20); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_LEN); -#endif -#else - mavlink_gps_status_t *packet = (mavlink_gps_status_t *)msgbuf; - packet->satellites_visible = satellites_visible; - mav_array_memcpy(packet->satellite_prn, satellite_prn, sizeof(uint8_t)*20); - mav_array_memcpy(packet->satellite_used, satellite_used, sizeof(uint8_t)*20); - mav_array_memcpy(packet->satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); - mav_array_memcpy(packet->satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); - mav_array_memcpy(packet->satellite_snr, satellite_snr, sizeof(uint8_t)*20); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)packet, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)packet, MAVLINK_MSG_ID_GPS_STATUS_LEN); -#endif + mavlink_gps_status_t *packet = (mavlink_gps_status_t *)msgbuf; + packet->satellites_visible = satellites_visible; + mav_array_memcpy(packet->satellite_prn, satellite_prn, sizeof(uint8_t)*20); + mav_array_memcpy(packet->satellite_used, satellite_used, sizeof(uint8_t)*20); + mav_array_memcpy(packet->satellite_elevation, satellite_elevation, sizeof(uint8_t)*20); + mav_array_memcpy(packet->satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20); + mav_array_memcpy(packet->satellite_snr, satellite_snr, sizeof(uint8_t)*20); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC); #endif } #endif @@ -251,7 +258,7 @@ static inline void mavlink_msg_gps_status_send_buf(mavlink_message_t *msgbuf, ma */ static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -261,7 +268,7 @@ static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlin */ static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_message_t* msg, uint8_t *satellite_prn) { - return _MAV_RETURN_uint8_t_array(msg, satellite_prn, 20, 1); + return _MAV_RETURN_uint8_t_array(msg, satellite_prn, 20, 1); } /** @@ -271,7 +278,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_me */ static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_message_t* msg, uint8_t *satellite_used) { - return _MAV_RETURN_uint8_t_array(msg, satellite_used, 20, 21); + return _MAV_RETURN_uint8_t_array(msg, satellite_used, 20, 21); } /** @@ -281,7 +288,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_m */ static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavlink_message_t* msg, uint8_t *satellite_elevation) { - return _MAV_RETURN_uint8_t_array(msg, satellite_elevation, 20, 41); + return _MAV_RETURN_uint8_t_array(msg, satellite_elevation, 20, 41); } /** @@ -291,7 +298,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavl */ static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlink_message_t* msg, uint8_t *satellite_azimuth) { - return _MAV_RETURN_uint8_t_array(msg, satellite_azimuth, 20, 61); + return _MAV_RETURN_uint8_t_array(msg, satellite_azimuth, 20, 61); } /** @@ -301,7 +308,7 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlin */ static inline uint16_t mavlink_msg_gps_status_get_satellite_snr(const mavlink_message_t* msg, uint8_t *satellite_snr) { - return _MAV_RETURN_uint8_t_array(msg, satellite_snr, 20, 81); + return _MAV_RETURN_uint8_t_array(msg, satellite_snr, 20, 81); } /** @@ -312,14 +319,16 @@ static inline uint16_t mavlink_msg_gps_status_get_satellite_snr(const mavlink_me */ static inline void mavlink_msg_gps_status_decode(const mavlink_message_t* msg, mavlink_gps_status_t* gps_status) { -#if MAVLINK_NEED_BYTE_SWAP - gps_status->satellites_visible = mavlink_msg_gps_status_get_satellites_visible(msg); - mavlink_msg_gps_status_get_satellite_prn(msg, gps_status->satellite_prn); - mavlink_msg_gps_status_get_satellite_used(msg, gps_status->satellite_used); - mavlink_msg_gps_status_get_satellite_elevation(msg, gps_status->satellite_elevation); - mavlink_msg_gps_status_get_satellite_azimuth(msg, gps_status->satellite_azimuth); - mavlink_msg_gps_status_get_satellite_snr(msg, gps_status->satellite_snr); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + gps_status->satellites_visible = mavlink_msg_gps_status_get_satellites_visible(msg); + mavlink_msg_gps_status_get_satellite_prn(msg, gps_status->satellite_prn); + mavlink_msg_gps_status_get_satellite_used(msg, gps_status->satellite_used); + mavlink_msg_gps_status_get_satellite_elevation(msg, gps_status->satellite_elevation); + mavlink_msg_gps_status_get_satellite_azimuth(msg, gps_status->satellite_azimuth); + mavlink_msg_gps_status_get_satellite_snr(msg, gps_status->satellite_snr); #else - memcpy(gps_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_STATUS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_GPS_STATUS_LEN; + memset(gps_status, 0, MAVLINK_MSG_ID_GPS_STATUS_LEN); + memcpy(gps_status, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_heartbeat.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_heartbeat.h index 338f70d..99d5c06 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_heartbeat.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_heartbeat.h @@ -1,29 +1,34 @@ +#pragma once // MESSAGE HEARTBEAT PACKING #define MAVLINK_MSG_ID_HEARTBEAT 0 -typedef struct __mavlink_heartbeat_t -{ +MAVPACKED( +typedef struct __mavlink_heartbeat_t { uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags.*/ uint8_t type; /*< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)*/ uint8_t autopilot; /*< Autopilot type / class. defined in MAV_AUTOPILOT ENUM*/ uint8_t base_mode; /*< System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h*/ uint8_t system_status; /*< System status flag, see MAV_STATE ENUM*/ uint8_t mavlink_version; /*< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version*/ -} mavlink_heartbeat_t; +}) mavlink_heartbeat_t; #define MAVLINK_MSG_ID_HEARTBEAT_LEN 9 +#define MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN 9 #define MAVLINK_MSG_ID_0_LEN 9 +#define MAVLINK_MSG_ID_0_MIN_LEN 9 #define MAVLINK_MSG_ID_HEARTBEAT_CRC 50 #define MAVLINK_MSG_ID_0_CRC 50 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HEARTBEAT { \ - "HEARTBEAT", \ - 6, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \ + 0, \ + "HEARTBEAT", \ + 6, \ + { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \ { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \ @@ -31,7 +36,19 @@ typedef struct __mavlink_heartbeat_t { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \ + "HEARTBEAT", \ + 6, \ + { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \ + { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \ + { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \ + { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \ + { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \ + } \ +} +#endif /** * @brief Pack a heartbeat message @@ -47,36 +64,32 @@ typedef struct __mavlink_heartbeat_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status) + uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, type); - _mav_put_uint8_t(buf, 5, autopilot); - _mav_put_uint8_t(buf, 6, base_mode); - _mav_put_uint8_t(buf, 7, system_status); - _mav_put_uint8_t(buf, 8, 3); + char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, type); + _mav_put_uint8_t(buf, 5, autopilot); + _mav_put_uint8_t(buf, 6, base_mode); + _mav_put_uint8_t(buf, 7, system_status); + _mav_put_uint8_t(buf, 8, 3); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN); #else - mavlink_heartbeat_t packet; - packet.custom_mode = custom_mode; - packet.type = type; - packet.autopilot = autopilot; - packet.base_mode = base_mode; - packet.system_status = system_status; - packet.mavlink_version = 3; + mavlink_heartbeat_t packet; + packet.custom_mode = custom_mode; + packet.type = type; + packet.autopilot = autopilot; + packet.base_mode = base_mode; + packet.system_status = system_status; + packet.mavlink_version = 3; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); } /** @@ -93,37 +106,33 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t type,uint8_t autopilot,uint8_t base_mode,uint32_t custom_mode,uint8_t system_status) + mavlink_message_t* msg, + uint8_t type,uint8_t autopilot,uint8_t base_mode,uint32_t custom_mode,uint8_t system_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, type); - _mav_put_uint8_t(buf, 5, autopilot); - _mav_put_uint8_t(buf, 6, base_mode); - _mav_put_uint8_t(buf, 7, system_status); - _mav_put_uint8_t(buf, 8, 3); + char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, type); + _mav_put_uint8_t(buf, 5, autopilot); + _mav_put_uint8_t(buf, 6, base_mode); + _mav_put_uint8_t(buf, 7, system_status); + _mav_put_uint8_t(buf, 8, 3); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN); #else - mavlink_heartbeat_t packet; - packet.custom_mode = custom_mode; - packet.type = type; - packet.autopilot = autopilot; - packet.base_mode = base_mode; - packet.system_status = system_status; - packet.mavlink_version = 3; + mavlink_heartbeat_t packet; + packet.custom_mode = custom_mode; + packet.type = type; + packet.autopilot = autopilot; + packet.base_mode = base_mode; + packet.system_status = system_status; + packet.mavlink_version = 3; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); } /** @@ -136,7 +145,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat) { - return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status); + return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status); } /** @@ -150,7 +159,7 @@ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t c */ static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat) { - return mavlink_msg_heartbeat_pack_chan(system_id, component_id, chan, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status); + return mavlink_msg_heartbeat_pack_chan(system_id, component_id, chan, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status); } /** @@ -168,33 +177,39 @@ static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, type); - _mav_put_uint8_t(buf, 5, autopilot); - _mav_put_uint8_t(buf, 6, base_mode); - _mav_put_uint8_t(buf, 7, system_status); - _mav_put_uint8_t(buf, 8, 3); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); + char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN]; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, type); + _mav_put_uint8_t(buf, 5, autopilot); + _mav_put_uint8_t(buf, 6, base_mode); + _mav_put_uint8_t(buf, 7, system_status); + _mav_put_uint8_t(buf, 8, 3); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_LEN); + mavlink_heartbeat_t packet; + packet.custom_mode = custom_mode; + packet.type = type; + packet.autopilot = autopilot; + packet.base_mode = base_mode; + packet.system_status = system_status; + packet.mavlink_version = 3; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); #endif +} + +/** + * @brief Send a heartbeat message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_heartbeat_send_struct(mavlink_channel_t chan, const mavlink_heartbeat_t* heartbeat) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_heartbeat_send(chan, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status); #else - mavlink_heartbeat_t packet; - packet.custom_mode = custom_mode; - packet.type = type; - packet.autopilot = autopilot; - packet.base_mode = base_mode; - packet.system_status = system_status; - packet.mavlink_version = 3; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)heartbeat, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); #endif } @@ -209,33 +224,25 @@ static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t ty static inline void mavlink_msg_heartbeat_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, type); - _mav_put_uint8_t(buf, 5, autopilot); - _mav_put_uint8_t(buf, 6, base_mode); - _mav_put_uint8_t(buf, 7, system_status); - _mav_put_uint8_t(buf, 8, 3); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, type); + _mav_put_uint8_t(buf, 5, autopilot); + _mav_put_uint8_t(buf, 6, base_mode); + _mav_put_uint8_t(buf, 7, system_status); + _mav_put_uint8_t(buf, 8, 3); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_LEN); -#endif -#else - mavlink_heartbeat_t *packet = (mavlink_heartbeat_t *)msgbuf; - packet->custom_mode = custom_mode; - packet->type = type; - packet->autopilot = autopilot; - packet->base_mode = base_mode; - packet->system_status = system_status; - packet->mavlink_version = 3; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_HEARTBEAT_LEN); -#endif + mavlink_heartbeat_t *packet = (mavlink_heartbeat_t *)msgbuf; + packet->custom_mode = custom_mode; + packet->type = type; + packet->autopilot = autopilot; + packet->base_mode = base_mode; + packet->system_status = system_status; + packet->mavlink_version = 3; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC); #endif } #endif @@ -252,7 +259,7 @@ static inline void mavlink_msg_heartbeat_send_buf(mavlink_message_t *msgbuf, mav */ static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -262,7 +269,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* ms */ static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -272,7 +279,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_ */ static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 6); + return _MAV_RETURN_uint8_t(msg, 6); } /** @@ -282,7 +289,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_ */ static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -292,7 +299,7 @@ static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_messa */ static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 7); + return _MAV_RETURN_uint8_t(msg, 7); } /** @@ -302,7 +309,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_mess */ static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 8); + return _MAV_RETURN_uint8_t(msg, 8); } /** @@ -313,14 +320,16 @@ static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_me */ static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, mavlink_heartbeat_t* heartbeat) { -#if MAVLINK_NEED_BYTE_SWAP - heartbeat->custom_mode = mavlink_msg_heartbeat_get_custom_mode(msg); - heartbeat->type = mavlink_msg_heartbeat_get_type(msg); - heartbeat->autopilot = mavlink_msg_heartbeat_get_autopilot(msg); - heartbeat->base_mode = mavlink_msg_heartbeat_get_base_mode(msg); - heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg); - heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + heartbeat->custom_mode = mavlink_msg_heartbeat_get_custom_mode(msg); + heartbeat->type = mavlink_msg_heartbeat_get_type(msg); + heartbeat->autopilot = mavlink_msg_heartbeat_get_autopilot(msg); + heartbeat->base_mode = mavlink_msg_heartbeat_get_base_mode(msg); + heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg); + heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg); #else - memcpy(heartbeat, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HEARTBEAT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HEARTBEAT_LEN? msg->len : MAVLINK_MSG_ID_HEARTBEAT_LEN; + memset(heartbeat, 0, MAVLINK_MSG_ID_HEARTBEAT_LEN); + memcpy(heartbeat, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_highres_imu.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_highres_imu.h index 427bf2a..8f9f2e4 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_highres_imu.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_highres_imu.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIGHRES_IMU PACKING #define MAVLINK_MSG_ID_HIGHRES_IMU 105 -typedef struct __mavlink_highres_imu_t -{ +MAVPACKED( +typedef struct __mavlink_highres_imu_t { uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ float xacc; /*< X acceleration (m/s^2)*/ float yacc; /*< Y acceleration (m/s^2)*/ @@ -19,20 +20,24 @@ typedef struct __mavlink_highres_imu_t float pressure_alt; /*< Altitude calculated from pressure*/ float temperature; /*< Temperature in degrees celsius*/ uint16_t fields_updated; /*< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature*/ -} mavlink_highres_imu_t; +}) mavlink_highres_imu_t; #define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62 +#define MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN 62 #define MAVLINK_MSG_ID_105_LEN 62 +#define MAVLINK_MSG_ID_105_MIN_LEN 62 #define MAVLINK_MSG_ID_HIGHRES_IMU_CRC 93 #define MAVLINK_MSG_ID_105_CRC 93 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \ - "HIGHRES_IMU", \ - 15, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \ + 105, \ + "HIGHRES_IMU", \ + 15, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \ { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \ { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \ { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \ @@ -49,7 +54,28 @@ typedef struct __mavlink_highres_imu_t { "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \ + "HIGHRES_IMU", \ + 15, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \ + { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \ + { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \ + { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \ + { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \ + { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \ + { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \ + { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \ + { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \ + { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \ + { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \ + { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \ + { "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \ + } \ +} +#endif /** * @brief Pack a highres_imu message @@ -75,54 +101,50 @@ typedef struct __mavlink_highres_imu_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated) + uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint16_t(buf, 60, fields_updated); + char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint16_t(buf, 60, fields_updated); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #else - mavlink_highres_imu_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - packet.abs_pressure = abs_pressure; - packet.diff_pressure = diff_pressure; - packet.pressure_alt = pressure_alt; - packet.temperature = temperature; - packet.fields_updated = fields_updated; + mavlink_highres_imu_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + packet.abs_pressure = abs_pressure; + packet.diff_pressure = diff_pressure; + packet.pressure_alt = pressure_alt; + packet.temperature = temperature; + packet.fields_updated = fields_updated; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); } /** @@ -149,55 +171,51 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated) + mavlink_message_t* msg, + uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint16_t(buf, 60, fields_updated); + char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint16_t(buf, 60, fields_updated); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #else - mavlink_highres_imu_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - packet.abs_pressure = abs_pressure; - packet.diff_pressure = diff_pressure; - packet.pressure_alt = pressure_alt; - packet.temperature = temperature; - packet.fields_updated = fields_updated; + mavlink_highres_imu_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + packet.abs_pressure = abs_pressure; + packet.diff_pressure = diff_pressure; + packet.pressure_alt = pressure_alt; + packet.temperature = temperature; + packet.fields_updated = fields_updated; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); } /** @@ -210,7 +228,7 @@ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu) { - return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated); + return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated); } /** @@ -224,7 +242,7 @@ static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_highres_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu) { - return mavlink_msg_highres_imu_pack_chan(system_id, component_id, chan, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated); + return mavlink_msg_highres_imu_pack_chan(system_id, component_id, chan, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated); } /** @@ -252,51 +270,57 @@ static inline uint16_t mavlink_msg_highres_imu_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint16_t(buf, 60, fields_updated); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); + char buf[MAVLINK_MSG_ID_HIGHRES_IMU_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint16_t(buf, 60, fields_updated); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); + mavlink_highres_imu_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + packet.abs_pressure = abs_pressure; + packet.diff_pressure = diff_pressure; + packet.pressure_alt = pressure_alt; + packet.temperature = temperature; + packet.fields_updated = fields_updated; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); #endif +} + +/** + * @brief Send a highres_imu message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_highres_imu_send_struct(mavlink_channel_t chan, const mavlink_highres_imu_t* highres_imu) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_highres_imu_send(chan, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated); #else - mavlink_highres_imu_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - packet.abs_pressure = abs_pressure; - packet.diff_pressure = diff_pressure; - packet.pressure_alt = pressure_alt; - packet.temperature = temperature; - packet.fields_updated = fields_updated; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)highres_imu, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); #endif } @@ -311,51 +335,43 @@ static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t static inline void mavlink_msg_highres_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint16_t(buf, 60, fields_updated); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint16_t(buf, 60, fields_updated); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); -#endif -#else - mavlink_highres_imu_t *packet = (mavlink_highres_imu_t *)msgbuf; - packet->time_usec = time_usec; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - packet->xgyro = xgyro; - packet->ygyro = ygyro; - packet->zgyro = zgyro; - packet->xmag = xmag; - packet->ymag = ymag; - packet->zmag = zmag; - packet->abs_pressure = abs_pressure; - packet->diff_pressure = diff_pressure; - packet->pressure_alt = pressure_alt; - packet->temperature = temperature; - packet->fields_updated = fields_updated; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)packet, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); -#endif + mavlink_highres_imu_t *packet = (mavlink_highres_imu_t *)msgbuf; + packet->time_usec = time_usec; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + packet->xgyro = xgyro; + packet->ygyro = ygyro; + packet->zgyro = zgyro; + packet->xmag = xmag; + packet->ymag = ymag; + packet->zmag = zmag; + packet->abs_pressure = abs_pressure; + packet->diff_pressure = diff_pressure; + packet->pressure_alt = pressure_alt; + packet->temperature = temperature; + packet->fields_updated = fields_updated; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)packet, MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_LEN, MAVLINK_MSG_ID_HIGHRES_IMU_CRC); #endif } #endif @@ -372,7 +388,7 @@ static inline void mavlink_msg_highres_imu_send_buf(mavlink_message_t *msgbuf, m */ static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -382,7 +398,7 @@ static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_messa */ static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -392,7 +408,7 @@ static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* ms */ static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -402,7 +418,7 @@ static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* ms */ static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -412,7 +428,7 @@ static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* ms */ static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -422,7 +438,7 @@ static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* m */ static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -432,7 +448,7 @@ static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* m */ static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -442,7 +458,7 @@ static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* m */ static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -452,7 +468,7 @@ static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* ms */ static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -462,7 +478,7 @@ static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* ms */ static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -472,7 +488,7 @@ static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* ms */ static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -482,7 +498,7 @@ static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_messa */ static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 48); + return _MAV_RETURN_float(msg, 48); } /** @@ -492,7 +508,7 @@ static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_mess */ static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 52); + return _MAV_RETURN_float(msg, 52); } /** @@ -502,7 +518,7 @@ static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_messa */ static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 56); + return _MAV_RETURN_float(msg, 56); } /** @@ -512,7 +528,7 @@ static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_messag */ static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 60); + return _MAV_RETURN_uint16_t(msg, 60); } /** @@ -523,23 +539,25 @@ static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_ */ static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu) { -#if MAVLINK_NEED_BYTE_SWAP - highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg); - highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg); - highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg); - highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg); - highres_imu->xgyro = mavlink_msg_highres_imu_get_xgyro(msg); - highres_imu->ygyro = mavlink_msg_highres_imu_get_ygyro(msg); - highres_imu->zgyro = mavlink_msg_highres_imu_get_zgyro(msg); - highres_imu->xmag = mavlink_msg_highres_imu_get_xmag(msg); - highres_imu->ymag = mavlink_msg_highres_imu_get_ymag(msg); - highres_imu->zmag = mavlink_msg_highres_imu_get_zmag(msg); - highres_imu->abs_pressure = mavlink_msg_highres_imu_get_abs_pressure(msg); - highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg); - highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg); - highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg); - highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg); + highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg); + highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg); + highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg); + highres_imu->xgyro = mavlink_msg_highres_imu_get_xgyro(msg); + highres_imu->ygyro = mavlink_msg_highres_imu_get_ygyro(msg); + highres_imu->zgyro = mavlink_msg_highres_imu_get_zgyro(msg); + highres_imu->xmag = mavlink_msg_highres_imu_get_xmag(msg); + highres_imu->ymag = mavlink_msg_highres_imu_get_ymag(msg); + highres_imu->zmag = mavlink_msg_highres_imu_get_zmag(msg); + highres_imu->abs_pressure = mavlink_msg_highres_imu_get_abs_pressure(msg); + highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg); + highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg); + highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg); + highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg); #else - memcpy(highres_imu, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIGHRES_IMU_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIGHRES_IMU_LEN? msg->len : MAVLINK_MSG_ID_HIGHRES_IMU_LEN; + memset(highres_imu, 0, MAVLINK_MSG_ID_HIGHRES_IMU_LEN); + memcpy(highres_imu, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_controls.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_controls.h index 0d399dd..288ffe8 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_controls.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_controls.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIL_CONTROLS PACKING #define MAVLINK_MSG_ID_HIL_CONTROLS 91 -typedef struct __mavlink_hil_controls_t -{ +MAVPACKED( +typedef struct __mavlink_hil_controls_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ float roll_ailerons; /*< Control output -1 .. 1*/ float pitch_elevator; /*< Control output -1 .. 1*/ @@ -15,20 +16,24 @@ typedef struct __mavlink_hil_controls_t float aux4; /*< Aux 4, -1 .. 1*/ uint8_t mode; /*< System mode (MAV_MODE)*/ uint8_t nav_mode; /*< Navigation mode (MAV_NAV_MODE)*/ -} mavlink_hil_controls_t; +}) mavlink_hil_controls_t; #define MAVLINK_MSG_ID_HIL_CONTROLS_LEN 42 +#define MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN 42 #define MAVLINK_MSG_ID_91_LEN 42 +#define MAVLINK_MSG_ID_91_MIN_LEN 42 #define MAVLINK_MSG_ID_HIL_CONTROLS_CRC 63 #define MAVLINK_MSG_ID_91_CRC 63 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \ - "HIL_CONTROLS", \ - 11, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_usec) }, \ + 91, \ + "HIL_CONTROLS", \ + 11, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_usec) }, \ { "roll_ailerons", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_controls_t, roll_ailerons) }, \ { "pitch_elevator", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_controls_t, pitch_elevator) }, \ { "yaw_rudder", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_controls_t, yaw_rudder) }, \ @@ -41,7 +46,24 @@ typedef struct __mavlink_hil_controls_t { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_hil_controls_t, nav_mode) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIL_CONTROLS { \ + "HIL_CONTROLS", \ + 11, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_controls_t, time_usec) }, \ + { "roll_ailerons", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_controls_t, roll_ailerons) }, \ + { "pitch_elevator", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_controls_t, pitch_elevator) }, \ + { "yaw_rudder", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_controls_t, yaw_rudder) }, \ + { "throttle", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_controls_t, throttle) }, \ + { "aux1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_controls_t, aux1) }, \ + { "aux2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_controls_t, aux2) }, \ + { "aux3", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_controls_t, aux3) }, \ + { "aux4", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_controls_t, aux4) }, \ + { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_hil_controls_t, mode) }, \ + { "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_hil_controls_t, nav_mode) }, \ + } \ +} +#endif /** * @brief Pack a hil_controls message @@ -63,46 +85,42 @@ typedef struct __mavlink_hil_controls_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode) + uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll_ailerons); - _mav_put_float(buf, 12, pitch_elevator); - _mav_put_float(buf, 16, yaw_rudder); - _mav_put_float(buf, 20, throttle); - _mav_put_float(buf, 24, aux1); - _mav_put_float(buf, 28, aux2); - _mav_put_float(buf, 32, aux3); - _mav_put_float(buf, 36, aux4); - _mav_put_uint8_t(buf, 40, mode); - _mav_put_uint8_t(buf, 41, nav_mode); + char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll_ailerons); + _mav_put_float(buf, 12, pitch_elevator); + _mav_put_float(buf, 16, yaw_rudder); + _mav_put_float(buf, 20, throttle); + _mav_put_float(buf, 24, aux1); + _mav_put_float(buf, 28, aux2); + _mav_put_float(buf, 32, aux3); + _mav_put_float(buf, 36, aux4); + _mav_put_uint8_t(buf, 40, mode); + _mav_put_uint8_t(buf, 41, nav_mode); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #else - mavlink_hil_controls_t packet; - packet.time_usec = time_usec; - packet.roll_ailerons = roll_ailerons; - packet.pitch_elevator = pitch_elevator; - packet.yaw_rudder = yaw_rudder; - packet.throttle = throttle; - packet.aux1 = aux1; - packet.aux2 = aux2; - packet.aux3 = aux3; - packet.aux4 = aux4; - packet.mode = mode; - packet.nav_mode = nav_mode; + mavlink_hil_controls_t packet; + packet.time_usec = time_usec; + packet.roll_ailerons = roll_ailerons; + packet.pitch_elevator = pitch_elevator; + packet.yaw_rudder = yaw_rudder; + packet.throttle = throttle; + packet.aux1 = aux1; + packet.aux2 = aux2; + packet.aux3 = aux3; + packet.aux4 = aux4; + packet.mode = mode; + packet.nav_mode = nav_mode; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); } /** @@ -125,47 +143,43 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float roll_ailerons,float pitch_elevator,float yaw_rudder,float throttle,float aux1,float aux2,float aux3,float aux4,uint8_t mode,uint8_t nav_mode) + mavlink_message_t* msg, + uint64_t time_usec,float roll_ailerons,float pitch_elevator,float yaw_rudder,float throttle,float aux1,float aux2,float aux3,float aux4,uint8_t mode,uint8_t nav_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll_ailerons); - _mav_put_float(buf, 12, pitch_elevator); - _mav_put_float(buf, 16, yaw_rudder); - _mav_put_float(buf, 20, throttle); - _mav_put_float(buf, 24, aux1); - _mav_put_float(buf, 28, aux2); - _mav_put_float(buf, 32, aux3); - _mav_put_float(buf, 36, aux4); - _mav_put_uint8_t(buf, 40, mode); - _mav_put_uint8_t(buf, 41, nav_mode); + char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll_ailerons); + _mav_put_float(buf, 12, pitch_elevator); + _mav_put_float(buf, 16, yaw_rudder); + _mav_put_float(buf, 20, throttle); + _mav_put_float(buf, 24, aux1); + _mav_put_float(buf, 28, aux2); + _mav_put_float(buf, 32, aux3); + _mav_put_float(buf, 36, aux4); + _mav_put_uint8_t(buf, 40, mode); + _mav_put_uint8_t(buf, 41, nav_mode); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #else - mavlink_hil_controls_t packet; - packet.time_usec = time_usec; - packet.roll_ailerons = roll_ailerons; - packet.pitch_elevator = pitch_elevator; - packet.yaw_rudder = yaw_rudder; - packet.throttle = throttle; - packet.aux1 = aux1; - packet.aux2 = aux2; - packet.aux3 = aux3; - packet.aux4 = aux4; - packet.mode = mode; - packet.nav_mode = nav_mode; + mavlink_hil_controls_t packet; + packet.time_usec = time_usec; + packet.roll_ailerons = roll_ailerons; + packet.pitch_elevator = pitch_elevator; + packet.yaw_rudder = yaw_rudder; + packet.throttle = throttle; + packet.aux1 = aux1; + packet.aux2 = aux2; + packet.aux3 = aux3; + packet.aux4 = aux4; + packet.mode = mode; + packet.nav_mode = nav_mode; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); } /** @@ -178,7 +192,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_hil_controls_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_controls_t* hil_controls) { - return mavlink_msg_hil_controls_pack(system_id, component_id, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode); + return mavlink_msg_hil_controls_pack(system_id, component_id, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode); } /** @@ -192,7 +206,7 @@ static inline uint16_t mavlink_msg_hil_controls_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_hil_controls_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_controls_t* hil_controls) { - return mavlink_msg_hil_controls_pack_chan(system_id, component_id, chan, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode); + return mavlink_msg_hil_controls_pack_chan(system_id, component_id, chan, msg, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode); } /** @@ -216,43 +230,49 @@ static inline uint16_t mavlink_msg_hil_controls_encode_chan(uint8_t system_id, u static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll_ailerons); - _mav_put_float(buf, 12, pitch_elevator); - _mav_put_float(buf, 16, yaw_rudder); - _mav_put_float(buf, 20, throttle); - _mav_put_float(buf, 24, aux1); - _mav_put_float(buf, 28, aux2); - _mav_put_float(buf, 32, aux3); - _mav_put_float(buf, 36, aux4); - _mav_put_uint8_t(buf, 40, mode); - _mav_put_uint8_t(buf, 41, nav_mode); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); + char buf[MAVLINK_MSG_ID_HIL_CONTROLS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll_ailerons); + _mav_put_float(buf, 12, pitch_elevator); + _mav_put_float(buf, 16, yaw_rudder); + _mav_put_float(buf, 20, throttle); + _mav_put_float(buf, 24, aux1); + _mav_put_float(buf, 28, aux2); + _mav_put_float(buf, 32, aux3); + _mav_put_float(buf, 36, aux4); + _mav_put_uint8_t(buf, 40, mode); + _mav_put_uint8_t(buf, 41, nav_mode); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); + mavlink_hil_controls_t packet; + packet.time_usec = time_usec; + packet.roll_ailerons = roll_ailerons; + packet.pitch_elevator = pitch_elevator; + packet.yaw_rudder = yaw_rudder; + packet.throttle = throttle; + packet.aux1 = aux1; + packet.aux2 = aux2; + packet.aux3 = aux3; + packet.aux4 = aux4; + packet.mode = mode; + packet.nav_mode = nav_mode; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); #endif +} + +/** + * @brief Send a hil_controls message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_hil_controls_send_struct(mavlink_channel_t chan, const mavlink_hil_controls_t* hil_controls) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_hil_controls_send(chan, hil_controls->time_usec, hil_controls->roll_ailerons, hil_controls->pitch_elevator, hil_controls->yaw_rudder, hil_controls->throttle, hil_controls->aux1, hil_controls->aux2, hil_controls->aux3, hil_controls->aux4, hil_controls->mode, hil_controls->nav_mode); #else - mavlink_hil_controls_t packet; - packet.time_usec = time_usec; - packet.roll_ailerons = roll_ailerons; - packet.pitch_elevator = pitch_elevator; - packet.yaw_rudder = yaw_rudder; - packet.throttle = throttle; - packet.aux1 = aux1; - packet.aux2 = aux2; - packet.aux3 = aux3; - packet.aux4 = aux4; - packet.mode = mode; - packet.nav_mode = nav_mode; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)&packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)hil_controls, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); #endif } @@ -267,43 +287,35 @@ static inline void mavlink_msg_hil_controls_send(mavlink_channel_t chan, uint64_ static inline void mavlink_msg_hil_controls_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float roll_ailerons, float pitch_elevator, float yaw_rudder, float throttle, float aux1, float aux2, float aux3, float aux4, uint8_t mode, uint8_t nav_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll_ailerons); - _mav_put_float(buf, 12, pitch_elevator); - _mav_put_float(buf, 16, yaw_rudder); - _mav_put_float(buf, 20, throttle); - _mav_put_float(buf, 24, aux1); - _mav_put_float(buf, 28, aux2); - _mav_put_float(buf, 32, aux3); - _mav_put_float(buf, 36, aux4); - _mav_put_uint8_t(buf, 40, mode); - _mav_put_uint8_t(buf, 41, nav_mode); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll_ailerons); + _mav_put_float(buf, 12, pitch_elevator); + _mav_put_float(buf, 16, yaw_rudder); + _mav_put_float(buf, 20, throttle); + _mav_put_float(buf, 24, aux1); + _mav_put_float(buf, 28, aux2); + _mav_put_float(buf, 32, aux3); + _mav_put_float(buf, 36, aux4); + _mav_put_uint8_t(buf, 40, mode); + _mav_put_uint8_t(buf, 41, nav_mode); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, buf, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); -#endif -#else - mavlink_hil_controls_t *packet = (mavlink_hil_controls_t *)msgbuf; - packet->time_usec = time_usec; - packet->roll_ailerons = roll_ailerons; - packet->pitch_elevator = pitch_elevator; - packet->yaw_rudder = yaw_rudder; - packet->throttle = throttle; - packet->aux1 = aux1; - packet->aux2 = aux2; - packet->aux3 = aux3; - packet->aux4 = aux4; - packet->mode = mode; - packet->nav_mode = nav_mode; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)packet, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); -#endif + mavlink_hil_controls_t *packet = (mavlink_hil_controls_t *)msgbuf; + packet->time_usec = time_usec; + packet->roll_ailerons = roll_ailerons; + packet->pitch_elevator = pitch_elevator; + packet->yaw_rudder = yaw_rudder; + packet->throttle = throttle; + packet->aux1 = aux1; + packet->aux2 = aux2; + packet->aux3 = aux3; + packet->aux4 = aux4; + packet->mode = mode; + packet->nav_mode = nav_mode; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_CONTROLS, (const char *)packet, MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_LEN, MAVLINK_MSG_ID_HIL_CONTROLS_CRC); #endif } #endif @@ -320,7 +332,7 @@ static inline void mavlink_msg_hil_controls_send_buf(mavlink_message_t *msgbuf, */ static inline uint64_t mavlink_msg_hil_controls_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -330,7 +342,7 @@ static inline uint64_t mavlink_msg_hil_controls_get_time_usec(const mavlink_mess */ static inline float mavlink_msg_hil_controls_get_roll_ailerons(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -340,7 +352,7 @@ static inline float mavlink_msg_hil_controls_get_roll_ailerons(const mavlink_mes */ static inline float mavlink_msg_hil_controls_get_pitch_elevator(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -350,7 +362,7 @@ static inline float mavlink_msg_hil_controls_get_pitch_elevator(const mavlink_me */ static inline float mavlink_msg_hil_controls_get_yaw_rudder(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -360,7 +372,7 @@ static inline float mavlink_msg_hil_controls_get_yaw_rudder(const mavlink_messag */ static inline float mavlink_msg_hil_controls_get_throttle(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -370,7 +382,7 @@ static inline float mavlink_msg_hil_controls_get_throttle(const mavlink_message_ */ static inline float mavlink_msg_hil_controls_get_aux1(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -380,7 +392,7 @@ static inline float mavlink_msg_hil_controls_get_aux1(const mavlink_message_t* m */ static inline float mavlink_msg_hil_controls_get_aux2(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -390,7 +402,7 @@ static inline float mavlink_msg_hil_controls_get_aux2(const mavlink_message_t* m */ static inline float mavlink_msg_hil_controls_get_aux3(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -400,7 +412,7 @@ static inline float mavlink_msg_hil_controls_get_aux3(const mavlink_message_t* m */ static inline float mavlink_msg_hil_controls_get_aux4(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -410,7 +422,7 @@ static inline float mavlink_msg_hil_controls_get_aux4(const mavlink_message_t* m */ static inline uint8_t mavlink_msg_hil_controls_get_mode(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 40); + return _MAV_RETURN_uint8_t(msg, 40); } /** @@ -420,7 +432,7 @@ static inline uint8_t mavlink_msg_hil_controls_get_mode(const mavlink_message_t* */ static inline uint8_t mavlink_msg_hil_controls_get_nav_mode(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 41); + return _MAV_RETURN_uint8_t(msg, 41); } /** @@ -431,19 +443,21 @@ static inline uint8_t mavlink_msg_hil_controls_get_nav_mode(const mavlink_messag */ static inline void mavlink_msg_hil_controls_decode(const mavlink_message_t* msg, mavlink_hil_controls_t* hil_controls) { -#if MAVLINK_NEED_BYTE_SWAP - hil_controls->time_usec = mavlink_msg_hil_controls_get_time_usec(msg); - hil_controls->roll_ailerons = mavlink_msg_hil_controls_get_roll_ailerons(msg); - hil_controls->pitch_elevator = mavlink_msg_hil_controls_get_pitch_elevator(msg); - hil_controls->yaw_rudder = mavlink_msg_hil_controls_get_yaw_rudder(msg); - hil_controls->throttle = mavlink_msg_hil_controls_get_throttle(msg); - hil_controls->aux1 = mavlink_msg_hil_controls_get_aux1(msg); - hil_controls->aux2 = mavlink_msg_hil_controls_get_aux2(msg); - hil_controls->aux3 = mavlink_msg_hil_controls_get_aux3(msg); - hil_controls->aux4 = mavlink_msg_hil_controls_get_aux4(msg); - hil_controls->mode = mavlink_msg_hil_controls_get_mode(msg); - hil_controls->nav_mode = mavlink_msg_hil_controls_get_nav_mode(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + hil_controls->time_usec = mavlink_msg_hil_controls_get_time_usec(msg); + hil_controls->roll_ailerons = mavlink_msg_hil_controls_get_roll_ailerons(msg); + hil_controls->pitch_elevator = mavlink_msg_hil_controls_get_pitch_elevator(msg); + hil_controls->yaw_rudder = mavlink_msg_hil_controls_get_yaw_rudder(msg); + hil_controls->throttle = mavlink_msg_hil_controls_get_throttle(msg); + hil_controls->aux1 = mavlink_msg_hil_controls_get_aux1(msg); + hil_controls->aux2 = mavlink_msg_hil_controls_get_aux2(msg); + hil_controls->aux3 = mavlink_msg_hil_controls_get_aux3(msg); + hil_controls->aux4 = mavlink_msg_hil_controls_get_aux4(msg); + hil_controls->mode = mavlink_msg_hil_controls_get_mode(msg); + hil_controls->nav_mode = mavlink_msg_hil_controls_get_nav_mode(msg); #else - memcpy(hil_controls, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_CONTROLS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_CONTROLS_LEN? msg->len : MAVLINK_MSG_ID_HIL_CONTROLS_LEN; + memset(hil_controls, 0, MAVLINK_MSG_ID_HIL_CONTROLS_LEN); + memcpy(hil_controls, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_gps.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_gps.h index 6a30c29..1bb92c7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_gps.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_gps.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIL_GPS PACKING #define MAVLINK_MSG_ID_HIL_GPS 113 -typedef struct __mavlink_hil_gps_t -{ +MAVPACKED( +typedef struct __mavlink_hil_gps_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/ int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/ @@ -17,20 +18,24 @@ typedef struct __mavlink_hil_gps_t uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535*/ uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.*/ uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/ -} mavlink_hil_gps_t; +}) mavlink_hil_gps_t; #define MAVLINK_MSG_ID_HIL_GPS_LEN 36 +#define MAVLINK_MSG_ID_HIL_GPS_MIN_LEN 36 #define MAVLINK_MSG_ID_113_LEN 36 +#define MAVLINK_MSG_ID_113_MIN_LEN 36 #define MAVLINK_MSG_ID_HIL_GPS_CRC 124 #define MAVLINK_MSG_ID_113_CRC 124 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIL_GPS { \ - "HIL_GPS", \ - 13, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \ + 113, \ + "HIL_GPS", \ + 13, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \ { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \ @@ -45,7 +50,26 @@ typedef struct __mavlink_hil_gps_t { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIL_GPS { \ + "HIL_GPS", \ + 13, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \ + { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_gps_t, eph) }, \ + { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_gps_t, epv) }, \ + { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_gps_t, vel) }, \ + { "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_hil_gps_t, vn) }, \ + { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \ + { "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \ + { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \ + { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \ + { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \ + } \ +} +#endif /** * @brief Pack a hil_gps message @@ -69,50 +93,46 @@ typedef struct __mavlink_hil_gps_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible) + uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_GPS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_int16_t(buf, 26, vn); - _mav_put_int16_t(buf, 28, ve); - _mav_put_int16_t(buf, 30, vd); - _mav_put_uint16_t(buf, 32, cog); - _mav_put_uint8_t(buf, 34, fix_type); - _mav_put_uint8_t(buf, 35, satellites_visible); + char buf[MAVLINK_MSG_ID_HIL_GPS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_int16_t(buf, 26, vn); + _mav_put_int16_t(buf, 28, ve); + _mav_put_int16_t(buf, 30, vd); + _mav_put_uint16_t(buf, 32, cog); + _mav_put_uint8_t(buf, 34, fix_type); + _mav_put_uint8_t(buf, 35, satellites_visible); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN); #else - mavlink_hil_gps_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.vn = vn; - packet.ve = ve; - packet.vd = vd; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; + mavlink_hil_gps_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.vn = vn; + packet.ve = ve; + packet.vd = vd; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_GPS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_GPS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_GPS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); } /** @@ -137,51 +157,47 @@ static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t compo * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_gps_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,int16_t vn,int16_t ve,int16_t vd,uint16_t cog,uint8_t satellites_visible) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,int16_t vn,int16_t ve,int16_t vd,uint16_t cog,uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_GPS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_int16_t(buf, 26, vn); - _mav_put_int16_t(buf, 28, ve); - _mav_put_int16_t(buf, 30, vd); - _mav_put_uint16_t(buf, 32, cog); - _mav_put_uint8_t(buf, 34, fix_type); - _mav_put_uint8_t(buf, 35, satellites_visible); + char buf[MAVLINK_MSG_ID_HIL_GPS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_int16_t(buf, 26, vn); + _mav_put_int16_t(buf, 28, ve); + _mav_put_int16_t(buf, 30, vd); + _mav_put_uint16_t(buf, 32, cog); + _mav_put_uint8_t(buf, 34, fix_type); + _mav_put_uint8_t(buf, 35, satellites_visible); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN); #else - mavlink_hil_gps_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.vn = vn; - packet.ve = ve; - packet.vd = vd; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; + mavlink_hil_gps_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.vn = vn; + packet.ve = ve; + packet.vd = vd; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_GPS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_GPS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_GPS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); } /** @@ -194,7 +210,7 @@ static inline uint16_t mavlink_msg_hil_gps_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_hil_gps_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_gps_t* hil_gps) { - return mavlink_msg_hil_gps_pack(system_id, component_id, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible); + return mavlink_msg_hil_gps_pack(system_id, component_id, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible); } /** @@ -208,7 +224,7 @@ static inline uint16_t mavlink_msg_hil_gps_encode(uint8_t system_id, uint8_t com */ static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_gps_t* hil_gps) { - return mavlink_msg_hil_gps_pack_chan(system_id, component_id, chan, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible); + return mavlink_msg_hil_gps_pack_chan(system_id, component_id, chan, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible); } /** @@ -234,47 +250,53 @@ static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_ static inline void mavlink_msg_hil_gps_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_GPS_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_int16_t(buf, 26, vn); - _mav_put_int16_t(buf, 28, ve); - _mav_put_int16_t(buf, 30, vd); - _mav_put_uint16_t(buf, 32, cog); - _mav_put_uint8_t(buf, 34, fix_type); - _mav_put_uint8_t(buf, 35, satellites_visible); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); + char buf[MAVLINK_MSG_ID_HIL_GPS_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_int16_t(buf, 26, vn); + _mav_put_int16_t(buf, 28, ve); + _mav_put_int16_t(buf, 30, vd); + _mav_put_uint16_t(buf, 32, cog); + _mav_put_uint8_t(buf, 34, fix_type); + _mav_put_uint8_t(buf, 35, satellites_visible); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_LEN); + mavlink_hil_gps_t packet; + packet.time_usec = time_usec; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.eph = eph; + packet.epv = epv; + packet.vel = vel; + packet.vn = vn; + packet.ve = ve; + packet.vd = vd; + packet.cog = cog; + packet.fix_type = fix_type; + packet.satellites_visible = satellites_visible; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)&packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); #endif +} + +/** + * @brief Send a hil_gps message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_hil_gps_send_struct(mavlink_channel_t chan, const mavlink_hil_gps_t* hil_gps) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_hil_gps_send(chan, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible); #else - mavlink_hil_gps_t packet; - packet.time_usec = time_usec; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.eph = eph; - packet.epv = epv; - packet.vel = vel; - packet.vn = vn; - packet.ve = ve; - packet.vd = vd; - packet.cog = cog; - packet.fix_type = fix_type; - packet.satellites_visible = satellites_visible; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)&packet, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)&packet, MAVLINK_MSG_ID_HIL_GPS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)hil_gps, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); #endif } @@ -289,47 +311,39 @@ static inline void mavlink_msg_hil_gps_send(mavlink_channel_t chan, uint64_t tim static inline void mavlink_msg_hil_gps_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_int32_t(buf, 16, alt); - _mav_put_uint16_t(buf, 20, eph); - _mav_put_uint16_t(buf, 22, epv); - _mav_put_uint16_t(buf, 24, vel); - _mav_put_int16_t(buf, 26, vn); - _mav_put_int16_t(buf, 28, ve); - _mav_put_int16_t(buf, 30, vd); - _mav_put_uint16_t(buf, 32, cog); - _mav_put_uint8_t(buf, 34, fix_type); - _mav_put_uint8_t(buf, 35, satellites_visible); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_int32_t(buf, 16, alt); + _mav_put_uint16_t(buf, 20, eph); + _mav_put_uint16_t(buf, 22, epv); + _mav_put_uint16_t(buf, 24, vel); + _mav_put_int16_t(buf, 26, vn); + _mav_put_int16_t(buf, 28, ve); + _mav_put_int16_t(buf, 30, vd); + _mav_put_uint16_t(buf, 32, cog); + _mav_put_uint8_t(buf, 34, fix_type); + _mav_put_uint8_t(buf, 35, satellites_visible); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_LEN); -#endif -#else - mavlink_hil_gps_t *packet = (mavlink_hil_gps_t *)msgbuf; - packet->time_usec = time_usec; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->eph = eph; - packet->epv = epv; - packet->vel = vel; - packet->vn = vn; - packet->ve = ve; - packet->vd = vd; - packet->cog = cog; - packet->fix_type = fix_type; - packet->satellites_visible = satellites_visible; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)packet, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)packet, MAVLINK_MSG_ID_HIL_GPS_LEN); -#endif + mavlink_hil_gps_t *packet = (mavlink_hil_gps_t *)msgbuf; + packet->time_usec = time_usec; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->eph = eph; + packet->epv = epv; + packet->vel = vel; + packet->vn = vn; + packet->ve = ve; + packet->vd = vd; + packet->cog = cog; + packet->fix_type = fix_type; + packet->satellites_visible = satellites_visible; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (const char *)packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC); #endif } #endif @@ -346,7 +360,7 @@ static inline void mavlink_msg_hil_gps_send_buf(mavlink_message_t *msgbuf, mavli */ static inline uint64_t mavlink_msg_hil_gps_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -356,7 +370,7 @@ static inline uint64_t mavlink_msg_hil_gps_get_time_usec(const mavlink_message_t */ static inline uint8_t mavlink_msg_hil_gps_get_fix_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -366,7 +380,7 @@ static inline uint8_t mavlink_msg_hil_gps_get_fix_type(const mavlink_message_t* */ static inline int32_t mavlink_msg_hil_gps_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -376,7 +390,7 @@ static inline int32_t mavlink_msg_hil_gps_get_lat(const mavlink_message_t* msg) */ static inline int32_t mavlink_msg_hil_gps_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -386,7 +400,7 @@ static inline int32_t mavlink_msg_hil_gps_get_lon(const mavlink_message_t* msg) */ static inline int32_t mavlink_msg_hil_gps_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -396,7 +410,7 @@ static inline int32_t mavlink_msg_hil_gps_get_alt(const mavlink_message_t* msg) */ static inline uint16_t mavlink_msg_hil_gps_get_eph(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 20); + return _MAV_RETURN_uint16_t(msg, 20); } /** @@ -406,7 +420,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_eph(const mavlink_message_t* msg) */ static inline uint16_t mavlink_msg_hil_gps_get_epv(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 22); + return _MAV_RETURN_uint16_t(msg, 22); } /** @@ -416,7 +430,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_epv(const mavlink_message_t* msg) */ static inline uint16_t mavlink_msg_hil_gps_get_vel(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -426,7 +440,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_vel(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_hil_gps_get_vn(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 26); + return _MAV_RETURN_int16_t(msg, 26); } /** @@ -436,7 +450,7 @@ static inline int16_t mavlink_msg_hil_gps_get_vn(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_hil_gps_get_ve(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 28); + return _MAV_RETURN_int16_t(msg, 28); } /** @@ -446,7 +460,7 @@ static inline int16_t mavlink_msg_hil_gps_get_ve(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_hil_gps_get_vd(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 30); + return _MAV_RETURN_int16_t(msg, 30); } /** @@ -456,7 +470,7 @@ static inline int16_t mavlink_msg_hil_gps_get_vd(const mavlink_message_t* msg) */ static inline uint16_t mavlink_msg_hil_gps_get_cog(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 32); + return _MAV_RETURN_uint16_t(msg, 32); } /** @@ -466,7 +480,7 @@ static inline uint16_t mavlink_msg_hil_gps_get_cog(const mavlink_message_t* msg) */ static inline uint8_t mavlink_msg_hil_gps_get_satellites_visible(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 35); + return _MAV_RETURN_uint8_t(msg, 35); } /** @@ -477,21 +491,23 @@ static inline uint8_t mavlink_msg_hil_gps_get_satellites_visible(const mavlink_m */ static inline void mavlink_msg_hil_gps_decode(const mavlink_message_t* msg, mavlink_hil_gps_t* hil_gps) { -#if MAVLINK_NEED_BYTE_SWAP - hil_gps->time_usec = mavlink_msg_hil_gps_get_time_usec(msg); - hil_gps->lat = mavlink_msg_hil_gps_get_lat(msg); - hil_gps->lon = mavlink_msg_hil_gps_get_lon(msg); - hil_gps->alt = mavlink_msg_hil_gps_get_alt(msg); - hil_gps->eph = mavlink_msg_hil_gps_get_eph(msg); - hil_gps->epv = mavlink_msg_hil_gps_get_epv(msg); - hil_gps->vel = mavlink_msg_hil_gps_get_vel(msg); - hil_gps->vn = mavlink_msg_hil_gps_get_vn(msg); - hil_gps->ve = mavlink_msg_hil_gps_get_ve(msg); - hil_gps->vd = mavlink_msg_hil_gps_get_vd(msg); - hil_gps->cog = mavlink_msg_hil_gps_get_cog(msg); - hil_gps->fix_type = mavlink_msg_hil_gps_get_fix_type(msg); - hil_gps->satellites_visible = mavlink_msg_hil_gps_get_satellites_visible(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + hil_gps->time_usec = mavlink_msg_hil_gps_get_time_usec(msg); + hil_gps->lat = mavlink_msg_hil_gps_get_lat(msg); + hil_gps->lon = mavlink_msg_hil_gps_get_lon(msg); + hil_gps->alt = mavlink_msg_hil_gps_get_alt(msg); + hil_gps->eph = mavlink_msg_hil_gps_get_eph(msg); + hil_gps->epv = mavlink_msg_hil_gps_get_epv(msg); + hil_gps->vel = mavlink_msg_hil_gps_get_vel(msg); + hil_gps->vn = mavlink_msg_hil_gps_get_vn(msg); + hil_gps->ve = mavlink_msg_hil_gps_get_ve(msg); + hil_gps->vd = mavlink_msg_hil_gps_get_vd(msg); + hil_gps->cog = mavlink_msg_hil_gps_get_cog(msg); + hil_gps->fix_type = mavlink_msg_hil_gps_get_fix_type(msg); + hil_gps->satellites_visible = mavlink_msg_hil_gps_get_satellites_visible(msg); #else - memcpy(hil_gps, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_GPS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_GPS_LEN? msg->len : MAVLINK_MSG_ID_HIL_GPS_LEN; + memset(hil_gps, 0, MAVLINK_MSG_ID_HIL_GPS_LEN); + memcpy(hil_gps, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_optical_flow.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_optical_flow.h index 67849c5..32a94bc 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_optical_flow.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_optical_flow.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIL_OPTICAL_FLOW PACKING #define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW 114 -typedef struct __mavlink_hil_optical_flow_t -{ +MAVPACKED( +typedef struct __mavlink_hil_optical_flow_t { uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ uint32_t integration_time_us; /*< Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/ float integrated_x; /*< Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/ @@ -16,20 +17,24 @@ typedef struct __mavlink_hil_optical_flow_t int16_t temperature; /*< Temperature * 100 in centi-degrees Celsius*/ uint8_t sensor_id; /*< Sensor ID*/ uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/ -} mavlink_hil_optical_flow_t; +}) mavlink_hil_optical_flow_t; #define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN 44 +#define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN 44 #define MAVLINK_MSG_ID_114_LEN 44 +#define MAVLINK_MSG_ID_114_MIN_LEN 44 #define MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC 237 #define MAVLINK_MSG_ID_114_CRC 237 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \ - "HIL_OPTICAL_FLOW", \ - 12, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \ + 114, \ + "HIL_OPTICAL_FLOW", \ + 12, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \ { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \ { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \ { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \ @@ -43,7 +48,25 @@ typedef struct __mavlink_hil_optical_flow_t { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW { \ + "HIL_OPTICAL_FLOW", \ + 12, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_optical_flow_t, time_usec) }, \ + { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_hil_optical_flow_t, integration_time_us) }, \ + { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_optical_flow_t, integrated_x) }, \ + { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_optical_flow_t, integrated_y) }, \ + { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_optical_flow_t, integrated_xgyro) }, \ + { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_optical_flow_t, integrated_ygyro) }, \ + { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_optical_flow_t, integrated_zgyro) }, \ + { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_hil_optical_flow_t, time_delta_distance_us) }, \ + { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_optical_flow_t, distance) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_hil_optical_flow_t, temperature) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_hil_optical_flow_t, sensor_id) }, \ + { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_hil_optical_flow_t, quality) }, \ + } \ +} +#endif /** * @brief Pack a hil_optical_flow message @@ -66,48 +89,44 @@ typedef struct __mavlink_hil_optical_flow_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) + uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); + char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); #else - mavlink_hil_optical_flow_t packet; - packet.time_usec = time_usec; - packet.integration_time_us = integration_time_us; - packet.integrated_x = integrated_x; - packet.integrated_y = integrated_y; - packet.integrated_xgyro = integrated_xgyro; - packet.integrated_ygyro = integrated_ygyro; - packet.integrated_zgyro = integrated_zgyro; - packet.time_delta_distance_us = time_delta_distance_us; - packet.distance = distance; - packet.temperature = temperature; - packet.sensor_id = sensor_id; - packet.quality = quality; + mavlink_hil_optical_flow_t packet; + packet.time_usec = time_usec; + packet.integration_time_us = integration_time_us; + packet.integrated_x = integrated_x; + packet.integrated_y = integrated_y; + packet.integrated_xgyro = integrated_xgyro; + packet.integrated_ygyro = integrated_ygyro; + packet.integrated_zgyro = integrated_zgyro; + packet.time_delta_distance_us = time_delta_distance_us; + packet.distance = distance; + packet.temperature = temperature; + packet.sensor_id = sensor_id; + packet.quality = quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); } /** @@ -131,49 +150,45 @@ static inline uint16_t mavlink_msg_hil_optical_flow_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); + char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); #else - mavlink_hil_optical_flow_t packet; - packet.time_usec = time_usec; - packet.integration_time_us = integration_time_us; - packet.integrated_x = integrated_x; - packet.integrated_y = integrated_y; - packet.integrated_xgyro = integrated_xgyro; - packet.integrated_ygyro = integrated_ygyro; - packet.integrated_zgyro = integrated_zgyro; - packet.time_delta_distance_us = time_delta_distance_us; - packet.distance = distance; - packet.temperature = temperature; - packet.sensor_id = sensor_id; - packet.quality = quality; + mavlink_hil_optical_flow_t packet; + packet.time_usec = time_usec; + packet.integration_time_us = integration_time_us; + packet.integrated_x = integrated_x; + packet.integrated_y = integrated_y; + packet.integrated_xgyro = integrated_xgyro; + packet.integrated_ygyro = integrated_ygyro; + packet.integrated_zgyro = integrated_zgyro; + packet.time_delta_distance_us = time_delta_distance_us; + packet.distance = distance; + packet.temperature = temperature; + packet.sensor_id = sensor_id; + packet.quality = quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_OPTICAL_FLOW; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); } /** @@ -186,7 +201,7 @@ static inline uint16_t mavlink_msg_hil_optical_flow_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_hil_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow) { - return mavlink_msg_hil_optical_flow_pack(system_id, component_id, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance); + return mavlink_msg_hil_optical_flow_pack(system_id, component_id, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance); } /** @@ -200,7 +215,7 @@ static inline uint16_t mavlink_msg_hil_optical_flow_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_hil_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_optical_flow_t* hil_optical_flow) { - return mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, chan, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance); + return mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, chan, msg, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance); } /** @@ -225,45 +240,51 @@ static inline uint16_t mavlink_msg_hil_optical_flow_encode_chan(uint8_t system_i static inline void mavlink_msg_hil_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); + char buf[MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); + mavlink_hil_optical_flow_t packet; + packet.time_usec = time_usec; + packet.integration_time_us = integration_time_us; + packet.integrated_x = integrated_x; + packet.integrated_y = integrated_y; + packet.integrated_xgyro = integrated_xgyro; + packet.integrated_ygyro = integrated_ygyro; + packet.integrated_zgyro = integrated_zgyro; + packet.time_delta_distance_us = time_delta_distance_us; + packet.distance = distance; + packet.temperature = temperature; + packet.sensor_id = sensor_id; + packet.quality = quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); #endif +} + +/** + * @brief Send a hil_optical_flow message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_hil_optical_flow_send_struct(mavlink_channel_t chan, const mavlink_hil_optical_flow_t* hil_optical_flow) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_hil_optical_flow_send(chan, hil_optical_flow->time_usec, hil_optical_flow->sensor_id, hil_optical_flow->integration_time_us, hil_optical_flow->integrated_x, hil_optical_flow->integrated_y, hil_optical_flow->integrated_xgyro, hil_optical_flow->integrated_ygyro, hil_optical_flow->integrated_zgyro, hil_optical_flow->temperature, hil_optical_flow->quality, hil_optical_flow->time_delta_distance_us, hil_optical_flow->distance); #else - mavlink_hil_optical_flow_t packet; - packet.time_usec = time_usec; - packet.integration_time_us = integration_time_us; - packet.integrated_x = integrated_x; - packet.integrated_y = integrated_y; - packet.integrated_xgyro = integrated_xgyro; - packet.integrated_ygyro = integrated_ygyro; - packet.integrated_zgyro = integrated_zgyro; - packet.time_delta_distance_us = time_delta_distance_us; - packet.distance = distance; - packet.temperature = temperature; - packet.sensor_id = sensor_id; - packet.quality = quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)hil_optical_flow, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); #endif } @@ -278,45 +299,37 @@ static inline void mavlink_msg_hil_optical_flow_send(mavlink_channel_t chan, uin static inline void mavlink_msg_hil_optical_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); -#endif -#else - mavlink_hil_optical_flow_t *packet = (mavlink_hil_optical_flow_t *)msgbuf; - packet->time_usec = time_usec; - packet->integration_time_us = integration_time_us; - packet->integrated_x = integrated_x; - packet->integrated_y = integrated_y; - packet->integrated_xgyro = integrated_xgyro; - packet->integrated_ygyro = integrated_ygyro; - packet->integrated_zgyro = integrated_zgyro; - packet->time_delta_distance_us = time_delta_distance_us; - packet->distance = distance; - packet->temperature = temperature; - packet->sensor_id = sensor_id; - packet->quality = quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); -#endif + mavlink_hil_optical_flow_t *packet = (mavlink_hil_optical_flow_t *)msgbuf; + packet->time_usec = time_usec; + packet->integration_time_us = integration_time_us; + packet->integrated_x = integrated_x; + packet->integrated_y = integrated_y; + packet->integrated_xgyro = integrated_xgyro; + packet->integrated_ygyro = integrated_ygyro; + packet->integrated_zgyro = integrated_zgyro; + packet->time_delta_distance_us = time_delta_distance_us; + packet->distance = distance; + packet->temperature = temperature; + packet->sensor_id = sensor_id; + packet->quality = quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_CRC); #endif } #endif @@ -333,7 +346,7 @@ static inline void mavlink_msg_hil_optical_flow_send_buf(mavlink_message_t *msgb */ static inline uint64_t mavlink_msg_hil_optical_flow_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -343,7 +356,7 @@ static inline uint64_t mavlink_msg_hil_optical_flow_get_time_usec(const mavlink_ */ static inline uint8_t mavlink_msg_hil_optical_flow_get_sensor_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 42); + return _MAV_RETURN_uint8_t(msg, 42); } /** @@ -353,7 +366,7 @@ static inline uint8_t mavlink_msg_hil_optical_flow_get_sensor_id(const mavlink_m */ static inline uint32_t mavlink_msg_hil_optical_flow_get_integration_time_us(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -363,7 +376,7 @@ static inline uint32_t mavlink_msg_hil_optical_flow_get_integration_time_us(cons */ static inline float mavlink_msg_hil_optical_flow_get_integrated_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -373,7 +386,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_x(const mavlink_ */ static inline float mavlink_msg_hil_optical_flow_get_integrated_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -383,7 +396,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_y(const mavlink_ */ static inline float mavlink_msg_hil_optical_flow_get_integrated_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -393,7 +406,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_xgyro(const mavl */ static inline float mavlink_msg_hil_optical_flow_get_integrated_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -403,7 +416,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_ygyro(const mavl */ static inline float mavlink_msg_hil_optical_flow_get_integrated_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -413,7 +426,7 @@ static inline float mavlink_msg_hil_optical_flow_get_integrated_zgyro(const mavl */ static inline int16_t mavlink_msg_hil_optical_flow_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 40); + return _MAV_RETURN_int16_t(msg, 40); } /** @@ -423,7 +436,7 @@ static inline int16_t mavlink_msg_hil_optical_flow_get_temperature(const mavlink */ static inline uint8_t mavlink_msg_hil_optical_flow_get_quality(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 43); + return _MAV_RETURN_uint8_t(msg, 43); } /** @@ -433,7 +446,7 @@ static inline uint8_t mavlink_msg_hil_optical_flow_get_quality(const mavlink_mes */ static inline uint32_t mavlink_msg_hil_optical_flow_get_time_delta_distance_us(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 32); + return _MAV_RETURN_uint32_t(msg, 32); } /** @@ -443,7 +456,7 @@ static inline uint32_t mavlink_msg_hil_optical_flow_get_time_delta_distance_us(c */ static inline float mavlink_msg_hil_optical_flow_get_distance(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -454,20 +467,22 @@ static inline float mavlink_msg_hil_optical_flow_get_distance(const mavlink_mess */ static inline void mavlink_msg_hil_optical_flow_decode(const mavlink_message_t* msg, mavlink_hil_optical_flow_t* hil_optical_flow) { -#if MAVLINK_NEED_BYTE_SWAP - hil_optical_flow->time_usec = mavlink_msg_hil_optical_flow_get_time_usec(msg); - hil_optical_flow->integration_time_us = mavlink_msg_hil_optical_flow_get_integration_time_us(msg); - hil_optical_flow->integrated_x = mavlink_msg_hil_optical_flow_get_integrated_x(msg); - hil_optical_flow->integrated_y = mavlink_msg_hil_optical_flow_get_integrated_y(msg); - hil_optical_flow->integrated_xgyro = mavlink_msg_hil_optical_flow_get_integrated_xgyro(msg); - hil_optical_flow->integrated_ygyro = mavlink_msg_hil_optical_flow_get_integrated_ygyro(msg); - hil_optical_flow->integrated_zgyro = mavlink_msg_hil_optical_flow_get_integrated_zgyro(msg); - hil_optical_flow->time_delta_distance_us = mavlink_msg_hil_optical_flow_get_time_delta_distance_us(msg); - hil_optical_flow->distance = mavlink_msg_hil_optical_flow_get_distance(msg); - hil_optical_flow->temperature = mavlink_msg_hil_optical_flow_get_temperature(msg); - hil_optical_flow->sensor_id = mavlink_msg_hil_optical_flow_get_sensor_id(msg); - hil_optical_flow->quality = mavlink_msg_hil_optical_flow_get_quality(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + hil_optical_flow->time_usec = mavlink_msg_hil_optical_flow_get_time_usec(msg); + hil_optical_flow->integration_time_us = mavlink_msg_hil_optical_flow_get_integration_time_us(msg); + hil_optical_flow->integrated_x = mavlink_msg_hil_optical_flow_get_integrated_x(msg); + hil_optical_flow->integrated_y = mavlink_msg_hil_optical_flow_get_integrated_y(msg); + hil_optical_flow->integrated_xgyro = mavlink_msg_hil_optical_flow_get_integrated_xgyro(msg); + hil_optical_flow->integrated_ygyro = mavlink_msg_hil_optical_flow_get_integrated_ygyro(msg); + hil_optical_flow->integrated_zgyro = mavlink_msg_hil_optical_flow_get_integrated_zgyro(msg); + hil_optical_flow->time_delta_distance_us = mavlink_msg_hil_optical_flow_get_time_delta_distance_us(msg); + hil_optical_flow->distance = mavlink_msg_hil_optical_flow_get_distance(msg); + hil_optical_flow->temperature = mavlink_msg_hil_optical_flow_get_temperature(msg); + hil_optical_flow->sensor_id = mavlink_msg_hil_optical_flow_get_sensor_id(msg); + hil_optical_flow->quality = mavlink_msg_hil_optical_flow_get_quality(msg); #else - memcpy(hil_optical_flow, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN? msg->len : MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN; + memset(hil_optical_flow, 0, MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_LEN); + memcpy(hil_optical_flow, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_rc_inputs_raw.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_rc_inputs_raw.h index 1eb426e..27d2e20 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_rc_inputs_raw.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_rc_inputs_raw.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIL_RC_INPUTS_RAW PACKING #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92 -typedef struct __mavlink_hil_rc_inputs_raw_t -{ +MAVPACKED( +typedef struct __mavlink_hil_rc_inputs_raw_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ uint16_t chan1_raw; /*< RC channel 1 value, in microseconds*/ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds*/ @@ -18,20 +19,24 @@ typedef struct __mavlink_hil_rc_inputs_raw_t uint16_t chan11_raw; /*< RC channel 11 value, in microseconds*/ uint16_t chan12_raw; /*< RC channel 12 value, in microseconds*/ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 255: 100%*/ -} mavlink_hil_rc_inputs_raw_t; +}) mavlink_hil_rc_inputs_raw_t; #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33 +#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN 33 #define MAVLINK_MSG_ID_92_LEN 33 +#define MAVLINK_MSG_ID_92_MIN_LEN 33 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54 #define MAVLINK_MSG_ID_92_CRC 54 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \ - "HIL_RC_INPUTS_RAW", \ - 14, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \ + 92, \ + "HIL_RC_INPUTS_RAW", \ + 14, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \ { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \ @@ -47,7 +52,27 @@ typedef struct __mavlink_hil_rc_inputs_raw_t { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \ + "HIL_RC_INPUTS_RAW", \ + 14, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \ + { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \ + { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \ + { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \ + { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \ + { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \ + { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \ + { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \ + { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \ + { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \ + { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \ + { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \ + { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \ + { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \ + } \ +} +#endif /** * @brief Pack a hil_rc_inputs_raw message @@ -72,52 +97,48 @@ typedef struct __mavlink_hil_rc_inputs_raw_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi) + uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 8, chan1_raw); - _mav_put_uint16_t(buf, 10, chan2_raw); - _mav_put_uint16_t(buf, 12, chan3_raw); - _mav_put_uint16_t(buf, 14, chan4_raw); - _mav_put_uint16_t(buf, 16, chan5_raw); - _mav_put_uint16_t(buf, 18, chan6_raw); - _mav_put_uint16_t(buf, 20, chan7_raw); - _mav_put_uint16_t(buf, 22, chan8_raw); - _mav_put_uint16_t(buf, 24, chan9_raw); - _mav_put_uint16_t(buf, 26, chan10_raw); - _mav_put_uint16_t(buf, 28, chan11_raw); - _mav_put_uint16_t(buf, 30, chan12_raw); - _mav_put_uint8_t(buf, 32, rssi); + char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 8, chan1_raw); + _mav_put_uint16_t(buf, 10, chan2_raw); + _mav_put_uint16_t(buf, 12, chan3_raw); + _mav_put_uint16_t(buf, 14, chan4_raw); + _mav_put_uint16_t(buf, 16, chan5_raw); + _mav_put_uint16_t(buf, 18, chan6_raw); + _mav_put_uint16_t(buf, 20, chan7_raw); + _mav_put_uint16_t(buf, 22, chan8_raw); + _mav_put_uint16_t(buf, 24, chan9_raw); + _mav_put_uint16_t(buf, 26, chan10_raw); + _mav_put_uint16_t(buf, 28, chan11_raw); + _mav_put_uint16_t(buf, 30, chan12_raw); + _mav_put_uint8_t(buf, 32, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #else - mavlink_hil_rc_inputs_raw_t packet; - packet.time_usec = time_usec; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.chan9_raw = chan9_raw; - packet.chan10_raw = chan10_raw; - packet.chan11_raw = chan11_raw; - packet.chan12_raw = chan12_raw; - packet.rssi = rssi; + mavlink_hil_rc_inputs_raw_t packet; + packet.time_usec = time_usec; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.chan9_raw = chan9_raw; + packet.chan10_raw = chan10_raw; + packet.chan11_raw = chan11_raw; + packet.chan12_raw = chan12_raw; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); } /** @@ -143,53 +164,49 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint8_t rssi) + mavlink_message_t* msg, + uint64_t time_usec,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 8, chan1_raw); - _mav_put_uint16_t(buf, 10, chan2_raw); - _mav_put_uint16_t(buf, 12, chan3_raw); - _mav_put_uint16_t(buf, 14, chan4_raw); - _mav_put_uint16_t(buf, 16, chan5_raw); - _mav_put_uint16_t(buf, 18, chan6_raw); - _mav_put_uint16_t(buf, 20, chan7_raw); - _mav_put_uint16_t(buf, 22, chan8_raw); - _mav_put_uint16_t(buf, 24, chan9_raw); - _mav_put_uint16_t(buf, 26, chan10_raw); - _mav_put_uint16_t(buf, 28, chan11_raw); - _mav_put_uint16_t(buf, 30, chan12_raw); - _mav_put_uint8_t(buf, 32, rssi); + char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 8, chan1_raw); + _mav_put_uint16_t(buf, 10, chan2_raw); + _mav_put_uint16_t(buf, 12, chan3_raw); + _mav_put_uint16_t(buf, 14, chan4_raw); + _mav_put_uint16_t(buf, 16, chan5_raw); + _mav_put_uint16_t(buf, 18, chan6_raw); + _mav_put_uint16_t(buf, 20, chan7_raw); + _mav_put_uint16_t(buf, 22, chan8_raw); + _mav_put_uint16_t(buf, 24, chan9_raw); + _mav_put_uint16_t(buf, 26, chan10_raw); + _mav_put_uint16_t(buf, 28, chan11_raw); + _mav_put_uint16_t(buf, 30, chan12_raw); + _mav_put_uint8_t(buf, 32, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #else - mavlink_hil_rc_inputs_raw_t packet; - packet.time_usec = time_usec; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.chan9_raw = chan9_raw; - packet.chan10_raw = chan10_raw; - packet.chan11_raw = chan11_raw; - packet.chan12_raw = chan12_raw; - packet.rssi = rssi; + mavlink_hil_rc_inputs_raw_t packet; + packet.time_usec = time_usec; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.chan9_raw = chan9_raw; + packet.chan10_raw = chan10_raw; + packet.chan11_raw = chan11_raw; + packet.chan12_raw = chan12_raw; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); } /** @@ -202,7 +219,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw) { - return mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi); + return mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi); } /** @@ -216,7 +233,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode(uint8_t system_id, u */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw) { - return mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, chan, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi); + return mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, chan, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi); } /** @@ -243,49 +260,55 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode_chan(uint8_t system_ static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 8, chan1_raw); - _mav_put_uint16_t(buf, 10, chan2_raw); - _mav_put_uint16_t(buf, 12, chan3_raw); - _mav_put_uint16_t(buf, 14, chan4_raw); - _mav_put_uint16_t(buf, 16, chan5_raw); - _mav_put_uint16_t(buf, 18, chan6_raw); - _mav_put_uint16_t(buf, 20, chan7_raw); - _mav_put_uint16_t(buf, 22, chan8_raw); - _mav_put_uint16_t(buf, 24, chan9_raw); - _mav_put_uint16_t(buf, 26, chan10_raw); - _mav_put_uint16_t(buf, 28, chan11_raw); - _mav_put_uint16_t(buf, 30, chan12_raw); - _mav_put_uint8_t(buf, 32, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); + char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 8, chan1_raw); + _mav_put_uint16_t(buf, 10, chan2_raw); + _mav_put_uint16_t(buf, 12, chan3_raw); + _mav_put_uint16_t(buf, 14, chan4_raw); + _mav_put_uint16_t(buf, 16, chan5_raw); + _mav_put_uint16_t(buf, 18, chan6_raw); + _mav_put_uint16_t(buf, 20, chan7_raw); + _mav_put_uint16_t(buf, 22, chan8_raw); + _mav_put_uint16_t(buf, 24, chan9_raw); + _mav_put_uint16_t(buf, 26, chan10_raw); + _mav_put_uint16_t(buf, 28, chan11_raw); + _mav_put_uint16_t(buf, 30, chan12_raw); + _mav_put_uint8_t(buf, 32, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); + mavlink_hil_rc_inputs_raw_t packet; + packet.time_usec = time_usec; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.chan9_raw = chan9_raw; + packet.chan10_raw = chan10_raw; + packet.chan11_raw = chan11_raw; + packet.chan12_raw = chan12_raw; + packet.rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); #endif +} + +/** + * @brief Send a hil_rc_inputs_raw message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_hil_rc_inputs_raw_send_struct(mavlink_channel_t chan, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_hil_rc_inputs_raw_send(chan, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi); #else - mavlink_hil_rc_inputs_raw_t packet; - packet.time_usec = time_usec; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.chan9_raw = chan9_raw; - packet.chan10_raw = chan10_raw; - packet.chan11_raw = chan11_raw; - packet.chan12_raw = chan12_raw; - packet.rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)hil_rc_inputs_raw, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); #endif } @@ -300,49 +323,41 @@ static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, ui static inline void mavlink_msg_hil_rc_inputs_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 8, chan1_raw); - _mav_put_uint16_t(buf, 10, chan2_raw); - _mav_put_uint16_t(buf, 12, chan3_raw); - _mav_put_uint16_t(buf, 14, chan4_raw); - _mav_put_uint16_t(buf, 16, chan5_raw); - _mav_put_uint16_t(buf, 18, chan6_raw); - _mav_put_uint16_t(buf, 20, chan7_raw); - _mav_put_uint16_t(buf, 22, chan8_raw); - _mav_put_uint16_t(buf, 24, chan9_raw); - _mav_put_uint16_t(buf, 26, chan10_raw); - _mav_put_uint16_t(buf, 28, chan11_raw); - _mav_put_uint16_t(buf, 30, chan12_raw); - _mav_put_uint8_t(buf, 32, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 8, chan1_raw); + _mav_put_uint16_t(buf, 10, chan2_raw); + _mav_put_uint16_t(buf, 12, chan3_raw); + _mav_put_uint16_t(buf, 14, chan4_raw); + _mav_put_uint16_t(buf, 16, chan5_raw); + _mav_put_uint16_t(buf, 18, chan6_raw); + _mav_put_uint16_t(buf, 20, chan7_raw); + _mav_put_uint16_t(buf, 22, chan8_raw); + _mav_put_uint16_t(buf, 24, chan9_raw); + _mav_put_uint16_t(buf, 26, chan10_raw); + _mav_put_uint16_t(buf, 28, chan11_raw); + _mav_put_uint16_t(buf, 30, chan12_raw); + _mav_put_uint8_t(buf, 32, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); -#endif -#else - mavlink_hil_rc_inputs_raw_t *packet = (mavlink_hil_rc_inputs_raw_t *)msgbuf; - packet->time_usec = time_usec; - packet->chan1_raw = chan1_raw; - packet->chan2_raw = chan2_raw; - packet->chan3_raw = chan3_raw; - packet->chan4_raw = chan4_raw; - packet->chan5_raw = chan5_raw; - packet->chan6_raw = chan6_raw; - packet->chan7_raw = chan7_raw; - packet->chan8_raw = chan8_raw; - packet->chan9_raw = chan9_raw; - packet->chan10_raw = chan10_raw; - packet->chan11_raw = chan11_raw; - packet->chan12_raw = chan12_raw; - packet->rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); -#endif + mavlink_hil_rc_inputs_raw_t *packet = (mavlink_hil_rc_inputs_raw_t *)msgbuf; + packet->time_usec = time_usec; + packet->chan1_raw = chan1_raw; + packet->chan2_raw = chan2_raw; + packet->chan3_raw = chan3_raw; + packet->chan4_raw = chan4_raw; + packet->chan5_raw = chan5_raw; + packet->chan6_raw = chan6_raw; + packet->chan7_raw = chan7_raw; + packet->chan8_raw = chan8_raw; + packet->chan9_raw = chan9_raw; + packet->chan10_raw = chan10_raw; + packet->chan11_raw = chan11_raw; + packet->chan12_raw = chan12_raw; + packet->rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC); #endif } #endif @@ -359,7 +374,7 @@ static inline void mavlink_msg_hil_rc_inputs_raw_send_buf(mavlink_message_t *msg */ static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -369,7 +384,7 @@ static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -379,7 +394,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 10); + return _MAV_RETURN_uint16_t(msg, 10); } /** @@ -389,7 +404,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 12); + return _MAV_RETURN_uint16_t(msg, 12); } /** @@ -399,7 +414,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 14); + return _MAV_RETURN_uint16_t(msg, 14); } /** @@ -409,7 +424,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 16); + return _MAV_RETURN_uint16_t(msg, 16); } /** @@ -419,7 +434,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -429,7 +444,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 20); + return _MAV_RETURN_uint16_t(msg, 20); } /** @@ -439,7 +454,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 22); + return _MAV_RETURN_uint16_t(msg, 22); } /** @@ -449,7 +464,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -459,7 +474,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 26); + return _MAV_RETURN_uint16_t(msg, 26); } /** @@ -469,7 +484,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlin */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -479,7 +494,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlin */ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 30); + return _MAV_RETURN_uint16_t(msg, 30); } /** @@ -489,7 +504,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlin */ static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -500,22 +515,24 @@ static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_messa */ static inline void mavlink_msg_hil_rc_inputs_raw_decode(const mavlink_message_t* msg, mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw) { -#if MAVLINK_NEED_BYTE_SWAP - hil_rc_inputs_raw->time_usec = mavlink_msg_hil_rc_inputs_raw_get_time_usec(msg); - hil_rc_inputs_raw->chan1_raw = mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(msg); - hil_rc_inputs_raw->chan2_raw = mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(msg); - hil_rc_inputs_raw->chan3_raw = mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(msg); - hil_rc_inputs_raw->chan4_raw = mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(msg); - hil_rc_inputs_raw->chan5_raw = mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(msg); - hil_rc_inputs_raw->chan6_raw = mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(msg); - hil_rc_inputs_raw->chan7_raw = mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(msg); - hil_rc_inputs_raw->chan8_raw = mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(msg); - hil_rc_inputs_raw->chan9_raw = mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(msg); - hil_rc_inputs_raw->chan10_raw = mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(msg); - hil_rc_inputs_raw->chan11_raw = mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(msg); - hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg); - hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + hil_rc_inputs_raw->time_usec = mavlink_msg_hil_rc_inputs_raw_get_time_usec(msg); + hil_rc_inputs_raw->chan1_raw = mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(msg); + hil_rc_inputs_raw->chan2_raw = mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(msg); + hil_rc_inputs_raw->chan3_raw = mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(msg); + hil_rc_inputs_raw->chan4_raw = mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(msg); + hil_rc_inputs_raw->chan5_raw = mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(msg); + hil_rc_inputs_raw->chan6_raw = mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(msg); + hil_rc_inputs_raw->chan7_raw = mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(msg); + hil_rc_inputs_raw->chan8_raw = mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(msg); + hil_rc_inputs_raw->chan9_raw = mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(msg); + hil_rc_inputs_raw->chan10_raw = mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(msg); + hil_rc_inputs_raw->chan11_raw = mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(msg); + hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg); + hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg); #else - memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN? msg->len : MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN; + memset(hil_rc_inputs_raw, 0, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN); + memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_sensor.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_sensor.h index d037605..abc3a5f 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_sensor.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_sensor.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIL_SENSOR PACKING #define MAVLINK_MSG_ID_HIL_SENSOR 107 -typedef struct __mavlink_hil_sensor_t -{ +MAVPACKED( +typedef struct __mavlink_hil_sensor_t { uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ float xacc; /*< X acceleration (m/s^2)*/ float yacc; /*< Y acceleration (m/s^2)*/ @@ -19,20 +20,24 @@ typedef struct __mavlink_hil_sensor_t float pressure_alt; /*< Altitude calculated from pressure*/ float temperature; /*< Temperature in degrees celsius*/ uint32_t fields_updated; /*< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim.*/ -} mavlink_hil_sensor_t; +}) mavlink_hil_sensor_t; #define MAVLINK_MSG_ID_HIL_SENSOR_LEN 64 +#define MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN 64 #define MAVLINK_MSG_ID_107_LEN 64 +#define MAVLINK_MSG_ID_107_MIN_LEN 64 #define MAVLINK_MSG_ID_HIL_SENSOR_CRC 108 #define MAVLINK_MSG_ID_107_CRC 108 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIL_SENSOR { \ - "HIL_SENSOR", \ - 15, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_sensor_t, time_usec) }, \ + 107, \ + "HIL_SENSOR", \ + 15, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_sensor_t, time_usec) }, \ { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_sensor_t, xacc) }, \ { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_sensor_t, yacc) }, \ { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_sensor_t, zacc) }, \ @@ -49,7 +54,28 @@ typedef struct __mavlink_hil_sensor_t { "fields_updated", NULL, MAVLINK_TYPE_UINT32_T, 0, 60, offsetof(mavlink_hil_sensor_t, fields_updated) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIL_SENSOR { \ + "HIL_SENSOR", \ + 15, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_sensor_t, time_usec) }, \ + { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_sensor_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_sensor_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_sensor_t, zacc) }, \ + { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_sensor_t, xgyro) }, \ + { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_sensor_t, ygyro) }, \ + { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_sensor_t, zgyro) }, \ + { "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_sensor_t, xmag) }, \ + { "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_hil_sensor_t, ymag) }, \ + { "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_hil_sensor_t, zmag) }, \ + { "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_hil_sensor_t, abs_pressure) }, \ + { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_hil_sensor_t, diff_pressure) }, \ + { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_hil_sensor_t, pressure_alt) }, \ + { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_hil_sensor_t, temperature) }, \ + { "fields_updated", NULL, MAVLINK_TYPE_UINT32_T, 0, 60, offsetof(mavlink_hil_sensor_t, fields_updated) }, \ + } \ +} +#endif /** * @brief Pack a hil_sensor message @@ -75,54 +101,50 @@ typedef struct __mavlink_hil_sensor_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated) + uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint32_t(buf, 60, fields_updated); + char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint32_t(buf, 60, fields_updated); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN); #else - mavlink_hil_sensor_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - packet.abs_pressure = abs_pressure; - packet.diff_pressure = diff_pressure; - packet.pressure_alt = pressure_alt; - packet.temperature = temperature; - packet.fields_updated = fields_updated; + mavlink_hil_sensor_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + packet.abs_pressure = abs_pressure; + packet.diff_pressure = diff_pressure; + packet.pressure_alt = pressure_alt; + packet.temperature = temperature; + packet.fields_updated = fields_updated; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_SENSOR_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); } /** @@ -149,55 +171,51 @@ static inline uint16_t mavlink_msg_hil_sensor_pack(uint8_t system_id, uint8_t co * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint32_t fields_updated) + mavlink_message_t* msg, + uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint32_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint32_t(buf, 60, fields_updated); + char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint32_t(buf, 60, fields_updated); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN); #else - mavlink_hil_sensor_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - packet.abs_pressure = abs_pressure; - packet.diff_pressure = diff_pressure; - packet.pressure_alt = pressure_alt; - packet.temperature = temperature; - packet.fields_updated = fields_updated; + mavlink_hil_sensor_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + packet.abs_pressure = abs_pressure; + packet.diff_pressure = diff_pressure; + packet.pressure_alt = pressure_alt; + packet.temperature = temperature; + packet.fields_updated = fields_updated; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_SENSOR_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_SENSOR; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); } /** @@ -210,7 +228,7 @@ static inline uint16_t mavlink_msg_hil_sensor_pack_chan(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_hil_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_sensor_t* hil_sensor) { - return mavlink_msg_hil_sensor_pack(system_id, component_id, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated); + return mavlink_msg_hil_sensor_pack(system_id, component_id, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated); } /** @@ -224,7 +242,7 @@ static inline uint16_t mavlink_msg_hil_sensor_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_hil_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_sensor_t* hil_sensor) { - return mavlink_msg_hil_sensor_pack_chan(system_id, component_id, chan, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated); + return mavlink_msg_hil_sensor_pack_chan(system_id, component_id, chan, msg, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated); } /** @@ -252,51 +270,57 @@ static inline uint16_t mavlink_msg_hil_sensor_encode_chan(uint8_t system_id, uin static inline void mavlink_msg_hil_sensor_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint32_t(buf, 60, fields_updated); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); + char buf[MAVLINK_MSG_ID_HIL_SENSOR_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint32_t(buf, 60, fields_updated); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN); + mavlink_hil_sensor_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + packet.abs_pressure = abs_pressure; + packet.diff_pressure = diff_pressure; + packet.pressure_alt = pressure_alt; + packet.temperature = temperature; + packet.fields_updated = fields_updated; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); #endif +} + +/** + * @brief Send a hil_sensor message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_hil_sensor_send_struct(mavlink_channel_t chan, const mavlink_hil_sensor_t* hil_sensor) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_hil_sensor_send(chan, hil_sensor->time_usec, hil_sensor->xacc, hil_sensor->yacc, hil_sensor->zacc, hil_sensor->xgyro, hil_sensor->ygyro, hil_sensor->zgyro, hil_sensor->xmag, hil_sensor->ymag, hil_sensor->zmag, hil_sensor->abs_pressure, hil_sensor->diff_pressure, hil_sensor->pressure_alt, hil_sensor->temperature, hil_sensor->fields_updated); #else - mavlink_hil_sensor_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - packet.abs_pressure = abs_pressure; - packet.diff_pressure = diff_pressure; - packet.pressure_alt = pressure_alt; - packet.temperature = temperature; - packet.fields_updated = fields_updated; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)hil_sensor, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); #endif } @@ -311,51 +335,43 @@ static inline void mavlink_msg_hil_sensor_send(mavlink_channel_t chan, uint64_t static inline void mavlink_msg_hil_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint32_t fields_updated) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, xacc); - _mav_put_float(buf, 12, yacc); - _mav_put_float(buf, 16, zacc); - _mav_put_float(buf, 20, xgyro); - _mav_put_float(buf, 24, ygyro); - _mav_put_float(buf, 28, zgyro); - _mav_put_float(buf, 32, xmag); - _mav_put_float(buf, 36, ymag); - _mav_put_float(buf, 40, zmag); - _mav_put_float(buf, 44, abs_pressure); - _mav_put_float(buf, 48, diff_pressure); - _mav_put_float(buf, 52, pressure_alt); - _mav_put_float(buf, 56, temperature); - _mav_put_uint32_t(buf, 60, fields_updated); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, xacc); + _mav_put_float(buf, 12, yacc); + _mav_put_float(buf, 16, zacc); + _mav_put_float(buf, 20, xgyro); + _mav_put_float(buf, 24, ygyro); + _mav_put_float(buf, 28, zgyro); + _mav_put_float(buf, 32, xmag); + _mav_put_float(buf, 36, ymag); + _mav_put_float(buf, 40, zmag); + _mav_put_float(buf, 44, abs_pressure); + _mav_put_float(buf, 48, diff_pressure); + _mav_put_float(buf, 52, pressure_alt); + _mav_put_float(buf, 56, temperature); + _mav_put_uint32_t(buf, 60, fields_updated); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, buf, MAVLINK_MSG_ID_HIL_SENSOR_LEN); -#endif -#else - mavlink_hil_sensor_t *packet = (mavlink_hil_sensor_t *)msgbuf; - packet->time_usec = time_usec; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - packet->xgyro = xgyro; - packet->ygyro = ygyro; - packet->zgyro = zgyro; - packet->xmag = xmag; - packet->ymag = ymag; - packet->zmag = zmag; - packet->abs_pressure = abs_pressure; - packet->diff_pressure = diff_pressure; - packet->pressure_alt = pressure_alt; - packet->temperature = temperature; - packet->fields_updated = fields_updated; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)packet, MAVLINK_MSG_ID_HIL_SENSOR_LEN); -#endif + mavlink_hil_sensor_t *packet = (mavlink_hil_sensor_t *)msgbuf; + packet->time_usec = time_usec; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + packet->xgyro = xgyro; + packet->ygyro = ygyro; + packet->zgyro = zgyro; + packet->xmag = xmag; + packet->ymag = ymag; + packet->zmag = zmag; + packet->abs_pressure = abs_pressure; + packet->diff_pressure = diff_pressure; + packet->pressure_alt = pressure_alt; + packet->temperature = temperature; + packet->fields_updated = fields_updated; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_SENSOR, (const char *)packet, MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN, MAVLINK_MSG_ID_HIL_SENSOR_LEN, MAVLINK_MSG_ID_HIL_SENSOR_CRC); #endif } #endif @@ -372,7 +388,7 @@ static inline void mavlink_msg_hil_sensor_send_buf(mavlink_message_t *msgbuf, ma */ static inline uint64_t mavlink_msg_hil_sensor_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -382,7 +398,7 @@ static inline uint64_t mavlink_msg_hil_sensor_get_time_usec(const mavlink_messag */ static inline float mavlink_msg_hil_sensor_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -392,7 +408,7 @@ static inline float mavlink_msg_hil_sensor_get_xacc(const mavlink_message_t* msg */ static inline float mavlink_msg_hil_sensor_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -402,7 +418,7 @@ static inline float mavlink_msg_hil_sensor_get_yacc(const mavlink_message_t* msg */ static inline float mavlink_msg_hil_sensor_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -412,7 +428,7 @@ static inline float mavlink_msg_hil_sensor_get_zacc(const mavlink_message_t* msg */ static inline float mavlink_msg_hil_sensor_get_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -422,7 +438,7 @@ static inline float mavlink_msg_hil_sensor_get_xgyro(const mavlink_message_t* ms */ static inline float mavlink_msg_hil_sensor_get_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -432,7 +448,7 @@ static inline float mavlink_msg_hil_sensor_get_ygyro(const mavlink_message_t* ms */ static inline float mavlink_msg_hil_sensor_get_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -442,7 +458,7 @@ static inline float mavlink_msg_hil_sensor_get_zgyro(const mavlink_message_t* ms */ static inline float mavlink_msg_hil_sensor_get_xmag(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -452,7 +468,7 @@ static inline float mavlink_msg_hil_sensor_get_xmag(const mavlink_message_t* msg */ static inline float mavlink_msg_hil_sensor_get_ymag(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -462,7 +478,7 @@ static inline float mavlink_msg_hil_sensor_get_ymag(const mavlink_message_t* msg */ static inline float mavlink_msg_hil_sensor_get_zmag(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -472,7 +488,7 @@ static inline float mavlink_msg_hil_sensor_get_zmag(const mavlink_message_t* msg */ static inline float mavlink_msg_hil_sensor_get_abs_pressure(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -482,7 +498,7 @@ static inline float mavlink_msg_hil_sensor_get_abs_pressure(const mavlink_messag */ static inline float mavlink_msg_hil_sensor_get_diff_pressure(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 48); + return _MAV_RETURN_float(msg, 48); } /** @@ -492,7 +508,7 @@ static inline float mavlink_msg_hil_sensor_get_diff_pressure(const mavlink_messa */ static inline float mavlink_msg_hil_sensor_get_pressure_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 52); + return _MAV_RETURN_float(msg, 52); } /** @@ -502,7 +518,7 @@ static inline float mavlink_msg_hil_sensor_get_pressure_alt(const mavlink_messag */ static inline float mavlink_msg_hil_sensor_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 56); + return _MAV_RETURN_float(msg, 56); } /** @@ -512,7 +528,7 @@ static inline float mavlink_msg_hil_sensor_get_temperature(const mavlink_message */ static inline uint32_t mavlink_msg_hil_sensor_get_fields_updated(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 60); + return _MAV_RETURN_uint32_t(msg, 60); } /** @@ -523,23 +539,25 @@ static inline uint32_t mavlink_msg_hil_sensor_get_fields_updated(const mavlink_m */ static inline void mavlink_msg_hil_sensor_decode(const mavlink_message_t* msg, mavlink_hil_sensor_t* hil_sensor) { -#if MAVLINK_NEED_BYTE_SWAP - hil_sensor->time_usec = mavlink_msg_hil_sensor_get_time_usec(msg); - hil_sensor->xacc = mavlink_msg_hil_sensor_get_xacc(msg); - hil_sensor->yacc = mavlink_msg_hil_sensor_get_yacc(msg); - hil_sensor->zacc = mavlink_msg_hil_sensor_get_zacc(msg); - hil_sensor->xgyro = mavlink_msg_hil_sensor_get_xgyro(msg); - hil_sensor->ygyro = mavlink_msg_hil_sensor_get_ygyro(msg); - hil_sensor->zgyro = mavlink_msg_hil_sensor_get_zgyro(msg); - hil_sensor->xmag = mavlink_msg_hil_sensor_get_xmag(msg); - hil_sensor->ymag = mavlink_msg_hil_sensor_get_ymag(msg); - hil_sensor->zmag = mavlink_msg_hil_sensor_get_zmag(msg); - hil_sensor->abs_pressure = mavlink_msg_hil_sensor_get_abs_pressure(msg); - hil_sensor->diff_pressure = mavlink_msg_hil_sensor_get_diff_pressure(msg); - hil_sensor->pressure_alt = mavlink_msg_hil_sensor_get_pressure_alt(msg); - hil_sensor->temperature = mavlink_msg_hil_sensor_get_temperature(msg); - hil_sensor->fields_updated = mavlink_msg_hil_sensor_get_fields_updated(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + hil_sensor->time_usec = mavlink_msg_hil_sensor_get_time_usec(msg); + hil_sensor->xacc = mavlink_msg_hil_sensor_get_xacc(msg); + hil_sensor->yacc = mavlink_msg_hil_sensor_get_yacc(msg); + hil_sensor->zacc = mavlink_msg_hil_sensor_get_zacc(msg); + hil_sensor->xgyro = mavlink_msg_hil_sensor_get_xgyro(msg); + hil_sensor->ygyro = mavlink_msg_hil_sensor_get_ygyro(msg); + hil_sensor->zgyro = mavlink_msg_hil_sensor_get_zgyro(msg); + hil_sensor->xmag = mavlink_msg_hil_sensor_get_xmag(msg); + hil_sensor->ymag = mavlink_msg_hil_sensor_get_ymag(msg); + hil_sensor->zmag = mavlink_msg_hil_sensor_get_zmag(msg); + hil_sensor->abs_pressure = mavlink_msg_hil_sensor_get_abs_pressure(msg); + hil_sensor->diff_pressure = mavlink_msg_hil_sensor_get_diff_pressure(msg); + hil_sensor->pressure_alt = mavlink_msg_hil_sensor_get_pressure_alt(msg); + hil_sensor->temperature = mavlink_msg_hil_sensor_get_temperature(msg); + hil_sensor->fields_updated = mavlink_msg_hil_sensor_get_fields_updated(msg); #else - memcpy(hil_sensor, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_SENSOR_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_HIL_SENSOR_LEN; + memset(hil_sensor, 0, MAVLINK_MSG_ID_HIL_SENSOR_LEN); + memcpy(hil_sensor, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state.h index 15e3c04..e2590a7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIL_STATE PACKING #define MAVLINK_MSG_ID_HIL_STATE 90 -typedef struct __mavlink_hil_state_t -{ +MAVPACKED( +typedef struct __mavlink_hil_state_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ float roll; /*< Roll angle (rad)*/ float pitch; /*< Pitch angle (rad)*/ @@ -20,20 +21,24 @@ typedef struct __mavlink_hil_state_t int16_t xacc; /*< X acceleration (mg)*/ int16_t yacc; /*< Y acceleration (mg)*/ int16_t zacc; /*< Z acceleration (mg)*/ -} mavlink_hil_state_t; +}) mavlink_hil_state_t; #define MAVLINK_MSG_ID_HIL_STATE_LEN 56 +#define MAVLINK_MSG_ID_HIL_STATE_MIN_LEN 56 #define MAVLINK_MSG_ID_90_LEN 56 +#define MAVLINK_MSG_ID_90_MIN_LEN 56 #define MAVLINK_MSG_ID_HIL_STATE_CRC 183 #define MAVLINK_MSG_ID_90_CRC 183 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIL_STATE { \ - "HIL_STATE", \ - 16, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \ + 90, \ + "HIL_STATE", \ + 16, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \ { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \ @@ -51,7 +56,29 @@ typedef struct __mavlink_hil_state_t { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIL_STATE { \ + "HIL_STATE", \ + 16, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_t, time_usec) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_hil_state_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_hil_state_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_hil_state_t, yaw) }, \ + { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_hil_state_t, rollspeed) }, \ + { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_t, pitchspeed) }, \ + { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_t, yawspeed) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_hil_state_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_t, alt) }, \ + { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_hil_state_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_hil_state_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_t, vz) }, \ + { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 54, offsetof(mavlink_hil_state_t, zacc) }, \ + } \ +} +#endif /** * @brief Pack a hil_state message @@ -78,56 +105,52 @@ typedef struct __mavlink_hil_state_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) + uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_int32_t(buf, 32, lat); - _mav_put_int32_t(buf, 36, lon); - _mav_put_int32_t(buf, 40, alt); - _mav_put_int16_t(buf, 44, vx); - _mav_put_int16_t(buf, 46, vy); - _mav_put_int16_t(buf, 48, vz); - _mav_put_int16_t(buf, 50, xacc); - _mav_put_int16_t(buf, 52, yacc); - _mav_put_int16_t(buf, 54, zacc); + char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll); + _mav_put_float(buf, 12, pitch); + _mav_put_float(buf, 16, yaw); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_int32_t(buf, 32, lat); + _mav_put_int32_t(buf, 36, lon); + _mav_put_int32_t(buf, 40, alt); + _mav_put_int16_t(buf, 44, vx); + _mav_put_int16_t(buf, 46, vy); + _mav_put_int16_t(buf, 48, vz); + _mav_put_int16_t(buf, 50, xacc); + _mav_put_int16_t(buf, 52, yacc); + _mav_put_int16_t(buf, 54, zacc); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN); #else - mavlink_hil_state_t packet; - packet.time_usec = time_usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; + mavlink_hil_state_t packet; + packet.time_usec = time_usec; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_STATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); } /** @@ -155,57 +178,53 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,int16_t xacc,int16_t yacc,int16_t zacc) + mavlink_message_t* msg, + uint64_t time_usec,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,int16_t xacc,int16_t yacc,int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_int32_t(buf, 32, lat); - _mav_put_int32_t(buf, 36, lon); - _mav_put_int32_t(buf, 40, alt); - _mav_put_int16_t(buf, 44, vx); - _mav_put_int16_t(buf, 46, vy); - _mav_put_int16_t(buf, 48, vz); - _mav_put_int16_t(buf, 50, xacc); - _mav_put_int16_t(buf, 52, yacc); - _mav_put_int16_t(buf, 54, zacc); + char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll); + _mav_put_float(buf, 12, pitch); + _mav_put_float(buf, 16, yaw); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_int32_t(buf, 32, lat); + _mav_put_int32_t(buf, 36, lon); + _mav_put_int32_t(buf, 40, alt); + _mav_put_int16_t(buf, 44, vx); + _mav_put_int16_t(buf, 46, vy); + _mav_put_int16_t(buf, 48, vz); + _mav_put_int16_t(buf, 50, xacc); + _mav_put_int16_t(buf, 52, yacc); + _mav_put_int16_t(buf, 54, zacc); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_LEN); #else - mavlink_hil_state_t packet; - packet.time_usec = time_usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; + mavlink_hil_state_t packet; + packet.time_usec = time_usec; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_STATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); } /** @@ -218,7 +237,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_hil_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state) { - return mavlink_msg_hil_state_pack(system_id, component_id, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc); + return mavlink_msg_hil_state_pack(system_id, component_id, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc); } /** @@ -232,7 +251,7 @@ static inline uint16_t mavlink_msg_hil_state_encode(uint8_t system_id, uint8_t c */ static inline uint16_t mavlink_msg_hil_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_state_t* hil_state) { - return mavlink_msg_hil_state_pack_chan(system_id, component_id, chan, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc); + return mavlink_msg_hil_state_pack_chan(system_id, component_id, chan, msg, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc); } /** @@ -261,53 +280,59 @@ static inline uint16_t mavlink_msg_hil_state_encode_chan(uint8_t system_id, uint static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_int32_t(buf, 32, lat); - _mav_put_int32_t(buf, 36, lon); - _mav_put_int32_t(buf, 40, alt); - _mav_put_int16_t(buf, 44, vx); - _mav_put_int16_t(buf, 46, vy); - _mav_put_int16_t(buf, 48, vz); - _mav_put_int16_t(buf, 50, xacc); - _mav_put_int16_t(buf, 52, yacc); - _mav_put_int16_t(buf, 54, zacc); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); + char buf[MAVLINK_MSG_ID_HIL_STATE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll); + _mav_put_float(buf, 12, pitch); + _mav_put_float(buf, 16, yaw); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_int32_t(buf, 32, lat); + _mav_put_int32_t(buf, 36, lon); + _mav_put_int32_t(buf, 40, alt); + _mav_put_int16_t(buf, 44, vx); + _mav_put_int16_t(buf, 46, vy); + _mav_put_int16_t(buf, 48, vz); + _mav_put_int16_t(buf, 50, xacc); + _mav_put_int16_t(buf, 52, yacc); + _mav_put_int16_t(buf, 54, zacc); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN); + mavlink_hil_state_t packet; + packet.time_usec = time_usec; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); #endif +} + +/** + * @brief Send a hil_state message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_hil_state_send_struct(mavlink_channel_t chan, const mavlink_hil_state_t* hil_state) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_hil_state_send(chan, hil_state->time_usec, hil_state->roll, hil_state->pitch, hil_state->yaw, hil_state->rollspeed, hil_state->pitchspeed, hil_state->yawspeed, hil_state->lat, hil_state->lon, hil_state->alt, hil_state->vx, hil_state->vy, hil_state->vz, hil_state->xacc, hil_state->yacc, hil_state->zacc); #else - mavlink_hil_state_t packet; - packet.time_usec = time_usec; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)hil_state, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); #endif } @@ -322,53 +347,45 @@ static inline void mavlink_msg_hil_state_send(mavlink_channel_t chan, uint64_t t static inline void mavlink_msg_hil_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, roll); - _mav_put_float(buf, 12, pitch); - _mav_put_float(buf, 16, yaw); - _mav_put_float(buf, 20, rollspeed); - _mav_put_float(buf, 24, pitchspeed); - _mav_put_float(buf, 28, yawspeed); - _mav_put_int32_t(buf, 32, lat); - _mav_put_int32_t(buf, 36, lon); - _mav_put_int32_t(buf, 40, alt); - _mav_put_int16_t(buf, 44, vx); - _mav_put_int16_t(buf, 46, vy); - _mav_put_int16_t(buf, 48, vz); - _mav_put_int16_t(buf, 50, xacc); - _mav_put_int16_t(buf, 52, yacc); - _mav_put_int16_t(buf, 54, zacc); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, roll); + _mav_put_float(buf, 12, pitch); + _mav_put_float(buf, 16, yaw); + _mav_put_float(buf, 20, rollspeed); + _mav_put_float(buf, 24, pitchspeed); + _mav_put_float(buf, 28, yawspeed); + _mav_put_int32_t(buf, 32, lat); + _mav_put_int32_t(buf, 36, lon); + _mav_put_int32_t(buf, 40, alt); + _mav_put_int16_t(buf, 44, vx); + _mav_put_int16_t(buf, 46, vy); + _mav_put_int16_t(buf, 48, vz); + _mav_put_int16_t(buf, 50, xacc); + _mav_put_int16_t(buf, 52, yacc); + _mav_put_int16_t(buf, 54, zacc); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, buf, MAVLINK_MSG_ID_HIL_STATE_LEN); -#endif -#else - mavlink_hil_state_t *packet = (mavlink_hil_state_t *)msgbuf; - packet->time_usec = time_usec; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - packet->rollspeed = rollspeed; - packet->pitchspeed = pitchspeed; - packet->yawspeed = yawspeed; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_LEN); -#endif + mavlink_hil_state_t *packet = (mavlink_hil_state_t *)msgbuf; + packet->time_usec = time_usec; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + packet->rollspeed = rollspeed; + packet->pitchspeed = pitchspeed; + packet->yawspeed = yawspeed; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_LEN, MAVLINK_MSG_ID_HIL_STATE_CRC); #endif } #endif @@ -385,7 +402,7 @@ static inline void mavlink_msg_hil_state_send_buf(mavlink_message_t *msgbuf, mav */ static inline uint64_t mavlink_msg_hil_state_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -395,7 +412,7 @@ static inline uint64_t mavlink_msg_hil_state_get_time_usec(const mavlink_message */ static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -405,7 +422,7 @@ static inline float mavlink_msg_hil_state_get_roll(const mavlink_message_t* msg) */ static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -415,7 +432,7 @@ static inline float mavlink_msg_hil_state_get_pitch(const mavlink_message_t* msg */ static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -425,7 +442,7 @@ static inline float mavlink_msg_hil_state_get_yaw(const mavlink_message_t* msg) */ static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -435,7 +452,7 @@ static inline float mavlink_msg_hil_state_get_rollspeed(const mavlink_message_t* */ static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -445,7 +462,7 @@ static inline float mavlink_msg_hil_state_get_pitchspeed(const mavlink_message_t */ static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -455,7 +472,7 @@ static inline float mavlink_msg_hil_state_get_yawspeed(const mavlink_message_t* */ static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 32); + return _MAV_RETURN_int32_t(msg, 32); } /** @@ -465,7 +482,7 @@ static inline int32_t mavlink_msg_hil_state_get_lat(const mavlink_message_t* msg */ static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 36); + return _MAV_RETURN_int32_t(msg, 36); } /** @@ -475,7 +492,7 @@ static inline int32_t mavlink_msg_hil_state_get_lon(const mavlink_message_t* msg */ static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 40); + return _MAV_RETURN_int32_t(msg, 40); } /** @@ -485,7 +502,7 @@ static inline int32_t mavlink_msg_hil_state_get_alt(const mavlink_message_t* msg */ static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 44); + return _MAV_RETURN_int16_t(msg, 44); } /** @@ -495,7 +512,7 @@ static inline int16_t mavlink_msg_hil_state_get_vx(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 46); + return _MAV_RETURN_int16_t(msg, 46); } /** @@ -505,7 +522,7 @@ static inline int16_t mavlink_msg_hil_state_get_vy(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 48); + return _MAV_RETURN_int16_t(msg, 48); } /** @@ -515,7 +532,7 @@ static inline int16_t mavlink_msg_hil_state_get_vz(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 50); + return _MAV_RETURN_int16_t(msg, 50); } /** @@ -525,7 +542,7 @@ static inline int16_t mavlink_msg_hil_state_get_xacc(const mavlink_message_t* ms */ static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 52); + return _MAV_RETURN_int16_t(msg, 52); } /** @@ -535,7 +552,7 @@ static inline int16_t mavlink_msg_hil_state_get_yacc(const mavlink_message_t* ms */ static inline int16_t mavlink_msg_hil_state_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 54); + return _MAV_RETURN_int16_t(msg, 54); } /** @@ -546,24 +563,26 @@ static inline int16_t mavlink_msg_hil_state_get_zacc(const mavlink_message_t* ms */ static inline void mavlink_msg_hil_state_decode(const mavlink_message_t* msg, mavlink_hil_state_t* hil_state) { -#if MAVLINK_NEED_BYTE_SWAP - hil_state->time_usec = mavlink_msg_hil_state_get_time_usec(msg); - hil_state->roll = mavlink_msg_hil_state_get_roll(msg); - hil_state->pitch = mavlink_msg_hil_state_get_pitch(msg); - hil_state->yaw = mavlink_msg_hil_state_get_yaw(msg); - hil_state->rollspeed = mavlink_msg_hil_state_get_rollspeed(msg); - hil_state->pitchspeed = mavlink_msg_hil_state_get_pitchspeed(msg); - hil_state->yawspeed = mavlink_msg_hil_state_get_yawspeed(msg); - hil_state->lat = mavlink_msg_hil_state_get_lat(msg); - hil_state->lon = mavlink_msg_hil_state_get_lon(msg); - hil_state->alt = mavlink_msg_hil_state_get_alt(msg); - hil_state->vx = mavlink_msg_hil_state_get_vx(msg); - hil_state->vy = mavlink_msg_hil_state_get_vy(msg); - hil_state->vz = mavlink_msg_hil_state_get_vz(msg); - hil_state->xacc = mavlink_msg_hil_state_get_xacc(msg); - hil_state->yacc = mavlink_msg_hil_state_get_yacc(msg); - hil_state->zacc = mavlink_msg_hil_state_get_zacc(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + hil_state->time_usec = mavlink_msg_hil_state_get_time_usec(msg); + hil_state->roll = mavlink_msg_hil_state_get_roll(msg); + hil_state->pitch = mavlink_msg_hil_state_get_pitch(msg); + hil_state->yaw = mavlink_msg_hil_state_get_yaw(msg); + hil_state->rollspeed = mavlink_msg_hil_state_get_rollspeed(msg); + hil_state->pitchspeed = mavlink_msg_hil_state_get_pitchspeed(msg); + hil_state->yawspeed = mavlink_msg_hil_state_get_yawspeed(msg); + hil_state->lat = mavlink_msg_hil_state_get_lat(msg); + hil_state->lon = mavlink_msg_hil_state_get_lon(msg); + hil_state->alt = mavlink_msg_hil_state_get_alt(msg); + hil_state->vx = mavlink_msg_hil_state_get_vx(msg); + hil_state->vy = mavlink_msg_hil_state_get_vy(msg); + hil_state->vz = mavlink_msg_hil_state_get_vz(msg); + hil_state->xacc = mavlink_msg_hil_state_get_xacc(msg); + hil_state->yacc = mavlink_msg_hil_state_get_yacc(msg); + hil_state->zacc = mavlink_msg_hil_state_get_zacc(msg); #else - memcpy(hil_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_STATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_STATE_LEN? msg->len : MAVLINK_MSG_ID_HIL_STATE_LEN; + memset(hil_state, 0, MAVLINK_MSG_ID_HIL_STATE_LEN); + memcpy(hil_state, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state_quaternion.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state_quaternion.h index 6cabc38..a7488b6 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state_quaternion.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_hil_state_quaternion.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HIL_STATE_QUATERNION PACKING #define MAVLINK_MSG_ID_HIL_STATE_QUATERNION 115 -typedef struct __mavlink_hil_state_quaternion_t -{ +MAVPACKED( +typedef struct __mavlink_hil_state_quaternion_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ float attitude_quaternion[4]; /*< Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)*/ float rollspeed; /*< Body frame roll / phi angular speed (rad/s)*/ @@ -20,20 +21,24 @@ typedef struct __mavlink_hil_state_quaternion_t int16_t xacc; /*< X acceleration (mg)*/ int16_t yacc; /*< Y acceleration (mg)*/ int16_t zacc; /*< Z acceleration (mg)*/ -} mavlink_hil_state_quaternion_t; +}) mavlink_hil_state_quaternion_t; #define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN 64 +#define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN 64 #define MAVLINK_MSG_ID_115_LEN 64 +#define MAVLINK_MSG_ID_115_MIN_LEN 64 #define MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC 4 #define MAVLINK_MSG_ID_115_CRC 4 #define MAVLINK_MSG_HIL_STATE_QUATERNION_FIELD_ATTITUDE_QUATERNION_LEN 4 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION { \ - "HIL_STATE_QUATERNION", \ - 16, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_quaternion_t, time_usec) }, \ + 115, \ + "HIL_STATE_QUATERNION", \ + 16, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_quaternion_t, time_usec) }, \ { "attitude_quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_hil_state_quaternion_t, attitude_quaternion) }, \ { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_quaternion_t, rollspeed) }, \ { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_quaternion_t, pitchspeed) }, \ @@ -51,7 +56,29 @@ typedef struct __mavlink_hil_state_quaternion_t { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 62, offsetof(mavlink_hil_state_quaternion_t, zacc) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION { \ + "HIL_STATE_QUATERNION", \ + 16, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_state_quaternion_t, time_usec) }, \ + { "attitude_quaternion", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_hil_state_quaternion_t, attitude_quaternion) }, \ + { "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_hil_state_quaternion_t, rollspeed) }, \ + { "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_hil_state_quaternion_t, pitchspeed) }, \ + { "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_hil_state_quaternion_t, yawspeed) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_hil_state_quaternion_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_hil_state_quaternion_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_hil_state_quaternion_t, alt) }, \ + { "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_hil_state_quaternion_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 50, offsetof(mavlink_hil_state_quaternion_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 52, offsetof(mavlink_hil_state_quaternion_t, vz) }, \ + { "ind_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 54, offsetof(mavlink_hil_state_quaternion_t, ind_airspeed) }, \ + { "true_airspeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_hil_state_quaternion_t, true_airspeed) }, \ + { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 58, offsetof(mavlink_hil_state_quaternion_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 60, offsetof(mavlink_hil_state_quaternion_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 62, offsetof(mavlink_hil_state_quaternion_t, zacc) }, \ + } \ +} +#endif /** * @brief Pack a hil_state_quaternion message @@ -78,54 +105,50 @@ typedef struct __mavlink_hil_state_quaternion_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc) + uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, rollspeed); - _mav_put_float(buf, 28, pitchspeed); - _mav_put_float(buf, 32, yawspeed); - _mav_put_int32_t(buf, 36, lat); - _mav_put_int32_t(buf, 40, lon); - _mav_put_int32_t(buf, 44, alt); - _mav_put_int16_t(buf, 48, vx); - _mav_put_int16_t(buf, 50, vy); - _mav_put_int16_t(buf, 52, vz); - _mav_put_uint16_t(buf, 54, ind_airspeed); - _mav_put_uint16_t(buf, 56, true_airspeed); - _mav_put_int16_t(buf, 58, xacc); - _mav_put_int16_t(buf, 60, yacc); - _mav_put_int16_t(buf, 62, zacc); - _mav_put_float_array(buf, 8, attitude_quaternion, 4); + char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, rollspeed); + _mav_put_float(buf, 28, pitchspeed); + _mav_put_float(buf, 32, yawspeed); + _mav_put_int32_t(buf, 36, lat); + _mav_put_int32_t(buf, 40, lon); + _mav_put_int32_t(buf, 44, alt); + _mav_put_int16_t(buf, 48, vx); + _mav_put_int16_t(buf, 50, vy); + _mav_put_int16_t(buf, 52, vz); + _mav_put_uint16_t(buf, 54, ind_airspeed); + _mav_put_uint16_t(buf, 56, true_airspeed); + _mav_put_int16_t(buf, 58, xacc); + _mav_put_int16_t(buf, 60, yacc); + _mav_put_int16_t(buf, 62, zacc); + _mav_put_float_array(buf, 8, attitude_quaternion, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); #else - mavlink_hil_state_quaternion_t packet; - packet.time_usec = time_usec; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.ind_airspeed = ind_airspeed; - packet.true_airspeed = true_airspeed; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4); + mavlink_hil_state_quaternion_t packet; + packet.time_usec = time_usec; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.ind_airspeed = ind_airspeed; + packet.true_airspeed = true_airspeed; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); } /** @@ -153,55 +176,51 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_hil_state_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,const float *attitude_quaternion,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,uint16_t ind_airspeed,uint16_t true_airspeed,int16_t xacc,int16_t yacc,int16_t zacc) + mavlink_message_t* msg, + uint64_t time_usec,const float *attitude_quaternion,float rollspeed,float pitchspeed,float yawspeed,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,uint16_t ind_airspeed,uint16_t true_airspeed,int16_t xacc,int16_t yacc,int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, rollspeed); - _mav_put_float(buf, 28, pitchspeed); - _mav_put_float(buf, 32, yawspeed); - _mav_put_int32_t(buf, 36, lat); - _mav_put_int32_t(buf, 40, lon); - _mav_put_int32_t(buf, 44, alt); - _mav_put_int16_t(buf, 48, vx); - _mav_put_int16_t(buf, 50, vy); - _mav_put_int16_t(buf, 52, vz); - _mav_put_uint16_t(buf, 54, ind_airspeed); - _mav_put_uint16_t(buf, 56, true_airspeed); - _mav_put_int16_t(buf, 58, xacc); - _mav_put_int16_t(buf, 60, yacc); - _mav_put_int16_t(buf, 62, zacc); - _mav_put_float_array(buf, 8, attitude_quaternion, 4); + char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, rollspeed); + _mav_put_float(buf, 28, pitchspeed); + _mav_put_float(buf, 32, yawspeed); + _mav_put_int32_t(buf, 36, lat); + _mav_put_int32_t(buf, 40, lon); + _mav_put_int32_t(buf, 44, alt); + _mav_put_int16_t(buf, 48, vx); + _mav_put_int16_t(buf, 50, vy); + _mav_put_int16_t(buf, 52, vz); + _mav_put_uint16_t(buf, 54, ind_airspeed); + _mav_put_uint16_t(buf, 56, true_airspeed); + _mav_put_int16_t(buf, 58, xacc); + _mav_put_int16_t(buf, 60, yacc); + _mav_put_int16_t(buf, 62, zacc); + _mav_put_float_array(buf, 8, attitude_quaternion, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); #else - mavlink_hil_state_quaternion_t packet; - packet.time_usec = time_usec; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.ind_airspeed = ind_airspeed; - packet.true_airspeed = true_airspeed; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4); + mavlink_hil_state_quaternion_t packet; + packet.time_usec = time_usec; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.ind_airspeed = ind_airspeed; + packet.true_airspeed = true_airspeed; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HIL_STATE_QUATERNION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); } /** @@ -214,7 +233,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_pack_chan(uint8_t system */ static inline uint16_t mavlink_msg_hil_state_quaternion_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_state_quaternion_t* hil_state_quaternion) { - return mavlink_msg_hil_state_quaternion_pack(system_id, component_id, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc); + return mavlink_msg_hil_state_quaternion_pack(system_id, component_id, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc); } /** @@ -228,7 +247,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_encode(uint8_t system_id */ static inline uint16_t mavlink_msg_hil_state_quaternion_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_state_quaternion_t* hil_state_quaternion) { - return mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, chan, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc); + return mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, chan, msg, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc); } /** @@ -257,51 +276,57 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_encode_chan(uint8_t syst static inline void mavlink_msg_hil_state_quaternion_send(mavlink_channel_t chan, uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, rollspeed); - _mav_put_float(buf, 28, pitchspeed); - _mav_put_float(buf, 32, yawspeed); - _mav_put_int32_t(buf, 36, lat); - _mav_put_int32_t(buf, 40, lon); - _mav_put_int32_t(buf, 44, alt); - _mav_put_int16_t(buf, 48, vx); - _mav_put_int16_t(buf, 50, vy); - _mav_put_int16_t(buf, 52, vz); - _mav_put_uint16_t(buf, 54, ind_airspeed); - _mav_put_uint16_t(buf, 56, true_airspeed); - _mav_put_int16_t(buf, 58, xacc); - _mav_put_int16_t(buf, 60, yacc); - _mav_put_int16_t(buf, 62, zacc); - _mav_put_float_array(buf, 8, attitude_quaternion, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); + char buf[MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, rollspeed); + _mav_put_float(buf, 28, pitchspeed); + _mav_put_float(buf, 32, yawspeed); + _mav_put_int32_t(buf, 36, lat); + _mav_put_int32_t(buf, 40, lon); + _mav_put_int32_t(buf, 44, alt); + _mav_put_int16_t(buf, 48, vx); + _mav_put_int16_t(buf, 50, vy); + _mav_put_int16_t(buf, 52, vz); + _mav_put_uint16_t(buf, 54, ind_airspeed); + _mav_put_uint16_t(buf, 56, true_airspeed); + _mav_put_int16_t(buf, 58, xacc); + _mav_put_int16_t(buf, 60, yacc); + _mav_put_int16_t(buf, 62, zacc); + _mav_put_float_array(buf, 8, attitude_quaternion, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); + mavlink_hil_state_quaternion_t packet; + packet.time_usec = time_usec; + packet.rollspeed = rollspeed; + packet.pitchspeed = pitchspeed; + packet.yawspeed = yawspeed; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.ind_airspeed = ind_airspeed; + packet.true_airspeed = true_airspeed; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); #endif +} + +/** + * @brief Send a hil_state_quaternion message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_hil_state_quaternion_send_struct(mavlink_channel_t chan, const mavlink_hil_state_quaternion_t* hil_state_quaternion) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_hil_state_quaternion_send(chan, hil_state_quaternion->time_usec, hil_state_quaternion->attitude_quaternion, hil_state_quaternion->rollspeed, hil_state_quaternion->pitchspeed, hil_state_quaternion->yawspeed, hil_state_quaternion->lat, hil_state_quaternion->lon, hil_state_quaternion->alt, hil_state_quaternion->vx, hil_state_quaternion->vy, hil_state_quaternion->vz, hil_state_quaternion->ind_airspeed, hil_state_quaternion->true_airspeed, hil_state_quaternion->xacc, hil_state_quaternion->yacc, hil_state_quaternion->zacc); #else - mavlink_hil_state_quaternion_t packet; - packet.time_usec = time_usec; - packet.rollspeed = rollspeed; - packet.pitchspeed = pitchspeed; - packet.yawspeed = yawspeed; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.ind_airspeed = ind_airspeed; - packet.true_airspeed = true_airspeed; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - mav_array_memcpy(packet.attitude_quaternion, attitude_quaternion, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)hil_state_quaternion, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); #endif } @@ -316,51 +341,43 @@ static inline void mavlink_msg_hil_state_quaternion_send(mavlink_channel_t chan, static inline void mavlink_msg_hil_state_quaternion_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *attitude_quaternion, float rollspeed, float pitchspeed, float yawspeed, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t ind_airspeed, uint16_t true_airspeed, int16_t xacc, int16_t yacc, int16_t zacc) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 24, rollspeed); - _mav_put_float(buf, 28, pitchspeed); - _mav_put_float(buf, 32, yawspeed); - _mav_put_int32_t(buf, 36, lat); - _mav_put_int32_t(buf, 40, lon); - _mav_put_int32_t(buf, 44, alt); - _mav_put_int16_t(buf, 48, vx); - _mav_put_int16_t(buf, 50, vy); - _mav_put_int16_t(buf, 52, vz); - _mav_put_uint16_t(buf, 54, ind_airspeed); - _mav_put_uint16_t(buf, 56, true_airspeed); - _mav_put_int16_t(buf, 58, xacc); - _mav_put_int16_t(buf, 60, yacc); - _mav_put_int16_t(buf, 62, zacc); - _mav_put_float_array(buf, 8, attitude_quaternion, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 24, rollspeed); + _mav_put_float(buf, 28, pitchspeed); + _mav_put_float(buf, 32, yawspeed); + _mav_put_int32_t(buf, 36, lat); + _mav_put_int32_t(buf, 40, lon); + _mav_put_int32_t(buf, 44, alt); + _mav_put_int16_t(buf, 48, vx); + _mav_put_int16_t(buf, 50, vy); + _mav_put_int16_t(buf, 52, vz); + _mav_put_uint16_t(buf, 54, ind_airspeed); + _mav_put_uint16_t(buf, 56, true_airspeed); + _mav_put_int16_t(buf, 58, xacc); + _mav_put_int16_t(buf, 60, yacc); + _mav_put_int16_t(buf, 62, zacc); + _mav_put_float_array(buf, 8, attitude_quaternion, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, buf, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); -#endif -#else - mavlink_hil_state_quaternion_t *packet = (mavlink_hil_state_quaternion_t *)msgbuf; - packet->time_usec = time_usec; - packet->rollspeed = rollspeed; - packet->pitchspeed = pitchspeed; - packet->yawspeed = yawspeed; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->ind_airspeed = ind_airspeed; - packet->true_airspeed = true_airspeed; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - mav_array_memcpy(packet->attitude_quaternion, attitude_quaternion, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); -#endif + mavlink_hil_state_quaternion_t *packet = (mavlink_hil_state_quaternion_t *)msgbuf; + packet->time_usec = time_usec; + packet->rollspeed = rollspeed; + packet->pitchspeed = pitchspeed; + packet->yawspeed = yawspeed; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->ind_airspeed = ind_airspeed; + packet->true_airspeed = true_airspeed; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + mav_array_memcpy(packet->attitude_quaternion, attitude_quaternion, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_STATE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_CRC); #endif } #endif @@ -377,7 +394,7 @@ static inline void mavlink_msg_hil_state_quaternion_send_buf(mavlink_message_t * */ static inline uint64_t mavlink_msg_hil_state_quaternion_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -387,7 +404,7 @@ static inline uint64_t mavlink_msg_hil_state_quaternion_get_time_usec(const mavl */ static inline uint16_t mavlink_msg_hil_state_quaternion_get_attitude_quaternion(const mavlink_message_t* msg, float *attitude_quaternion) { - return _MAV_RETURN_float_array(msg, attitude_quaternion, 4, 8); + return _MAV_RETURN_float_array(msg, attitude_quaternion, 4, 8); } /** @@ -397,7 +414,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_get_attitude_quaternion( */ static inline float mavlink_msg_hil_state_quaternion_get_rollspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -407,7 +424,7 @@ static inline float mavlink_msg_hil_state_quaternion_get_rollspeed(const mavlink */ static inline float mavlink_msg_hil_state_quaternion_get_pitchspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -417,7 +434,7 @@ static inline float mavlink_msg_hil_state_quaternion_get_pitchspeed(const mavlin */ static inline float mavlink_msg_hil_state_quaternion_get_yawspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -427,7 +444,7 @@ static inline float mavlink_msg_hil_state_quaternion_get_yawspeed(const mavlink_ */ static inline int32_t mavlink_msg_hil_state_quaternion_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 36); + return _MAV_RETURN_int32_t(msg, 36); } /** @@ -437,7 +454,7 @@ static inline int32_t mavlink_msg_hil_state_quaternion_get_lat(const mavlink_mes */ static inline int32_t mavlink_msg_hil_state_quaternion_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 40); + return _MAV_RETURN_int32_t(msg, 40); } /** @@ -447,7 +464,7 @@ static inline int32_t mavlink_msg_hil_state_quaternion_get_lon(const mavlink_mes */ static inline int32_t mavlink_msg_hil_state_quaternion_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 44); + return _MAV_RETURN_int32_t(msg, 44); } /** @@ -457,7 +474,7 @@ static inline int32_t mavlink_msg_hil_state_quaternion_get_alt(const mavlink_mes */ static inline int16_t mavlink_msg_hil_state_quaternion_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 48); + return _MAV_RETURN_int16_t(msg, 48); } /** @@ -467,7 +484,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_vx(const mavlink_mess */ static inline int16_t mavlink_msg_hil_state_quaternion_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 50); + return _MAV_RETURN_int16_t(msg, 50); } /** @@ -477,7 +494,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_vy(const mavlink_mess */ static inline int16_t mavlink_msg_hil_state_quaternion_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 52); + return _MAV_RETURN_int16_t(msg, 52); } /** @@ -487,7 +504,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_vz(const mavlink_mess */ static inline uint16_t mavlink_msg_hil_state_quaternion_get_ind_airspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 54); + return _MAV_RETURN_uint16_t(msg, 54); } /** @@ -497,7 +514,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_get_ind_airspeed(const m */ static inline uint16_t mavlink_msg_hil_state_quaternion_get_true_airspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 56); + return _MAV_RETURN_uint16_t(msg, 56); } /** @@ -507,7 +524,7 @@ static inline uint16_t mavlink_msg_hil_state_quaternion_get_true_airspeed(const */ static inline int16_t mavlink_msg_hil_state_quaternion_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 58); + return _MAV_RETURN_int16_t(msg, 58); } /** @@ -517,7 +534,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_xacc(const mavlink_me */ static inline int16_t mavlink_msg_hil_state_quaternion_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 60); + return _MAV_RETURN_int16_t(msg, 60); } /** @@ -527,7 +544,7 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_yacc(const mavlink_me */ static inline int16_t mavlink_msg_hil_state_quaternion_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 62); + return _MAV_RETURN_int16_t(msg, 62); } /** @@ -538,24 +555,26 @@ static inline int16_t mavlink_msg_hil_state_quaternion_get_zacc(const mavlink_me */ static inline void mavlink_msg_hil_state_quaternion_decode(const mavlink_message_t* msg, mavlink_hil_state_quaternion_t* hil_state_quaternion) { -#if MAVLINK_NEED_BYTE_SWAP - hil_state_quaternion->time_usec = mavlink_msg_hil_state_quaternion_get_time_usec(msg); - mavlink_msg_hil_state_quaternion_get_attitude_quaternion(msg, hil_state_quaternion->attitude_quaternion); - hil_state_quaternion->rollspeed = mavlink_msg_hil_state_quaternion_get_rollspeed(msg); - hil_state_quaternion->pitchspeed = mavlink_msg_hil_state_quaternion_get_pitchspeed(msg); - hil_state_quaternion->yawspeed = mavlink_msg_hil_state_quaternion_get_yawspeed(msg); - hil_state_quaternion->lat = mavlink_msg_hil_state_quaternion_get_lat(msg); - hil_state_quaternion->lon = mavlink_msg_hil_state_quaternion_get_lon(msg); - hil_state_quaternion->alt = mavlink_msg_hil_state_quaternion_get_alt(msg); - hil_state_quaternion->vx = mavlink_msg_hil_state_quaternion_get_vx(msg); - hil_state_quaternion->vy = mavlink_msg_hil_state_quaternion_get_vy(msg); - hil_state_quaternion->vz = mavlink_msg_hil_state_quaternion_get_vz(msg); - hil_state_quaternion->ind_airspeed = mavlink_msg_hil_state_quaternion_get_ind_airspeed(msg); - hil_state_quaternion->true_airspeed = mavlink_msg_hil_state_quaternion_get_true_airspeed(msg); - hil_state_quaternion->xacc = mavlink_msg_hil_state_quaternion_get_xacc(msg); - hil_state_quaternion->yacc = mavlink_msg_hil_state_quaternion_get_yacc(msg); - hil_state_quaternion->zacc = mavlink_msg_hil_state_quaternion_get_zacc(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + hil_state_quaternion->time_usec = mavlink_msg_hil_state_quaternion_get_time_usec(msg); + mavlink_msg_hil_state_quaternion_get_attitude_quaternion(msg, hil_state_quaternion->attitude_quaternion); + hil_state_quaternion->rollspeed = mavlink_msg_hil_state_quaternion_get_rollspeed(msg); + hil_state_quaternion->pitchspeed = mavlink_msg_hil_state_quaternion_get_pitchspeed(msg); + hil_state_quaternion->yawspeed = mavlink_msg_hil_state_quaternion_get_yawspeed(msg); + hil_state_quaternion->lat = mavlink_msg_hil_state_quaternion_get_lat(msg); + hil_state_quaternion->lon = mavlink_msg_hil_state_quaternion_get_lon(msg); + hil_state_quaternion->alt = mavlink_msg_hil_state_quaternion_get_alt(msg); + hil_state_quaternion->vx = mavlink_msg_hil_state_quaternion_get_vx(msg); + hil_state_quaternion->vy = mavlink_msg_hil_state_quaternion_get_vy(msg); + hil_state_quaternion->vz = mavlink_msg_hil_state_quaternion_get_vz(msg); + hil_state_quaternion->ind_airspeed = mavlink_msg_hil_state_quaternion_get_ind_airspeed(msg); + hil_state_quaternion->true_airspeed = mavlink_msg_hil_state_quaternion_get_true_airspeed(msg); + hil_state_quaternion->xacc = mavlink_msg_hil_state_quaternion_get_xacc(msg); + hil_state_quaternion->yacc = mavlink_msg_hil_state_quaternion_get_yacc(msg); + hil_state_quaternion->zacc = mavlink_msg_hil_state_quaternion_get_zacc(msg); #else - memcpy(hil_state_quaternion, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN? msg->len : MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN; + memset(hil_state_quaternion, 0, MAVLINK_MSG_ID_HIL_STATE_QUATERNION_LEN); + memcpy(hil_state_quaternion, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_home_position.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_home_position.h index 67cae57..26d45f3 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_home_position.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_home_position.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE HOME_POSITION PACKING #define MAVLINK_MSG_ID_HOME_POSITION 242 -typedef struct __mavlink_home_position_t -{ +MAVPACKED( +typedef struct __mavlink_home_position_t { int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_home_position_t float approach_x; /*< Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ float approach_y; /*< Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ float approach_z; /*< Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ -} mavlink_home_position_t; +}) mavlink_home_position_t; #define MAVLINK_MSG_ID_HOME_POSITION_LEN 52 +#define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN 52 #define MAVLINK_MSG_ID_242_LEN 52 +#define MAVLINK_MSG_ID_242_MIN_LEN 52 #define MAVLINK_MSG_ID_HOME_POSITION_CRC 104 #define MAVLINK_MSG_ID_242_CRC 104 #define MAVLINK_MSG_HOME_POSITION_FIELD_Q_LEN 4 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_HOME_POSITION { \ - "HOME_POSITION", \ - 10, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \ + 242, \ + "HOME_POSITION", \ + 10, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_home_position_t { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_HOME_POSITION { \ + "HOME_POSITION", \ + 10, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \ + { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_home_position_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_home_position_t, z) }, \ + { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_home_position_t, q) }, \ + { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \ + { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \ + { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \ + } \ +} +#endif /** * @brief Pack a home_position message @@ -60,42 +81,38 @@ typedef struct __mavlink_home_position_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) + int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_float_array(buf, 24, q, 4); + char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_float_array(buf, 24, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN); #else - mavlink_home_position_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.x = x; - packet.y = y; - packet.z = z; - packet.approach_x = approach_x; - packet.approach_y = approach_y; - packet.approach_z = approach_z; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_home_position_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.x = x; + packet.y = y; + packet.z = z; + packet.approach_x = approach_x; + packet.approach_y = approach_y; + packet.approach_z = approach_z; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HOME_POSITION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HOME_POSITION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HOME_POSITION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); } /** @@ -117,43 +134,39 @@ static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z) + mavlink_message_t* msg, + int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_float_array(buf, 24, q, 4); + char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_float_array(buf, 24, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN); #else - mavlink_home_position_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.x = x; - packet.y = y; - packet.z = z; - packet.approach_x = approach_x; - packet.approach_y = approach_y; - packet.approach_z = approach_z; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_home_position_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.x = x; + packet.y = y; + packet.z = z; + packet.approach_x = approach_x; + packet.approach_y = approach_y; + packet.approach_z = approach_z; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_HOME_POSITION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HOME_POSITION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_HOME_POSITION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); } /** @@ -166,7 +179,7 @@ static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_home_position_t* home_position) { - return mavlink_msg_home_position_pack(system_id, component_id, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z); + return mavlink_msg_home_position_pack(system_id, component_id, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z); } /** @@ -180,7 +193,7 @@ static inline uint16_t mavlink_msg_home_position_encode(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_home_position_t* home_position) { - return mavlink_msg_home_position_pack_chan(system_id, component_id, chan, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z); + return mavlink_msg_home_position_pack_chan(system_id, component_id, chan, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z); } /** @@ -203,39 +216,45 @@ static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id, static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_float_array(buf, 24, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); + char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_float_array(buf, 24, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_LEN); + mavlink_home_position_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.x = x; + packet.y = y; + packet.z = z; + packet.approach_x = approach_x; + packet.approach_y = approach_y; + packet.approach_z = approach_z; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); #endif +} + +/** + * @brief Send a home_position message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_home_position_send_struct(mavlink_channel_t chan, const mavlink_home_position_t* home_position) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_home_position_send(chan, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z); #else - mavlink_home_position_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.x = x; - packet.y = y; - packet.z = z; - packet.approach_x = approach_x; - packet.approach_y = approach_y; - packet.approach_z = approach_z; - mav_array_memcpy(packet.q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_HOME_POSITION_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)home_position, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); #endif } @@ -250,39 +269,31 @@ static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, int32_ static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_float_array(buf, 24, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_LEN); -#endif -#else - mavlink_home_position_t *packet = (mavlink_home_position_t *)msgbuf; - packet->latitude = latitude; - packet->longitude = longitude; - packet->altitude = altitude; - packet->x = x; - packet->y = y; - packet->z = z; - packet->approach_x = approach_x; - packet->approach_y = approach_y; - packet->approach_z = approach_z; - mav_array_memcpy(packet->q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_float_array(buf, 24, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_HOME_POSITION_LEN); -#endif + mavlink_home_position_t *packet = (mavlink_home_position_t *)msgbuf; + packet->latitude = latitude; + packet->longitude = longitude; + packet->altitude = altitude; + packet->x = x; + packet->y = y; + packet->z = z; + packet->approach_x = approach_x; + packet->approach_y = approach_y; + packet->approach_z = approach_z; + mav_array_memcpy(packet->q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC); #endif } #endif @@ -299,7 +310,7 @@ static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf, */ static inline int32_t mavlink_msg_home_position_get_latitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -309,7 +320,7 @@ static inline int32_t mavlink_msg_home_position_get_latitude(const mavlink_messa */ static inline int32_t mavlink_msg_home_position_get_longitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -319,7 +330,7 @@ static inline int32_t mavlink_msg_home_position_get_longitude(const mavlink_mess */ static inline int32_t mavlink_msg_home_position_get_altitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -329,7 +340,7 @@ static inline int32_t mavlink_msg_home_position_get_altitude(const mavlink_messa */ static inline float mavlink_msg_home_position_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -339,7 +350,7 @@ static inline float mavlink_msg_home_position_get_x(const mavlink_message_t* msg */ static inline float mavlink_msg_home_position_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -349,7 +360,7 @@ static inline float mavlink_msg_home_position_get_y(const mavlink_message_t* msg */ static inline float mavlink_msg_home_position_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -359,7 +370,7 @@ static inline float mavlink_msg_home_position_get_z(const mavlink_message_t* msg */ static inline uint16_t mavlink_msg_home_position_get_q(const mavlink_message_t* msg, float *q) { - return _MAV_RETURN_float_array(msg, q, 4, 24); + return _MAV_RETURN_float_array(msg, q, 4, 24); } /** @@ -369,7 +380,7 @@ static inline uint16_t mavlink_msg_home_position_get_q(const mavlink_message_t* */ static inline float mavlink_msg_home_position_get_approach_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -379,7 +390,7 @@ static inline float mavlink_msg_home_position_get_approach_x(const mavlink_messa */ static inline float mavlink_msg_home_position_get_approach_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -389,7 +400,7 @@ static inline float mavlink_msg_home_position_get_approach_y(const mavlink_messa */ static inline float mavlink_msg_home_position_get_approach_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 48); + return _MAV_RETURN_float(msg, 48); } /** @@ -400,18 +411,20 @@ static inline float mavlink_msg_home_position_get_approach_z(const mavlink_messa */ static inline void mavlink_msg_home_position_decode(const mavlink_message_t* msg, mavlink_home_position_t* home_position) { -#if MAVLINK_NEED_BYTE_SWAP - home_position->latitude = mavlink_msg_home_position_get_latitude(msg); - home_position->longitude = mavlink_msg_home_position_get_longitude(msg); - home_position->altitude = mavlink_msg_home_position_get_altitude(msg); - home_position->x = mavlink_msg_home_position_get_x(msg); - home_position->y = mavlink_msg_home_position_get_y(msg); - home_position->z = mavlink_msg_home_position_get_z(msg); - mavlink_msg_home_position_get_q(msg, home_position->q); - home_position->approach_x = mavlink_msg_home_position_get_approach_x(msg); - home_position->approach_y = mavlink_msg_home_position_get_approach_y(msg); - home_position->approach_z = mavlink_msg_home_position_get_approach_z(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + home_position->latitude = mavlink_msg_home_position_get_latitude(msg); + home_position->longitude = mavlink_msg_home_position_get_longitude(msg); + home_position->altitude = mavlink_msg_home_position_get_altitude(msg); + home_position->x = mavlink_msg_home_position_get_x(msg); + home_position->y = mavlink_msg_home_position_get_y(msg); + home_position->z = mavlink_msg_home_position_get_z(msg); + mavlink_msg_home_position_get_q(msg, home_position->q); + home_position->approach_x = mavlink_msg_home_position_get_approach_x(msg); + home_position->approach_y = mavlink_msg_home_position_get_approach_y(msg); + home_position->approach_z = mavlink_msg_home_position_get_approach_z(msg); #else - memcpy(home_position, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HOME_POSITION_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_HOME_POSITION_LEN; + memset(home_position, 0, MAVLINK_MSG_ID_HOME_POSITION_LEN); + memcpy(home_position, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_landing_target.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_landing_target.h index e9c28b3..f8296f4 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_landing_target.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_landing_target.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE LANDING_TARGET PACKING #define MAVLINK_MSG_ID_LANDING_TARGET 149 -typedef struct __mavlink_landing_target_t -{ +MAVPACKED( +typedef struct __mavlink_landing_target_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float angle_x; /*< X-axis angular offset (in radians) of the target from the center of the image*/ float angle_y; /*< Y-axis angular offset (in radians) of the target from the center of the image*/ @@ -12,20 +13,24 @@ typedef struct __mavlink_landing_target_t float size_y; /*< Size in radians of target along y-axis*/ uint8_t target_num; /*< The ID of the target if multiple targets are present*/ uint8_t frame; /*< MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc.*/ -} mavlink_landing_target_t; +}) mavlink_landing_target_t; #define MAVLINK_MSG_ID_LANDING_TARGET_LEN 30 +#define MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN 30 #define MAVLINK_MSG_ID_149_LEN 30 +#define MAVLINK_MSG_ID_149_MIN_LEN 30 #define MAVLINK_MSG_ID_LANDING_TARGET_CRC 200 #define MAVLINK_MSG_ID_149_CRC 200 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \ - "LANDING_TARGET", \ - 8, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \ + 149, \ + "LANDING_TARGET", \ + 8, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \ { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \ { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \ @@ -35,7 +40,21 @@ typedef struct __mavlink_landing_target_t { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LANDING_TARGET { \ + "LANDING_TARGET", \ + 8, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_landing_target_t, time_usec) }, \ + { "angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_landing_target_t, angle_x) }, \ + { "angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_landing_target_t, angle_y) }, \ + { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_landing_target_t, distance) }, \ + { "size_x", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_landing_target_t, size_x) }, \ + { "size_y", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_landing_target_t, size_y) }, \ + { "target_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_landing_target_t, target_num) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_landing_target_t, frame) }, \ + } \ +} +#endif /** * @brief Pack a landing_target message @@ -54,40 +73,36 @@ typedef struct __mavlink_landing_target_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y) + uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, angle_x); - _mav_put_float(buf, 12, angle_y); - _mav_put_float(buf, 16, distance); - _mav_put_float(buf, 20, size_x); - _mav_put_float(buf, 24, size_y); - _mav_put_uint8_t(buf, 28, target_num); - _mav_put_uint8_t(buf, 29, frame); + char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, angle_x); + _mav_put_float(buf, 12, angle_y); + _mav_put_float(buf, 16, distance); + _mav_put_float(buf, 20, size_x); + _mav_put_float(buf, 24, size_y); + _mav_put_uint8_t(buf, 28, target_num); + _mav_put_uint8_t(buf, 29, frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN); #else - mavlink_landing_target_t packet; - packet.time_usec = time_usec; - packet.angle_x = angle_x; - packet.angle_y = angle_y; - packet.distance = distance; - packet.size_x = size_x; - packet.size_y = size_y; - packet.target_num = target_num; - packet.frame = frame; + mavlink_landing_target_t packet; + packet.time_usec = time_usec; + packet.angle_x = angle_x; + packet.angle_y = angle_y; + packet.distance = distance; + packet.size_x = size_x; + packet.size_y = size_y; + packet.target_num = target_num; + packet.frame = frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LANDING_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); } /** @@ -107,41 +122,37 @@ static inline uint16_t mavlink_msg_landing_target_pack(uint8_t system_id, uint8_ * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t target_num,uint8_t frame,float angle_x,float angle_y,float distance,float size_x,float size_y) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t target_num,uint8_t frame,float angle_x,float angle_y,float distance,float size_x,float size_y) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, angle_x); - _mav_put_float(buf, 12, angle_y); - _mav_put_float(buf, 16, distance); - _mav_put_float(buf, 20, size_x); - _mav_put_float(buf, 24, size_y); - _mav_put_uint8_t(buf, 28, target_num); - _mav_put_uint8_t(buf, 29, frame); + char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, angle_x); + _mav_put_float(buf, 12, angle_y); + _mav_put_float(buf, 16, distance); + _mav_put_float(buf, 20, size_x); + _mav_put_float(buf, 24, size_y); + _mav_put_uint8_t(buf, 28, target_num); + _mav_put_uint8_t(buf, 29, frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN); #else - mavlink_landing_target_t packet; - packet.time_usec = time_usec; - packet.angle_x = angle_x; - packet.angle_y = angle_y; - packet.distance = distance; - packet.size_x = size_x; - packet.size_y = size_y; - packet.target_num = target_num; - packet.frame = frame; + mavlink_landing_target_t packet; + packet.time_usec = time_usec; + packet.angle_x = angle_x; + packet.angle_y = angle_y; + packet.distance = distance; + packet.size_x = size_x; + packet.size_y = size_y; + packet.target_num = target_num; + packet.frame = frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LANDING_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LANDING_TARGET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); } /** @@ -154,7 +165,7 @@ static inline uint16_t mavlink_msg_landing_target_pack_chan(uint8_t system_id, u */ static inline uint16_t mavlink_msg_landing_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target) { - return mavlink_msg_landing_target_pack(system_id, component_id, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y); + return mavlink_msg_landing_target_pack(system_id, component_id, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y); } /** @@ -168,7 +179,7 @@ static inline uint16_t mavlink_msg_landing_target_encode(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_landing_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_landing_target_t* landing_target) { - return mavlink_msg_landing_target_pack_chan(system_id, component_id, chan, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y); + return mavlink_msg_landing_target_pack_chan(system_id, component_id, chan, msg, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y); } /** @@ -189,37 +200,43 @@ static inline uint16_t mavlink_msg_landing_target_encode_chan(uint8_t system_id, static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, angle_x); - _mav_put_float(buf, 12, angle_y); - _mav_put_float(buf, 16, distance); - _mav_put_float(buf, 20, size_x); - _mav_put_float(buf, 24, size_y); - _mav_put_uint8_t(buf, 28, target_num); - _mav_put_uint8_t(buf, 29, frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); + char buf[MAVLINK_MSG_ID_LANDING_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, angle_x); + _mav_put_float(buf, 12, angle_y); + _mav_put_float(buf, 16, distance); + _mav_put_float(buf, 20, size_x); + _mav_put_float(buf, 24, size_y); + _mav_put_uint8_t(buf, 28, target_num); + _mav_put_uint8_t(buf, 29, frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN); + mavlink_landing_target_t packet; + packet.time_usec = time_usec; + packet.angle_x = angle_x; + packet.angle_y = angle_y; + packet.distance = distance; + packet.size_x = size_x; + packet.size_y = size_y; + packet.target_num = target_num; + packet.frame = frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)&packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); #endif +} + +/** + * @brief Send a landing_target message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_landing_target_send_struct(mavlink_channel_t chan, const mavlink_landing_target_t* landing_target) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_landing_target_send(chan, landing_target->time_usec, landing_target->target_num, landing_target->frame, landing_target->angle_x, landing_target->angle_y, landing_target->distance, landing_target->size_x, landing_target->size_y); #else - mavlink_landing_target_t packet; - packet.time_usec = time_usec; - packet.angle_x = angle_x; - packet.angle_y = angle_y; - packet.distance = distance; - packet.size_x = size_x; - packet.size_y = size_y; - packet.target_num = target_num; - packet.frame = frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)&packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)&packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)landing_target, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); #endif } @@ -234,37 +251,29 @@ static inline void mavlink_msg_landing_target_send(mavlink_channel_t chan, uint6 static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_num, uint8_t frame, float angle_x, float angle_y, float distance, float size_x, float size_y) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, angle_x); - _mav_put_float(buf, 12, angle_y); - _mav_put_float(buf, 16, distance); - _mav_put_float(buf, 20, size_x); - _mav_put_float(buf, 24, size_y); - _mav_put_uint8_t(buf, 28, target_num); - _mav_put_uint8_t(buf, 29, frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_LEN); -#endif -#else - mavlink_landing_target_t *packet = (mavlink_landing_target_t *)msgbuf; - packet->time_usec = time_usec; - packet->angle_x = angle_x; - packet->angle_y = angle_y; - packet->distance = distance; - packet->size_x = size_x; - packet->size_y = size_y; - packet->target_num = target_num; - packet->frame = frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, angle_x); + _mav_put_float(buf, 12, angle_y); + _mav_put_float(buf, 16, distance); + _mav_put_float(buf, 20, size_x); + _mav_put_float(buf, 24, size_y); + _mav_put_uint8_t(buf, 28, target_num); + _mav_put_uint8_t(buf, 29, frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, buf, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)packet, MAVLINK_MSG_ID_LANDING_TARGET_LEN); -#endif + mavlink_landing_target_t *packet = (mavlink_landing_target_t *)msgbuf; + packet->time_usec = time_usec; + packet->angle_x = angle_x; + packet->angle_y = angle_y; + packet->distance = distance; + packet->size_x = size_x; + packet->size_y = size_y; + packet->target_num = target_num; + packet->frame = frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LANDING_TARGET, (const char *)packet, MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN, MAVLINK_MSG_ID_LANDING_TARGET_LEN, MAVLINK_MSG_ID_LANDING_TARGET_CRC); #endif } #endif @@ -281,7 +290,7 @@ static inline void mavlink_msg_landing_target_send_buf(mavlink_message_t *msgbuf */ static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -291,7 +300,7 @@ static inline uint64_t mavlink_msg_landing_target_get_time_usec(const mavlink_me */ static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 28); + return _MAV_RETURN_uint8_t(msg, 28); } /** @@ -301,7 +310,7 @@ static inline uint8_t mavlink_msg_landing_target_get_target_num(const mavlink_me */ static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 29); + return _MAV_RETURN_uint8_t(msg, 29); } /** @@ -311,7 +320,7 @@ static inline uint8_t mavlink_msg_landing_target_get_frame(const mavlink_message */ static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -321,7 +330,7 @@ static inline float mavlink_msg_landing_target_get_angle_x(const mavlink_message */ static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -331,7 +340,7 @@ static inline float mavlink_msg_landing_target_get_angle_y(const mavlink_message */ static inline float mavlink_msg_landing_target_get_distance(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -341,7 +350,7 @@ static inline float mavlink_msg_landing_target_get_distance(const mavlink_messag */ static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -351,7 +360,7 @@ static inline float mavlink_msg_landing_target_get_size_x(const mavlink_message_ */ static inline float mavlink_msg_landing_target_get_size_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -362,16 +371,18 @@ static inline float mavlink_msg_landing_target_get_size_y(const mavlink_message_ */ static inline void mavlink_msg_landing_target_decode(const mavlink_message_t* msg, mavlink_landing_target_t* landing_target) { -#if MAVLINK_NEED_BYTE_SWAP - landing_target->time_usec = mavlink_msg_landing_target_get_time_usec(msg); - landing_target->angle_x = mavlink_msg_landing_target_get_angle_x(msg); - landing_target->angle_y = mavlink_msg_landing_target_get_angle_y(msg); - landing_target->distance = mavlink_msg_landing_target_get_distance(msg); - landing_target->size_x = mavlink_msg_landing_target_get_size_x(msg); - landing_target->size_y = mavlink_msg_landing_target_get_size_y(msg); - landing_target->target_num = mavlink_msg_landing_target_get_target_num(msg); - landing_target->frame = mavlink_msg_landing_target_get_frame(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + landing_target->time_usec = mavlink_msg_landing_target_get_time_usec(msg); + landing_target->angle_x = mavlink_msg_landing_target_get_angle_x(msg); + landing_target->angle_y = mavlink_msg_landing_target_get_angle_y(msg); + landing_target->distance = mavlink_msg_landing_target_get_distance(msg); + landing_target->size_x = mavlink_msg_landing_target_get_size_x(msg); + landing_target->size_y = mavlink_msg_landing_target_get_size_y(msg); + landing_target->target_num = mavlink_msg_landing_target_get_target_num(msg); + landing_target->frame = mavlink_msg_landing_target_get_frame(msg); #else - memcpy(landing_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LANDING_TARGET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LANDING_TARGET_LEN? msg->len : MAVLINK_MSG_ID_LANDING_TARGET_LEN; + memset(landing_target, 0, MAVLINK_MSG_ID_LANDING_TARGET_LEN); + memcpy(landing_target, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned.h index 0f54e0c..d640324 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE LOCAL_POSITION_NED PACKING #define MAVLINK_MSG_ID_LOCAL_POSITION_NED 32 -typedef struct __mavlink_local_position_ned_t -{ +MAVPACKED( +typedef struct __mavlink_local_position_ned_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float x; /*< X Position*/ float y; /*< Y Position*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_local_position_ned_t float vx; /*< X Speed*/ float vy; /*< Y Speed*/ float vz; /*< Z Speed*/ -} mavlink_local_position_ned_t; +}) mavlink_local_position_ned_t; #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN 28 +#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN 28 #define MAVLINK_MSG_ID_32_LEN 28 +#define MAVLINK_MSG_ID_32_MIN_LEN 28 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC 185 #define MAVLINK_MSG_ID_32_CRC 185 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \ - "LOCAL_POSITION_NED", \ - 7, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \ + 32, \ + "LOCAL_POSITION_NED", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_t, z) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_local_position_ned_t { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_t, vz) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \ + "LOCAL_POSITION_NED", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_t, z) }, \ + { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_t, vz) }, \ + } \ +} +#endif /** * @brief Pack a local_position_ned message @@ -51,38 +69,34 @@ typedef struct __mavlink_local_position_ned_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz) + uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #else - mavlink_local_position_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; + mavlink_local_position_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float x,float y,float z,float vx,float vy,float vz) + mavlink_message_t* msg, + uint32_t time_boot_ms,float x,float y,float z,float vx,float vy,float vz) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #else - mavlink_local_position_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; + mavlink_local_position_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i */ static inline uint16_t mavlink_msg_local_position_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned) { - return mavlink_msg_local_position_ned_pack(system_id, component_id, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz); + return mavlink_msg_local_position_ned_pack(system_id, component_id, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_local_position_ned_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_local_position_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned) { - return mavlink_msg_local_position_ned_pack_chan(system_id, component_id, chan, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz); + return mavlink_msg_local_position_ned_pack_chan(system_id, component_id, chan, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_local_position_ned_encode_chan(uint8_t system static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); + mavlink_local_position_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); #endif +} + +/** + * @brief Send a local_position_ned message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_local_position_ned_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_t* local_position_ned) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_local_position_ned_send(chan, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz); #else - mavlink_local_position_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)local_position_ned, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, u static inline void mavlink_msg_local_position_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); -#endif -#else - mavlink_local_position_ned_t *packet = (mavlink_local_position_ned_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->x = x; - packet->y = y; - packet->z = z; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); -#endif + mavlink_local_position_ned_t *packet = (mavlink_local_position_ned_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->x = x; + packet->y = y; + packet->z = z; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_local_position_ned_send_buf(mavlink_message_t *ms */ static inline uint32_t mavlink_msg_local_position_ned_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint32_t mavlink_msg_local_position_ned_get_time_boot_ms(const mav */ static inline float mavlink_msg_local_position_ned_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_local_position_ned_get_x(const mavlink_message_t */ static inline float mavlink_msg_local_position_ned_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_local_position_ned_get_y(const mavlink_message_t */ static inline float mavlink_msg_local_position_ned_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_local_position_ned_get_z(const mavlink_message_t */ static inline float mavlink_msg_local_position_ned_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_local_position_ned_get_vx(const mavlink_message_ */ static inline float mavlink_msg_local_position_ned_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_local_position_ned_get_vy(const mavlink_message_ */ static inline float mavlink_msg_local_position_ned_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_local_position_ned_get_vz(const mavlink_message_ */ static inline void mavlink_msg_local_position_ned_decode(const mavlink_message_t* msg, mavlink_local_position_ned_t* local_position_ned) { -#if MAVLINK_NEED_BYTE_SWAP - local_position_ned->time_boot_ms = mavlink_msg_local_position_ned_get_time_boot_ms(msg); - local_position_ned->x = mavlink_msg_local_position_ned_get_x(msg); - local_position_ned->y = mavlink_msg_local_position_ned_get_y(msg); - local_position_ned->z = mavlink_msg_local_position_ned_get_z(msg); - local_position_ned->vx = mavlink_msg_local_position_ned_get_vx(msg); - local_position_ned->vy = mavlink_msg_local_position_ned_get_vy(msg); - local_position_ned->vz = mavlink_msg_local_position_ned_get_vz(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + local_position_ned->time_boot_ms = mavlink_msg_local_position_ned_get_time_boot_ms(msg); + local_position_ned->x = mavlink_msg_local_position_ned_get_x(msg); + local_position_ned->y = mavlink_msg_local_position_ned_get_y(msg); + local_position_ned->z = mavlink_msg_local_position_ned_get_z(msg); + local_position_ned->vx = mavlink_msg_local_position_ned_get_vx(msg); + local_position_ned->vy = mavlink_msg_local_position_ned_get_vy(msg); + local_position_ned->vz = mavlink_msg_local_position_ned_get_vz(msg); #else - memcpy(local_position_ned, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN; + memset(local_position_ned, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN); + memcpy(local_position_ned, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_cov.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_cov.h index 993a602..fc51e96 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_cov.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_cov.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE LOCAL_POSITION_NED_COV PACKING #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV 64 -typedef struct __mavlink_local_position_ned_cov_t -{ +MAVPACKED( +typedef struct __mavlink_local_position_ned_cov_t { uint64_t time_utc; /*< Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver.*/ uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp*/ float x; /*< X Position*/ @@ -17,20 +18,24 @@ typedef struct __mavlink_local_position_ned_cov_t float az; /*< Z Acceleration (m/s^2)*/ float covariance[45]; /*< Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.)*/ uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/ -} mavlink_local_position_ned_cov_t; +}) mavlink_local_position_ned_cov_t; #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN 229 +#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN 229 #define MAVLINK_MSG_ID_64_LEN 229 +#define MAVLINK_MSG_ID_64_MIN_LEN 229 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC 59 #define MAVLINK_MSG_ID_64_CRC 59 #define MAVLINK_MSG_LOCAL_POSITION_NED_COV_FIELD_COVARIANCE_LEN 45 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV { \ - "LOCAL_POSITION_NED_COV", \ - 13, \ - { { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_utc) }, \ + 64, \ + "LOCAL_POSITION_NED_COV", \ + 13, \ + { { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_utc) }, \ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_local_position_ned_cov_t, time_boot_ms) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, y) }, \ @@ -45,7 +50,26 @@ typedef struct __mavlink_local_position_ned_cov_t { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 228, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV { \ + "LOCAL_POSITION_NED_COV", \ + 13, \ + { { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_local_position_ned_cov_t, time_utc) }, \ + { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_local_position_ned_cov_t, time_boot_ms) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_cov_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_cov_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_cov_t, z) }, \ + { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_cov_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_local_position_ned_cov_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_local_position_ned_cov_t, vz) }, \ + { "ax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_local_position_ned_cov_t, ax) }, \ + { "ay", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_local_position_ned_cov_t, ay) }, \ + { "az", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_local_position_ned_cov_t, az) }, \ + { "covariance", NULL, MAVLINK_TYPE_FLOAT, 45, 48, offsetof(mavlink_local_position_ned_cov_t, covariance) }, \ + { "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 228, offsetof(mavlink_local_position_ned_cov_t, estimator_type) }, \ + } \ +} +#endif /** * @brief Pack a local_position_ned_cov message @@ -69,48 +93,44 @@ typedef struct __mavlink_local_position_ned_cov_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance) + uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 24, vx); - _mav_put_float(buf, 28, vy); - _mav_put_float(buf, 32, vz); - _mav_put_float(buf, 36, ax); - _mav_put_float(buf, 40, ay); - _mav_put_float(buf, 44, az); - _mav_put_uint8_t(buf, 228, estimator_type); - _mav_put_float_array(buf, 48, covariance, 45); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 24, vx); + _mav_put_float(buf, 28, vy); + _mav_put_float(buf, 32, vz); + _mav_put_float(buf, 36, ax); + _mav_put_float(buf, 40, ay); + _mav_put_float(buf, 44, az); + _mav_put_uint8_t(buf, 228, estimator_type); + _mav_put_float_array(buf, 48, covariance, 45); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); #else - mavlink_local_position_ned_cov_t packet; - packet.time_utc = time_utc; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.ax = ax; - packet.ay = ay; - packet.az = az; - packet.estimator_type = estimator_type; - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45); + mavlink_local_position_ned_cov_t packet; + packet.time_utc = time_utc; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.ax = ax; + packet.ay = ay; + packet.az = az; + packet.estimator_type = estimator_type; + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); } /** @@ -135,49 +155,45 @@ static inline uint16_t mavlink_msg_local_position_ned_cov_pack(uint8_t system_id * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint64_t time_utc,uint8_t estimator_type,float x,float y,float z,float vx,float vy,float vz,float ax,float ay,float az,const float *covariance) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint64_t time_utc,uint8_t estimator_type,float x,float y,float z,float vx,float vy,float vz,float ax,float ay,float az,const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 24, vx); - _mav_put_float(buf, 28, vy); - _mav_put_float(buf, 32, vz); - _mav_put_float(buf, 36, ax); - _mav_put_float(buf, 40, ay); - _mav_put_float(buf, 44, az); - _mav_put_uint8_t(buf, 228, estimator_type); - _mav_put_float_array(buf, 48, covariance, 45); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 24, vx); + _mav_put_float(buf, 28, vy); + _mav_put_float(buf, 32, vz); + _mav_put_float(buf, 36, ax); + _mav_put_float(buf, 40, ay); + _mav_put_float(buf, 44, az); + _mav_put_uint8_t(buf, 228, estimator_type); + _mav_put_float_array(buf, 48, covariance, 45); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); #else - mavlink_local_position_ned_cov_t packet; - packet.time_utc = time_utc; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.ax = ax; - packet.ay = ay; - packet.az = az; - packet.estimator_type = estimator_type; - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45); + mavlink_local_position_ned_cov_t packet; + packet.time_utc = time_utc; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.ax = ax; + packet.ay = ay; + packet.az = az; + packet.estimator_type = estimator_type; + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); } /** @@ -190,7 +206,7 @@ static inline uint16_t mavlink_msg_local_position_ned_cov_pack_chan(uint8_t syst */ static inline uint16_t mavlink_msg_local_position_ned_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov) { - return mavlink_msg_local_position_ned_cov_pack(system_id, component_id, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance); + return mavlink_msg_local_position_ned_cov_pack(system_id, component_id, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance); } /** @@ -204,7 +220,7 @@ static inline uint16_t mavlink_msg_local_position_ned_cov_encode(uint8_t system_ */ static inline uint16_t mavlink_msg_local_position_ned_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_cov_t* local_position_ned_cov) { - return mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, chan, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance); + return mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, chan, msg, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance); } /** @@ -230,45 +246,51 @@ static inline uint16_t mavlink_msg_local_position_ned_cov_encode_chan(uint8_t sy static inline void mavlink_msg_local_position_ned_cov_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 24, vx); - _mav_put_float(buf, 28, vy); - _mav_put_float(buf, 32, vz); - _mav_put_float(buf, 36, ax); - _mav_put_float(buf, 40, ay); - _mav_put_float(buf, 44, az); - _mav_put_uint8_t(buf, 228, estimator_type); - _mav_put_float_array(buf, 48, covariance, 45); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 24, vx); + _mav_put_float(buf, 28, vy); + _mav_put_float(buf, 32, vz); + _mav_put_float(buf, 36, ax); + _mav_put_float(buf, 40, ay); + _mav_put_float(buf, 44, az); + _mav_put_uint8_t(buf, 228, estimator_type); + _mav_put_float_array(buf, 48, covariance, 45); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); + mavlink_local_position_ned_cov_t packet; + packet.time_utc = time_utc; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.ax = ax; + packet.ay = ay; + packet.az = az; + packet.estimator_type = estimator_type; + mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); #endif +} + +/** + * @brief Send a local_position_ned_cov message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_local_position_ned_cov_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_cov_t* local_position_ned_cov) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_local_position_ned_cov_send(chan, local_position_ned_cov->time_boot_ms, local_position_ned_cov->time_utc, local_position_ned_cov->estimator_type, local_position_ned_cov->x, local_position_ned_cov->y, local_position_ned_cov->z, local_position_ned_cov->vx, local_position_ned_cov->vy, local_position_ned_cov->vz, local_position_ned_cov->ax, local_position_ned_cov->ay, local_position_ned_cov->az, local_position_ned_cov->covariance); #else - mavlink_local_position_ned_cov_t packet; - packet.time_utc = time_utc; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.ax = ax; - packet.ay = ay; - packet.az = az; - packet.estimator_type = estimator_type; - mav_array_memcpy(packet.covariance, covariance, sizeof(float)*45); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)local_position_ned_cov, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); #endif } @@ -283,45 +305,37 @@ static inline void mavlink_msg_local_position_ned_cov_send(mavlink_channel_t cha static inline void mavlink_msg_local_position_ned_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t estimator_type, float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, const float *covariance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 8, time_boot_ms); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 24, vx); - _mav_put_float(buf, 28, vy); - _mav_put_float(buf, 32, vz); - _mav_put_float(buf, 36, ax); - _mav_put_float(buf, 40, ay); - _mav_put_float(buf, 44, az); - _mav_put_uint8_t(buf, 228, estimator_type); - _mav_put_float_array(buf, 48, covariance, 45); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 8, time_boot_ms); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 24, vx); + _mav_put_float(buf, 28, vy); + _mav_put_float(buf, 32, vz); + _mav_put_float(buf, 36, ax); + _mav_put_float(buf, 40, ay); + _mav_put_float(buf, 44, az); + _mav_put_uint8_t(buf, 228, estimator_type); + _mav_put_float_array(buf, 48, covariance, 45); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); -#endif -#else - mavlink_local_position_ned_cov_t *packet = (mavlink_local_position_ned_cov_t *)msgbuf; - packet->time_utc = time_utc; - packet->time_boot_ms = time_boot_ms; - packet->x = x; - packet->y = y; - packet->z = z; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->ax = ax; - packet->ay = ay; - packet->az = az; - packet->estimator_type = estimator_type; - mav_array_memcpy(packet->covariance, covariance, sizeof(float)*45); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); -#endif + mavlink_local_position_ned_cov_t *packet = (mavlink_local_position_ned_cov_t *)msgbuf; + packet->time_utc = time_utc; + packet->time_boot_ms = time_boot_ms; + packet->x = x; + packet->y = y; + packet->z = z; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->ax = ax; + packet->ay = ay; + packet->az = az; + packet->estimator_type = estimator_type; + mav_array_memcpy(packet->covariance, covariance, sizeof(float)*45); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_CRC); #endif } #endif @@ -338,7 +352,7 @@ static inline void mavlink_msg_local_position_ned_cov_send_buf(mavlink_message_t */ static inline uint32_t mavlink_msg_local_position_ned_cov_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -348,7 +362,7 @@ static inline uint32_t mavlink_msg_local_position_ned_cov_get_time_boot_ms(const */ static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_utc(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -358,7 +372,7 @@ static inline uint64_t mavlink_msg_local_position_ned_cov_get_time_utc(const mav */ static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 228); + return _MAV_RETURN_uint8_t(msg, 228); } /** @@ -368,7 +382,7 @@ static inline uint8_t mavlink_msg_local_position_ned_cov_get_estimator_type(cons */ static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -378,7 +392,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_x(const mavlink_messa */ static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -388,7 +402,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_y(const mavlink_messa */ static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -398,7 +412,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_z(const mavlink_messa */ static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -408,7 +422,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_vx(const mavlink_mess */ static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -418,7 +432,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_vy(const mavlink_mess */ static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -428,7 +442,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_vz(const mavlink_mess */ static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -438,7 +452,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_ax(const mavlink_mess */ static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -448,7 +462,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_ay(const mavlink_mess */ static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -458,7 +472,7 @@ static inline float mavlink_msg_local_position_ned_cov_get_az(const mavlink_mess */ static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const mavlink_message_t* msg, float *covariance) { - return _MAV_RETURN_float_array(msg, covariance, 45, 48); + return _MAV_RETURN_float_array(msg, covariance, 45, 48); } /** @@ -469,21 +483,23 @@ static inline uint16_t mavlink_msg_local_position_ned_cov_get_covariance(const m */ static inline void mavlink_msg_local_position_ned_cov_decode(const mavlink_message_t* msg, mavlink_local_position_ned_cov_t* local_position_ned_cov) { -#if MAVLINK_NEED_BYTE_SWAP - local_position_ned_cov->time_utc = mavlink_msg_local_position_ned_cov_get_time_utc(msg); - local_position_ned_cov->time_boot_ms = mavlink_msg_local_position_ned_cov_get_time_boot_ms(msg); - local_position_ned_cov->x = mavlink_msg_local_position_ned_cov_get_x(msg); - local_position_ned_cov->y = mavlink_msg_local_position_ned_cov_get_y(msg); - local_position_ned_cov->z = mavlink_msg_local_position_ned_cov_get_z(msg); - local_position_ned_cov->vx = mavlink_msg_local_position_ned_cov_get_vx(msg); - local_position_ned_cov->vy = mavlink_msg_local_position_ned_cov_get_vy(msg); - local_position_ned_cov->vz = mavlink_msg_local_position_ned_cov_get_vz(msg); - local_position_ned_cov->ax = mavlink_msg_local_position_ned_cov_get_ax(msg); - local_position_ned_cov->ay = mavlink_msg_local_position_ned_cov_get_ay(msg); - local_position_ned_cov->az = mavlink_msg_local_position_ned_cov_get_az(msg); - mavlink_msg_local_position_ned_cov_get_covariance(msg, local_position_ned_cov->covariance); - local_position_ned_cov->estimator_type = mavlink_msg_local_position_ned_cov_get_estimator_type(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + local_position_ned_cov->time_utc = mavlink_msg_local_position_ned_cov_get_time_utc(msg); + local_position_ned_cov->time_boot_ms = mavlink_msg_local_position_ned_cov_get_time_boot_ms(msg); + local_position_ned_cov->x = mavlink_msg_local_position_ned_cov_get_x(msg); + local_position_ned_cov->y = mavlink_msg_local_position_ned_cov_get_y(msg); + local_position_ned_cov->z = mavlink_msg_local_position_ned_cov_get_z(msg); + local_position_ned_cov->vx = mavlink_msg_local_position_ned_cov_get_vx(msg); + local_position_ned_cov->vy = mavlink_msg_local_position_ned_cov_get_vy(msg); + local_position_ned_cov->vz = mavlink_msg_local_position_ned_cov_get_vz(msg); + local_position_ned_cov->ax = mavlink_msg_local_position_ned_cov_get_ax(msg); + local_position_ned_cov->ay = mavlink_msg_local_position_ned_cov_get_ay(msg); + local_position_ned_cov->az = mavlink_msg_local_position_ned_cov_get_az(msg); + mavlink_msg_local_position_ned_cov_get_covariance(msg, local_position_ned_cov->covariance); + local_position_ned_cov->estimator_type = mavlink_msg_local_position_ned_cov_get_estimator_type(msg); #else - memcpy(local_position_ned_cov, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN; + memset(local_position_ned_cov, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_LEN); + memcpy(local_position_ned_cov, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_system_global_offset.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_system_global_offset.h index 18bd191..7e8d250 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_system_global_offset.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_local_position_ned_system_global_offset.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET PACKING #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89 -typedef struct __mavlink_local_position_ned_system_global_offset_t -{ +MAVPACKED( +typedef struct __mavlink_local_position_ned_system_global_offset_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float x; /*< X Position*/ float y; /*< Y Position*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_local_position_ned_system_global_offset_t float roll; /*< Roll*/ float pitch; /*< Pitch*/ float yaw; /*< Yaw*/ -} mavlink_local_position_ned_system_global_offset_t; +}) mavlink_local_position_ned_system_global_offset_t; #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28 +#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN 28 #define MAVLINK_MSG_ID_89_LEN 28 +#define MAVLINK_MSG_ID_89_MIN_LEN 28 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC 231 #define MAVLINK_MSG_ID_89_CRC 231 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \ - "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \ - 7, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \ + 89, \ + "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_local_position_ned_system_global_offset_t { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \ + "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \ + } \ +} +#endif /** * @brief Pack a local_position_ned_system_global_offset message @@ -51,38 +69,34 @@ typedef struct __mavlink_local_position_ned_system_global_offset_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw) + uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #else - mavlink_local_position_ned_system_global_offset_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_local_position_ned_system_global_offset_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack( * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw) + mavlink_message_t* msg, + uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #else - mavlink_local_position_ned_system_global_offset_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_local_position_ned_system_global_offset_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_ */ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset) { - return mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw); + return mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encod */ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset) { - return mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, chan, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw); + return mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, chan, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encod static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); + char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); + mavlink_local_position_ned_system_global_offset_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); #endif +} + +/** + * @brief Send a local_position_ned_system_global_offset message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_local_position_ned_system_global_offset_send_struct(mavlink_channel_t chan, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_local_position_ned_system_global_offset_send(chan, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw); #else - mavlink_local_position_ned_system_global_offset_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)local_position_ned_system_global_offset, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavl static inline void mavlink_msg_local_position_ned_system_global_offset_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); -#endif -#else - mavlink_local_position_ned_system_global_offset_t *packet = (mavlink_local_position_ned_system_global_offset_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->x = x; - packet->y = y; - packet->z = z; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); -#endif + mavlink_local_position_ned_system_global_offset_t *packet = (mavlink_local_position_ned_system_global_offset_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->x = x; + packet->y = y; + packet->z = z; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_local_position_ned_system_global_offset_send_buf( */ static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_t */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(co */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(co */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(co */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitc */ static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw( */ static inline void mavlink_msg_local_position_ned_system_global_offset_decode(const mavlink_message_t* msg, mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset) { -#if MAVLINK_NEED_BYTE_SWAP - local_position_ned_system_global_offset->time_boot_ms = mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(msg); - local_position_ned_system_global_offset->x = mavlink_msg_local_position_ned_system_global_offset_get_x(msg); - local_position_ned_system_global_offset->y = mavlink_msg_local_position_ned_system_global_offset_get_y(msg); - local_position_ned_system_global_offset->z = mavlink_msg_local_position_ned_system_global_offset_get_z(msg); - local_position_ned_system_global_offset->roll = mavlink_msg_local_position_ned_system_global_offset_get_roll(msg); - local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg); - local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + local_position_ned_system_global_offset->time_boot_ms = mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(msg); + local_position_ned_system_global_offset->x = mavlink_msg_local_position_ned_system_global_offset_get_x(msg); + local_position_ned_system_global_offset->y = mavlink_msg_local_position_ned_system_global_offset_get_y(msg); + local_position_ned_system_global_offset->z = mavlink_msg_local_position_ned_system_global_offset_get_z(msg); + local_position_ned_system_global_offset->roll = mavlink_msg_local_position_ned_system_global_offset_get_roll(msg); + local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg); + local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg); #else - memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN? msg->len : MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN; + memset(local_position_ned_system_global_offset, 0, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN); + memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_data.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_data.h index 18cc981..229e19a 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_data.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_data.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE LOG_DATA PACKING #define MAVLINK_MSG_ID_LOG_DATA 120 -typedef struct __mavlink_log_data_t -{ +MAVPACKED( +typedef struct __mavlink_log_data_t { uint32_t ofs; /*< Offset into the log*/ uint16_t id; /*< Log id (from LOG_ENTRY reply)*/ uint8_t count; /*< Number of bytes (zero for end of log)*/ uint8_t data[90]; /*< log data*/ -} mavlink_log_data_t; +}) mavlink_log_data_t; #define MAVLINK_MSG_ID_LOG_DATA_LEN 97 +#define MAVLINK_MSG_ID_LOG_DATA_MIN_LEN 97 #define MAVLINK_MSG_ID_120_LEN 97 +#define MAVLINK_MSG_ID_120_MIN_LEN 97 #define MAVLINK_MSG_ID_LOG_DATA_CRC 134 #define MAVLINK_MSG_ID_120_CRC 134 #define MAVLINK_MSG_LOG_DATA_FIELD_DATA_LEN 90 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOG_DATA { \ - "LOG_DATA", \ - 4, \ - { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \ + 120, \ + "LOG_DATA", \ + 4, \ + { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \ { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \ { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \ { "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOG_DATA { \ + "LOG_DATA", \ + 4, \ + { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_data_t, ofs) }, \ + { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_log_data_t, id) }, \ + { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_log_data_t, count) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 90, 7, offsetof(mavlink_log_data_t, data) }, \ + } \ +} +#endif /** * @brief Pack a log_data message @@ -42,30 +57,26 @@ typedef struct __mavlink_log_data_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data) + uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_DATA_LEN]; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint16_t(buf, 4, id); - _mav_put_uint8_t(buf, 6, count); - _mav_put_uint8_t_array(buf, 7, data, 90); + char buf[MAVLINK_MSG_ID_LOG_DATA_LEN]; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint16_t(buf, 4, id); + _mav_put_uint8_t(buf, 6, count); + _mav_put_uint8_t_array(buf, 7, data, 90); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN); #else - mavlink_log_data_t packet; - packet.ofs = ofs; - packet.id = id; - packet.count = count; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90); + mavlink_log_data_t packet; + packet.ofs = ofs; + packet.id = id; + packet.count = count; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_DATA; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); } /** @@ -81,31 +92,27 @@ static inline uint16_t mavlink_msg_log_data_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t id,uint32_t ofs,uint8_t count,const uint8_t *data) + mavlink_message_t* msg, + uint16_t id,uint32_t ofs,uint8_t count,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_DATA_LEN]; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint16_t(buf, 4, id); - _mav_put_uint8_t(buf, 6, count); - _mav_put_uint8_t_array(buf, 7, data, 90); + char buf[MAVLINK_MSG_ID_LOG_DATA_LEN]; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint16_t(buf, 4, id); + _mav_put_uint8_t(buf, 6, count); + _mav_put_uint8_t_array(buf, 7, data, 90); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_DATA_LEN); #else - mavlink_log_data_t packet; - packet.ofs = ofs; - packet.id = id; - packet.count = count; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90); + mavlink_log_data_t packet; + packet.ofs = ofs; + packet.id = id; + packet.count = count; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_DATA; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); } /** @@ -118,7 +125,7 @@ static inline uint16_t mavlink_msg_log_data_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_log_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_data_t* log_data) { - return mavlink_msg_log_data_pack(system_id, component_id, msg, log_data->id, log_data->ofs, log_data->count, log_data->data); + return mavlink_msg_log_data_pack(system_id, component_id, msg, log_data->id, log_data->ofs, log_data->count, log_data->data); } /** @@ -132,7 +139,7 @@ static inline uint16_t mavlink_msg_log_data_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_log_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_data_t* log_data) { - return mavlink_msg_log_data_pack_chan(system_id, component_id, chan, msg, log_data->id, log_data->ofs, log_data->count, log_data->data); + return mavlink_msg_log_data_pack_chan(system_id, component_id, chan, msg, log_data->id, log_data->ofs, log_data->count, log_data->data); } /** @@ -149,27 +156,33 @@ static inline uint16_t mavlink_msg_log_data_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_log_data_send(mavlink_channel_t chan, uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_DATA_LEN]; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint16_t(buf, 4, id); - _mav_put_uint8_t(buf, 6, count); - _mav_put_uint8_t_array(buf, 7, data, 90); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); + char buf[MAVLINK_MSG_ID_LOG_DATA_LEN]; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint16_t(buf, 4, id); + _mav_put_uint8_t(buf, 6, count); + _mav_put_uint8_t_array(buf, 7, data, 90); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_LEN); + mavlink_log_data_t packet; + packet.ofs = ofs; + packet.id = id; + packet.count = count; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); #endif +} + +/** + * @brief Send a log_data message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_log_data_send_struct(mavlink_channel_t chan, const mavlink_log_data_t* log_data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_log_data_send(chan, log_data->id, log_data->ofs, log_data->count, log_data->data); #else - mavlink_log_data_t packet; - packet.ofs = ofs; - packet.id = id; - packet.count = count; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*90); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_DATA_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)log_data, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); #endif } @@ -184,27 +197,19 @@ static inline void mavlink_msg_log_data_send(mavlink_channel_t chan, uint16_t id static inline void mavlink_msg_log_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t id, uint32_t ofs, uint8_t count, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint16_t(buf, 4, id); - _mav_put_uint8_t(buf, 6, count); - _mav_put_uint8_t_array(buf, 7, data, 90); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint16_t(buf, 4, id); + _mav_put_uint8_t(buf, 6, count); + _mav_put_uint8_t_array(buf, 7, data, 90); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, buf, MAVLINK_MSG_ID_LOG_DATA_LEN); -#endif -#else - mavlink_log_data_t *packet = (mavlink_log_data_t *)msgbuf; - packet->ofs = ofs; - packet->id = id; - packet->count = count; - mav_array_memcpy(packet->data, data, sizeof(uint8_t)*90); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_DATA_LEN); -#endif + mavlink_log_data_t *packet = (mavlink_log_data_t *)msgbuf; + packet->ofs = ofs; + packet->id = id; + packet->count = count; + mav_array_memcpy(packet->data, data, sizeof(uint8_t)*90); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_DATA_LEN, MAVLINK_MSG_ID_LOG_DATA_CRC); #endif } #endif @@ -221,7 +226,7 @@ static inline void mavlink_msg_log_data_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint16_t mavlink_msg_log_data_get_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -231,7 +236,7 @@ static inline uint16_t mavlink_msg_log_data_get_id(const mavlink_message_t* msg) */ static inline uint32_t mavlink_msg_log_data_get_ofs(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -241,7 +246,7 @@ static inline uint32_t mavlink_msg_log_data_get_ofs(const mavlink_message_t* msg */ static inline uint8_t mavlink_msg_log_data_get_count(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 6); + return _MAV_RETURN_uint8_t(msg, 6); } /** @@ -251,7 +256,7 @@ static inline uint8_t mavlink_msg_log_data_get_count(const mavlink_message_t* ms */ static inline uint16_t mavlink_msg_log_data_get_data(const mavlink_message_t* msg, uint8_t *data) { - return _MAV_RETURN_uint8_t_array(msg, data, 90, 7); + return _MAV_RETURN_uint8_t_array(msg, data, 90, 7); } /** @@ -262,12 +267,14 @@ static inline uint16_t mavlink_msg_log_data_get_data(const mavlink_message_t* ms */ static inline void mavlink_msg_log_data_decode(const mavlink_message_t* msg, mavlink_log_data_t* log_data) { -#if MAVLINK_NEED_BYTE_SWAP - log_data->ofs = mavlink_msg_log_data_get_ofs(msg); - log_data->id = mavlink_msg_log_data_get_id(msg); - log_data->count = mavlink_msg_log_data_get_count(msg); - mavlink_msg_log_data_get_data(msg, log_data->data); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + log_data->ofs = mavlink_msg_log_data_get_ofs(msg); + log_data->id = mavlink_msg_log_data_get_id(msg); + log_data->count = mavlink_msg_log_data_get_count(msg); + mavlink_msg_log_data_get_data(msg, log_data->data); #else - memcpy(log_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_DATA_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_DATA_LEN? msg->len : MAVLINK_MSG_ID_LOG_DATA_LEN; + memset(log_data, 0, MAVLINK_MSG_ID_LOG_DATA_LEN); + memcpy(log_data, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_entry.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_entry.h index c179eba..2e697d5 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_entry.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_entry.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE LOG_ENTRY PACKING #define MAVLINK_MSG_ID_LOG_ENTRY 118 -typedef struct __mavlink_log_entry_t -{ +MAVPACKED( +typedef struct __mavlink_log_entry_t { uint32_t time_utc; /*< UTC timestamp of log in seconds since 1970, or 0 if not available*/ uint32_t size; /*< Size of the log (may be approximate) in bytes*/ uint16_t id; /*< Log id*/ uint16_t num_logs; /*< Total number of logs*/ uint16_t last_log_num; /*< High log number*/ -} mavlink_log_entry_t; +}) mavlink_log_entry_t; #define MAVLINK_MSG_ID_LOG_ENTRY_LEN 14 +#define MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN 14 #define MAVLINK_MSG_ID_118_LEN 14 +#define MAVLINK_MSG_ID_118_MIN_LEN 14 #define MAVLINK_MSG_ID_LOG_ENTRY_CRC 56 #define MAVLINK_MSG_ID_118_CRC 56 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \ - "LOG_ENTRY", \ - 5, \ - { { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \ + 118, \ + "LOG_ENTRY", \ + 5, \ + { { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \ { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \ { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \ { "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \ { "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOG_ENTRY { \ + "LOG_ENTRY", \ + 5, \ + { { "time_utc", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_entry_t, time_utc) }, \ + { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_entry_t, size) }, \ + { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_entry_t, id) }, \ + { "num_logs", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_log_entry_t, num_logs) }, \ + { "last_log_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_log_entry_t, last_log_num) }, \ + } \ +} +#endif /** * @brief Pack a log_entry message @@ -45,34 +61,30 @@ typedef struct __mavlink_log_entry_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_entry_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size) + uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN]; - _mav_put_uint32_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 4, size); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint16_t(buf, 10, num_logs); - _mav_put_uint16_t(buf, 12, last_log_num); + char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN]; + _mav_put_uint32_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 4, size); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint16_t(buf, 10, num_logs); + _mav_put_uint16_t(buf, 12, last_log_num); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN); #else - mavlink_log_entry_t packet; - packet.time_utc = time_utc; - packet.size = size; - packet.id = id; - packet.num_logs = num_logs; - packet.last_log_num = last_log_num; + mavlink_log_entry_t packet; + packet.time_utc = time_utc; + packet.size = size; + packet.id = id; + packet.num_logs = num_logs; + packet.last_log_num = last_log_num; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ENTRY_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); } /** @@ -89,35 +101,31 @@ static inline uint16_t mavlink_msg_log_entry_pack(uint8_t system_id, uint8_t com * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_entry_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t id,uint16_t num_logs,uint16_t last_log_num,uint32_t time_utc,uint32_t size) + mavlink_message_t* msg, + uint16_t id,uint16_t num_logs,uint16_t last_log_num,uint32_t time_utc,uint32_t size) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN]; - _mav_put_uint32_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 4, size); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint16_t(buf, 10, num_logs); - _mav_put_uint16_t(buf, 12, last_log_num); + char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN]; + _mav_put_uint32_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 4, size); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint16_t(buf, 10, num_logs); + _mav_put_uint16_t(buf, 12, last_log_num); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN); #else - mavlink_log_entry_t packet; - packet.time_utc = time_utc; - packet.size = size; - packet.id = id; - packet.num_logs = num_logs; - packet.last_log_num = last_log_num; + mavlink_log_entry_t packet; + packet.time_utc = time_utc; + packet.size = size; + packet.id = id; + packet.num_logs = num_logs; + packet.last_log_num = last_log_num; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ENTRY_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_ENTRY; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); } /** @@ -130,7 +138,7 @@ static inline uint16_t mavlink_msg_log_entry_pack_chan(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_log_entry_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry) { - return mavlink_msg_log_entry_pack(system_id, component_id, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size); + return mavlink_msg_log_entry_pack(system_id, component_id, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size); } /** @@ -144,7 +152,7 @@ static inline uint16_t mavlink_msg_log_entry_encode(uint8_t system_id, uint8_t c */ static inline uint16_t mavlink_msg_log_entry_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_entry_t* log_entry) { - return mavlink_msg_log_entry_pack_chan(system_id, component_id, chan, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size); + return mavlink_msg_log_entry_pack_chan(system_id, component_id, chan, msg, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size); } /** @@ -162,31 +170,37 @@ static inline uint16_t mavlink_msg_log_entry_encode_chan(uint8_t system_id, uint static inline void mavlink_msg_log_entry_send(mavlink_channel_t chan, uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN]; - _mav_put_uint32_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 4, size); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint16_t(buf, 10, num_logs); - _mav_put_uint16_t(buf, 12, last_log_num); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); + char buf[MAVLINK_MSG_ID_LOG_ENTRY_LEN]; + _mav_put_uint32_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 4, size); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint16_t(buf, 10, num_logs); + _mav_put_uint16_t(buf, 12, last_log_num); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN); + mavlink_log_entry_t packet; + packet.time_utc = time_utc; + packet.size = size; + packet.id = id; + packet.num_logs = num_logs; + packet.last_log_num = last_log_num; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)&packet, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); #endif +} + +/** + * @brief Send a log_entry message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_log_entry_send_struct(mavlink_channel_t chan, const mavlink_log_entry_t* log_entry) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_log_entry_send(chan, log_entry->id, log_entry->num_logs, log_entry->last_log_num, log_entry->time_utc, log_entry->size); #else - mavlink_log_entry_t packet; - packet.time_utc = time_utc; - packet.size = size; - packet.id = id; - packet.num_logs = num_logs; - packet.last_log_num = last_log_num; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)&packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)&packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)log_entry, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); #endif } @@ -201,31 +215,23 @@ static inline void mavlink_msg_log_entry_send(mavlink_channel_t chan, uint16_t i static inline void mavlink_msg_log_entry_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t id, uint16_t num_logs, uint16_t last_log_num, uint32_t time_utc, uint32_t size) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_utc); - _mav_put_uint32_t(buf, 4, size); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint16_t(buf, 10, num_logs); - _mav_put_uint16_t(buf, 12, last_log_num); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_utc); + _mav_put_uint32_t(buf, 4, size); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint16_t(buf, 10, num_logs); + _mav_put_uint16_t(buf, 12, last_log_num); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, buf, MAVLINK_MSG_ID_LOG_ENTRY_LEN); -#endif -#else - mavlink_log_entry_t *packet = (mavlink_log_entry_t *)msgbuf; - packet->time_utc = time_utc; - packet->size = size; - packet->id = id; - packet->num_logs = num_logs; - packet->last_log_num = last_log_num; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)packet, MAVLINK_MSG_ID_LOG_ENTRY_LEN); -#endif + mavlink_log_entry_t *packet = (mavlink_log_entry_t *)msgbuf; + packet->time_utc = time_utc; + packet->size = size; + packet->id = id; + packet->num_logs = num_logs; + packet->last_log_num = last_log_num; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ENTRY, (const char *)packet, MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN, MAVLINK_MSG_ID_LOG_ENTRY_LEN, MAVLINK_MSG_ID_LOG_ENTRY_CRC); #endif } #endif @@ -242,7 +248,7 @@ static inline void mavlink_msg_log_entry_send_buf(mavlink_message_t *msgbuf, mav */ static inline uint16_t mavlink_msg_log_entry_get_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -252,7 +258,7 @@ static inline uint16_t mavlink_msg_log_entry_get_id(const mavlink_message_t* msg */ static inline uint16_t mavlink_msg_log_entry_get_num_logs(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 10); + return _MAV_RETURN_uint16_t(msg, 10); } /** @@ -262,7 +268,7 @@ static inline uint16_t mavlink_msg_log_entry_get_num_logs(const mavlink_message_ */ static inline uint16_t mavlink_msg_log_entry_get_last_log_num(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 12); + return _MAV_RETURN_uint16_t(msg, 12); } /** @@ -272,7 +278,7 @@ static inline uint16_t mavlink_msg_log_entry_get_last_log_num(const mavlink_mess */ static inline uint32_t mavlink_msg_log_entry_get_time_utc(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -282,7 +288,7 @@ static inline uint32_t mavlink_msg_log_entry_get_time_utc(const mavlink_message_ */ static inline uint32_t mavlink_msg_log_entry_get_size(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 4); + return _MAV_RETURN_uint32_t(msg, 4); } /** @@ -293,13 +299,15 @@ static inline uint32_t mavlink_msg_log_entry_get_size(const mavlink_message_t* m */ static inline void mavlink_msg_log_entry_decode(const mavlink_message_t* msg, mavlink_log_entry_t* log_entry) { -#if MAVLINK_NEED_BYTE_SWAP - log_entry->time_utc = mavlink_msg_log_entry_get_time_utc(msg); - log_entry->size = mavlink_msg_log_entry_get_size(msg); - log_entry->id = mavlink_msg_log_entry_get_id(msg); - log_entry->num_logs = mavlink_msg_log_entry_get_num_logs(msg); - log_entry->last_log_num = mavlink_msg_log_entry_get_last_log_num(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + log_entry->time_utc = mavlink_msg_log_entry_get_time_utc(msg); + log_entry->size = mavlink_msg_log_entry_get_size(msg); + log_entry->id = mavlink_msg_log_entry_get_id(msg); + log_entry->num_logs = mavlink_msg_log_entry_get_num_logs(msg); + log_entry->last_log_num = mavlink_msg_log_entry_get_last_log_num(msg); #else - memcpy(log_entry, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_ENTRY_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_ENTRY_LEN? msg->len : MAVLINK_MSG_ID_LOG_ENTRY_LEN; + memset(log_entry, 0, MAVLINK_MSG_ID_LOG_ENTRY_LEN); + memcpy(log_entry, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_erase.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_erase.h index 2cd145e..d815b6c 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_erase.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_erase.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE LOG_ERASE PACKING #define MAVLINK_MSG_ID_LOG_ERASE 121 -typedef struct __mavlink_log_erase_t -{ +MAVPACKED( +typedef struct __mavlink_log_erase_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_log_erase_t; +}) mavlink_log_erase_t; #define MAVLINK_MSG_ID_LOG_ERASE_LEN 2 +#define MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN 2 #define MAVLINK_MSG_ID_121_LEN 2 +#define MAVLINK_MSG_ID_121_MIN_LEN 2 #define MAVLINK_MSG_ID_LOG_ERASE_CRC 237 #define MAVLINK_MSG_ID_121_CRC 237 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOG_ERASE { \ - "LOG_ERASE", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \ + 121, \ + "LOG_ERASE", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_erase_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOG_ERASE { \ + "LOG_ERASE", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_erase_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_erase_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a log_erase message @@ -36,28 +49,24 @@ typedef struct __mavlink_log_erase_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_erase_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) + uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN); #else - mavlink_log_erase_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_erase_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_ERASE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ERASE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_ERASE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_log_erase_pack(uint8_t system_id, uint8_t com * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_erase_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_ERASE_LEN); #else - mavlink_log_erase_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_erase_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_ERASE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_ERASE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ERASE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_ERASE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_log_erase_pack_chan(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_log_erase_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase) { - return mavlink_msg_log_erase_pack(system_id, component_id, msg, log_erase->target_system, log_erase->target_component); + return mavlink_msg_log_erase_pack(system_id, component_id, msg, log_erase->target_system, log_erase->target_component); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_log_erase_encode(uint8_t system_id, uint8_t c */ static inline uint16_t mavlink_msg_log_erase_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_erase_t* log_erase) { - return mavlink_msg_log_erase_pack_chan(system_id, component_id, chan, msg, log_erase->target_system, log_erase->target_component); + return mavlink_msg_log_erase_pack_chan(system_id, component_id, chan, msg, log_erase->target_system, log_erase->target_component); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_log_erase_encode_chan(uint8_t system_id, uint static inline void mavlink_msg_log_erase_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_LOG_ERASE_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_LEN); + mavlink_log_erase_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)&packet, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); #endif -#else - mavlink_log_erase_t packet; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)&packet, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); +/** + * @brief Send a log_erase message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_log_erase_send_struct(mavlink_channel_t chan, const mavlink_log_erase_t* log_erase) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_log_erase_send(chan, log_erase->target_system, log_erase->target_component); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)&packet, MAVLINK_MSG_ID_LOG_ERASE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)log_erase, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_log_erase_send(mavlink_channel_t chan, uint8_t ta static inline void mavlink_msg_log_erase_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, buf, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); #else - mavlink_log_erase_t *packet = (mavlink_log_erase_t *)msgbuf; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_log_erase_t *packet = (mavlink_log_erase_t *)msgbuf; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)packet, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)packet, MAVLINK_MSG_ID_LOG_ERASE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_ERASE, (const char *)packet, MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN, MAVLINK_MSG_ID_LOG_ERASE_LEN, MAVLINK_MSG_ID_LOG_ERASE_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_log_erase_send_buf(mavlink_message_t *msgbuf, mav */ static inline uint8_t mavlink_msg_log_erase_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint8_t mavlink_msg_log_erase_get_target_system(const mavlink_mess */ static inline uint8_t mavlink_msg_log_erase_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -224,10 +227,12 @@ static inline uint8_t mavlink_msg_log_erase_get_target_component(const mavlink_m */ static inline void mavlink_msg_log_erase_decode(const mavlink_message_t* msg, mavlink_log_erase_t* log_erase) { -#if MAVLINK_NEED_BYTE_SWAP - log_erase->target_system = mavlink_msg_log_erase_get_target_system(msg); - log_erase->target_component = mavlink_msg_log_erase_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + log_erase->target_system = mavlink_msg_log_erase_get_target_system(msg); + log_erase->target_component = mavlink_msg_log_erase_get_target_component(msg); #else - memcpy(log_erase, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_ERASE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_ERASE_LEN? msg->len : MAVLINK_MSG_ID_LOG_ERASE_LEN; + memset(log_erase, 0, MAVLINK_MSG_ID_LOG_ERASE_LEN); + memcpy(log_erase, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_data.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_data.h index 5f4ae58..da7535b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_data.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_data.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE LOG_REQUEST_DATA PACKING #define MAVLINK_MSG_ID_LOG_REQUEST_DATA 119 -typedef struct __mavlink_log_request_data_t -{ +MAVPACKED( +typedef struct __mavlink_log_request_data_t { uint32_t ofs; /*< Offset into the log*/ uint32_t count; /*< Number of bytes*/ uint16_t id; /*< Log id (from LOG_ENTRY reply)*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_log_request_data_t; +}) mavlink_log_request_data_t; #define MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN 12 +#define MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN 12 #define MAVLINK_MSG_ID_119_LEN 12 +#define MAVLINK_MSG_ID_119_MIN_LEN 12 #define MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC 116 #define MAVLINK_MSG_ID_119_CRC 116 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \ - "LOG_REQUEST_DATA", \ - 5, \ - { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \ + 119, \ + "LOG_REQUEST_DATA", \ + 5, \ + { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \ { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \ { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA { \ + "LOG_REQUEST_DATA", \ + 5, \ + { { "ofs", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_log_request_data_t, ofs) }, \ + { "count", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_log_request_data_t, count) }, \ + { "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_log_request_data_t, id) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_log_request_data_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_log_request_data_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a log_request_data message @@ -45,34 +61,30 @@ typedef struct __mavlink_log_request_data_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count) + uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN]; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint32_t(buf, 4, count); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint8_t(buf, 10, target_system); - _mav_put_uint8_t(buf, 11, target_component); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN]; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint32_t(buf, 4, count); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint8_t(buf, 10, target_system); + _mav_put_uint8_t(buf, 11, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); #else - mavlink_log_request_data_t packet; - packet.ofs = ofs; - packet.count = count; - packet.id = id; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_request_data_t packet; + packet.ofs = ofs; + packet.count = count; + packet.id = id; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); } /** @@ -89,35 +101,31 @@ static inline uint16_t mavlink_msg_log_request_data_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t id,uint32_t ofs,uint32_t count) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t id,uint32_t ofs,uint32_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN]; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint32_t(buf, 4, count); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint8_t(buf, 10, target_system); - _mav_put_uint8_t(buf, 11, target_component); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN]; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint32_t(buf, 4, count); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint8_t(buf, 10, target_system); + _mav_put_uint8_t(buf, 11, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); #else - mavlink_log_request_data_t packet; - packet.ofs = ofs; - packet.count = count; - packet.id = id; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_request_data_t packet; + packet.ofs = ofs; + packet.count = count; + packet.id = id; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_DATA; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); } /** @@ -130,7 +138,7 @@ static inline uint16_t mavlink_msg_log_request_data_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_log_request_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data) { - return mavlink_msg_log_request_data_pack(system_id, component_id, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count); + return mavlink_msg_log_request_data_pack(system_id, component_id, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count); } /** @@ -144,7 +152,7 @@ static inline uint16_t mavlink_msg_log_request_data_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_log_request_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_data_t* log_request_data) { - return mavlink_msg_log_request_data_pack_chan(system_id, component_id, chan, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count); + return mavlink_msg_log_request_data_pack_chan(system_id, component_id, chan, msg, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count); } /** @@ -162,31 +170,37 @@ static inline uint16_t mavlink_msg_log_request_data_encode_chan(uint8_t system_i static inline void mavlink_msg_log_request_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN]; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint32_t(buf, 4, count); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint8_t(buf, 10, target_system); - _mav_put_uint8_t(buf, 11, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN]; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint32_t(buf, 4, count); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint8_t(buf, 10, target_system); + _mav_put_uint8_t(buf, 11, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); + mavlink_log_request_data_t packet; + packet.ofs = ofs; + packet.count = count; + packet.id = id; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); #endif +} + +/** + * @brief Send a log_request_data message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_log_request_data_send_struct(mavlink_channel_t chan, const mavlink_log_request_data_t* log_request_data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_log_request_data_send(chan, log_request_data->target_system, log_request_data->target_component, log_request_data->id, log_request_data->ofs, log_request_data->count); #else - mavlink_log_request_data_t packet; - packet.ofs = ofs; - packet.count = count; - packet.id = id; - packet.target_system = target_system; - packet.target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)log_request_data, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); #endif } @@ -201,31 +215,23 @@ static inline void mavlink_msg_log_request_data_send(mavlink_channel_t chan, uin static inline void mavlink_msg_log_request_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, uint32_t ofs, uint32_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, ofs); - _mav_put_uint32_t(buf, 4, count); - _mav_put_uint16_t(buf, 8, id); - _mav_put_uint8_t(buf, 10, target_system); - _mav_put_uint8_t(buf, 11, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, ofs); + _mav_put_uint32_t(buf, 4, count); + _mav_put_uint16_t(buf, 8, id); + _mav_put_uint8_t(buf, 10, target_system); + _mav_put_uint8_t(buf, 11, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, buf, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); -#endif -#else - mavlink_log_request_data_t *packet = (mavlink_log_request_data_t *)msgbuf; - packet->ofs = ofs; - packet->count = count; - packet->id = id; - packet->target_system = target_system; - packet->target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); -#endif + mavlink_log_request_data_t *packet = (mavlink_log_request_data_t *)msgbuf; + packet->ofs = ofs; + packet->count = count; + packet->id = id; + packet->target_system = target_system; + packet->target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_DATA, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN, MAVLINK_MSG_ID_LOG_REQUEST_DATA_CRC); #endif } #endif @@ -242,7 +248,7 @@ static inline void mavlink_msg_log_request_data_send_buf(mavlink_message_t *msgb */ static inline uint8_t mavlink_msg_log_request_data_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 10); + return _MAV_RETURN_uint8_t(msg, 10); } /** @@ -252,7 +258,7 @@ static inline uint8_t mavlink_msg_log_request_data_get_target_system(const mavli */ static inline uint8_t mavlink_msg_log_request_data_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 11); + return _MAV_RETURN_uint8_t(msg, 11); } /** @@ -262,7 +268,7 @@ static inline uint8_t mavlink_msg_log_request_data_get_target_component(const ma */ static inline uint16_t mavlink_msg_log_request_data_get_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -272,7 +278,7 @@ static inline uint16_t mavlink_msg_log_request_data_get_id(const mavlink_message */ static inline uint32_t mavlink_msg_log_request_data_get_ofs(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -282,7 +288,7 @@ static inline uint32_t mavlink_msg_log_request_data_get_ofs(const mavlink_messag */ static inline uint32_t mavlink_msg_log_request_data_get_count(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 4); + return _MAV_RETURN_uint32_t(msg, 4); } /** @@ -293,13 +299,15 @@ static inline uint32_t mavlink_msg_log_request_data_get_count(const mavlink_mess */ static inline void mavlink_msg_log_request_data_decode(const mavlink_message_t* msg, mavlink_log_request_data_t* log_request_data) { -#if MAVLINK_NEED_BYTE_SWAP - log_request_data->ofs = mavlink_msg_log_request_data_get_ofs(msg); - log_request_data->count = mavlink_msg_log_request_data_get_count(msg); - log_request_data->id = mavlink_msg_log_request_data_get_id(msg); - log_request_data->target_system = mavlink_msg_log_request_data_get_target_system(msg); - log_request_data->target_component = mavlink_msg_log_request_data_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + log_request_data->ofs = mavlink_msg_log_request_data_get_ofs(msg); + log_request_data->count = mavlink_msg_log_request_data_get_count(msg); + log_request_data->id = mavlink_msg_log_request_data_get_id(msg); + log_request_data->target_system = mavlink_msg_log_request_data_get_target_system(msg); + log_request_data->target_component = mavlink_msg_log_request_data_get_target_component(msg); #else - memcpy(log_request_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN; + memset(log_request_data, 0, MAVLINK_MSG_ID_LOG_REQUEST_DATA_LEN); + memcpy(log_request_data, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_end.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_end.h index 760fe4a..be61930 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_end.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_end.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE LOG_REQUEST_END PACKING #define MAVLINK_MSG_ID_LOG_REQUEST_END 122 -typedef struct __mavlink_log_request_end_t -{ +MAVPACKED( +typedef struct __mavlink_log_request_end_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_log_request_end_t; +}) mavlink_log_request_end_t; #define MAVLINK_MSG_ID_LOG_REQUEST_END_LEN 2 +#define MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN 2 #define MAVLINK_MSG_ID_122_LEN 2 +#define MAVLINK_MSG_ID_122_MIN_LEN 2 #define MAVLINK_MSG_ID_LOG_REQUEST_END_CRC 203 #define MAVLINK_MSG_ID_122_CRC 203 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOG_REQUEST_END { \ - "LOG_REQUEST_END", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \ + 122, \ + "LOG_REQUEST_END", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_request_end_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_END { \ + "LOG_REQUEST_END", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_log_request_end_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_log_request_end_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a log_request_end message @@ -36,28 +49,24 @@ typedef struct __mavlink_log_request_end_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_end_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) + uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); #else - mavlink_log_request_end_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_request_end_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_log_request_end_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_end_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); #else - mavlink_log_request_end_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_request_end_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_END; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_log_request_end_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_log_request_end_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end) { - return mavlink_msg_log_request_end_pack(system_id, component_id, msg, log_request_end->target_system, log_request_end->target_component); + return mavlink_msg_log_request_end_pack(system_id, component_id, msg, log_request_end->target_system, log_request_end->target_component); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_log_request_end_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_log_request_end_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_end_t* log_request_end) { - return mavlink_msg_log_request_end_pack_chan(system_id, component_id, chan, msg, log_request_end->target_system, log_request_end->target_component); + return mavlink_msg_log_request_end_pack_chan(system_id, component_id, chan, msg, log_request_end->target_system, log_request_end->target_component); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_log_request_end_encode_chan(uint8_t system_id static inline void mavlink_msg_log_request_end_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_END_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); + mavlink_log_request_end_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); #endif -#else - mavlink_log_request_end_t packet; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); +/** + * @brief Send a log_request_end message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_log_request_end_send_struct(mavlink_channel_t chan, const mavlink_log_request_end_t* log_request_end) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_log_request_end_send(chan, log_request_end->target_system, log_request_end->target_component); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)log_request_end, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_log_request_end_send(mavlink_channel_t chan, uint static inline void mavlink_msg_log_request_end_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, buf, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); #else - mavlink_log_request_end_t *packet = (mavlink_log_request_end_t *)msgbuf; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_log_request_end_t *packet = (mavlink_log_request_end_t *)msgbuf; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_END, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN, MAVLINK_MSG_ID_LOG_REQUEST_END_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_log_request_end_send_buf(mavlink_message_t *msgbu */ static inline uint8_t mavlink_msg_log_request_end_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint8_t mavlink_msg_log_request_end_get_target_system(const mavlin */ static inline uint8_t mavlink_msg_log_request_end_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -224,10 +227,12 @@ static inline uint8_t mavlink_msg_log_request_end_get_target_component(const mav */ static inline void mavlink_msg_log_request_end_decode(const mavlink_message_t* msg, mavlink_log_request_end_t* log_request_end) { -#if MAVLINK_NEED_BYTE_SWAP - log_request_end->target_system = mavlink_msg_log_request_end_get_target_system(msg); - log_request_end->target_component = mavlink_msg_log_request_end_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + log_request_end->target_system = mavlink_msg_log_request_end_get_target_system(msg); + log_request_end->target_component = mavlink_msg_log_request_end_get_target_component(msg); #else - memcpy(log_request_end, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_END_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_END_LEN; + memset(log_request_end, 0, MAVLINK_MSG_ID_LOG_REQUEST_END_LEN); + memcpy(log_request_end, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_list.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_list.h index 0b0f304..fba75c7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_list.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_log_request_list.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE LOG_REQUEST_LIST PACKING #define MAVLINK_MSG_ID_LOG_REQUEST_LIST 117 -typedef struct __mavlink_log_request_list_t -{ +MAVPACKED( +typedef struct __mavlink_log_request_list_t { uint16_t start; /*< First log id (0 for first available)*/ uint16_t end; /*< Last log id (0xffff for last available)*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_log_request_list_t; +}) mavlink_log_request_list_t; #define MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN 6 +#define MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN 6 #define MAVLINK_MSG_ID_117_LEN 6 +#define MAVLINK_MSG_ID_117_MIN_LEN 6 #define MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC 128 #define MAVLINK_MSG_ID_117_CRC 128 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \ - "LOG_REQUEST_LIST", \ - 4, \ - { { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \ + 117, \ + "LOG_REQUEST_LIST", \ + 4, \ + { { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \ { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \ + "LOG_REQUEST_LIST", \ + 4, \ + { { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \ + { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a log_request_list message @@ -42,32 +57,28 @@ typedef struct __mavlink_log_request_list_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end) + uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN]; - _mav_put_uint16_t(buf, 0, start); - _mav_put_uint16_t(buf, 2, end); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN]; + _mav_put_uint16_t(buf, 0, start); + _mav_put_uint16_t(buf, 2, end); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); #else - mavlink_log_request_list_t packet; - packet.start = start; - packet.end = end; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_request_list_t packet; + packet.start = start; + packet.end = end; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_log_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t start,uint16_t end) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t start,uint16_t end) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN]; - _mav_put_uint16_t(buf, 0, start); - _mav_put_uint16_t(buf, 2, end); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN]; + _mav_put_uint16_t(buf, 0, start); + _mav_put_uint16_t(buf, 2, end); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); #else - mavlink_log_request_list_t packet; - packet.start = start; - packet.end = end; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_log_request_list_t packet; + packet.start = start; + packet.end = end; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_LOG_REQUEST_LIST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_log_request_list_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_log_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list) { - return mavlink_msg_log_request_list_pack(system_id, component_id, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end); + return mavlink_msg_log_request_list_pack(system_id, component_id, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_log_request_list_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_log_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_log_request_list_t* log_request_list) { - return mavlink_msg_log_request_list_pack_chan(system_id, component_id, chan, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end); + return mavlink_msg_log_request_list_pack_chan(system_id, component_id, chan, msg, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_log_request_list_encode_chan(uint8_t system_i static inline void mavlink_msg_log_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN]; - _mav_put_uint16_t(buf, 0, start); - _mav_put_uint16_t(buf, 2, end); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); + char buf[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN]; + _mav_put_uint16_t(buf, 0, start); + _mav_put_uint16_t(buf, 2, end); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); + mavlink_log_request_list_t packet; + packet.start = start; + packet.end = end; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); #endif +} + +/** + * @brief Send a log_request_list message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_log_request_list_send_struct(mavlink_channel_t chan, const mavlink_log_request_list_t* log_request_list) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_log_request_list_send(chan, log_request_list->target_system, log_request_list->target_component, log_request_list->start, log_request_list->end); #else - mavlink_log_request_list_t packet; - packet.start = start; - packet.end = end; - packet.target_system = target_system; - packet.target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)log_request_list, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_log_request_list_send(mavlink_channel_t chan, uin static inline void mavlink_msg_log_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t start, uint16_t end) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, start); - _mav_put_uint16_t(buf, 2, end); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); -#endif -#else - mavlink_log_request_list_t *packet = (mavlink_log_request_list_t *)msgbuf; - packet->start = start; - packet->end = end; - packet->target_system = target_system; - packet->target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, start); + _mav_put_uint16_t(buf, 2, end); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, buf, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); -#endif + mavlink_log_request_list_t *packet = (mavlink_log_request_list_t *)msgbuf; + packet->start = start; + packet->end = end; + packet->target_system = target_system; + packet->target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOG_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_log_request_list_send_buf(mavlink_message_t *msgb */ static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -239,7 +244,7 @@ static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavli */ static inline uint8_t mavlink_msg_log_request_list_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -249,7 +254,7 @@ static inline uint8_t mavlink_msg_log_request_list_get_target_component(const ma */ static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -259,7 +264,7 @@ static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_mess */ static inline uint16_t mavlink_msg_log_request_list_get_end(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 2); + return _MAV_RETURN_uint16_t(msg, 2); } /** @@ -270,12 +275,14 @@ static inline uint16_t mavlink_msg_log_request_list_get_end(const mavlink_messag */ static inline void mavlink_msg_log_request_list_decode(const mavlink_message_t* msg, mavlink_log_request_list_t* log_request_list) { -#if MAVLINK_NEED_BYTE_SWAP - log_request_list->start = mavlink_msg_log_request_list_get_start(msg); - log_request_list->end = mavlink_msg_log_request_list_get_end(msg); - log_request_list->target_system = mavlink_msg_log_request_list_get_target_system(msg); - log_request_list->target_component = mavlink_msg_log_request_list_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + log_request_list->start = mavlink_msg_log_request_list_get_start(msg); + log_request_list->end = mavlink_msg_log_request_list_get_end(msg); + log_request_list->target_system = mavlink_msg_log_request_list_get_target_system(msg); + log_request_list->target_component = mavlink_msg_log_request_list_get_target_component(msg); #else - memcpy(log_request_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN; + memset(log_request_list, 0, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN); + memcpy(log_request_list, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_control.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_control.h index 8ce31ff..0589d80 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_control.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_control.h @@ -1,29 +1,34 @@ +#pragma once // MESSAGE MANUAL_CONTROL PACKING #define MAVLINK_MSG_ID_MANUAL_CONTROL 69 -typedef struct __mavlink_manual_control_t -{ +MAVPACKED( +typedef struct __mavlink_manual_control_t { int16_t x; /*< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.*/ int16_t y; /*< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.*/ int16_t z; /*< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust.*/ int16_t r; /*< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.*/ uint16_t buttons; /*< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.*/ uint8_t target; /*< The system to be controlled.*/ -} mavlink_manual_control_t; +}) mavlink_manual_control_t; #define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11 +#define MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN 11 #define MAVLINK_MSG_ID_69_LEN 11 +#define MAVLINK_MSG_ID_69_MIN_LEN 11 #define MAVLINK_MSG_ID_MANUAL_CONTROL_CRC 243 #define MAVLINK_MSG_ID_69_CRC 243 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \ - "MANUAL_CONTROL", \ - 6, \ - { { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \ + 69, \ + "MANUAL_CONTROL", \ + 6, \ + { { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \ { "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \ { "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \ { "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \ @@ -31,7 +36,19 @@ typedef struct __mavlink_manual_control_t { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \ + "MANUAL_CONTROL", \ + 6, \ + { { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \ + { "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \ + { "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \ + { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \ + } \ +} +#endif /** * @brief Pack a manual_control message @@ -48,36 +65,32 @@ typedef struct __mavlink_manual_control_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons) + uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; - _mav_put_int16_t(buf, 0, x); - _mav_put_int16_t(buf, 2, y); - _mav_put_int16_t(buf, 4, z); - _mav_put_int16_t(buf, 6, r); - _mav_put_uint16_t(buf, 8, buttons); - _mav_put_uint8_t(buf, 10, target); + char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; + _mav_put_int16_t(buf, 0, x); + _mav_put_int16_t(buf, 2, y); + _mav_put_int16_t(buf, 4, z); + _mav_put_int16_t(buf, 6, r); + _mav_put_uint16_t(buf, 8, buttons); + _mav_put_uint8_t(buf, 10, target); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #else - mavlink_manual_control_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.r = r; - packet.buttons = buttons; - packet.target = target; + mavlink_manual_control_t packet; + packet.x = x; + packet.y = y; + packet.z = z; + packet.r = r; + packet.buttons = buttons; + packet.target = target; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); } /** @@ -95,37 +108,33 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_ * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target,int16_t x,int16_t y,int16_t z,int16_t r,uint16_t buttons) + mavlink_message_t* msg, + uint8_t target,int16_t x,int16_t y,int16_t z,int16_t r,uint16_t buttons) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; - _mav_put_int16_t(buf, 0, x); - _mav_put_int16_t(buf, 2, y); - _mav_put_int16_t(buf, 4, z); - _mav_put_int16_t(buf, 6, r); - _mav_put_uint16_t(buf, 8, buttons); - _mav_put_uint8_t(buf, 10, target); + char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; + _mav_put_int16_t(buf, 0, x); + _mav_put_int16_t(buf, 2, y); + _mav_put_int16_t(buf, 4, z); + _mav_put_int16_t(buf, 6, r); + _mav_put_uint16_t(buf, 8, buttons); + _mav_put_uint8_t(buf, 10, target); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #else - mavlink_manual_control_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.r = r; - packet.buttons = buttons; - packet.target = target; + mavlink_manual_control_t packet; + packet.x = x; + packet.y = y; + packet.z = z; + packet.r = r; + packet.buttons = buttons; + packet.target = target; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); } /** @@ -138,7 +147,7 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u */ static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control) { - return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons); + return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons); } /** @@ -152,7 +161,7 @@ static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_manual_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control) { - return mavlink_msg_manual_control_pack_chan(system_id, component_id, chan, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons); + return mavlink_msg_manual_control_pack_chan(system_id, component_id, chan, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons); } /** @@ -171,33 +180,39 @@ static inline uint16_t mavlink_msg_manual_control_encode_chan(uint8_t system_id, static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; - _mav_put_int16_t(buf, 0, x); - _mav_put_int16_t(buf, 2, y); - _mav_put_int16_t(buf, 4, z); - _mav_put_int16_t(buf, 6, r); - _mav_put_uint16_t(buf, 8, buttons); - _mav_put_uint8_t(buf, 10, target); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); + char buf[MAVLINK_MSG_ID_MANUAL_CONTROL_LEN]; + _mav_put_int16_t(buf, 0, x); + _mav_put_int16_t(buf, 2, y); + _mav_put_int16_t(buf, 4, z); + _mav_put_int16_t(buf, 6, r); + _mav_put_uint16_t(buf, 8, buttons); + _mav_put_uint8_t(buf, 10, target); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); + mavlink_manual_control_t packet; + packet.x = x; + packet.y = y; + packet.z = z; + packet.r = r; + packet.buttons = buttons; + packet.target = target; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); #endif +} + +/** + * @brief Send a manual_control message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_manual_control_send_struct(mavlink_channel_t chan, const mavlink_manual_control_t* manual_control) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_manual_control_send(chan, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons); #else - mavlink_manual_control_t packet; - packet.x = x; - packet.y = y; - packet.z = z; - packet.r = r; - packet.buttons = buttons; - packet.target = target; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)manual_control, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); #endif } @@ -212,33 +227,25 @@ static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8 static inline void mavlink_msg_manual_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int16_t(buf, 0, x); - _mav_put_int16_t(buf, 2, y); - _mav_put_int16_t(buf, 4, z); - _mav_put_int16_t(buf, 6, r); - _mav_put_uint16_t(buf, 8, buttons); - _mav_put_uint8_t(buf, 10, target); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); + char *buf = (char *)msgbuf; + _mav_put_int16_t(buf, 0, x); + _mav_put_int16_t(buf, 2, y); + _mav_put_int16_t(buf, 4, z); + _mav_put_int16_t(buf, 6, r); + _mav_put_uint16_t(buf, 8, buttons); + _mav_put_uint8_t(buf, 10, target); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); -#endif -#else - mavlink_manual_control_t *packet = (mavlink_manual_control_t *)msgbuf; - packet->x = x; - packet->y = y; - packet->z = z; - packet->r = r; - packet->buttons = buttons; - packet->target = target; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); -#endif + mavlink_manual_control_t *packet = (mavlink_manual_control_t *)msgbuf; + packet->x = x; + packet->y = y; + packet->z = z; + packet->r = r; + packet->buttons = buttons; + packet->target = target; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN, MAVLINK_MSG_ID_MANUAL_CONTROL_CRC); #endif } #endif @@ -255,7 +262,7 @@ static inline void mavlink_msg_manual_control_send_buf(mavlink_message_t *msgbuf */ static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 10); + return _MAV_RETURN_uint8_t(msg, 10); } /** @@ -265,7 +272,7 @@ static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_messag */ static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 0); + return _MAV_RETURN_int16_t(msg, 0); } /** @@ -275,7 +282,7 @@ static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* */ static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 2); + return _MAV_RETURN_int16_t(msg, 2); } /** @@ -285,7 +292,7 @@ static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* */ static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 4); + return _MAV_RETURN_int16_t(msg, 4); } /** @@ -295,7 +302,7 @@ static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* */ static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 6); + return _MAV_RETURN_int16_t(msg, 6); } /** @@ -305,7 +312,7 @@ static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* */ static inline uint16_t mavlink_msg_manual_control_get_buttons(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -316,14 +323,16 @@ static inline uint16_t mavlink_msg_manual_control_get_buttons(const mavlink_mess */ static inline void mavlink_msg_manual_control_decode(const mavlink_message_t* msg, mavlink_manual_control_t* manual_control) { -#if MAVLINK_NEED_BYTE_SWAP - manual_control->x = mavlink_msg_manual_control_get_x(msg); - manual_control->y = mavlink_msg_manual_control_get_y(msg); - manual_control->z = mavlink_msg_manual_control_get_z(msg); - manual_control->r = mavlink_msg_manual_control_get_r(msg); - manual_control->buttons = mavlink_msg_manual_control_get_buttons(msg); - manual_control->target = mavlink_msg_manual_control_get_target(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + manual_control->x = mavlink_msg_manual_control_get_x(msg); + manual_control->y = mavlink_msg_manual_control_get_y(msg); + manual_control->z = mavlink_msg_manual_control_get_z(msg); + manual_control->r = mavlink_msg_manual_control_get_r(msg); + manual_control->buttons = mavlink_msg_manual_control_get_buttons(msg); + manual_control->target = mavlink_msg_manual_control_get_target(msg); #else - memcpy(manual_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MANUAL_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_MANUAL_CONTROL_LEN; + memset(manual_control, 0, MAVLINK_MSG_ID_MANUAL_CONTROL_LEN); + memcpy(manual_control, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_setpoint.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_setpoint.h index b0533ab..b6c7ca8 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_setpoint.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_manual_setpoint.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE MANUAL_SETPOINT PACKING #define MAVLINK_MSG_ID_MANUAL_SETPOINT 81 -typedef struct __mavlink_manual_setpoint_t -{ +MAVPACKED( +typedef struct __mavlink_manual_setpoint_t { uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ float roll; /*< Desired roll rate in radians per second*/ float pitch; /*< Desired pitch rate in radians per second*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_manual_setpoint_t float thrust; /*< Collective thrust, normalized to 0 .. 1*/ uint8_t mode_switch; /*< Flight mode switch position, 0.. 255*/ uint8_t manual_override_switch; /*< Override mode switch position, 0.. 255*/ -} mavlink_manual_setpoint_t; +}) mavlink_manual_setpoint_t; #define MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22 +#define MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN 22 #define MAVLINK_MSG_ID_81_LEN 22 +#define MAVLINK_MSG_ID_81_MIN_LEN 22 #define MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC 106 #define MAVLINK_MSG_ID_81_CRC 106 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \ - "MANUAL_SETPOINT", \ - 7, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \ + 81, \ + "MANUAL_SETPOINT", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \ { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \ { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_manual_setpoint_t { "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \ + "MANUAL_SETPOINT", \ + 7, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \ + { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_manual_setpoint_t, thrust) }, \ + { "mode_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_setpoint_t, mode_switch) }, \ + { "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \ + } \ +} +#endif /** * @brief Pack a manual_setpoint message @@ -51,38 +69,34 @@ typedef struct __mavlink_manual_setpoint_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch) + uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, thrust); - _mav_put_uint8_t(buf, 20, mode_switch); - _mav_put_uint8_t(buf, 21, manual_override_switch); + char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, thrust); + _mav_put_uint8_t(buf, 20, mode_switch); + _mav_put_uint8_t(buf, 21, manual_override_switch); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #else - mavlink_manual_setpoint_t packet; - packet.time_boot_ms = time_boot_ms; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - packet.mode_switch = mode_switch; - packet.manual_override_switch = manual_override_switch; + mavlink_manual_setpoint_t packet; + packet.time_boot_ms = time_boot_ms; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.thrust = thrust; + packet.mode_switch = mode_switch; + packet.manual_override_switch = manual_override_switch; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust,uint8_t mode_switch,uint8_t manual_override_switch) + mavlink_message_t* msg, + uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust,uint8_t mode_switch,uint8_t manual_override_switch) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, thrust); - _mav_put_uint8_t(buf, 20, mode_switch); - _mav_put_uint8_t(buf, 21, manual_override_switch); + char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, thrust); + _mav_put_uint8_t(buf, 20, mode_switch); + _mav_put_uint8_t(buf, 21, manual_override_switch); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #else - mavlink_manual_setpoint_t packet; - packet.time_boot_ms = time_boot_ms; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - packet.mode_switch = mode_switch; - packet.manual_override_switch = manual_override_switch; + mavlink_manual_setpoint_t packet; + packet.time_boot_ms = time_boot_ms; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.thrust = thrust; + packet.mode_switch = mode_switch; + packet.manual_override_switch = manual_override_switch; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_manual_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint) { - return mavlink_msg_manual_setpoint_pack(system_id, component_id, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch); + return mavlink_msg_manual_setpoint_pack(system_id, component_id, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_manual_setpoint_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_manual_setpoint_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint) { - return mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, chan, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch); + return mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, chan, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_manual_setpoint_encode_chan(uint8_t system_id static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, thrust); - _mav_put_uint8_t(buf, 20, mode_switch); - _mav_put_uint8_t(buf, 21, manual_override_switch); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); + char buf[MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, thrust); + _mav_put_uint8_t(buf, 20, mode_switch); + _mav_put_uint8_t(buf, 21, manual_override_switch); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); + mavlink_manual_setpoint_t packet; + packet.time_boot_ms = time_boot_ms; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.thrust = thrust; + packet.mode_switch = mode_switch; + packet.manual_override_switch = manual_override_switch; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); #endif +} + +/** + * @brief Send a manual_setpoint message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_manual_setpoint_send_struct(mavlink_channel_t chan, const mavlink_manual_setpoint_t* manual_setpoint) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_manual_setpoint_send(chan, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch); #else - mavlink_manual_setpoint_t packet; - packet.time_boot_ms = time_boot_ms; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.thrust = thrust; - packet.mode_switch = mode_switch; - packet.manual_override_switch = manual_override_switch; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)manual_setpoint, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint static inline void mavlink_msg_manual_setpoint_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, roll); - _mav_put_float(buf, 8, pitch); - _mav_put_float(buf, 12, yaw); - _mav_put_float(buf, 16, thrust); - _mav_put_uint8_t(buf, 20, mode_switch); - _mav_put_uint8_t(buf, 21, manual_override_switch); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); -#endif -#else - mavlink_manual_setpoint_t *packet = (mavlink_manual_setpoint_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - packet->thrust = thrust; - packet->mode_switch = mode_switch; - packet->manual_override_switch = manual_override_switch; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, roll); + _mav_put_float(buf, 8, pitch); + _mav_put_float(buf, 12, yaw); + _mav_put_float(buf, 16, thrust); + _mav_put_uint8_t(buf, 20, mode_switch); + _mav_put_uint8_t(buf, 21, manual_override_switch); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); -#endif + mavlink_manual_setpoint_t *packet = (mavlink_manual_setpoint_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + packet->thrust = thrust; + packet->mode_switch = mode_switch; + packet->manual_override_switch = manual_override_switch; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN, MAVLINK_MSG_ID_MANUAL_SETPOINT_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_manual_setpoint_send_buf(mavlink_message_t *msgbu */ static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlin */ static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t */ static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_ */ static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* */ static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message */ static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 20); + return _MAV_RETURN_uint8_t(msg, 20); } /** @@ -328,7 +336,7 @@ static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_ */ static inline uint8_t mavlink_msg_manual_setpoint_get_manual_override_switch(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 21); + return _MAV_RETURN_uint8_t(msg, 21); } /** @@ -339,15 +347,17 @@ static inline uint8_t mavlink_msg_manual_setpoint_get_manual_override_switch(con */ static inline void mavlink_msg_manual_setpoint_decode(const mavlink_message_t* msg, mavlink_manual_setpoint_t* manual_setpoint) { -#if MAVLINK_NEED_BYTE_SWAP - manual_setpoint->time_boot_ms = mavlink_msg_manual_setpoint_get_time_boot_ms(msg); - manual_setpoint->roll = mavlink_msg_manual_setpoint_get_roll(msg); - manual_setpoint->pitch = mavlink_msg_manual_setpoint_get_pitch(msg); - manual_setpoint->yaw = mavlink_msg_manual_setpoint_get_yaw(msg); - manual_setpoint->thrust = mavlink_msg_manual_setpoint_get_thrust(msg); - manual_setpoint->mode_switch = mavlink_msg_manual_setpoint_get_mode_switch(msg); - manual_setpoint->manual_override_switch = mavlink_msg_manual_setpoint_get_manual_override_switch(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + manual_setpoint->time_boot_ms = mavlink_msg_manual_setpoint_get_time_boot_ms(msg); + manual_setpoint->roll = mavlink_msg_manual_setpoint_get_roll(msg); + manual_setpoint->pitch = mavlink_msg_manual_setpoint_get_pitch(msg); + manual_setpoint->yaw = mavlink_msg_manual_setpoint_get_yaw(msg); + manual_setpoint->thrust = mavlink_msg_manual_setpoint_get_thrust(msg); + manual_setpoint->mode_switch = mavlink_msg_manual_setpoint_get_mode_switch(msg); + manual_setpoint->manual_override_switch = mavlink_msg_manual_setpoint_get_manual_override_switch(msg); #else - memcpy(manual_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN? msg->len : MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN; + memset(manual_setpoint, 0, MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN); + memcpy(manual_setpoint, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_memory_vect.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_memory_vect.h index a97ab8d..485954b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_memory_vect.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_memory_vect.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE MEMORY_VECT PACKING #define MAVLINK_MSG_ID_MEMORY_VECT 249 -typedef struct __mavlink_memory_vect_t -{ +MAVPACKED( +typedef struct __mavlink_memory_vect_t { uint16_t address; /*< Starting address of the debug variables*/ uint8_t ver; /*< Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below*/ uint8_t type; /*< Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14*/ int8_t value[32]; /*< Memory contents at specified address*/ -} mavlink_memory_vect_t; +}) mavlink_memory_vect_t; #define MAVLINK_MSG_ID_MEMORY_VECT_LEN 36 +#define MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN 36 #define MAVLINK_MSG_ID_249_LEN 36 +#define MAVLINK_MSG_ID_249_MIN_LEN 36 #define MAVLINK_MSG_ID_MEMORY_VECT_CRC 204 #define MAVLINK_MSG_ID_249_CRC 204 #define MAVLINK_MSG_MEMORY_VECT_FIELD_VALUE_LEN 32 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MEMORY_VECT { \ - "MEMORY_VECT", \ - 4, \ - { { "address", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_memory_vect_t, address) }, \ + 249, \ + "MEMORY_VECT", \ + 4, \ + { { "address", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_memory_vect_t, address) }, \ { "ver", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_memory_vect_t, ver) }, \ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_memory_vect_t, type) }, \ { "value", NULL, MAVLINK_TYPE_INT8_T, 32, 4, offsetof(mavlink_memory_vect_t, value) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MEMORY_VECT { \ + "MEMORY_VECT", \ + 4, \ + { { "address", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_memory_vect_t, address) }, \ + { "ver", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_memory_vect_t, ver) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_memory_vect_t, type) }, \ + { "value", NULL, MAVLINK_TYPE_INT8_T, 32, 4, offsetof(mavlink_memory_vect_t, value) }, \ + } \ +} +#endif /** * @brief Pack a memory_vect message @@ -42,30 +57,26 @@ typedef struct __mavlink_memory_vect_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t address, uint8_t ver, uint8_t type, const int8_t *value) + uint16_t address, uint8_t ver, uint8_t type, const int8_t *value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; - _mav_put_uint16_t(buf, 0, address); - _mav_put_uint8_t(buf, 2, ver); - _mav_put_uint8_t(buf, 3, type); - _mav_put_int8_t_array(buf, 4, value, 32); + char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; + _mav_put_uint16_t(buf, 0, address); + _mav_put_uint8_t(buf, 2, ver); + _mav_put_uint8_t(buf, 3, type); + _mav_put_int8_t_array(buf, 4, value, 32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #else - mavlink_memory_vect_t packet; - packet.address = address; - packet.ver = ver; - packet.type = type; - mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); + mavlink_memory_vect_t packet; + packet.address = address; + packet.ver = ver; + packet.type = type; + mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMORY_VECT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); } /** @@ -81,31 +92,27 @@ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t address,uint8_t ver,uint8_t type,const int8_t *value) + mavlink_message_t* msg, + uint16_t address,uint8_t ver,uint8_t type,const int8_t *value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; - _mav_put_uint16_t(buf, 0, address); - _mav_put_uint8_t(buf, 2, ver); - _mav_put_uint8_t(buf, 3, type); - _mav_put_int8_t_array(buf, 4, value, 32); + char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; + _mav_put_uint16_t(buf, 0, address); + _mav_put_uint8_t(buf, 2, ver); + _mav_put_uint8_t(buf, 3, type); + _mav_put_int8_t_array(buf, 4, value, 32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #else - mavlink_memory_vect_t packet; - packet.address = address; - packet.ver = ver; - packet.type = type; - mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); + mavlink_memory_vect_t packet; + packet.address = address; + packet.ver = ver; + packet.type = type; + mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMORY_VECT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); } /** @@ -118,7 +125,7 @@ static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_memory_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_memory_vect_t* memory_vect) { - return mavlink_msg_memory_vect_pack(system_id, component_id, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value); + return mavlink_msg_memory_vect_pack(system_id, component_id, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value); } /** @@ -132,7 +139,7 @@ static inline uint16_t mavlink_msg_memory_vect_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_memory_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_memory_vect_t* memory_vect) { - return mavlink_msg_memory_vect_pack_chan(system_id, component_id, chan, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value); + return mavlink_msg_memory_vect_pack_chan(system_id, component_id, chan, msg, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value); } /** @@ -149,27 +156,33 @@ static inline uint16_t mavlink_msg_memory_vect_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_memory_vect_send(mavlink_channel_t chan, uint16_t address, uint8_t ver, uint8_t type, const int8_t *value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; - _mav_put_uint16_t(buf, 0, address); - _mav_put_uint8_t(buf, 2, ver); - _mav_put_uint8_t(buf, 3, type); - _mav_put_int8_t_array(buf, 4, value, 32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); + char buf[MAVLINK_MSG_ID_MEMORY_VECT_LEN]; + _mav_put_uint16_t(buf, 0, address); + _mav_put_uint8_t(buf, 2, ver); + _mav_put_uint8_t(buf, 3, type); + _mav_put_int8_t_array(buf, 4, value, 32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN); + mavlink_memory_vect_t packet; + packet.address = address; + packet.ver = ver; + packet.type = type; + mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); #endif +} + +/** + * @brief Send a memory_vect message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_memory_vect_send_struct(mavlink_channel_t chan, const mavlink_memory_vect_t* memory_vect) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_memory_vect_send(chan, memory_vect->address, memory_vect->ver, memory_vect->type, memory_vect->value); #else - mavlink_memory_vect_t packet; - packet.address = address; - packet.ver = ver; - packet.type = type; - mav_array_memcpy(packet.value, value, sizeof(int8_t)*32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)&packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)memory_vect, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); #endif } @@ -184,27 +197,19 @@ static inline void mavlink_msg_memory_vect_send(mavlink_channel_t chan, uint16_t static inline void mavlink_msg_memory_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t address, uint8_t ver, uint8_t type, const int8_t *value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, address); - _mav_put_uint8_t(buf, 2, ver); - _mav_put_uint8_t(buf, 3, type); - _mav_put_int8_t_array(buf, 4, value, 32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, address); + _mav_put_uint8_t(buf, 2, ver); + _mav_put_uint8_t(buf, 3, type); + _mav_put_int8_t_array(buf, 4, value, 32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, buf, MAVLINK_MSG_ID_MEMORY_VECT_LEN); -#endif -#else - mavlink_memory_vect_t *packet = (mavlink_memory_vect_t *)msgbuf; - packet->address = address; - packet->ver = ver; - packet->type = type; - mav_array_memcpy(packet->value, value, sizeof(int8_t)*32); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)packet, MAVLINK_MSG_ID_MEMORY_VECT_LEN); -#endif + mavlink_memory_vect_t *packet = (mavlink_memory_vect_t *)msgbuf; + packet->address = address; + packet->ver = ver; + packet->type = type; + mav_array_memcpy(packet->value, value, sizeof(int8_t)*32); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMORY_VECT, (const char *)packet, MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN, MAVLINK_MSG_ID_MEMORY_VECT_LEN, MAVLINK_MSG_ID_MEMORY_VECT_CRC); #endif } #endif @@ -221,7 +226,7 @@ static inline void mavlink_msg_memory_vect_send_buf(mavlink_message_t *msgbuf, m */ static inline uint16_t mavlink_msg_memory_vect_get_address(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -231,7 +236,7 @@ static inline uint16_t mavlink_msg_memory_vect_get_address(const mavlink_message */ static inline uint8_t mavlink_msg_memory_vect_get_ver(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -241,7 +246,7 @@ static inline uint8_t mavlink_msg_memory_vect_get_ver(const mavlink_message_t* m */ static inline uint8_t mavlink_msg_memory_vect_get_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -251,7 +256,7 @@ static inline uint8_t mavlink_msg_memory_vect_get_type(const mavlink_message_t* */ static inline uint16_t mavlink_msg_memory_vect_get_value(const mavlink_message_t* msg, int8_t *value) { - return _MAV_RETURN_int8_t_array(msg, value, 32, 4); + return _MAV_RETURN_int8_t_array(msg, value, 32, 4); } /** @@ -262,12 +267,14 @@ static inline uint16_t mavlink_msg_memory_vect_get_value(const mavlink_message_t */ static inline void mavlink_msg_memory_vect_decode(const mavlink_message_t* msg, mavlink_memory_vect_t* memory_vect) { -#if MAVLINK_NEED_BYTE_SWAP - memory_vect->address = mavlink_msg_memory_vect_get_address(msg); - memory_vect->ver = mavlink_msg_memory_vect_get_ver(msg); - memory_vect->type = mavlink_msg_memory_vect_get_type(msg); - mavlink_msg_memory_vect_get_value(msg, memory_vect->value); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + memory_vect->address = mavlink_msg_memory_vect_get_address(msg); + memory_vect->ver = mavlink_msg_memory_vect_get_ver(msg); + memory_vect->type = mavlink_msg_memory_vect_get_type(msg); + mavlink_msg_memory_vect_get_value(msg, memory_vect->value); #else - memcpy(memory_vect, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MEMORY_VECT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MEMORY_VECT_LEN? msg->len : MAVLINK_MSG_ID_MEMORY_VECT_LEN; + memset(memory_vect, 0, MAVLINK_MSG_ID_MEMORY_VECT_LEN); + memcpy(memory_vect, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_message_interval.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_message_interval.h index 7e8e734..238286d 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_message_interval.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_message_interval.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE MESSAGE_INTERVAL PACKING #define MAVLINK_MSG_ID_MESSAGE_INTERVAL 244 -typedef struct __mavlink_message_interval_t -{ +MAVPACKED( +typedef struct __mavlink_message_interval_t { int32_t interval_us; /*< The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.*/ uint16_t message_id; /*< The ID of the requested MAVLink message. v1.0 is limited to 254 messages.*/ -} mavlink_message_interval_t; +}) mavlink_message_interval_t; #define MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN 6 +#define MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN 6 #define MAVLINK_MSG_ID_244_LEN 6 +#define MAVLINK_MSG_ID_244_MIN_LEN 6 #define MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC 95 #define MAVLINK_MSG_ID_244_CRC 95 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \ - "MESSAGE_INTERVAL", \ - 2, \ - { { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \ + 244, \ + "MESSAGE_INTERVAL", \ + 2, \ + { { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \ { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \ + "MESSAGE_INTERVAL", \ + 2, \ + { { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \ + { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \ + } \ +} +#endif /** * @brief Pack a message_interval message @@ -36,28 +49,24 @@ typedef struct __mavlink_message_interval_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_message_interval_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t message_id, int32_t interval_us) + uint16_t message_id, int32_t interval_us) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN]; - _mav_put_int32_t(buf, 0, interval_us); - _mav_put_uint16_t(buf, 4, message_id); + char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN]; + _mav_put_int32_t(buf, 0, interval_us); + _mav_put_uint16_t(buf, 4, message_id); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); #else - mavlink_message_interval_t packet; - packet.interval_us = interval_us; - packet.message_id = message_id; + mavlink_message_interval_t packet; + packet.interval_us = interval_us; + packet.message_id = message_id; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_message_interval_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_message_interval_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t message_id,int32_t interval_us) + mavlink_message_t* msg, + uint16_t message_id,int32_t interval_us) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN]; - _mav_put_int32_t(buf, 0, interval_us); - _mav_put_uint16_t(buf, 4, message_id); + char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN]; + _mav_put_int32_t(buf, 0, interval_us); + _mav_put_uint16_t(buf, 4, message_id); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); #else - mavlink_message_interval_t packet; - packet.interval_us = interval_us; - packet.message_id = message_id; + mavlink_message_interval_t packet; + packet.interval_us = interval_us; + packet.message_id = message_id; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_message_interval_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_message_interval_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval) { - return mavlink_msg_message_interval_pack(system_id, component_id, msg, message_interval->message_id, message_interval->interval_us); + return mavlink_msg_message_interval_pack(system_id, component_id, msg, message_interval->message_id, message_interval->interval_us); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_message_interval_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_message_interval_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval) { - return mavlink_msg_message_interval_pack_chan(system_id, component_id, chan, msg, message_interval->message_id, message_interval->interval_us); + return mavlink_msg_message_interval_pack_chan(system_id, component_id, chan, msg, message_interval->message_id, message_interval->interval_us); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_message_interval_encode_chan(uint8_t system_i static inline void mavlink_msg_message_interval_send(mavlink_channel_t chan, uint16_t message_id, int32_t interval_us) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN]; - _mav_put_int32_t(buf, 0, interval_us); - _mav_put_uint16_t(buf, 4, message_id); + char buf[MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN]; + _mav_put_int32_t(buf, 0, interval_us); + _mav_put_uint16_t(buf, 4, message_id); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); + mavlink_message_interval_t packet; + packet.interval_us = interval_us; + packet.message_id = message_id; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)&packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); #endif -#else - mavlink_message_interval_t packet; - packet.interval_us = interval_us; - packet.message_id = message_id; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)&packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); +/** + * @brief Send a message_interval message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_message_interval_send_struct(mavlink_channel_t chan, const mavlink_message_interval_t* message_interval) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_message_interval_send(chan, message_interval->message_id, message_interval->interval_us); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)&packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)message_interval, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_message_interval_send(mavlink_channel_t chan, uin static inline void mavlink_msg_message_interval_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t message_id, int32_t interval_us) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, interval_us); - _mav_put_uint16_t(buf, 4, message_id); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, interval_us); + _mav_put_uint16_t(buf, 4, message_id); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); #else - mavlink_message_interval_t *packet = (mavlink_message_interval_t *)msgbuf; - packet->interval_us = interval_us; - packet->message_id = message_id; + mavlink_message_interval_t *packet = (mavlink_message_interval_t *)msgbuf; + packet->interval_us = interval_us; + packet->message_id = message_id; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_message_interval_send_buf(mavlink_message_t *msgb */ static inline uint16_t mavlink_msg_message_interval_get_message_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -213,7 +216,7 @@ static inline uint16_t mavlink_msg_message_interval_get_message_id(const mavlink */ static inline int32_t mavlink_msg_message_interval_get_interval_us(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -224,10 +227,12 @@ static inline int32_t mavlink_msg_message_interval_get_interval_us(const mavlink */ static inline void mavlink_msg_message_interval_decode(const mavlink_message_t* msg, mavlink_message_interval_t* message_interval) { -#if MAVLINK_NEED_BYTE_SWAP - message_interval->interval_us = mavlink_msg_message_interval_get_interval_us(msg); - message_interval->message_id = mavlink_msg_message_interval_get_message_id(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + message_interval->interval_us = mavlink_msg_message_interval_get_interval_us(msg); + message_interval->message_id = mavlink_msg_message_interval_get_message_id(msg); #else - memcpy(message_interval, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN? msg->len : MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN; + memset(message_interval, 0, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN); + memcpy(message_interval, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_ack.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_ack.h index 34132ad..1672955 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_ack.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_ack.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE MISSION_ACK PACKING #define MAVLINK_MSG_ID_MISSION_ACK 47 -typedef struct __mavlink_mission_ack_t -{ +MAVPACKED( +typedef struct __mavlink_mission_ack_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ uint8_t type; /*< See MAV_MISSION_RESULT enum*/ -} mavlink_mission_ack_t; +}) mavlink_mission_ack_t; #define MAVLINK_MSG_ID_MISSION_ACK_LEN 3 +#define MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN 3 #define MAVLINK_MSG_ID_47_LEN 3 +#define MAVLINK_MSG_ID_47_MIN_LEN 3 #define MAVLINK_MSG_ID_MISSION_ACK_CRC 153 #define MAVLINK_MSG_ID_47_CRC 153 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_ACK { \ - "MISSION_ACK", \ - 3, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \ + 47, \ + "MISSION_ACK", \ + 3, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_ack_t, target_component) }, \ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_ack_t, type) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_ACK { \ + "MISSION_ACK", \ + 3, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_ack_t, target_component) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_ack_t, type) }, \ + } \ +} +#endif /** * @brief Pack a mission_ack message @@ -39,30 +53,26 @@ typedef struct __mavlink_mission_ack_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t type) + uint8_t target_system, uint8_t target_component, uint8_t type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, type); + char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, type); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN); #else - mavlink_mission_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; + mavlink_mission_ack_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + packet.type = type; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ACK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t type) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint8_t type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, type); + char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, type); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ACK_LEN); #else - mavlink_mission_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; + mavlink_mission_ack_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + packet.type = type; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ACK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ACK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_mission_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_ack_t* mission_ack) { - return mavlink_msg_mission_ack_pack(system_id, component_id, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type); + return mavlink_msg_mission_ack_pack(system_id, component_id, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_mission_ack_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_mission_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_ack_t* mission_ack) { - return mavlink_msg_mission_ack_pack_chan(system_id, component_id, chan, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type); + return mavlink_msg_mission_ack_pack_chan(system_id, component_id, chan, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_mission_ack_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_mission_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, type); + char buf[MAVLINK_MSG_ID_MISSION_ACK_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, type); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_LEN); + mavlink_mission_ack_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + packet.type = type; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); #endif -#else - mavlink_mission_ack_t packet; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type = type; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); +/** + * @brief Send a mission_ack message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_ack_send_struct(mavlink_channel_t chan, const mavlink_mission_ack_t* mission_ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_ack_send(chan, mission_ack->target_system, mission_ack->target_component, mission_ack->type); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)mission_ack, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_mission_ack_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_mission_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); - _mav_put_uint8_t(buf, 2, type); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); + _mav_put_uint8_t(buf, 2, type); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); #else - mavlink_mission_ack_t *packet = (mavlink_mission_ack_t *)msgbuf; - packet->target_system = target_system; - packet->target_component = target_component; - packet->type = type; + mavlink_mission_ack_t *packet = (mavlink_mission_ack_t *)msgbuf; + packet->target_system = target_system; + packet->target_component = target_component; + packet->type = type; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)packet, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)packet, MAVLINK_MSG_ID_MISSION_ACK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)packet, MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN, MAVLINK_MSG_ID_MISSION_ACK_LEN, MAVLINK_MSG_ID_MISSION_ACK_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_mission_ack_send_buf(mavlink_message_t *msgbuf, m */ static inline uint8_t mavlink_msg_mission_ack_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_mission_ack_get_target_system(const mavlink_me */ static inline uint8_t mavlink_msg_mission_ack_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_mission_ack_get_target_component(const mavlink */ static inline uint8_t mavlink_msg_mission_ack_get_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -247,11 +251,13 @@ static inline uint8_t mavlink_msg_mission_ack_get_type(const mavlink_message_t* */ static inline void mavlink_msg_mission_ack_decode(const mavlink_message_t* msg, mavlink_mission_ack_t* mission_ack) { -#if MAVLINK_NEED_BYTE_SWAP - mission_ack->target_system = mavlink_msg_mission_ack_get_target_system(msg); - mission_ack->target_component = mavlink_msg_mission_ack_get_target_component(msg); - mission_ack->type = mavlink_msg_mission_ack_get_type(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_ack->target_system = mavlink_msg_mission_ack_get_target_system(msg); + mission_ack->target_component = mavlink_msg_mission_ack_get_target_component(msg); + mission_ack->type = mavlink_msg_mission_ack_get_type(msg); #else - memcpy(mission_ack, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ACK_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ACK_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ACK_LEN; + memset(mission_ack, 0, MAVLINK_MSG_ID_MISSION_ACK_LEN); + memcpy(mission_ack, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_clear_all.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_clear_all.h index ef84199..3b9610f 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_clear_all.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_clear_all.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE MISSION_CLEAR_ALL PACKING #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45 -typedef struct __mavlink_mission_clear_all_t -{ +MAVPACKED( +typedef struct __mavlink_mission_clear_all_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_clear_all_t; +}) mavlink_mission_clear_all_t; #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2 +#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN 2 #define MAVLINK_MSG_ID_45_LEN 2 +#define MAVLINK_MSG_ID_45_MIN_LEN 2 #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC 232 #define MAVLINK_MSG_ID_45_CRC 232 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \ - "MISSION_CLEAR_ALL", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \ + 45, \ + "MISSION_CLEAR_ALL", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \ + "MISSION_CLEAR_ALL", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_clear_all message @@ -36,28 +49,24 @@ typedef struct __mavlink_mission_clear_all_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) + uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #else - mavlink_mission_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_clear_all_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #else - mavlink_mission_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_clear_all_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id */ static inline uint16_t mavlink_msg_mission_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_clear_all_t* mission_clear_all) { - return mavlink_msg_mission_clear_all_pack(system_id, component_id, msg, mission_clear_all->target_system, mission_clear_all->target_component); + return mavlink_msg_mission_clear_all_pack(system_id, component_id, msg, mission_clear_all->target_system, mission_clear_all->target_component); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_mission_clear_all_encode(uint8_t system_id, u */ static inline uint16_t mavlink_msg_mission_clear_all_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_clear_all_t* mission_clear_all) { - return mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, chan, msg, mission_clear_all->target_system, mission_clear_all->target_component); + return mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, chan, msg, mission_clear_all->target_system, mission_clear_all->target_component); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_mission_clear_all_encode_chan(uint8_t system_ static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); + mavlink_mission_clear_all_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); #endif -#else - mavlink_mission_clear_all_t packet; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); +/** + * @brief Send a mission_clear_all message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_clear_all_send_struct(mavlink_channel_t chan, const mavlink_mission_clear_all_t* mission_clear_all) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_clear_all_send(chan, mission_clear_all->target_system, mission_clear_all->target_component); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)mission_clear_all, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, ui static inline void mavlink_msg_mission_clear_all_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); #else - mavlink_mission_clear_all_t *packet = (mavlink_mission_clear_all_t *)msgbuf; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_mission_clear_all_t *packet = (mavlink_mission_clear_all_t *)msgbuf; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)packet, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_mission_clear_all_send_buf(mavlink_message_t *msg */ static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavl */ static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -224,10 +227,12 @@ static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const m */ static inline void mavlink_msg_mission_clear_all_decode(const mavlink_message_t* msg, mavlink_mission_clear_all_t* mission_clear_all) { -#if MAVLINK_NEED_BYTE_SWAP - mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg); - mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg); + mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg); #else - memcpy(mission_clear_all, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN; + memset(mission_clear_all, 0, MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN); + memcpy(mission_clear_all, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_count.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_count.h index 1d6a3f0..39b7c92 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_count.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_count.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE MISSION_COUNT PACKING #define MAVLINK_MSG_ID_MISSION_COUNT 44 -typedef struct __mavlink_mission_count_t -{ +MAVPACKED( +typedef struct __mavlink_mission_count_t { uint16_t count; /*< Number of mission items in the sequence*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_count_t; +}) mavlink_mission_count_t; #define MAVLINK_MSG_ID_MISSION_COUNT_LEN 4 +#define MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN 4 #define MAVLINK_MSG_ID_44_LEN 4 +#define MAVLINK_MSG_ID_44_MIN_LEN 4 #define MAVLINK_MSG_ID_MISSION_COUNT_CRC 221 #define MAVLINK_MSG_ID_44_CRC 221 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \ - "MISSION_COUNT", \ - 3, \ - { { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ + 44, \ + "MISSION_COUNT", \ + 3, \ + { { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \ + "MISSION_COUNT", \ + 3, \ + { { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_count message @@ -39,30 +53,26 @@ typedef struct __mavlink_mission_count_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t count) + uint8_t target_system, uint8_t target_component, uint16_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; - _mav_put_uint16_t(buf, 0, count); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; + _mav_put_uint16_t(buf, 0, count); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #else - mavlink_mission_count_t packet; - packet.count = count; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_count_t packet; + packet.count = count; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_COUNT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t count) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; - _mav_put_uint16_t(buf, 0, count); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; + _mav_put_uint16_t(buf, 0, count); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #else - mavlink_mission_count_t packet; - packet.count = count; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_count_t packet; + packet.count = count; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_COUNT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_mission_count_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_count_t* mission_count) { - return mavlink_msg_mission_count_pack(system_id, component_id, msg, mission_count->target_system, mission_count->target_component, mission_count->count); + return mavlink_msg_mission_count_pack(system_id, component_id, msg, mission_count->target_system, mission_count->target_component, mission_count->count); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_mission_count_encode(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_mission_count_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_count_t* mission_count) { - return mavlink_msg_mission_count_pack_chan(system_id, component_id, chan, msg, mission_count->target_system, mission_count->target_component, mission_count->count); + return mavlink_msg_mission_count_pack_chan(system_id, component_id, chan, msg, mission_count->target_system, mission_count->target_component, mission_count->count); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_mission_count_encode_chan(uint8_t system_id, static inline void mavlink_msg_mission_count_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; - _mav_put_uint16_t(buf, 0, count); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_COUNT_LEN]; + _mav_put_uint16_t(buf, 0, count); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN); + mavlink_mission_count_t packet; + packet.count = count; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); #endif -#else - mavlink_mission_count_t packet; - packet.count = count; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); +/** + * @brief Send a mission_count message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_count_send_struct(mavlink_channel_t chan, const mavlink_mission_count_t* mission_count) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_count_send(chan, mission_count->target_system, mission_count->target_component, mission_count->count); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)mission_count, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_mission_count_send(mavlink_channel_t chan, uint8_ static inline void mavlink_msg_mission_count_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, count); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, count); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); #else - mavlink_mission_count_t *packet = (mavlink_mission_count_t *)msgbuf; - packet->count = count; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_mission_count_t *packet = (mavlink_mission_count_t *)msgbuf; + packet->count = count; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)packet, MAVLINK_MSG_ID_MISSION_COUNT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)packet, MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN, MAVLINK_MSG_ID_MISSION_COUNT_LEN, MAVLINK_MSG_ID_MISSION_COUNT_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_mission_count_send_buf(mavlink_message_t *msgbuf, */ static inline uint8_t mavlink_msg_mission_count_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_mission_count_get_target_system(const mavlink_ */ static inline uint8_t mavlink_msg_mission_count_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_mission_count_get_target_component(const mavli */ static inline uint16_t mavlink_msg_mission_count_get_count(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -247,11 +251,13 @@ static inline uint16_t mavlink_msg_mission_count_get_count(const mavlink_message */ static inline void mavlink_msg_mission_count_decode(const mavlink_message_t* msg, mavlink_mission_count_t* mission_count) { -#if MAVLINK_NEED_BYTE_SWAP - mission_count->count = mavlink_msg_mission_count_get_count(msg); - mission_count->target_system = mavlink_msg_mission_count_get_target_system(msg); - mission_count->target_component = mavlink_msg_mission_count_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_count->count = mavlink_msg_mission_count_get_count(msg); + mission_count->target_system = mavlink_msg_mission_count_get_target_system(msg); + mission_count->target_component = mavlink_msg_mission_count_get_target_component(msg); #else - memcpy(mission_count, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_COUNT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_COUNT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_COUNT_LEN; + memset(mission_count, 0, MAVLINK_MSG_ID_MISSION_COUNT_LEN); + memcpy(mission_count, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_current.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_current.h index 7fa6ed4..e619069 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_current.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_current.h @@ -1,27 +1,39 @@ +#pragma once // MESSAGE MISSION_CURRENT PACKING #define MAVLINK_MSG_ID_MISSION_CURRENT 42 -typedef struct __mavlink_mission_current_t -{ +MAVPACKED( +typedef struct __mavlink_mission_current_t { uint16_t seq; /*< Sequence*/ -} mavlink_mission_current_t; +}) mavlink_mission_current_t; #define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2 +#define MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN 2 #define MAVLINK_MSG_ID_42_LEN 2 +#define MAVLINK_MSG_ID_42_MIN_LEN 2 #define MAVLINK_MSG_ID_MISSION_CURRENT_CRC 28 #define MAVLINK_MSG_ID_42_CRC 28 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \ - "MISSION_CURRENT", \ - 1, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \ + 42, \ + "MISSION_CURRENT", \ + 1, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \ + "MISSION_CURRENT", \ + 1, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \ + } \ +} +#endif /** * @brief Pack a mission_current message @@ -33,26 +45,22 @@ typedef struct __mavlink_mission_current_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t seq) + uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; - _mav_put_uint16_t(buf, 0, seq); + char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; + _mav_put_uint16_t(buf, 0, seq); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #else - mavlink_mission_current_t packet; - packet.seq = seq; + mavlink_mission_current_t packet; + packet.seq = seq; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); } /** @@ -65,27 +73,23 @@ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t seq) + mavlink_message_t* msg, + uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; - _mav_put_uint16_t(buf, 0, seq); + char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; + _mav_put_uint16_t(buf, 0, seq); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #else - mavlink_mission_current_t packet; - packet.seq = seq; + mavlink_mission_current_t packet; + packet.seq = seq; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); } /** @@ -98,7 +102,7 @@ static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current) { - return mavlink_msg_mission_current_pack(system_id, component_id, msg, mission_current->seq); + return mavlink_msg_mission_current_pack(system_id, component_id, msg, mission_current->seq); } /** @@ -112,7 +116,7 @@ static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_mission_current_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current) { - return mavlink_msg_mission_current_pack_chan(system_id, component_id, chan, msg, mission_current->seq); + return mavlink_msg_mission_current_pack_chan(system_id, component_id, chan, msg, mission_current->seq); } /** @@ -126,23 +130,29 @@ static inline uint16_t mavlink_msg_mission_current_encode_chan(uint8_t system_id static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; - _mav_put_uint16_t(buf, 0, seq); + char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN]; + _mav_put_uint16_t(buf, 0, seq); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); + mavlink_mission_current_t packet; + packet.seq = seq; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); #endif -#else - mavlink_mission_current_t packet; - packet.seq = seq; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); +/** + * @brief Send a mission_current message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_current_send_struct(mavlink_channel_t chan, const mavlink_mission_current_t* mission_current) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_current_send(chan, mission_current->seq); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)mission_current, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); #endif } @@ -157,23 +167,15 @@ static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan, uint static inline void mavlink_msg_mission_current_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, seq); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, seq); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); #else - mavlink_mission_current_t *packet = (mavlink_mission_current_t *)msgbuf; - packet->seq = seq; + mavlink_mission_current_t *packet = (mavlink_mission_current_t *)msgbuf; + packet->seq = seq; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC); #endif } #endif @@ -190,7 +192,7 @@ static inline void mavlink_msg_mission_current_send_buf(mavlink_message_t *msgbu */ static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -201,9 +203,11 @@ static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message */ static inline void mavlink_msg_mission_current_decode(const mavlink_message_t* msg, mavlink_mission_current_t* mission_current) { -#if MAVLINK_NEED_BYTE_SWAP - mission_current->seq = mavlink_msg_mission_current_get_seq(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_current->seq = mavlink_msg_mission_current_get_seq(msg); #else - memcpy(mission_current, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_CURRENT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CURRENT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CURRENT_LEN; + memset(mission_current, 0, MAVLINK_MSG_ID_MISSION_CURRENT_LEN); + memcpy(mission_current, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item.h index e94cfdb..fd21cee 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE MISSION_ITEM PACKING #define MAVLINK_MSG_ID_MISSION_ITEM 39 -typedef struct __mavlink_mission_item_t -{ +MAVPACKED( +typedef struct __mavlink_mission_item_t { float param1; /*< PARAM1, see MAV_CMD enum*/ float param2; /*< PARAM2, see MAV_CMD enum*/ float param3; /*< PARAM3, see MAV_CMD enum*/ @@ -18,20 +19,24 @@ typedef struct __mavlink_mission_item_t uint8_t frame; /*< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h*/ uint8_t current; /*< false:0, true:1*/ uint8_t autocontinue; /*< autocontinue to next wp*/ -} mavlink_mission_item_t; +}) mavlink_mission_item_t; #define MAVLINK_MSG_ID_MISSION_ITEM_LEN 37 +#define MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN 37 #define MAVLINK_MSG_ID_39_LEN 37 +#define MAVLINK_MSG_ID_39_MIN_LEN 37 #define MAVLINK_MSG_ID_MISSION_ITEM_CRC 254 #define MAVLINK_MSG_ID_39_CRC 254 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \ - "MISSION_ITEM", \ - 14, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \ + 39, \ + "MISSION_ITEM", \ + 14, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \ @@ -47,7 +52,27 @@ typedef struct __mavlink_mission_item_t { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \ + "MISSION_ITEM", \ + 14, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \ + { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \ + { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \ + { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \ + } \ +} +#endif /** * @brief Pack a mission_item message @@ -72,52 +97,48 @@ typedef struct __mavlink_mission_item_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) + uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, x); - _mav_put_float(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, x); + _mav_put_float(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #else - mavlink_mission_item_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.seq = seq; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; + mavlink_mission_item_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.seq = seq; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); } /** @@ -143,53 +164,49 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,float x,float y,float z) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,float x,float y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, x); - _mav_put_float(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, x); + _mav_put_float(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #else - mavlink_mission_item_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.seq = seq; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; + mavlink_mission_item_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.seq = seq; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); } /** @@ -202,7 +219,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_mission_item_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_t* mission_item) { - return mavlink_msg_mission_item_pack(system_id, component_id, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z); + return mavlink_msg_mission_item_pack(system_id, component_id, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z); } /** @@ -216,7 +233,7 @@ static inline uint16_t mavlink_msg_mission_item_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_mission_item_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_t* mission_item) { - return mavlink_msg_mission_item_pack_chan(system_id, component_id, chan, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z); + return mavlink_msg_mission_item_pack_chan(system_id, component_id, chan, msg, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z); } /** @@ -243,49 +260,55 @@ static inline uint16_t mavlink_msg_mission_item_encode_chan(uint8_t system_id, u static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, x); - _mav_put_float(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, x); + _mav_put_float(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN); + mavlink_mission_item_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.seq = seq; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); #endif +} + +/** + * @brief Send a mission_item message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_item_send_struct(mavlink_channel_t chan, const mavlink_mission_item_t* mission_item) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_item_send(chan, mission_item->target_system, mission_item->target_component, mission_item->seq, mission_item->frame, mission_item->command, mission_item->current, mission_item->autocontinue, mission_item->param1, mission_item->param2, mission_item->param3, mission_item->param4, mission_item->x, mission_item->y, mission_item->z); #else - mavlink_mission_item_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.seq = seq; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)mission_item, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); #endif } @@ -300,49 +323,41 @@ static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_mission_item_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_float(buf, 16, x); - _mav_put_float(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_float(buf, 16, x); + _mav_put_float(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, buf, MAVLINK_MSG_ID_MISSION_ITEM_LEN); -#endif -#else - mavlink_mission_item_t *packet = (mavlink_mission_item_t *)msgbuf; - packet->param1 = param1; - packet->param2 = param2; - packet->param3 = param3; - packet->param4 = param4; - packet->x = x; - packet->y = y; - packet->z = z; - packet->seq = seq; - packet->command = command; - packet->target_system = target_system; - packet->target_component = target_component; - packet->frame = frame; - packet->current = current; - packet->autocontinue = autocontinue; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_LEN); -#endif + mavlink_mission_item_t *packet = (mavlink_mission_item_t *)msgbuf; + packet->param1 = param1; + packet->param2 = param2; + packet->param3 = param3; + packet->param4 = param4; + packet->x = x; + packet->y = y; + packet->z = z; + packet->seq = seq; + packet->command = command; + packet->target_system = target_system; + packet->target_component = target_component; + packet->frame = frame; + packet->current = current; + packet->autocontinue = autocontinue; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_LEN, MAVLINK_MSG_ID_MISSION_ITEM_CRC); #endif } #endif @@ -359,7 +374,7 @@ static inline void mavlink_msg_mission_item_send_buf(mavlink_message_t *msgbuf, */ static inline uint8_t mavlink_msg_mission_item_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -369,7 +384,7 @@ static inline uint8_t mavlink_msg_mission_item_get_target_system(const mavlink_m */ static inline uint8_t mavlink_msg_mission_item_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 33); + return _MAV_RETURN_uint8_t(msg, 33); } /** @@ -379,7 +394,7 @@ static inline uint8_t mavlink_msg_mission_item_get_target_component(const mavlin */ static inline uint16_t mavlink_msg_mission_item_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -389,7 +404,7 @@ static inline uint16_t mavlink_msg_mission_item_get_seq(const mavlink_message_t* */ static inline uint8_t mavlink_msg_mission_item_get_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -399,7 +414,7 @@ static inline uint8_t mavlink_msg_mission_item_get_frame(const mavlink_message_t */ static inline uint16_t mavlink_msg_mission_item_get_command(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 30); + return _MAV_RETURN_uint16_t(msg, 30); } /** @@ -409,7 +424,7 @@ static inline uint16_t mavlink_msg_mission_item_get_command(const mavlink_messag */ static inline uint8_t mavlink_msg_mission_item_get_current(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 35); + return _MAV_RETURN_uint8_t(msg, 35); } /** @@ -419,7 +434,7 @@ static inline uint8_t mavlink_msg_mission_item_get_current(const mavlink_message */ static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 36); + return _MAV_RETURN_uint8_t(msg, 36); } /** @@ -429,7 +444,7 @@ static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_me */ static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -439,7 +454,7 @@ static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t* */ static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -449,7 +464,7 @@ static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t* */ static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -459,7 +474,7 @@ static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t* */ static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -469,7 +484,7 @@ static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t* */ static inline float mavlink_msg_mission_item_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -479,7 +494,7 @@ static inline float mavlink_msg_mission_item_get_x(const mavlink_message_t* msg) */ static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -489,7 +504,7 @@ static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t* msg) */ static inline float mavlink_msg_mission_item_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -500,22 +515,24 @@ static inline float mavlink_msg_mission_item_get_z(const mavlink_message_t* msg) */ static inline void mavlink_msg_mission_item_decode(const mavlink_message_t* msg, mavlink_mission_item_t* mission_item) { -#if MAVLINK_NEED_BYTE_SWAP - mission_item->param1 = mavlink_msg_mission_item_get_param1(msg); - mission_item->param2 = mavlink_msg_mission_item_get_param2(msg); - mission_item->param3 = mavlink_msg_mission_item_get_param3(msg); - mission_item->param4 = mavlink_msg_mission_item_get_param4(msg); - mission_item->x = mavlink_msg_mission_item_get_x(msg); - mission_item->y = mavlink_msg_mission_item_get_y(msg); - mission_item->z = mavlink_msg_mission_item_get_z(msg); - mission_item->seq = mavlink_msg_mission_item_get_seq(msg); - mission_item->command = mavlink_msg_mission_item_get_command(msg); - mission_item->target_system = mavlink_msg_mission_item_get_target_system(msg); - mission_item->target_component = mavlink_msg_mission_item_get_target_component(msg); - mission_item->frame = mavlink_msg_mission_item_get_frame(msg); - mission_item->current = mavlink_msg_mission_item_get_current(msg); - mission_item->autocontinue = mavlink_msg_mission_item_get_autocontinue(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_item->param1 = mavlink_msg_mission_item_get_param1(msg); + mission_item->param2 = mavlink_msg_mission_item_get_param2(msg); + mission_item->param3 = mavlink_msg_mission_item_get_param3(msg); + mission_item->param4 = mavlink_msg_mission_item_get_param4(msg); + mission_item->x = mavlink_msg_mission_item_get_x(msg); + mission_item->y = mavlink_msg_mission_item_get_y(msg); + mission_item->z = mavlink_msg_mission_item_get_z(msg); + mission_item->seq = mavlink_msg_mission_item_get_seq(msg); + mission_item->command = mavlink_msg_mission_item_get_command(msg); + mission_item->target_system = mavlink_msg_mission_item_get_target_system(msg); + mission_item->target_component = mavlink_msg_mission_item_get_target_component(msg); + mission_item->frame = mavlink_msg_mission_item_get_frame(msg); + mission_item->current = mavlink_msg_mission_item_get_current(msg); + mission_item->autocontinue = mavlink_msg_mission_item_get_autocontinue(msg); #else - memcpy(mission_item, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ITEM_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_LEN; + memset(mission_item, 0, MAVLINK_MSG_ID_MISSION_ITEM_LEN); + memcpy(mission_item, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_int.h index 7beae1b..91ddeb4 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_int.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE MISSION_ITEM_INT PACKING #define MAVLINK_MSG_ID_MISSION_ITEM_INT 73 -typedef struct __mavlink_mission_item_int_t -{ +MAVPACKED( +typedef struct __mavlink_mission_item_int_t { float param1; /*< PARAM1, see MAV_CMD enum*/ float param2; /*< PARAM2, see MAV_CMD enum*/ float param3; /*< PARAM3, see MAV_CMD enum*/ @@ -18,20 +19,24 @@ typedef struct __mavlink_mission_item_int_t uint8_t frame; /*< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h*/ uint8_t current; /*< false:0, true:1*/ uint8_t autocontinue; /*< autocontinue to next wp*/ -} mavlink_mission_item_int_t; +}) mavlink_mission_item_int_t; #define MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN 37 +#define MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN 37 #define MAVLINK_MSG_ID_73_LEN 37 +#define MAVLINK_MSG_ID_73_MIN_LEN 37 #define MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC 38 #define MAVLINK_MSG_ID_73_CRC 38 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT { \ - "MISSION_ITEM_INT", \ - 14, \ - { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \ + 73, \ + "MISSION_ITEM_INT", \ + 14, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \ { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \ { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \ { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \ @@ -47,7 +52,27 @@ typedef struct __mavlink_mission_item_int_t { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT { \ + "MISSION_ITEM_INT", \ + 14, \ + { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_int_t, param1) }, \ + { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_int_t, param2) }, \ + { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_int_t, param3) }, \ + { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_int_t, param4) }, \ + { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_item_int_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_item_int_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_int_t, z) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_int_t, seq) }, \ + { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_int_t, command) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_int_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_int_t, frame) }, \ + { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_int_t, current) }, \ + { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_int_t, autocontinue) }, \ + } \ +} +#endif /** * @brief Pack a mission_item_int message @@ -72,52 +97,48 @@ typedef struct __mavlink_mission_item_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) + uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); #else - mavlink_mission_item_int_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.seq = seq; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; + mavlink_mission_item_int_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.seq = seq; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); } /** @@ -143,53 +164,49 @@ static inline uint16_t mavlink_msg_mission_item_int_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t seq,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); #else - mavlink_mission_item_int_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.seq = seq; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; + mavlink_mission_item_int_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.seq = seq; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); } /** @@ -202,7 +219,7 @@ static inline uint16_t mavlink_msg_mission_item_int_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_mission_item_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_int_t* mission_item_int) { - return mavlink_msg_mission_item_int_pack(system_id, component_id, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z); + return mavlink_msg_mission_item_int_pack(system_id, component_id, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z); } /** @@ -216,7 +233,7 @@ static inline uint16_t mavlink_msg_mission_item_int_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_mission_item_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_int_t* mission_item_int) { - return mavlink_msg_mission_item_int_pack_chan(system_id, component_id, chan, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z); + return mavlink_msg_mission_item_int_pack_chan(system_id, component_id, chan, msg, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z); } /** @@ -243,49 +260,55 @@ static inline uint16_t mavlink_msg_mission_item_int_encode_chan(uint8_t system_i static inline void mavlink_msg_mission_item_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN]; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN]; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); + mavlink_mission_item_int_t packet; + packet.param1 = param1; + packet.param2 = param2; + packet.param3 = param3; + packet.param4 = param4; + packet.x = x; + packet.y = y; + packet.z = z; + packet.seq = seq; + packet.command = command; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + packet.current = current; + packet.autocontinue = autocontinue; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); #endif +} + +/** + * @brief Send a mission_item_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_item_int_send_struct(mavlink_channel_t chan, const mavlink_mission_item_int_t* mission_item_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_item_int_send(chan, mission_item_int->target_system, mission_item_int->target_component, mission_item_int->seq, mission_item_int->frame, mission_item_int->command, mission_item_int->current, mission_item_int->autocontinue, mission_item_int->param1, mission_item_int->param2, mission_item_int->param3, mission_item_int->param4, mission_item_int->x, mission_item_int->y, mission_item_int->z); #else - mavlink_mission_item_int_t packet; - packet.param1 = param1; - packet.param2 = param2; - packet.param3 = param3; - packet.param4 = param4; - packet.x = x; - packet.y = y; - packet.z = z; - packet.seq = seq; - packet.command = command; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - packet.current = current; - packet.autocontinue = autocontinue; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)mission_item_int, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); #endif } @@ -300,49 +323,41 @@ static inline void mavlink_msg_mission_item_int_send(mavlink_channel_t chan, uin static inline void mavlink_msg_mission_item_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, param1); - _mav_put_float(buf, 4, param2); - _mav_put_float(buf, 8, param3); - _mav_put_float(buf, 12, param4); - _mav_put_int32_t(buf, 16, x); - _mav_put_int32_t(buf, 20, y); - _mav_put_float(buf, 24, z); - _mav_put_uint16_t(buf, 28, seq); - _mav_put_uint16_t(buf, 30, command); - _mav_put_uint8_t(buf, 32, target_system); - _mav_put_uint8_t(buf, 33, target_component); - _mav_put_uint8_t(buf, 34, frame); - _mav_put_uint8_t(buf, 35, current); - _mav_put_uint8_t(buf, 36, autocontinue); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param1); + _mav_put_float(buf, 4, param2); + _mav_put_float(buf, 8, param3); + _mav_put_float(buf, 12, param4); + _mav_put_int32_t(buf, 16, x); + _mav_put_int32_t(buf, 20, y); + _mav_put_float(buf, 24, z); + _mav_put_uint16_t(buf, 28, seq); + _mav_put_uint16_t(buf, 30, command); + _mav_put_uint8_t(buf, 32, target_system); + _mav_put_uint8_t(buf, 33, target_component); + _mav_put_uint8_t(buf, 34, frame); + _mav_put_uint8_t(buf, 35, current); + _mav_put_uint8_t(buf, 36, autocontinue); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, buf, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); -#endif -#else - mavlink_mission_item_int_t *packet = (mavlink_mission_item_int_t *)msgbuf; - packet->param1 = param1; - packet->param2 = param2; - packet->param3 = param3; - packet->param4 = param4; - packet->x = x; - packet->y = y; - packet->z = z; - packet->seq = seq; - packet->command = command; - packet->target_system = target_system; - packet->target_component = target_component; - packet->frame = frame; - packet->current = current; - packet->autocontinue = autocontinue; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); -#endif + mavlink_mission_item_int_t *packet = (mavlink_mission_item_int_t *)msgbuf; + packet->param1 = param1; + packet->param2 = param2; + packet->param3 = param3; + packet->param4 = param4; + packet->x = x; + packet->y = y; + packet->z = z; + packet->seq = seq; + packet->command = command; + packet->target_system = target_system; + packet->target_component = target_component; + packet->frame = frame; + packet->current = current; + packet->autocontinue = autocontinue; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN, MAVLINK_MSG_ID_MISSION_ITEM_INT_CRC); #endif } #endif @@ -359,7 +374,7 @@ static inline void mavlink_msg_mission_item_int_send_buf(mavlink_message_t *msgb */ static inline uint8_t mavlink_msg_mission_item_int_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 32); + return _MAV_RETURN_uint8_t(msg, 32); } /** @@ -369,7 +384,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_target_system(const mavli */ static inline uint8_t mavlink_msg_mission_item_int_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 33); + return _MAV_RETURN_uint8_t(msg, 33); } /** @@ -379,7 +394,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_target_component(const ma */ static inline uint16_t mavlink_msg_mission_item_int_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -389,7 +404,7 @@ static inline uint16_t mavlink_msg_mission_item_int_get_seq(const mavlink_messag */ static inline uint8_t mavlink_msg_mission_item_int_get_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 34); + return _MAV_RETURN_uint8_t(msg, 34); } /** @@ -399,7 +414,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_frame(const mavlink_messa */ static inline uint16_t mavlink_msg_mission_item_int_get_command(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 30); + return _MAV_RETURN_uint16_t(msg, 30); } /** @@ -409,7 +424,7 @@ static inline uint16_t mavlink_msg_mission_item_int_get_command(const mavlink_me */ static inline uint8_t mavlink_msg_mission_item_int_get_current(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 35); + return _MAV_RETURN_uint8_t(msg, 35); } /** @@ -419,7 +434,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_current(const mavlink_mes */ static inline uint8_t mavlink_msg_mission_item_int_get_autocontinue(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 36); + return _MAV_RETURN_uint8_t(msg, 36); } /** @@ -429,7 +444,7 @@ static inline uint8_t mavlink_msg_mission_item_int_get_autocontinue(const mavlin */ static inline float mavlink_msg_mission_item_int_get_param1(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -439,7 +454,7 @@ static inline float mavlink_msg_mission_item_int_get_param1(const mavlink_messag */ static inline float mavlink_msg_mission_item_int_get_param2(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -449,7 +464,7 @@ static inline float mavlink_msg_mission_item_int_get_param2(const mavlink_messag */ static inline float mavlink_msg_mission_item_int_get_param3(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -459,7 +474,7 @@ static inline float mavlink_msg_mission_item_int_get_param3(const mavlink_messag */ static inline float mavlink_msg_mission_item_int_get_param4(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -469,7 +484,7 @@ static inline float mavlink_msg_mission_item_int_get_param4(const mavlink_messag */ static inline int32_t mavlink_msg_mission_item_int_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 16); + return _MAV_RETURN_int32_t(msg, 16); } /** @@ -479,7 +494,7 @@ static inline int32_t mavlink_msg_mission_item_int_get_x(const mavlink_message_t */ static inline int32_t mavlink_msg_mission_item_int_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 20); + return _MAV_RETURN_int32_t(msg, 20); } /** @@ -489,7 +504,7 @@ static inline int32_t mavlink_msg_mission_item_int_get_y(const mavlink_message_t */ static inline float mavlink_msg_mission_item_int_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -500,22 +515,24 @@ static inline float mavlink_msg_mission_item_int_get_z(const mavlink_message_t* */ static inline void mavlink_msg_mission_item_int_decode(const mavlink_message_t* msg, mavlink_mission_item_int_t* mission_item_int) { -#if MAVLINK_NEED_BYTE_SWAP - mission_item_int->param1 = mavlink_msg_mission_item_int_get_param1(msg); - mission_item_int->param2 = mavlink_msg_mission_item_int_get_param2(msg); - mission_item_int->param3 = mavlink_msg_mission_item_int_get_param3(msg); - mission_item_int->param4 = mavlink_msg_mission_item_int_get_param4(msg); - mission_item_int->x = mavlink_msg_mission_item_int_get_x(msg); - mission_item_int->y = mavlink_msg_mission_item_int_get_y(msg); - mission_item_int->z = mavlink_msg_mission_item_int_get_z(msg); - mission_item_int->seq = mavlink_msg_mission_item_int_get_seq(msg); - mission_item_int->command = mavlink_msg_mission_item_int_get_command(msg); - mission_item_int->target_system = mavlink_msg_mission_item_int_get_target_system(msg); - mission_item_int->target_component = mavlink_msg_mission_item_int_get_target_component(msg); - mission_item_int->frame = mavlink_msg_mission_item_int_get_frame(msg); - mission_item_int->current = mavlink_msg_mission_item_int_get_current(msg); - mission_item_int->autocontinue = mavlink_msg_mission_item_int_get_autocontinue(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_item_int->param1 = mavlink_msg_mission_item_int_get_param1(msg); + mission_item_int->param2 = mavlink_msg_mission_item_int_get_param2(msg); + mission_item_int->param3 = mavlink_msg_mission_item_int_get_param3(msg); + mission_item_int->param4 = mavlink_msg_mission_item_int_get_param4(msg); + mission_item_int->x = mavlink_msg_mission_item_int_get_x(msg); + mission_item_int->y = mavlink_msg_mission_item_int_get_y(msg); + mission_item_int->z = mavlink_msg_mission_item_int_get_z(msg); + mission_item_int->seq = mavlink_msg_mission_item_int_get_seq(msg); + mission_item_int->command = mavlink_msg_mission_item_int_get_command(msg); + mission_item_int->target_system = mavlink_msg_mission_item_int_get_target_system(msg); + mission_item_int->target_component = mavlink_msg_mission_item_int_get_target_component(msg); + mission_item_int->frame = mavlink_msg_mission_item_int_get_frame(msg); + mission_item_int->current = mavlink_msg_mission_item_int_get_current(msg); + mission_item_int->autocontinue = mavlink_msg_mission_item_int_get_autocontinue(msg); #else - memcpy(mission_item_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN; + memset(mission_item_int, 0, MAVLINK_MSG_ID_MISSION_ITEM_INT_LEN); + memcpy(mission_item_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_reached.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_reached.h index 431ea18..13f4b51 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_reached.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_item_reached.h @@ -1,27 +1,39 @@ +#pragma once // MESSAGE MISSION_ITEM_REACHED PACKING #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED 46 -typedef struct __mavlink_mission_item_reached_t -{ +MAVPACKED( +typedef struct __mavlink_mission_item_reached_t { uint16_t seq; /*< Sequence*/ -} mavlink_mission_item_reached_t; +}) mavlink_mission_item_reached_t; #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2 +#define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN 2 #define MAVLINK_MSG_ID_46_LEN 2 +#define MAVLINK_MSG_ID_46_MIN_LEN 2 #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC 11 #define MAVLINK_MSG_ID_46_CRC 11 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \ - "MISSION_ITEM_REACHED", \ - 1, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \ + 46, \ + "MISSION_ITEM_REACHED", \ + 1, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \ + "MISSION_ITEM_REACHED", \ + 1, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \ + } \ +} +#endif /** * @brief Pack a mission_item_reached message @@ -33,26 +45,22 @@ typedef struct __mavlink_mission_item_reached_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t seq) + uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; - _mav_put_uint16_t(buf, 0, seq); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; + _mav_put_uint16_t(buf, 0, seq); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #else - mavlink_mission_item_reached_t packet; - packet.seq = seq; + mavlink_mission_item_reached_t packet; + packet.seq = seq; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); } /** @@ -65,27 +73,23 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t seq) + mavlink_message_t* msg, + uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; - _mav_put_uint16_t(buf, 0, seq); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; + _mav_put_uint16_t(buf, 0, seq); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #else - mavlink_mission_item_reached_t packet; - packet.seq = seq; + mavlink_mission_item_reached_t packet; + packet.seq = seq; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); } /** @@ -98,7 +102,7 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system */ static inline uint16_t mavlink_msg_mission_item_reached_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached) { - return mavlink_msg_mission_item_reached_pack(system_id, component_id, msg, mission_item_reached->seq); + return mavlink_msg_mission_item_reached_pack(system_id, component_id, msg, mission_item_reached->seq); } /** @@ -112,7 +116,7 @@ static inline uint16_t mavlink_msg_mission_item_reached_encode(uint8_t system_id */ static inline uint16_t mavlink_msg_mission_item_reached_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached) { - return mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, chan, msg, mission_item_reached->seq); + return mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, chan, msg, mission_item_reached->seq); } /** @@ -126,23 +130,29 @@ static inline uint16_t mavlink_msg_mission_item_reached_encode_chan(uint8_t syst static inline void mavlink_msg_mission_item_reached_send(mavlink_channel_t chan, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; - _mav_put_uint16_t(buf, 0, seq); + char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN]; + _mav_put_uint16_t(buf, 0, seq); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); + mavlink_mission_item_reached_t packet; + packet.seq = seq; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); #endif -#else - mavlink_mission_item_reached_t packet; - packet.seq = seq; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); +/** + * @brief Send a mission_item_reached message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_item_reached_send_struct(mavlink_channel_t chan, const mavlink_mission_item_reached_t* mission_item_reached) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_item_reached_send(chan, mission_item_reached->seq); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)mission_item_reached, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); #endif } @@ -157,23 +167,15 @@ static inline void mavlink_msg_mission_item_reached_send(mavlink_channel_t chan, static inline void mavlink_msg_mission_item_reached_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, seq); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, seq); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); #else - mavlink_mission_item_reached_t *packet = (mavlink_mission_item_reached_t *)msgbuf; - packet->seq = seq; + mavlink_mission_item_reached_t *packet = (mavlink_mission_item_reached_t *)msgbuf; + packet->seq = seq; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC); #endif } #endif @@ -190,7 +192,7 @@ static inline void mavlink_msg_mission_item_reached_send_buf(mavlink_message_t * */ static inline uint16_t mavlink_msg_mission_item_reached_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -201,9 +203,11 @@ static inline uint16_t mavlink_msg_mission_item_reached_get_seq(const mavlink_me */ static inline void mavlink_msg_mission_item_reached_decode(const mavlink_message_t* msg, mavlink_mission_item_reached_t* mission_item_reached) { -#if MAVLINK_NEED_BYTE_SWAP - mission_item_reached->seq = mavlink_msg_mission_item_reached_get_seq(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_item_reached->seq = mavlink_msg_mission_item_reached_get_seq(msg); #else - memcpy(mission_item_reached, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN? msg->len : MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN; + memset(mission_item_reached, 0, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN); + memcpy(mission_item_reached, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request.h index 6c48161..f088b75 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE MISSION_REQUEST PACKING #define MAVLINK_MSG_ID_MISSION_REQUEST 40 -typedef struct __mavlink_mission_request_t -{ +MAVPACKED( +typedef struct __mavlink_mission_request_t { uint16_t seq; /*< Sequence*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_request_t; +}) mavlink_mission_request_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_LEN 4 +#define MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN 4 #define MAVLINK_MSG_ID_40_LEN 4 +#define MAVLINK_MSG_ID_40_MIN_LEN 4 #define MAVLINK_MSG_ID_MISSION_REQUEST_CRC 230 #define MAVLINK_MSG_ID_40_CRC 230 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \ - "MISSION_REQUEST", \ - 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ + 40, \ + "MISSION_REQUEST", \ + 3, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \ + "MISSION_REQUEST", \ + 3, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_request message @@ -39,30 +53,26 @@ typedef struct __mavlink_mission_request_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq) + uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #else - mavlink_mission_request_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #else - mavlink_mission_request_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_mission_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_t* mission_request) { - return mavlink_msg_mission_request_pack(system_id, component_id, msg, mission_request->target_system, mission_request->target_component, mission_request->seq); + return mavlink_msg_mission_request_pack(system_id, component_id, msg, mission_request->target_system, mission_request->target_component, mission_request->seq); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_mission_request_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_mission_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_t* mission_request) { - return mavlink_msg_mission_request_pack_chan(system_id, component_id, chan, msg, mission_request->target_system, mission_request->target_component, mission_request->seq); + return mavlink_msg_mission_request_pack_chan(system_id, component_id, chan, msg, mission_request->target_system, mission_request->target_component, mission_request->seq); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_mission_request_encode_chan(uint8_t system_id static inline void mavlink_msg_mission_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); + mavlink_mission_request_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); #endif -#else - mavlink_mission_request_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); +/** + * @brief Send a mission_request message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_request_send_struct(mavlink_channel_t chan, const mavlink_mission_request_t* mission_request) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_request_send(chan, mission_request->target_system, mission_request->target_component, mission_request->seq); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)mission_request, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_mission_request_send(mavlink_channel_t chan, uint static inline void mavlink_msg_mission_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); #else - mavlink_mission_request_t *packet = (mavlink_mission_request_t *)msgbuf; - packet->seq = seq; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_mission_request_t *packet = (mavlink_mission_request_t *)msgbuf; + packet->seq = seq; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_mission_request_send_buf(mavlink_message_t *msgbu */ static inline uint8_t mavlink_msg_mission_request_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_mission_request_get_target_system(const mavlin */ static inline uint8_t mavlink_msg_mission_request_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_mission_request_get_target_component(const mav */ static inline uint16_t mavlink_msg_mission_request_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -247,11 +251,13 @@ static inline uint16_t mavlink_msg_mission_request_get_seq(const mavlink_message */ static inline void mavlink_msg_mission_request_decode(const mavlink_message_t* msg, mavlink_mission_request_t* mission_request) { -#if MAVLINK_NEED_BYTE_SWAP - mission_request->seq = mavlink_msg_mission_request_get_seq(msg); - mission_request->target_system = mavlink_msg_mission_request_get_target_system(msg); - mission_request->target_component = mavlink_msg_mission_request_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_request->seq = mavlink_msg_mission_request_get_seq(msg); + mission_request->target_system = mavlink_msg_mission_request_get_target_system(msg); + mission_request->target_component = mavlink_msg_mission_request_get_target_component(msg); #else - memcpy(mission_request, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_REQUEST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_LEN; + memset(mission_request, 0, MAVLINK_MSG_ID_MISSION_REQUEST_LEN); + memcpy(mission_request, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_int.h index d9c2eb6..112da27 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_int.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE MISSION_REQUEST_INT PACKING #define MAVLINK_MSG_ID_MISSION_REQUEST_INT 51 -typedef struct __mavlink_mission_request_int_t -{ +MAVPACKED( +typedef struct __mavlink_mission_request_int_t { uint16_t seq; /*< Sequence*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_request_int_t; +}) mavlink_mission_request_int_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN 4 +#define MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN 4 #define MAVLINK_MSG_ID_51_LEN 4 +#define MAVLINK_MSG_ID_51_MIN_LEN 4 #define MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC 196 #define MAVLINK_MSG_ID_51_CRC 196 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT { \ - "MISSION_REQUEST_INT", \ - 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \ + 51, \ + "MISSION_REQUEST_INT", \ + 3, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT { \ + "MISSION_REQUEST_INT", \ + 3, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_int_t, seq) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_int_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_request_int message @@ -39,30 +53,26 @@ typedef struct __mavlink_mission_request_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq) + uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); #else - mavlink_mission_request_int_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_int_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_mission_request_int_pack(uint8_t system_id, u * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); #else - mavlink_mission_request_int_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_int_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_mission_request_int_pack_chan(uint8_t system_ */ static inline uint16_t mavlink_msg_mission_request_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_int_t* mission_request_int) { - return mavlink_msg_mission_request_int_pack(system_id, component_id, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq); + return mavlink_msg_mission_request_int_pack(system_id, component_id, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_mission_request_int_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_mission_request_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_int_t* mission_request_int) { - return mavlink_msg_mission_request_int_pack_chan(system_id, component_id, chan, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq); + return mavlink_msg_mission_request_int_pack_chan(system_id, component_id, chan, msg, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_mission_request_int_encode_chan(uint8_t syste static inline void mavlink_msg_mission_request_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); + mavlink_mission_request_int_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); #endif -#else - mavlink_mission_request_int_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); +/** + * @brief Send a mission_request_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_request_int_send_struct(mavlink_channel_t chan, const mavlink_mission_request_int_t* mission_request_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_request_int_send(chan, mission_request_int->target_system, mission_request_int->target_component, mission_request_int->seq); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)mission_request_int, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_mission_request_int_send(mavlink_channel_t chan, static inline void mavlink_msg_mission_request_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, buf, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); #else - mavlink_mission_request_int_t *packet = (mavlink_mission_request_int_t *)msgbuf; - packet->seq = seq; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_mission_request_int_t *packet = (mavlink_mission_request_int_t *)msgbuf; + packet->seq = seq; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_INT, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_INT_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_mission_request_int_send_buf(mavlink_message_t *m */ static inline uint8_t mavlink_msg_mission_request_int_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_mission_request_int_get_target_system(const ma */ static inline uint8_t mavlink_msg_mission_request_int_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_mission_request_int_get_target_component(const */ static inline uint16_t mavlink_msg_mission_request_int_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -247,11 +251,13 @@ static inline uint16_t mavlink_msg_mission_request_int_get_seq(const mavlink_mes */ static inline void mavlink_msg_mission_request_int_decode(const mavlink_message_t* msg, mavlink_mission_request_int_t* mission_request_int) { -#if MAVLINK_NEED_BYTE_SWAP - mission_request_int->seq = mavlink_msg_mission_request_int_get_seq(msg); - mission_request_int->target_system = mavlink_msg_mission_request_int_get_target_system(msg); - mission_request_int->target_component = mavlink_msg_mission_request_int_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_request_int->seq = mavlink_msg_mission_request_int_get_seq(msg); + mission_request_int->target_system = mavlink_msg_mission_request_int_get_target_system(msg); + mission_request_int->target_component = mavlink_msg_mission_request_int_get_target_component(msg); #else - memcpy(mission_request_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN; + memset(mission_request_int, 0, MAVLINK_MSG_ID_MISSION_REQUEST_INT_LEN); + memcpy(mission_request_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_list.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_list.h index d821690..533e0fe 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_list.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_list.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE MISSION_REQUEST_LIST PACKING #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST 43 -typedef struct __mavlink_mission_request_list_t -{ +MAVPACKED( +typedef struct __mavlink_mission_request_list_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_request_list_t; +}) mavlink_mission_request_list_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 2 +#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN 2 #define MAVLINK_MSG_ID_43_LEN 2 +#define MAVLINK_MSG_ID_43_MIN_LEN 2 #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC 132 #define MAVLINK_MSG_ID_43_CRC 132 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \ - "MISSION_REQUEST_LIST", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \ + 43, \ + "MISSION_REQUEST_LIST", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \ + "MISSION_REQUEST_LIST", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_request_list message @@ -36,28 +49,24 @@ typedef struct __mavlink_mission_request_list_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) + uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #else - mavlink_mission_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_list_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #else - mavlink_mission_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_list_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system */ static inline uint16_t mavlink_msg_mission_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list) { - return mavlink_msg_mission_request_list_pack(system_id, component_id, msg, mission_request_list->target_system, mission_request_list->target_component); + return mavlink_msg_mission_request_list_pack(system_id, component_id, msg, mission_request_list->target_system, mission_request_list->target_component); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_mission_request_list_encode(uint8_t system_id */ static inline uint16_t mavlink_msg_mission_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list) { - return mavlink_msg_mission_request_list_pack_chan(system_id, component_id, chan, msg, mission_request_list->target_system, mission_request_list->target_component); + return mavlink_msg_mission_request_list_pack_chan(system_id, component_id, chan, msg, mission_request_list->target_system, mission_request_list->target_component); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_mission_request_list_encode_chan(uint8_t syst static inline void mavlink_msg_mission_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); + mavlink_mission_request_list_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); #endif -#else - mavlink_mission_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); +/** + * @brief Send a mission_request_list message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_request_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_list_t* mission_request_list) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_request_list_send(chan, mission_request_list->target_system, mission_request_list->target_component); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)mission_request_list, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_mission_request_list_send(mavlink_channel_t chan, static inline void mavlink_msg_mission_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); #else - mavlink_mission_request_list_t *packet = (mavlink_mission_request_list_t *)msgbuf; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_mission_request_list_t *packet = (mavlink_mission_request_list_t *)msgbuf; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_mission_request_list_send_buf(mavlink_message_t * */ static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const m */ static inline uint8_t mavlink_msg_mission_request_list_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -224,10 +227,12 @@ static inline uint8_t mavlink_msg_mission_request_list_get_target_component(cons */ static inline void mavlink_msg_mission_request_list_decode(const mavlink_message_t* msg, mavlink_mission_request_list_t* mission_request_list) { -#if MAVLINK_NEED_BYTE_SWAP - mission_request_list->target_system = mavlink_msg_mission_request_list_get_target_system(msg); - mission_request_list->target_component = mavlink_msg_mission_request_list_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_request_list->target_system = mavlink_msg_mission_request_list_get_target_system(msg); + mission_request_list->target_component = mavlink_msg_mission_request_list_get_target_component(msg); #else - memcpy(mission_request_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN; + memset(mission_request_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN); + memcpy(mission_request_list, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_partial_list.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_partial_list.h index c4c4c7f..fde86c0 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_partial_list.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_request_partial_list.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE MISSION_REQUEST_PARTIAL_LIST PACKING #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST 37 -typedef struct __mavlink_mission_request_partial_list_t -{ +MAVPACKED( +typedef struct __mavlink_mission_request_partial_list_t { int16_t start_index; /*< Start index, 0 by default*/ int16_t end_index; /*< End index, -1 by default (-1: send list to end). Else a valid index of the list*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_request_partial_list_t; +}) mavlink_mission_request_partial_list_t; #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 6 +#define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN 6 #define MAVLINK_MSG_ID_37_LEN 6 +#define MAVLINK_MSG_ID_37_MIN_LEN 6 #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC 212 #define MAVLINK_MSG_ID_37_CRC 212 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \ - "MISSION_REQUEST_PARTIAL_LIST", \ - 4, \ - { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ + 37, \ + "MISSION_REQUEST_PARTIAL_LIST", \ + 4, \ + { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \ + "MISSION_REQUEST_PARTIAL_LIST", \ + 4, \ + { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_request_partial_list message @@ -42,32 +57,28 @@ typedef struct __mavlink_mission_request_partial_list_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) + uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #else - mavlink_mission_request_partial_list_t packet; - packet.start_index = start_index; - packet.end_index = end_index; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_partial_list_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #else - mavlink_mission_request_partial_list_t packet; - packet.start_index = start_index; - packet.end_index = end_index; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_request_partial_list_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_ */ static inline uint16_t mavlink_msg_mission_request_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list) { - return mavlink_msg_mission_request_partial_list_pack(system_id, component_id, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); + return mavlink_msg_mission_request_partial_list_pack(system_id, component_id, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_encode(uint8_t s */ static inline uint16_t mavlink_msg_mission_request_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list) { - return mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, chan, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); + return mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, chan, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_encode_chan(uint static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); + char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); + mavlink_mission_request_partial_list_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); #endif +} + +/** + * @brief Send a mission_request_partial_list message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_request_partial_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_partial_list_t* mission_request_partial_list) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_request_partial_list_send(chan, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); #else - mavlink_mission_request_partial_list_t packet; - packet.start_index = start_index; - packet.end_index = end_index; - packet.target_system = target_system; - packet.target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)mission_request_partial_list, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel static inline void mavlink_msg_mission_request_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); -#endif -#else - mavlink_mission_request_partial_list_t *packet = (mavlink_mission_request_partial_list_t *)msgbuf; - packet->start_index = start_index; - packet->end_index = end_index; - packet->target_system = target_system; - packet->target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); + char *buf = (char *)msgbuf; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); -#endif + mavlink_mission_request_partial_list_t *packet = (mavlink_mission_request_partial_list_t *)msgbuf; + packet->start_index = start_index; + packet->end_index = end_index; + packet->target_system = target_system; + packet->target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_mission_request_partial_list_send_buf(mavlink_mes */ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -239,7 +244,7 @@ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system */ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -249,7 +254,7 @@ static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_compon */ static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 0); + return _MAV_RETURN_int16_t(msg, 0); } /** @@ -259,7 +264,7 @@ static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(c */ static inline int16_t mavlink_msg_mission_request_partial_list_get_end_index(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 2); + return _MAV_RETURN_int16_t(msg, 2); } /** @@ -270,12 +275,14 @@ static inline int16_t mavlink_msg_mission_request_partial_list_get_end_index(con */ static inline void mavlink_msg_mission_request_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_request_partial_list_t* mission_request_partial_list) { -#if MAVLINK_NEED_BYTE_SWAP - mission_request_partial_list->start_index = mavlink_msg_mission_request_partial_list_get_start_index(msg); - mission_request_partial_list->end_index = mavlink_msg_mission_request_partial_list_get_end_index(msg); - mission_request_partial_list->target_system = mavlink_msg_mission_request_partial_list_get_target_system(msg); - mission_request_partial_list->target_component = mavlink_msg_mission_request_partial_list_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_request_partial_list->start_index = mavlink_msg_mission_request_partial_list_get_start_index(msg); + mission_request_partial_list->end_index = mavlink_msg_mission_request_partial_list_get_end_index(msg); + mission_request_partial_list->target_system = mavlink_msg_mission_request_partial_list_get_target_system(msg); + mission_request_partial_list->target_component = mavlink_msg_mission_request_partial_list_get_target_component(msg); #else - memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN; + memset(mission_request_partial_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); + memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_set_current.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_set_current.h index 1d4c544..901b67b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_set_current.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_set_current.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE MISSION_SET_CURRENT PACKING #define MAVLINK_MSG_ID_MISSION_SET_CURRENT 41 -typedef struct __mavlink_mission_set_current_t -{ +MAVPACKED( +typedef struct __mavlink_mission_set_current_t { uint16_t seq; /*< Sequence*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_set_current_t; +}) mavlink_mission_set_current_t; #define MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN 4 +#define MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN 4 #define MAVLINK_MSG_ID_41_LEN 4 +#define MAVLINK_MSG_ID_41_MIN_LEN 4 #define MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC 28 #define MAVLINK_MSG_ID_41_CRC 28 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \ - "MISSION_SET_CURRENT", \ - 3, \ - { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ + 41, \ + "MISSION_SET_CURRENT", \ + 3, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \ + "MISSION_SET_CURRENT", \ + 3, \ + { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_set_current message @@ -39,30 +53,26 @@ typedef struct __mavlink_mission_set_current_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t seq) + uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #else - mavlink_mission_set_current_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_set_current_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, u * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t seq) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #else - mavlink_mission_set_current_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_set_current_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_ */ static inline uint16_t mavlink_msg_mission_set_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_set_current_t* mission_set_current) { - return mavlink_msg_mission_set_current_pack(system_id, component_id, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq); + return mavlink_msg_mission_set_current_pack(system_id, component_id, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_mission_set_current_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_mission_set_current_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_set_current_t* mission_set_current) { - return mavlink_msg_mission_set_current_pack_chan(system_id, component_id, chan, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq); + return mavlink_msg_mission_set_current_pack_chan(system_id, component_id, chan, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_mission_set_current_encode_chan(uint8_t syste static inline void mavlink_msg_mission_set_current_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char buf[MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN]; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); + mavlink_mission_set_current_t packet; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); #endif -#else - mavlink_mission_set_current_t packet; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); +/** + * @brief Send a mission_set_current message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_set_current_send_struct(mavlink_channel_t chan, const mavlink_mission_set_current_t* mission_set_current) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_set_current_send(chan, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)mission_set_current, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_mission_set_current_send(mavlink_channel_t chan, static inline void mavlink_msg_mission_set_current_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, seq); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, seq); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); #else - mavlink_mission_set_current_t *packet = (mavlink_mission_set_current_t *)msgbuf; - packet->seq = seq; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_mission_set_current_t *packet = (mavlink_mission_set_current_t *)msgbuf; + packet->seq = seq; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_SET_CURRENT_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_mission_set_current_send_buf(mavlink_message_t *m */ static inline uint8_t mavlink_msg_mission_set_current_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_mission_set_current_get_target_system(const ma */ static inline uint8_t mavlink_msg_mission_set_current_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_mission_set_current_get_target_component(const */ static inline uint16_t mavlink_msg_mission_set_current_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -247,11 +251,13 @@ static inline uint16_t mavlink_msg_mission_set_current_get_seq(const mavlink_mes */ static inline void mavlink_msg_mission_set_current_decode(const mavlink_message_t* msg, mavlink_mission_set_current_t* mission_set_current) { -#if MAVLINK_NEED_BYTE_SWAP - mission_set_current->seq = mavlink_msg_mission_set_current_get_seq(msg); - mission_set_current->target_system = mavlink_msg_mission_set_current_get_target_system(msg); - mission_set_current->target_component = mavlink_msg_mission_set_current_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_set_current->seq = mavlink_msg_mission_set_current_get_seq(msg); + mission_set_current->target_system = mavlink_msg_mission_set_current_get_target_system(msg); + mission_set_current->target_component = mavlink_msg_mission_set_current_get_target_component(msg); #else - memcpy(mission_set_current, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN; + memset(mission_set_current, 0, MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN); + memcpy(mission_set_current, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_write_partial_list.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_write_partial_list.h index 1a0bf4f..d3a5f4b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_write_partial_list.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_mission_write_partial_list.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE MISSION_WRITE_PARTIAL_LIST PACKING #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST 38 -typedef struct __mavlink_mission_write_partial_list_t -{ +MAVPACKED( +typedef struct __mavlink_mission_write_partial_list_t { int16_t start_index; /*< Start index, 0 by default and smaller / equal to the largest index of the current onboard list.*/ int16_t end_index; /*< End index, equal or greater than start index.*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_mission_write_partial_list_t; +}) mavlink_mission_write_partial_list_t; #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN 6 +#define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN 6 #define MAVLINK_MSG_ID_38_LEN 6 +#define MAVLINK_MSG_ID_38_MIN_LEN 6 #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC 9 #define MAVLINK_MSG_ID_38_CRC 9 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \ - "MISSION_WRITE_PARTIAL_LIST", \ - 4, \ - { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \ + 38, \ + "MISSION_WRITE_PARTIAL_LIST", \ + 4, \ + { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \ { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \ + "MISSION_WRITE_PARTIAL_LIST", \ + 4, \ + { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \ + { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a mission_write_partial_list message @@ -42,32 +57,28 @@ typedef struct __mavlink_mission_write_partial_list_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) + uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); + char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #else - mavlink_mission_write_partial_list_t packet; - packet.start_index = start_index; - packet.end_index = end_index; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_write_partial_list_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); + char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #else - mavlink_mission_write_partial_list_t packet; - packet.start_index = start_index; - packet.end_index = end_index; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_mission_write_partial_list_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t */ static inline uint16_t mavlink_msg_mission_write_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list) { - return mavlink_msg_mission_write_partial_list_pack(system_id, component_id, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index); + return mavlink_msg_mission_write_partial_list_pack(system_id, component_id, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_encode(uint8_t sys */ static inline uint16_t mavlink_msg_mission_write_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list) { - return mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, chan, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index); + return mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, chan, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_encode_chan(uint8_ static inline void mavlink_msg_mission_write_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); + char buf[MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN]; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); + mavlink_mission_write_partial_list_t packet; + packet.start_index = start_index; + packet.end_index = end_index; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); #endif +} + +/** + * @brief Send a mission_write_partial_list message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_mission_write_partial_list_send_struct(mavlink_channel_t chan, const mavlink_mission_write_partial_list_t* mission_write_partial_list) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_mission_write_partial_list_send(chan, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index); #else - mavlink_mission_write_partial_list_t packet; - packet.start_index = start_index; - packet.end_index = end_index; - packet.target_system = target_system; - packet.target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)mission_write_partial_list, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_mission_write_partial_list_send(mavlink_channel_t static inline void mavlink_msg_mission_write_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int16_t(buf, 0, start_index); - _mav_put_int16_t(buf, 2, end_index); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); -#endif -#else - mavlink_mission_write_partial_list_t *packet = (mavlink_mission_write_partial_list_t *)msgbuf; - packet->start_index = start_index; - packet->end_index = end_index; - packet->target_system = target_system; - packet->target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); + char *buf = (char *)msgbuf; + _mav_put_int16_t(buf, 0, start_index); + _mav_put_int16_t(buf, 2, end_index); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); -#endif + mavlink_mission_write_partial_list_t *packet = (mavlink_mission_write_partial_list_t *)msgbuf; + packet->start_index = start_index; + packet->end_index = end_index; + packet->target_system = target_system; + packet->target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_mission_write_partial_list_send_buf(mavlink_messa */ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -239,7 +244,7 @@ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_system(c */ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -249,7 +254,7 @@ static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_componen */ static inline int16_t mavlink_msg_mission_write_partial_list_get_start_index(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 0); + return _MAV_RETURN_int16_t(msg, 0); } /** @@ -259,7 +264,7 @@ static inline int16_t mavlink_msg_mission_write_partial_list_get_start_index(con */ static inline int16_t mavlink_msg_mission_write_partial_list_get_end_index(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 2); + return _MAV_RETURN_int16_t(msg, 2); } /** @@ -270,12 +275,14 @@ static inline int16_t mavlink_msg_mission_write_partial_list_get_end_index(const */ static inline void mavlink_msg_mission_write_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_write_partial_list_t* mission_write_partial_list) { -#if MAVLINK_NEED_BYTE_SWAP - mission_write_partial_list->start_index = mavlink_msg_mission_write_partial_list_get_start_index(msg); - mission_write_partial_list->end_index = mavlink_msg_mission_write_partial_list_get_end_index(msg); - mission_write_partial_list->target_system = mavlink_msg_mission_write_partial_list_get_target_system(msg); - mission_write_partial_list->target_component = mavlink_msg_mission_write_partial_list_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mission_write_partial_list->start_index = mavlink_msg_mission_write_partial_list_get_start_index(msg); + mission_write_partial_list->end_index = mavlink_msg_mission_write_partial_list_get_end_index(msg); + mission_write_partial_list->target_system = mavlink_msg_mission_write_partial_list_get_target_system(msg); + mission_write_partial_list->target_component = mavlink_msg_mission_write_partial_list_get_target_component(msg); #else - memcpy(mission_write_partial_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN; + memset(mission_write_partial_list, 0, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN); + memcpy(mission_write_partial_list, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_float.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_float.h index ceb07a4..707a1d2 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_float.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_float.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE NAMED_VALUE_FLOAT PACKING #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT 251 -typedef struct __mavlink_named_value_float_t -{ +MAVPACKED( +typedef struct __mavlink_named_value_float_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float value; /*< Floating point value*/ char name[10]; /*< Name of the debug variable*/ -} mavlink_named_value_float_t; +}) mavlink_named_value_float_t; #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 18 +#define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN 18 #define MAVLINK_MSG_ID_251_LEN 18 +#define MAVLINK_MSG_ID_251_MIN_LEN 18 #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC 170 #define MAVLINK_MSG_ID_251_CRC 170 #define MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_NAME_LEN 10 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \ - "NAMED_VALUE_FLOAT", \ - 3, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \ + 251, \ + "NAMED_VALUE_FLOAT", \ + 3, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \ { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \ + "NAMED_VALUE_FLOAT", \ + 3, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \ + { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \ + { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \ + } \ +} +#endif /** * @brief Pack a named_value_float message @@ -39,28 +53,24 @@ typedef struct __mavlink_named_value_float_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, const char *name, float value) + uint32_t time_boot_ms, const char *name, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); + char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #else - mavlink_named_value_float_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); + mavlink_named_value_float_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + mav_array_memcpy(packet.name, name, sizeof(char)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); } /** @@ -75,29 +85,25 @@ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,const char *name,float value) + mavlink_message_t* msg, + uint32_t time_boot_ms,const char *name,float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); + char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #else - mavlink_named_value_float_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); + mavlink_named_value_float_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + mav_array_memcpy(packet.name, name, sizeof(char)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); } /** @@ -110,7 +116,7 @@ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id */ static inline uint16_t mavlink_msg_named_value_float_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float) { - return mavlink_msg_named_value_float_pack(system_id, component_id, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value); + return mavlink_msg_named_value_float_pack(system_id, component_id, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value); } /** @@ -124,7 +130,7 @@ static inline uint16_t mavlink_msg_named_value_float_encode(uint8_t system_id, u */ static inline uint16_t mavlink_msg_named_value_float_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float) { - return mavlink_msg_named_value_float_pack_chan(system_id, component_id, chan, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value); + return mavlink_msg_named_value_float_pack_chan(system_id, component_id, chan, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value); } /** @@ -140,25 +146,31 @@ static inline uint16_t mavlink_msg_named_value_float_encode_chan(uint8_t system_ static inline void mavlink_msg_named_value_float_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); + char buf[MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); + mavlink_named_value_float_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + mav_array_memcpy(packet.name, name, sizeof(char)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); #endif +} + +/** + * @brief Send a named_value_float message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_named_value_float_send_struct(mavlink_channel_t chan, const mavlink_named_value_float_t* named_value_float) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_named_value_float_send(chan, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value); #else - mavlink_named_value_float_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)named_value_float, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); #endif } @@ -173,25 +185,17 @@ static inline void mavlink_msg_named_value_float_send(mavlink_channel_t chan, ui static inline void mavlink_msg_named_value_float_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, float value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); -#endif -#else - mavlink_named_value_float_t *packet = (mavlink_named_value_float_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->value = value; - mav_array_memcpy(packet->name, name, sizeof(char)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); -#endif + mavlink_named_value_float_t *packet = (mavlink_named_value_float_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->value = value; + mav_array_memcpy(packet->name, name, sizeof(char)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_CRC); #endif } #endif @@ -208,7 +212,7 @@ static inline void mavlink_msg_named_value_float_send_buf(mavlink_message_t *msg */ static inline uint32_t mavlink_msg_named_value_float_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -218,7 +222,7 @@ static inline uint32_t mavlink_msg_named_value_float_get_time_boot_ms(const mavl */ static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_message_t* msg, char *name) { - return _MAV_RETURN_char_array(msg, name, 10, 8); + return _MAV_RETURN_char_array(msg, name, 10, 8); } /** @@ -228,7 +232,7 @@ static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_mess */ static inline float mavlink_msg_named_value_float_get_value(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -239,11 +243,13 @@ static inline float mavlink_msg_named_value_float_get_value(const mavlink_messag */ static inline void mavlink_msg_named_value_float_decode(const mavlink_message_t* msg, mavlink_named_value_float_t* named_value_float) { -#if MAVLINK_NEED_BYTE_SWAP - named_value_float->time_boot_ms = mavlink_msg_named_value_float_get_time_boot_ms(msg); - named_value_float->value = mavlink_msg_named_value_float_get_value(msg); - mavlink_msg_named_value_float_get_name(msg, named_value_float->name); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + named_value_float->time_boot_ms = mavlink_msg_named_value_float_get_time_boot_ms(msg); + named_value_float->value = mavlink_msg_named_value_float_get_value(msg); + mavlink_msg_named_value_float_get_name(msg, named_value_float->name); #else - memcpy(named_value_float, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN? msg->len : MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN; + memset(named_value_float, 0, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN); + memcpy(named_value_float, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_int.h index a3b16a1..a0293a6 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_named_value_int.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE NAMED_VALUE_INT PACKING #define MAVLINK_MSG_ID_NAMED_VALUE_INT 252 -typedef struct __mavlink_named_value_int_t -{ +MAVPACKED( +typedef struct __mavlink_named_value_int_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ int32_t value; /*< Signed integer value*/ char name[10]; /*< Name of the debug variable*/ -} mavlink_named_value_int_t; +}) mavlink_named_value_int_t; #define MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 18 +#define MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN 18 #define MAVLINK_MSG_ID_252_LEN 18 +#define MAVLINK_MSG_ID_252_MIN_LEN 18 #define MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC 44 #define MAVLINK_MSG_ID_252_CRC 44 #define MAVLINK_MSG_NAMED_VALUE_INT_FIELD_NAME_LEN 10 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \ - "NAMED_VALUE_INT", \ - 3, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \ + 252, \ + "NAMED_VALUE_INT", \ + 3, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \ { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \ { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \ + "NAMED_VALUE_INT", \ + 3, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \ + { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \ + { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \ + } \ +} +#endif /** * @brief Pack a named_value_int message @@ -39,28 +53,24 @@ typedef struct __mavlink_named_value_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, const char *name, int32_t value) + uint32_t time_boot_ms, const char *name, int32_t value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); + char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #else - mavlink_named_value_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); + mavlink_named_value_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + mav_array_memcpy(packet.name, name, sizeof(char)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); } /** @@ -75,29 +85,25 @@ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,const char *name,int32_t value) + mavlink_message_t* msg, + uint32_t time_boot_ms,const char *name,int32_t value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); + char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #else - mavlink_named_value_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); + mavlink_named_value_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + mav_array_memcpy(packet.name, name, sizeof(char)*10); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); } /** @@ -110,7 +116,7 @@ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_named_value_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int) { - return mavlink_msg_named_value_int_pack(system_id, component_id, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value); + return mavlink_msg_named_value_int_pack(system_id, component_id, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value); } /** @@ -124,7 +130,7 @@ static inline uint16_t mavlink_msg_named_value_int_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_named_value_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int) { - return mavlink_msg_named_value_int_pack_chan(system_id, component_id, chan, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value); + return mavlink_msg_named_value_int_pack_chan(system_id, component_id, chan, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value); } /** @@ -140,25 +146,31 @@ static inline uint16_t mavlink_msg_named_value_int_encode_chan(uint8_t system_id static inline void mavlink_msg_named_value_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, int32_t value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); + char buf[MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); + mavlink_named_value_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.value = value; + mav_array_memcpy(packet.name, name, sizeof(char)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); #endif +} + +/** + * @brief Send a named_value_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_named_value_int_send_struct(mavlink_channel_t chan, const mavlink_named_value_int_t* named_value_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_named_value_int_send(chan, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value); #else - mavlink_named_value_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.value = value; - mav_array_memcpy(packet.name, name, sizeof(char)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)named_value_int, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); #endif } @@ -173,25 +185,17 @@ static inline void mavlink_msg_named_value_int_send(mavlink_channel_t chan, uint static inline void mavlink_msg_named_value_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, int32_t value) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, value); - _mav_put_char_array(buf, 8, name, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, value); + _mav_put_char_array(buf, 8, name, 10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); -#endif -#else - mavlink_named_value_int_t *packet = (mavlink_named_value_int_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->value = value; - mav_array_memcpy(packet->name, name, sizeof(char)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); -#endif + mavlink_named_value_int_t *packet = (mavlink_named_value_int_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->value = value; + mav_array_memcpy(packet->name, name, sizeof(char)*10); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)packet, MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN, MAVLINK_MSG_ID_NAMED_VALUE_INT_CRC); #endif } #endif @@ -208,7 +212,7 @@ static inline void mavlink_msg_named_value_int_send_buf(mavlink_message_t *msgbu */ static inline uint32_t mavlink_msg_named_value_int_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -218,7 +222,7 @@ static inline uint32_t mavlink_msg_named_value_int_get_time_boot_ms(const mavlin */ static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_message_t* msg, char *name) { - return _MAV_RETURN_char_array(msg, name, 10, 8); + return _MAV_RETURN_char_array(msg, name, 10, 8); } /** @@ -228,7 +232,7 @@ static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_messag */ static inline int32_t mavlink_msg_named_value_int_get_value(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -239,11 +243,13 @@ static inline int32_t mavlink_msg_named_value_int_get_value(const mavlink_messag */ static inline void mavlink_msg_named_value_int_decode(const mavlink_message_t* msg, mavlink_named_value_int_t* named_value_int) { -#if MAVLINK_NEED_BYTE_SWAP - named_value_int->time_boot_ms = mavlink_msg_named_value_int_get_time_boot_ms(msg); - named_value_int->value = mavlink_msg_named_value_int_get_value(msg); - mavlink_msg_named_value_int_get_name(msg, named_value_int->name); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + named_value_int->time_boot_ms = mavlink_msg_named_value_int_get_time_boot_ms(msg); + named_value_int->value = mavlink_msg_named_value_int_get_value(msg); + mavlink_msg_named_value_int_get_name(msg, named_value_int->name); #else - memcpy(named_value_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN? msg->len : MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN; + memset(named_value_int, 0, MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN); + memcpy(named_value_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_nav_controller_output.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_nav_controller_output.h index 758b719..37724ca 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_nav_controller_output.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_nav_controller_output.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE NAV_CONTROLLER_OUTPUT PACKING #define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT 62 -typedef struct __mavlink_nav_controller_output_t -{ +MAVPACKED( +typedef struct __mavlink_nav_controller_output_t { float nav_roll; /*< Current desired roll in degrees*/ float nav_pitch; /*< Current desired pitch in degrees*/ float alt_error; /*< Current altitude error in meters*/ @@ -12,20 +13,24 @@ typedef struct __mavlink_nav_controller_output_t int16_t nav_bearing; /*< Current desired heading in degrees*/ int16_t target_bearing; /*< Bearing to current MISSION/target in degrees*/ uint16_t wp_dist; /*< Distance to active MISSION in meters*/ -} mavlink_nav_controller_output_t; +}) mavlink_nav_controller_output_t; #define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN 26 +#define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN 26 #define MAVLINK_MSG_ID_62_LEN 26 +#define MAVLINK_MSG_ID_62_MIN_LEN 26 #define MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC 183 #define MAVLINK_MSG_ID_62_CRC 183 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \ - "NAV_CONTROLLER_OUTPUT", \ - 8, \ - { { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \ + 62, \ + "NAV_CONTROLLER_OUTPUT", \ + 8, \ + { { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \ { "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \ { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \ { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \ @@ -35,7 +40,21 @@ typedef struct __mavlink_nav_controller_output_t { "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT { \ + "NAV_CONTROLLER_OUTPUT", \ + 8, \ + { { "nav_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_nav_controller_output_t, nav_roll) }, \ + { "nav_pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_nav_controller_output_t, nav_pitch) }, \ + { "alt_error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_nav_controller_output_t, alt_error) }, \ + { "aspd_error", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_nav_controller_output_t, aspd_error) }, \ + { "xtrack_error", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_nav_controller_output_t, xtrack_error) }, \ + { "nav_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_nav_controller_output_t, nav_bearing) }, \ + { "target_bearing", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_nav_controller_output_t, target_bearing) }, \ + { "wp_dist", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_nav_controller_output_t, wp_dist) }, \ + } \ +} +#endif /** * @brief Pack a nav_controller_output message @@ -54,40 +73,36 @@ typedef struct __mavlink_nav_controller_output_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) + float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; - _mav_put_float(buf, 0, nav_roll); - _mav_put_float(buf, 4, nav_pitch); - _mav_put_float(buf, 8, alt_error); - _mav_put_float(buf, 12, aspd_error); - _mav_put_float(buf, 16, xtrack_error); - _mav_put_int16_t(buf, 20, nav_bearing); - _mav_put_int16_t(buf, 22, target_bearing); - _mav_put_uint16_t(buf, 24, wp_dist); + char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; + _mav_put_float(buf, 0, nav_roll); + _mav_put_float(buf, 4, nav_pitch); + _mav_put_float(buf, 8, alt_error); + _mav_put_float(buf, 12, aspd_error); + _mav_put_float(buf, 16, xtrack_error); + _mav_put_int16_t(buf, 20, nav_bearing); + _mav_put_int16_t(buf, 22, target_bearing); + _mav_put_uint16_t(buf, 24, wp_dist); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #else - mavlink_nav_controller_output_t packet; - packet.nav_roll = nav_roll; - packet.nav_pitch = nav_pitch; - packet.alt_error = alt_error; - packet.aspd_error = aspd_error; - packet.xtrack_error = xtrack_error; - packet.nav_bearing = nav_bearing; - packet.target_bearing = target_bearing; - packet.wp_dist = wp_dist; + mavlink_nav_controller_output_t packet; + packet.nav_roll = nav_roll; + packet.nav_pitch = nav_pitch; + packet.alt_error = alt_error; + packet.aspd_error = aspd_error; + packet.xtrack_error = xtrack_error; + packet.nav_bearing = nav_bearing; + packet.target_bearing = target_bearing; + packet.wp_dist = wp_dist; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); } /** @@ -107,41 +122,37 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float nav_roll,float nav_pitch,int16_t nav_bearing,int16_t target_bearing,uint16_t wp_dist,float alt_error,float aspd_error,float xtrack_error) + mavlink_message_t* msg, + float nav_roll,float nav_pitch,int16_t nav_bearing,int16_t target_bearing,uint16_t wp_dist,float alt_error,float aspd_error,float xtrack_error) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; - _mav_put_float(buf, 0, nav_roll); - _mav_put_float(buf, 4, nav_pitch); - _mav_put_float(buf, 8, alt_error); - _mav_put_float(buf, 12, aspd_error); - _mav_put_float(buf, 16, xtrack_error); - _mav_put_int16_t(buf, 20, nav_bearing); - _mav_put_int16_t(buf, 22, target_bearing); - _mav_put_uint16_t(buf, 24, wp_dist); + char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; + _mav_put_float(buf, 0, nav_roll); + _mav_put_float(buf, 4, nav_pitch); + _mav_put_float(buf, 8, alt_error); + _mav_put_float(buf, 12, aspd_error); + _mav_put_float(buf, 16, xtrack_error); + _mav_put_int16_t(buf, 20, nav_bearing); + _mav_put_int16_t(buf, 22, target_bearing); + _mav_put_uint16_t(buf, 24, wp_dist); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #else - mavlink_nav_controller_output_t packet; - packet.nav_roll = nav_roll; - packet.nav_pitch = nav_pitch; - packet.alt_error = alt_error; - packet.aspd_error = aspd_error; - packet.xtrack_error = xtrack_error; - packet.nav_bearing = nav_bearing; - packet.target_bearing = target_bearing; - packet.wp_dist = wp_dist; + mavlink_nav_controller_output_t packet; + packet.nav_roll = nav_roll; + packet.nav_pitch = nav_pitch; + packet.alt_error = alt_error; + packet.aspd_error = aspd_error; + packet.xtrack_error = xtrack_error; + packet.nav_bearing = nav_bearing; + packet.target_bearing = target_bearing; + packet.wp_dist = wp_dist; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); } /** @@ -154,7 +165,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste */ static inline uint16_t mavlink_msg_nav_controller_output_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_nav_controller_output_t* nav_controller_output) { - return mavlink_msg_nav_controller_output_pack(system_id, component_id, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error); + return mavlink_msg_nav_controller_output_pack(system_id, component_id, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error); } /** @@ -168,7 +179,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_encode(uint8_t system_i */ static inline uint16_t mavlink_msg_nav_controller_output_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_nav_controller_output_t* nav_controller_output) { - return mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, chan, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error); + return mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, chan, msg, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error); } /** @@ -189,37 +200,43 @@ static inline uint16_t mavlink_msg_nav_controller_output_encode_chan(uint8_t sys static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; - _mav_put_float(buf, 0, nav_roll); - _mav_put_float(buf, 4, nav_pitch); - _mav_put_float(buf, 8, alt_error); - _mav_put_float(buf, 12, aspd_error); - _mav_put_float(buf, 16, xtrack_error); - _mav_put_int16_t(buf, 20, nav_bearing); - _mav_put_int16_t(buf, 22, target_bearing); - _mav_put_uint16_t(buf, 24, wp_dist); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); + char buf[MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN]; + _mav_put_float(buf, 0, nav_roll); + _mav_put_float(buf, 4, nav_pitch); + _mav_put_float(buf, 8, alt_error); + _mav_put_float(buf, 12, aspd_error); + _mav_put_float(buf, 16, xtrack_error); + _mav_put_int16_t(buf, 20, nav_bearing); + _mav_put_int16_t(buf, 22, target_bearing); + _mav_put_uint16_t(buf, 24, wp_dist); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); + mavlink_nav_controller_output_t packet; + packet.nav_roll = nav_roll; + packet.nav_pitch = nav_pitch; + packet.alt_error = alt_error; + packet.aspd_error = aspd_error; + packet.xtrack_error = xtrack_error; + packet.nav_bearing = nav_bearing; + packet.target_bearing = target_bearing; + packet.wp_dist = wp_dist; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); #endif +} + +/** + * @brief Send a nav_controller_output message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_nav_controller_output_send_struct(mavlink_channel_t chan, const mavlink_nav_controller_output_t* nav_controller_output) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_nav_controller_output_send(chan, nav_controller_output->nav_roll, nav_controller_output->nav_pitch, nav_controller_output->nav_bearing, nav_controller_output->target_bearing, nav_controller_output->wp_dist, nav_controller_output->alt_error, nav_controller_output->aspd_error, nav_controller_output->xtrack_error); #else - mavlink_nav_controller_output_t packet; - packet.nav_roll = nav_roll; - packet.nav_pitch = nav_pitch; - packet.alt_error = alt_error; - packet.aspd_error = aspd_error; - packet.xtrack_error = xtrack_error; - packet.nav_bearing = nav_bearing; - packet.target_bearing = target_bearing; - packet.wp_dist = wp_dist; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)&packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)nav_controller_output, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); #endif } @@ -234,37 +251,29 @@ static inline void mavlink_msg_nav_controller_output_send(mavlink_channel_t chan static inline void mavlink_msg_nav_controller_output_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float nav_roll, float nav_pitch, int16_t nav_bearing, int16_t target_bearing, uint16_t wp_dist, float alt_error, float aspd_error, float xtrack_error) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, nav_roll); - _mav_put_float(buf, 4, nav_pitch); - _mav_put_float(buf, 8, alt_error); - _mav_put_float(buf, 12, aspd_error); - _mav_put_float(buf, 16, xtrack_error); - _mav_put_int16_t(buf, 20, nav_bearing); - _mav_put_int16_t(buf, 22, target_bearing); - _mav_put_uint16_t(buf, 24, wp_dist); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); -#endif -#else - mavlink_nav_controller_output_t *packet = (mavlink_nav_controller_output_t *)msgbuf; - packet->nav_roll = nav_roll; - packet->nav_pitch = nav_pitch; - packet->alt_error = alt_error; - packet->aspd_error = aspd_error; - packet->xtrack_error = xtrack_error; - packet->nav_bearing = nav_bearing; - packet->target_bearing = target_bearing; - packet->wp_dist = wp_dist; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, nav_roll); + _mav_put_float(buf, 4, nav_pitch); + _mav_put_float(buf, 8, alt_error); + _mav_put_float(buf, 12, aspd_error); + _mav_put_float(buf, 16, xtrack_error); + _mav_put_int16_t(buf, 20, nav_bearing); + _mav_put_int16_t(buf, 22, target_bearing); + _mav_put_uint16_t(buf, 24, wp_dist); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, buf, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); -#endif + mavlink_nav_controller_output_t *packet = (mavlink_nav_controller_output_t *)msgbuf; + packet->nav_roll = nav_roll; + packet->nav_pitch = nav_pitch; + packet->alt_error = alt_error; + packet->aspd_error = aspd_error; + packet->xtrack_error = xtrack_error; + packet->nav_bearing = nav_bearing; + packet->target_bearing = target_bearing; + packet->wp_dist = wp_dist; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT, (const char *)packet, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_CRC); #endif } #endif @@ -281,7 +290,7 @@ static inline void mavlink_msg_nav_controller_output_send_buf(mavlink_message_t */ static inline float mavlink_msg_nav_controller_output_get_nav_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -291,7 +300,7 @@ static inline float mavlink_msg_nav_controller_output_get_nav_roll(const mavlink */ static inline float mavlink_msg_nav_controller_output_get_nav_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -301,7 +310,7 @@ static inline float mavlink_msg_nav_controller_output_get_nav_pitch(const mavlin */ static inline int16_t mavlink_msg_nav_controller_output_get_nav_bearing(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -311,7 +320,7 @@ static inline int16_t mavlink_msg_nav_controller_output_get_nav_bearing(const ma */ static inline int16_t mavlink_msg_nav_controller_output_get_target_bearing(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 22); + return _MAV_RETURN_int16_t(msg, 22); } /** @@ -321,7 +330,7 @@ static inline int16_t mavlink_msg_nav_controller_output_get_target_bearing(const */ static inline uint16_t mavlink_msg_nav_controller_output_get_wp_dist(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -331,7 +340,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_get_wp_dist(const mavli */ static inline float mavlink_msg_nav_controller_output_get_alt_error(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -341,7 +350,7 @@ static inline float mavlink_msg_nav_controller_output_get_alt_error(const mavlin */ static inline float mavlink_msg_nav_controller_output_get_aspd_error(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -351,7 +360,7 @@ static inline float mavlink_msg_nav_controller_output_get_aspd_error(const mavli */ static inline float mavlink_msg_nav_controller_output_get_xtrack_error(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -362,16 +371,18 @@ static inline float mavlink_msg_nav_controller_output_get_xtrack_error(const mav */ static inline void mavlink_msg_nav_controller_output_decode(const mavlink_message_t* msg, mavlink_nav_controller_output_t* nav_controller_output) { -#if MAVLINK_NEED_BYTE_SWAP - nav_controller_output->nav_roll = mavlink_msg_nav_controller_output_get_nav_roll(msg); - nav_controller_output->nav_pitch = mavlink_msg_nav_controller_output_get_nav_pitch(msg); - nav_controller_output->alt_error = mavlink_msg_nav_controller_output_get_alt_error(msg); - nav_controller_output->aspd_error = mavlink_msg_nav_controller_output_get_aspd_error(msg); - nav_controller_output->xtrack_error = mavlink_msg_nav_controller_output_get_xtrack_error(msg); - nav_controller_output->nav_bearing = mavlink_msg_nav_controller_output_get_nav_bearing(msg); - nav_controller_output->target_bearing = mavlink_msg_nav_controller_output_get_target_bearing(msg); - nav_controller_output->wp_dist = mavlink_msg_nav_controller_output_get_wp_dist(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + nav_controller_output->nav_roll = mavlink_msg_nav_controller_output_get_nav_roll(msg); + nav_controller_output->nav_pitch = mavlink_msg_nav_controller_output_get_nav_pitch(msg); + nav_controller_output->alt_error = mavlink_msg_nav_controller_output_get_alt_error(msg); + nav_controller_output->aspd_error = mavlink_msg_nav_controller_output_get_aspd_error(msg); + nav_controller_output->xtrack_error = mavlink_msg_nav_controller_output_get_xtrack_error(msg); + nav_controller_output->nav_bearing = mavlink_msg_nav_controller_output_get_nav_bearing(msg); + nav_controller_output->target_bearing = mavlink_msg_nav_controller_output_get_target_bearing(msg); + nav_controller_output->wp_dist = mavlink_msg_nav_controller_output_get_wp_dist(msg); #else - memcpy(nav_controller_output, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN? msg->len : MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN; + memset(nav_controller_output, 0, MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_LEN); + memcpy(nav_controller_output, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow.h index 9388147..5292a0f 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE OPTICAL_FLOW PACKING #define MAVLINK_MSG_ID_OPTICAL_FLOW 100 -typedef struct __mavlink_optical_flow_t -{ +MAVPACKED( +typedef struct __mavlink_optical_flow_t { uint64_t time_usec; /*< Timestamp (UNIX)*/ float flow_comp_m_x; /*< Flow in meters in x-sensor direction, angular-speed compensated*/ float flow_comp_m_y; /*< Flow in meters in y-sensor direction, angular-speed compensated*/ @@ -12,20 +13,24 @@ typedef struct __mavlink_optical_flow_t int16_t flow_y; /*< Flow in pixels * 10 in y-sensor direction (dezi-pixels)*/ uint8_t sensor_id; /*< Sensor ID*/ uint8_t quality; /*< Optical flow quality / confidence. 0: bad, 255: maximum quality*/ -} mavlink_optical_flow_t; +}) mavlink_optical_flow_t; #define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26 +#define MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN 26 #define MAVLINK_MSG_ID_100_LEN 26 +#define MAVLINK_MSG_ID_100_MIN_LEN 26 #define MAVLINK_MSG_ID_OPTICAL_FLOW_CRC 175 #define MAVLINK_MSG_ID_100_CRC 175 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \ - "OPTICAL_FLOW", \ - 8, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \ + 100, \ + "OPTICAL_FLOW", \ + 8, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \ { "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \ { "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \ { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \ @@ -35,7 +40,21 @@ typedef struct __mavlink_optical_flow_t { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \ + "OPTICAL_FLOW", \ + 8, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \ + { "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \ + { "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \ + { "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \ + { "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \ + { "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \ + { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \ + } \ +} +#endif /** * @brief Pack a optical_flow message @@ -54,40 +73,36 @@ typedef struct __mavlink_optical_flow_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance) + uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, flow_comp_m_x); - _mav_put_float(buf, 12, flow_comp_m_y); - _mav_put_float(buf, 16, ground_distance); - _mav_put_int16_t(buf, 20, flow_x); - _mav_put_int16_t(buf, 22, flow_y); - _mav_put_uint8_t(buf, 24, sensor_id); - _mav_put_uint8_t(buf, 25, quality); + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, flow_comp_m_x); + _mav_put_float(buf, 12, flow_comp_m_y); + _mav_put_float(buf, 16, ground_distance); + _mav_put_int16_t(buf, 20, flow_x); + _mav_put_int16_t(buf, 22, flow_y); + _mav_put_uint8_t(buf, 24, sensor_id); + _mav_put_uint8_t(buf, 25, quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #else - mavlink_optical_flow_t packet; - packet.time_usec = time_usec; - packet.flow_comp_m_x = flow_comp_m_x; - packet.flow_comp_m_y = flow_comp_m_y; - packet.ground_distance = ground_distance; - packet.flow_x = flow_x; - packet.flow_y = flow_y; - packet.sensor_id = sensor_id; - packet.quality = quality; + mavlink_optical_flow_t packet; + packet.time_usec = time_usec; + packet.flow_comp_m_x = flow_comp_m_x; + packet.flow_comp_m_y = flow_comp_m_y; + packet.ground_distance = ground_distance; + packet.flow_x = flow_x; + packet.flow_y = flow_y; + packet.sensor_id = sensor_id; + packet.quality = quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); } /** @@ -107,41 +122,37 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,float flow_comp_m_x,float flow_comp_m_y,uint8_t quality,float ground_distance) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,float flow_comp_m_x,float flow_comp_m_y,uint8_t quality,float ground_distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, flow_comp_m_x); - _mav_put_float(buf, 12, flow_comp_m_y); - _mav_put_float(buf, 16, ground_distance); - _mav_put_int16_t(buf, 20, flow_x); - _mav_put_int16_t(buf, 22, flow_y); - _mav_put_uint8_t(buf, 24, sensor_id); - _mav_put_uint8_t(buf, 25, quality); + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, flow_comp_m_x); + _mav_put_float(buf, 12, flow_comp_m_y); + _mav_put_float(buf, 16, ground_distance); + _mav_put_int16_t(buf, 20, flow_x); + _mav_put_int16_t(buf, 22, flow_y); + _mav_put_uint8_t(buf, 24, sensor_id); + _mav_put_uint8_t(buf, 25, quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #else - mavlink_optical_flow_t packet; - packet.time_usec = time_usec; - packet.flow_comp_m_x = flow_comp_m_x; - packet.flow_comp_m_y = flow_comp_m_y; - packet.ground_distance = ground_distance; - packet.flow_x = flow_x; - packet.flow_y = flow_y; - packet.sensor_id = sensor_id; - packet.quality = quality; + mavlink_optical_flow_t packet; + packet.time_usec = time_usec; + packet.flow_comp_m_x = flow_comp_m_x; + packet.flow_comp_m_y = flow_comp_m_y; + packet.ground_distance = ground_distance; + packet.flow_x = flow_x; + packet.flow_y = flow_y; + packet.sensor_id = sensor_id; + packet.quality = quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); } /** @@ -154,7 +165,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow) { - return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance); + return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance); } /** @@ -168,7 +179,7 @@ static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_optical_flow_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow) { - return mavlink_msg_optical_flow_pack_chan(system_id, component_id, chan, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance); + return mavlink_msg_optical_flow_pack_chan(system_id, component_id, chan, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance); } /** @@ -189,37 +200,43 @@ static inline uint16_t mavlink_msg_optical_flow_encode_chan(uint8_t system_id, u static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, flow_comp_m_x); - _mav_put_float(buf, 12, flow_comp_m_y); - _mav_put_float(buf, 16, ground_distance); - _mav_put_int16_t(buf, 20, flow_x); - _mav_put_int16_t(buf, 22, flow_y); - _mav_put_uint8_t(buf, 24, sensor_id); - _mav_put_uint8_t(buf, 25, quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, flow_comp_m_x); + _mav_put_float(buf, 12, flow_comp_m_y); + _mav_put_float(buf, 16, ground_distance); + _mav_put_int16_t(buf, 20, flow_x); + _mav_put_int16_t(buf, 22, flow_y); + _mav_put_uint8_t(buf, 24, sensor_id); + _mav_put_uint8_t(buf, 25, quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); + mavlink_optical_flow_t packet; + packet.time_usec = time_usec; + packet.flow_comp_m_x = flow_comp_m_x; + packet.flow_comp_m_y = flow_comp_m_y; + packet.ground_distance = ground_distance; + packet.flow_x = flow_x; + packet.flow_y = flow_y; + packet.sensor_id = sensor_id; + packet.quality = quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); #endif +} + +/** + * @brief Send a optical_flow message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_optical_flow_send_struct(mavlink_channel_t chan, const mavlink_optical_flow_t* optical_flow) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_optical_flow_send(chan, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance); #else - mavlink_optical_flow_t packet; - packet.time_usec = time_usec; - packet.flow_comp_m_x = flow_comp_m_x; - packet.flow_comp_m_y = flow_comp_m_y; - packet.ground_distance = ground_distance; - packet.flow_x = flow_x; - packet.flow_y = flow_y; - packet.sensor_id = sensor_id; - packet.quality = quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)optical_flow, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); #endif } @@ -234,37 +251,29 @@ static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_ static inline void mavlink_msg_optical_flow_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, flow_comp_m_x); - _mav_put_float(buf, 12, flow_comp_m_y); - _mav_put_float(buf, 16, ground_distance); - _mav_put_int16_t(buf, 20, flow_x); - _mav_put_int16_t(buf, 22, flow_y); - _mav_put_uint8_t(buf, 24, sensor_id); - _mav_put_uint8_t(buf, 25, quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); -#endif -#else - mavlink_optical_flow_t *packet = (mavlink_optical_flow_t *)msgbuf; - packet->time_usec = time_usec; - packet->flow_comp_m_x = flow_comp_m_x; - packet->flow_comp_m_y = flow_comp_m_y; - packet->ground_distance = ground_distance; - packet->flow_x = flow_x; - packet->flow_y = flow_y; - packet->sensor_id = sensor_id; - packet->quality = quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, flow_comp_m_x); + _mav_put_float(buf, 12, flow_comp_m_y); + _mav_put_float(buf, 16, ground_distance); + _mav_put_int16_t(buf, 20, flow_x); + _mav_put_int16_t(buf, 22, flow_y); + _mav_put_uint8_t(buf, 24, sensor_id); + _mav_put_uint8_t(buf, 25, quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); -#endif + mavlink_optical_flow_t *packet = (mavlink_optical_flow_t *)msgbuf; + packet->time_usec = time_usec; + packet->flow_comp_m_x = flow_comp_m_x; + packet->flow_comp_m_y = flow_comp_m_y; + packet->ground_distance = ground_distance; + packet->flow_x = flow_x; + packet->flow_y = flow_y; + packet->sensor_id = sensor_id; + packet->quality = quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_CRC); #endif } #endif @@ -281,7 +290,7 @@ static inline void mavlink_msg_optical_flow_send_buf(mavlink_message_t *msgbuf, */ static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -291,7 +300,7 @@ static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_mess */ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 24); + return _MAV_RETURN_uint8_t(msg, 24); } /** @@ -301,7 +310,7 @@ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_messa */ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -311,7 +320,7 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_ */ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 22); + return _MAV_RETURN_int16_t(msg, 22); } /** @@ -321,7 +330,7 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_ */ static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -331,7 +340,7 @@ static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_mes */ static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -341,7 +350,7 @@ static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_mes */ static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 25); + return _MAV_RETURN_uint8_t(msg, 25); } /** @@ -351,7 +360,7 @@ static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message */ static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -362,16 +371,18 @@ static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_m */ static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg, mavlink_optical_flow_t* optical_flow) { -#if MAVLINK_NEED_BYTE_SWAP - optical_flow->time_usec = mavlink_msg_optical_flow_get_time_usec(msg); - optical_flow->flow_comp_m_x = mavlink_msg_optical_flow_get_flow_comp_m_x(msg); - optical_flow->flow_comp_m_y = mavlink_msg_optical_flow_get_flow_comp_m_y(msg); - optical_flow->ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg); - optical_flow->flow_x = mavlink_msg_optical_flow_get_flow_x(msg); - optical_flow->flow_y = mavlink_msg_optical_flow_get_flow_y(msg); - optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg); - optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + optical_flow->time_usec = mavlink_msg_optical_flow_get_time_usec(msg); + optical_flow->flow_comp_m_x = mavlink_msg_optical_flow_get_flow_comp_m_x(msg); + optical_flow->flow_comp_m_y = mavlink_msg_optical_flow_get_flow_comp_m_y(msg); + optical_flow->ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg); + optical_flow->flow_x = mavlink_msg_optical_flow_get_flow_x(msg); + optical_flow->flow_y = mavlink_msg_optical_flow_get_flow_y(msg); + optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg); + optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg); #else - memcpy(optical_flow, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_OPTICAL_FLOW_LEN? msg->len : MAVLINK_MSG_ID_OPTICAL_FLOW_LEN; + memset(optical_flow, 0, MAVLINK_MSG_ID_OPTICAL_FLOW_LEN); + memcpy(optical_flow, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow_rad.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow_rad.h index ea2de32..008fcaf 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow_rad.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_optical_flow_rad.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE OPTICAL_FLOW_RAD PACKING #define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD 106 -typedef struct __mavlink_optical_flow_rad_t -{ +MAVPACKED( +typedef struct __mavlink_optical_flow_rad_t { uint64_t time_usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ uint32_t integration_time_us; /*< Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the.*/ float integrated_x; /*< Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)*/ @@ -16,20 +17,24 @@ typedef struct __mavlink_optical_flow_rad_t int16_t temperature; /*< Temperature * 100 in centi-degrees Celsius*/ uint8_t sensor_id; /*< Sensor ID*/ uint8_t quality; /*< Optical flow quality / confidence. 0: no valid flow, 255: maximum quality*/ -} mavlink_optical_flow_rad_t; +}) mavlink_optical_flow_rad_t; #define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN 44 +#define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN 44 #define MAVLINK_MSG_ID_106_LEN 44 +#define MAVLINK_MSG_ID_106_MIN_LEN 44 #define MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC 138 #define MAVLINK_MSG_ID_106_CRC 138 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD { \ - "OPTICAL_FLOW_RAD", \ - 12, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \ + 106, \ + "OPTICAL_FLOW_RAD", \ + 12, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \ { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \ { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \ { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \ @@ -43,7 +48,25 @@ typedef struct __mavlink_optical_flow_rad_t { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD { \ + "OPTICAL_FLOW_RAD", \ + 12, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_rad_t, time_usec) }, \ + { "integration_time_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_optical_flow_rad_t, integration_time_us) }, \ + { "integrated_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_rad_t, integrated_x) }, \ + { "integrated_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_rad_t, integrated_y) }, \ + { "integrated_xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_optical_flow_rad_t, integrated_xgyro) }, \ + { "integrated_ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_optical_flow_rad_t, integrated_ygyro) }, \ + { "integrated_zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_optical_flow_rad_t, integrated_zgyro) }, \ + { "time_delta_distance_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_optical_flow_rad_t, time_delta_distance_us) }, \ + { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_optical_flow_rad_t, distance) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_optical_flow_rad_t, temperature) }, \ + { "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_optical_flow_rad_t, sensor_id) }, \ + { "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_optical_flow_rad_t, quality) }, \ + } \ +} +#endif /** * @brief Pack a optical_flow_rad message @@ -66,48 +89,44 @@ typedef struct __mavlink_optical_flow_rad_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_optical_flow_rad_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) + uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); #else - mavlink_optical_flow_rad_t packet; - packet.time_usec = time_usec; - packet.integration_time_us = integration_time_us; - packet.integrated_x = integrated_x; - packet.integrated_y = integrated_y; - packet.integrated_xgyro = integrated_xgyro; - packet.integrated_ygyro = integrated_ygyro; - packet.integrated_zgyro = integrated_zgyro; - packet.time_delta_distance_us = time_delta_distance_us; - packet.distance = distance; - packet.temperature = temperature; - packet.sensor_id = sensor_id; - packet.quality = quality; + mavlink_optical_flow_rad_t packet; + packet.time_usec = time_usec; + packet.integration_time_us = integration_time_us; + packet.integrated_x = integrated_x; + packet.integrated_y = integrated_y; + packet.integrated_xgyro = integrated_xgyro; + packet.integrated_ygyro = integrated_ygyro; + packet.integrated_zgyro = integrated_zgyro; + packet.time_delta_distance_us = time_delta_distance_us; + packet.distance = distance; + packet.temperature = temperature; + packet.sensor_id = sensor_id; + packet.quality = quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); } /** @@ -131,49 +150,45 @@ static inline uint16_t mavlink_msg_optical_flow_rad_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_optical_flow_rad_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t sensor_id,uint32_t integration_time_us,float integrated_x,float integrated_y,float integrated_xgyro,float integrated_ygyro,float integrated_zgyro,int16_t temperature,uint8_t quality,uint32_t time_delta_distance_us,float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); #else - mavlink_optical_flow_rad_t packet; - packet.time_usec = time_usec; - packet.integration_time_us = integration_time_us; - packet.integrated_x = integrated_x; - packet.integrated_y = integrated_y; - packet.integrated_xgyro = integrated_xgyro; - packet.integrated_ygyro = integrated_ygyro; - packet.integrated_zgyro = integrated_zgyro; - packet.time_delta_distance_us = time_delta_distance_us; - packet.distance = distance; - packet.temperature = temperature; - packet.sensor_id = sensor_id; - packet.quality = quality; + mavlink_optical_flow_rad_t packet; + packet.time_usec = time_usec; + packet.integration_time_us = integration_time_us; + packet.integrated_x = integrated_x; + packet.integrated_y = integrated_y; + packet.integrated_xgyro = integrated_xgyro; + packet.integrated_ygyro = integrated_ygyro; + packet.integrated_zgyro = integrated_zgyro; + packet.time_delta_distance_us = time_delta_distance_us; + packet.distance = distance; + packet.temperature = temperature; + packet.sensor_id = sensor_id; + packet.quality = quality; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW_RAD; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); } /** @@ -186,7 +201,7 @@ static inline uint16_t mavlink_msg_optical_flow_rad_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_optical_flow_rad_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_rad_t* optical_flow_rad) { - return mavlink_msg_optical_flow_rad_pack(system_id, component_id, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance); + return mavlink_msg_optical_flow_rad_pack(system_id, component_id, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance); } /** @@ -200,7 +215,7 @@ static inline uint16_t mavlink_msg_optical_flow_rad_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_optical_flow_rad_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_optical_flow_rad_t* optical_flow_rad) { - return mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, chan, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance); + return mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, chan, msg, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance); } /** @@ -225,45 +240,51 @@ static inline uint16_t mavlink_msg_optical_flow_rad_encode_chan(uint8_t system_i static inline void mavlink_msg_optical_flow_rad_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); + char buf[MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); + mavlink_optical_flow_rad_t packet; + packet.time_usec = time_usec; + packet.integration_time_us = integration_time_us; + packet.integrated_x = integrated_x; + packet.integrated_y = integrated_y; + packet.integrated_xgyro = integrated_xgyro; + packet.integrated_ygyro = integrated_ygyro; + packet.integrated_zgyro = integrated_zgyro; + packet.time_delta_distance_us = time_delta_distance_us; + packet.distance = distance; + packet.temperature = temperature; + packet.sensor_id = sensor_id; + packet.quality = quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); #endif +} + +/** + * @brief Send a optical_flow_rad message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_optical_flow_rad_send_struct(mavlink_channel_t chan, const mavlink_optical_flow_rad_t* optical_flow_rad) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_optical_flow_rad_send(chan, optical_flow_rad->time_usec, optical_flow_rad->sensor_id, optical_flow_rad->integration_time_us, optical_flow_rad->integrated_x, optical_flow_rad->integrated_y, optical_flow_rad->integrated_xgyro, optical_flow_rad->integrated_ygyro, optical_flow_rad->integrated_zgyro, optical_flow_rad->temperature, optical_flow_rad->quality, optical_flow_rad->time_delta_distance_us, optical_flow_rad->distance); #else - mavlink_optical_flow_rad_t packet; - packet.time_usec = time_usec; - packet.integration_time_us = integration_time_us; - packet.integrated_x = integrated_x; - packet.integrated_y = integrated_y; - packet.integrated_xgyro = integrated_xgyro; - packet.integrated_ygyro = integrated_ygyro; - packet.integrated_zgyro = integrated_zgyro; - packet.time_delta_distance_us = time_delta_distance_us; - packet.distance = distance; - packet.temperature = temperature; - packet.sensor_id = sensor_id; - packet.quality = quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)&packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)optical_flow_rad, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); #endif } @@ -278,45 +299,37 @@ static inline void mavlink_msg_optical_flow_rad_send(mavlink_channel_t chan, uin static inline void mavlink_msg_optical_flow_rad_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, uint32_t integration_time_us, float integrated_x, float integrated_y, float integrated_xgyro, float integrated_ygyro, float integrated_zgyro, int16_t temperature, uint8_t quality, uint32_t time_delta_distance_us, float distance) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, integration_time_us); - _mav_put_float(buf, 12, integrated_x); - _mav_put_float(buf, 16, integrated_y); - _mav_put_float(buf, 20, integrated_xgyro); - _mav_put_float(buf, 24, integrated_ygyro); - _mav_put_float(buf, 28, integrated_zgyro); - _mav_put_uint32_t(buf, 32, time_delta_distance_us); - _mav_put_float(buf, 36, distance); - _mav_put_int16_t(buf, 40, temperature); - _mav_put_uint8_t(buf, 42, sensor_id); - _mav_put_uint8_t(buf, 43, quality); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, integration_time_us); + _mav_put_float(buf, 12, integrated_x); + _mav_put_float(buf, 16, integrated_y); + _mav_put_float(buf, 20, integrated_xgyro); + _mav_put_float(buf, 24, integrated_ygyro); + _mav_put_float(buf, 28, integrated_zgyro); + _mav_put_uint32_t(buf, 32, time_delta_distance_us); + _mav_put_float(buf, 36, distance); + _mav_put_int16_t(buf, 40, temperature); + _mav_put_uint8_t(buf, 42, sensor_id); + _mav_put_uint8_t(buf, 43, quality); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, buf, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); -#endif -#else - mavlink_optical_flow_rad_t *packet = (mavlink_optical_flow_rad_t *)msgbuf; - packet->time_usec = time_usec; - packet->integration_time_us = integration_time_us; - packet->integrated_x = integrated_x; - packet->integrated_y = integrated_y; - packet->integrated_xgyro = integrated_xgyro; - packet->integrated_ygyro = integrated_ygyro; - packet->integrated_zgyro = integrated_zgyro; - packet->time_delta_distance_us = time_delta_distance_us; - packet->distance = distance; - packet->temperature = temperature; - packet->sensor_id = sensor_id; - packet->quality = quality; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); -#endif + mavlink_optical_flow_rad_t *packet = (mavlink_optical_flow_rad_t *)msgbuf; + packet->time_usec = time_usec; + packet->integration_time_us = integration_time_us; + packet->integrated_x = integrated_x; + packet->integrated_y = integrated_y; + packet->integrated_xgyro = integrated_xgyro; + packet->integrated_ygyro = integrated_ygyro; + packet->integrated_zgyro = integrated_zgyro; + packet->time_delta_distance_us = time_delta_distance_us; + packet->distance = distance; + packet->temperature = temperature; + packet->sensor_id = sensor_id; + packet->quality = quality; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD, (const char *)packet, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_CRC); #endif } #endif @@ -333,7 +346,7 @@ static inline void mavlink_msg_optical_flow_rad_send_buf(mavlink_message_t *msgb */ static inline uint64_t mavlink_msg_optical_flow_rad_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -343,7 +356,7 @@ static inline uint64_t mavlink_msg_optical_flow_rad_get_time_usec(const mavlink_ */ static inline uint8_t mavlink_msg_optical_flow_rad_get_sensor_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 42); + return _MAV_RETURN_uint8_t(msg, 42); } /** @@ -353,7 +366,7 @@ static inline uint8_t mavlink_msg_optical_flow_rad_get_sensor_id(const mavlink_m */ static inline uint32_t mavlink_msg_optical_flow_rad_get_integration_time_us(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -363,7 +376,7 @@ static inline uint32_t mavlink_msg_optical_flow_rad_get_integration_time_us(cons */ static inline float mavlink_msg_optical_flow_rad_get_integrated_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -373,7 +386,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_x(const mavlink_ */ static inline float mavlink_msg_optical_flow_rad_get_integrated_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -383,7 +396,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_y(const mavlink_ */ static inline float mavlink_msg_optical_flow_rad_get_integrated_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -393,7 +406,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_xgyro(const mavl */ static inline float mavlink_msg_optical_flow_rad_get_integrated_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -403,7 +416,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_ygyro(const mavl */ static inline float mavlink_msg_optical_flow_rad_get_integrated_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -413,7 +426,7 @@ static inline float mavlink_msg_optical_flow_rad_get_integrated_zgyro(const mavl */ static inline int16_t mavlink_msg_optical_flow_rad_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 40); + return _MAV_RETURN_int16_t(msg, 40); } /** @@ -423,7 +436,7 @@ static inline int16_t mavlink_msg_optical_flow_rad_get_temperature(const mavlink */ static inline uint8_t mavlink_msg_optical_flow_rad_get_quality(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 43); + return _MAV_RETURN_uint8_t(msg, 43); } /** @@ -433,7 +446,7 @@ static inline uint8_t mavlink_msg_optical_flow_rad_get_quality(const mavlink_mes */ static inline uint32_t mavlink_msg_optical_flow_rad_get_time_delta_distance_us(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 32); + return _MAV_RETURN_uint32_t(msg, 32); } /** @@ -443,7 +456,7 @@ static inline uint32_t mavlink_msg_optical_flow_rad_get_time_delta_distance_us(c */ static inline float mavlink_msg_optical_flow_rad_get_distance(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -454,20 +467,22 @@ static inline float mavlink_msg_optical_flow_rad_get_distance(const mavlink_mess */ static inline void mavlink_msg_optical_flow_rad_decode(const mavlink_message_t* msg, mavlink_optical_flow_rad_t* optical_flow_rad) { -#if MAVLINK_NEED_BYTE_SWAP - optical_flow_rad->time_usec = mavlink_msg_optical_flow_rad_get_time_usec(msg); - optical_flow_rad->integration_time_us = mavlink_msg_optical_flow_rad_get_integration_time_us(msg); - optical_flow_rad->integrated_x = mavlink_msg_optical_flow_rad_get_integrated_x(msg); - optical_flow_rad->integrated_y = mavlink_msg_optical_flow_rad_get_integrated_y(msg); - optical_flow_rad->integrated_xgyro = mavlink_msg_optical_flow_rad_get_integrated_xgyro(msg); - optical_flow_rad->integrated_ygyro = mavlink_msg_optical_flow_rad_get_integrated_ygyro(msg); - optical_flow_rad->integrated_zgyro = mavlink_msg_optical_flow_rad_get_integrated_zgyro(msg); - optical_flow_rad->time_delta_distance_us = mavlink_msg_optical_flow_rad_get_time_delta_distance_us(msg); - optical_flow_rad->distance = mavlink_msg_optical_flow_rad_get_distance(msg); - optical_flow_rad->temperature = mavlink_msg_optical_flow_rad_get_temperature(msg); - optical_flow_rad->sensor_id = mavlink_msg_optical_flow_rad_get_sensor_id(msg); - optical_flow_rad->quality = mavlink_msg_optical_flow_rad_get_quality(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + optical_flow_rad->time_usec = mavlink_msg_optical_flow_rad_get_time_usec(msg); + optical_flow_rad->integration_time_us = mavlink_msg_optical_flow_rad_get_integration_time_us(msg); + optical_flow_rad->integrated_x = mavlink_msg_optical_flow_rad_get_integrated_x(msg); + optical_flow_rad->integrated_y = mavlink_msg_optical_flow_rad_get_integrated_y(msg); + optical_flow_rad->integrated_xgyro = mavlink_msg_optical_flow_rad_get_integrated_xgyro(msg); + optical_flow_rad->integrated_ygyro = mavlink_msg_optical_flow_rad_get_integrated_ygyro(msg); + optical_flow_rad->integrated_zgyro = mavlink_msg_optical_flow_rad_get_integrated_zgyro(msg); + optical_flow_rad->time_delta_distance_us = mavlink_msg_optical_flow_rad_get_time_delta_distance_us(msg); + optical_flow_rad->distance = mavlink_msg_optical_flow_rad_get_distance(msg); + optical_flow_rad->temperature = mavlink_msg_optical_flow_rad_get_temperature(msg); + optical_flow_rad->sensor_id = mavlink_msg_optical_flow_rad_get_sensor_id(msg); + optical_flow_rad->quality = mavlink_msg_optical_flow_rad_get_quality(msg); #else - memcpy(optical_flow_rad, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN? msg->len : MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN; + memset(optical_flow_rad, 0, MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_LEN); + memcpy(optical_flow_rad, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_map_rc.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_map_rc.h index fba0bfa..4e73137 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_map_rc.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_map_rc.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE PARAM_MAP_RC PACKING #define MAVLINK_MSG_ID_PARAM_MAP_RC 50 -typedef struct __mavlink_param_map_rc_t -{ +MAVPACKED( +typedef struct __mavlink_param_map_rc_t { float param_value0; /*< Initial parameter value*/ float scale; /*< Scale, maps the RC range [-1, 1] to a parameter value*/ float param_value_min; /*< Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)*/ @@ -13,20 +14,24 @@ typedef struct __mavlink_param_map_rc_t uint8_t target_component; /*< Component ID*/ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ uint8_t parameter_rc_channel_index; /*< Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC.*/ -} mavlink_param_map_rc_t; +}) mavlink_param_map_rc_t; #define MAVLINK_MSG_ID_PARAM_MAP_RC_LEN 37 +#define MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN 37 #define MAVLINK_MSG_ID_50_LEN 37 +#define MAVLINK_MSG_ID_50_MIN_LEN 37 #define MAVLINK_MSG_ID_PARAM_MAP_RC_CRC 78 #define MAVLINK_MSG_ID_50_CRC 78 #define MAVLINK_MSG_PARAM_MAP_RC_FIELD_PARAM_ID_LEN 16 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_PARAM_MAP_RC { \ - "PARAM_MAP_RC", \ - 9, \ - { { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \ + 50, \ + "PARAM_MAP_RC", \ + 9, \ + { { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \ { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) }, \ { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) }, \ { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) }, \ @@ -37,7 +42,22 @@ typedef struct __mavlink_param_map_rc_t { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_PARAM_MAP_RC { \ + "PARAM_MAP_RC", \ + 9, \ + { { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) }, \ + { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) }, \ + { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) }, \ + { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) }, \ + { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) }, \ + { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) }, \ + } \ +} +#endif /** * @brief Pack a param_map_rc message @@ -57,40 +77,36 @@ typedef struct __mavlink_param_map_rc_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_map_rc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max) + uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN]; - _mav_put_float(buf, 0, param_value0); - _mav_put_float(buf, 4, scale); - _mav_put_float(buf, 8, param_value_min); - _mav_put_float(buf, 12, param_value_max); - _mav_put_int16_t(buf, 16, param_index); - _mav_put_uint8_t(buf, 18, target_system); - _mav_put_uint8_t(buf, 19, target_component); - _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); - _mav_put_char_array(buf, 20, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN]; + _mav_put_float(buf, 0, param_value0); + _mav_put_float(buf, 4, scale); + _mav_put_float(buf, 8, param_value_min); + _mav_put_float(buf, 12, param_value_max); + _mav_put_int16_t(buf, 16, param_index); + _mav_put_uint8_t(buf, 18, target_system); + _mav_put_uint8_t(buf, 19, target_component); + _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); + _mav_put_char_array(buf, 20, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); #else - mavlink_param_map_rc_t packet; - packet.param_value0 = param_value0; - packet.scale = scale; - packet.param_value_min = param_value_min; - packet.param_value_max = param_value_max; - packet.param_index = param_index; - packet.target_system = target_system; - packet.target_component = target_component; - packet.parameter_rc_channel_index = parameter_rc_channel_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_map_rc_t packet; + packet.param_value0 = param_value0; + packet.scale = scale; + packet.param_value_min = param_value_min; + packet.param_value_max = param_value_max; + packet.param_index = param_index; + packet.target_system = target_system; + packet.target_component = target_component; + packet.parameter_rc_channel_index = parameter_rc_channel_index; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); } /** @@ -111,41 +127,37 @@ static inline uint16_t mavlink_msg_param_map_rc_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_map_rc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index,uint8_t parameter_rc_channel_index,float param_value0,float scale,float param_value_min,float param_value_max) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index,uint8_t parameter_rc_channel_index,float param_value0,float scale,float param_value_min,float param_value_max) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN]; - _mav_put_float(buf, 0, param_value0); - _mav_put_float(buf, 4, scale); - _mav_put_float(buf, 8, param_value_min); - _mav_put_float(buf, 12, param_value_max); - _mav_put_int16_t(buf, 16, param_index); - _mav_put_uint8_t(buf, 18, target_system); - _mav_put_uint8_t(buf, 19, target_component); - _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); - _mav_put_char_array(buf, 20, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN]; + _mav_put_float(buf, 0, param_value0); + _mav_put_float(buf, 4, scale); + _mav_put_float(buf, 8, param_value_min); + _mav_put_float(buf, 12, param_value_max); + _mav_put_int16_t(buf, 16, param_index); + _mav_put_uint8_t(buf, 18, target_system); + _mav_put_uint8_t(buf, 19, target_component); + _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); + _mav_put_char_array(buf, 20, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); #else - mavlink_param_map_rc_t packet; - packet.param_value0 = param_value0; - packet.scale = scale; - packet.param_value_min = param_value_min; - packet.param_value_max = param_value_max; - packet.param_index = param_index; - packet.target_system = target_system; - packet.target_component = target_component; - packet.parameter_rc_channel_index = parameter_rc_channel_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_map_rc_t packet; + packet.param_value0 = param_value0; + packet.scale = scale; + packet.param_value_min = param_value_min; + packet.param_value_max = param_value_max; + packet.param_index = param_index; + packet.target_system = target_system; + packet.target_component = target_component; + packet.parameter_rc_channel_index = parameter_rc_channel_index; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); } /** @@ -158,7 +170,7 @@ static inline uint16_t mavlink_msg_param_map_rc_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_param_map_rc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_map_rc_t* param_map_rc) { - return mavlink_msg_param_map_rc_pack(system_id, component_id, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max); + return mavlink_msg_param_map_rc_pack(system_id, component_id, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max); } /** @@ -172,7 +184,7 @@ static inline uint16_t mavlink_msg_param_map_rc_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_param_map_rc_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_map_rc_t* param_map_rc) { - return mavlink_msg_param_map_rc_pack_chan(system_id, component_id, chan, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max); + return mavlink_msg_param_map_rc_pack_chan(system_id, component_id, chan, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max); } /** @@ -194,37 +206,43 @@ static inline uint16_t mavlink_msg_param_map_rc_encode_chan(uint8_t system_id, u static inline void mavlink_msg_param_map_rc_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN]; - _mav_put_float(buf, 0, param_value0); - _mav_put_float(buf, 4, scale); - _mav_put_float(buf, 8, param_value_min); - _mav_put_float(buf, 12, param_value_max); - _mav_put_int16_t(buf, 16, param_index); - _mav_put_uint8_t(buf, 18, target_system); - _mav_put_uint8_t(buf, 19, target_component); - _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); - _mav_put_char_array(buf, 20, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); + char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN]; + _mav_put_float(buf, 0, param_value0); + _mav_put_float(buf, 4, scale); + _mav_put_float(buf, 8, param_value_min); + _mav_put_float(buf, 12, param_value_max); + _mav_put_int16_t(buf, 16, param_index); + _mav_put_uint8_t(buf, 18, target_system); + _mav_put_uint8_t(buf, 19, target_component); + _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); + _mav_put_char_array(buf, 20, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); + mavlink_param_map_rc_t packet; + packet.param_value0 = param_value0; + packet.scale = scale; + packet.param_value_min = param_value_min; + packet.param_value_max = param_value_max; + packet.param_index = param_index; + packet.target_system = target_system; + packet.target_component = target_component; + packet.parameter_rc_channel_index = parameter_rc_channel_index; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)&packet, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); #endif +} + +/** + * @brief Send a param_map_rc message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_param_map_rc_send_struct(mavlink_channel_t chan, const mavlink_param_map_rc_t* param_map_rc) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_param_map_rc_send(chan, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max); #else - mavlink_param_map_rc_t packet; - packet.param_value0 = param_value0; - packet.scale = scale; - packet.param_value_min = param_value_min; - packet.param_value_max = param_value_max; - packet.param_index = param_index; - packet.target_system = target_system; - packet.target_component = target_component; - packet.parameter_rc_channel_index = parameter_rc_channel_index; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)&packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)&packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)param_map_rc, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); #endif } @@ -239,37 +257,29 @@ static inline void mavlink_msg_param_map_rc_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_param_map_rc_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, param_value0); - _mav_put_float(buf, 4, scale); - _mav_put_float(buf, 8, param_value_min); - _mav_put_float(buf, 12, param_value_max); - _mav_put_int16_t(buf, 16, param_index); - _mav_put_uint8_t(buf, 18, target_system); - _mav_put_uint8_t(buf, 19, target_component); - _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); - _mav_put_char_array(buf, 20, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); -#endif -#else - mavlink_param_map_rc_t *packet = (mavlink_param_map_rc_t *)msgbuf; - packet->param_value0 = param_value0; - packet->scale = scale; - packet->param_value_min = param_value_min; - packet->param_value_max = param_value_max; - packet->param_index = param_index; - packet->target_system = target_system; - packet->target_component = target_component; - packet->parameter_rc_channel_index = parameter_rc_channel_index; - mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param_value0); + _mav_put_float(buf, 4, scale); + _mav_put_float(buf, 8, param_value_min); + _mav_put_float(buf, 12, param_value_max); + _mav_put_int16_t(buf, 16, param_index); + _mav_put_uint8_t(buf, 18, target_system); + _mav_put_uint8_t(buf, 19, target_component); + _mav_put_uint8_t(buf, 36, parameter_rc_channel_index); + _mav_put_char_array(buf, 20, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); -#endif + mavlink_param_map_rc_t *packet = (mavlink_param_map_rc_t *)msgbuf; + packet->param_value0 = param_value0; + packet->scale = scale; + packet->param_value_min = param_value_min; + packet->param_value_max = param_value_max; + packet->param_index = param_index; + packet->target_system = target_system; + packet->target_component = target_component; + packet->parameter_rc_channel_index = parameter_rc_channel_index; + mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)packet, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC); #endif } #endif @@ -286,7 +296,7 @@ static inline void mavlink_msg_param_map_rc_send_buf(mavlink_message_t *msgbuf, */ static inline uint8_t mavlink_msg_param_map_rc_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 18); + return _MAV_RETURN_uint8_t(msg, 18); } /** @@ -296,7 +306,7 @@ static inline uint8_t mavlink_msg_param_map_rc_get_target_system(const mavlink_m */ static inline uint8_t mavlink_msg_param_map_rc_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 19); + return _MAV_RETURN_uint8_t(msg, 19); } /** @@ -306,7 +316,7 @@ static inline uint8_t mavlink_msg_param_map_rc_get_target_component(const mavlin */ static inline uint16_t mavlink_msg_param_map_rc_get_param_id(const mavlink_message_t* msg, char *param_id) { - return _MAV_RETURN_char_array(msg, param_id, 16, 20); + return _MAV_RETURN_char_array(msg, param_id, 16, 20); } /** @@ -316,7 +326,7 @@ static inline uint16_t mavlink_msg_param_map_rc_get_param_id(const mavlink_messa */ static inline int16_t mavlink_msg_param_map_rc_get_param_index(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -326,7 +336,7 @@ static inline int16_t mavlink_msg_param_map_rc_get_param_index(const mavlink_mes */ static inline uint8_t mavlink_msg_param_map_rc_get_parameter_rc_channel_index(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 36); + return _MAV_RETURN_uint8_t(msg, 36); } /** @@ -336,7 +346,7 @@ static inline uint8_t mavlink_msg_param_map_rc_get_parameter_rc_channel_index(co */ static inline float mavlink_msg_param_map_rc_get_param_value0(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -346,7 +356,7 @@ static inline float mavlink_msg_param_map_rc_get_param_value0(const mavlink_mess */ static inline float mavlink_msg_param_map_rc_get_scale(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -356,7 +366,7 @@ static inline float mavlink_msg_param_map_rc_get_scale(const mavlink_message_t* */ static inline float mavlink_msg_param_map_rc_get_param_value_min(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -366,7 +376,7 @@ static inline float mavlink_msg_param_map_rc_get_param_value_min(const mavlink_m */ static inline float mavlink_msg_param_map_rc_get_param_value_max(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -377,17 +387,19 @@ static inline float mavlink_msg_param_map_rc_get_param_value_max(const mavlink_m */ static inline void mavlink_msg_param_map_rc_decode(const mavlink_message_t* msg, mavlink_param_map_rc_t* param_map_rc) { -#if MAVLINK_NEED_BYTE_SWAP - param_map_rc->param_value0 = mavlink_msg_param_map_rc_get_param_value0(msg); - param_map_rc->scale = mavlink_msg_param_map_rc_get_scale(msg); - param_map_rc->param_value_min = mavlink_msg_param_map_rc_get_param_value_min(msg); - param_map_rc->param_value_max = mavlink_msg_param_map_rc_get_param_value_max(msg); - param_map_rc->param_index = mavlink_msg_param_map_rc_get_param_index(msg); - param_map_rc->target_system = mavlink_msg_param_map_rc_get_target_system(msg); - param_map_rc->target_component = mavlink_msg_param_map_rc_get_target_component(msg); - mavlink_msg_param_map_rc_get_param_id(msg, param_map_rc->param_id); - param_map_rc->parameter_rc_channel_index = mavlink_msg_param_map_rc_get_parameter_rc_channel_index(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + param_map_rc->param_value0 = mavlink_msg_param_map_rc_get_param_value0(msg); + param_map_rc->scale = mavlink_msg_param_map_rc_get_scale(msg); + param_map_rc->param_value_min = mavlink_msg_param_map_rc_get_param_value_min(msg); + param_map_rc->param_value_max = mavlink_msg_param_map_rc_get_param_value_max(msg); + param_map_rc->param_index = mavlink_msg_param_map_rc_get_param_index(msg); + param_map_rc->target_system = mavlink_msg_param_map_rc_get_target_system(msg); + param_map_rc->target_component = mavlink_msg_param_map_rc_get_target_component(msg); + mavlink_msg_param_map_rc_get_param_id(msg, param_map_rc->param_id); + param_map_rc->parameter_rc_channel_index = mavlink_msg_param_map_rc_get_parameter_rc_channel_index(msg); #else - memcpy(param_map_rc, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_MAP_RC_LEN? msg->len : MAVLINK_MSG_ID_PARAM_MAP_RC_LEN; + memset(param_map_rc, 0, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN); + memcpy(param_map_rc, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_list.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_list.h index e0b4976..23ed2ce 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_list.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_list.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE PARAM_REQUEST_LIST PACKING #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST 21 -typedef struct __mavlink_param_request_list_t -{ +MAVPACKED( +typedef struct __mavlink_param_request_list_t { uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_param_request_list_t; +}) mavlink_param_request_list_t; #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN 2 +#define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN 2 #define MAVLINK_MSG_ID_21_LEN 2 +#define MAVLINK_MSG_ID_21_MIN_LEN 2 #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC 159 #define MAVLINK_MSG_ID_21_CRC 159 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST { \ - "PARAM_REQUEST_LIST", \ - 2, \ - { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_list_t, target_system) }, \ + 21, \ + "PARAM_REQUEST_LIST", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_list_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_request_list_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST { \ + "PARAM_REQUEST_LIST", \ + 2, \ + { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_list_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_request_list_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a param_request_list message @@ -36,28 +49,24 @@ typedef struct __mavlink_param_request_list_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component) + uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #else - mavlink_param_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_param_request_list_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, ui * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #else - mavlink_param_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_param_request_list_t packet; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_i */ static inline uint16_t mavlink_msg_param_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_request_list_t* param_request_list) { - return mavlink_msg_param_request_list_pack(system_id, component_id, msg, param_request_list->target_system, param_request_list->target_component); + return mavlink_msg_param_request_list_pack(system_id, component_id, msg, param_request_list->target_system, param_request_list->target_component); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_param_request_list_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_param_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_request_list_t* param_request_list) { - return mavlink_msg_param_request_list_pack_chan(system_id, component_id, chan, msg, param_request_list->target_system, param_request_list->target_component); + return mavlink_msg_param_request_list_pack_chan(system_id, component_id, chan, msg, param_request_list->target_system, param_request_list->target_component); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_param_request_list_encode_chan(uint8_t system static inline void mavlink_msg_param_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN]; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); + mavlink_param_request_list_t packet; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); #endif -#else - mavlink_param_request_list_t packet; - packet.target_system = target_system; - packet.target_component = target_component; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); +/** + * @brief Send a param_request_list message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_param_request_list_send_struct(mavlink_channel_t chan, const mavlink_param_request_list_t* param_request_list) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_param_request_list_send(chan, param_request_list->target_system, param_request_list->target_component); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)param_request_list, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_param_request_list_send(mavlink_channel_t chan, u static inline void mavlink_msg_param_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, target_system); - _mav_put_uint8_t(buf, 1, target_component); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, target_system); + _mav_put_uint8_t(buf, 1, target_component); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); #else - mavlink_param_request_list_t *packet = (mavlink_param_request_list_t *)msgbuf; - packet->target_system = target_system; - packet->target_component = target_component; + mavlink_param_request_list_t *packet = (mavlink_param_request_list_t *)msgbuf; + packet->target_system = target_system; + packet->target_component = target_component; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_param_request_list_send_buf(mavlink_message_t *ms */ static inline uint8_t mavlink_msg_param_request_list_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint8_t mavlink_msg_param_request_list_get_target_system(const mav */ static inline uint8_t mavlink_msg_param_request_list_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -224,10 +227,12 @@ static inline uint8_t mavlink_msg_param_request_list_get_target_component(const */ static inline void mavlink_msg_param_request_list_decode(const mavlink_message_t* msg, mavlink_param_request_list_t* param_request_list) { -#if MAVLINK_NEED_BYTE_SWAP - param_request_list->target_system = mavlink_msg_param_request_list_get_target_system(msg); - param_request_list->target_component = mavlink_msg_param_request_list_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + param_request_list->target_system = mavlink_msg_param_request_list_get_target_system(msg); + param_request_list->target_component = mavlink_msg_param_request_list_get_target_component(msg); #else - memcpy(param_request_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN; + memset(param_request_list, 0, MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN); + memcpy(param_request_list, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_read.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_read.h index 0eade11..6e97d0b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_read.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_request_read.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE PARAM_REQUEST_READ PACKING #define MAVLINK_MSG_ID_PARAM_REQUEST_READ 20 -typedef struct __mavlink_param_request_read_t -{ +MAVPACKED( +typedef struct __mavlink_param_request_read_t { int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ -} mavlink_param_request_read_t; +}) mavlink_param_request_read_t; #define MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 20 +#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN 20 #define MAVLINK_MSG_ID_20_LEN 20 +#define MAVLINK_MSG_ID_20_MIN_LEN 20 #define MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC 214 #define MAVLINK_MSG_ID_20_CRC 214 #define MAVLINK_MSG_PARAM_REQUEST_READ_FIELD_PARAM_ID_LEN 16 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ { \ - "PARAM_REQUEST_READ", \ - 4, \ - { { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \ + 20, \ + "PARAM_REQUEST_READ", \ + 4, \ + { { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_param_request_read_t, target_component) }, \ { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 4, offsetof(mavlink_param_request_read_t, param_id) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ { \ + "PARAM_REQUEST_READ", \ + 4, \ + { { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_param_request_read_t, param_index) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_param_request_read_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_param_request_read_t, target_component) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 4, offsetof(mavlink_param_request_read_t, param_id) }, \ + } \ +} +#endif /** * @brief Pack a param_request_read message @@ -42,30 +57,26 @@ typedef struct __mavlink_param_request_read_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index) + uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; - _mav_put_int16_t(buf, 0, param_index); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_char_array(buf, 4, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; + _mav_put_int16_t(buf, 0, param_index); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_char_array(buf, 4, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #else - mavlink_param_request_read_t packet; - packet.param_index = param_index; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_request_read_t packet; + packet.param_index = param_index; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); } /** @@ -81,31 +92,27 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; - _mav_put_int16_t(buf, 0, param_index); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_char_array(buf, 4, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; + _mav_put_int16_t(buf, 0, param_index); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_char_array(buf, 4, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #else - mavlink_param_request_read_t packet; - packet.param_index = param_index; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_request_read_t packet; + packet.param_index = param_index; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); } /** @@ -118,7 +125,7 @@ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_i */ static inline uint16_t mavlink_msg_param_request_read_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_request_read_t* param_request_read) { - return mavlink_msg_param_request_read_pack(system_id, component_id, msg, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index); + return mavlink_msg_param_request_read_pack(system_id, component_id, msg, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index); } /** @@ -132,7 +139,7 @@ static inline uint16_t mavlink_msg_param_request_read_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_param_request_read_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_request_read_t* param_request_read) { - return mavlink_msg_param_request_read_pack_chan(system_id, component_id, chan, msg, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index); + return mavlink_msg_param_request_read_pack_chan(system_id, component_id, chan, msg, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index); } /** @@ -149,27 +156,33 @@ static inline uint16_t mavlink_msg_param_request_read_encode_chan(uint8_t system static inline void mavlink_msg_param_request_read_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; - _mav_put_int16_t(buf, 0, param_index); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_char_array(buf, 4, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); + char buf[MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN]; + _mav_put_int16_t(buf, 0, param_index); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_char_array(buf, 4, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); + mavlink_param_request_read_t packet; + packet.param_index = param_index; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); #endif +} + +/** + * @brief Send a param_request_read message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_param_request_read_send_struct(mavlink_channel_t chan, const mavlink_param_request_read_t* param_request_read) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_param_request_read_send(chan, param_request_read->target_system, param_request_read->target_component, param_request_read->param_id, param_request_read->param_index); #else - mavlink_param_request_read_t packet; - packet.param_index = param_index; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)&packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)param_request_read, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); #endif } @@ -184,27 +197,19 @@ static inline void mavlink_msg_param_request_read_send(mavlink_channel_t chan, u static inline void mavlink_msg_param_request_read_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int16_t(buf, 0, param_index); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_char_array(buf, 4, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); + char *buf = (char *)msgbuf; + _mav_put_int16_t(buf, 0, param_index); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_char_array(buf, 4, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, buf, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); -#endif -#else - mavlink_param_request_read_t *packet = (mavlink_param_request_read_t *)msgbuf; - packet->param_index = param_index; - packet->target_system = target_system; - packet->target_component = target_component; - mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); -#endif + mavlink_param_request_read_t *packet = (mavlink_param_request_read_t *)msgbuf; + packet->param_index = param_index; + packet->target_system = target_system; + packet->target_component = target_component; + mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_READ, (const char *)packet, MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN, MAVLINK_MSG_ID_PARAM_REQUEST_READ_CRC); #endif } #endif @@ -221,7 +226,7 @@ static inline void mavlink_msg_param_request_read_send_buf(mavlink_message_t *ms */ static inline uint8_t mavlink_msg_param_request_read_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -231,7 +236,7 @@ static inline uint8_t mavlink_msg_param_request_read_get_target_system(const mav */ static inline uint8_t mavlink_msg_param_request_read_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -241,7 +246,7 @@ static inline uint8_t mavlink_msg_param_request_read_get_target_component(const */ static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink_message_t* msg, char *param_id) { - return _MAV_RETURN_char_array(msg, param_id, 16, 4); + return _MAV_RETURN_char_array(msg, param_id, 16, 4); } /** @@ -251,7 +256,7 @@ static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink */ static inline int16_t mavlink_msg_param_request_read_get_param_index(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 0); + return _MAV_RETURN_int16_t(msg, 0); } /** @@ -262,12 +267,14 @@ static inline int16_t mavlink_msg_param_request_read_get_param_index(const mavli */ static inline void mavlink_msg_param_request_read_decode(const mavlink_message_t* msg, mavlink_param_request_read_t* param_request_read) { -#if MAVLINK_NEED_BYTE_SWAP - param_request_read->param_index = mavlink_msg_param_request_read_get_param_index(msg); - param_request_read->target_system = mavlink_msg_param_request_read_get_target_system(msg); - param_request_read->target_component = mavlink_msg_param_request_read_get_target_component(msg); - mavlink_msg_param_request_read_get_param_id(msg, param_request_read->param_id); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + param_request_read->param_index = mavlink_msg_param_request_read_get_param_index(msg); + param_request_read->target_system = mavlink_msg_param_request_read_get_target_system(msg); + param_request_read->target_component = mavlink_msg_param_request_read_get_target_component(msg); + mavlink_msg_param_request_read_get_param_id(msg, param_request_read->param_id); #else - memcpy(param_request_read, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN? msg->len : MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN; + memset(param_request_read, 0, MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN); + memcpy(param_request_read, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_set.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_set.h index 8173abc..1537b01 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_set.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_set.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE PARAM_SET PACKING #define MAVLINK_MSG_ID_PARAM_SET 23 -typedef struct __mavlink_param_set_t -{ +MAVPACKED( +typedef struct __mavlink_param_set_t { float param_value; /*< Onboard parameter value*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ uint8_t param_type; /*< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.*/ -} mavlink_param_set_t; +}) mavlink_param_set_t; #define MAVLINK_MSG_ID_PARAM_SET_LEN 23 +#define MAVLINK_MSG_ID_PARAM_SET_MIN_LEN 23 #define MAVLINK_MSG_ID_23_LEN 23 +#define MAVLINK_MSG_ID_23_MIN_LEN 23 #define MAVLINK_MSG_ID_PARAM_SET_CRC 168 #define MAVLINK_MSG_ID_23_CRC 168 #define MAVLINK_MSG_PARAM_SET_FIELD_PARAM_ID_LEN 16 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_PARAM_SET { \ - "PARAM_SET", \ - 5, \ - { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \ + 23, \ + "PARAM_SET", \ + 5, \ + { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_set_t, target_component) }, \ { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_set_t, param_id) }, \ { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_set_t, param_type) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_PARAM_SET { \ + "PARAM_SET", \ + 5, \ + { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_set_t, param_value) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_param_set_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_param_set_t, target_component) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 6, offsetof(mavlink_param_set_t, param_id) }, \ + { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_param_set_t, param_type) }, \ + } \ +} +#endif /** * @brief Pack a param_set message @@ -45,32 +61,28 @@ typedef struct __mavlink_param_set_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type) + uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; - _mav_put_float(buf, 0, param_value); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - _mav_put_uint8_t(buf, 22, param_type); - _mav_put_char_array(buf, 6, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_char_array(buf, 6, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_SET_LEN); #else - mavlink_param_set_t packet; - packet.param_value = param_value; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_type = param_type; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_set_t packet; + packet.param_value = param_value; + packet.target_system = target_system; + packet.target_component = target_component; + packet.param_type = param_type; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_SET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_SET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_SET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_SET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); } /** @@ -87,33 +99,29 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,const char *param_id,float param_value,uint8_t param_type) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,const char *param_id,float param_value,uint8_t param_type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; - _mav_put_float(buf, 0, param_value); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - _mav_put_uint8_t(buf, 22, param_type); - _mav_put_char_array(buf, 6, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_char_array(buf, 6, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_SET_LEN); #else - mavlink_param_set_t packet; - packet.param_value = param_value; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_type = param_type; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_set_t packet; + packet.param_value = param_value; + packet.target_system = target_system; + packet.target_component = target_component; + packet.param_type = param_type; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_SET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_SET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_SET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_SET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); } /** @@ -126,7 +134,7 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_param_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_set_t* param_set) { - return mavlink_msg_param_set_pack(system_id, component_id, msg, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type); + return mavlink_msg_param_set_pack(system_id, component_id, msg, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type); } /** @@ -140,7 +148,7 @@ static inline uint16_t mavlink_msg_param_set_encode(uint8_t system_id, uint8_t c */ static inline uint16_t mavlink_msg_param_set_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_set_t* param_set) { - return mavlink_msg_param_set_pack_chan(system_id, component_id, chan, msg, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type); + return mavlink_msg_param_set_pack_chan(system_id, component_id, chan, msg, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type); } /** @@ -158,29 +166,35 @@ static inline uint16_t mavlink_msg_param_set_encode_chan(uint8_t system_id, uint static inline void mavlink_msg_param_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; - _mav_put_float(buf, 0, param_value); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - _mav_put_uint8_t(buf, 22, param_type); - _mav_put_char_array(buf, 6, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); + char buf[MAVLINK_MSG_ID_PARAM_SET_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_char_array(buf, 6, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_LEN); + mavlink_param_set_t packet; + packet.param_value = param_value; + packet.target_system = target_system; + packet.target_component = target_component; + packet.param_type = param_type; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); #endif +} + +/** + * @brief Send a param_set message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_param_set_send_struct(mavlink_channel_t chan, const mavlink_param_set_t* param_set) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_param_set_send(chan, param_set->target_system, param_set->target_component, param_set->param_id, param_set->param_value, param_set->param_type); #else - mavlink_param_set_t packet; - packet.param_value = param_value; - packet.target_system = target_system; - packet.target_component = target_component; - packet.param_type = param_type; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)&packet, MAVLINK_MSG_ID_PARAM_SET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)param_set, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); #endif } @@ -195,29 +209,21 @@ static inline void mavlink_msg_param_set_send(mavlink_channel_t chan, uint8_t ta static inline void mavlink_msg_param_set_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, float param_value, uint8_t param_type) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, param_value); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, target_component); - _mav_put_uint8_t(buf, 22, param_type); - _mav_put_char_array(buf, 6, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param_value); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, target_component); + _mav_put_uint8_t(buf, 22, param_type); + _mav_put_char_array(buf, 6, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, buf, MAVLINK_MSG_ID_PARAM_SET_LEN); -#endif -#else - mavlink_param_set_t *packet = (mavlink_param_set_t *)msgbuf; - packet->param_value = param_value; - packet->target_system = target_system; - packet->target_component = target_component; - packet->param_type = param_type; - mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)packet, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)packet, MAVLINK_MSG_ID_PARAM_SET_LEN); -#endif + mavlink_param_set_t *packet = (mavlink_param_set_t *)msgbuf; + packet->param_value = param_value; + packet->target_system = target_system; + packet->target_component = target_component; + packet->param_type = param_type; + mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_SET, (const char *)packet, MAVLINK_MSG_ID_PARAM_SET_MIN_LEN, MAVLINK_MSG_ID_PARAM_SET_LEN, MAVLINK_MSG_ID_PARAM_SET_CRC); #endif } #endif @@ -234,7 +240,7 @@ static inline void mavlink_msg_param_set_send_buf(mavlink_message_t *msgbuf, mav */ static inline uint8_t mavlink_msg_param_set_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -244,7 +250,7 @@ static inline uint8_t mavlink_msg_param_set_get_target_system(const mavlink_mess */ static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -254,7 +260,7 @@ static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_m */ static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_t* msg, char *param_id) { - return _MAV_RETURN_char_array(msg, param_id, 16, 6); + return _MAV_RETURN_char_array(msg, param_id, 16, 6); } /** @@ -264,7 +270,7 @@ static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_ */ static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -274,7 +280,7 @@ static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_ */ static inline uint8_t mavlink_msg_param_set_get_param_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 22); + return _MAV_RETURN_uint8_t(msg, 22); } /** @@ -285,13 +291,15 @@ static inline uint8_t mavlink_msg_param_set_get_param_type(const mavlink_message */ static inline void mavlink_msg_param_set_decode(const mavlink_message_t* msg, mavlink_param_set_t* param_set) { -#if MAVLINK_NEED_BYTE_SWAP - param_set->param_value = mavlink_msg_param_set_get_param_value(msg); - param_set->target_system = mavlink_msg_param_set_get_target_system(msg); - param_set->target_component = mavlink_msg_param_set_get_target_component(msg); - mavlink_msg_param_set_get_param_id(msg, param_set->param_id); - param_set->param_type = mavlink_msg_param_set_get_param_type(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + param_set->param_value = mavlink_msg_param_set_get_param_value(msg); + param_set->target_system = mavlink_msg_param_set_get_target_system(msg); + param_set->target_component = mavlink_msg_param_set_get_target_component(msg); + mavlink_msg_param_set_get_param_id(msg, param_set->param_id); + param_set->param_type = mavlink_msg_param_set_get_param_type(msg); #else - memcpy(param_set, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_SET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_SET_LEN? msg->len : MAVLINK_MSG_ID_PARAM_SET_LEN; + memset(param_set, 0, MAVLINK_MSG_ID_PARAM_SET_LEN); + memcpy(param_set, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_value.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_value.h index 23fb514..43de226 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_value.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_param_value.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE PARAM_VALUE PACKING #define MAVLINK_MSG_ID_PARAM_VALUE 22 -typedef struct __mavlink_param_value_t -{ +MAVPACKED( +typedef struct __mavlink_param_value_t { float param_value; /*< Onboard parameter value*/ uint16_t param_count; /*< Total number of onboard parameters*/ uint16_t param_index; /*< Index of this onboard parameter*/ char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/ uint8_t param_type; /*< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.*/ -} mavlink_param_value_t; +}) mavlink_param_value_t; #define MAVLINK_MSG_ID_PARAM_VALUE_LEN 25 +#define MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN 25 #define MAVLINK_MSG_ID_22_LEN 25 +#define MAVLINK_MSG_ID_22_MIN_LEN 25 #define MAVLINK_MSG_ID_PARAM_VALUE_CRC 220 #define MAVLINK_MSG_ID_22_CRC 220 #define MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN 16 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \ - "PARAM_VALUE", \ - 5, \ - { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \ + 22, \ + "PARAM_VALUE", \ + 5, \ + { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \ { "param_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_param_value_t, param_count) }, \ { "param_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_param_value_t, param_index) }, \ { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \ { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \ + "PARAM_VALUE", \ + 5, \ + { { "param_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_value_t, param_value) }, \ + { "param_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_param_value_t, param_count) }, \ + { "param_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_param_value_t, param_index) }, \ + { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 8, offsetof(mavlink_param_value_t, param_id) }, \ + { "param_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_param_value_t, param_type) }, \ + } \ +} +#endif /** * @brief Pack a param_value message @@ -45,32 +61,28 @@ typedef struct __mavlink_param_value_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) + const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; - _mav_put_float(buf, 0, param_value); - _mav_put_uint16_t(buf, 4, param_count); - _mav_put_uint16_t(buf, 6, param_index); - _mav_put_uint8_t(buf, 24, param_type); - _mav_put_char_array(buf, 8, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint16_t(buf, 4, param_count); + _mav_put_uint16_t(buf, 6, param_index); + _mav_put_uint8_t(buf, 24, param_type); + _mav_put_char_array(buf, 8, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #else - mavlink_param_value_t packet; - packet.param_value = param_value; - packet.param_count = param_count; - packet.param_index = param_index; - packet.param_type = param_type; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_value_t packet; + packet.param_value = param_value; + packet.param_count = param_count; + packet.param_index = param_index; + packet.param_type = param_type; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); } /** @@ -87,33 +99,29 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const char *param_id,float param_value,uint8_t param_type,uint16_t param_count,uint16_t param_index) + mavlink_message_t* msg, + const char *param_id,float param_value,uint8_t param_type,uint16_t param_count,uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; - _mav_put_float(buf, 0, param_value); - _mav_put_uint16_t(buf, 4, param_count); - _mav_put_uint16_t(buf, 6, param_index); - _mav_put_uint8_t(buf, 24, param_type); - _mav_put_char_array(buf, 8, param_id, 16); + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint16_t(buf, 4, param_count); + _mav_put_uint16_t(buf, 6, param_index); + _mav_put_uint8_t(buf, 24, param_type); + _mav_put_char_array(buf, 8, param_id, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #else - mavlink_param_value_t packet; - packet.param_value = param_value; - packet.param_count = param_count; - packet.param_index = param_index; - packet.param_type = param_type; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + mavlink_param_value_t packet; + packet.param_value = param_value; + packet.param_count = param_count; + packet.param_index = param_index; + packet.param_type = param_type; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); } /** @@ -126,7 +134,7 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_value_t* param_value) { - return mavlink_msg_param_value_pack(system_id, component_id, msg, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index); + return mavlink_msg_param_value_pack(system_id, component_id, msg, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index); } /** @@ -140,7 +148,7 @@ static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_param_value_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_value_t* param_value) { - return mavlink_msg_param_value_pack_chan(system_id, component_id, chan, msg, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index); + return mavlink_msg_param_value_pack_chan(system_id, component_id, chan, msg, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index); } /** @@ -158,29 +166,35 @@ static inline uint16_t mavlink_msg_param_value_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; - _mav_put_float(buf, 0, param_value); - _mav_put_uint16_t(buf, 4, param_count); - _mav_put_uint16_t(buf, 6, param_index); - _mav_put_uint8_t(buf, 24, param_type); - _mav_put_char_array(buf, 8, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; + _mav_put_float(buf, 0, param_value); + _mav_put_uint16_t(buf, 4, param_count); + _mav_put_uint16_t(buf, 6, param_index); + _mav_put_uint8_t(buf, 24, param_type); + _mav_put_char_array(buf, 8, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); + mavlink_param_value_t packet; + packet.param_value = param_value; + packet.param_count = param_count; + packet.param_index = param_index; + packet.param_type = param_type; + mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); #endif +} + +/** + * @brief Send a param_value message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_param_value_send_struct(mavlink_channel_t chan, const mavlink_param_value_t* param_value) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_param_value_send(chan, param_value->param_id, param_value->param_value, param_value->param_type, param_value->param_count, param_value->param_index); #else - mavlink_param_value_t packet; - packet.param_value = param_value; - packet.param_count = param_count; - packet.param_index = param_index; - packet.param_type = param_type; - mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)param_value, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); #endif } @@ -195,29 +209,21 @@ static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const ch static inline void mavlink_msg_param_value_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, param_value); - _mav_put_uint16_t(buf, 4, param_count); - _mav_put_uint16_t(buf, 6, param_index); - _mav_put_uint8_t(buf, 24, param_type); - _mav_put_char_array(buf, 8, param_id, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, param_value); + _mav_put_uint16_t(buf, 4, param_count); + _mav_put_uint16_t(buf, 6, param_index); + _mav_put_uint8_t(buf, 24, param_type); + _mav_put_char_array(buf, 8, param_id, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); -#endif -#else - mavlink_param_value_t *packet = (mavlink_param_value_t *)msgbuf; - packet->param_value = param_value; - packet->param_count = param_count; - packet->param_index = param_index; - packet->param_type = param_type; - mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); -#endif + mavlink_param_value_t *packet = (mavlink_param_value_t *)msgbuf; + packet->param_value = param_value; + packet->param_count = param_count; + packet->param_index = param_index; + packet->param_type = param_type; + mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)packet, MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); #endif } #endif @@ -234,7 +240,7 @@ static inline void mavlink_msg_param_value_send_buf(mavlink_message_t *msgbuf, m */ static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_message_t* msg, char *param_id) { - return _MAV_RETURN_char_array(msg, param_id, 16, 8); + return _MAV_RETURN_char_array(msg, param_id, 16, 8); } /** @@ -244,7 +250,7 @@ static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_messag */ static inline float mavlink_msg_param_value_get_param_value(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -254,7 +260,7 @@ static inline float mavlink_msg_param_value_get_param_value(const mavlink_messag */ static inline uint8_t mavlink_msg_param_value_get_param_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 24); + return _MAV_RETURN_uint8_t(msg, 24); } /** @@ -264,7 +270,7 @@ static inline uint8_t mavlink_msg_param_value_get_param_type(const mavlink_messa */ static inline uint16_t mavlink_msg_param_value_get_param_count(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -274,7 +280,7 @@ static inline uint16_t mavlink_msg_param_value_get_param_count(const mavlink_mes */ static inline uint16_t mavlink_msg_param_value_get_param_index(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 6); + return _MAV_RETURN_uint16_t(msg, 6); } /** @@ -285,13 +291,15 @@ static inline uint16_t mavlink_msg_param_value_get_param_index(const mavlink_mes */ static inline void mavlink_msg_param_value_decode(const mavlink_message_t* msg, mavlink_param_value_t* param_value) { -#if MAVLINK_NEED_BYTE_SWAP - param_value->param_value = mavlink_msg_param_value_get_param_value(msg); - param_value->param_count = mavlink_msg_param_value_get_param_count(msg); - param_value->param_index = mavlink_msg_param_value_get_param_index(msg); - mavlink_msg_param_value_get_param_id(msg, param_value->param_id); - param_value->param_type = mavlink_msg_param_value_get_param_type(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + param_value->param_value = mavlink_msg_param_value_get_param_value(msg); + param_value->param_count = mavlink_msg_param_value_get_param_count(msg); + param_value->param_index = mavlink_msg_param_value_get_param_index(msg); + mavlink_msg_param_value_get_param_id(msg, param_value->param_id); + param_value->param_type = mavlink_msg_param_value_get_param_type(msg); #else - memcpy(param_value, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_VALUE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_VALUE_LEN? msg->len : MAVLINK_MSG_ID_PARAM_VALUE_LEN; + memset(param_value, 0, MAVLINK_MSG_ID_PARAM_VALUE_LEN); + memcpy(param_value, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_ping.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_ping.h index 2d9f0f7..1005f07 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_ping.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_ping.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE PING PACKING #define MAVLINK_MSG_ID_PING 4 -typedef struct __mavlink_ping_t -{ +MAVPACKED( +typedef struct __mavlink_ping_t { uint64_t time_usec; /*< Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009)*/ uint32_t seq; /*< PING sequence*/ uint8_t target_system; /*< 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system*/ uint8_t target_component; /*< 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system*/ -} mavlink_ping_t; +}) mavlink_ping_t; #define MAVLINK_MSG_ID_PING_LEN 14 +#define MAVLINK_MSG_ID_PING_MIN_LEN 14 #define MAVLINK_MSG_ID_4_LEN 14 +#define MAVLINK_MSG_ID_4_MIN_LEN 14 #define MAVLINK_MSG_ID_PING_CRC 237 #define MAVLINK_MSG_ID_4_CRC 237 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_PING { \ - "PING", \ - 4, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_ping_t, time_usec) }, \ + 4, \ + "PING", \ + 4, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_ping_t, time_usec) }, \ { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_ping_t, seq) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_ping_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_ping_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_PING { \ + "PING", \ + 4, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_ping_t, time_usec) }, \ + { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_ping_t, seq) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_ping_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_ping_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a ping message @@ -42,32 +57,28 @@ typedef struct __mavlink_ping_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component) + uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PING_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); - _mav_put_uint8_t(buf, 12, target_system); - _mav_put_uint8_t(buf, 13, target_component); + char buf[MAVLINK_MSG_ID_PING_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); + _mav_put_uint8_t(buf, 12, target_system); + _mav_put_uint8_t(buf, 13, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN); #else - mavlink_ping_t packet; - packet.time_usec = time_usec; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_ping_t packet; + packet.time_usec = time_usec; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PING; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PING; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint32_t seq,uint8_t target_system,uint8_t target_component) + mavlink_message_t* msg, + uint64_t time_usec,uint32_t seq,uint8_t target_system,uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PING_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); - _mav_put_uint8_t(buf, 12, target_system); - _mav_put_uint8_t(buf, 13, target_component); + char buf[MAVLINK_MSG_ID_PING_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); + _mav_put_uint8_t(buf, 12, target_system); + _mav_put_uint8_t(buf, 13, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN); #else - mavlink_ping_t packet; - packet.time_usec = time_usec; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_ping_t packet; + packet.time_usec = time_usec; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_PING; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_PING; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com */ static inline uint16_t mavlink_msg_ping_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ping_t* ping) { - return mavlink_msg_ping_pack(system_id, component_id, msg, ping->time_usec, ping->seq, ping->target_system, ping->target_component); + return mavlink_msg_ping_pack(system_id, component_id, msg, ping->time_usec, ping->seq, ping->target_system, ping->target_component); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_ping_encode(uint8_t system_id, uint8_t compon */ static inline uint16_t mavlink_msg_ping_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ping_t* ping) { - return mavlink_msg_ping_pack_chan(system_id, component_id, chan, msg, ping->time_usec, ping->seq, ping->target_system, ping->target_component); + return mavlink_msg_ping_pack_chan(system_id, component_id, chan, msg, ping->time_usec, ping->seq, ping->target_system, ping->target_component); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_ping_encode_chan(uint8_t system_id, uint8_t c static inline void mavlink_msg_ping_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_PING_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); - _mav_put_uint8_t(buf, 12, target_system); - _mav_put_uint8_t(buf, 13, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); + char buf[MAVLINK_MSG_ID_PING_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); + _mav_put_uint8_t(buf, 12, target_system); + _mav_put_uint8_t(buf, 13, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN); + mavlink_ping_t packet; + packet.time_usec = time_usec; + packet.seq = seq; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); #endif +} + +/** + * @brief Send a ping message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_ping_send_struct(mavlink_channel_t chan, const mavlink_ping_t* ping) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_ping_send(chan, ping->time_usec, ping->seq, ping->target_system, ping->target_component); #else - mavlink_ping_t packet; - packet.time_usec = time_usec; - packet.seq = seq; - packet.target_system = target_system; - packet.target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)&packet, MAVLINK_MSG_ID_PING_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)ping, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_ping_send(mavlink_channel_t chan, uint64_t time_u static inline void mavlink_msg_ping_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint32_t(buf, 8, seq); - _mav_put_uint8_t(buf, 12, target_system); - _mav_put_uint8_t(buf, 13, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN); -#endif -#else - mavlink_ping_t *packet = (mavlink_ping_t *)msgbuf; - packet->time_usec = time_usec; - packet->seq = seq; - packet->target_system = target_system; - packet->target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)packet, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint32_t(buf, 8, seq); + _mav_put_uint8_t(buf, 12, target_system); + _mav_put_uint8_t(buf, 13, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)packet, MAVLINK_MSG_ID_PING_LEN); -#endif + mavlink_ping_t *packet = (mavlink_ping_t *)msgbuf; + packet->time_usec = time_usec; + packet->seq = seq; + packet->target_system = target_system; + packet->target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (const char *)packet, MAVLINK_MSG_ID_PING_MIN_LEN, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_ping_send_buf(mavlink_message_t *msgbuf, mavlink_ */ static inline uint64_t mavlink_msg_ping_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -239,7 +244,7 @@ static inline uint64_t mavlink_msg_ping_get_time_usec(const mavlink_message_t* m */ static inline uint32_t mavlink_msg_ping_get_seq(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -249,7 +254,7 @@ static inline uint32_t mavlink_msg_ping_get_seq(const mavlink_message_t* msg) */ static inline uint8_t mavlink_msg_ping_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 12); + return _MAV_RETURN_uint8_t(msg, 12); } /** @@ -259,7 +264,7 @@ static inline uint8_t mavlink_msg_ping_get_target_system(const mavlink_message_t */ static inline uint8_t mavlink_msg_ping_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 13); + return _MAV_RETURN_uint8_t(msg, 13); } /** @@ -270,12 +275,14 @@ static inline uint8_t mavlink_msg_ping_get_target_component(const mavlink_messag */ static inline void mavlink_msg_ping_decode(const mavlink_message_t* msg, mavlink_ping_t* ping) { -#if MAVLINK_NEED_BYTE_SWAP - ping->time_usec = mavlink_msg_ping_get_time_usec(msg); - ping->seq = mavlink_msg_ping_get_seq(msg); - ping->target_system = mavlink_msg_ping_get_target_system(msg); - ping->target_component = mavlink_msg_ping_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + ping->time_usec = mavlink_msg_ping_get_time_usec(msg); + ping->seq = mavlink_msg_ping_get_seq(msg); + ping->target_system = mavlink_msg_ping_get_target_system(msg); + ping->target_component = mavlink_msg_ping_get_target_component(msg); #else - memcpy(ping, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PING_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_PING_LEN? msg->len : MAVLINK_MSG_ID_PING_LEN; + memset(ping, 0, MAVLINK_MSG_ID_PING_LEN); + memcpy(ping, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_global_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_global_int.h index 51cc4ba..a1e472b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_global_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_global_int.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE POSITION_TARGET_GLOBAL_INT PACKING #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT 87 -typedef struct __mavlink_position_target_global_int_t -{ +MAVPACKED( +typedef struct __mavlink_position_target_global_int_t { uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/ int32_t lat_int; /*< X Position in WGS84 frame in 1e7 * meters*/ int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/ @@ -18,20 +19,24 @@ typedef struct __mavlink_position_target_global_int_t float yaw_rate; /*< yaw rate setpoint in rad/s*/ uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/ -} mavlink_position_target_global_int_t; +}) mavlink_position_target_global_int_t; #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN 51 +#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN 51 #define MAVLINK_MSG_ID_87_LEN 51 +#define MAVLINK_MSG_ID_87_MIN_LEN 51 #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC 150 #define MAVLINK_MSG_ID_87_CRC 150 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT { \ - "POSITION_TARGET_GLOBAL_INT", \ - 14, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \ + 87, \ + "POSITION_TARGET_GLOBAL_INT", \ + 14, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \ { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \ { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \ @@ -47,7 +52,27 @@ typedef struct __mavlink_position_target_global_int_t { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT { \ + "POSITION_TARGET_GLOBAL_INT", \ + 14, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \ + { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \ + { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \ + { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \ + { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) }, \ + { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) }, \ + { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) }, \ + { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \ + { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \ + } \ +} +#endif /** * @brief Pack a position_target_global_int message @@ -72,52 +97,48 @@ typedef struct __mavlink_position_target_global_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) + uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); + char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); #else - mavlink_position_target_global_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat_int = lat_int; - packet.lon_int = lon_int; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.coordinate_frame = coordinate_frame; + mavlink_position_target_global_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat_int = lat_int; + packet.lon_int = lon_int; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); } /** @@ -143,53 +164,49 @@ static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t syste * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); + char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); #else - mavlink_position_target_global_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat_int = lat_int; - packet.lon_int = lon_int; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.coordinate_frame = coordinate_frame; + mavlink_position_target_global_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat_int = lat_int; + packet.lon_int = lon_int; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); } /** @@ -202,7 +219,7 @@ static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t */ static inline uint16_t mavlink_msg_position_target_global_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int) { - return mavlink_msg_position_target_global_int_pack(system_id, component_id, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate); + return mavlink_msg_position_target_global_int_pack(system_id, component_id, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate); } /** @@ -216,7 +233,7 @@ static inline uint16_t mavlink_msg_position_target_global_int_encode(uint8_t sys */ static inline uint16_t mavlink_msg_position_target_global_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int) { - return mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, chan, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate); + return mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, chan, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate); } /** @@ -243,49 +260,55 @@ static inline uint16_t mavlink_msg_position_target_global_int_encode_chan(uint8_ static inline void mavlink_msg_position_target_global_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); + char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); + mavlink_position_target_global_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat_int = lat_int; + packet.lon_int = lon_int; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); #endif +} + +/** + * @brief Send a position_target_global_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_position_target_global_int_send_struct(mavlink_channel_t chan, const mavlink_position_target_global_int_t* position_target_global_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_position_target_global_int_send(chan, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate); #else - mavlink_position_target_global_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat_int = lat_int; - packet.lon_int = lon_int; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)position_target_global_int, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); #endif } @@ -300,49 +323,41 @@ static inline void mavlink_msg_position_target_global_int_send(mavlink_channel_t static inline void mavlink_msg_position_target_global_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); -#endif -#else - mavlink_position_target_global_int_t *packet = (mavlink_position_target_global_int_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->lat_int = lat_int; - packet->lon_int = lon_int; - packet->alt = alt; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->afx = afx; - packet->afy = afy; - packet->afz = afz; - packet->yaw = yaw; - packet->yaw_rate = yaw_rate; - packet->type_mask = type_mask; - packet->coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + mavlink_position_target_global_int_t *packet = (mavlink_position_target_global_int_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->lat_int = lat_int; + packet->lon_int = lon_int; + packet->alt = alt; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->afx = afx; + packet->afy = afy; + packet->afz = afz; + packet->yaw = yaw; + packet->yaw_rate = yaw_rate; + packet->type_mask = type_mask; + packet->coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC); #endif } #endif @@ -359,7 +374,7 @@ static inline void mavlink_msg_position_target_global_int_send_buf(mavlink_messa */ static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -369,7 +384,7 @@ static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(c */ static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 50); + return _MAV_RETURN_uint8_t(msg, 50); } /** @@ -379,7 +394,7 @@ static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_fram */ static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 48); + return _MAV_RETURN_uint16_t(msg, 48); } /** @@ -389,7 +404,7 @@ static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(cons */ static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -399,7 +414,7 @@ static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const m */ static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -409,7 +424,7 @@ static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const m */ static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -419,7 +434,7 @@ static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink */ static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -429,7 +444,7 @@ static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_ */ static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -439,7 +454,7 @@ static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_ */ static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -449,7 +464,7 @@ static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_ */ static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -459,7 +474,7 @@ static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink */ static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -469,7 +484,7 @@ static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink */ static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -479,7 +494,7 @@ static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink */ static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -489,7 +504,7 @@ static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink */ static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -500,22 +515,24 @@ static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const ma */ static inline void mavlink_msg_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_position_target_global_int_t* position_target_global_int) { -#if MAVLINK_NEED_BYTE_SWAP - position_target_global_int->time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(msg); - position_target_global_int->lat_int = mavlink_msg_position_target_global_int_get_lat_int(msg); - position_target_global_int->lon_int = mavlink_msg_position_target_global_int_get_lon_int(msg); - position_target_global_int->alt = mavlink_msg_position_target_global_int_get_alt(msg); - position_target_global_int->vx = mavlink_msg_position_target_global_int_get_vx(msg); - position_target_global_int->vy = mavlink_msg_position_target_global_int_get_vy(msg); - position_target_global_int->vz = mavlink_msg_position_target_global_int_get_vz(msg); - position_target_global_int->afx = mavlink_msg_position_target_global_int_get_afx(msg); - position_target_global_int->afy = mavlink_msg_position_target_global_int_get_afy(msg); - position_target_global_int->afz = mavlink_msg_position_target_global_int_get_afz(msg); - position_target_global_int->yaw = mavlink_msg_position_target_global_int_get_yaw(msg); - position_target_global_int->yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(msg); - position_target_global_int->type_mask = mavlink_msg_position_target_global_int_get_type_mask(msg); - position_target_global_int->coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + position_target_global_int->time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(msg); + position_target_global_int->lat_int = mavlink_msg_position_target_global_int_get_lat_int(msg); + position_target_global_int->lon_int = mavlink_msg_position_target_global_int_get_lon_int(msg); + position_target_global_int->alt = mavlink_msg_position_target_global_int_get_alt(msg); + position_target_global_int->vx = mavlink_msg_position_target_global_int_get_vx(msg); + position_target_global_int->vy = mavlink_msg_position_target_global_int_get_vy(msg); + position_target_global_int->vz = mavlink_msg_position_target_global_int_get_vz(msg); + position_target_global_int->afx = mavlink_msg_position_target_global_int_get_afx(msg); + position_target_global_int->afy = mavlink_msg_position_target_global_int_get_afy(msg); + position_target_global_int->afz = mavlink_msg_position_target_global_int_get_afz(msg); + position_target_global_int->yaw = mavlink_msg_position_target_global_int_get_yaw(msg); + position_target_global_int->yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(msg); + position_target_global_int->type_mask = mavlink_msg_position_target_global_int_get_type_mask(msg); + position_target_global_int->coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(msg); #else - memcpy(position_target_global_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN; + memset(position_target_global_int, 0, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN); + memcpy(position_target_global_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_local_ned.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_local_ned.h index 60d6736..faf1b1a 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_local_ned.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_position_target_local_ned.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE POSITION_TARGET_LOCAL_NED PACKING #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED 85 -typedef struct __mavlink_position_target_local_ned_t -{ +MAVPACKED( +typedef struct __mavlink_position_target_local_ned_t { uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ float x; /*< X Position in NED frame in meters*/ float y; /*< Y Position in NED frame in meters*/ @@ -18,20 +19,24 @@ typedef struct __mavlink_position_target_local_ned_t float yaw_rate; /*< yaw rate setpoint in rad/s*/ uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/ -} mavlink_position_target_local_ned_t; +}) mavlink_position_target_local_ned_t; #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN 51 +#define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN 51 #define MAVLINK_MSG_ID_85_LEN 51 +#define MAVLINK_MSG_ID_85_MIN_LEN 51 #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC 140 #define MAVLINK_MSG_ID_85_CRC 140 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED { \ - "POSITION_TARGET_LOCAL_NED", \ - 14, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \ + 85, \ + "POSITION_TARGET_LOCAL_NED", \ + 14, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \ @@ -47,7 +52,27 @@ typedef struct __mavlink_position_target_local_ned_t { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED { \ + "POSITION_TARGET_LOCAL_NED", \ + 14, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \ + { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_local_ned_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_local_ned_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_local_ned_t, vz) }, \ + { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_local_ned_t, afx) }, \ + { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_local_ned_t, afy) }, \ + { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_local_ned_t, afz) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_local_ned_t, yaw) }, \ + { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_local_ned_t, yaw_rate) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \ + } \ +} +#endif /** * @brief Pack a position_target_local_ned message @@ -72,52 +97,48 @@ typedef struct __mavlink_position_target_local_ned_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) + uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); + char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); #else - mavlink_position_target_local_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.coordinate_frame = coordinate_frame; + mavlink_position_target_local_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); } /** @@ -143,53 +164,49 @@ static inline uint16_t mavlink_msg_position_target_local_ned_pack(uint8_t system * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,float x,float y,float z,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,float x,float y,float z,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); + char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); #else - mavlink_position_target_local_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.coordinate_frame = coordinate_frame; + mavlink_position_target_local_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); } /** @@ -202,7 +219,7 @@ static inline uint16_t mavlink_msg_position_target_local_ned_pack_chan(uint8_t s */ static inline uint16_t mavlink_msg_position_target_local_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_local_ned_t* position_target_local_ned) { - return mavlink_msg_position_target_local_ned_pack(system_id, component_id, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate); + return mavlink_msg_position_target_local_ned_pack(system_id, component_id, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate); } /** @@ -216,7 +233,7 @@ static inline uint16_t mavlink_msg_position_target_local_ned_encode(uint8_t syst */ static inline uint16_t mavlink_msg_position_target_local_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_target_local_ned_t* position_target_local_ned) { - return mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate); + return mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate); } /** @@ -243,49 +260,55 @@ static inline uint16_t mavlink_msg_position_target_local_ned_encode_chan(uint8_t static inline void mavlink_msg_position_target_local_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); + char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); + mavlink_position_target_local_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); #endif +} + +/** + * @brief Send a position_target_local_ned message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_position_target_local_ned_send_struct(mavlink_channel_t chan, const mavlink_position_target_local_ned_t* position_target_local_ned) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_position_target_local_ned_send(chan, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate); #else - mavlink_position_target_local_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)position_target_local_ned, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); #endif } @@ -300,49 +323,41 @@ static inline void mavlink_msg_position_target_local_ned_send(mavlink_channel_t static inline void mavlink_msg_position_target_local_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); -#endif -#else - mavlink_position_target_local_ned_t *packet = (mavlink_position_target_local_ned_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->x = x; - packet->y = y; - packet->z = z; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->afx = afx; - packet->afy = afy; - packet->afz = afz; - packet->yaw = yaw; - packet->yaw_rate = yaw_rate; - packet->type_mask = type_mask; - packet->coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); -#endif + mavlink_position_target_local_ned_t *packet = (mavlink_position_target_local_ned_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->x = x; + packet->y = y; + packet->z = z; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->afx = afx; + packet->afy = afy; + packet->afz = afz; + packet->yaw = yaw; + packet->yaw_rate = yaw_rate; + packet->type_mask = type_mask; + packet->coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC); #endif } #endif @@ -359,7 +374,7 @@ static inline void mavlink_msg_position_target_local_ned_send_buf(mavlink_messag */ static inline uint32_t mavlink_msg_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -369,7 +384,7 @@ static inline uint32_t mavlink_msg_position_target_local_ned_get_time_boot_ms(co */ static inline uint8_t mavlink_msg_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 50); + return _MAV_RETURN_uint8_t(msg, 50); } /** @@ -379,7 +394,7 @@ static inline uint8_t mavlink_msg_position_target_local_ned_get_coordinate_frame */ static inline uint16_t mavlink_msg_position_target_local_ned_get_type_mask(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 48); + return _MAV_RETURN_uint16_t(msg, 48); } /** @@ -389,7 +404,7 @@ static inline uint16_t mavlink_msg_position_target_local_ned_get_type_mask(const */ static inline float mavlink_msg_position_target_local_ned_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -399,7 +414,7 @@ static inline float mavlink_msg_position_target_local_ned_get_x(const mavlink_me */ static inline float mavlink_msg_position_target_local_ned_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -409,7 +424,7 @@ static inline float mavlink_msg_position_target_local_ned_get_y(const mavlink_me */ static inline float mavlink_msg_position_target_local_ned_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -419,7 +434,7 @@ static inline float mavlink_msg_position_target_local_ned_get_z(const mavlink_me */ static inline float mavlink_msg_position_target_local_ned_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -429,7 +444,7 @@ static inline float mavlink_msg_position_target_local_ned_get_vx(const mavlink_m */ static inline float mavlink_msg_position_target_local_ned_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -439,7 +454,7 @@ static inline float mavlink_msg_position_target_local_ned_get_vy(const mavlink_m */ static inline float mavlink_msg_position_target_local_ned_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -449,7 +464,7 @@ static inline float mavlink_msg_position_target_local_ned_get_vz(const mavlink_m */ static inline float mavlink_msg_position_target_local_ned_get_afx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -459,7 +474,7 @@ static inline float mavlink_msg_position_target_local_ned_get_afx(const mavlink_ */ static inline float mavlink_msg_position_target_local_ned_get_afy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -469,7 +484,7 @@ static inline float mavlink_msg_position_target_local_ned_get_afy(const mavlink_ */ static inline float mavlink_msg_position_target_local_ned_get_afz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -479,7 +494,7 @@ static inline float mavlink_msg_position_target_local_ned_get_afz(const mavlink_ */ static inline float mavlink_msg_position_target_local_ned_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -489,7 +504,7 @@ static inline float mavlink_msg_position_target_local_ned_get_yaw(const mavlink_ */ static inline float mavlink_msg_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -500,22 +515,24 @@ static inline float mavlink_msg_position_target_local_ned_get_yaw_rate(const mav */ static inline void mavlink_msg_position_target_local_ned_decode(const mavlink_message_t* msg, mavlink_position_target_local_ned_t* position_target_local_ned) { -#if MAVLINK_NEED_BYTE_SWAP - position_target_local_ned->time_boot_ms = mavlink_msg_position_target_local_ned_get_time_boot_ms(msg); - position_target_local_ned->x = mavlink_msg_position_target_local_ned_get_x(msg); - position_target_local_ned->y = mavlink_msg_position_target_local_ned_get_y(msg); - position_target_local_ned->z = mavlink_msg_position_target_local_ned_get_z(msg); - position_target_local_ned->vx = mavlink_msg_position_target_local_ned_get_vx(msg); - position_target_local_ned->vy = mavlink_msg_position_target_local_ned_get_vy(msg); - position_target_local_ned->vz = mavlink_msg_position_target_local_ned_get_vz(msg); - position_target_local_ned->afx = mavlink_msg_position_target_local_ned_get_afx(msg); - position_target_local_ned->afy = mavlink_msg_position_target_local_ned_get_afy(msg); - position_target_local_ned->afz = mavlink_msg_position_target_local_ned_get_afz(msg); - position_target_local_ned->yaw = mavlink_msg_position_target_local_ned_get_yaw(msg); - position_target_local_ned->yaw_rate = mavlink_msg_position_target_local_ned_get_yaw_rate(msg); - position_target_local_ned->type_mask = mavlink_msg_position_target_local_ned_get_type_mask(msg); - position_target_local_ned->coordinate_frame = mavlink_msg_position_target_local_ned_get_coordinate_frame(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + position_target_local_ned->time_boot_ms = mavlink_msg_position_target_local_ned_get_time_boot_ms(msg); + position_target_local_ned->x = mavlink_msg_position_target_local_ned_get_x(msg); + position_target_local_ned->y = mavlink_msg_position_target_local_ned_get_y(msg); + position_target_local_ned->z = mavlink_msg_position_target_local_ned_get_z(msg); + position_target_local_ned->vx = mavlink_msg_position_target_local_ned_get_vx(msg); + position_target_local_ned->vy = mavlink_msg_position_target_local_ned_get_vy(msg); + position_target_local_ned->vz = mavlink_msg_position_target_local_ned_get_vz(msg); + position_target_local_ned->afx = mavlink_msg_position_target_local_ned_get_afx(msg); + position_target_local_ned->afy = mavlink_msg_position_target_local_ned_get_afy(msg); + position_target_local_ned->afz = mavlink_msg_position_target_local_ned_get_afz(msg); + position_target_local_ned->yaw = mavlink_msg_position_target_local_ned_get_yaw(msg); + position_target_local_ned->yaw_rate = mavlink_msg_position_target_local_ned_get_yaw_rate(msg); + position_target_local_ned->type_mask = mavlink_msg_position_target_local_ned_get_type_mask(msg); + position_target_local_ned->coordinate_frame = mavlink_msg_position_target_local_ned_get_coordinate_frame(msg); #else - memcpy(position_target_local_ned, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN; + memset(position_target_local_ned, 0, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN); + memcpy(position_target_local_ned, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_power_status.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_power_status.h index 52c937b..9cc3e61 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_power_status.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_power_status.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE POWER_STATUS PACKING #define MAVLINK_MSG_ID_POWER_STATUS 125 -typedef struct __mavlink_power_status_t -{ +MAVPACKED( +typedef struct __mavlink_power_status_t { uint16_t Vcc; /*< 5V rail voltage in millivolts*/ uint16_t Vservo; /*< servo rail voltage in millivolts*/ uint16_t flags; /*< power supply status flags (see MAV_POWER_STATUS enum)*/ -} mavlink_power_status_t; +}) mavlink_power_status_t; #define MAVLINK_MSG_ID_POWER_STATUS_LEN 6 +#define MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN 6 #define MAVLINK_MSG_ID_125_LEN 6 +#define MAVLINK_MSG_ID_125_MIN_LEN 6 #define MAVLINK_MSG_ID_POWER_STATUS_CRC 203 #define MAVLINK_MSG_ID_125_CRC 203 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_POWER_STATUS { \ - "POWER_STATUS", \ - 3, \ - { { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_power_status_t, Vcc) }, \ + 125, \ + "POWER_STATUS", \ + 3, \ + { { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_power_status_t, Vcc) }, \ { "Vservo", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_power_status_t, Vservo) }, \ { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_power_status_t, flags) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_POWER_STATUS { \ + "POWER_STATUS", \ + 3, \ + { { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_power_status_t, Vcc) }, \ + { "Vservo", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_power_status_t, Vservo) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_power_status_t, flags) }, \ + } \ +} +#endif /** * @brief Pack a power_status message @@ -39,30 +53,26 @@ typedef struct __mavlink_power_status_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_power_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint16_t Vcc, uint16_t Vservo, uint16_t flags) + uint16_t Vcc, uint16_t Vservo, uint16_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN]; - _mav_put_uint16_t(buf, 0, Vcc); - _mav_put_uint16_t(buf, 2, Vservo); - _mav_put_uint16_t(buf, 4, flags); + char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN]; + _mav_put_uint16_t(buf, 0, Vcc); + _mav_put_uint16_t(buf, 2, Vservo); + _mav_put_uint16_t(buf, 4, flags); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POWER_STATUS_LEN); #else - mavlink_power_status_t packet; - packet.Vcc = Vcc; - packet.Vservo = Vservo; - packet.flags = flags; + mavlink_power_status_t packet; + packet.Vcc = Vcc; + packet.Vservo = Vservo; + packet.flags = flags; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POWER_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_POWER_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POWER_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_POWER_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_power_status_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_power_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint16_t Vcc,uint16_t Vservo,uint16_t flags) + mavlink_message_t* msg, + uint16_t Vcc,uint16_t Vservo,uint16_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN]; - _mav_put_uint16_t(buf, 0, Vcc); - _mav_put_uint16_t(buf, 2, Vservo); - _mav_put_uint16_t(buf, 4, flags); + char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN]; + _mav_put_uint16_t(buf, 0, Vcc); + _mav_put_uint16_t(buf, 2, Vservo); + _mav_put_uint16_t(buf, 4, flags); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POWER_STATUS_LEN); #else - mavlink_power_status_t packet; - packet.Vcc = Vcc; - packet.Vservo = Vservo; - packet.flags = flags; + mavlink_power_status_t packet; + packet.Vcc = Vcc; + packet.Vservo = Vservo; + packet.flags = flags; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POWER_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_POWER_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POWER_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_POWER_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_power_status_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_power_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_power_status_t* power_status) { - return mavlink_msg_power_status_pack(system_id, component_id, msg, power_status->Vcc, power_status->Vservo, power_status->flags); + return mavlink_msg_power_status_pack(system_id, component_id, msg, power_status->Vcc, power_status->Vservo, power_status->flags); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_power_status_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_power_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_power_status_t* power_status) { - return mavlink_msg_power_status_pack_chan(system_id, component_id, chan, msg, power_status->Vcc, power_status->Vservo, power_status->flags); + return mavlink_msg_power_status_pack_chan(system_id, component_id, chan, msg, power_status->Vcc, power_status->Vservo, power_status->flags); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_power_status_encode_chan(uint8_t system_id, u static inline void mavlink_msg_power_status_send(mavlink_channel_t chan, uint16_t Vcc, uint16_t Vservo, uint16_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN]; - _mav_put_uint16_t(buf, 0, Vcc); - _mav_put_uint16_t(buf, 2, Vservo); - _mav_put_uint16_t(buf, 4, flags); + char buf[MAVLINK_MSG_ID_POWER_STATUS_LEN]; + _mav_put_uint16_t(buf, 0, Vcc); + _mav_put_uint16_t(buf, 2, Vservo); + _mav_put_uint16_t(buf, 4, flags); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_LEN); + mavlink_power_status_t packet; + packet.Vcc = Vcc; + packet.Vservo = Vservo; + packet.flags = flags; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)&packet, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); #endif -#else - mavlink_power_status_t packet; - packet.Vcc = Vcc; - packet.Vservo = Vservo; - packet.flags = flags; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)&packet, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); +/** + * @brief Send a power_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_power_status_send_struct(mavlink_channel_t chan, const mavlink_power_status_t* power_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_power_status_send(chan, power_status->Vcc, power_status->Vservo, power_status->flags); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)&packet, MAVLINK_MSG_ID_POWER_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)power_status, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_power_status_send(mavlink_channel_t chan, uint16_ static inline void mavlink_msg_power_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t Vcc, uint16_t Vservo, uint16_t flags) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, Vcc); - _mav_put_uint16_t(buf, 2, Vservo); - _mav_put_uint16_t(buf, 4, flags); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, Vcc); + _mav_put_uint16_t(buf, 2, Vservo); + _mav_put_uint16_t(buf, 4, flags); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, buf, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); #else - mavlink_power_status_t *packet = (mavlink_power_status_t *)msgbuf; - packet->Vcc = Vcc; - packet->Vservo = Vservo; - packet->flags = flags; + mavlink_power_status_t *packet = (mavlink_power_status_t *)msgbuf; + packet->Vcc = Vcc; + packet->Vservo = Vservo; + packet->flags = flags; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)packet, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)packet, MAVLINK_MSG_ID_POWER_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POWER_STATUS, (const char *)packet, MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN, MAVLINK_MSG_ID_POWER_STATUS_LEN, MAVLINK_MSG_ID_POWER_STATUS_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_power_status_send_buf(mavlink_message_t *msgbuf, */ static inline uint16_t mavlink_msg_power_status_get_Vcc(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -226,7 +230,7 @@ static inline uint16_t mavlink_msg_power_status_get_Vcc(const mavlink_message_t* */ static inline uint16_t mavlink_msg_power_status_get_Vservo(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 2); + return _MAV_RETURN_uint16_t(msg, 2); } /** @@ -236,7 +240,7 @@ static inline uint16_t mavlink_msg_power_status_get_Vservo(const mavlink_message */ static inline uint16_t mavlink_msg_power_status_get_flags(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -247,11 +251,13 @@ static inline uint16_t mavlink_msg_power_status_get_flags(const mavlink_message_ */ static inline void mavlink_msg_power_status_decode(const mavlink_message_t* msg, mavlink_power_status_t* power_status) { -#if MAVLINK_NEED_BYTE_SWAP - power_status->Vcc = mavlink_msg_power_status_get_Vcc(msg); - power_status->Vservo = mavlink_msg_power_status_get_Vservo(msg); - power_status->flags = mavlink_msg_power_status_get_flags(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + power_status->Vcc = mavlink_msg_power_status_get_Vcc(msg); + power_status->Vservo = mavlink_msg_power_status_get_Vservo(msg); + power_status->flags = mavlink_msg_power_status_get_flags(msg); #else - memcpy(power_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POWER_STATUS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_POWER_STATUS_LEN? msg->len : MAVLINK_MSG_ID_POWER_STATUS_LEN; + memset(power_status, 0, MAVLINK_MSG_ID_POWER_STATUS_LEN); + memcpy(power_status, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_radio_status.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_radio_status.h index b653fff..824223f 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_radio_status.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_radio_status.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE RADIO_STATUS PACKING #define MAVLINK_MSG_ID_RADIO_STATUS 109 -typedef struct __mavlink_radio_status_t -{ +MAVPACKED( +typedef struct __mavlink_radio_status_t { uint16_t rxerrors; /*< Receive errors*/ uint16_t fixed; /*< Count of error corrected packets*/ uint8_t rssi; /*< Local signal strength*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_radio_status_t uint8_t txbuf; /*< Remaining free buffer space in percent.*/ uint8_t noise; /*< Background noise level*/ uint8_t remnoise; /*< Remote background noise level*/ -} mavlink_radio_status_t; +}) mavlink_radio_status_t; #define MAVLINK_MSG_ID_RADIO_STATUS_LEN 9 +#define MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN 9 #define MAVLINK_MSG_ID_109_LEN 9 +#define MAVLINK_MSG_ID_109_MIN_LEN 9 #define MAVLINK_MSG_ID_RADIO_STATUS_CRC 185 #define MAVLINK_MSG_ID_109_CRC 185 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RADIO_STATUS { \ - "RADIO_STATUS", \ - 7, \ - { { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \ + 109, \ + "RADIO_STATUS", \ + 7, \ + { { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \ { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \ { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_status_t, remrssi) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_radio_status_t { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_status_t, remnoise) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RADIO_STATUS { \ + "RADIO_STATUS", \ + 7, \ + { { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \ + { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \ + { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \ + { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_status_t, remrssi) }, \ + { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_status_t, txbuf) }, \ + { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_status_t, noise) }, \ + { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_status_t, remnoise) }, \ + } \ +} +#endif /** * @brief Pack a radio_status message @@ -51,38 +69,34 @@ typedef struct __mavlink_radio_status_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) + uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN]; - _mav_put_uint16_t(buf, 0, rxerrors); - _mav_put_uint16_t(buf, 2, fixed); - _mav_put_uint8_t(buf, 4, rssi); - _mav_put_uint8_t(buf, 5, remrssi); - _mav_put_uint8_t(buf, 6, txbuf); - _mav_put_uint8_t(buf, 7, noise); - _mav_put_uint8_t(buf, 8, remnoise); + char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN]; + _mav_put_uint16_t(buf, 0, rxerrors); + _mav_put_uint16_t(buf, 2, fixed); + _mav_put_uint8_t(buf, 4, rssi); + _mav_put_uint8_t(buf, 5, remrssi); + _mav_put_uint8_t(buf, 6, txbuf); + _mav_put_uint8_t(buf, 7, noise); + _mav_put_uint8_t(buf, 8, remnoise); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN); #else - mavlink_radio_status_t packet; - packet.rxerrors = rxerrors; - packet.fixed = fixed; - packet.rssi = rssi; - packet.remrssi = remrssi; - packet.txbuf = txbuf; - packet.noise = noise; - packet.remnoise = remnoise; + mavlink_radio_status_t packet; + packet.rxerrors = rxerrors; + packet.fixed = fixed; + packet.rssi = rssi; + packet.remrssi = remrssi; + packet.txbuf = txbuf; + packet.noise = noise; + packet.remnoise = remnoise; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_radio_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed) + mavlink_message_t* msg, + uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN]; - _mav_put_uint16_t(buf, 0, rxerrors); - _mav_put_uint16_t(buf, 2, fixed); - _mav_put_uint8_t(buf, 4, rssi); - _mav_put_uint8_t(buf, 5, remrssi); - _mav_put_uint8_t(buf, 6, txbuf); - _mav_put_uint8_t(buf, 7, noise); - _mav_put_uint8_t(buf, 8, remnoise); + char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN]; + _mav_put_uint16_t(buf, 0, rxerrors); + _mav_put_uint16_t(buf, 2, fixed); + _mav_put_uint8_t(buf, 4, rssi); + _mav_put_uint8_t(buf, 5, remrssi); + _mav_put_uint8_t(buf, 6, txbuf); + _mav_put_uint8_t(buf, 7, noise); + _mav_put_uint8_t(buf, 8, remnoise); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN); #else - mavlink_radio_status_t packet; - packet.rxerrors = rxerrors; - packet.fixed = fixed; - packet.rssi = rssi; - packet.remrssi = remrssi; - packet.txbuf = txbuf; - packet.noise = noise; - packet.remnoise = remnoise; + mavlink_radio_status_t packet; + packet.rxerrors = rxerrors; + packet.fixed = fixed; + packet.rssi = rssi; + packet.remrssi = remrssi; + packet.txbuf = txbuf; + packet.noise = noise; + packet.remnoise = remnoise; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_radio_status_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_radio_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_status_t* radio_status) { - return mavlink_msg_radio_status_pack(system_id, component_id, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed); + return mavlink_msg_radio_status_pack(system_id, component_id, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_radio_status_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_radio_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_radio_status_t* radio_status) { - return mavlink_msg_radio_status_pack_chan(system_id, component_id, chan, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed); + return mavlink_msg_radio_status_pack_chan(system_id, component_id, chan, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_radio_status_encode_chan(uint8_t system_id, u static inline void mavlink_msg_radio_status_send(mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN]; - _mav_put_uint16_t(buf, 0, rxerrors); - _mav_put_uint16_t(buf, 2, fixed); - _mav_put_uint8_t(buf, 4, rssi); - _mav_put_uint8_t(buf, 5, remrssi); - _mav_put_uint8_t(buf, 6, txbuf); - _mav_put_uint8_t(buf, 7, noise); - _mav_put_uint8_t(buf, 8, remnoise); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); + char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN]; + _mav_put_uint16_t(buf, 0, rxerrors); + _mav_put_uint16_t(buf, 2, fixed); + _mav_put_uint8_t(buf, 4, rssi); + _mav_put_uint8_t(buf, 5, remrssi); + _mav_put_uint8_t(buf, 6, txbuf); + _mav_put_uint8_t(buf, 7, noise); + _mav_put_uint8_t(buf, 8, remnoise); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN); + mavlink_radio_status_t packet; + packet.rxerrors = rxerrors; + packet.fixed = fixed; + packet.rssi = rssi; + packet.remrssi = remrssi; + packet.txbuf = txbuf; + packet.noise = noise; + packet.remnoise = remnoise; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)&packet, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); #endif +} + +/** + * @brief Send a radio_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_radio_status_send_struct(mavlink_channel_t chan, const mavlink_radio_status_t* radio_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_radio_status_send(chan, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed); #else - mavlink_radio_status_t packet; - packet.rxerrors = rxerrors; - packet.fixed = fixed; - packet.rssi = rssi; - packet.remrssi = remrssi; - packet.txbuf = txbuf; - packet.noise = noise; - packet.remnoise = remnoise; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)&packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)&packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)radio_status, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_radio_status_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_radio_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, rxerrors); - _mav_put_uint16_t(buf, 2, fixed); - _mav_put_uint8_t(buf, 4, rssi); - _mav_put_uint8_t(buf, 5, remrssi); - _mav_put_uint8_t(buf, 6, txbuf); - _mav_put_uint8_t(buf, 7, noise); - _mav_put_uint8_t(buf, 8, remnoise); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN); -#endif -#else - mavlink_radio_status_t *packet = (mavlink_radio_status_t *)msgbuf; - packet->rxerrors = rxerrors; - packet->fixed = fixed; - packet->rssi = rssi; - packet->remrssi = remrssi; - packet->txbuf = txbuf; - packet->noise = noise; - packet->remnoise = remnoise; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, rxerrors); + _mav_put_uint16_t(buf, 2, fixed); + _mav_put_uint8_t(buf, 4, rssi); + _mav_put_uint8_t(buf, 5, remrssi); + _mav_put_uint8_t(buf, 6, txbuf); + _mav_put_uint8_t(buf, 7, noise); + _mav_put_uint8_t(buf, 8, remnoise); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN); -#endif + mavlink_radio_status_t *packet = (mavlink_radio_status_t *)msgbuf; + packet->rxerrors = rxerrors; + packet->fixed = fixed; + packet->rssi = rssi; + packet->remrssi = remrssi; + packet->txbuf = txbuf; + packet->noise = noise; + packet->remnoise = remnoise; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)packet, MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_radio_status_send_buf(mavlink_message_t *msgbuf, */ static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -278,7 +286,7 @@ static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t* */ static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -288,7 +296,7 @@ static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message */ static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 6); + return _MAV_RETURN_uint8_t(msg, 6); } /** @@ -298,7 +306,7 @@ static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t */ static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 7); + return _MAV_RETURN_uint8_t(msg, 7); } /** @@ -308,7 +316,7 @@ static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t */ static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 8); + return _MAV_RETURN_uint8_t(msg, 8); } /** @@ -318,7 +326,7 @@ static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_messag */ static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -328,7 +336,7 @@ static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_messa */ static inline uint16_t mavlink_msg_radio_status_get_fixed(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 2); + return _MAV_RETURN_uint16_t(msg, 2); } /** @@ -339,15 +347,17 @@ static inline uint16_t mavlink_msg_radio_status_get_fixed(const mavlink_message_ */ static inline void mavlink_msg_radio_status_decode(const mavlink_message_t* msg, mavlink_radio_status_t* radio_status) { -#if MAVLINK_NEED_BYTE_SWAP - radio_status->rxerrors = mavlink_msg_radio_status_get_rxerrors(msg); - radio_status->fixed = mavlink_msg_radio_status_get_fixed(msg); - radio_status->rssi = mavlink_msg_radio_status_get_rssi(msg); - radio_status->remrssi = mavlink_msg_radio_status_get_remrssi(msg); - radio_status->txbuf = mavlink_msg_radio_status_get_txbuf(msg); - radio_status->noise = mavlink_msg_radio_status_get_noise(msg); - radio_status->remnoise = mavlink_msg_radio_status_get_remnoise(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + radio_status->rxerrors = mavlink_msg_radio_status_get_rxerrors(msg); + radio_status->fixed = mavlink_msg_radio_status_get_fixed(msg); + radio_status->rssi = mavlink_msg_radio_status_get_rssi(msg); + radio_status->remrssi = mavlink_msg_radio_status_get_remrssi(msg); + radio_status->txbuf = mavlink_msg_radio_status_get_txbuf(msg); + radio_status->noise = mavlink_msg_radio_status_get_noise(msg); + radio_status->remnoise = mavlink_msg_radio_status_get_remnoise(msg); #else - memcpy(radio_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RADIO_STATUS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RADIO_STATUS_LEN? msg->len : MAVLINK_MSG_ID_RADIO_STATUS_LEN; + memset(radio_status, 0, MAVLINK_MSG_ID_RADIO_STATUS_LEN); + memcpy(radio_status, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_imu.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_imu.h index 577e3d3..463b571 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_imu.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_imu.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE RAW_IMU PACKING #define MAVLINK_MSG_ID_RAW_IMU 27 -typedef struct __mavlink_raw_imu_t -{ +MAVPACKED( +typedef struct __mavlink_raw_imu_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ int16_t xacc; /*< X acceleration (raw)*/ int16_t yacc; /*< Y acceleration (raw)*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_raw_imu_t int16_t xmag; /*< X Magnetic field (raw)*/ int16_t ymag; /*< Y Magnetic field (raw)*/ int16_t zmag; /*< Z Magnetic field (raw)*/ -} mavlink_raw_imu_t; +}) mavlink_raw_imu_t; #define MAVLINK_MSG_ID_RAW_IMU_LEN 26 +#define MAVLINK_MSG_ID_RAW_IMU_MIN_LEN 26 #define MAVLINK_MSG_ID_27_LEN 26 +#define MAVLINK_MSG_ID_27_MIN_LEN 26 #define MAVLINK_MSG_ID_RAW_IMU_CRC 144 #define MAVLINK_MSG_ID_27_CRC 144 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RAW_IMU { \ - "RAW_IMU", \ - 10, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_imu_t, time_usec) }, \ + 27, \ + "RAW_IMU", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_imu_t, time_usec) }, \ { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_imu_t, xacc) }, \ { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_imu_t, yacc) }, \ { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_imu_t, zacc) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_raw_imu_t { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_raw_imu_t, zmag) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RAW_IMU { \ + "RAW_IMU", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_imu_t, time_usec) }, \ + { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_imu_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_imu_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_imu_t, zacc) }, \ + { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_imu_t, xgyro) }, \ + { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_raw_imu_t, ygyro) }, \ + { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_raw_imu_t, zgyro) }, \ + { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_raw_imu_t, xmag) }, \ + { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_raw_imu_t, ymag) }, \ + { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_raw_imu_t, zmag) }, \ + } \ +} +#endif /** * @brief Pack a raw_imu message @@ -60,44 +81,40 @@ typedef struct __mavlink_raw_imu_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) + uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); + char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, xacc); + _mav_put_int16_t(buf, 10, yacc); + _mav_put_int16_t(buf, 12, zacc); + _mav_put_int16_t(buf, 14, xgyro); + _mav_put_int16_t(buf, 16, ygyro); + _mav_put_int16_t(buf, 18, zgyro); + _mav_put_int16_t(buf, 20, xmag); + _mav_put_int16_t(buf, 22, ymag); + _mav_put_int16_t(buf, 24, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_IMU_LEN); #else - mavlink_raw_imu_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_raw_imu_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_IMU_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RAW_IMU; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_IMU_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RAW_IMU; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) + mavlink_message_t* msg, + uint64_t time_usec,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); + char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, xacc); + _mav_put_int16_t(buf, 10, yacc); + _mav_put_int16_t(buf, 12, zacc); + _mav_put_int16_t(buf, 14, xgyro); + _mav_put_int16_t(buf, 16, ygyro); + _mav_put_int16_t(buf, 18, zgyro); + _mav_put_int16_t(buf, 20, xmag); + _mav_put_int16_t(buf, 22, ymag); + _mav_put_int16_t(buf, 24, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_IMU_LEN); #else - mavlink_raw_imu_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_raw_imu_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_IMU_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RAW_IMU; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_IMU_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RAW_IMU; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_raw_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_imu_t* raw_imu) { - return mavlink_msg_raw_imu_pack(system_id, component_id, msg, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag); + return mavlink_msg_raw_imu_pack(system_id, component_id, msg, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_raw_imu_encode(uint8_t system_id, uint8_t com */ static inline uint16_t mavlink_msg_raw_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_raw_imu_t* raw_imu) { - return mavlink_msg_raw_imu_pack_chan(system_id, component_id, chan, msg, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag); + return mavlink_msg_raw_imu_pack_chan(system_id, component_id, chan, msg, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_raw_imu_encode_chan(uint8_t system_id, uint8_ static inline void mavlink_msg_raw_imu_send(mavlink_channel_t chan, uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); + char buf[MAVLINK_MSG_ID_RAW_IMU_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, xacc); + _mav_put_int16_t(buf, 10, yacc); + _mav_put_int16_t(buf, 12, zacc); + _mav_put_int16_t(buf, 14, xgyro); + _mav_put_int16_t(buf, 16, ygyro); + _mav_put_int16_t(buf, 18, zgyro); + _mav_put_int16_t(buf, 20, xmag); + _mav_put_int16_t(buf, 22, ymag); + _mav_put_int16_t(buf, 24, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_LEN); + mavlink_raw_imu_t packet; + packet.time_usec = time_usec; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); #endif +} + +/** + * @brief Send a raw_imu message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_raw_imu_send_struct(mavlink_channel_t chan, const mavlink_raw_imu_t* raw_imu) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_raw_imu_send(chan, raw_imu->time_usec, raw_imu->xacc, raw_imu->yacc, raw_imu->zacc, raw_imu->xgyro, raw_imu->ygyro, raw_imu->zgyro, raw_imu->xmag, raw_imu->ymag, raw_imu->zmag); #else - mavlink_raw_imu_t packet; - packet.time_usec = time_usec; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)&packet, MAVLINK_MSG_ID_RAW_IMU_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)raw_imu, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_raw_imu_send(mavlink_channel_t chan, uint64_t tim static inline void mavlink_msg_raw_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, xacc); - _mav_put_int16_t(buf, 10, yacc); - _mav_put_int16_t(buf, 12, zacc); - _mav_put_int16_t(buf, 14, xgyro); - _mav_put_int16_t(buf, 16, ygyro); - _mav_put_int16_t(buf, 18, zgyro); - _mav_put_int16_t(buf, 20, xmag); - _mav_put_int16_t(buf, 22, ymag); - _mav_put_int16_t(buf, 24, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_LEN); -#endif -#else - mavlink_raw_imu_t *packet = (mavlink_raw_imu_t *)msgbuf; - packet->time_usec = time_usec; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - packet->xgyro = xgyro; - packet->ygyro = ygyro; - packet->zgyro = zgyro; - packet->xmag = xmag; - packet->ymag = ymag; - packet->zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)packet, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, xacc); + _mav_put_int16_t(buf, 10, yacc); + _mav_put_int16_t(buf, 12, zacc); + _mav_put_int16_t(buf, 14, xgyro); + _mav_put_int16_t(buf, 16, ygyro); + _mav_put_int16_t(buf, 18, zgyro); + _mav_put_int16_t(buf, 20, xmag); + _mav_put_int16_t(buf, 22, ymag); + _mav_put_int16_t(buf, 24, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, buf, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)packet, MAVLINK_MSG_ID_RAW_IMU_LEN); -#endif + mavlink_raw_imu_t *packet = (mavlink_raw_imu_t *)msgbuf; + packet->time_usec = time_usec; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + packet->xgyro = xgyro; + packet->ygyro = ygyro; + packet->zgyro = zgyro; + packet->xmag = xmag; + packet->ymag = ymag; + packet->zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_IMU, (const char *)packet, MAVLINK_MSG_ID_RAW_IMU_MIN_LEN, MAVLINK_MSG_ID_RAW_IMU_LEN, MAVLINK_MSG_ID_RAW_IMU_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_raw_imu_send_buf(mavlink_message_t *msgbuf, mavli */ static inline uint64_t mavlink_msg_raw_imu_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -317,7 +328,7 @@ static inline uint64_t mavlink_msg_raw_imu_get_time_usec(const mavlink_message_t */ static inline int16_t mavlink_msg_raw_imu_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 8); + return _MAV_RETURN_int16_t(msg, 8); } /** @@ -327,7 +338,7 @@ static inline int16_t mavlink_msg_raw_imu_get_xacc(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_raw_imu_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 10); + return _MAV_RETURN_int16_t(msg, 10); } /** @@ -337,7 +348,7 @@ static inline int16_t mavlink_msg_raw_imu_get_yacc(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_raw_imu_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -347,7 +358,7 @@ static inline int16_t mavlink_msg_raw_imu_get_zacc(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_raw_imu_get_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 14); + return _MAV_RETURN_int16_t(msg, 14); } /** @@ -357,7 +368,7 @@ static inline int16_t mavlink_msg_raw_imu_get_xgyro(const mavlink_message_t* msg */ static inline int16_t mavlink_msg_raw_imu_get_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -367,7 +378,7 @@ static inline int16_t mavlink_msg_raw_imu_get_ygyro(const mavlink_message_t* msg */ static inline int16_t mavlink_msg_raw_imu_get_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 18); + return _MAV_RETURN_int16_t(msg, 18); } /** @@ -377,7 +388,7 @@ static inline int16_t mavlink_msg_raw_imu_get_zgyro(const mavlink_message_t* msg */ static inline int16_t mavlink_msg_raw_imu_get_xmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -387,7 +398,7 @@ static inline int16_t mavlink_msg_raw_imu_get_xmag(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_raw_imu_get_ymag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 22); + return _MAV_RETURN_int16_t(msg, 22); } /** @@ -397,7 +408,7 @@ static inline int16_t mavlink_msg_raw_imu_get_ymag(const mavlink_message_t* msg) */ static inline int16_t mavlink_msg_raw_imu_get_zmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 24); + return _MAV_RETURN_int16_t(msg, 24); } /** @@ -408,18 +419,20 @@ static inline int16_t mavlink_msg_raw_imu_get_zmag(const mavlink_message_t* msg) */ static inline void mavlink_msg_raw_imu_decode(const mavlink_message_t* msg, mavlink_raw_imu_t* raw_imu) { -#if MAVLINK_NEED_BYTE_SWAP - raw_imu->time_usec = mavlink_msg_raw_imu_get_time_usec(msg); - raw_imu->xacc = mavlink_msg_raw_imu_get_xacc(msg); - raw_imu->yacc = mavlink_msg_raw_imu_get_yacc(msg); - raw_imu->zacc = mavlink_msg_raw_imu_get_zacc(msg); - raw_imu->xgyro = mavlink_msg_raw_imu_get_xgyro(msg); - raw_imu->ygyro = mavlink_msg_raw_imu_get_ygyro(msg); - raw_imu->zgyro = mavlink_msg_raw_imu_get_zgyro(msg); - raw_imu->xmag = mavlink_msg_raw_imu_get_xmag(msg); - raw_imu->ymag = mavlink_msg_raw_imu_get_ymag(msg); - raw_imu->zmag = mavlink_msg_raw_imu_get_zmag(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + raw_imu->time_usec = mavlink_msg_raw_imu_get_time_usec(msg); + raw_imu->xacc = mavlink_msg_raw_imu_get_xacc(msg); + raw_imu->yacc = mavlink_msg_raw_imu_get_yacc(msg); + raw_imu->zacc = mavlink_msg_raw_imu_get_zacc(msg); + raw_imu->xgyro = mavlink_msg_raw_imu_get_xgyro(msg); + raw_imu->ygyro = mavlink_msg_raw_imu_get_ygyro(msg); + raw_imu->zgyro = mavlink_msg_raw_imu_get_zgyro(msg); + raw_imu->xmag = mavlink_msg_raw_imu_get_xmag(msg); + raw_imu->ymag = mavlink_msg_raw_imu_get_ymag(msg); + raw_imu->zmag = mavlink_msg_raw_imu_get_zmag(msg); #else - memcpy(raw_imu, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RAW_IMU_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RAW_IMU_LEN? msg->len : MAVLINK_MSG_ID_RAW_IMU_LEN; + memset(raw_imu, 0, MAVLINK_MSG_ID_RAW_IMU_LEN); + memcpy(raw_imu, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_pressure.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_pressure.h index 859defa..a6c4129 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_pressure.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_raw_pressure.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE RAW_PRESSURE PACKING #define MAVLINK_MSG_ID_RAW_PRESSURE 28 -typedef struct __mavlink_raw_pressure_t -{ +MAVPACKED( +typedef struct __mavlink_raw_pressure_t { uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/ int16_t press_abs; /*< Absolute pressure (raw)*/ int16_t press_diff1; /*< Differential pressure 1 (raw, 0 if nonexistant)*/ int16_t press_diff2; /*< Differential pressure 2 (raw, 0 if nonexistant)*/ int16_t temperature; /*< Raw Temperature measurement (raw)*/ -} mavlink_raw_pressure_t; +}) mavlink_raw_pressure_t; #define MAVLINK_MSG_ID_RAW_PRESSURE_LEN 16 +#define MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN 16 #define MAVLINK_MSG_ID_28_LEN 16 +#define MAVLINK_MSG_ID_28_MIN_LEN 16 #define MAVLINK_MSG_ID_RAW_PRESSURE_CRC 67 #define MAVLINK_MSG_ID_28_CRC 67 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RAW_PRESSURE { \ - "RAW_PRESSURE", \ - 5, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_pressure_t, time_usec) }, \ + 28, \ + "RAW_PRESSURE", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_pressure_t, time_usec) }, \ { "press_abs", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_pressure_t, press_abs) }, \ { "press_diff1", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_pressure_t, press_diff1) }, \ { "press_diff2", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_pressure_t, press_diff2) }, \ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_pressure_t, temperature) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RAW_PRESSURE { \ + "RAW_PRESSURE", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_raw_pressure_t, time_usec) }, \ + { "press_abs", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_raw_pressure_t, press_abs) }, \ + { "press_diff1", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_raw_pressure_t, press_diff1) }, \ + { "press_diff2", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_raw_pressure_t, press_diff2) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_pressure_t, temperature) }, \ + } \ +} +#endif /** * @brief Pack a raw_pressure message @@ -45,34 +61,30 @@ typedef struct __mavlink_raw_pressure_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) + uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, press_abs); - _mav_put_int16_t(buf, 10, press_diff1); - _mav_put_int16_t(buf, 12, press_diff2); - _mav_put_int16_t(buf, 14, temperature); + char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, press_abs); + _mav_put_int16_t(buf, 10, press_diff1); + _mav_put_int16_t(buf, 12, press_diff2); + _mav_put_int16_t(buf, 14, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #else - mavlink_raw_pressure_t packet; - packet.time_usec = time_usec; - packet.press_abs = press_abs; - packet.press_diff1 = press_diff1; - packet.press_diff2 = press_diff2; - packet.temperature = temperature; + mavlink_raw_pressure_t packet; + packet.time_usec = time_usec; + packet.press_abs = press_abs; + packet.press_diff1 = press_diff1; + packet.press_diff2 = press_diff2; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); } /** @@ -89,35 +101,31 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,int16_t press_abs,int16_t press_diff1,int16_t press_diff2,int16_t temperature) + mavlink_message_t* msg, + uint64_t time_usec,int16_t press_abs,int16_t press_diff1,int16_t press_diff2,int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, press_abs); - _mav_put_int16_t(buf, 10, press_diff1); - _mav_put_int16_t(buf, 12, press_diff2); - _mav_put_int16_t(buf, 14, temperature); + char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, press_abs); + _mav_put_int16_t(buf, 10, press_diff1); + _mav_put_int16_t(buf, 12, press_diff2); + _mav_put_int16_t(buf, 14, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #else - mavlink_raw_pressure_t packet; - packet.time_usec = time_usec; - packet.press_abs = press_abs; - packet.press_diff1 = press_diff1; - packet.press_diff2 = press_diff2; - packet.temperature = temperature; + mavlink_raw_pressure_t packet; + packet.time_usec = time_usec; + packet.press_abs = press_abs; + packet.press_diff1 = press_diff1; + packet.press_diff2 = press_diff2; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); } /** @@ -130,7 +138,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_raw_pressure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_pressure_t* raw_pressure) { - return mavlink_msg_raw_pressure_pack(system_id, component_id, msg, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature); + return mavlink_msg_raw_pressure_pack(system_id, component_id, msg, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature); } /** @@ -144,7 +152,7 @@ static inline uint16_t mavlink_msg_raw_pressure_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_raw_pressure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_raw_pressure_t* raw_pressure) { - return mavlink_msg_raw_pressure_pack_chan(system_id, component_id, chan, msg, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature); + return mavlink_msg_raw_pressure_pack_chan(system_id, component_id, chan, msg, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature); } /** @@ -162,31 +170,37 @@ static inline uint16_t mavlink_msg_raw_pressure_encode_chan(uint8_t system_id, u static inline void mavlink_msg_raw_pressure_send(mavlink_channel_t chan, uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, press_abs); - _mav_put_int16_t(buf, 10, press_diff1); - _mav_put_int16_t(buf, 12, press_diff2); - _mav_put_int16_t(buf, 14, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); + char buf[MAVLINK_MSG_ID_RAW_PRESSURE_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, press_abs); + _mav_put_int16_t(buf, 10, press_diff1); + _mav_put_int16_t(buf, 12, press_diff2); + _mav_put_int16_t(buf, 14, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); + mavlink_raw_pressure_t packet; + packet.time_usec = time_usec; + packet.press_abs = press_abs; + packet.press_diff1 = press_diff1; + packet.press_diff2 = press_diff2; + packet.temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); #endif +} + +/** + * @brief Send a raw_pressure message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_raw_pressure_send_struct(mavlink_channel_t chan, const mavlink_raw_pressure_t* raw_pressure) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_raw_pressure_send(chan, raw_pressure->time_usec, raw_pressure->press_abs, raw_pressure->press_diff1, raw_pressure->press_diff2, raw_pressure->temperature); #else - mavlink_raw_pressure_t packet; - packet.time_usec = time_usec; - packet.press_abs = press_abs; - packet.press_diff1 = press_diff1; - packet.press_diff2 = press_diff2; - packet.temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)raw_pressure, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); #endif } @@ -201,31 +215,23 @@ static inline void mavlink_msg_raw_pressure_send(mavlink_channel_t chan, uint64_ static inline void mavlink_msg_raw_pressure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, int16_t press_abs, int16_t press_diff1, int16_t press_diff2, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_int16_t(buf, 8, press_abs); - _mav_put_int16_t(buf, 10, press_diff1); - _mav_put_int16_t(buf, 12, press_diff2); - _mav_put_int16_t(buf, 14, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_int16_t(buf, 8, press_abs); + _mav_put_int16_t(buf, 10, press_diff1); + _mav_put_int16_t(buf, 12, press_diff2); + _mav_put_int16_t(buf, 14, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, buf, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); -#endif -#else - mavlink_raw_pressure_t *packet = (mavlink_raw_pressure_t *)msgbuf; - packet->time_usec = time_usec; - packet->press_abs = press_abs; - packet->press_diff1 = press_diff1; - packet->press_diff2 = press_diff2; - packet->temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); -#endif + mavlink_raw_pressure_t *packet = (mavlink_raw_pressure_t *)msgbuf; + packet->time_usec = time_usec; + packet->press_abs = press_abs; + packet->press_diff1 = press_diff1; + packet->press_diff2 = press_diff2; + packet->temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_LEN, MAVLINK_MSG_ID_RAW_PRESSURE_CRC); #endif } #endif @@ -242,7 +248,7 @@ static inline void mavlink_msg_raw_pressure_send_buf(mavlink_message_t *msgbuf, */ static inline uint64_t mavlink_msg_raw_pressure_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -252,7 +258,7 @@ static inline uint64_t mavlink_msg_raw_pressure_get_time_usec(const mavlink_mess */ static inline int16_t mavlink_msg_raw_pressure_get_press_abs(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 8); + return _MAV_RETURN_int16_t(msg, 8); } /** @@ -262,7 +268,7 @@ static inline int16_t mavlink_msg_raw_pressure_get_press_abs(const mavlink_messa */ static inline int16_t mavlink_msg_raw_pressure_get_press_diff1(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 10); + return _MAV_RETURN_int16_t(msg, 10); } /** @@ -272,7 +278,7 @@ static inline int16_t mavlink_msg_raw_pressure_get_press_diff1(const mavlink_mes */ static inline int16_t mavlink_msg_raw_pressure_get_press_diff2(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -282,7 +288,7 @@ static inline int16_t mavlink_msg_raw_pressure_get_press_diff2(const mavlink_mes */ static inline int16_t mavlink_msg_raw_pressure_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 14); + return _MAV_RETURN_int16_t(msg, 14); } /** @@ -293,13 +299,15 @@ static inline int16_t mavlink_msg_raw_pressure_get_temperature(const mavlink_mes */ static inline void mavlink_msg_raw_pressure_decode(const mavlink_message_t* msg, mavlink_raw_pressure_t* raw_pressure) { -#if MAVLINK_NEED_BYTE_SWAP - raw_pressure->time_usec = mavlink_msg_raw_pressure_get_time_usec(msg); - raw_pressure->press_abs = mavlink_msg_raw_pressure_get_press_abs(msg); - raw_pressure->press_diff1 = mavlink_msg_raw_pressure_get_press_diff1(msg); - raw_pressure->press_diff2 = mavlink_msg_raw_pressure_get_press_diff2(msg); - raw_pressure->temperature = mavlink_msg_raw_pressure_get_temperature(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + raw_pressure->time_usec = mavlink_msg_raw_pressure_get_time_usec(msg); + raw_pressure->press_abs = mavlink_msg_raw_pressure_get_press_abs(msg); + raw_pressure->press_diff1 = mavlink_msg_raw_pressure_get_press_diff1(msg); + raw_pressure->press_diff2 = mavlink_msg_raw_pressure_get_press_diff2(msg); + raw_pressure->temperature = mavlink_msg_raw_pressure_get_temperature(msg); #else - memcpy(raw_pressure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RAW_PRESSURE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RAW_PRESSURE_LEN? msg->len : MAVLINK_MSG_ID_RAW_PRESSURE_LEN; + memset(raw_pressure, 0, MAVLINK_MSG_ID_RAW_PRESSURE_LEN); + memcpy(raw_pressure, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels.h index a309bea..c7fbe58 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE RC_CHANNELS PACKING #define MAVLINK_MSG_ID_RC_CHANNELS 65 -typedef struct __mavlink_rc_channels_t -{ +MAVPACKED( +typedef struct __mavlink_rc_channels_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ @@ -25,20 +26,24 @@ typedef struct __mavlink_rc_channels_t uint16_t chan18_raw; /*< RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ uint8_t chancount; /*< Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.*/ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/ -} mavlink_rc_channels_t; +}) mavlink_rc_channels_t; #define MAVLINK_MSG_ID_RC_CHANNELS_LEN 42 +#define MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN 42 #define MAVLINK_MSG_ID_65_LEN 42 +#define MAVLINK_MSG_ID_65_MIN_LEN 42 #define MAVLINK_MSG_ID_RC_CHANNELS_CRC 118 #define MAVLINK_MSG_ID_65_CRC 118 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RC_CHANNELS { \ - "RC_CHANNELS", \ - 21, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \ + 65, \ + "RC_CHANNELS", \ + 21, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \ { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \ @@ -61,7 +66,34 @@ typedef struct __mavlink_rc_channels_t { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RC_CHANNELS { \ + "RC_CHANNELS", \ + 21, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \ + { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \ + { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \ + { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \ + { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_t, chan4_raw) }, \ + { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_t, chan5_raw) }, \ + { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_t, chan6_raw) }, \ + { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_t, chan7_raw) }, \ + { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_t, chan8_raw) }, \ + { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_rc_channels_t, chan9_raw) }, \ + { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_rc_channels_t, chan10_raw) }, \ + { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_rc_channels_t, chan11_raw) }, \ + { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_rc_channels_t, chan12_raw) }, \ + { "chan13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_rc_channels_t, chan13_raw) }, \ + { "chan14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_rc_channels_t, chan14_raw) }, \ + { "chan15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_rc_channels_t, chan15_raw) }, \ + { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_t, chan16_raw) }, \ + { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_t, chan17_raw) }, \ + { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_rc_channels_t, chan18_raw) }, \ + { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \ + { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \ + } \ +} +#endif /** * @brief Pack a rc_channels message @@ -93,66 +125,62 @@ typedef struct __mavlink_rc_channels_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t chancount, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi) + uint32_t time_boot_ms, uint8_t chancount, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint16_t(buf, 20, chan9_raw); - _mav_put_uint16_t(buf, 22, chan10_raw); - _mav_put_uint16_t(buf, 24, chan11_raw); - _mav_put_uint16_t(buf, 26, chan12_raw); - _mav_put_uint16_t(buf, 28, chan13_raw); - _mav_put_uint16_t(buf, 30, chan14_raw); - _mav_put_uint16_t(buf, 32, chan15_raw); - _mav_put_uint16_t(buf, 34, chan16_raw); - _mav_put_uint16_t(buf, 36, chan17_raw); - _mav_put_uint16_t(buf, 38, chan18_raw); - _mav_put_uint8_t(buf, 40, chancount); - _mav_put_uint8_t(buf, 41, rssi); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint16_t(buf, 20, chan9_raw); + _mav_put_uint16_t(buf, 22, chan10_raw); + _mav_put_uint16_t(buf, 24, chan11_raw); + _mav_put_uint16_t(buf, 26, chan12_raw); + _mav_put_uint16_t(buf, 28, chan13_raw); + _mav_put_uint16_t(buf, 30, chan14_raw); + _mav_put_uint16_t(buf, 32, chan15_raw); + _mav_put_uint16_t(buf, 34, chan16_raw); + _mav_put_uint16_t(buf, 36, chan17_raw); + _mav_put_uint16_t(buf, 38, chan18_raw); + _mav_put_uint8_t(buf, 40, chancount); + _mav_put_uint8_t(buf, 41, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN); #else - mavlink_rc_channels_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.chan9_raw = chan9_raw; - packet.chan10_raw = chan10_raw; - packet.chan11_raw = chan11_raw; - packet.chan12_raw = chan12_raw; - packet.chan13_raw = chan13_raw; - packet.chan14_raw = chan14_raw; - packet.chan15_raw = chan15_raw; - packet.chan16_raw = chan16_raw; - packet.chan17_raw = chan17_raw; - packet.chan18_raw = chan18_raw; - packet.chancount = chancount; - packet.rssi = rssi; + mavlink_rc_channels_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.chan9_raw = chan9_raw; + packet.chan10_raw = chan10_raw; + packet.chan11_raw = chan11_raw; + packet.chan12_raw = chan12_raw; + packet.chan13_raw = chan13_raw; + packet.chan14_raw = chan14_raw; + packet.chan15_raw = chan15_raw; + packet.chan16_raw = chan16_raw; + packet.chan17_raw = chan17_raw; + packet.chan18_raw = chan18_raw; + packet.chancount = chancount; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); } /** @@ -185,67 +213,63 @@ static inline uint16_t mavlink_msg_rc_channels_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t chancount,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint16_t chan13_raw,uint16_t chan14_raw,uint16_t chan15_raw,uint16_t chan16_raw,uint16_t chan17_raw,uint16_t chan18_raw,uint8_t rssi) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t chancount,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint16_t chan13_raw,uint16_t chan14_raw,uint16_t chan15_raw,uint16_t chan16_raw,uint16_t chan17_raw,uint16_t chan18_raw,uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint16_t(buf, 20, chan9_raw); - _mav_put_uint16_t(buf, 22, chan10_raw); - _mav_put_uint16_t(buf, 24, chan11_raw); - _mav_put_uint16_t(buf, 26, chan12_raw); - _mav_put_uint16_t(buf, 28, chan13_raw); - _mav_put_uint16_t(buf, 30, chan14_raw); - _mav_put_uint16_t(buf, 32, chan15_raw); - _mav_put_uint16_t(buf, 34, chan16_raw); - _mav_put_uint16_t(buf, 36, chan17_raw); - _mav_put_uint16_t(buf, 38, chan18_raw); - _mav_put_uint8_t(buf, 40, chancount); - _mav_put_uint8_t(buf, 41, rssi); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint16_t(buf, 20, chan9_raw); + _mav_put_uint16_t(buf, 22, chan10_raw); + _mav_put_uint16_t(buf, 24, chan11_raw); + _mav_put_uint16_t(buf, 26, chan12_raw); + _mav_put_uint16_t(buf, 28, chan13_raw); + _mav_put_uint16_t(buf, 30, chan14_raw); + _mav_put_uint16_t(buf, 32, chan15_raw); + _mav_put_uint16_t(buf, 34, chan16_raw); + _mav_put_uint16_t(buf, 36, chan17_raw); + _mav_put_uint16_t(buf, 38, chan18_raw); + _mav_put_uint8_t(buf, 40, chancount); + _mav_put_uint8_t(buf, 41, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN); #else - mavlink_rc_channels_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.chan9_raw = chan9_raw; - packet.chan10_raw = chan10_raw; - packet.chan11_raw = chan11_raw; - packet.chan12_raw = chan12_raw; - packet.chan13_raw = chan13_raw; - packet.chan14_raw = chan14_raw; - packet.chan15_raw = chan15_raw; - packet.chan16_raw = chan16_raw; - packet.chan17_raw = chan17_raw; - packet.chan18_raw = chan18_raw; - packet.chancount = chancount; - packet.rssi = rssi; + mavlink_rc_channels_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.chan9_raw = chan9_raw; + packet.chan10_raw = chan10_raw; + packet.chan11_raw = chan11_raw; + packet.chan12_raw = chan12_raw; + packet.chan13_raw = chan13_raw; + packet.chan14_raw = chan14_raw; + packet.chan15_raw = chan15_raw; + packet.chan16_raw = chan16_raw; + packet.chan17_raw = chan17_raw; + packet.chan18_raw = chan18_raw; + packet.chancount = chancount; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); } /** @@ -258,7 +282,7 @@ static inline uint16_t mavlink_msg_rc_channels_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_rc_channels_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_t* rc_channels) { - return mavlink_msg_rc_channels_pack(system_id, component_id, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi); + return mavlink_msg_rc_channels_pack(system_id, component_id, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi); } /** @@ -272,7 +296,7 @@ static inline uint16_t mavlink_msg_rc_channels_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_rc_channels_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_t* rc_channels) { - return mavlink_msg_rc_channels_pack_chan(system_id, component_id, chan, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi); + return mavlink_msg_rc_channels_pack_chan(system_id, component_id, chan, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi); } /** @@ -306,63 +330,69 @@ static inline uint16_t mavlink_msg_rc_channels_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_rc_channels_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t chancount, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint16_t(buf, 20, chan9_raw); - _mav_put_uint16_t(buf, 22, chan10_raw); - _mav_put_uint16_t(buf, 24, chan11_raw); - _mav_put_uint16_t(buf, 26, chan12_raw); - _mav_put_uint16_t(buf, 28, chan13_raw); - _mav_put_uint16_t(buf, 30, chan14_raw); - _mav_put_uint16_t(buf, 32, chan15_raw); - _mav_put_uint16_t(buf, 34, chan16_raw); - _mav_put_uint16_t(buf, 36, chan17_raw); - _mav_put_uint16_t(buf, 38, chan18_raw); - _mav_put_uint8_t(buf, 40, chancount); - _mav_put_uint8_t(buf, 41, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint16_t(buf, 20, chan9_raw); + _mav_put_uint16_t(buf, 22, chan10_raw); + _mav_put_uint16_t(buf, 24, chan11_raw); + _mav_put_uint16_t(buf, 26, chan12_raw); + _mav_put_uint16_t(buf, 28, chan13_raw); + _mav_put_uint16_t(buf, 30, chan14_raw); + _mav_put_uint16_t(buf, 32, chan15_raw); + _mav_put_uint16_t(buf, 34, chan16_raw); + _mav_put_uint16_t(buf, 36, chan17_raw); + _mav_put_uint16_t(buf, 38, chan18_raw); + _mav_put_uint8_t(buf, 40, chancount); + _mav_put_uint8_t(buf, 41, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN); + mavlink_rc_channels_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.chan9_raw = chan9_raw; + packet.chan10_raw = chan10_raw; + packet.chan11_raw = chan11_raw; + packet.chan12_raw = chan12_raw; + packet.chan13_raw = chan13_raw; + packet.chan14_raw = chan14_raw; + packet.chan15_raw = chan15_raw; + packet.chan16_raw = chan16_raw; + packet.chan17_raw = chan17_raw; + packet.chan18_raw = chan18_raw; + packet.chancount = chancount; + packet.rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); #endif +} + +/** + * @brief Send a rc_channels message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_rc_channels_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_t* rc_channels) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_rc_channels_send(chan, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi); #else - mavlink_rc_channels_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.chan9_raw = chan9_raw; - packet.chan10_raw = chan10_raw; - packet.chan11_raw = chan11_raw; - packet.chan12_raw = chan12_raw; - packet.chan13_raw = chan13_raw; - packet.chan14_raw = chan14_raw; - packet.chan15_raw = chan15_raw; - packet.chan16_raw = chan16_raw; - packet.chan17_raw = chan17_raw; - packet.chan18_raw = chan18_raw; - packet.chancount = chancount; - packet.rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)rc_channels, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); #endif } @@ -377,63 +407,55 @@ static inline void mavlink_msg_rc_channels_send(mavlink_channel_t chan, uint32_t static inline void mavlink_msg_rc_channels_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t chancount, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint16_t(buf, 20, chan9_raw); - _mav_put_uint16_t(buf, 22, chan10_raw); - _mav_put_uint16_t(buf, 24, chan11_raw); - _mav_put_uint16_t(buf, 26, chan12_raw); - _mav_put_uint16_t(buf, 28, chan13_raw); - _mav_put_uint16_t(buf, 30, chan14_raw); - _mav_put_uint16_t(buf, 32, chan15_raw); - _mav_put_uint16_t(buf, 34, chan16_raw); - _mav_put_uint16_t(buf, 36, chan17_raw); - _mav_put_uint16_t(buf, 38, chan18_raw); - _mav_put_uint8_t(buf, 40, chancount); - _mav_put_uint8_t(buf, 41, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint16_t(buf, 20, chan9_raw); + _mav_put_uint16_t(buf, 22, chan10_raw); + _mav_put_uint16_t(buf, 24, chan11_raw); + _mav_put_uint16_t(buf, 26, chan12_raw); + _mav_put_uint16_t(buf, 28, chan13_raw); + _mav_put_uint16_t(buf, 30, chan14_raw); + _mav_put_uint16_t(buf, 32, chan15_raw); + _mav_put_uint16_t(buf, 34, chan16_raw); + _mav_put_uint16_t(buf, 36, chan17_raw); + _mav_put_uint16_t(buf, 38, chan18_raw); + _mav_put_uint8_t(buf, 40, chancount); + _mav_put_uint8_t(buf, 41, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN); -#endif -#else - mavlink_rc_channels_t *packet = (mavlink_rc_channels_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->chan1_raw = chan1_raw; - packet->chan2_raw = chan2_raw; - packet->chan3_raw = chan3_raw; - packet->chan4_raw = chan4_raw; - packet->chan5_raw = chan5_raw; - packet->chan6_raw = chan6_raw; - packet->chan7_raw = chan7_raw; - packet->chan8_raw = chan8_raw; - packet->chan9_raw = chan9_raw; - packet->chan10_raw = chan10_raw; - packet->chan11_raw = chan11_raw; - packet->chan12_raw = chan12_raw; - packet->chan13_raw = chan13_raw; - packet->chan14_raw = chan14_raw; - packet->chan15_raw = chan15_raw; - packet->chan16_raw = chan16_raw; - packet->chan17_raw = chan17_raw; - packet->chan18_raw = chan18_raw; - packet->chancount = chancount; - packet->rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN); -#endif + mavlink_rc_channels_t *packet = (mavlink_rc_channels_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->chan1_raw = chan1_raw; + packet->chan2_raw = chan2_raw; + packet->chan3_raw = chan3_raw; + packet->chan4_raw = chan4_raw; + packet->chan5_raw = chan5_raw; + packet->chan6_raw = chan6_raw; + packet->chan7_raw = chan7_raw; + packet->chan8_raw = chan8_raw; + packet->chan9_raw = chan9_raw; + packet->chan10_raw = chan10_raw; + packet->chan11_raw = chan11_raw; + packet->chan12_raw = chan12_raw; + packet->chan13_raw = chan13_raw; + packet->chan14_raw = chan14_raw; + packet->chan15_raw = chan15_raw; + packet->chan16_raw = chan16_raw; + packet->chan17_raw = chan17_raw; + packet->chan18_raw = chan18_raw; + packet->chancount = chancount; + packet->rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC); #endif } #endif @@ -450,7 +472,7 @@ static inline void mavlink_msg_rc_channels_send_buf(mavlink_message_t *msgbuf, m */ static inline uint32_t mavlink_msg_rc_channels_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -460,7 +482,7 @@ static inline uint32_t mavlink_msg_rc_channels_get_time_boot_ms(const mavlink_me */ static inline uint8_t mavlink_msg_rc_channels_get_chancount(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 40); + return _MAV_RETURN_uint8_t(msg, 40); } /** @@ -470,7 +492,7 @@ static inline uint8_t mavlink_msg_rc_channels_get_chancount(const mavlink_messag */ static inline uint16_t mavlink_msg_rc_channels_get_chan1_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -480,7 +502,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan1_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan2_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 6); + return _MAV_RETURN_uint16_t(msg, 6); } /** @@ -490,7 +512,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan2_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan3_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -500,7 +522,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan3_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan4_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 10); + return _MAV_RETURN_uint16_t(msg, 10); } /** @@ -510,7 +532,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan4_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan5_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 12); + return _MAV_RETURN_uint16_t(msg, 12); } /** @@ -520,7 +542,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan5_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan6_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 14); + return _MAV_RETURN_uint16_t(msg, 14); } /** @@ -530,7 +552,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan6_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan7_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 16); + return _MAV_RETURN_uint16_t(msg, 16); } /** @@ -540,7 +562,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan7_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan8_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -550,7 +572,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan8_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan9_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 20); + return _MAV_RETURN_uint16_t(msg, 20); } /** @@ -560,7 +582,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan9_raw(const mavlink_messa */ static inline uint16_t mavlink_msg_rc_channels_get_chan10_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 22); + return _MAV_RETURN_uint16_t(msg, 22); } /** @@ -570,7 +592,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan10_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan11_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -580,7 +602,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan11_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan12_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 26); + return _MAV_RETURN_uint16_t(msg, 26); } /** @@ -590,7 +612,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan12_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan13_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -600,7 +622,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan13_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan14_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 30); + return _MAV_RETURN_uint16_t(msg, 30); } /** @@ -610,7 +632,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan14_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan15_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 32); + return _MAV_RETURN_uint16_t(msg, 32); } /** @@ -620,7 +642,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan15_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan16_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 34); + return _MAV_RETURN_uint16_t(msg, 34); } /** @@ -630,7 +652,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan16_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan17_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 36); + return _MAV_RETURN_uint16_t(msg, 36); } /** @@ -640,7 +662,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan17_raw(const mavlink_mess */ static inline uint16_t mavlink_msg_rc_channels_get_chan18_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 38); + return _MAV_RETURN_uint16_t(msg, 38); } /** @@ -650,7 +672,7 @@ static inline uint16_t mavlink_msg_rc_channels_get_chan18_raw(const mavlink_mess */ static inline uint8_t mavlink_msg_rc_channels_get_rssi(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 41); + return _MAV_RETURN_uint8_t(msg, 41); } /** @@ -661,29 +683,31 @@ static inline uint8_t mavlink_msg_rc_channels_get_rssi(const mavlink_message_t* */ static inline void mavlink_msg_rc_channels_decode(const mavlink_message_t* msg, mavlink_rc_channels_t* rc_channels) { -#if MAVLINK_NEED_BYTE_SWAP - rc_channels->time_boot_ms = mavlink_msg_rc_channels_get_time_boot_ms(msg); - rc_channels->chan1_raw = mavlink_msg_rc_channels_get_chan1_raw(msg); - rc_channels->chan2_raw = mavlink_msg_rc_channels_get_chan2_raw(msg); - rc_channels->chan3_raw = mavlink_msg_rc_channels_get_chan3_raw(msg); - rc_channels->chan4_raw = mavlink_msg_rc_channels_get_chan4_raw(msg); - rc_channels->chan5_raw = mavlink_msg_rc_channels_get_chan5_raw(msg); - rc_channels->chan6_raw = mavlink_msg_rc_channels_get_chan6_raw(msg); - rc_channels->chan7_raw = mavlink_msg_rc_channels_get_chan7_raw(msg); - rc_channels->chan8_raw = mavlink_msg_rc_channels_get_chan8_raw(msg); - rc_channels->chan9_raw = mavlink_msg_rc_channels_get_chan9_raw(msg); - rc_channels->chan10_raw = mavlink_msg_rc_channels_get_chan10_raw(msg); - rc_channels->chan11_raw = mavlink_msg_rc_channels_get_chan11_raw(msg); - rc_channels->chan12_raw = mavlink_msg_rc_channels_get_chan12_raw(msg); - rc_channels->chan13_raw = mavlink_msg_rc_channels_get_chan13_raw(msg); - rc_channels->chan14_raw = mavlink_msg_rc_channels_get_chan14_raw(msg); - rc_channels->chan15_raw = mavlink_msg_rc_channels_get_chan15_raw(msg); - rc_channels->chan16_raw = mavlink_msg_rc_channels_get_chan16_raw(msg); - rc_channels->chan17_raw = mavlink_msg_rc_channels_get_chan17_raw(msg); - rc_channels->chan18_raw = mavlink_msg_rc_channels_get_chan18_raw(msg); - rc_channels->chancount = mavlink_msg_rc_channels_get_chancount(msg); - rc_channels->rssi = mavlink_msg_rc_channels_get_rssi(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + rc_channels->time_boot_ms = mavlink_msg_rc_channels_get_time_boot_ms(msg); + rc_channels->chan1_raw = mavlink_msg_rc_channels_get_chan1_raw(msg); + rc_channels->chan2_raw = mavlink_msg_rc_channels_get_chan2_raw(msg); + rc_channels->chan3_raw = mavlink_msg_rc_channels_get_chan3_raw(msg); + rc_channels->chan4_raw = mavlink_msg_rc_channels_get_chan4_raw(msg); + rc_channels->chan5_raw = mavlink_msg_rc_channels_get_chan5_raw(msg); + rc_channels->chan6_raw = mavlink_msg_rc_channels_get_chan6_raw(msg); + rc_channels->chan7_raw = mavlink_msg_rc_channels_get_chan7_raw(msg); + rc_channels->chan8_raw = mavlink_msg_rc_channels_get_chan8_raw(msg); + rc_channels->chan9_raw = mavlink_msg_rc_channels_get_chan9_raw(msg); + rc_channels->chan10_raw = mavlink_msg_rc_channels_get_chan10_raw(msg); + rc_channels->chan11_raw = mavlink_msg_rc_channels_get_chan11_raw(msg); + rc_channels->chan12_raw = mavlink_msg_rc_channels_get_chan12_raw(msg); + rc_channels->chan13_raw = mavlink_msg_rc_channels_get_chan13_raw(msg); + rc_channels->chan14_raw = mavlink_msg_rc_channels_get_chan14_raw(msg); + rc_channels->chan15_raw = mavlink_msg_rc_channels_get_chan15_raw(msg); + rc_channels->chan16_raw = mavlink_msg_rc_channels_get_chan16_raw(msg); + rc_channels->chan17_raw = mavlink_msg_rc_channels_get_chan17_raw(msg); + rc_channels->chan18_raw = mavlink_msg_rc_channels_get_chan18_raw(msg); + rc_channels->chancount = mavlink_msg_rc_channels_get_chancount(msg); + rc_channels->rssi = mavlink_msg_rc_channels_get_rssi(msg); #else - memcpy(rc_channels, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_LEN; + memset(rc_channels, 0, MAVLINK_MSG_ID_RC_CHANNELS_LEN); + memcpy(rc_channels, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_override.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_override.h index 6cc9aab..443126e 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_override.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_override.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE RC_CHANNELS_OVERRIDE PACKING #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70 -typedef struct __mavlink_rc_channels_override_t -{ +MAVPACKED( +typedef struct __mavlink_rc_channels_override_t { uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_rc_channels_override_t uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_rc_channels_override_t; +}) mavlink_rc_channels_override_t; #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18 +#define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN 18 #define MAVLINK_MSG_ID_70_LEN 18 +#define MAVLINK_MSG_ID_70_MIN_LEN 18 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC 124 #define MAVLINK_MSG_ID_70_CRC 124 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \ - "RC_CHANNELS_OVERRIDE", \ - 10, \ - { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ + 70, \ + "RC_CHANNELS_OVERRIDE", \ + 10, \ + { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \ { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_rc_channels_override_t { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \ + "RC_CHANNELS_OVERRIDE", \ + 10, \ + { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \ + { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \ + { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \ + { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \ + { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \ + { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \ + { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \ + { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a rc_channels_override message @@ -60,44 +81,40 @@ typedef struct __mavlink_rc_channels_override_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) + uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; - _mav_put_uint16_t(buf, 0, chan1_raw); - _mav_put_uint16_t(buf, 2, chan2_raw); - _mav_put_uint16_t(buf, 4, chan3_raw); - _mav_put_uint16_t(buf, 6, chan4_raw); - _mav_put_uint16_t(buf, 8, chan5_raw); - _mav_put_uint16_t(buf, 10, chan6_raw); - _mav_put_uint16_t(buf, 12, chan7_raw); - _mav_put_uint16_t(buf, 14, chan8_raw); - _mav_put_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; + _mav_put_uint16_t(buf, 0, chan1_raw); + _mav_put_uint16_t(buf, 2, chan2_raw); + _mav_put_uint16_t(buf, 4, chan3_raw); + _mav_put_uint16_t(buf, 6, chan4_raw); + _mav_put_uint16_t(buf, 8, chan5_raw); + _mav_put_uint16_t(buf, 10, chan6_raw); + _mav_put_uint16_t(buf, 12, chan7_raw); + _mav_put_uint16_t(buf, 14, chan8_raw); + _mav_put_uint8_t(buf, 16, target_system); + _mav_put_uint8_t(buf, 17, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #else - mavlink_rc_channels_override_t packet; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_rc_channels_override_t packet; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; - _mav_put_uint16_t(buf, 0, chan1_raw); - _mav_put_uint16_t(buf, 2, chan2_raw); - _mav_put_uint16_t(buf, 4, chan3_raw); - _mav_put_uint16_t(buf, 6, chan4_raw); - _mav_put_uint16_t(buf, 8, chan5_raw); - _mav_put_uint16_t(buf, 10, chan6_raw); - _mav_put_uint16_t(buf, 12, chan7_raw); - _mav_put_uint16_t(buf, 14, chan8_raw); - _mav_put_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; + _mav_put_uint16_t(buf, 0, chan1_raw); + _mav_put_uint16_t(buf, 2, chan2_raw); + _mav_put_uint16_t(buf, 4, chan3_raw); + _mav_put_uint16_t(buf, 6, chan4_raw); + _mav_put_uint16_t(buf, 8, chan5_raw); + _mav_put_uint16_t(buf, 10, chan6_raw); + _mav_put_uint16_t(buf, 12, chan7_raw); + _mav_put_uint16_t(buf, 14, chan8_raw); + _mav_put_uint8_t(buf, 16, target_system); + _mav_put_uint8_t(buf, 17, target_component); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #else - mavlink_rc_channels_override_t packet; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.target_system = target_system; - packet.target_component = target_component; + mavlink_rc_channels_override_t packet; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.target_system = target_system; + packet.target_component = target_component; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system */ static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override) { - return mavlink_msg_rc_channels_override_pack(system_id, component_id, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw); + return mavlink_msg_rc_channels_override_pack(system_id, component_id, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id */ static inline uint16_t mavlink_msg_rc_channels_override_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override) { - return mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, chan, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw); + return mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, chan, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_rc_channels_override_encode_chan(uint8_t syst static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; - _mav_put_uint16_t(buf, 0, chan1_raw); - _mav_put_uint16_t(buf, 2, chan2_raw); - _mav_put_uint16_t(buf, 4, chan3_raw); - _mav_put_uint16_t(buf, 6, chan4_raw); - _mav_put_uint16_t(buf, 8, chan5_raw); - _mav_put_uint16_t(buf, 10, chan6_raw); - _mav_put_uint16_t(buf, 12, chan7_raw); - _mav_put_uint16_t(buf, 14, chan8_raw); - _mav_put_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN]; + _mav_put_uint16_t(buf, 0, chan1_raw); + _mav_put_uint16_t(buf, 2, chan2_raw); + _mav_put_uint16_t(buf, 4, chan3_raw); + _mav_put_uint16_t(buf, 6, chan4_raw); + _mav_put_uint16_t(buf, 8, chan5_raw); + _mav_put_uint16_t(buf, 10, chan6_raw); + _mav_put_uint16_t(buf, 12, chan7_raw); + _mav_put_uint16_t(buf, 14, chan8_raw); + _mav_put_uint8_t(buf, 16, target_system); + _mav_put_uint8_t(buf, 17, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); + mavlink_rc_channels_override_t packet; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.target_system = target_system; + packet.target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); #endif +} + +/** + * @brief Send a rc_channels_override message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_rc_channels_override_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_override_t* rc_channels_override) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_rc_channels_override_send(chan, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw); #else - mavlink_rc_channels_override_t packet; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.target_system = target_system; - packet.target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)rc_channels_override, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, static inline void mavlink_msg_rc_channels_override_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, chan1_raw); - _mav_put_uint16_t(buf, 2, chan2_raw); - _mav_put_uint16_t(buf, 4, chan3_raw); - _mav_put_uint16_t(buf, 6, chan4_raw); - _mav_put_uint16_t(buf, 8, chan5_raw); - _mav_put_uint16_t(buf, 10, chan6_raw); - _mav_put_uint16_t(buf, 12, chan7_raw); - _mav_put_uint16_t(buf, 14, chan8_raw); - _mav_put_uint8_t(buf, 16, target_system); - _mav_put_uint8_t(buf, 17, target_component); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); -#endif -#else - mavlink_rc_channels_override_t *packet = (mavlink_rc_channels_override_t *)msgbuf; - packet->chan1_raw = chan1_raw; - packet->chan2_raw = chan2_raw; - packet->chan3_raw = chan3_raw; - packet->chan4_raw = chan4_raw; - packet->chan5_raw = chan5_raw; - packet->chan6_raw = chan6_raw; - packet->chan7_raw = chan7_raw; - packet->chan8_raw = chan8_raw; - packet->target_system = target_system; - packet->target_component = target_component; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, chan1_raw); + _mav_put_uint16_t(buf, 2, chan2_raw); + _mav_put_uint16_t(buf, 4, chan3_raw); + _mav_put_uint16_t(buf, 6, chan4_raw); + _mav_put_uint16_t(buf, 8, chan5_raw); + _mav_put_uint16_t(buf, 10, chan6_raw); + _mav_put_uint16_t(buf, 12, chan7_raw); + _mav_put_uint16_t(buf, 14, chan8_raw); + _mav_put_uint8_t(buf, 16, target_system); + _mav_put_uint8_t(buf, 17, target_component); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); -#endif + mavlink_rc_channels_override_t *packet = (mavlink_rc_channels_override_t *)msgbuf; + packet->chan1_raw = chan1_raw; + packet->chan2_raw = chan2_raw; + packet->chan3_raw = chan3_raw; + packet->chan4_raw = chan4_raw; + packet->chan5_raw = chan5_raw; + packet->chan6_raw = chan6_raw; + packet->chan7_raw = chan7_raw; + packet->chan8_raw = chan8_raw; + packet->target_system = target_system; + packet->target_component = target_component; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_rc_channels_override_send_buf(mavlink_message_t * */ static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 16); + return _MAV_RETURN_uint8_t(msg, 16); } /** @@ -317,7 +328,7 @@ static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const m */ static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 17); + return _MAV_RETURN_uint8_t(msg, 17); } /** @@ -327,7 +338,7 @@ static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(cons */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -337,7 +348,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavl */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 2); + return _MAV_RETURN_uint16_t(msg, 2); } /** @@ -347,7 +358,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavl */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -357,7 +368,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavl */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 6); + return _MAV_RETURN_uint16_t(msg, 6); } /** @@ -367,7 +378,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavl */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -377,7 +388,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavl */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 10); + return _MAV_RETURN_uint16_t(msg, 10); } /** @@ -387,7 +398,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavl */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 12); + return _MAV_RETURN_uint16_t(msg, 12); } /** @@ -397,7 +408,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavl */ static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 14); + return _MAV_RETURN_uint16_t(msg, 14); } /** @@ -408,18 +419,20 @@ static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavl */ static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message_t* msg, mavlink_rc_channels_override_t* rc_channels_override) { -#if MAVLINK_NEED_BYTE_SWAP - rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg); - rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg); - rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg); - rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg); - rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg); - rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg); - rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg); - rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg); - rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg); - rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg); + rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg); + rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg); + rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg); + rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg); + rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg); + rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg); + rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg); + rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg); + rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg); #else - memcpy(rc_channels_override, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN; + memset(rc_channels_override, 0, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN); + memcpy(rc_channels_override, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_raw.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_raw.h index bd04fb5..6d51d80 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_raw.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_raw.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE RC_CHANNELS_RAW PACKING #define MAVLINK_MSG_ID_RC_CHANNELS_RAW 35 -typedef struct __mavlink_rc_channels_raw_t -{ +MAVPACKED( +typedef struct __mavlink_rc_channels_raw_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ @@ -15,20 +16,24 @@ typedef struct __mavlink_rc_channels_raw_t uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/ uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.*/ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/ -} mavlink_rc_channels_raw_t; +}) mavlink_rc_channels_raw_t; #define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22 +#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN 22 #define MAVLINK_MSG_ID_35_LEN 22 +#define MAVLINK_MSG_ID_35_MIN_LEN 22 #define MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC 244 #define MAVLINK_MSG_ID_35_CRC 244 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW { \ - "RC_CHANNELS_RAW", \ - 11, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \ + 35, \ + "RC_CHANNELS_RAW", \ + 11, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \ { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \ { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \ { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \ @@ -41,7 +46,24 @@ typedef struct __mavlink_rc_channels_raw_t { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW { \ + "RC_CHANNELS_RAW", \ + 11, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \ + { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \ + { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \ + { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \ + { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_raw_t, chan4_raw) }, \ + { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_raw_t, chan5_raw) }, \ + { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) }, \ + { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) }, \ + { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \ + { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) }, \ + } \ +} +#endif /** * @brief Pack a rc_channels_raw message @@ -63,46 +85,42 @@ typedef struct __mavlink_rc_channels_raw_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) + uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #else - mavlink_rc_channels_raw_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.port = port; - packet.rssi = rssi; + mavlink_rc_channels_raw_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.port = port; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); } /** @@ -125,47 +143,43 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t port,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint8_t rssi) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t port,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #else - mavlink_rc_channels_raw_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.port = port; - packet.rssi = rssi; + mavlink_rc_channels_raw_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.port = port; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); } /** @@ -178,7 +192,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw) { - return mavlink_msg_rc_channels_raw_pack(system_id, component_id, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi); + return mavlink_msg_rc_channels_raw_pack(system_id, component_id, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi); } /** @@ -192,7 +206,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_rc_channels_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw) { - return mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, chan, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi); + return mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, chan, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi); } /** @@ -216,43 +230,49 @@ static inline uint16_t mavlink_msg_rc_channels_raw_encode_chan(uint8_t system_id static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); + mavlink_rc_channels_raw_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_raw = chan1_raw; + packet.chan2_raw = chan2_raw; + packet.chan3_raw = chan3_raw; + packet.chan4_raw = chan4_raw; + packet.chan5_raw = chan5_raw; + packet.chan6_raw = chan6_raw; + packet.chan7_raw = chan7_raw; + packet.chan8_raw = chan8_raw; + packet.port = port; + packet.rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); #endif +} + +/** + * @brief Send a rc_channels_raw message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_rc_channels_raw_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_raw_t* rc_channels_raw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_rc_channels_raw_send(chan, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi); #else - mavlink_rc_channels_raw_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_raw = chan1_raw; - packet.chan2_raw = chan2_raw; - packet.chan3_raw = chan3_raw; - packet.chan4_raw = chan4_raw; - packet.chan5_raw = chan5_raw; - packet.chan6_raw = chan6_raw; - packet.chan7_raw = chan7_raw; - packet.chan8_raw = chan8_raw; - packet.port = port; - packet.rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)rc_channels_raw, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); #endif } @@ -267,43 +287,35 @@ static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint static inline void mavlink_msg_rc_channels_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_uint16_t(buf, 4, chan1_raw); - _mav_put_uint16_t(buf, 6, chan2_raw); - _mav_put_uint16_t(buf, 8, chan3_raw); - _mav_put_uint16_t(buf, 10, chan4_raw); - _mav_put_uint16_t(buf, 12, chan5_raw); - _mav_put_uint16_t(buf, 14, chan6_raw); - _mav_put_uint16_t(buf, 16, chan7_raw); - _mav_put_uint16_t(buf, 18, chan8_raw); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_uint16_t(buf, 4, chan1_raw); + _mav_put_uint16_t(buf, 6, chan2_raw); + _mav_put_uint16_t(buf, 8, chan3_raw); + _mav_put_uint16_t(buf, 10, chan4_raw); + _mav_put_uint16_t(buf, 12, chan5_raw); + _mav_put_uint16_t(buf, 14, chan6_raw); + _mav_put_uint16_t(buf, 16, chan7_raw); + _mav_put_uint16_t(buf, 18, chan8_raw); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); -#endif -#else - mavlink_rc_channels_raw_t *packet = (mavlink_rc_channels_raw_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->chan1_raw = chan1_raw; - packet->chan2_raw = chan2_raw; - packet->chan3_raw = chan3_raw; - packet->chan4_raw = chan4_raw; - packet->chan5_raw = chan5_raw; - packet->chan6_raw = chan6_raw; - packet->chan7_raw = chan7_raw; - packet->chan8_raw = chan8_raw; - packet->port = port; - packet->rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); -#endif + mavlink_rc_channels_raw_t *packet = (mavlink_rc_channels_raw_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->chan1_raw = chan1_raw; + packet->chan2_raw = chan2_raw; + packet->chan3_raw = chan3_raw; + packet->chan4_raw = chan4_raw; + packet->chan5_raw = chan5_raw; + packet->chan6_raw = chan6_raw; + packet->chan7_raw = chan7_raw; + packet->chan8_raw = chan8_raw; + packet->port = port; + packet->rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC); #endif } #endif @@ -320,7 +332,7 @@ static inline void mavlink_msg_rc_channels_raw_send_buf(mavlink_message_t *msgbu */ static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -330,7 +342,7 @@ static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlin */ static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 20); + return _MAV_RETURN_uint8_t(msg, 20); } /** @@ -340,7 +352,7 @@ static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -350,7 +362,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_m */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 6); + return _MAV_RETURN_uint16_t(msg, 6); } /** @@ -360,7 +372,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_m */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -370,7 +382,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_m */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 10); + return _MAV_RETURN_uint16_t(msg, 10); } /** @@ -380,7 +392,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_m */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 12); + return _MAV_RETURN_uint16_t(msg, 12); } /** @@ -390,7 +402,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_m */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 14); + return _MAV_RETURN_uint16_t(msg, 14); } /** @@ -400,7 +412,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_m */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 16); + return _MAV_RETURN_uint16_t(msg, 16); } /** @@ -410,7 +422,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_m */ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -420,7 +432,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_m */ static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 21); + return _MAV_RETURN_uint8_t(msg, 21); } /** @@ -431,19 +443,21 @@ static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message */ static inline void mavlink_msg_rc_channels_raw_decode(const mavlink_message_t* msg, mavlink_rc_channels_raw_t* rc_channels_raw) { -#if MAVLINK_NEED_BYTE_SWAP - rc_channels_raw->time_boot_ms = mavlink_msg_rc_channels_raw_get_time_boot_ms(msg); - rc_channels_raw->chan1_raw = mavlink_msg_rc_channels_raw_get_chan1_raw(msg); - rc_channels_raw->chan2_raw = mavlink_msg_rc_channels_raw_get_chan2_raw(msg); - rc_channels_raw->chan3_raw = mavlink_msg_rc_channels_raw_get_chan3_raw(msg); - rc_channels_raw->chan4_raw = mavlink_msg_rc_channels_raw_get_chan4_raw(msg); - rc_channels_raw->chan5_raw = mavlink_msg_rc_channels_raw_get_chan5_raw(msg); - rc_channels_raw->chan6_raw = mavlink_msg_rc_channels_raw_get_chan6_raw(msg); - rc_channels_raw->chan7_raw = mavlink_msg_rc_channels_raw_get_chan7_raw(msg); - rc_channels_raw->chan8_raw = mavlink_msg_rc_channels_raw_get_chan8_raw(msg); - rc_channels_raw->port = mavlink_msg_rc_channels_raw_get_port(msg); - rc_channels_raw->rssi = mavlink_msg_rc_channels_raw_get_rssi(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + rc_channels_raw->time_boot_ms = mavlink_msg_rc_channels_raw_get_time_boot_ms(msg); + rc_channels_raw->chan1_raw = mavlink_msg_rc_channels_raw_get_chan1_raw(msg); + rc_channels_raw->chan2_raw = mavlink_msg_rc_channels_raw_get_chan2_raw(msg); + rc_channels_raw->chan3_raw = mavlink_msg_rc_channels_raw_get_chan3_raw(msg); + rc_channels_raw->chan4_raw = mavlink_msg_rc_channels_raw_get_chan4_raw(msg); + rc_channels_raw->chan5_raw = mavlink_msg_rc_channels_raw_get_chan5_raw(msg); + rc_channels_raw->chan6_raw = mavlink_msg_rc_channels_raw_get_chan6_raw(msg); + rc_channels_raw->chan7_raw = mavlink_msg_rc_channels_raw_get_chan7_raw(msg); + rc_channels_raw->chan8_raw = mavlink_msg_rc_channels_raw_get_chan8_raw(msg); + rc_channels_raw->port = mavlink_msg_rc_channels_raw_get_port(msg); + rc_channels_raw->rssi = mavlink_msg_rc_channels_raw_get_rssi(msg); #else - memcpy(rc_channels_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN; + memset(rc_channels_raw, 0, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN); + memcpy(rc_channels_raw, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_scaled.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_scaled.h index e5fa6e8..a969151 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_scaled.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_rc_channels_scaled.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE RC_CHANNELS_SCALED PACKING #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED 34 -typedef struct __mavlink_rc_channels_scaled_t -{ +MAVPACKED( +typedef struct __mavlink_rc_channels_scaled_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ int16_t chan1_scaled; /*< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ int16_t chan2_scaled; /*< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ @@ -15,20 +16,24 @@ typedef struct __mavlink_rc_channels_scaled_t int16_t chan8_scaled; /*< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.*/ uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.*/ uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/ -} mavlink_rc_channels_scaled_t; +}) mavlink_rc_channels_scaled_t; #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22 +#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN 22 #define MAVLINK_MSG_ID_34_LEN 22 +#define MAVLINK_MSG_ID_34_MIN_LEN 22 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC 237 #define MAVLINK_MSG_ID_34_CRC 237 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \ - "RC_CHANNELS_SCALED", \ - 11, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \ + 34, \ + "RC_CHANNELS_SCALED", \ + 11, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \ { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \ { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \ { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \ @@ -41,7 +46,24 @@ typedef struct __mavlink_rc_channels_scaled_t { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \ + "RC_CHANNELS_SCALED", \ + 11, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \ + { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \ + { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \ + { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \ + { "chan4_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rc_channels_scaled_t, chan4_scaled) }, \ + { "chan5_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_rc_channels_scaled_t, chan5_scaled) }, \ + { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \ + { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \ + { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \ + { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \ + } \ +} +#endif /** * @brief Pack a rc_channels_scaled message @@ -63,46 +85,42 @@ typedef struct __mavlink_rc_channels_scaled_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) + uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, chan1_scaled); - _mav_put_int16_t(buf, 6, chan2_scaled); - _mav_put_int16_t(buf, 8, chan3_scaled); - _mav_put_int16_t(buf, 10, chan4_scaled); - _mav_put_int16_t(buf, 12, chan5_scaled); - _mav_put_int16_t(buf, 14, chan6_scaled); - _mav_put_int16_t(buf, 16, chan7_scaled); - _mav_put_int16_t(buf, 18, chan8_scaled); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, chan1_scaled); + _mav_put_int16_t(buf, 6, chan2_scaled); + _mav_put_int16_t(buf, 8, chan3_scaled); + _mav_put_int16_t(buf, 10, chan4_scaled); + _mav_put_int16_t(buf, 12, chan5_scaled); + _mav_put_int16_t(buf, 14, chan6_scaled); + _mav_put_int16_t(buf, 16, chan7_scaled); + _mav_put_int16_t(buf, 18, chan8_scaled); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #else - mavlink_rc_channels_scaled_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_scaled = chan1_scaled; - packet.chan2_scaled = chan2_scaled; - packet.chan3_scaled = chan3_scaled; - packet.chan4_scaled = chan4_scaled; - packet.chan5_scaled = chan5_scaled; - packet.chan6_scaled = chan6_scaled; - packet.chan7_scaled = chan7_scaled; - packet.chan8_scaled = chan8_scaled; - packet.port = port; - packet.rssi = rssi; + mavlink_rc_channels_scaled_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_scaled = chan1_scaled; + packet.chan2_scaled = chan2_scaled; + packet.chan3_scaled = chan3_scaled; + packet.chan4_scaled = chan4_scaled; + packet.chan5_scaled = chan5_scaled; + packet.chan6_scaled = chan6_scaled; + packet.chan7_scaled = chan7_scaled; + packet.chan8_scaled = chan8_scaled; + packet.port = port; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); } /** @@ -125,47 +143,43 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t port,int16_t chan1_scaled,int16_t chan2_scaled,int16_t chan3_scaled,int16_t chan4_scaled,int16_t chan5_scaled,int16_t chan6_scaled,int16_t chan7_scaled,int16_t chan8_scaled,uint8_t rssi) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t port,int16_t chan1_scaled,int16_t chan2_scaled,int16_t chan3_scaled,int16_t chan4_scaled,int16_t chan5_scaled,int16_t chan6_scaled,int16_t chan7_scaled,int16_t chan8_scaled,uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, chan1_scaled); - _mav_put_int16_t(buf, 6, chan2_scaled); - _mav_put_int16_t(buf, 8, chan3_scaled); - _mav_put_int16_t(buf, 10, chan4_scaled); - _mav_put_int16_t(buf, 12, chan5_scaled); - _mav_put_int16_t(buf, 14, chan6_scaled); - _mav_put_int16_t(buf, 16, chan7_scaled); - _mav_put_int16_t(buf, 18, chan8_scaled); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, chan1_scaled); + _mav_put_int16_t(buf, 6, chan2_scaled); + _mav_put_int16_t(buf, 8, chan3_scaled); + _mav_put_int16_t(buf, 10, chan4_scaled); + _mav_put_int16_t(buf, 12, chan5_scaled); + _mav_put_int16_t(buf, 14, chan6_scaled); + _mav_put_int16_t(buf, 16, chan7_scaled); + _mav_put_int16_t(buf, 18, chan8_scaled); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #else - mavlink_rc_channels_scaled_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_scaled = chan1_scaled; - packet.chan2_scaled = chan2_scaled; - packet.chan3_scaled = chan3_scaled; - packet.chan4_scaled = chan4_scaled; - packet.chan5_scaled = chan5_scaled; - packet.chan6_scaled = chan6_scaled; - packet.chan7_scaled = chan7_scaled; - packet.chan8_scaled = chan8_scaled; - packet.port = port; - packet.rssi = rssi; + mavlink_rc_channels_scaled_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_scaled = chan1_scaled; + packet.chan2_scaled = chan2_scaled; + packet.chan3_scaled = chan3_scaled; + packet.chan4_scaled = chan4_scaled; + packet.chan5_scaled = chan5_scaled; + packet.chan6_scaled = chan6_scaled; + packet.chan7_scaled = chan7_scaled; + packet.chan8_scaled = chan8_scaled; + packet.port = port; + packet.rssi = rssi; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); } /** @@ -178,7 +192,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i */ static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_scaled_t* rc_channels_scaled) { - return mavlink_msg_rc_channels_scaled_pack(system_id, component_id, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi); + return mavlink_msg_rc_channels_scaled_pack(system_id, component_id, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi); } /** @@ -192,7 +206,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_rc_channels_scaled_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_scaled_t* rc_channels_scaled) { - return mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, chan, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi); + return mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, chan, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi); } /** @@ -216,43 +230,49 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_encode_chan(uint8_t system static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, chan1_scaled); - _mav_put_int16_t(buf, 6, chan2_scaled); - _mav_put_int16_t(buf, 8, chan3_scaled); - _mav_put_int16_t(buf, 10, chan4_scaled); - _mav_put_int16_t(buf, 12, chan5_scaled); - _mav_put_int16_t(buf, 14, chan6_scaled); - _mav_put_int16_t(buf, 16, chan7_scaled); - _mav_put_int16_t(buf, 18, chan8_scaled); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); + char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, chan1_scaled); + _mav_put_int16_t(buf, 6, chan2_scaled); + _mav_put_int16_t(buf, 8, chan3_scaled); + _mav_put_int16_t(buf, 10, chan4_scaled); + _mav_put_int16_t(buf, 12, chan5_scaled); + _mav_put_int16_t(buf, 14, chan6_scaled); + _mav_put_int16_t(buf, 16, chan7_scaled); + _mav_put_int16_t(buf, 18, chan8_scaled); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); + mavlink_rc_channels_scaled_t packet; + packet.time_boot_ms = time_boot_ms; + packet.chan1_scaled = chan1_scaled; + packet.chan2_scaled = chan2_scaled; + packet.chan3_scaled = chan3_scaled; + packet.chan4_scaled = chan4_scaled; + packet.chan5_scaled = chan5_scaled; + packet.chan6_scaled = chan6_scaled; + packet.chan7_scaled = chan7_scaled; + packet.chan8_scaled = chan8_scaled; + packet.port = port; + packet.rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); #endif +} + +/** + * @brief Send a rc_channels_scaled message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_rc_channels_scaled_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_scaled_t* rc_channels_scaled) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_rc_channels_scaled_send(chan, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi); #else - mavlink_rc_channels_scaled_t packet; - packet.time_boot_ms = time_boot_ms; - packet.chan1_scaled = chan1_scaled; - packet.chan2_scaled = chan2_scaled; - packet.chan3_scaled = chan3_scaled; - packet.chan4_scaled = chan4_scaled; - packet.chan5_scaled = chan5_scaled; - packet.chan6_scaled = chan6_scaled; - packet.chan7_scaled = chan7_scaled; - packet.chan8_scaled = chan8_scaled; - packet.port = port; - packet.rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)rc_channels_scaled, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); #endif } @@ -267,43 +287,35 @@ static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, u static inline void mavlink_msg_rc_channels_scaled_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, chan1_scaled); - _mav_put_int16_t(buf, 6, chan2_scaled); - _mav_put_int16_t(buf, 8, chan3_scaled); - _mav_put_int16_t(buf, 10, chan4_scaled); - _mav_put_int16_t(buf, 12, chan5_scaled); - _mav_put_int16_t(buf, 14, chan6_scaled); - _mav_put_int16_t(buf, 16, chan7_scaled); - _mav_put_int16_t(buf, 18, chan8_scaled); - _mav_put_uint8_t(buf, 20, port); - _mav_put_uint8_t(buf, 21, rssi); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, chan1_scaled); + _mav_put_int16_t(buf, 6, chan2_scaled); + _mav_put_int16_t(buf, 8, chan3_scaled); + _mav_put_int16_t(buf, 10, chan4_scaled); + _mav_put_int16_t(buf, 12, chan5_scaled); + _mav_put_int16_t(buf, 14, chan6_scaled); + _mav_put_int16_t(buf, 16, chan7_scaled); + _mav_put_int16_t(buf, 18, chan8_scaled); + _mav_put_uint8_t(buf, 20, port); + _mav_put_uint8_t(buf, 21, rssi); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); -#endif -#else - mavlink_rc_channels_scaled_t *packet = (mavlink_rc_channels_scaled_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->chan1_scaled = chan1_scaled; - packet->chan2_scaled = chan2_scaled; - packet->chan3_scaled = chan3_scaled; - packet->chan4_scaled = chan4_scaled; - packet->chan5_scaled = chan5_scaled; - packet->chan6_scaled = chan6_scaled; - packet->chan7_scaled = chan7_scaled; - packet->chan8_scaled = chan8_scaled; - packet->port = port; - packet->rssi = rssi; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); -#endif + mavlink_rc_channels_scaled_t *packet = (mavlink_rc_channels_scaled_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->chan1_scaled = chan1_scaled; + packet->chan2_scaled = chan2_scaled; + packet->chan3_scaled = chan3_scaled; + packet->chan4_scaled = chan4_scaled; + packet->chan5_scaled = chan5_scaled; + packet->chan6_scaled = chan6_scaled; + packet->chan7_scaled = chan7_scaled; + packet->chan8_scaled = chan8_scaled; + packet->port = port; + packet->rssi = rssi; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC); #endif } #endif @@ -320,7 +332,7 @@ static inline void mavlink_msg_rc_channels_scaled_send_buf(mavlink_message_t *ms */ static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -330,7 +342,7 @@ static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mav */ static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 20); + return _MAV_RETURN_uint8_t(msg, 20); } /** @@ -340,7 +352,7 @@ static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_mess */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 4); + return _MAV_RETURN_int16_t(msg, 4); } /** @@ -350,7 +362,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavl */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 6); + return _MAV_RETURN_int16_t(msg, 6); } /** @@ -360,7 +372,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavl */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 8); + return _MAV_RETURN_int16_t(msg, 8); } /** @@ -370,7 +382,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavl */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 10); + return _MAV_RETURN_int16_t(msg, 10); } /** @@ -380,7 +392,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavl */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -390,7 +402,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavl */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 14); + return _MAV_RETURN_int16_t(msg, 14); } /** @@ -400,7 +412,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavl */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -410,7 +422,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavl */ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 18); + return _MAV_RETURN_int16_t(msg, 18); } /** @@ -420,7 +432,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavl */ static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 21); + return _MAV_RETURN_uint8_t(msg, 21); } /** @@ -431,19 +443,21 @@ static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_mess */ static inline void mavlink_msg_rc_channels_scaled_decode(const mavlink_message_t* msg, mavlink_rc_channels_scaled_t* rc_channels_scaled) { -#if MAVLINK_NEED_BYTE_SWAP - rc_channels_scaled->time_boot_ms = mavlink_msg_rc_channels_scaled_get_time_boot_ms(msg); - rc_channels_scaled->chan1_scaled = mavlink_msg_rc_channels_scaled_get_chan1_scaled(msg); - rc_channels_scaled->chan2_scaled = mavlink_msg_rc_channels_scaled_get_chan2_scaled(msg); - rc_channels_scaled->chan3_scaled = mavlink_msg_rc_channels_scaled_get_chan3_scaled(msg); - rc_channels_scaled->chan4_scaled = mavlink_msg_rc_channels_scaled_get_chan4_scaled(msg); - rc_channels_scaled->chan5_scaled = mavlink_msg_rc_channels_scaled_get_chan5_scaled(msg); - rc_channels_scaled->chan6_scaled = mavlink_msg_rc_channels_scaled_get_chan6_scaled(msg); - rc_channels_scaled->chan7_scaled = mavlink_msg_rc_channels_scaled_get_chan7_scaled(msg); - rc_channels_scaled->chan8_scaled = mavlink_msg_rc_channels_scaled_get_chan8_scaled(msg); - rc_channels_scaled->port = mavlink_msg_rc_channels_scaled_get_port(msg); - rc_channels_scaled->rssi = mavlink_msg_rc_channels_scaled_get_rssi(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + rc_channels_scaled->time_boot_ms = mavlink_msg_rc_channels_scaled_get_time_boot_ms(msg); + rc_channels_scaled->chan1_scaled = mavlink_msg_rc_channels_scaled_get_chan1_scaled(msg); + rc_channels_scaled->chan2_scaled = mavlink_msg_rc_channels_scaled_get_chan2_scaled(msg); + rc_channels_scaled->chan3_scaled = mavlink_msg_rc_channels_scaled_get_chan3_scaled(msg); + rc_channels_scaled->chan4_scaled = mavlink_msg_rc_channels_scaled_get_chan4_scaled(msg); + rc_channels_scaled->chan5_scaled = mavlink_msg_rc_channels_scaled_get_chan5_scaled(msg); + rc_channels_scaled->chan6_scaled = mavlink_msg_rc_channels_scaled_get_chan6_scaled(msg); + rc_channels_scaled->chan7_scaled = mavlink_msg_rc_channels_scaled_get_chan7_scaled(msg); + rc_channels_scaled->chan8_scaled = mavlink_msg_rc_channels_scaled_get_chan8_scaled(msg); + rc_channels_scaled->port = mavlink_msg_rc_channels_scaled_get_port(msg); + rc_channels_scaled->rssi = mavlink_msg_rc_channels_scaled_get_rssi(msg); #else - memcpy(rc_channels_scaled, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN; + memset(rc_channels_scaled, 0, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN); + memcpy(rc_channels_scaled, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_request_data_stream.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_request_data_stream.h index aef341f..33107df 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_request_data_stream.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_request_data_stream.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE REQUEST_DATA_STREAM PACKING #define MAVLINK_MSG_ID_REQUEST_DATA_STREAM 66 -typedef struct __mavlink_request_data_stream_t -{ +MAVPACKED( +typedef struct __mavlink_request_data_stream_t { uint16_t req_message_rate; /*< The requested message rate*/ uint8_t target_system; /*< The target requested to send the message stream.*/ uint8_t target_component; /*< The target requested to send the message stream.*/ uint8_t req_stream_id; /*< The ID of the requested data stream*/ uint8_t start_stop; /*< 1 to start sending, 0 to stop sending.*/ -} mavlink_request_data_stream_t; +}) mavlink_request_data_stream_t; #define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN 6 +#define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN 6 #define MAVLINK_MSG_ID_66_LEN 6 +#define MAVLINK_MSG_ID_66_MIN_LEN 6 #define MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC 148 #define MAVLINK_MSG_ID_66_CRC 148 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM { \ - "REQUEST_DATA_STREAM", \ - 5, \ - { { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ + 66, \ + "REQUEST_DATA_STREAM", \ + 5, \ + { { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_request_data_stream_t, target_component) }, \ { "req_stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_request_data_stream_t, req_stream_id) }, \ { "start_stop", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_request_data_stream_t, start_stop) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM { \ + "REQUEST_DATA_STREAM", \ + 5, \ + { { "req_message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_request_data_stream_t, req_message_rate) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_request_data_stream_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_request_data_stream_t, target_component) }, \ + { "req_stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_request_data_stream_t, req_stream_id) }, \ + { "start_stop", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_request_data_stream_t, start_stop) }, \ + } \ +} +#endif /** * @brief Pack a request_data_stream message @@ -45,34 +61,30 @@ typedef struct __mavlink_request_data_stream_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) + uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; - _mav_put_uint16_t(buf, 0, req_message_rate); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_uint8_t(buf, 4, req_stream_id); - _mav_put_uint8_t(buf, 5, start_stop); + char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; + _mav_put_uint16_t(buf, 0, req_message_rate); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_uint8_t(buf, 4, req_stream_id); + _mav_put_uint8_t(buf, 5, start_stop); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #else - mavlink_request_data_stream_t packet; - packet.req_message_rate = req_message_rate; - packet.target_system = target_system; - packet.target_component = target_component; - packet.req_stream_id = req_stream_id; - packet.start_stop = start_stop; + mavlink_request_data_stream_t packet; + packet.req_message_rate = req_message_rate; + packet.target_system = target_system; + packet.target_component = target_component; + packet.req_stream_id = req_stream_id; + packet.start_stop = start_stop; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); } /** @@ -89,35 +101,31 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t req_stream_id,uint16_t req_message_rate,uint8_t start_stop) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint8_t req_stream_id,uint16_t req_message_rate,uint8_t start_stop) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; - _mav_put_uint16_t(buf, 0, req_message_rate); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_uint8_t(buf, 4, req_stream_id); - _mav_put_uint8_t(buf, 5, start_stop); + char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; + _mav_put_uint16_t(buf, 0, req_message_rate); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_uint8_t(buf, 4, req_stream_id); + _mav_put_uint8_t(buf, 5, start_stop); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #else - mavlink_request_data_stream_t packet; - packet.req_message_rate = req_message_rate; - packet.target_system = target_system; - packet.target_component = target_component; - packet.req_stream_id = req_stream_id; - packet.start_stop = start_stop; + mavlink_request_data_stream_t packet; + packet.req_message_rate = req_message_rate; + packet.target_system = target_system; + packet.target_component = target_component; + packet.req_stream_id = req_stream_id; + packet.start_stop = start_stop; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); } /** @@ -130,7 +138,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_ */ static inline uint16_t mavlink_msg_request_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_request_data_stream_t* request_data_stream) { - return mavlink_msg_request_data_stream_pack(system_id, component_id, msg, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop); + return mavlink_msg_request_data_stream_pack(system_id, component_id, msg, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop); } /** @@ -144,7 +152,7 @@ static inline uint16_t mavlink_msg_request_data_stream_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_request_data_stream_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_request_data_stream_t* request_data_stream) { - return mavlink_msg_request_data_stream_pack_chan(system_id, component_id, chan, msg, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop); + return mavlink_msg_request_data_stream_pack_chan(system_id, component_id, chan, msg, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop); } /** @@ -162,31 +170,37 @@ static inline uint16_t mavlink_msg_request_data_stream_encode_chan(uint8_t syste static inline void mavlink_msg_request_data_stream_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; - _mav_put_uint16_t(buf, 0, req_message_rate); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_uint8_t(buf, 4, req_stream_id); - _mav_put_uint8_t(buf, 5, start_stop); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); + char buf[MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN]; + _mav_put_uint16_t(buf, 0, req_message_rate); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_uint8_t(buf, 4, req_stream_id); + _mav_put_uint8_t(buf, 5, start_stop); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); + mavlink_request_data_stream_t packet; + packet.req_message_rate = req_message_rate; + packet.target_system = target_system; + packet.target_component = target_component; + packet.req_stream_id = req_stream_id; + packet.start_stop = start_stop; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); #endif +} + +/** + * @brief Send a request_data_stream message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_request_data_stream_send_struct(mavlink_channel_t chan, const mavlink_request_data_stream_t* request_data_stream) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_request_data_stream_send(chan, request_data_stream->target_system, request_data_stream->target_component, request_data_stream->req_stream_id, request_data_stream->req_message_rate, request_data_stream->start_stop); #else - mavlink_request_data_stream_t packet; - packet.req_message_rate = req_message_rate; - packet.target_system = target_system; - packet.target_component = target_component; - packet.req_stream_id = req_stream_id; - packet.start_stop = start_stop; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)request_data_stream, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); #endif } @@ -201,31 +215,23 @@ static inline void mavlink_msg_request_data_stream_send(mavlink_channel_t chan, static inline void mavlink_msg_request_data_stream_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t req_stream_id, uint16_t req_message_rate, uint8_t start_stop) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, req_message_rate); - _mav_put_uint8_t(buf, 2, target_system); - _mav_put_uint8_t(buf, 3, target_component); - _mav_put_uint8_t(buf, 4, req_stream_id); - _mav_put_uint8_t(buf, 5, start_stop); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, req_message_rate); + _mav_put_uint8_t(buf, 2, target_system); + _mav_put_uint8_t(buf, 3, target_component); + _mav_put_uint8_t(buf, 4, req_stream_id); + _mav_put_uint8_t(buf, 5, start_stop); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, buf, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); -#endif -#else - mavlink_request_data_stream_t *packet = (mavlink_request_data_stream_t *)msgbuf; - packet->req_message_rate = req_message_rate; - packet->target_system = target_system; - packet->target_component = target_component; - packet->req_stream_id = req_stream_id; - packet->start_stop = start_stop; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); -#endif + mavlink_request_data_stream_t *packet = (mavlink_request_data_stream_t *)msgbuf; + packet->req_message_rate = req_message_rate; + packet->target_system = target_system; + packet->target_component = target_component; + packet->req_stream_id = req_stream_id; + packet->start_stop = start_stop; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REQUEST_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_CRC); #endif } #endif @@ -242,7 +248,7 @@ static inline void mavlink_msg_request_data_stream_send_buf(mavlink_message_t *m */ static inline uint8_t mavlink_msg_request_data_stream_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -252,7 +258,7 @@ static inline uint8_t mavlink_msg_request_data_stream_get_target_system(const ma */ static inline uint8_t mavlink_msg_request_data_stream_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -262,7 +268,7 @@ static inline uint8_t mavlink_msg_request_data_stream_get_target_component(const */ static inline uint8_t mavlink_msg_request_data_stream_get_req_stream_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -272,7 +278,7 @@ static inline uint8_t mavlink_msg_request_data_stream_get_req_stream_id(const ma */ static inline uint16_t mavlink_msg_request_data_stream_get_req_message_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -282,7 +288,7 @@ static inline uint16_t mavlink_msg_request_data_stream_get_req_message_rate(cons */ static inline uint8_t mavlink_msg_request_data_stream_get_start_stop(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -293,13 +299,15 @@ static inline uint8_t mavlink_msg_request_data_stream_get_start_stop(const mavli */ static inline void mavlink_msg_request_data_stream_decode(const mavlink_message_t* msg, mavlink_request_data_stream_t* request_data_stream) { -#if MAVLINK_NEED_BYTE_SWAP - request_data_stream->req_message_rate = mavlink_msg_request_data_stream_get_req_message_rate(msg); - request_data_stream->target_system = mavlink_msg_request_data_stream_get_target_system(msg); - request_data_stream->target_component = mavlink_msg_request_data_stream_get_target_component(msg); - request_data_stream->req_stream_id = mavlink_msg_request_data_stream_get_req_stream_id(msg); - request_data_stream->start_stop = mavlink_msg_request_data_stream_get_start_stop(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + request_data_stream->req_message_rate = mavlink_msg_request_data_stream_get_req_message_rate(msg); + request_data_stream->target_system = mavlink_msg_request_data_stream_get_target_system(msg); + request_data_stream->target_component = mavlink_msg_request_data_stream_get_target_component(msg); + request_data_stream->req_stream_id = mavlink_msg_request_data_stream_get_req_stream_id(msg); + request_data_stream->start_stop = mavlink_msg_request_data_stream_get_start_stop(msg); #else - memcpy(request_data_stream, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN? msg->len : MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN; + memset(request_data_stream, 0, MAVLINK_MSG_ID_REQUEST_DATA_STREAM_LEN); + memcpy(request_data_stream, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_resource_request.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_resource_request.h index 9291b6a..4893089 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_resource_request.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_resource_request.h @@ -1,18 +1,21 @@ +#pragma once // MESSAGE RESOURCE_REQUEST PACKING #define MAVLINK_MSG_ID_RESOURCE_REQUEST 142 -typedef struct __mavlink_resource_request_t -{ +MAVPACKED( +typedef struct __mavlink_resource_request_t { uint8_t request_id; /*< Request ID. This ID should be re-used when sending back URI contents*/ uint8_t uri_type; /*< The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary*/ uint8_t uri[120]; /*< The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)*/ uint8_t transfer_type; /*< The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream.*/ uint8_t storage[120]; /*< The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP).*/ -} mavlink_resource_request_t; +}) mavlink_resource_request_t; #define MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN 243 +#define MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN 243 #define MAVLINK_MSG_ID_142_LEN 243 +#define MAVLINK_MSG_ID_142_MIN_LEN 243 #define MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC 72 #define MAVLINK_MSG_ID_142_CRC 72 @@ -20,17 +23,30 @@ typedef struct __mavlink_resource_request_t #define MAVLINK_MSG_RESOURCE_REQUEST_FIELD_URI_LEN 120 #define MAVLINK_MSG_RESOURCE_REQUEST_FIELD_STORAGE_LEN 120 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST { \ - "RESOURCE_REQUEST", \ - 5, \ - { { "request_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_resource_request_t, request_id) }, \ + 142, \ + "RESOURCE_REQUEST", \ + 5, \ + { { "request_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_resource_request_t, request_id) }, \ { "uri_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_resource_request_t, uri_type) }, \ { "uri", NULL, MAVLINK_TYPE_UINT8_T, 120, 2, offsetof(mavlink_resource_request_t, uri) }, \ { "transfer_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 122, offsetof(mavlink_resource_request_t, transfer_type) }, \ { "storage", NULL, MAVLINK_TYPE_UINT8_T, 120, 123, offsetof(mavlink_resource_request_t, storage) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST { \ + "RESOURCE_REQUEST", \ + 5, \ + { { "request_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_resource_request_t, request_id) }, \ + { "uri_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_resource_request_t, uri_type) }, \ + { "uri", NULL, MAVLINK_TYPE_UINT8_T, 120, 2, offsetof(mavlink_resource_request_t, uri) }, \ + { "transfer_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 122, offsetof(mavlink_resource_request_t, transfer_type) }, \ + { "storage", NULL, MAVLINK_TYPE_UINT8_T, 120, 123, offsetof(mavlink_resource_request_t, storage) }, \ + } \ +} +#endif /** * @brief Pack a resource_request message @@ -46,32 +62,28 @@ typedef struct __mavlink_resource_request_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_resource_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t request_id, uint8_t uri_type, const uint8_t *uri, uint8_t transfer_type, const uint8_t *storage) + uint8_t request_id, uint8_t uri_type, const uint8_t *uri, uint8_t transfer_type, const uint8_t *storage) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN]; - _mav_put_uint8_t(buf, 0, request_id); - _mav_put_uint8_t(buf, 1, uri_type); - _mav_put_uint8_t(buf, 122, transfer_type); - _mav_put_uint8_t_array(buf, 2, uri, 120); - _mav_put_uint8_t_array(buf, 123, storage, 120); + char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN]; + _mav_put_uint8_t(buf, 0, request_id); + _mav_put_uint8_t(buf, 1, uri_type); + _mav_put_uint8_t(buf, 122, transfer_type); + _mav_put_uint8_t_array(buf, 2, uri, 120); + _mav_put_uint8_t_array(buf, 123, storage, 120); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); #else - mavlink_resource_request_t packet; - packet.request_id = request_id; - packet.uri_type = uri_type; - packet.transfer_type = transfer_type; - mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120); - mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120); + mavlink_resource_request_t packet; + packet.request_id = request_id; + packet.uri_type = uri_type; + packet.transfer_type = transfer_type; + mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120); + mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RESOURCE_REQUEST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RESOURCE_REQUEST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); } /** @@ -88,33 +100,29 @@ static inline uint16_t mavlink_msg_resource_request_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_resource_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t request_id,uint8_t uri_type,const uint8_t *uri,uint8_t transfer_type,const uint8_t *storage) + mavlink_message_t* msg, + uint8_t request_id,uint8_t uri_type,const uint8_t *uri,uint8_t transfer_type,const uint8_t *storage) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN]; - _mav_put_uint8_t(buf, 0, request_id); - _mav_put_uint8_t(buf, 1, uri_type); - _mav_put_uint8_t(buf, 122, transfer_type); - _mav_put_uint8_t_array(buf, 2, uri, 120); - _mav_put_uint8_t_array(buf, 123, storage, 120); + char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN]; + _mav_put_uint8_t(buf, 0, request_id); + _mav_put_uint8_t(buf, 1, uri_type); + _mav_put_uint8_t(buf, 122, transfer_type); + _mav_put_uint8_t_array(buf, 2, uri, 120); + _mav_put_uint8_t_array(buf, 123, storage, 120); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); #else - mavlink_resource_request_t packet; - packet.request_id = request_id; - packet.uri_type = uri_type; - packet.transfer_type = transfer_type; - mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120); - mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120); + mavlink_resource_request_t packet; + packet.request_id = request_id; + packet.uri_type = uri_type; + packet.transfer_type = transfer_type; + mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120); + mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_RESOURCE_REQUEST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_RESOURCE_REQUEST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); } /** @@ -127,7 +135,7 @@ static inline uint16_t mavlink_msg_resource_request_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_resource_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_resource_request_t* resource_request) { - return mavlink_msg_resource_request_pack(system_id, component_id, msg, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage); + return mavlink_msg_resource_request_pack(system_id, component_id, msg, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage); } /** @@ -141,7 +149,7 @@ static inline uint16_t mavlink_msg_resource_request_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_resource_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_resource_request_t* resource_request) { - return mavlink_msg_resource_request_pack_chan(system_id, component_id, chan, msg, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage); + return mavlink_msg_resource_request_pack_chan(system_id, component_id, chan, msg, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage); } /** @@ -159,29 +167,35 @@ static inline uint16_t mavlink_msg_resource_request_encode_chan(uint8_t system_i static inline void mavlink_msg_resource_request_send(mavlink_channel_t chan, uint8_t request_id, uint8_t uri_type, const uint8_t *uri, uint8_t transfer_type, const uint8_t *storage) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN]; - _mav_put_uint8_t(buf, 0, request_id); - _mav_put_uint8_t(buf, 1, uri_type); - _mav_put_uint8_t(buf, 122, transfer_type); - _mav_put_uint8_t_array(buf, 2, uri, 120); - _mav_put_uint8_t_array(buf, 123, storage, 120); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); + char buf[MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN]; + _mav_put_uint8_t(buf, 0, request_id); + _mav_put_uint8_t(buf, 1, uri_type); + _mav_put_uint8_t(buf, 122, transfer_type); + _mav_put_uint8_t_array(buf, 2, uri, 120); + _mav_put_uint8_t_array(buf, 123, storage, 120); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); + mavlink_resource_request_t packet; + packet.request_id = request_id; + packet.uri_type = uri_type; + packet.transfer_type = transfer_type; + mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120); + mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); #endif +} + +/** + * @brief Send a resource_request message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_resource_request_send_struct(mavlink_channel_t chan, const mavlink_resource_request_t* resource_request) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_resource_request_send(chan, resource_request->request_id, resource_request->uri_type, resource_request->uri, resource_request->transfer_type, resource_request->storage); #else - mavlink_resource_request_t packet; - packet.request_id = request_id; - packet.uri_type = uri_type; - packet.transfer_type = transfer_type; - mav_array_memcpy(packet.uri, uri, sizeof(uint8_t)*120); - mav_array_memcpy(packet.storage, storage, sizeof(uint8_t)*120); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)resource_request, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); #endif } @@ -196,29 +210,21 @@ static inline void mavlink_msg_resource_request_send(mavlink_channel_t chan, uin static inline void mavlink_msg_resource_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t request_id, uint8_t uri_type, const uint8_t *uri, uint8_t transfer_type, const uint8_t *storage) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, request_id); - _mav_put_uint8_t(buf, 1, uri_type); - _mav_put_uint8_t(buf, 122, transfer_type); - _mav_put_uint8_t_array(buf, 2, uri, 120); - _mav_put_uint8_t_array(buf, 123, storage, 120); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, request_id); + _mav_put_uint8_t(buf, 1, uri_type); + _mav_put_uint8_t(buf, 122, transfer_type); + _mav_put_uint8_t_array(buf, 2, uri, 120); + _mav_put_uint8_t_array(buf, 123, storage, 120); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, buf, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); -#endif -#else - mavlink_resource_request_t *packet = (mavlink_resource_request_t *)msgbuf; - packet->request_id = request_id; - packet->uri_type = uri_type; - packet->transfer_type = transfer_type; - mav_array_memcpy(packet->uri, uri, sizeof(uint8_t)*120); - mav_array_memcpy(packet->storage, storage, sizeof(uint8_t)*120); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); -#endif + mavlink_resource_request_t *packet = (mavlink_resource_request_t *)msgbuf; + packet->request_id = request_id; + packet->uri_type = uri_type; + packet->transfer_type = transfer_type; + mav_array_memcpy(packet->uri, uri, sizeof(uint8_t)*120); + mav_array_memcpy(packet->storage, storage, sizeof(uint8_t)*120); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESOURCE_REQUEST, (const char *)packet, MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN, MAVLINK_MSG_ID_RESOURCE_REQUEST_CRC); #endif } #endif @@ -235,7 +241,7 @@ static inline void mavlink_msg_resource_request_send_buf(mavlink_message_t *msgb */ static inline uint8_t mavlink_msg_resource_request_get_request_id(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -245,7 +251,7 @@ static inline uint8_t mavlink_msg_resource_request_get_request_id(const mavlink_ */ static inline uint8_t mavlink_msg_resource_request_get_uri_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 1); + return _MAV_RETURN_uint8_t(msg, 1); } /** @@ -255,7 +261,7 @@ static inline uint8_t mavlink_msg_resource_request_get_uri_type(const mavlink_me */ static inline uint16_t mavlink_msg_resource_request_get_uri(const mavlink_message_t* msg, uint8_t *uri) { - return _MAV_RETURN_uint8_t_array(msg, uri, 120, 2); + return _MAV_RETURN_uint8_t_array(msg, uri, 120, 2); } /** @@ -265,7 +271,7 @@ static inline uint16_t mavlink_msg_resource_request_get_uri(const mavlink_messag */ static inline uint8_t mavlink_msg_resource_request_get_transfer_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 122); + return _MAV_RETURN_uint8_t(msg, 122); } /** @@ -275,7 +281,7 @@ static inline uint8_t mavlink_msg_resource_request_get_transfer_type(const mavli */ static inline uint16_t mavlink_msg_resource_request_get_storage(const mavlink_message_t* msg, uint8_t *storage) { - return _MAV_RETURN_uint8_t_array(msg, storage, 120, 123); + return _MAV_RETURN_uint8_t_array(msg, storage, 120, 123); } /** @@ -286,13 +292,15 @@ static inline uint16_t mavlink_msg_resource_request_get_storage(const mavlink_me */ static inline void mavlink_msg_resource_request_decode(const mavlink_message_t* msg, mavlink_resource_request_t* resource_request) { -#if MAVLINK_NEED_BYTE_SWAP - resource_request->request_id = mavlink_msg_resource_request_get_request_id(msg); - resource_request->uri_type = mavlink_msg_resource_request_get_uri_type(msg); - mavlink_msg_resource_request_get_uri(msg, resource_request->uri); - resource_request->transfer_type = mavlink_msg_resource_request_get_transfer_type(msg); - mavlink_msg_resource_request_get_storage(msg, resource_request->storage); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + resource_request->request_id = mavlink_msg_resource_request_get_request_id(msg); + resource_request->uri_type = mavlink_msg_resource_request_get_uri_type(msg); + mavlink_msg_resource_request_get_uri(msg, resource_request->uri); + resource_request->transfer_type = mavlink_msg_resource_request_get_transfer_type(msg); + mavlink_msg_resource_request_get_storage(msg, resource_request->storage); #else - memcpy(resource_request, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN; + memset(resource_request, 0, MAVLINK_MSG_ID_RESOURCE_REQUEST_LEN); + memcpy(resource_request, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_allowed_area.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_allowed_area.h index 234f77d..a55953a 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_allowed_area.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_allowed_area.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SAFETY_ALLOWED_AREA PACKING #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA 55 -typedef struct __mavlink_safety_allowed_area_t -{ +MAVPACKED( +typedef struct __mavlink_safety_allowed_area_t { float p1x; /*< x position 1 / Latitude 1*/ float p1y; /*< y position 1 / Longitude 1*/ float p1z; /*< z position 1 / Altitude 1*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_safety_allowed_area_t float p2y; /*< y position 2 / Longitude 2*/ float p2z; /*< z position 2 / Altitude 2*/ uint8_t frame; /*< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/ -} mavlink_safety_allowed_area_t; +}) mavlink_safety_allowed_area_t; #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN 25 +#define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN 25 #define MAVLINK_MSG_ID_55_LEN 25 +#define MAVLINK_MSG_ID_55_MIN_LEN 25 #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC 3 #define MAVLINK_MSG_ID_55_CRC 3 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \ - "SAFETY_ALLOWED_AREA", \ - 7, \ - { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ + 55, \ + "SAFETY_ALLOWED_AREA", \ + 7, \ + { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_allowed_area_t, p1y) }, \ { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_allowed_area_t, p1z) }, \ { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_allowed_area_t, p2x) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_safety_allowed_area_t { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \ + "SAFETY_ALLOWED_AREA", \ + 7, \ + { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ + { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_allowed_area_t, p1y) }, \ + { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_allowed_area_t, p1z) }, \ + { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_allowed_area_t, p2x) }, \ + { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_allowed_area_t, p2y) }, \ + { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_allowed_area_t, p2z) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_allowed_area_t, frame) }, \ + } \ +} +#endif /** * @brief Pack a safety_allowed_area message @@ -51,38 +69,34 @@ typedef struct __mavlink_safety_allowed_area_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) + uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, frame); + char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #else - mavlink_safety_allowed_area_t packet; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - packet.frame = frame; + mavlink_safety_allowed_area_t packet; + packet.p1x = p1x; + packet.p1y = p1y; + packet.p1z = p1z; + packet.p2x = p2x; + packet.p2y = p2y; + packet.p2z = p2z; + packet.frame = frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) + mavlink_message_t* msg, + uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, frame); + char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #else - mavlink_safety_allowed_area_t packet; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - packet.frame = frame; + mavlink_safety_allowed_area_t packet; + packet.p1x = p1x; + packet.p1y = p1y; + packet.p1z = p1z; + packet.p2x = p2x; + packet.p2y = p2y; + packet.p2z = p2z; + packet.frame = frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_ */ static inline uint16_t mavlink_msg_safety_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_allowed_area_t* safety_allowed_area) { - return mavlink_msg_safety_allowed_area_pack(system_id, component_id, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z); + return mavlink_msg_safety_allowed_area_pack(system_id, component_id, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_safety_allowed_area_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_safety_allowed_area_t* safety_allowed_area) { - return mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, chan, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z); + return mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, chan, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_safety_allowed_area_encode_chan(uint8_t syste static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); + char buf[MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN]; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); + mavlink_safety_allowed_area_t packet; + packet.p1x = p1x; + packet.p1y = p1y; + packet.p1z = p1z; + packet.p2x = p2x; + packet.p2y = p2y; + packet.p2z = p2z; + packet.frame = frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); #endif +} + +/** + * @brief Send a safety_allowed_area message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_safety_allowed_area_send_struct(mavlink_channel_t chan, const mavlink_safety_allowed_area_t* safety_allowed_area) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_safety_allowed_area_send(chan, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z); #else - mavlink_safety_allowed_area_t packet; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - packet.frame = frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)safety_allowed_area, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, static inline void mavlink_msg_safety_allowed_area_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); -#endif -#else - mavlink_safety_allowed_area_t *packet = (mavlink_safety_allowed_area_t *)msgbuf; - packet->p1x = p1x; - packet->p1y = p1y; - packet->p1z = p1z; - packet->p2x = p2x; - packet->p2y = p2y; - packet->p2z = p2z; - packet->frame = frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); -#endif + mavlink_safety_allowed_area_t *packet = (mavlink_safety_allowed_area_t *)msgbuf; + packet->p1x = p1x; + packet->p1y = p1y; + packet->p1z = p1z; + packet->p2x = p2x; + packet->p2y = p2y; + packet->p2z = p2z; + packet->frame = frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_safety_allowed_area_send_buf(mavlink_message_t *m */ static inline uint8_t mavlink_msg_safety_allowed_area_get_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 24); + return _MAV_RETURN_uint8_t(msg, 24); } /** @@ -278,7 +286,7 @@ static inline uint8_t mavlink_msg_safety_allowed_area_get_frame(const mavlink_me */ static inline float mavlink_msg_safety_allowed_area_get_p1x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p1x(const mavlink_messag */ static inline float mavlink_msg_safety_allowed_area_get_p1y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p1y(const mavlink_messag */ static inline float mavlink_msg_safety_allowed_area_get_p1z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p1z(const mavlink_messag */ static inline float mavlink_msg_safety_allowed_area_get_p2x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p2x(const mavlink_messag */ static inline float mavlink_msg_safety_allowed_area_get_p2y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_safety_allowed_area_get_p2y(const mavlink_messag */ static inline float mavlink_msg_safety_allowed_area_get_p2z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_safety_allowed_area_get_p2z(const mavlink_messag */ static inline void mavlink_msg_safety_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_allowed_area_t* safety_allowed_area) { -#if MAVLINK_NEED_BYTE_SWAP - safety_allowed_area->p1x = mavlink_msg_safety_allowed_area_get_p1x(msg); - safety_allowed_area->p1y = mavlink_msg_safety_allowed_area_get_p1y(msg); - safety_allowed_area->p1z = mavlink_msg_safety_allowed_area_get_p1z(msg); - safety_allowed_area->p2x = mavlink_msg_safety_allowed_area_get_p2x(msg); - safety_allowed_area->p2y = mavlink_msg_safety_allowed_area_get_p2y(msg); - safety_allowed_area->p2z = mavlink_msg_safety_allowed_area_get_p2z(msg); - safety_allowed_area->frame = mavlink_msg_safety_allowed_area_get_frame(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + safety_allowed_area->p1x = mavlink_msg_safety_allowed_area_get_p1x(msg); + safety_allowed_area->p1y = mavlink_msg_safety_allowed_area_get_p1y(msg); + safety_allowed_area->p1z = mavlink_msg_safety_allowed_area_get_p1z(msg); + safety_allowed_area->p2x = mavlink_msg_safety_allowed_area_get_p2x(msg); + safety_allowed_area->p2y = mavlink_msg_safety_allowed_area_get_p2y(msg); + safety_allowed_area->p2z = mavlink_msg_safety_allowed_area_get_p2z(msg); + safety_allowed_area->frame = mavlink_msg_safety_allowed_area_get_frame(msg); #else - memcpy(safety_allowed_area, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN? msg->len : MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN; + memset(safety_allowed_area, 0, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN); + memcpy(safety_allowed_area, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_set_allowed_area.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_set_allowed_area.h index 8d9c83d..da917fe 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_set_allowed_area.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_safety_set_allowed_area.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SAFETY_SET_ALLOWED_AREA PACKING #define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA 54 -typedef struct __mavlink_safety_set_allowed_area_t -{ +MAVPACKED( +typedef struct __mavlink_safety_set_allowed_area_t { float p1x; /*< x position 1 / Latitude 1*/ float p1y; /*< y position 1 / Longitude 1*/ float p1z; /*< z position 1 / Altitude 1*/ @@ -13,20 +14,24 @@ typedef struct __mavlink_safety_set_allowed_area_t uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ uint8_t frame; /*< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/ -} mavlink_safety_set_allowed_area_t; +}) mavlink_safety_set_allowed_area_t; #define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN 27 +#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN 27 #define MAVLINK_MSG_ID_54_LEN 27 +#define MAVLINK_MSG_ID_54_MIN_LEN 27 #define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC 15 #define MAVLINK_MSG_ID_54_CRC 15 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA { \ - "SAFETY_SET_ALLOWED_AREA", \ - 9, \ - { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ + 54, \ + "SAFETY_SET_ALLOWED_AREA", \ + 9, \ + { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) }, \ { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) }, \ { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) }, \ @@ -37,7 +42,22 @@ typedef struct __mavlink_safety_set_allowed_area_t { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA { \ + "SAFETY_SET_ALLOWED_AREA", \ + 9, \ + { { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) }, \ + { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) }, \ + { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) }, \ + { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) }, \ + { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_set_allowed_area_t, p2y) }, \ + { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_set_allowed_area_t, p2z) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) }, \ + { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) }, \ + } \ +} +#endif /** * @brief Pack a safety_set_allowed_area message @@ -57,42 +77,38 @@ typedef struct __mavlink_safety_set_allowed_area_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) + uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, target_system); - _mav_put_uint8_t(buf, 25, target_component); - _mav_put_uint8_t(buf, 26, frame); + char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, target_system); + _mav_put_uint8_t(buf, 25, target_component); + _mav_put_uint8_t(buf, 26, frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #else - mavlink_safety_set_allowed_area_t packet; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; + mavlink_safety_set_allowed_area_t packet; + packet.p1x = p1x; + packet.p1y = p1y; + packet.p1z = p1z; + packet.p2x = p2x; + packet.p2y = p2y; + packet.p2z = p2z; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); } /** @@ -113,43 +129,39 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t target_component,uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) + mavlink_message_t* msg, + uint8_t target_system,uint8_t target_component,uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, target_system); - _mav_put_uint8_t(buf, 25, target_component); - _mav_put_uint8_t(buf, 26, frame); + char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, target_system); + _mav_put_uint8_t(buf, 25, target_component); + _mav_put_uint8_t(buf, 26, frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #else - mavlink_safety_set_allowed_area_t packet; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; + mavlink_safety_set_allowed_area_t packet; + packet.p1x = p1x; + packet.p1y = p1y; + packet.p1z = p1z; + packet.p2x = p2x; + packet.p2y = p2y; + packet.p2z = p2z; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); } /** @@ -162,7 +174,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys */ static inline uint16_t mavlink_msg_safety_set_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area) { - return mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z); + return mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z); } /** @@ -176,7 +188,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_encode(uint8_t system */ static inline uint16_t mavlink_msg_safety_set_allowed_area_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area) { - return mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, chan, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z); + return mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, chan, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z); } /** @@ -198,39 +210,45 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_encode_chan(uint8_t s static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, target_system); - _mav_put_uint8_t(buf, 25, target_component); - _mav_put_uint8_t(buf, 26, frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); + char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN]; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, target_system); + _mav_put_uint8_t(buf, 25, target_component); + _mav_put_uint8_t(buf, 26, frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); + mavlink_safety_set_allowed_area_t packet; + packet.p1x = p1x; + packet.p1y = p1y; + packet.p1z = p1z; + packet.p2x = p2x; + packet.p2y = p2y; + packet.p2z = p2z; + packet.target_system = target_system; + packet.target_component = target_component; + packet.frame = frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); #endif +} + +/** + * @brief Send a safety_set_allowed_area message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_safety_set_allowed_area_send_struct(mavlink_channel_t chan, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_safety_set_allowed_area_send(chan, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z); #else - mavlink_safety_set_allowed_area_t packet; - packet.p1x = p1x; - packet.p1y = p1y; - packet.p1z = p1z; - packet.p2x = p2x; - packet.p2y = p2y; - packet.p2z = p2z; - packet.target_system = target_system; - packet.target_component = target_component; - packet.frame = frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)safety_set_allowed_area, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); #endif } @@ -245,39 +263,31 @@ static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t ch static inline void mavlink_msg_safety_set_allowed_area_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, p1x); - _mav_put_float(buf, 4, p1y); - _mav_put_float(buf, 8, p1z); - _mav_put_float(buf, 12, p2x); - _mav_put_float(buf, 16, p2y); - _mav_put_float(buf, 20, p2z); - _mav_put_uint8_t(buf, 24, target_system); - _mav_put_uint8_t(buf, 25, target_component); - _mav_put_uint8_t(buf, 26, frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); -#endif -#else - mavlink_safety_set_allowed_area_t *packet = (mavlink_safety_set_allowed_area_t *)msgbuf; - packet->p1x = p1x; - packet->p1y = p1y; - packet->p1z = p1z; - packet->p2x = p2x; - packet->p2y = p2y; - packet->p2z = p2z; - packet->target_system = target_system; - packet->target_component = target_component; - packet->frame = frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, p1x); + _mav_put_float(buf, 4, p1y); + _mav_put_float(buf, 8, p1z); + _mav_put_float(buf, 12, p2x); + _mav_put_float(buf, 16, p2y); + _mav_put_float(buf, 20, p2z); + _mav_put_uint8_t(buf, 24, target_system); + _mav_put_uint8_t(buf, 25, target_component); + _mav_put_uint8_t(buf, 26, frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); -#endif + mavlink_safety_set_allowed_area_t *packet = (mavlink_safety_set_allowed_area_t *)msgbuf; + packet->p1x = p1x; + packet->p1y = p1y; + packet->p1z = p1z; + packet->p2x = p2x; + packet->p2y = p2y; + packet->p2z = p2z; + packet->target_system = target_system; + packet->target_component = target_component; + packet->frame = frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC); #endif } #endif @@ -294,7 +304,7 @@ static inline void mavlink_msg_safety_set_allowed_area_send_buf(mavlink_message_ */ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 24); + return _MAV_RETURN_uint8_t(msg, 24); } /** @@ -304,7 +314,7 @@ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_system(cons */ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 25); + return _MAV_RETURN_uint8_t(msg, 25); } /** @@ -314,7 +324,7 @@ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_component(c */ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 26); + return _MAV_RETURN_uint8_t(msg, 26); } /** @@ -324,7 +334,7 @@ static inline uint8_t mavlink_msg_safety_set_allowed_area_get_frame(const mavlin */ static inline float mavlink_msg_safety_set_allowed_area_get_p1x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -334,7 +344,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p1x(const mavlink_me */ static inline float mavlink_msg_safety_set_allowed_area_get_p1y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -344,7 +354,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p1y(const mavlink_me */ static inline float mavlink_msg_safety_set_allowed_area_get_p1z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -354,7 +364,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p1z(const mavlink_me */ static inline float mavlink_msg_safety_set_allowed_area_get_p2x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -364,7 +374,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p2x(const mavlink_me */ static inline float mavlink_msg_safety_set_allowed_area_get_p2y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -374,7 +384,7 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p2y(const mavlink_me */ static inline float mavlink_msg_safety_set_allowed_area_get_p2z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -385,17 +395,19 @@ static inline float mavlink_msg_safety_set_allowed_area_get_p2z(const mavlink_me */ static inline void mavlink_msg_safety_set_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_set_allowed_area_t* safety_set_allowed_area) { -#if MAVLINK_NEED_BYTE_SWAP - safety_set_allowed_area->p1x = mavlink_msg_safety_set_allowed_area_get_p1x(msg); - safety_set_allowed_area->p1y = mavlink_msg_safety_set_allowed_area_get_p1y(msg); - safety_set_allowed_area->p1z = mavlink_msg_safety_set_allowed_area_get_p1z(msg); - safety_set_allowed_area->p2x = mavlink_msg_safety_set_allowed_area_get_p2x(msg); - safety_set_allowed_area->p2y = mavlink_msg_safety_set_allowed_area_get_p2y(msg); - safety_set_allowed_area->p2z = mavlink_msg_safety_set_allowed_area_get_p2z(msg); - safety_set_allowed_area->target_system = mavlink_msg_safety_set_allowed_area_get_target_system(msg); - safety_set_allowed_area->target_component = mavlink_msg_safety_set_allowed_area_get_target_component(msg); - safety_set_allowed_area->frame = mavlink_msg_safety_set_allowed_area_get_frame(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + safety_set_allowed_area->p1x = mavlink_msg_safety_set_allowed_area_get_p1x(msg); + safety_set_allowed_area->p1y = mavlink_msg_safety_set_allowed_area_get_p1y(msg); + safety_set_allowed_area->p1z = mavlink_msg_safety_set_allowed_area_get_p1z(msg); + safety_set_allowed_area->p2x = mavlink_msg_safety_set_allowed_area_get_p2x(msg); + safety_set_allowed_area->p2y = mavlink_msg_safety_set_allowed_area_get_p2y(msg); + safety_set_allowed_area->p2z = mavlink_msg_safety_set_allowed_area_get_p2z(msg); + safety_set_allowed_area->target_system = mavlink_msg_safety_set_allowed_area_get_target_system(msg); + safety_set_allowed_area->target_component = mavlink_msg_safety_set_allowed_area_get_target_component(msg); + safety_set_allowed_area->frame = mavlink_msg_safety_set_allowed_area_get_frame(msg); #else - memcpy(safety_set_allowed_area, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN? msg->len : MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN; + memset(safety_set_allowed_area, 0, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN); + memcpy(safety_set_allowed_area, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu.h index e9a2dc3..d803be5 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SCALED_IMU PACKING #define MAVLINK_MSG_ID_SCALED_IMU 26 -typedef struct __mavlink_scaled_imu_t -{ +MAVPACKED( +typedef struct __mavlink_scaled_imu_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ int16_t xacc; /*< X acceleration (mg)*/ int16_t yacc; /*< Y acceleration (mg)*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_scaled_imu_t int16_t xmag; /*< X Magnetic field (milli tesla)*/ int16_t ymag; /*< Y Magnetic field (milli tesla)*/ int16_t zmag; /*< Z Magnetic field (milli tesla)*/ -} mavlink_scaled_imu_t; +}) mavlink_scaled_imu_t; #define MAVLINK_MSG_ID_SCALED_IMU_LEN 22 +#define MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN 22 #define MAVLINK_MSG_ID_26_LEN 22 +#define MAVLINK_MSG_ID_26_MIN_LEN 22 #define MAVLINK_MSG_ID_SCALED_IMU_CRC 170 #define MAVLINK_MSG_ID_26_CRC 170 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SCALED_IMU { \ - "SCALED_IMU", \ - 10, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu_t, time_boot_ms) }, \ + 26, \ + "SCALED_IMU", \ + 10, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu_t, time_boot_ms) }, \ { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu_t, xacc) }, \ { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu_t, yacc) }, \ { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu_t, zacc) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_scaled_imu_t { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu_t, zmag) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SCALED_IMU { \ + "SCALED_IMU", \ + 10, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu_t, time_boot_ms) }, \ + { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu_t, zacc) }, \ + { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu_t, xgyro) }, \ + { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu_t, ygyro) }, \ + { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu_t, zgyro) }, \ + { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu_t, xmag) }, \ + { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu_t, ymag) }, \ + { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu_t, zmag) }, \ + } \ +} +#endif /** * @brief Pack a scaled_imu message @@ -60,44 +81,40 @@ typedef struct __mavlink_scaled_imu_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) + uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); + char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU_LEN); #else - mavlink_scaled_imu_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_scaled_imu_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) + mavlink_message_t* msg, + uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); + char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU_LEN); #else - mavlink_scaled_imu_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_scaled_imu_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_IMU; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_scaled_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu_t* scaled_imu) { - return mavlink_msg_scaled_imu_pack(system_id, component_id, msg, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag); + return mavlink_msg_scaled_imu_pack(system_id, component_id, msg, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_scaled_imu_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_scaled_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_imu_t* scaled_imu) { - return mavlink_msg_scaled_imu_pack_chan(system_id, component_id, chan, msg, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag); + return mavlink_msg_scaled_imu_pack_chan(system_id, component_id, chan, msg, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_scaled_imu_encode_chan(uint8_t system_id, uin static inline void mavlink_msg_scaled_imu_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); + char buf[MAVLINK_MSG_ID_SCALED_IMU_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_LEN); + mavlink_scaled_imu_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); #endif +} + +/** + * @brief Send a scaled_imu message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_scaled_imu_send_struct(mavlink_channel_t chan, const mavlink_scaled_imu_t* scaled_imu) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_scaled_imu_send(chan, scaled_imu->time_boot_ms, scaled_imu->xacc, scaled_imu->yacc, scaled_imu->zacc, scaled_imu->xgyro, scaled_imu->ygyro, scaled_imu->zgyro, scaled_imu->xmag, scaled_imu->ymag, scaled_imu->zmag); #else - mavlink_scaled_imu_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)scaled_imu, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_scaled_imu_send(mavlink_channel_t chan, uint32_t static inline void mavlink_msg_scaled_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_LEN); -#endif -#else - mavlink_scaled_imu_t *packet = (mavlink_scaled_imu_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - packet->xgyro = xgyro; - packet->ygyro = ygyro; - packet->zgyro = zgyro; - packet->xmag = xmag; - packet->ymag = ymag; - packet->zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, buf, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU_LEN); -#endif + mavlink_scaled_imu_t *packet = (mavlink_scaled_imu_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + packet->xgyro = xgyro; + packet->ygyro = ygyro; + packet->zgyro = zgyro; + packet->xmag = xmag; + packet->ymag = ymag; + packet->zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU_LEN, MAVLINK_MSG_ID_SCALED_IMU_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_scaled_imu_send_buf(mavlink_message_t *msgbuf, ma */ static inline uint32_t mavlink_msg_scaled_imu_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -317,7 +328,7 @@ static inline uint32_t mavlink_msg_scaled_imu_get_time_boot_ms(const mavlink_mes */ static inline int16_t mavlink_msg_scaled_imu_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 4); + return _MAV_RETURN_int16_t(msg, 4); } /** @@ -327,7 +338,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_xacc(const mavlink_message_t* m */ static inline int16_t mavlink_msg_scaled_imu_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 6); + return _MAV_RETURN_int16_t(msg, 6); } /** @@ -337,7 +348,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_yacc(const mavlink_message_t* m */ static inline int16_t mavlink_msg_scaled_imu_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 8); + return _MAV_RETURN_int16_t(msg, 8); } /** @@ -347,7 +358,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_zacc(const mavlink_message_t* m */ static inline int16_t mavlink_msg_scaled_imu_get_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 10); + return _MAV_RETURN_int16_t(msg, 10); } /** @@ -357,7 +368,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_xgyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu_get_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -367,7 +378,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_ygyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu_get_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 14); + return _MAV_RETURN_int16_t(msg, 14); } /** @@ -377,7 +388,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_zgyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu_get_xmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -387,7 +398,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_xmag(const mavlink_message_t* m */ static inline int16_t mavlink_msg_scaled_imu_get_ymag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 18); + return _MAV_RETURN_int16_t(msg, 18); } /** @@ -397,7 +408,7 @@ static inline int16_t mavlink_msg_scaled_imu_get_ymag(const mavlink_message_t* m */ static inline int16_t mavlink_msg_scaled_imu_get_zmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -408,18 +419,20 @@ static inline int16_t mavlink_msg_scaled_imu_get_zmag(const mavlink_message_t* m */ static inline void mavlink_msg_scaled_imu_decode(const mavlink_message_t* msg, mavlink_scaled_imu_t* scaled_imu) { -#if MAVLINK_NEED_BYTE_SWAP - scaled_imu->time_boot_ms = mavlink_msg_scaled_imu_get_time_boot_ms(msg); - scaled_imu->xacc = mavlink_msg_scaled_imu_get_xacc(msg); - scaled_imu->yacc = mavlink_msg_scaled_imu_get_yacc(msg); - scaled_imu->zacc = mavlink_msg_scaled_imu_get_zacc(msg); - scaled_imu->xgyro = mavlink_msg_scaled_imu_get_xgyro(msg); - scaled_imu->ygyro = mavlink_msg_scaled_imu_get_ygyro(msg); - scaled_imu->zgyro = mavlink_msg_scaled_imu_get_zgyro(msg); - scaled_imu->xmag = mavlink_msg_scaled_imu_get_xmag(msg); - scaled_imu->ymag = mavlink_msg_scaled_imu_get_ymag(msg); - scaled_imu->zmag = mavlink_msg_scaled_imu_get_zmag(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + scaled_imu->time_boot_ms = mavlink_msg_scaled_imu_get_time_boot_ms(msg); + scaled_imu->xacc = mavlink_msg_scaled_imu_get_xacc(msg); + scaled_imu->yacc = mavlink_msg_scaled_imu_get_yacc(msg); + scaled_imu->zacc = mavlink_msg_scaled_imu_get_zacc(msg); + scaled_imu->xgyro = mavlink_msg_scaled_imu_get_xgyro(msg); + scaled_imu->ygyro = mavlink_msg_scaled_imu_get_ygyro(msg); + scaled_imu->zgyro = mavlink_msg_scaled_imu_get_zgyro(msg); + scaled_imu->xmag = mavlink_msg_scaled_imu_get_xmag(msg); + scaled_imu->ymag = mavlink_msg_scaled_imu_get_ymag(msg); + scaled_imu->zmag = mavlink_msg_scaled_imu_get_zmag(msg); #else - memcpy(scaled_imu, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_IMU_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_IMU_LEN? msg->len : MAVLINK_MSG_ID_SCALED_IMU_LEN; + memset(scaled_imu, 0, MAVLINK_MSG_ID_SCALED_IMU_LEN); + memcpy(scaled_imu, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu2.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu2.h index 57b6dfb..d647916 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu2.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu2.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SCALED_IMU2 PACKING #define MAVLINK_MSG_ID_SCALED_IMU2 116 -typedef struct __mavlink_scaled_imu2_t -{ +MAVPACKED( +typedef struct __mavlink_scaled_imu2_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ int16_t xacc; /*< X acceleration (mg)*/ int16_t yacc; /*< Y acceleration (mg)*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_scaled_imu2_t int16_t xmag; /*< X Magnetic field (milli tesla)*/ int16_t ymag; /*< Y Magnetic field (milli tesla)*/ int16_t zmag; /*< Z Magnetic field (milli tesla)*/ -} mavlink_scaled_imu2_t; +}) mavlink_scaled_imu2_t; #define MAVLINK_MSG_ID_SCALED_IMU2_LEN 22 +#define MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN 22 #define MAVLINK_MSG_ID_116_LEN 22 +#define MAVLINK_MSG_ID_116_MIN_LEN 22 #define MAVLINK_MSG_ID_SCALED_IMU2_CRC 76 #define MAVLINK_MSG_ID_116_CRC 76 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SCALED_IMU2 { \ - "SCALED_IMU2", \ - 10, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu2_t, time_boot_ms) }, \ + 116, \ + "SCALED_IMU2", \ + 10, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu2_t, time_boot_ms) }, \ { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu2_t, xacc) }, \ { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu2_t, yacc) }, \ { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu2_t, zacc) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_scaled_imu2_t { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu2_t, zmag) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SCALED_IMU2 { \ + "SCALED_IMU2", \ + 10, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu2_t, time_boot_ms) }, \ + { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu2_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu2_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu2_t, zacc) }, \ + { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu2_t, xgyro) }, \ + { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu2_t, ygyro) }, \ + { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu2_t, zgyro) }, \ + { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu2_t, xmag) }, \ + { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu2_t, ymag) }, \ + { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu2_t, zmag) }, \ + } \ +} +#endif /** * @brief Pack a scaled_imu2 message @@ -60,44 +81,40 @@ typedef struct __mavlink_scaled_imu2_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) + uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); + char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN); #else - mavlink_scaled_imu2_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_scaled_imu2_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU2_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_scaled_imu2_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) + mavlink_message_t* msg, + uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); + char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN); #else - mavlink_scaled_imu2_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_scaled_imu2_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU2_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_IMU2; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_scaled_imu2_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_scaled_imu2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu2_t* scaled_imu2) { - return mavlink_msg_scaled_imu2_pack(system_id, component_id, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag); + return mavlink_msg_scaled_imu2_pack(system_id, component_id, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_scaled_imu2_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_scaled_imu2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_imu2_t* scaled_imu2) { - return mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, chan, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag); + return mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, chan, msg, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_scaled_imu2_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_scaled_imu2_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); + char buf[MAVLINK_MSG_ID_SCALED_IMU2_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN); + mavlink_scaled_imu2_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); #endif +} + +/** + * @brief Send a scaled_imu2 message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_scaled_imu2_send_struct(mavlink_channel_t chan, const mavlink_scaled_imu2_t* scaled_imu2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_scaled_imu2_send(chan, scaled_imu2->time_boot_ms, scaled_imu2->xacc, scaled_imu2->yacc, scaled_imu2->zacc, scaled_imu2->xgyro, scaled_imu2->ygyro, scaled_imu2->zgyro, scaled_imu2->xmag, scaled_imu2->ymag, scaled_imu2->zmag); #else - mavlink_scaled_imu2_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)scaled_imu2, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_scaled_imu2_send(mavlink_channel_t chan, uint32_t static inline void mavlink_msg_scaled_imu2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_LEN); -#endif -#else - mavlink_scaled_imu2_t *packet = (mavlink_scaled_imu2_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - packet->xgyro = xgyro; - packet->ygyro = ygyro; - packet->zgyro = zgyro; - packet->xmag = xmag; - packet->ymag = ymag; - packet->zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, buf, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU2_LEN); -#endif + mavlink_scaled_imu2_t *packet = (mavlink_scaled_imu2_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + packet->xgyro = xgyro; + packet->ygyro = ygyro; + packet->zgyro = zgyro; + packet->xmag = xmag; + packet->ymag = ymag; + packet->zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU2, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU2_LEN, MAVLINK_MSG_ID_SCALED_IMU2_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_scaled_imu2_send_buf(mavlink_message_t *msgbuf, m */ static inline uint32_t mavlink_msg_scaled_imu2_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -317,7 +328,7 @@ static inline uint32_t mavlink_msg_scaled_imu2_get_time_boot_ms(const mavlink_me */ static inline int16_t mavlink_msg_scaled_imu2_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 4); + return _MAV_RETURN_int16_t(msg, 4); } /** @@ -327,7 +338,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_xacc(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 6); + return _MAV_RETURN_int16_t(msg, 6); } /** @@ -337,7 +348,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_yacc(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 8); + return _MAV_RETURN_int16_t(msg, 8); } /** @@ -347,7 +358,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_zacc(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 10); + return _MAV_RETURN_int16_t(msg, 10); } /** @@ -357,7 +368,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_xgyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -367,7 +378,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_ygyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 14); + return _MAV_RETURN_int16_t(msg, 14); } /** @@ -377,7 +388,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_zgyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_xmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -387,7 +398,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_xmag(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_ymag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 18); + return _MAV_RETURN_int16_t(msg, 18); } /** @@ -397,7 +408,7 @@ static inline int16_t mavlink_msg_scaled_imu2_get_ymag(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu2_get_zmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -408,18 +419,20 @@ static inline int16_t mavlink_msg_scaled_imu2_get_zmag(const mavlink_message_t* */ static inline void mavlink_msg_scaled_imu2_decode(const mavlink_message_t* msg, mavlink_scaled_imu2_t* scaled_imu2) { -#if MAVLINK_NEED_BYTE_SWAP - scaled_imu2->time_boot_ms = mavlink_msg_scaled_imu2_get_time_boot_ms(msg); - scaled_imu2->xacc = mavlink_msg_scaled_imu2_get_xacc(msg); - scaled_imu2->yacc = mavlink_msg_scaled_imu2_get_yacc(msg); - scaled_imu2->zacc = mavlink_msg_scaled_imu2_get_zacc(msg); - scaled_imu2->xgyro = mavlink_msg_scaled_imu2_get_xgyro(msg); - scaled_imu2->ygyro = mavlink_msg_scaled_imu2_get_ygyro(msg); - scaled_imu2->zgyro = mavlink_msg_scaled_imu2_get_zgyro(msg); - scaled_imu2->xmag = mavlink_msg_scaled_imu2_get_xmag(msg); - scaled_imu2->ymag = mavlink_msg_scaled_imu2_get_ymag(msg); - scaled_imu2->zmag = mavlink_msg_scaled_imu2_get_zmag(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + scaled_imu2->time_boot_ms = mavlink_msg_scaled_imu2_get_time_boot_ms(msg); + scaled_imu2->xacc = mavlink_msg_scaled_imu2_get_xacc(msg); + scaled_imu2->yacc = mavlink_msg_scaled_imu2_get_yacc(msg); + scaled_imu2->zacc = mavlink_msg_scaled_imu2_get_zacc(msg); + scaled_imu2->xgyro = mavlink_msg_scaled_imu2_get_xgyro(msg); + scaled_imu2->ygyro = mavlink_msg_scaled_imu2_get_ygyro(msg); + scaled_imu2->zgyro = mavlink_msg_scaled_imu2_get_zgyro(msg); + scaled_imu2->xmag = mavlink_msg_scaled_imu2_get_xmag(msg); + scaled_imu2->ymag = mavlink_msg_scaled_imu2_get_ymag(msg); + scaled_imu2->zmag = mavlink_msg_scaled_imu2_get_zmag(msg); #else - memcpy(scaled_imu2, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_IMU2_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_IMU2_LEN? msg->len : MAVLINK_MSG_ID_SCALED_IMU2_LEN; + memset(scaled_imu2, 0, MAVLINK_MSG_ID_SCALED_IMU2_LEN); + memcpy(scaled_imu2, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu3.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu3.h index cd19fda..7a12ece 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu3.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_imu3.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SCALED_IMU3 PACKING #define MAVLINK_MSG_ID_SCALED_IMU3 129 -typedef struct __mavlink_scaled_imu3_t -{ +MAVPACKED( +typedef struct __mavlink_scaled_imu3_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ int16_t xacc; /*< X acceleration (mg)*/ int16_t yacc; /*< Y acceleration (mg)*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_scaled_imu3_t int16_t xmag; /*< X Magnetic field (milli tesla)*/ int16_t ymag; /*< Y Magnetic field (milli tesla)*/ int16_t zmag; /*< Z Magnetic field (milli tesla)*/ -} mavlink_scaled_imu3_t; +}) mavlink_scaled_imu3_t; #define MAVLINK_MSG_ID_SCALED_IMU3_LEN 22 +#define MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN 22 #define MAVLINK_MSG_ID_129_LEN 22 +#define MAVLINK_MSG_ID_129_MIN_LEN 22 #define MAVLINK_MSG_ID_SCALED_IMU3_CRC 46 #define MAVLINK_MSG_ID_129_CRC 46 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SCALED_IMU3 { \ - "SCALED_IMU3", \ - 10, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu3_t, time_boot_ms) }, \ + 129, \ + "SCALED_IMU3", \ + 10, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu3_t, time_boot_ms) }, \ { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu3_t, xacc) }, \ { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu3_t, yacc) }, \ { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu3_t, zacc) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_scaled_imu3_t { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu3_t, zmag) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SCALED_IMU3 { \ + "SCALED_IMU3", \ + 10, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_imu3_t, time_boot_ms) }, \ + { "xacc", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_scaled_imu3_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_scaled_imu3_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_scaled_imu3_t, zacc) }, \ + { "xgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_scaled_imu3_t, xgyro) }, \ + { "ygyro", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_imu3_t, ygyro) }, \ + { "zgyro", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_scaled_imu3_t, zgyro) }, \ + { "xmag", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_scaled_imu3_t, xmag) }, \ + { "ymag", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_scaled_imu3_t, ymag) }, \ + { "zmag", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_scaled_imu3_t, zmag) }, \ + } \ +} +#endif /** * @brief Pack a scaled_imu3 message @@ -60,44 +81,40 @@ typedef struct __mavlink_scaled_imu3_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) + uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); + char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN); #else - mavlink_scaled_imu3_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_scaled_imu3_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU3; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU3_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_IMU3; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_scaled_imu3_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_imu3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) + mavlink_message_t* msg, + uint32_t time_boot_ms,int16_t xacc,int16_t yacc,int16_t zacc,int16_t xgyro,int16_t ygyro,int16_t zgyro,int16_t xmag,int16_t ymag,int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); + char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN); #else - mavlink_scaled_imu3_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; + mavlink_scaled_imu3_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_IMU3; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU3_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_IMU3; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_scaled_imu3_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_scaled_imu3_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_imu3_t* scaled_imu3) { - return mavlink_msg_scaled_imu3_pack(system_id, component_id, msg, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag); + return mavlink_msg_scaled_imu3_pack(system_id, component_id, msg, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_scaled_imu3_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_scaled_imu3_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_imu3_t* scaled_imu3) { - return mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, chan, msg, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag); + return mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, chan, msg, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_scaled_imu3_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_scaled_imu3_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); + char buf[MAVLINK_MSG_ID_SCALED_IMU3_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN); + mavlink_scaled_imu3_t packet; + packet.time_boot_ms = time_boot_ms; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.xmag = xmag; + packet.ymag = ymag; + packet.zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); #endif +} + +/** + * @brief Send a scaled_imu3 message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_scaled_imu3_send_struct(mavlink_channel_t chan, const mavlink_scaled_imu3_t* scaled_imu3) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_scaled_imu3_send(chan, scaled_imu3->time_boot_ms, scaled_imu3->xacc, scaled_imu3->yacc, scaled_imu3->zacc, scaled_imu3->xgyro, scaled_imu3->ygyro, scaled_imu3->zgyro, scaled_imu3->xmag, scaled_imu3->ymag, scaled_imu3->zmag); #else - mavlink_scaled_imu3_t packet; - packet.time_boot_ms = time_boot_ms; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.xmag = xmag; - packet.ymag = ymag; - packet.zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)scaled_imu3, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_scaled_imu3_send(mavlink_channel_t chan, uint32_t static inline void mavlink_msg_scaled_imu3_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int16_t(buf, 4, xacc); - _mav_put_int16_t(buf, 6, yacc); - _mav_put_int16_t(buf, 8, zacc); - _mav_put_int16_t(buf, 10, xgyro); - _mav_put_int16_t(buf, 12, ygyro); - _mav_put_int16_t(buf, 14, zgyro); - _mav_put_int16_t(buf, 16, xmag); - _mav_put_int16_t(buf, 18, ymag); - _mav_put_int16_t(buf, 20, zmag); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_LEN); -#endif -#else - mavlink_scaled_imu3_t *packet = (mavlink_scaled_imu3_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - packet->xgyro = xgyro; - packet->ygyro = ygyro; - packet->zgyro = zgyro; - packet->xmag = xmag; - packet->ymag = ymag; - packet->zmag = zmag; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int16_t(buf, 4, xacc); + _mav_put_int16_t(buf, 6, yacc); + _mav_put_int16_t(buf, 8, zacc); + _mav_put_int16_t(buf, 10, xgyro); + _mav_put_int16_t(buf, 12, ygyro); + _mav_put_int16_t(buf, 14, zgyro); + _mav_put_int16_t(buf, 16, xmag); + _mav_put_int16_t(buf, 18, ymag); + _mav_put_int16_t(buf, 20, zmag); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, buf, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU3_LEN); -#endif + mavlink_scaled_imu3_t *packet = (mavlink_scaled_imu3_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + packet->xgyro = xgyro; + packet->ygyro = ygyro; + packet->zgyro = zgyro; + packet->xmag = xmag; + packet->ymag = ymag; + packet->zmag = zmag; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_IMU3, (const char *)packet, MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN, MAVLINK_MSG_ID_SCALED_IMU3_LEN, MAVLINK_MSG_ID_SCALED_IMU3_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_scaled_imu3_send_buf(mavlink_message_t *msgbuf, m */ static inline uint32_t mavlink_msg_scaled_imu3_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -317,7 +328,7 @@ static inline uint32_t mavlink_msg_scaled_imu3_get_time_boot_ms(const mavlink_me */ static inline int16_t mavlink_msg_scaled_imu3_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 4); + return _MAV_RETURN_int16_t(msg, 4); } /** @@ -327,7 +338,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_xacc(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 6); + return _MAV_RETURN_int16_t(msg, 6); } /** @@ -337,7 +348,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_yacc(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 8); + return _MAV_RETURN_int16_t(msg, 8); } /** @@ -347,7 +358,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_zacc(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 10); + return _MAV_RETURN_int16_t(msg, 10); } /** @@ -357,7 +368,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_xgyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -367,7 +378,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_ygyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 14); + return _MAV_RETURN_int16_t(msg, 14); } /** @@ -377,7 +388,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_zgyro(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_xmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -387,7 +398,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_xmag(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_ymag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 18); + return _MAV_RETURN_int16_t(msg, 18); } /** @@ -397,7 +408,7 @@ static inline int16_t mavlink_msg_scaled_imu3_get_ymag(const mavlink_message_t* */ static inline int16_t mavlink_msg_scaled_imu3_get_zmag(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 20); + return _MAV_RETURN_int16_t(msg, 20); } /** @@ -408,18 +419,20 @@ static inline int16_t mavlink_msg_scaled_imu3_get_zmag(const mavlink_message_t* */ static inline void mavlink_msg_scaled_imu3_decode(const mavlink_message_t* msg, mavlink_scaled_imu3_t* scaled_imu3) { -#if MAVLINK_NEED_BYTE_SWAP - scaled_imu3->time_boot_ms = mavlink_msg_scaled_imu3_get_time_boot_ms(msg); - scaled_imu3->xacc = mavlink_msg_scaled_imu3_get_xacc(msg); - scaled_imu3->yacc = mavlink_msg_scaled_imu3_get_yacc(msg); - scaled_imu3->zacc = mavlink_msg_scaled_imu3_get_zacc(msg); - scaled_imu3->xgyro = mavlink_msg_scaled_imu3_get_xgyro(msg); - scaled_imu3->ygyro = mavlink_msg_scaled_imu3_get_ygyro(msg); - scaled_imu3->zgyro = mavlink_msg_scaled_imu3_get_zgyro(msg); - scaled_imu3->xmag = mavlink_msg_scaled_imu3_get_xmag(msg); - scaled_imu3->ymag = mavlink_msg_scaled_imu3_get_ymag(msg); - scaled_imu3->zmag = mavlink_msg_scaled_imu3_get_zmag(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + scaled_imu3->time_boot_ms = mavlink_msg_scaled_imu3_get_time_boot_ms(msg); + scaled_imu3->xacc = mavlink_msg_scaled_imu3_get_xacc(msg); + scaled_imu3->yacc = mavlink_msg_scaled_imu3_get_yacc(msg); + scaled_imu3->zacc = mavlink_msg_scaled_imu3_get_zacc(msg); + scaled_imu3->xgyro = mavlink_msg_scaled_imu3_get_xgyro(msg); + scaled_imu3->ygyro = mavlink_msg_scaled_imu3_get_ygyro(msg); + scaled_imu3->zgyro = mavlink_msg_scaled_imu3_get_zgyro(msg); + scaled_imu3->xmag = mavlink_msg_scaled_imu3_get_xmag(msg); + scaled_imu3->ymag = mavlink_msg_scaled_imu3_get_ymag(msg); + scaled_imu3->zmag = mavlink_msg_scaled_imu3_get_zmag(msg); #else - memcpy(scaled_imu3, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_IMU3_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_IMU3_LEN? msg->len : MAVLINK_MSG_ID_SCALED_IMU3_LEN; + memset(scaled_imu3, 0, MAVLINK_MSG_ID_SCALED_IMU3_LEN); + memcpy(scaled_imu3, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure.h index d227cdc..42f75ed 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE SCALED_PRESSURE PACKING #define MAVLINK_MSG_ID_SCALED_PRESSURE 29 -typedef struct __mavlink_scaled_pressure_t -{ +MAVPACKED( +typedef struct __mavlink_scaled_pressure_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float press_abs; /*< Absolute pressure (hectopascal)*/ float press_diff; /*< Differential pressure 1 (hectopascal)*/ int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/ -} mavlink_scaled_pressure_t; +}) mavlink_scaled_pressure_t; #define MAVLINK_MSG_ID_SCALED_PRESSURE_LEN 14 +#define MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN 14 #define MAVLINK_MSG_ID_29_LEN 14 +#define MAVLINK_MSG_ID_29_MIN_LEN 14 #define MAVLINK_MSG_ID_SCALED_PRESSURE_CRC 115 #define MAVLINK_MSG_ID_29_CRC 115 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE { \ - "SCALED_PRESSURE", \ - 4, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure_t, time_boot_ms) }, \ + 29, \ + "SCALED_PRESSURE", \ + 4, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure_t, time_boot_ms) }, \ { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure_t, press_abs) }, \ { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure_t, press_diff) }, \ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure_t, temperature) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE { \ + "SCALED_PRESSURE", \ + 4, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure_t, time_boot_ms) }, \ + { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure_t, press_abs) }, \ + { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure_t, press_diff) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure_t, temperature) }, \ + } \ +} +#endif /** * @brief Pack a scaled_pressure message @@ -42,32 +57,28 @@ typedef struct __mavlink_scaled_pressure_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) + uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #else - mavlink_scaled_pressure_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; + mavlink_scaled_pressure_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature) + mavlink_message_t* msg, + uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #else - mavlink_scaled_pressure_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; + mavlink_scaled_pressure_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_scaled_pressure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_pressure_t* scaled_pressure) { - return mavlink_msg_scaled_pressure_pack(system_id, component_id, msg, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature); + return mavlink_msg_scaled_pressure_pack(system_id, component_id, msg, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_scaled_pressure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_pressure_t* scaled_pressure) { - return mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, chan, msg, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature); + return mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, chan, msg, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_scaled_pressure_encode_chan(uint8_t system_id static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); + mavlink_scaled_pressure_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); #endif +} + +/** + * @brief Send a scaled_pressure message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_scaled_pressure_send_struct(mavlink_channel_t chan, const mavlink_scaled_pressure_t* scaled_pressure) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_scaled_pressure_send(chan, scaled_pressure->time_boot_ms, scaled_pressure->press_abs, scaled_pressure->press_diff, scaled_pressure->temperature); #else - mavlink_scaled_pressure_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)scaled_pressure, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint static inline void mavlink_msg_scaled_pressure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); -#endif -#else - mavlink_scaled_pressure_t *packet = (mavlink_scaled_pressure_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->press_abs = press_abs; - packet->press_diff = press_diff; - packet->temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, buf, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); -#endif + mavlink_scaled_pressure_t *packet = (mavlink_scaled_pressure_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->press_abs = press_abs; + packet->press_diff = press_diff; + packet->temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_scaled_pressure_send_buf(mavlink_message_t *msgbu */ static inline uint32_t mavlink_msg_scaled_pressure_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -239,7 +244,7 @@ static inline uint32_t mavlink_msg_scaled_pressure_get_time_boot_ms(const mavlin */ static inline float mavlink_msg_scaled_pressure_get_press_abs(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -249,7 +254,7 @@ static inline float mavlink_msg_scaled_pressure_get_press_abs(const mavlink_mess */ static inline float mavlink_msg_scaled_pressure_get_press_diff(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -259,7 +264,7 @@ static inline float mavlink_msg_scaled_pressure_get_press_diff(const mavlink_mes */ static inline int16_t mavlink_msg_scaled_pressure_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -270,12 +275,14 @@ static inline int16_t mavlink_msg_scaled_pressure_get_temperature(const mavlink_ */ static inline void mavlink_msg_scaled_pressure_decode(const mavlink_message_t* msg, mavlink_scaled_pressure_t* scaled_pressure) { -#if MAVLINK_NEED_BYTE_SWAP - scaled_pressure->time_boot_ms = mavlink_msg_scaled_pressure_get_time_boot_ms(msg); - scaled_pressure->press_abs = mavlink_msg_scaled_pressure_get_press_abs(msg); - scaled_pressure->press_diff = mavlink_msg_scaled_pressure_get_press_diff(msg); - scaled_pressure->temperature = mavlink_msg_scaled_pressure_get_temperature(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + scaled_pressure->time_boot_ms = mavlink_msg_scaled_pressure_get_time_boot_ms(msg); + scaled_pressure->press_abs = mavlink_msg_scaled_pressure_get_press_abs(msg); + scaled_pressure->press_diff = mavlink_msg_scaled_pressure_get_press_diff(msg); + scaled_pressure->temperature = mavlink_msg_scaled_pressure_get_temperature(msg); #else - memcpy(scaled_pressure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_PRESSURE_LEN? msg->len : MAVLINK_MSG_ID_SCALED_PRESSURE_LEN; + memset(scaled_pressure, 0, MAVLINK_MSG_ID_SCALED_PRESSURE_LEN); + memcpy(scaled_pressure, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure2.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure2.h index 922b27b..bdd3177 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure2.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure2.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE SCALED_PRESSURE2 PACKING #define MAVLINK_MSG_ID_SCALED_PRESSURE2 137 -typedef struct __mavlink_scaled_pressure2_t -{ +MAVPACKED( +typedef struct __mavlink_scaled_pressure2_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float press_abs; /*< Absolute pressure (hectopascal)*/ float press_diff; /*< Differential pressure 1 (hectopascal)*/ int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/ -} mavlink_scaled_pressure2_t; +}) mavlink_scaled_pressure2_t; #define MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN 14 +#define MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN 14 #define MAVLINK_MSG_ID_137_LEN 14 +#define MAVLINK_MSG_ID_137_MIN_LEN 14 #define MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC 195 #define MAVLINK_MSG_ID_137_CRC 195 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2 { \ - "SCALED_PRESSURE2", \ - 4, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure2_t, time_boot_ms) }, \ + 137, \ + "SCALED_PRESSURE2", \ + 4, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure2_t, time_boot_ms) }, \ { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure2_t, press_abs) }, \ { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure2_t, press_diff) }, \ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure2_t, temperature) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2 { \ + "SCALED_PRESSURE2", \ + 4, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure2_t, time_boot_ms) }, \ + { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure2_t, press_abs) }, \ + { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure2_t, press_diff) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure2_t, temperature) }, \ + } \ +} +#endif /** * @brief Pack a scaled_pressure2 message @@ -42,32 +57,28 @@ typedef struct __mavlink_scaled_pressure2_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) + uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); #else - mavlink_scaled_pressure2_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; + mavlink_scaled_pressure2_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE2; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE2; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_scaled_pressure2_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature) + mavlink_message_t* msg, + uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); #else - mavlink_scaled_pressure2_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; + mavlink_scaled_pressure2_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE2; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE2; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_scaled_pressure2_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_scaled_pressure2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_pressure2_t* scaled_pressure2) { - return mavlink_msg_scaled_pressure2_pack(system_id, component_id, msg, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature); + return mavlink_msg_scaled_pressure2_pack(system_id, component_id, msg, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_scaled_pressure2_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_scaled_pressure2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_pressure2_t* scaled_pressure2) { - return mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, chan, msg, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature); + return mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, chan, msg, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_scaled_pressure2_encode_chan(uint8_t system_i static inline void mavlink_msg_scaled_pressure2_send(mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); + mavlink_scaled_pressure2_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); #endif +} + +/** + * @brief Send a scaled_pressure2 message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_scaled_pressure2_send_struct(mavlink_channel_t chan, const mavlink_scaled_pressure2_t* scaled_pressure2) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_scaled_pressure2_send(chan, scaled_pressure2->time_boot_ms, scaled_pressure2->press_abs, scaled_pressure2->press_diff, scaled_pressure2->temperature); #else - mavlink_scaled_pressure2_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)scaled_pressure2, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_scaled_pressure2_send(mavlink_channel_t chan, uin static inline void mavlink_msg_scaled_pressure2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); -#endif -#else - mavlink_scaled_pressure2_t *packet = (mavlink_scaled_pressure2_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->press_abs = press_abs; - packet->press_diff = press_diff; - packet->temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, buf, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); -#endif + mavlink_scaled_pressure2_t *packet = (mavlink_scaled_pressure2_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->press_abs = press_abs; + packet->press_diff = press_diff; + packet->temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE2, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE2_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_scaled_pressure2_send_buf(mavlink_message_t *msgb */ static inline uint32_t mavlink_msg_scaled_pressure2_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -239,7 +244,7 @@ static inline uint32_t mavlink_msg_scaled_pressure2_get_time_boot_ms(const mavli */ static inline float mavlink_msg_scaled_pressure2_get_press_abs(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -249,7 +254,7 @@ static inline float mavlink_msg_scaled_pressure2_get_press_abs(const mavlink_mes */ static inline float mavlink_msg_scaled_pressure2_get_press_diff(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -259,7 +264,7 @@ static inline float mavlink_msg_scaled_pressure2_get_press_diff(const mavlink_me */ static inline int16_t mavlink_msg_scaled_pressure2_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -270,12 +275,14 @@ static inline int16_t mavlink_msg_scaled_pressure2_get_temperature(const mavlink */ static inline void mavlink_msg_scaled_pressure2_decode(const mavlink_message_t* msg, mavlink_scaled_pressure2_t* scaled_pressure2) { -#if MAVLINK_NEED_BYTE_SWAP - scaled_pressure2->time_boot_ms = mavlink_msg_scaled_pressure2_get_time_boot_ms(msg); - scaled_pressure2->press_abs = mavlink_msg_scaled_pressure2_get_press_abs(msg); - scaled_pressure2->press_diff = mavlink_msg_scaled_pressure2_get_press_diff(msg); - scaled_pressure2->temperature = mavlink_msg_scaled_pressure2_get_temperature(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + scaled_pressure2->time_boot_ms = mavlink_msg_scaled_pressure2_get_time_boot_ms(msg); + scaled_pressure2->press_abs = mavlink_msg_scaled_pressure2_get_press_abs(msg); + scaled_pressure2->press_diff = mavlink_msg_scaled_pressure2_get_press_diff(msg); + scaled_pressure2->temperature = mavlink_msg_scaled_pressure2_get_temperature(msg); #else - memcpy(scaled_pressure2, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN? msg->len : MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN; + memset(scaled_pressure2, 0, MAVLINK_MSG_ID_SCALED_PRESSURE2_LEN); + memcpy(scaled_pressure2, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure3.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure3.h index 0ceed11..93ffbe9 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure3.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_scaled_pressure3.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE SCALED_PRESSURE3 PACKING #define MAVLINK_MSG_ID_SCALED_PRESSURE3 143 -typedef struct __mavlink_scaled_pressure3_t -{ +MAVPACKED( +typedef struct __mavlink_scaled_pressure3_t { uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/ float press_abs; /*< Absolute pressure (hectopascal)*/ float press_diff; /*< Differential pressure 1 (hectopascal)*/ int16_t temperature; /*< Temperature measurement (0.01 degrees celsius)*/ -} mavlink_scaled_pressure3_t; +}) mavlink_scaled_pressure3_t; #define MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN 14 +#define MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN 14 #define MAVLINK_MSG_ID_143_LEN 14 +#define MAVLINK_MSG_ID_143_MIN_LEN 14 #define MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC 131 #define MAVLINK_MSG_ID_143_CRC 131 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3 { \ - "SCALED_PRESSURE3", \ - 4, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure3_t, time_boot_ms) }, \ + 143, \ + "SCALED_PRESSURE3", \ + 4, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure3_t, time_boot_ms) }, \ { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure3_t, press_abs) }, \ { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure3_t, press_diff) }, \ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure3_t, temperature) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3 { \ + "SCALED_PRESSURE3", \ + 4, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_scaled_pressure3_t, time_boot_ms) }, \ + { "press_abs", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_scaled_pressure3_t, press_abs) }, \ + { "press_diff", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_scaled_pressure3_t, press_diff) }, \ + { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_scaled_pressure3_t, temperature) }, \ + } \ +} +#endif /** * @brief Pack a scaled_pressure3 message @@ -42,32 +57,28 @@ typedef struct __mavlink_scaled_pressure3_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) + uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); #else - mavlink_scaled_pressure3_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; + mavlink_scaled_pressure3_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE3; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE3; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_scaled_pressure3_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_scaled_pressure3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature) + mavlink_message_t* msg, + uint32_t time_boot_ms,float press_abs,float press_diff,int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); #else - mavlink_scaled_pressure3_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; + mavlink_scaled_pressure3_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE3; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE3; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_scaled_pressure3_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_scaled_pressure3_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_scaled_pressure3_t* scaled_pressure3) { - return mavlink_msg_scaled_pressure3_pack(system_id, component_id, msg, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature); + return mavlink_msg_scaled_pressure3_pack(system_id, component_id, msg, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_scaled_pressure3_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_scaled_pressure3_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_scaled_pressure3_t* scaled_pressure3) { - return mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, chan, msg, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature); + return mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, chan, msg, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_scaled_pressure3_encode_chan(uint8_t system_i static inline void mavlink_msg_scaled_pressure3_send(mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); + char buf[MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); + mavlink_scaled_pressure3_t packet; + packet.time_boot_ms = time_boot_ms; + packet.press_abs = press_abs; + packet.press_diff = press_diff; + packet.temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); #endif +} + +/** + * @brief Send a scaled_pressure3 message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_scaled_pressure3_send_struct(mavlink_channel_t chan, const mavlink_scaled_pressure3_t* scaled_pressure3) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_scaled_pressure3_send(chan, scaled_pressure3->time_boot_ms, scaled_pressure3->press_abs, scaled_pressure3->press_diff, scaled_pressure3->temperature); #else - mavlink_scaled_pressure3_t packet; - packet.time_boot_ms = time_boot_ms; - packet.press_abs = press_abs; - packet.press_diff = press_diff; - packet.temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)&packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)scaled_pressure3, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_scaled_pressure3_send(mavlink_channel_t chan, uin static inline void mavlink_msg_scaled_pressure3_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float press_abs, float press_diff, int16_t temperature) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, press_abs); - _mav_put_float(buf, 8, press_diff); - _mav_put_int16_t(buf, 12, temperature); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); -#endif -#else - mavlink_scaled_pressure3_t *packet = (mavlink_scaled_pressure3_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->press_abs = press_abs; - packet->press_diff = press_diff; - packet->temperature = temperature; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, press_abs); + _mav_put_float(buf, 8, press_diff); + _mav_put_int16_t(buf, 12, temperature); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, buf, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); -#endif + mavlink_scaled_pressure3_t *packet = (mavlink_scaled_pressure3_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->press_abs = press_abs; + packet->press_diff = press_diff; + packet->temperature = temperature; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SCALED_PRESSURE3, (const char *)packet, MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN, MAVLINK_MSG_ID_SCALED_PRESSURE3_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_scaled_pressure3_send_buf(mavlink_message_t *msgb */ static inline uint32_t mavlink_msg_scaled_pressure3_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -239,7 +244,7 @@ static inline uint32_t mavlink_msg_scaled_pressure3_get_time_boot_ms(const mavli */ static inline float mavlink_msg_scaled_pressure3_get_press_abs(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -249,7 +254,7 @@ static inline float mavlink_msg_scaled_pressure3_get_press_abs(const mavlink_mes */ static inline float mavlink_msg_scaled_pressure3_get_press_diff(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -259,7 +264,7 @@ static inline float mavlink_msg_scaled_pressure3_get_press_diff(const mavlink_me */ static inline int16_t mavlink_msg_scaled_pressure3_get_temperature(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 12); + return _MAV_RETURN_int16_t(msg, 12); } /** @@ -270,12 +275,14 @@ static inline int16_t mavlink_msg_scaled_pressure3_get_temperature(const mavlink */ static inline void mavlink_msg_scaled_pressure3_decode(const mavlink_message_t* msg, mavlink_scaled_pressure3_t* scaled_pressure3) { -#if MAVLINK_NEED_BYTE_SWAP - scaled_pressure3->time_boot_ms = mavlink_msg_scaled_pressure3_get_time_boot_ms(msg); - scaled_pressure3->press_abs = mavlink_msg_scaled_pressure3_get_press_abs(msg); - scaled_pressure3->press_diff = mavlink_msg_scaled_pressure3_get_press_diff(msg); - scaled_pressure3->temperature = mavlink_msg_scaled_pressure3_get_temperature(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + scaled_pressure3->time_boot_ms = mavlink_msg_scaled_pressure3_get_time_boot_ms(msg); + scaled_pressure3->press_abs = mavlink_msg_scaled_pressure3_get_press_abs(msg); + scaled_pressure3->press_diff = mavlink_msg_scaled_pressure3_get_press_diff(msg); + scaled_pressure3->temperature = mavlink_msg_scaled_pressure3_get_temperature(msg); #else - memcpy(scaled_pressure3, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN? msg->len : MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN; + memset(scaled_pressure3, 0, MAVLINK_MSG_ID_SCALED_PRESSURE3_LEN); + memcpy(scaled_pressure3, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_serial_control.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_serial_control.h index 477ca5c..53af8f8 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_serial_control.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_serial_control.h @@ -1,29 +1,34 @@ +#pragma once // MESSAGE SERIAL_CONTROL PACKING #define MAVLINK_MSG_ID_SERIAL_CONTROL 126 -typedef struct __mavlink_serial_control_t -{ +MAVPACKED( +typedef struct __mavlink_serial_control_t { uint32_t baudrate; /*< Baudrate of transfer. Zero means no change.*/ uint16_t timeout; /*< Timeout for reply data in milliseconds*/ uint8_t device; /*< See SERIAL_CONTROL_DEV enum*/ uint8_t flags; /*< See SERIAL_CONTROL_FLAG enum*/ uint8_t count; /*< how many bytes in this transfer*/ uint8_t data[70]; /*< serial data*/ -} mavlink_serial_control_t; +}) mavlink_serial_control_t; #define MAVLINK_MSG_ID_SERIAL_CONTROL_LEN 79 +#define MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN 79 #define MAVLINK_MSG_ID_126_LEN 79 +#define MAVLINK_MSG_ID_126_MIN_LEN 79 #define MAVLINK_MSG_ID_SERIAL_CONTROL_CRC 220 #define MAVLINK_MSG_ID_126_CRC 220 #define MAVLINK_MSG_SERIAL_CONTROL_FIELD_DATA_LEN 70 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SERIAL_CONTROL { \ - "SERIAL_CONTROL", \ - 6, \ - { { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \ + 126, \ + "SERIAL_CONTROL", \ + 6, \ + { { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \ { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \ { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \ { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_serial_control_t, flags) }, \ @@ -31,7 +36,19 @@ typedef struct __mavlink_serial_control_t { "data", NULL, MAVLINK_TYPE_UINT8_T, 70, 9, offsetof(mavlink_serial_control_t, data) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SERIAL_CONTROL { \ + "SERIAL_CONTROL", \ + 6, \ + { { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \ + { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \ + { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \ + { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_serial_control_t, flags) }, \ + { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_serial_control_t, count) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 70, 9, offsetof(mavlink_serial_control_t, data) }, \ + } \ +} +#endif /** * @brief Pack a serial_control message @@ -48,34 +65,30 @@ typedef struct __mavlink_serial_control_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_serial_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count, const uint8_t *data) + uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN]; - _mav_put_uint32_t(buf, 0, baudrate); - _mav_put_uint16_t(buf, 4, timeout); - _mav_put_uint8_t(buf, 6, device); - _mav_put_uint8_t(buf, 7, flags); - _mav_put_uint8_t(buf, 8, count); - _mav_put_uint8_t_array(buf, 9, data, 70); + char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN]; + _mav_put_uint32_t(buf, 0, baudrate); + _mav_put_uint16_t(buf, 4, timeout); + _mav_put_uint8_t(buf, 6, device); + _mav_put_uint8_t(buf, 7, flags); + _mav_put_uint8_t(buf, 8, count); + _mav_put_uint8_t_array(buf, 9, data, 70); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); #else - mavlink_serial_control_t packet; - packet.baudrate = baudrate; - packet.timeout = timeout; - packet.device = device; - packet.flags = flags; - packet.count = count; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70); + mavlink_serial_control_t packet; + packet.baudrate = baudrate; + packet.timeout = timeout; + packet.device = device; + packet.flags = flags; + packet.count = count; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SERIAL_CONTROL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SERIAL_CONTROL; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); } /** @@ -93,35 +106,31 @@ static inline uint16_t mavlink_msg_serial_control_pack(uint8_t system_id, uint8_ * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_serial_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t device,uint8_t flags,uint16_t timeout,uint32_t baudrate,uint8_t count,const uint8_t *data) + mavlink_message_t* msg, + uint8_t device,uint8_t flags,uint16_t timeout,uint32_t baudrate,uint8_t count,const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN]; - _mav_put_uint32_t(buf, 0, baudrate); - _mav_put_uint16_t(buf, 4, timeout); - _mav_put_uint8_t(buf, 6, device); - _mav_put_uint8_t(buf, 7, flags); - _mav_put_uint8_t(buf, 8, count); - _mav_put_uint8_t_array(buf, 9, data, 70); + char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN]; + _mav_put_uint32_t(buf, 0, baudrate); + _mav_put_uint16_t(buf, 4, timeout); + _mav_put_uint8_t(buf, 6, device); + _mav_put_uint8_t(buf, 7, flags); + _mav_put_uint8_t(buf, 8, count); + _mav_put_uint8_t_array(buf, 9, data, 70); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); #else - mavlink_serial_control_t packet; - packet.baudrate = baudrate; - packet.timeout = timeout; - packet.device = device; - packet.flags = flags; - packet.count = count; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70); + mavlink_serial_control_t packet; + packet.baudrate = baudrate; + packet.timeout = timeout; + packet.device = device; + packet.flags = flags; + packet.count = count; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SERIAL_CONTROL; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SERIAL_CONTROL; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); } /** @@ -134,7 +143,7 @@ static inline uint16_t mavlink_msg_serial_control_pack_chan(uint8_t system_id, u */ static inline uint16_t mavlink_msg_serial_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_serial_control_t* serial_control) { - return mavlink_msg_serial_control_pack(system_id, component_id, msg, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data); + return mavlink_msg_serial_control_pack(system_id, component_id, msg, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data); } /** @@ -148,7 +157,7 @@ static inline uint16_t mavlink_msg_serial_control_encode(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_serial_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_serial_control_t* serial_control) { - return mavlink_msg_serial_control_pack_chan(system_id, component_id, chan, msg, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data); + return mavlink_msg_serial_control_pack_chan(system_id, component_id, chan, msg, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data); } /** @@ -167,31 +176,37 @@ static inline uint16_t mavlink_msg_serial_control_encode_chan(uint8_t system_id, static inline void mavlink_msg_serial_control_send(mavlink_channel_t chan, uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN]; - _mav_put_uint32_t(buf, 0, baudrate); - _mav_put_uint16_t(buf, 4, timeout); - _mav_put_uint8_t(buf, 6, device); - _mav_put_uint8_t(buf, 7, flags); - _mav_put_uint8_t(buf, 8, count); - _mav_put_uint8_t_array(buf, 9, data, 70); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); + char buf[MAVLINK_MSG_ID_SERIAL_CONTROL_LEN]; + _mav_put_uint32_t(buf, 0, baudrate); + _mav_put_uint16_t(buf, 4, timeout); + _mav_put_uint8_t(buf, 6, device); + _mav_put_uint8_t(buf, 7, flags); + _mav_put_uint8_t(buf, 8, count); + _mav_put_uint8_t_array(buf, 9, data, 70); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); + mavlink_serial_control_t packet; + packet.baudrate = baudrate; + packet.timeout = timeout; + packet.device = device; + packet.flags = flags; + packet.count = count; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); #endif +} + +/** + * @brief Send a serial_control message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_serial_control_send_struct(mavlink_channel_t chan, const mavlink_serial_control_t* serial_control) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_serial_control_send(chan, serial_control->device, serial_control->flags, serial_control->timeout, serial_control->baudrate, serial_control->count, serial_control->data); #else - mavlink_serial_control_t packet; - packet.baudrate = baudrate; - packet.timeout = timeout; - packet.device = device; - packet.flags = flags; - packet.count = count; - mav_array_memcpy(packet.data, data, sizeof(uint8_t)*70); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)serial_control, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); #endif } @@ -206,31 +221,23 @@ static inline void mavlink_msg_serial_control_send(mavlink_channel_t chan, uint8 static inline void mavlink_msg_serial_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count, const uint8_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, baudrate); - _mav_put_uint16_t(buf, 4, timeout); - _mav_put_uint8_t(buf, 6, device); - _mav_put_uint8_t(buf, 7, flags); - _mav_put_uint8_t(buf, 8, count); - _mav_put_uint8_t_array(buf, 9, data, 70); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, baudrate); + _mav_put_uint16_t(buf, 4, timeout); + _mav_put_uint8_t(buf, 6, device); + _mav_put_uint8_t(buf, 7, flags); + _mav_put_uint8_t(buf, 8, count); + _mav_put_uint8_t_array(buf, 9, data, 70); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, buf, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); -#endif -#else - mavlink_serial_control_t *packet = (mavlink_serial_control_t *)msgbuf; - packet->baudrate = baudrate; - packet->timeout = timeout; - packet->device = device; - packet->flags = flags; - packet->count = count; - mav_array_memcpy(packet->data, data, sizeof(uint8_t)*70); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); -#endif + mavlink_serial_control_t *packet = (mavlink_serial_control_t *)msgbuf; + packet->baudrate = baudrate; + packet->timeout = timeout; + packet->device = device; + packet->flags = flags; + packet->count = count; + mav_array_memcpy(packet->data, data, sizeof(uint8_t)*70); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN, MAVLINK_MSG_ID_SERIAL_CONTROL_CRC); #endif } #endif @@ -247,7 +254,7 @@ static inline void mavlink_msg_serial_control_send_buf(mavlink_message_t *msgbuf */ static inline uint8_t mavlink_msg_serial_control_get_device(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 6); + return _MAV_RETURN_uint8_t(msg, 6); } /** @@ -257,7 +264,7 @@ static inline uint8_t mavlink_msg_serial_control_get_device(const mavlink_messag */ static inline uint8_t mavlink_msg_serial_control_get_flags(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 7); + return _MAV_RETURN_uint8_t(msg, 7); } /** @@ -267,7 +274,7 @@ static inline uint8_t mavlink_msg_serial_control_get_flags(const mavlink_message */ static inline uint16_t mavlink_msg_serial_control_get_timeout(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -277,7 +284,7 @@ static inline uint16_t mavlink_msg_serial_control_get_timeout(const mavlink_mess */ static inline uint32_t mavlink_msg_serial_control_get_baudrate(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -287,7 +294,7 @@ static inline uint32_t mavlink_msg_serial_control_get_baudrate(const mavlink_mes */ static inline uint8_t mavlink_msg_serial_control_get_count(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 8); + return _MAV_RETURN_uint8_t(msg, 8); } /** @@ -297,7 +304,7 @@ static inline uint8_t mavlink_msg_serial_control_get_count(const mavlink_message */ static inline uint16_t mavlink_msg_serial_control_get_data(const mavlink_message_t* msg, uint8_t *data) { - return _MAV_RETURN_uint8_t_array(msg, data, 70, 9); + return _MAV_RETURN_uint8_t_array(msg, data, 70, 9); } /** @@ -308,14 +315,16 @@ static inline uint16_t mavlink_msg_serial_control_get_data(const mavlink_message */ static inline void mavlink_msg_serial_control_decode(const mavlink_message_t* msg, mavlink_serial_control_t* serial_control) { -#if MAVLINK_NEED_BYTE_SWAP - serial_control->baudrate = mavlink_msg_serial_control_get_baudrate(msg); - serial_control->timeout = mavlink_msg_serial_control_get_timeout(msg); - serial_control->device = mavlink_msg_serial_control_get_device(msg); - serial_control->flags = mavlink_msg_serial_control_get_flags(msg); - serial_control->count = mavlink_msg_serial_control_get_count(msg); - mavlink_msg_serial_control_get_data(msg, serial_control->data); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + serial_control->baudrate = mavlink_msg_serial_control_get_baudrate(msg); + serial_control->timeout = mavlink_msg_serial_control_get_timeout(msg); + serial_control->device = mavlink_msg_serial_control_get_device(msg); + serial_control->flags = mavlink_msg_serial_control_get_flags(msg); + serial_control->count = mavlink_msg_serial_control_get_count(msg); + mavlink_msg_serial_control_get_data(msg, serial_control->data); #else - memcpy(serial_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SERIAL_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_SERIAL_CONTROL_LEN; + memset(serial_control, 0, MAVLINK_MSG_ID_SERIAL_CONTROL_LEN); + memcpy(serial_control, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_servo_output_raw.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_servo_output_raw.h index f4aa89b..9ae5317 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_servo_output_raw.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_servo_output_raw.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SERVO_OUTPUT_RAW PACKING #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW 36 -typedef struct __mavlink_servo_output_raw_t -{ +MAVPACKED( +typedef struct __mavlink_servo_output_raw_t { uint32_t time_usec; /*< Timestamp (microseconds since system boot)*/ uint16_t servo1_raw; /*< Servo output 1 value, in microseconds*/ uint16_t servo2_raw; /*< Servo output 2 value, in microseconds*/ @@ -14,20 +15,24 @@ typedef struct __mavlink_servo_output_raw_t uint16_t servo7_raw; /*< Servo output 7 value, in microseconds*/ uint16_t servo8_raw; /*< Servo output 8 value, in microseconds*/ uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.*/ -} mavlink_servo_output_raw_t; +}) mavlink_servo_output_raw_t; #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 21 +#define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN 21 #define MAVLINK_MSG_ID_36_LEN 21 +#define MAVLINK_MSG_ID_36_MIN_LEN 21 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC 222 #define MAVLINK_MSG_ID_36_CRC 222 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \ - "SERVO_OUTPUT_RAW", \ - 10, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \ + 36, \ + "SERVO_OUTPUT_RAW", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \ { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \ { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \ { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \ @@ -39,7 +44,23 @@ typedef struct __mavlink_servo_output_raw_t { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \ + "SERVO_OUTPUT_RAW", \ + 10, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \ + { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \ + { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \ + { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \ + { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \ + { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \ + { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \ + { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \ + { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \ + { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \ + } \ +} +#endif /** * @brief Pack a servo_output_raw message @@ -60,44 +81,40 @@ typedef struct __mavlink_servo_output_raw_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) + uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; - _mav_put_uint32_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 4, servo1_raw); - _mav_put_uint16_t(buf, 6, servo2_raw); - _mav_put_uint16_t(buf, 8, servo3_raw); - _mav_put_uint16_t(buf, 10, servo4_raw); - _mav_put_uint16_t(buf, 12, servo5_raw); - _mav_put_uint16_t(buf, 14, servo6_raw); - _mav_put_uint16_t(buf, 16, servo7_raw); - _mav_put_uint16_t(buf, 18, servo8_raw); - _mav_put_uint8_t(buf, 20, port); + char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; + _mav_put_uint32_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 4, servo1_raw); + _mav_put_uint16_t(buf, 6, servo2_raw); + _mav_put_uint16_t(buf, 8, servo3_raw); + _mav_put_uint16_t(buf, 10, servo4_raw); + _mav_put_uint16_t(buf, 12, servo5_raw); + _mav_put_uint16_t(buf, 14, servo6_raw); + _mav_put_uint16_t(buf, 16, servo7_raw); + _mav_put_uint16_t(buf, 18, servo8_raw); + _mav_put_uint8_t(buf, 20, port); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #else - mavlink_servo_output_raw_t packet; - packet.time_usec = time_usec; - packet.servo1_raw = servo1_raw; - packet.servo2_raw = servo2_raw; - packet.servo3_raw = servo3_raw; - packet.servo4_raw = servo4_raw; - packet.servo5_raw = servo5_raw; - packet.servo6_raw = servo6_raw; - packet.servo7_raw = servo7_raw; - packet.servo8_raw = servo8_raw; - packet.port = port; + mavlink_servo_output_raw_t packet; + packet.time_usec = time_usec; + packet.servo1_raw = servo1_raw; + packet.servo2_raw = servo2_raw; + packet.servo3_raw = servo3_raw; + packet.servo4_raw = servo4_raw; + packet.servo5_raw = servo5_raw; + packet.servo6_raw = servo6_raw; + packet.servo7_raw = servo7_raw; + packet.servo8_raw = servo8_raw; + packet.port = port; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); } /** @@ -119,45 +136,41 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_usec,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw) + mavlink_message_t* msg, + uint32_t time_usec,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; - _mav_put_uint32_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 4, servo1_raw); - _mav_put_uint16_t(buf, 6, servo2_raw); - _mav_put_uint16_t(buf, 8, servo3_raw); - _mav_put_uint16_t(buf, 10, servo4_raw); - _mav_put_uint16_t(buf, 12, servo5_raw); - _mav_put_uint16_t(buf, 14, servo6_raw); - _mav_put_uint16_t(buf, 16, servo7_raw); - _mav_put_uint16_t(buf, 18, servo8_raw); - _mav_put_uint8_t(buf, 20, port); + char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; + _mav_put_uint32_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 4, servo1_raw); + _mav_put_uint16_t(buf, 6, servo2_raw); + _mav_put_uint16_t(buf, 8, servo3_raw); + _mav_put_uint16_t(buf, 10, servo4_raw); + _mav_put_uint16_t(buf, 12, servo5_raw); + _mav_put_uint16_t(buf, 14, servo6_raw); + _mav_put_uint16_t(buf, 16, servo7_raw); + _mav_put_uint16_t(buf, 18, servo8_raw); + _mav_put_uint8_t(buf, 20, port); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #else - mavlink_servo_output_raw_t packet; - packet.time_usec = time_usec; - packet.servo1_raw = servo1_raw; - packet.servo2_raw = servo2_raw; - packet.servo3_raw = servo3_raw; - packet.servo4_raw = servo4_raw; - packet.servo5_raw = servo5_raw; - packet.servo6_raw = servo6_raw; - packet.servo7_raw = servo7_raw; - packet.servo8_raw = servo8_raw; - packet.port = port; + mavlink_servo_output_raw_t packet; + packet.time_usec = time_usec; + packet.servo1_raw = servo1_raw; + packet.servo2_raw = servo2_raw; + packet.servo3_raw = servo3_raw; + packet.servo4_raw = servo4_raw; + packet.servo5_raw = servo5_raw; + packet.servo6_raw = servo6_raw; + packet.servo7_raw = servo7_raw; + packet.servo8_raw = servo8_raw; + packet.port = port; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); } /** @@ -170,7 +183,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw) { - return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw); + return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw); } /** @@ -184,7 +197,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_servo_output_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw) { - return mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, chan, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw); + return mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, chan, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw); } /** @@ -207,41 +220,47 @@ static inline uint16_t mavlink_msg_servo_output_raw_encode_chan(uint8_t system_i static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; - _mav_put_uint32_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 4, servo1_raw); - _mav_put_uint16_t(buf, 6, servo2_raw); - _mav_put_uint16_t(buf, 8, servo3_raw); - _mav_put_uint16_t(buf, 10, servo4_raw); - _mav_put_uint16_t(buf, 12, servo5_raw); - _mav_put_uint16_t(buf, 14, servo6_raw); - _mav_put_uint16_t(buf, 16, servo7_raw); - _mav_put_uint16_t(buf, 18, servo8_raw); - _mav_put_uint8_t(buf, 20, port); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); + char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN]; + _mav_put_uint32_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 4, servo1_raw); + _mav_put_uint16_t(buf, 6, servo2_raw); + _mav_put_uint16_t(buf, 8, servo3_raw); + _mav_put_uint16_t(buf, 10, servo4_raw); + _mav_put_uint16_t(buf, 12, servo5_raw); + _mav_put_uint16_t(buf, 14, servo6_raw); + _mav_put_uint16_t(buf, 16, servo7_raw); + _mav_put_uint16_t(buf, 18, servo8_raw); + _mav_put_uint8_t(buf, 20, port); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); + mavlink_servo_output_raw_t packet; + packet.time_usec = time_usec; + packet.servo1_raw = servo1_raw; + packet.servo2_raw = servo2_raw; + packet.servo3_raw = servo3_raw; + packet.servo4_raw = servo4_raw; + packet.servo5_raw = servo5_raw; + packet.servo6_raw = servo6_raw; + packet.servo7_raw = servo7_raw; + packet.servo8_raw = servo8_raw; + packet.port = port; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); #endif +} + +/** + * @brief Send a servo_output_raw message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_servo_output_raw_send_struct(mavlink_channel_t chan, const mavlink_servo_output_raw_t* servo_output_raw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_servo_output_raw_send(chan, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw); #else - mavlink_servo_output_raw_t packet; - packet.time_usec = time_usec; - packet.servo1_raw = servo1_raw; - packet.servo2_raw = servo2_raw; - packet.servo3_raw = servo3_raw; - packet.servo4_raw = servo4_raw; - packet.servo5_raw = servo5_raw; - packet.servo6_raw = servo6_raw; - packet.servo7_raw = servo7_raw; - packet.servo8_raw = servo8_raw; - packet.port = port; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)servo_output_raw, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); #endif } @@ -256,41 +275,33 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin static inline void mavlink_msg_servo_output_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_usec); - _mav_put_uint16_t(buf, 4, servo1_raw); - _mav_put_uint16_t(buf, 6, servo2_raw); - _mav_put_uint16_t(buf, 8, servo3_raw); - _mav_put_uint16_t(buf, 10, servo4_raw); - _mav_put_uint16_t(buf, 12, servo5_raw); - _mav_put_uint16_t(buf, 14, servo6_raw); - _mav_put_uint16_t(buf, 16, servo7_raw); - _mav_put_uint16_t(buf, 18, servo8_raw); - _mav_put_uint8_t(buf, 20, port); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); -#endif -#else - mavlink_servo_output_raw_t *packet = (mavlink_servo_output_raw_t *)msgbuf; - packet->time_usec = time_usec; - packet->servo1_raw = servo1_raw; - packet->servo2_raw = servo2_raw; - packet->servo3_raw = servo3_raw; - packet->servo4_raw = servo4_raw; - packet->servo5_raw = servo5_raw; - packet->servo6_raw = servo6_raw; - packet->servo7_raw = servo7_raw; - packet->servo8_raw = servo8_raw; - packet->port = port; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_usec); + _mav_put_uint16_t(buf, 4, servo1_raw); + _mav_put_uint16_t(buf, 6, servo2_raw); + _mav_put_uint16_t(buf, 8, servo3_raw); + _mav_put_uint16_t(buf, 10, servo4_raw); + _mav_put_uint16_t(buf, 12, servo5_raw); + _mav_put_uint16_t(buf, 14, servo6_raw); + _mav_put_uint16_t(buf, 16, servo7_raw); + _mav_put_uint16_t(buf, 18, servo8_raw); + _mav_put_uint8_t(buf, 20, port); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); -#endif + mavlink_servo_output_raw_t *packet = (mavlink_servo_output_raw_t *)msgbuf; + packet->time_usec = time_usec; + packet->servo1_raw = servo1_raw; + packet->servo2_raw = servo2_raw; + packet->servo3_raw = servo3_raw; + packet->servo4_raw = servo4_raw; + packet->servo5_raw = servo5_raw; + packet->servo6_raw = servo6_raw; + packet->servo7_raw = servo7_raw; + packet->servo8_raw = servo8_raw; + packet->port = port; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC); #endif } #endif @@ -307,7 +318,7 @@ static inline void mavlink_msg_servo_output_raw_send_buf(mavlink_message_t *msgb */ static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -317,7 +328,7 @@ static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_ */ static inline uint8_t mavlink_msg_servo_output_raw_get_port(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 20); + return _MAV_RETURN_uint8_t(msg, 20); } /** @@ -327,7 +338,7 @@ static inline uint8_t mavlink_msg_servo_output_raw_get_port(const mavlink_messag */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 4); + return _MAV_RETURN_uint16_t(msg, 4); } /** @@ -337,7 +348,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 6); + return _MAV_RETURN_uint16_t(msg, 6); } /** @@ -347,7 +358,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -357,7 +368,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 10); + return _MAV_RETURN_uint16_t(msg, 10); } /** @@ -367,7 +378,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 12); + return _MAV_RETURN_uint16_t(msg, 12); } /** @@ -377,7 +388,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 14); + return _MAV_RETURN_uint16_t(msg, 14); } /** @@ -387,7 +398,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 16); + return _MAV_RETURN_uint16_t(msg, 16); } /** @@ -397,7 +408,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink */ static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -408,18 +419,20 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink */ static inline void mavlink_msg_servo_output_raw_decode(const mavlink_message_t* msg, mavlink_servo_output_raw_t* servo_output_raw) { -#if MAVLINK_NEED_BYTE_SWAP - servo_output_raw->time_usec = mavlink_msg_servo_output_raw_get_time_usec(msg); - servo_output_raw->servo1_raw = mavlink_msg_servo_output_raw_get_servo1_raw(msg); - servo_output_raw->servo2_raw = mavlink_msg_servo_output_raw_get_servo2_raw(msg); - servo_output_raw->servo3_raw = mavlink_msg_servo_output_raw_get_servo3_raw(msg); - servo_output_raw->servo4_raw = mavlink_msg_servo_output_raw_get_servo4_raw(msg); - servo_output_raw->servo5_raw = mavlink_msg_servo_output_raw_get_servo5_raw(msg); - servo_output_raw->servo6_raw = mavlink_msg_servo_output_raw_get_servo6_raw(msg); - servo_output_raw->servo7_raw = mavlink_msg_servo_output_raw_get_servo7_raw(msg); - servo_output_raw->servo8_raw = mavlink_msg_servo_output_raw_get_servo8_raw(msg); - servo_output_raw->port = mavlink_msg_servo_output_raw_get_port(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + servo_output_raw->time_usec = mavlink_msg_servo_output_raw_get_time_usec(msg); + servo_output_raw->servo1_raw = mavlink_msg_servo_output_raw_get_servo1_raw(msg); + servo_output_raw->servo2_raw = mavlink_msg_servo_output_raw_get_servo2_raw(msg); + servo_output_raw->servo3_raw = mavlink_msg_servo_output_raw_get_servo3_raw(msg); + servo_output_raw->servo4_raw = mavlink_msg_servo_output_raw_get_servo4_raw(msg); + servo_output_raw->servo5_raw = mavlink_msg_servo_output_raw_get_servo5_raw(msg); + servo_output_raw->servo6_raw = mavlink_msg_servo_output_raw_get_servo6_raw(msg); + servo_output_raw->servo7_raw = mavlink_msg_servo_output_raw_get_servo7_raw(msg); + servo_output_raw->servo8_raw = mavlink_msg_servo_output_raw_get_servo8_raw(msg); + servo_output_raw->port = mavlink_msg_servo_output_raw_get_port(msg); #else - memcpy(servo_output_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN? msg->len : MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN; + memset(servo_output_raw, 0, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN); + memcpy(servo_output_raw, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_actuator_control_target.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_actuator_control_target.h index 0ac8d62..dacd851 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_actuator_control_target.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_actuator_control_target.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE SET_ACTUATOR_CONTROL_TARGET PACKING #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET 139 -typedef struct __mavlink_set_actuator_control_target_t -{ +MAVPACKED( +typedef struct __mavlink_set_actuator_control_target_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/ uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/ uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ -} mavlink_set_actuator_control_target_t; +}) mavlink_set_actuator_control_target_t; #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN 43 +#define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN 43 #define MAVLINK_MSG_ID_139_LEN 43 +#define MAVLINK_MSG_ID_139_MIN_LEN 43 #define MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC 168 #define MAVLINK_MSG_ID_139_CRC 168 #define MAVLINK_MSG_SET_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET { \ - "SET_ACTUATOR_CONTROL_TARGET", \ - 5, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \ + 139, \ + "SET_ACTUATOR_CONTROL_TARGET", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \ { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \ { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET { \ + "SET_ACTUATOR_CONTROL_TARGET", \ + 5, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_set_actuator_control_target_t, time_usec) }, \ + { "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_set_actuator_control_target_t, controls) }, \ + { "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_set_actuator_control_target_t, group_mlx) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_set_actuator_control_target_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_set_actuator_control_target_t, target_component) }, \ + } \ +} +#endif /** * @brief Pack a set_actuator_control_target message @@ -45,32 +61,28 @@ typedef struct __mavlink_set_actuator_control_target_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls) + uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_uint8_t(buf, 41, target_system); - _mav_put_uint8_t(buf, 42, target_component); - _mav_put_float_array(buf, 8, controls, 8); + char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_uint8_t(buf, 41, target_system); + _mav_put_uint8_t(buf, 42, target_component); + _mav_put_float_array(buf, 8, controls, 8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); #else - mavlink_set_actuator_control_target_t packet; - packet.time_usec = time_usec; - packet.group_mlx = group_mlx; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.controls, controls, sizeof(float)*8); + mavlink_set_actuator_control_target_t packet; + packet.time_usec = time_usec; + packet.group_mlx = group_mlx; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.controls, controls, sizeof(float)*8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); } /** @@ -87,33 +99,29 @@ static inline uint16_t mavlink_msg_set_actuator_control_target_pack(uint8_t syst * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,uint8_t group_mlx,uint8_t target_system,uint8_t target_component,const float *controls) + mavlink_message_t* msg, + uint64_t time_usec,uint8_t group_mlx,uint8_t target_system,uint8_t target_component,const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_uint8_t(buf, 41, target_system); - _mav_put_uint8_t(buf, 42, target_component); - _mav_put_float_array(buf, 8, controls, 8); + char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_uint8_t(buf, 41, target_system); + _mav_put_uint8_t(buf, 42, target_component); + _mav_put_float_array(buf, 8, controls, 8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); #else - mavlink_set_actuator_control_target_t packet; - packet.time_usec = time_usec; - packet.group_mlx = group_mlx; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.controls, controls, sizeof(float)*8); + mavlink_set_actuator_control_target_t packet; + packet.time_usec = time_usec; + packet.group_mlx = group_mlx; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.controls, controls, sizeof(float)*8); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); } /** @@ -126,7 +134,7 @@ static inline uint16_t mavlink_msg_set_actuator_control_target_pack_chan(uint8_t */ static inline uint16_t mavlink_msg_set_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target) { - return mavlink_msg_set_actuator_control_target_pack(system_id, component_id, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls); + return mavlink_msg_set_actuator_control_target_pack(system_id, component_id, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls); } /** @@ -140,7 +148,7 @@ static inline uint16_t mavlink_msg_set_actuator_control_target_encode(uint8_t sy */ static inline uint16_t mavlink_msg_set_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_actuator_control_target_t* set_actuator_control_target) { - return mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, chan, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls); + return mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, chan, msg, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls); } /** @@ -158,29 +166,35 @@ static inline uint16_t mavlink_msg_set_actuator_control_target_encode_chan(uint8 static inline void mavlink_msg_set_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_uint8_t(buf, 41, target_system); - _mav_put_uint8_t(buf, 42, target_component); - _mav_put_float_array(buf, 8, controls, 8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); + char buf[MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_uint8_t(buf, 41, target_system); + _mav_put_uint8_t(buf, 42, target_component); + _mav_put_float_array(buf, 8, controls, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); + mavlink_set_actuator_control_target_t packet; + packet.time_usec = time_usec; + packet.group_mlx = group_mlx; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.controls, controls, sizeof(float)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); #endif +} + +/** + * @brief Send a set_actuator_control_target message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_actuator_control_target_send_struct(mavlink_channel_t chan, const mavlink_set_actuator_control_target_t* set_actuator_control_target) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_actuator_control_target_send(chan, set_actuator_control_target->time_usec, set_actuator_control_target->group_mlx, set_actuator_control_target->target_system, set_actuator_control_target->target_component, set_actuator_control_target->controls); #else - mavlink_set_actuator_control_target_t packet; - packet.time_usec = time_usec; - packet.group_mlx = group_mlx; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.controls, controls, sizeof(float)*8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)set_actuator_control_target, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); #endif } @@ -195,29 +209,21 @@ static inline void mavlink_msg_set_actuator_control_target_send(mavlink_channel_ static inline void mavlink_msg_set_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, uint8_t target_system, uint8_t target_component, const float *controls) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_uint8_t(buf, 40, group_mlx); - _mav_put_uint8_t(buf, 41, target_system); - _mav_put_uint8_t(buf, 42, target_component); - _mav_put_float_array(buf, 8, controls, 8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_uint8_t(buf, 40, group_mlx); + _mav_put_uint8_t(buf, 41, target_system); + _mav_put_uint8_t(buf, 42, target_component); + _mav_put_float_array(buf, 8, controls, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); -#endif -#else - mavlink_set_actuator_control_target_t *packet = (mavlink_set_actuator_control_target_t *)msgbuf; - packet->time_usec = time_usec; - packet->group_mlx = group_mlx; - packet->target_system = target_system; - packet->target_component = target_component; - mav_array_memcpy(packet->controls, controls, sizeof(float)*8); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); -#endif + mavlink_set_actuator_control_target_t *packet = (mavlink_set_actuator_control_target_t *)msgbuf; + packet->time_usec = time_usec; + packet->group_mlx = group_mlx; + packet->target_system = target_system; + packet->target_component = target_component; + mav_array_memcpy(packet->controls, controls, sizeof(float)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_CRC); #endif } #endif @@ -234,7 +240,7 @@ static inline void mavlink_msg_set_actuator_control_target_send_buf(mavlink_mess */ static inline uint64_t mavlink_msg_set_actuator_control_target_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -244,7 +250,7 @@ static inline uint64_t mavlink_msg_set_actuator_control_target_get_time_usec(con */ static inline uint8_t mavlink_msg_set_actuator_control_target_get_group_mlx(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 40); + return _MAV_RETURN_uint8_t(msg, 40); } /** @@ -254,7 +260,7 @@ static inline uint8_t mavlink_msg_set_actuator_control_target_get_group_mlx(cons */ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 41); + return _MAV_RETURN_uint8_t(msg, 41); } /** @@ -264,7 +270,7 @@ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_system( */ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 42); + return _MAV_RETURN_uint8_t(msg, 42); } /** @@ -274,7 +280,7 @@ static inline uint8_t mavlink_msg_set_actuator_control_target_get_target_compone */ static inline uint16_t mavlink_msg_set_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls) { - return _MAV_RETURN_float_array(msg, controls, 8, 8); + return _MAV_RETURN_float_array(msg, controls, 8, 8); } /** @@ -285,13 +291,15 @@ static inline uint16_t mavlink_msg_set_actuator_control_target_get_controls(cons */ static inline void mavlink_msg_set_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_set_actuator_control_target_t* set_actuator_control_target) { -#if MAVLINK_NEED_BYTE_SWAP - set_actuator_control_target->time_usec = mavlink_msg_set_actuator_control_target_get_time_usec(msg); - mavlink_msg_set_actuator_control_target_get_controls(msg, set_actuator_control_target->controls); - set_actuator_control_target->group_mlx = mavlink_msg_set_actuator_control_target_get_group_mlx(msg); - set_actuator_control_target->target_system = mavlink_msg_set_actuator_control_target_get_target_system(msg); - set_actuator_control_target->target_component = mavlink_msg_set_actuator_control_target_get_target_component(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_actuator_control_target->time_usec = mavlink_msg_set_actuator_control_target_get_time_usec(msg); + mavlink_msg_set_actuator_control_target_get_controls(msg, set_actuator_control_target->controls); + set_actuator_control_target->group_mlx = mavlink_msg_set_actuator_control_target_get_group_mlx(msg); + set_actuator_control_target->target_system = mavlink_msg_set_actuator_control_target_get_target_system(msg); + set_actuator_control_target->target_component = mavlink_msg_set_actuator_control_target_get_target_component(msg); #else - memcpy(set_actuator_control_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN? msg->len : MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN; + memset(set_actuator_control_target, 0, MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_LEN); + memcpy(set_actuator_control_target, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_attitude_target.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_attitude_target.h index c5273e4..91ab8d5 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_attitude_target.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_attitude_target.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SET_ATTITUDE_TARGET PACKING #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET 82 -typedef struct __mavlink_set_attitude_target_t -{ +MAVPACKED( +typedef struct __mavlink_set_attitude_target_t { uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/ float body_roll_rate; /*< Body roll rate in radians per second*/ @@ -13,20 +14,24 @@ typedef struct __mavlink_set_attitude_target_t uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude*/ -} mavlink_set_attitude_target_t; +}) mavlink_set_attitude_target_t; #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN 39 +#define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN 39 #define MAVLINK_MSG_ID_82_LEN 39 +#define MAVLINK_MSG_ID_82_MIN_LEN 39 #define MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC 49 #define MAVLINK_MSG_ID_82_CRC 49 #define MAVLINK_MSG_SET_ATTITUDE_TARGET_FIELD_Q_LEN 4 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET { \ - "SET_ATTITUDE_TARGET", \ - 9, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \ + 82, \ + "SET_ATTITUDE_TARGET", \ + 9, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \ { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \ { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \ { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \ @@ -37,7 +42,22 @@ typedef struct __mavlink_set_attitude_target_t { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET { \ + "SET_ATTITUDE_TARGET", \ + 9, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_attitude_target_t, time_boot_ms) }, \ + { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_set_attitude_target_t, q) }, \ + { "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_attitude_target_t, body_roll_rate) }, \ + { "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_attitude_target_t, body_pitch_rate) }, \ + { "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_attitude_target_t, body_yaw_rate) }, \ + { "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_attitude_target_t, thrust) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_set_attitude_target_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_set_attitude_target_t, target_component) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_set_attitude_target_t, type_mask) }, \ + } \ +} +#endif /** * @brief Pack a set_attitude_target message @@ -57,40 +77,36 @@ typedef struct __mavlink_set_attitude_target_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) + uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, target_system); - _mav_put_uint8_t(buf, 37, target_component); - _mav_put_uint8_t(buf, 38, type_mask); - _mav_put_float_array(buf, 4, q, 4); + char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, target_system); + _mav_put_uint8_t(buf, 37, target_component); + _mav_put_uint8_t(buf, 38, type_mask); + _mav_put_float_array(buf, 4, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); #else - mavlink_set_attitude_target_t packet; - packet.time_boot_ms = time_boot_ms; - packet.body_roll_rate = body_roll_rate; - packet.body_pitch_rate = body_pitch_rate; - packet.body_yaw_rate = body_yaw_rate; - packet.thrust = thrust; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type_mask = type_mask; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_set_attitude_target_t packet; + packet.time_boot_ms = time_boot_ms; + packet.body_roll_rate = body_roll_rate; + packet.body_pitch_rate = body_pitch_rate; + packet.body_yaw_rate = body_yaw_rate; + packet.thrust = thrust; + packet.target_system = target_system; + packet.target_component = target_component; + packet.type_mask = type_mask; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); } /** @@ -111,41 +127,37 @@ static inline uint16_t mavlink_msg_set_attitude_target_pack(uint8_t system_id, u * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, target_system); - _mav_put_uint8_t(buf, 37, target_component); - _mav_put_uint8_t(buf, 38, type_mask); - _mav_put_float_array(buf, 4, q, 4); + char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, target_system); + _mav_put_uint8_t(buf, 37, target_component); + _mav_put_uint8_t(buf, 38, type_mask); + _mav_put_float_array(buf, 4, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); #else - mavlink_set_attitude_target_t packet; - packet.time_boot_ms = time_boot_ms; - packet.body_roll_rate = body_roll_rate; - packet.body_pitch_rate = body_pitch_rate; - packet.body_yaw_rate = body_yaw_rate; - packet.thrust = thrust; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type_mask = type_mask; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_set_attitude_target_t packet; + packet.time_boot_ms = time_boot_ms; + packet.body_roll_rate = body_roll_rate; + packet.body_pitch_rate = body_pitch_rate; + packet.body_yaw_rate = body_yaw_rate; + packet.thrust = thrust; + packet.target_system = target_system; + packet.target_component = target_component; + packet.type_mask = type_mask; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); } /** @@ -158,7 +170,7 @@ static inline uint16_t mavlink_msg_set_attitude_target_pack_chan(uint8_t system_ */ static inline uint16_t mavlink_msg_set_attitude_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_attitude_target_t* set_attitude_target) { - return mavlink_msg_set_attitude_target_pack(system_id, component_id, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust); + return mavlink_msg_set_attitude_target_pack(system_id, component_id, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust); } /** @@ -172,7 +184,7 @@ static inline uint16_t mavlink_msg_set_attitude_target_encode(uint8_t system_id, */ static inline uint16_t mavlink_msg_set_attitude_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_attitude_target_t* set_attitude_target) { - return mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, chan, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust); + return mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, chan, msg, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust); } /** @@ -194,37 +206,43 @@ static inline uint16_t mavlink_msg_set_attitude_target_encode_chan(uint8_t syste static inline void mavlink_msg_set_attitude_target_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, target_system); - _mav_put_uint8_t(buf, 37, target_component); - _mav_put_uint8_t(buf, 38, type_mask); - _mav_put_float_array(buf, 4, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); + char buf[MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, target_system); + _mav_put_uint8_t(buf, 37, target_component); + _mav_put_uint8_t(buf, 38, type_mask); + _mav_put_float_array(buf, 4, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); + mavlink_set_attitude_target_t packet; + packet.time_boot_ms = time_boot_ms; + packet.body_roll_rate = body_roll_rate; + packet.body_pitch_rate = body_pitch_rate; + packet.body_yaw_rate = body_yaw_rate; + packet.thrust = thrust; + packet.target_system = target_system; + packet.target_component = target_component; + packet.type_mask = type_mask; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); #endif +} + +/** + * @brief Send a set_attitude_target message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_attitude_target_send_struct(mavlink_channel_t chan, const mavlink_set_attitude_target_t* set_attitude_target) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_attitude_target_send(chan, set_attitude_target->time_boot_ms, set_attitude_target->target_system, set_attitude_target->target_component, set_attitude_target->type_mask, set_attitude_target->q, set_attitude_target->body_roll_rate, set_attitude_target->body_pitch_rate, set_attitude_target->body_yaw_rate, set_attitude_target->thrust); #else - mavlink_set_attitude_target_t packet; - packet.time_boot_ms = time_boot_ms; - packet.body_roll_rate = body_roll_rate; - packet.body_pitch_rate = body_pitch_rate; - packet.body_yaw_rate = body_yaw_rate; - packet.thrust = thrust; - packet.target_system = target_system; - packet.target_component = target_component; - packet.type_mask = type_mask; - mav_array_memcpy(packet.q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)set_attitude_target, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); #endif } @@ -239,37 +257,29 @@ static inline void mavlink_msg_set_attitude_target_send(mavlink_channel_t chan, static inline void mavlink_msg_set_attitude_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 20, body_roll_rate); - _mav_put_float(buf, 24, body_pitch_rate); - _mav_put_float(buf, 28, body_yaw_rate); - _mav_put_float(buf, 32, thrust); - _mav_put_uint8_t(buf, 36, target_system); - _mav_put_uint8_t(buf, 37, target_component); - _mav_put_uint8_t(buf, 38, type_mask); - _mav_put_float_array(buf, 4, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); -#endif -#else - mavlink_set_attitude_target_t *packet = (mavlink_set_attitude_target_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->body_roll_rate = body_roll_rate; - packet->body_pitch_rate = body_pitch_rate; - packet->body_yaw_rate = body_yaw_rate; - packet->thrust = thrust; - packet->target_system = target_system; - packet->target_component = target_component; - packet->type_mask = type_mask; - mav_array_memcpy(packet->q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 20, body_roll_rate); + _mav_put_float(buf, 24, body_pitch_rate); + _mav_put_float(buf, 28, body_yaw_rate); + _mav_put_float(buf, 32, thrust); + _mav_put_uint8_t(buf, 36, target_system); + _mav_put_uint8_t(buf, 37, target_component); + _mav_put_uint8_t(buf, 38, type_mask); + _mav_put_float_array(buf, 4, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); -#endif + mavlink_set_attitude_target_t *packet = (mavlink_set_attitude_target_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->body_roll_rate = body_roll_rate; + packet->body_pitch_rate = body_pitch_rate; + packet->body_yaw_rate = body_yaw_rate; + packet->thrust = thrust; + packet->target_system = target_system; + packet->target_component = target_component; + packet->type_mask = type_mask; + mav_array_memcpy(packet->q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_CRC); #endif } #endif @@ -286,7 +296,7 @@ static inline void mavlink_msg_set_attitude_target_send_buf(mavlink_message_t *m */ static inline uint32_t mavlink_msg_set_attitude_target_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -296,7 +306,7 @@ static inline uint32_t mavlink_msg_set_attitude_target_get_time_boot_ms(const ma */ static inline uint8_t mavlink_msg_set_attitude_target_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 36); + return _MAV_RETURN_uint8_t(msg, 36); } /** @@ -306,7 +316,7 @@ static inline uint8_t mavlink_msg_set_attitude_target_get_target_system(const ma */ static inline uint8_t mavlink_msg_set_attitude_target_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 37); + return _MAV_RETURN_uint8_t(msg, 37); } /** @@ -316,7 +326,7 @@ static inline uint8_t mavlink_msg_set_attitude_target_get_target_component(const */ static inline uint8_t mavlink_msg_set_attitude_target_get_type_mask(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 38); + return _MAV_RETURN_uint8_t(msg, 38); } /** @@ -326,7 +336,7 @@ static inline uint8_t mavlink_msg_set_attitude_target_get_type_mask(const mavlin */ static inline uint16_t mavlink_msg_set_attitude_target_get_q(const mavlink_message_t* msg, float *q) { - return _MAV_RETURN_float_array(msg, q, 4, 4); + return _MAV_RETURN_float_array(msg, q, 4, 4); } /** @@ -336,7 +346,7 @@ static inline uint16_t mavlink_msg_set_attitude_target_get_q(const mavlink_messa */ static inline float mavlink_msg_set_attitude_target_get_body_roll_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -346,7 +356,7 @@ static inline float mavlink_msg_set_attitude_target_get_body_roll_rate(const mav */ static inline float mavlink_msg_set_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -356,7 +366,7 @@ static inline float mavlink_msg_set_attitude_target_get_body_pitch_rate(const ma */ static inline float mavlink_msg_set_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -366,7 +376,7 @@ static inline float mavlink_msg_set_attitude_target_get_body_yaw_rate(const mavl */ static inline float mavlink_msg_set_attitude_target_get_thrust(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -377,17 +387,19 @@ static inline float mavlink_msg_set_attitude_target_get_thrust(const mavlink_mes */ static inline void mavlink_msg_set_attitude_target_decode(const mavlink_message_t* msg, mavlink_set_attitude_target_t* set_attitude_target) { -#if MAVLINK_NEED_BYTE_SWAP - set_attitude_target->time_boot_ms = mavlink_msg_set_attitude_target_get_time_boot_ms(msg); - mavlink_msg_set_attitude_target_get_q(msg, set_attitude_target->q); - set_attitude_target->body_roll_rate = mavlink_msg_set_attitude_target_get_body_roll_rate(msg); - set_attitude_target->body_pitch_rate = mavlink_msg_set_attitude_target_get_body_pitch_rate(msg); - set_attitude_target->body_yaw_rate = mavlink_msg_set_attitude_target_get_body_yaw_rate(msg); - set_attitude_target->thrust = mavlink_msg_set_attitude_target_get_thrust(msg); - set_attitude_target->target_system = mavlink_msg_set_attitude_target_get_target_system(msg); - set_attitude_target->target_component = mavlink_msg_set_attitude_target_get_target_component(msg); - set_attitude_target->type_mask = mavlink_msg_set_attitude_target_get_type_mask(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_attitude_target->time_boot_ms = mavlink_msg_set_attitude_target_get_time_boot_ms(msg); + mavlink_msg_set_attitude_target_get_q(msg, set_attitude_target->q); + set_attitude_target->body_roll_rate = mavlink_msg_set_attitude_target_get_body_roll_rate(msg); + set_attitude_target->body_pitch_rate = mavlink_msg_set_attitude_target_get_body_pitch_rate(msg); + set_attitude_target->body_yaw_rate = mavlink_msg_set_attitude_target_get_body_yaw_rate(msg); + set_attitude_target->thrust = mavlink_msg_set_attitude_target_get_thrust(msg); + set_attitude_target->target_system = mavlink_msg_set_attitude_target_get_target_system(msg); + set_attitude_target->target_component = mavlink_msg_set_attitude_target_get_target_component(msg); + set_attitude_target->type_mask = mavlink_msg_set_attitude_target_get_type_mask(msg); #else - memcpy(set_attitude_target, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN? msg->len : MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN; + memset(set_attitude_target, 0, MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_LEN); + memcpy(set_attitude_target, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_gps_global_origin.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_gps_global_origin.h index 90c6f36..4b9ddd0 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_gps_global_origin.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_gps_global_origin.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE SET_GPS_GLOBAL_ORIGIN PACKING #define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN 48 -typedef struct __mavlink_set_gps_global_origin_t -{ +MAVPACKED( +typedef struct __mavlink_set_gps_global_origin_t { int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ uint8_t target_system; /*< System ID*/ -} mavlink_set_gps_global_origin_t; +}) mavlink_set_gps_global_origin_t; #define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN 13 +#define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN 13 #define MAVLINK_MSG_ID_48_LEN 13 +#define MAVLINK_MSG_ID_48_MIN_LEN 13 #define MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC 41 #define MAVLINK_MSG_ID_48_CRC 41 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN { \ - "SET_GPS_GLOBAL_ORIGIN", \ - 4, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \ + 48, \ + "SET_GPS_GLOBAL_ORIGIN", \ + 4, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_gps_global_origin_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_gps_global_origin_t, altitude) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN { \ + "SET_GPS_GLOBAL_ORIGIN", \ + 4, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_gps_global_origin_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_gps_global_origin_t, longitude) }, \ + { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_gps_global_origin_t, altitude) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_set_gps_global_origin_t, target_system) }, \ + } \ +} +#endif /** * @brief Pack a set_gps_global_origin message @@ -42,32 +57,28 @@ typedef struct __mavlink_set_gps_global_origin_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude) + uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_uint8_t(buf, 12, target_system); + char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_uint8_t(buf, 12, target_system); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #else - mavlink_set_gps_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.target_system = target_system; + mavlink_set_gps_global_origin_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.target_system = target_system; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude) + mavlink_message_t* msg, + uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_uint8_t(buf, 12, target_system); + char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_uint8_t(buf, 12, target_system); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #else - mavlink_set_gps_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.target_system = target_system; + mavlink_set_gps_global_origin_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.target_system = target_system; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste */ static inline uint16_t mavlink_msg_set_gps_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_gps_global_origin_t* set_gps_global_origin) { - return mavlink_msg_set_gps_global_origin_pack(system_id, component_id, msg, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude); + return mavlink_msg_set_gps_global_origin_pack(system_id, component_id, msg, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_encode(uint8_t system_i */ static inline uint16_t mavlink_msg_set_gps_global_origin_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_gps_global_origin_t* set_gps_global_origin) { - return mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, chan, msg, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude); + return mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, chan, msg, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_encode_chan(uint8_t sys static inline void mavlink_msg_set_gps_global_origin_send(mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_uint8_t(buf, 12, target_system); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); + char buf[MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_uint8_t(buf, 12, target_system); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); + mavlink_set_gps_global_origin_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.target_system = target_system; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); #endif +} + +/** + * @brief Send a set_gps_global_origin message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_gps_global_origin_send_struct(mavlink_channel_t chan, const mavlink_set_gps_global_origin_t* set_gps_global_origin) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_gps_global_origin_send(chan, set_gps_global_origin->target_system, set_gps_global_origin->latitude, set_gps_global_origin->longitude, set_gps_global_origin->altitude); #else - mavlink_set_gps_global_origin_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.target_system = target_system; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)set_gps_global_origin, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_set_gps_global_origin_send(mavlink_channel_t chan static inline void mavlink_msg_set_gps_global_origin_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_uint8_t(buf, 12, target_system); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); -#endif -#else - mavlink_set_gps_global_origin_t *packet = (mavlink_set_gps_global_origin_t *)msgbuf; - packet->latitude = latitude; - packet->longitude = longitude; - packet->altitude = altitude; - packet->target_system = target_system; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_uint8_t(buf, 12, target_system); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); -#endif + mavlink_set_gps_global_origin_t *packet = (mavlink_set_gps_global_origin_t *)msgbuf; + packet->latitude = latitude; + packet->longitude = longitude; + packet->altitude = altitude; + packet->target_system = target_system; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_set_gps_global_origin_send_buf(mavlink_message_t */ static inline uint8_t mavlink_msg_set_gps_global_origin_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 12); + return _MAV_RETURN_uint8_t(msg, 12); } /** @@ -239,7 +244,7 @@ static inline uint8_t mavlink_msg_set_gps_global_origin_get_target_system(const */ static inline int32_t mavlink_msg_set_gps_global_origin_get_latitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -249,7 +254,7 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_latitude(const mavli */ static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -259,7 +264,7 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_longitude(const mavl */ static inline int32_t mavlink_msg_set_gps_global_origin_get_altitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -270,12 +275,14 @@ static inline int32_t mavlink_msg_set_gps_global_origin_get_altitude(const mavli */ static inline void mavlink_msg_set_gps_global_origin_decode(const mavlink_message_t* msg, mavlink_set_gps_global_origin_t* set_gps_global_origin) { -#if MAVLINK_NEED_BYTE_SWAP - set_gps_global_origin->latitude = mavlink_msg_set_gps_global_origin_get_latitude(msg); - set_gps_global_origin->longitude = mavlink_msg_set_gps_global_origin_get_longitude(msg); - set_gps_global_origin->altitude = mavlink_msg_set_gps_global_origin_get_altitude(msg); - set_gps_global_origin->target_system = mavlink_msg_set_gps_global_origin_get_target_system(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_gps_global_origin->latitude = mavlink_msg_set_gps_global_origin_get_latitude(msg); + set_gps_global_origin->longitude = mavlink_msg_set_gps_global_origin_get_longitude(msg); + set_gps_global_origin->altitude = mavlink_msg_set_gps_global_origin_get_altitude(msg); + set_gps_global_origin->target_system = mavlink_msg_set_gps_global_origin_get_target_system(msg); #else - memcpy(set_gps_global_origin, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN? msg->len : MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN; + memset(set_gps_global_origin, 0, MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_LEN); + memcpy(set_gps_global_origin, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_home_position.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_home_position.h index 4a4504d..2384d67 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_home_position.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_home_position.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SET_HOME_POSITION PACKING #define MAVLINK_MSG_ID_SET_HOME_POSITION 243 -typedef struct __mavlink_set_home_position_t -{ +MAVPACKED( +typedef struct __mavlink_set_home_position_t { int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/ int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/ int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/ @@ -15,20 +16,24 @@ typedef struct __mavlink_set_home_position_t float approach_y; /*< Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ float approach_z; /*< Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/ uint8_t target_system; /*< System ID.*/ -} mavlink_set_home_position_t; +}) mavlink_set_home_position_t; #define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN 53 +#define MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN 53 #define MAVLINK_MSG_ID_243_LEN 53 +#define MAVLINK_MSG_ID_243_MIN_LEN 53 #define MAVLINK_MSG_ID_SET_HOME_POSITION_CRC 85 #define MAVLINK_MSG_ID_243_CRC 85 #define MAVLINK_MSG_SET_HOME_POSITION_FIELD_Q_LEN 4 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \ - "SET_HOME_POSITION", \ - 11, \ - { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \ + 243, \ + "SET_HOME_POSITION", \ + 11, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \ { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \ @@ -41,7 +46,24 @@ typedef struct __mavlink_set_home_position_t { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \ + "SET_HOME_POSITION", \ + 11, \ + { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \ + { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \ + { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_home_position_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_home_position_t, z) }, \ + { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_set_home_position_t, q) }, \ + { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \ + { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \ + { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \ + } \ +} +#endif /** * @brief Pack a set_home_position message @@ -63,44 +85,40 @@ typedef struct __mavlink_set_home_position_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) + uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_uint8_t(buf, 52, target_system); - _mav_put_float_array(buf, 24, q, 4); + char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_uint8_t(buf, 52, target_system); + _mav_put_float_array(buf, 24, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); #else - mavlink_set_home_position_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.x = x; - packet.y = y; - packet.z = z; - packet.approach_x = approach_x; - packet.approach_y = approach_y; - packet.approach_z = approach_z; - packet.target_system = target_system; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_set_home_position_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.x = x; + packet.y = y; + packet.z = z; + packet.approach_x = approach_x; + packet.approach_y = approach_y; + packet.approach_z = approach_z; + packet.target_system = target_system; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); } /** @@ -123,45 +141,41 @@ static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uin * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z) + mavlink_message_t* msg, + uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_uint8_t(buf, 52, target_system); - _mav_put_float_array(buf, 24, q, 4); + char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_uint8_t(buf, 52, target_system); + _mav_put_float_array(buf, 24, q, 4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); #else - mavlink_set_home_position_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.x = x; - packet.y = y; - packet.z = z; - packet.approach_x = approach_x; - packet.approach_y = approach_y; - packet.approach_z = approach_z; - packet.target_system = target_system; - mav_array_memcpy(packet.q, q, sizeof(float)*4); + mavlink_set_home_position_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.x = x; + packet.y = y; + packet.z = z; + packet.approach_x = approach_x; + packet.approach_y = approach_y; + packet.approach_z = approach_z; + packet.target_system = target_system; + mav_array_memcpy(packet.q, q, sizeof(float)*4); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); } /** @@ -174,7 +188,7 @@ static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id */ static inline uint16_t mavlink_msg_set_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position) { - return mavlink_msg_set_home_position_pack(system_id, component_id, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z); + return mavlink_msg_set_home_position_pack(system_id, component_id, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z); } /** @@ -188,7 +202,7 @@ static inline uint16_t mavlink_msg_set_home_position_encode(uint8_t system_id, u */ static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position) { - return mavlink_msg_set_home_position_pack_chan(system_id, component_id, chan, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z); + return mavlink_msg_set_home_position_pack_chan(system_id, component_id, chan, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z); } /** @@ -212,41 +226,47 @@ static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint8_t system_ static inline void mavlink_msg_set_home_position_send(mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN]; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_uint8_t(buf, 52, target_system); - _mav_put_float_array(buf, 24, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); + char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN]; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_uint8_t(buf, 52, target_system); + _mav_put_float_array(buf, 24, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); + mavlink_set_home_position_t packet; + packet.latitude = latitude; + packet.longitude = longitude; + packet.altitude = altitude; + packet.x = x; + packet.y = y; + packet.z = z; + packet.approach_x = approach_x; + packet.approach_y = approach_y; + packet.approach_z = approach_z; + packet.target_system = target_system; + mav_array_memcpy(packet.q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); #endif +} + +/** + * @brief Send a set_home_position message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_home_position_send_struct(mavlink_channel_t chan, const mavlink_set_home_position_t* set_home_position) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_home_position_send(chan, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z); #else - mavlink_set_home_position_t packet; - packet.latitude = latitude; - packet.longitude = longitude; - packet.altitude = altitude; - packet.x = x; - packet.y = y; - packet.z = z; - packet.approach_x = approach_x; - packet.approach_y = approach_y; - packet.approach_z = approach_z; - packet.target_system = target_system; - mav_array_memcpy(packet.q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)set_home_position, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); #endif } @@ -261,41 +281,33 @@ static inline void mavlink_msg_set_home_position_send(mavlink_channel_t chan, ui static inline void mavlink_msg_set_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, latitude); - _mav_put_int32_t(buf, 4, longitude); - _mav_put_int32_t(buf, 8, altitude); - _mav_put_float(buf, 12, x); - _mav_put_float(buf, 16, y); - _mav_put_float(buf, 20, z); - _mav_put_float(buf, 40, approach_x); - _mav_put_float(buf, 44, approach_y); - _mav_put_float(buf, 48, approach_z); - _mav_put_uint8_t(buf, 52, target_system); - _mav_put_float_array(buf, 24, q, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, latitude); + _mav_put_int32_t(buf, 4, longitude); + _mav_put_int32_t(buf, 8, altitude); + _mav_put_float(buf, 12, x); + _mav_put_float(buf, 16, y); + _mav_put_float(buf, 20, z); + _mav_put_float(buf, 40, approach_x); + _mav_put_float(buf, 44, approach_y); + _mav_put_float(buf, 48, approach_z); + _mav_put_uint8_t(buf, 52, target_system); + _mav_put_float_array(buf, 24, q, 4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); -#endif -#else - mavlink_set_home_position_t *packet = (mavlink_set_home_position_t *)msgbuf; - packet->latitude = latitude; - packet->longitude = longitude; - packet->altitude = altitude; - packet->x = x; - packet->y = y; - packet->z = z; - packet->approach_x = approach_x; - packet->approach_y = approach_y; - packet->approach_z = approach_z; - packet->target_system = target_system; - mav_array_memcpy(packet->q, q, sizeof(float)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); -#endif + mavlink_set_home_position_t *packet = (mavlink_set_home_position_t *)msgbuf; + packet->latitude = latitude; + packet->longitude = longitude; + packet->altitude = altitude; + packet->x = x; + packet->y = y; + packet->z = z; + packet->approach_x = approach_x; + packet->approach_y = approach_y; + packet->approach_z = approach_z; + packet->target_system = target_system; + mav_array_memcpy(packet->q, q, sizeof(float)*4); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC); #endif } #endif @@ -312,7 +324,7 @@ static inline void mavlink_msg_set_home_position_send_buf(mavlink_message_t *msg */ static inline uint8_t mavlink_msg_set_home_position_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 52); + return _MAV_RETURN_uint8_t(msg, 52); } /** @@ -322,7 +334,7 @@ static inline uint8_t mavlink_msg_set_home_position_get_target_system(const mavl */ static inline int32_t mavlink_msg_set_home_position_get_latitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -332,7 +344,7 @@ static inline int32_t mavlink_msg_set_home_position_get_latitude(const mavlink_m */ static inline int32_t mavlink_msg_set_home_position_get_longitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -342,7 +354,7 @@ static inline int32_t mavlink_msg_set_home_position_get_longitude(const mavlink_ */ static inline int32_t mavlink_msg_set_home_position_get_altitude(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -352,7 +364,7 @@ static inline int32_t mavlink_msg_set_home_position_get_altitude(const mavlink_m */ static inline float mavlink_msg_set_home_position_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -362,7 +374,7 @@ static inline float mavlink_msg_set_home_position_get_x(const mavlink_message_t* */ static inline float mavlink_msg_set_home_position_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -372,7 +384,7 @@ static inline float mavlink_msg_set_home_position_get_y(const mavlink_message_t* */ static inline float mavlink_msg_set_home_position_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -382,7 +394,7 @@ static inline float mavlink_msg_set_home_position_get_z(const mavlink_message_t* */ static inline uint16_t mavlink_msg_set_home_position_get_q(const mavlink_message_t* msg, float *q) { - return _MAV_RETURN_float_array(msg, q, 4, 24); + return _MAV_RETURN_float_array(msg, q, 4, 24); } /** @@ -392,7 +404,7 @@ static inline uint16_t mavlink_msg_set_home_position_get_q(const mavlink_message */ static inline float mavlink_msg_set_home_position_get_approach_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -402,7 +414,7 @@ static inline float mavlink_msg_set_home_position_get_approach_x(const mavlink_m */ static inline float mavlink_msg_set_home_position_get_approach_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -412,7 +424,7 @@ static inline float mavlink_msg_set_home_position_get_approach_y(const mavlink_m */ static inline float mavlink_msg_set_home_position_get_approach_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 48); + return _MAV_RETURN_float(msg, 48); } /** @@ -423,19 +435,21 @@ static inline float mavlink_msg_set_home_position_get_approach_z(const mavlink_m */ static inline void mavlink_msg_set_home_position_decode(const mavlink_message_t* msg, mavlink_set_home_position_t* set_home_position) { -#if MAVLINK_NEED_BYTE_SWAP - set_home_position->latitude = mavlink_msg_set_home_position_get_latitude(msg); - set_home_position->longitude = mavlink_msg_set_home_position_get_longitude(msg); - set_home_position->altitude = mavlink_msg_set_home_position_get_altitude(msg); - set_home_position->x = mavlink_msg_set_home_position_get_x(msg); - set_home_position->y = mavlink_msg_set_home_position_get_y(msg); - set_home_position->z = mavlink_msg_set_home_position_get_z(msg); - mavlink_msg_set_home_position_get_q(msg, set_home_position->q); - set_home_position->approach_x = mavlink_msg_set_home_position_get_approach_x(msg); - set_home_position->approach_y = mavlink_msg_set_home_position_get_approach_y(msg); - set_home_position->approach_z = mavlink_msg_set_home_position_get_approach_z(msg); - set_home_position->target_system = mavlink_msg_set_home_position_get_target_system(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_home_position->latitude = mavlink_msg_set_home_position_get_latitude(msg); + set_home_position->longitude = mavlink_msg_set_home_position_get_longitude(msg); + set_home_position->altitude = mavlink_msg_set_home_position_get_altitude(msg); + set_home_position->x = mavlink_msg_set_home_position_get_x(msg); + set_home_position->y = mavlink_msg_set_home_position_get_y(msg); + set_home_position->z = mavlink_msg_set_home_position_get_z(msg); + mavlink_msg_set_home_position_get_q(msg, set_home_position->q); + set_home_position->approach_x = mavlink_msg_set_home_position_get_approach_x(msg); + set_home_position->approach_y = mavlink_msg_set_home_position_get_approach_y(msg); + set_home_position->approach_z = mavlink_msg_set_home_position_get_approach_z(msg); + set_home_position->target_system = mavlink_msg_set_home_position_get_target_system(msg); #else - memcpy(set_home_position, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_SET_HOME_POSITION_LEN; + memset(set_home_position, 0, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN); + memcpy(set_home_position, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_mode.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_mode.h index d8a0973..f5770a7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_mode.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_mode.h @@ -1,31 +1,45 @@ +#pragma once // MESSAGE SET_MODE PACKING #define MAVLINK_MSG_ID_SET_MODE 11 -typedef struct __mavlink_set_mode_t -{ +MAVPACKED( +typedef struct __mavlink_set_mode_t { uint32_t custom_mode; /*< The new autopilot-specific mode. This field can be ignored by an autopilot.*/ uint8_t target_system; /*< The system setting the mode*/ uint8_t base_mode; /*< The new base mode*/ -} mavlink_set_mode_t; +}) mavlink_set_mode_t; #define MAVLINK_MSG_ID_SET_MODE_LEN 6 +#define MAVLINK_MSG_ID_SET_MODE_MIN_LEN 6 #define MAVLINK_MSG_ID_11_LEN 6 +#define MAVLINK_MSG_ID_11_MIN_LEN 6 #define MAVLINK_MSG_ID_SET_MODE_CRC 89 #define MAVLINK_MSG_ID_11_CRC 89 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SET_MODE { \ - "SET_MODE", \ - 3, \ - { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ + 11, \ + "SET_MODE", \ + 3, \ + { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \ { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_set_mode_t, base_mode) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SET_MODE { \ + "SET_MODE", \ + 3, \ + { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \ + { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_set_mode_t, base_mode) }, \ + } \ +} +#endif /** * @brief Pack a set_mode message @@ -39,30 +53,26 @@ typedef struct __mavlink_set_mode_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) + uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, base_mode); + char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, base_mode); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MODE_LEN); #else - mavlink_set_mode_t packet; - packet.custom_mode = custom_mode; - packet.target_system = target_system; - packet.base_mode = base_mode; + mavlink_set_mode_t packet; + packet.custom_mode = custom_mode; + packet.target_system = target_system; + packet.base_mode = base_mode; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MODE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_MODE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MODE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_MODE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); } /** @@ -77,31 +87,27 @@ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_system,uint8_t base_mode,uint32_t custom_mode) + mavlink_message_t* msg, + uint8_t target_system,uint8_t base_mode,uint32_t custom_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, base_mode); + char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, base_mode); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MODE_LEN); #else - mavlink_set_mode_t packet; - packet.custom_mode = custom_mode; - packet.target_system = target_system; - packet.base_mode = base_mode; + mavlink_set_mode_t packet; + packet.custom_mode = custom_mode; + packet.target_system = target_system; + packet.base_mode = base_mode; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MODE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_MODE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MODE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_MODE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); } /** @@ -114,7 +120,7 @@ static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_set_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mode_t* set_mode) { - return mavlink_msg_set_mode_pack(system_id, component_id, msg, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode); + return mavlink_msg_set_mode_pack(system_id, component_id, msg, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode); } /** @@ -128,7 +134,7 @@ static inline uint16_t mavlink_msg_set_mode_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_set_mode_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_mode_t* set_mode) { - return mavlink_msg_set_mode_pack_chan(system_id, component_id, chan, msg, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode); + return mavlink_msg_set_mode_pack_chan(system_id, component_id, chan, msg, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode); } /** @@ -144,27 +150,33 @@ static inline uint16_t mavlink_msg_set_mode_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_set_mode_send(mavlink_channel_t chan, uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, base_mode); + char buf[MAVLINK_MSG_ID_SET_MODE_LEN]; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, base_mode); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_LEN); + mavlink_set_mode_t packet; + packet.custom_mode = custom_mode; + packet.target_system = target_system; + packet.base_mode = base_mode; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); #endif -#else - mavlink_set_mode_t packet; - packet.custom_mode = custom_mode; - packet.target_system = target_system; - packet.base_mode = base_mode; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); +/** + * @brief Send a set_mode message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_mode_send_struct(mavlink_channel_t chan, const mavlink_set_mode_t* set_mode) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_mode_send(chan, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, MAVLINK_MSG_ID_SET_MODE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)set_mode, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); #endif } @@ -179,27 +191,19 @@ static inline void mavlink_msg_set_mode_send(mavlink_channel_t chan, uint8_t tar static inline void mavlink_msg_set_mode_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, custom_mode); - _mav_put_uint8_t(buf, 4, target_system); - _mav_put_uint8_t(buf, 5, base_mode); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, custom_mode); + _mav_put_uint8_t(buf, 4, target_system); + _mav_put_uint8_t(buf, 5, base_mode); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); #else - mavlink_set_mode_t *packet = (mavlink_set_mode_t *)msgbuf; - packet->custom_mode = custom_mode; - packet->target_system = target_system; - packet->base_mode = base_mode; + mavlink_set_mode_t *packet = (mavlink_set_mode_t *)msgbuf; + packet->custom_mode = custom_mode; + packet->target_system = target_system; + packet->base_mode = base_mode; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)packet, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)packet, MAVLINK_MSG_ID_SET_MODE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)packet, MAVLINK_MSG_ID_SET_MODE_MIN_LEN, MAVLINK_MSG_ID_SET_MODE_LEN, MAVLINK_MSG_ID_SET_MODE_CRC); #endif } #endif @@ -216,7 +220,7 @@ static inline void mavlink_msg_set_mode_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint8_t mavlink_msg_set_mode_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -226,7 +230,7 @@ static inline uint8_t mavlink_msg_set_mode_get_target_system(const mavlink_messa */ static inline uint8_t mavlink_msg_set_mode_get_base_mode(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 5); + return _MAV_RETURN_uint8_t(msg, 5); } /** @@ -236,7 +240,7 @@ static inline uint8_t mavlink_msg_set_mode_get_base_mode(const mavlink_message_t */ static inline uint32_t mavlink_msg_set_mode_get_custom_mode(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -247,11 +251,13 @@ static inline uint32_t mavlink_msg_set_mode_get_custom_mode(const mavlink_messag */ static inline void mavlink_msg_set_mode_decode(const mavlink_message_t* msg, mavlink_set_mode_t* set_mode) { -#if MAVLINK_NEED_BYTE_SWAP - set_mode->custom_mode = mavlink_msg_set_mode_get_custom_mode(msg); - set_mode->target_system = mavlink_msg_set_mode_get_target_system(msg); - set_mode->base_mode = mavlink_msg_set_mode_get_base_mode(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_mode->custom_mode = mavlink_msg_set_mode_get_custom_mode(msg); + set_mode->target_system = mavlink_msg_set_mode_get_target_system(msg); + set_mode->base_mode = mavlink_msg_set_mode_get_base_mode(msg); #else - memcpy(set_mode, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_MODE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_MODE_LEN? msg->len : MAVLINK_MSG_ID_SET_MODE_LEN; + memset(set_mode, 0, MAVLINK_MSG_ID_SET_MODE_LEN); + memcpy(set_mode, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_global_int.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_global_int.h index 814fc27..50cfb9f 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_global_int.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_global_int.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SET_POSITION_TARGET_GLOBAL_INT PACKING #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT 86 -typedef struct __mavlink_set_position_target_global_int_t -{ +MAVPACKED( +typedef struct __mavlink_set_position_target_global_int_t { uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/ int32_t lat_int; /*< X Position in WGS84 frame in 1e7 * meters*/ int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/ @@ -20,20 +21,24 @@ typedef struct __mavlink_set_position_target_global_int_t uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/ -} mavlink_set_position_target_global_int_t; +}) mavlink_set_position_target_global_int_t; #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN 53 +#define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN 53 #define MAVLINK_MSG_ID_86_LEN 53 +#define MAVLINK_MSG_ID_86_MIN_LEN 53 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC 5 #define MAVLINK_MSG_ID_86_CRC 5 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT { \ - "SET_POSITION_TARGET_GLOBAL_INT", \ - 16, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_global_int_t, time_boot_ms) }, \ + 86, \ + "SET_POSITION_TARGET_GLOBAL_INT", \ + 16, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_global_int_t, time_boot_ms) }, \ { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_position_target_global_int_t, lat_int) }, \ { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_position_target_global_int_t, lon_int) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_global_int_t, alt) }, \ @@ -51,7 +56,29 @@ typedef struct __mavlink_set_position_target_global_int_t { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT { \ + "SET_POSITION_TARGET_GLOBAL_INT", \ + 16, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_global_int_t, time_boot_ms) }, \ + { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_position_target_global_int_t, lat_int) }, \ + { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_position_target_global_int_t, lon_int) }, \ + { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_global_int_t, alt) }, \ + { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_global_int_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_global_int_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_global_int_t, vz) }, \ + { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_global_int_t, afx) }, \ + { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_global_int_t, afy) }, \ + { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_global_int_t, afz) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_global_int_t, yaw) }, \ + { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_global_int_t, yaw_rate) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_global_int_t, type_mask) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_global_int_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_global_int_t, target_component) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_global_int_t, coordinate_frame) }, \ + } \ +} +#endif /** * @brief Pack a set_position_target_global_int message @@ -78,56 +105,52 @@ typedef struct __mavlink_set_position_target_global_int_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) + uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); + char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); #else - mavlink_set_position_target_global_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat_int = lat_int; - packet.lon_int = lon_int; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.target_system = target_system; - packet.target_component = target_component; - packet.coordinate_frame = coordinate_frame; + mavlink_set_position_target_global_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat_int = lat_int; + packet.lon_int = lon_int; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.target_system = target_system; + packet.target_component = target_component; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); } /** @@ -155,57 +178,53 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_pack(uint8_t s * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); + char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); #else - mavlink_set_position_target_global_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat_int = lat_int; - packet.lon_int = lon_int; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.target_system = target_system; - packet.target_component = target_component; - packet.coordinate_frame = coordinate_frame; + mavlink_set_position_target_global_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat_int = lat_int; + packet.lon_int = lon_int; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.target_system = target_system; + packet.target_component = target_component; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); } /** @@ -218,7 +237,7 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_pack_chan(uint */ static inline uint16_t mavlink_msg_set_position_target_global_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_position_target_global_int_t* set_position_target_global_int) { - return mavlink_msg_set_position_target_global_int_pack(system_id, component_id, msg, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate); + return mavlink_msg_set_position_target_global_int_pack(system_id, component_id, msg, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate); } /** @@ -232,7 +251,7 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_encode(uint8_t */ static inline uint16_t mavlink_msg_set_position_target_global_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_position_target_global_int_t* set_position_target_global_int) { - return mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, chan, msg, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate); + return mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, chan, msg, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate); } /** @@ -261,53 +280,59 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_encode_chan(ui static inline void mavlink_msg_set_position_target_global_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); + char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); + mavlink_set_position_target_global_int_t packet; + packet.time_boot_ms = time_boot_ms; + packet.lat_int = lat_int; + packet.lon_int = lon_int; + packet.alt = alt; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.target_system = target_system; + packet.target_component = target_component; + packet.coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); #endif +} + +/** + * @brief Send a set_position_target_global_int message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_position_target_global_int_send_struct(mavlink_channel_t chan, const mavlink_set_position_target_global_int_t* set_position_target_global_int) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_position_target_global_int_send(chan, set_position_target_global_int->time_boot_ms, set_position_target_global_int->target_system, set_position_target_global_int->target_component, set_position_target_global_int->coordinate_frame, set_position_target_global_int->type_mask, set_position_target_global_int->lat_int, set_position_target_global_int->lon_int, set_position_target_global_int->alt, set_position_target_global_int->vx, set_position_target_global_int->vy, set_position_target_global_int->vz, set_position_target_global_int->afx, set_position_target_global_int->afy, set_position_target_global_int->afz, set_position_target_global_int->yaw, set_position_target_global_int->yaw_rate); #else - mavlink_set_position_target_global_int_t packet; - packet.time_boot_ms = time_boot_ms; - packet.lat_int = lat_int; - packet.lon_int = lon_int; - packet.alt = alt; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.target_system = target_system; - packet.target_component = target_component; - packet.coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)set_position_target_global_int, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); #endif } @@ -322,53 +347,45 @@ static inline void mavlink_msg_set_position_target_global_int_send(mavlink_chann static inline void mavlink_msg_set_position_target_global_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_int32_t(buf, 4, lat_int); - _mav_put_int32_t(buf, 8, lon_int); - _mav_put_float(buf, 12, alt); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_int32_t(buf, 4, lat_int); + _mav_put_int32_t(buf, 8, lon_int); + _mav_put_float(buf, 12, alt); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); -#endif -#else - mavlink_set_position_target_global_int_t *packet = (mavlink_set_position_target_global_int_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->lat_int = lat_int; - packet->lon_int = lon_int; - packet->alt = alt; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->afx = afx; - packet->afy = afy; - packet->afz = afz; - packet->yaw = yaw; - packet->yaw_rate = yaw_rate; - packet->type_mask = type_mask; - packet->target_system = target_system; - packet->target_component = target_component; - packet->coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); -#endif + mavlink_set_position_target_global_int_t *packet = (mavlink_set_position_target_global_int_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->lat_int = lat_int; + packet->lon_int = lon_int; + packet->alt = alt; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->afx = afx; + packet->afy = afy; + packet->afz = afz; + packet->yaw = yaw; + packet->yaw_rate = yaw_rate; + packet->type_mask = type_mask; + packet->target_system = target_system; + packet->target_component = target_component; + packet->coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC); #endif } #endif @@ -385,7 +402,7 @@ static inline void mavlink_msg_set_position_target_global_int_send_buf(mavlink_m */ static inline uint32_t mavlink_msg_set_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -395,7 +412,7 @@ static inline uint32_t mavlink_msg_set_position_target_global_int_get_time_boot_ */ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 50); + return _MAV_RETURN_uint8_t(msg, 50); } /** @@ -405,7 +422,7 @@ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_syst */ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 51); + return _MAV_RETURN_uint8_t(msg, 51); } /** @@ -415,7 +432,7 @@ static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_comp */ static inline uint8_t mavlink_msg_set_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 52); + return _MAV_RETURN_uint8_t(msg, 52); } /** @@ -425,7 +442,7 @@ static inline uint8_t mavlink_msg_set_position_target_global_int_get_coordinate_ */ static inline uint16_t mavlink_msg_set_position_target_global_int_get_type_mask(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 48); + return _MAV_RETURN_uint16_t(msg, 48); } /** @@ -435,7 +452,7 @@ static inline uint16_t mavlink_msg_set_position_target_global_int_get_type_mask( */ static inline int32_t mavlink_msg_set_position_target_global_int_get_lat_int(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -445,7 +462,7 @@ static inline int32_t mavlink_msg_set_position_target_global_int_get_lat_int(con */ static inline int32_t mavlink_msg_set_position_target_global_int_get_lon_int(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -455,7 +472,7 @@ static inline int32_t mavlink_msg_set_position_target_global_int_get_lon_int(con */ static inline float mavlink_msg_set_position_target_global_int_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -465,7 +482,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_alt(const mav */ static inline float mavlink_msg_set_position_target_global_int_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -475,7 +492,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_vx(const mavl */ static inline float mavlink_msg_set_position_target_global_int_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -485,7 +502,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_vy(const mavl */ static inline float mavlink_msg_set_position_target_global_int_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -495,7 +512,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_vz(const mavl */ static inline float mavlink_msg_set_position_target_global_int_get_afx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -505,7 +522,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_afx(const mav */ static inline float mavlink_msg_set_position_target_global_int_get_afy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -515,7 +532,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_afy(const mav */ static inline float mavlink_msg_set_position_target_global_int_get_afz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -525,7 +542,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_afz(const mav */ static inline float mavlink_msg_set_position_target_global_int_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -535,7 +552,7 @@ static inline float mavlink_msg_set_position_target_global_int_get_yaw(const mav */ static inline float mavlink_msg_set_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -546,24 +563,26 @@ static inline float mavlink_msg_set_position_target_global_int_get_yaw_rate(cons */ static inline void mavlink_msg_set_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_set_position_target_global_int_t* set_position_target_global_int) { -#if MAVLINK_NEED_BYTE_SWAP - set_position_target_global_int->time_boot_ms = mavlink_msg_set_position_target_global_int_get_time_boot_ms(msg); - set_position_target_global_int->lat_int = mavlink_msg_set_position_target_global_int_get_lat_int(msg); - set_position_target_global_int->lon_int = mavlink_msg_set_position_target_global_int_get_lon_int(msg); - set_position_target_global_int->alt = mavlink_msg_set_position_target_global_int_get_alt(msg); - set_position_target_global_int->vx = mavlink_msg_set_position_target_global_int_get_vx(msg); - set_position_target_global_int->vy = mavlink_msg_set_position_target_global_int_get_vy(msg); - set_position_target_global_int->vz = mavlink_msg_set_position_target_global_int_get_vz(msg); - set_position_target_global_int->afx = mavlink_msg_set_position_target_global_int_get_afx(msg); - set_position_target_global_int->afy = mavlink_msg_set_position_target_global_int_get_afy(msg); - set_position_target_global_int->afz = mavlink_msg_set_position_target_global_int_get_afz(msg); - set_position_target_global_int->yaw = mavlink_msg_set_position_target_global_int_get_yaw(msg); - set_position_target_global_int->yaw_rate = mavlink_msg_set_position_target_global_int_get_yaw_rate(msg); - set_position_target_global_int->type_mask = mavlink_msg_set_position_target_global_int_get_type_mask(msg); - set_position_target_global_int->target_system = mavlink_msg_set_position_target_global_int_get_target_system(msg); - set_position_target_global_int->target_component = mavlink_msg_set_position_target_global_int_get_target_component(msg); - set_position_target_global_int->coordinate_frame = mavlink_msg_set_position_target_global_int_get_coordinate_frame(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_position_target_global_int->time_boot_ms = mavlink_msg_set_position_target_global_int_get_time_boot_ms(msg); + set_position_target_global_int->lat_int = mavlink_msg_set_position_target_global_int_get_lat_int(msg); + set_position_target_global_int->lon_int = mavlink_msg_set_position_target_global_int_get_lon_int(msg); + set_position_target_global_int->alt = mavlink_msg_set_position_target_global_int_get_alt(msg); + set_position_target_global_int->vx = mavlink_msg_set_position_target_global_int_get_vx(msg); + set_position_target_global_int->vy = mavlink_msg_set_position_target_global_int_get_vy(msg); + set_position_target_global_int->vz = mavlink_msg_set_position_target_global_int_get_vz(msg); + set_position_target_global_int->afx = mavlink_msg_set_position_target_global_int_get_afx(msg); + set_position_target_global_int->afy = mavlink_msg_set_position_target_global_int_get_afy(msg); + set_position_target_global_int->afz = mavlink_msg_set_position_target_global_int_get_afz(msg); + set_position_target_global_int->yaw = mavlink_msg_set_position_target_global_int_get_yaw(msg); + set_position_target_global_int->yaw_rate = mavlink_msg_set_position_target_global_int_get_yaw_rate(msg); + set_position_target_global_int->type_mask = mavlink_msg_set_position_target_global_int_get_type_mask(msg); + set_position_target_global_int->target_system = mavlink_msg_set_position_target_global_int_get_target_system(msg); + set_position_target_global_int->target_component = mavlink_msg_set_position_target_global_int_get_target_component(msg); + set_position_target_global_int->coordinate_frame = mavlink_msg_set_position_target_global_int_get_coordinate_frame(msg); #else - memcpy(set_position_target_global_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN? msg->len : MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN; + memset(set_position_target_global_int, 0, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN); + memcpy(set_position_target_global_int, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_local_ned.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_local_ned.h index 9f503ed..8822513 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_local_ned.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_set_position_target_local_ned.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SET_POSITION_TARGET_LOCAL_NED PACKING #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED 84 -typedef struct __mavlink_set_position_target_local_ned_t -{ +MAVPACKED( +typedef struct __mavlink_set_position_target_local_ned_t { uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/ float x; /*< X Position in NED frame in meters*/ float y; /*< Y Position in NED frame in meters*/ @@ -20,20 +21,24 @@ typedef struct __mavlink_set_position_target_local_ned_t uint8_t target_system; /*< System ID*/ uint8_t target_component; /*< Component ID*/ uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/ -} mavlink_set_position_target_local_ned_t; +}) mavlink_set_position_target_local_ned_t; #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN 53 +#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN 53 #define MAVLINK_MSG_ID_84_LEN 53 +#define MAVLINK_MSG_ID_84_MIN_LEN 53 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC 143 #define MAVLINK_MSG_ID_84_CRC 143 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED { \ - "SET_POSITION_TARGET_LOCAL_NED", \ - 16, \ - { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \ + 84, \ + "SET_POSITION_TARGET_LOCAL_NED", \ + 16, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \ @@ -51,7 +56,29 @@ typedef struct __mavlink_set_position_target_local_ned_t { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED { \ + "SET_POSITION_TARGET_LOCAL_NED", \ + 16, \ + { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \ + { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_local_ned_t, vx) }, \ + { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_local_ned_t, vy) }, \ + { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_local_ned_t, vz) }, \ + { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_local_ned_t, afx) }, \ + { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_local_ned_t, afy) }, \ + { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \ + { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \ + { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \ + { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \ + } \ +} +#endif /** * @brief Pack a set_position_target_local_ned message @@ -78,56 +105,52 @@ typedef struct __mavlink_set_position_target_local_ned_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) + uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); + char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); #else - mavlink_set_position_target_local_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.target_system = target_system; - packet.target_component = target_component; - packet.coordinate_frame = coordinate_frame; + mavlink_set_position_target_local_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.target_system = target_system; + packet.target_component = target_component; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); } /** @@ -155,57 +178,53 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_pack(uint8_t sy * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_set_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,uint16_t type_mask,float x,float y,float z,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) + mavlink_message_t* msg, + uint32_t time_boot_ms,uint8_t target_system,uint8_t target_component,uint8_t coordinate_frame,uint16_t type_mask,float x,float y,float z,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); + char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); #else - mavlink_set_position_target_local_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.target_system = target_system; - packet.target_component = target_component; - packet.coordinate_frame = coordinate_frame; + mavlink_set_position_target_local_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.target_system = target_system; + packet.target_component = target_component; + packet.coordinate_frame = coordinate_frame; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); } /** @@ -218,7 +237,7 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_pack_chan(uint8 */ static inline uint16_t mavlink_msg_set_position_target_local_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned) { - return mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate); + return mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate); } /** @@ -232,7 +251,7 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_encode(uint8_t */ static inline uint16_t mavlink_msg_set_position_target_local_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned) { - return mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate); + return mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate); } /** @@ -261,53 +280,59 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_encode_chan(uin static inline void mavlink_msg_set_position_target_local_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN]; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); + char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN]; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); + mavlink_set_position_target_local_ned_t packet; + packet.time_boot_ms = time_boot_ms; + packet.x = x; + packet.y = y; + packet.z = z; + packet.vx = vx; + packet.vy = vy; + packet.vz = vz; + packet.afx = afx; + packet.afy = afy; + packet.afz = afz; + packet.yaw = yaw; + packet.yaw_rate = yaw_rate; + packet.type_mask = type_mask; + packet.target_system = target_system; + packet.target_component = target_component; + packet.coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); #endif +} + +/** + * @brief Send a set_position_target_local_ned message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_position_target_local_ned_send_struct(mavlink_channel_t chan, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_position_target_local_ned_send(chan, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate); #else - mavlink_set_position_target_local_ned_t packet; - packet.time_boot_ms = time_boot_ms; - packet.x = x; - packet.y = y; - packet.z = z; - packet.vx = vx; - packet.vy = vy; - packet.vz = vz; - packet.afx = afx; - packet.afy = afy; - packet.afz = afz; - packet.yaw = yaw; - packet.yaw_rate = yaw_rate; - packet.type_mask = type_mask; - packet.target_system = target_system; - packet.target_component = target_component; - packet.coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)set_position_target_local_ned, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); #endif } @@ -322,53 +347,45 @@ static inline void mavlink_msg_set_position_target_local_ned_send(mavlink_channe static inline void mavlink_msg_set_position_target_local_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t target_system, uint8_t target_component, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, time_boot_ms); - _mav_put_float(buf, 4, x); - _mav_put_float(buf, 8, y); - _mav_put_float(buf, 12, z); - _mav_put_float(buf, 16, vx); - _mav_put_float(buf, 20, vy); - _mav_put_float(buf, 24, vz); - _mav_put_float(buf, 28, afx); - _mav_put_float(buf, 32, afy); - _mav_put_float(buf, 36, afz); - _mav_put_float(buf, 40, yaw); - _mav_put_float(buf, 44, yaw_rate); - _mav_put_uint16_t(buf, 48, type_mask); - _mav_put_uint8_t(buf, 50, target_system); - _mav_put_uint8_t(buf, 51, target_component); - _mav_put_uint8_t(buf, 52, coordinate_frame); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, time_boot_ms); + _mav_put_float(buf, 4, x); + _mav_put_float(buf, 8, y); + _mav_put_float(buf, 12, z); + _mav_put_float(buf, 16, vx); + _mav_put_float(buf, 20, vy); + _mav_put_float(buf, 24, vz); + _mav_put_float(buf, 28, afx); + _mav_put_float(buf, 32, afy); + _mav_put_float(buf, 36, afz); + _mav_put_float(buf, 40, yaw); + _mav_put_float(buf, 44, yaw_rate); + _mav_put_uint16_t(buf, 48, type_mask); + _mav_put_uint8_t(buf, 50, target_system); + _mav_put_uint8_t(buf, 51, target_component); + _mav_put_uint8_t(buf, 52, coordinate_frame); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); -#endif -#else - mavlink_set_position_target_local_ned_t *packet = (mavlink_set_position_target_local_ned_t *)msgbuf; - packet->time_boot_ms = time_boot_ms; - packet->x = x; - packet->y = y; - packet->z = z; - packet->vx = vx; - packet->vy = vy; - packet->vz = vz; - packet->afx = afx; - packet->afy = afy; - packet->afz = afz; - packet->yaw = yaw; - packet->yaw_rate = yaw_rate; - packet->type_mask = type_mask; - packet->target_system = target_system; - packet->target_component = target_component; - packet->coordinate_frame = coordinate_frame; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); -#endif + mavlink_set_position_target_local_ned_t *packet = (mavlink_set_position_target_local_ned_t *)msgbuf; + packet->time_boot_ms = time_boot_ms; + packet->x = x; + packet->y = y; + packet->z = z; + packet->vx = vx; + packet->vy = vy; + packet->vz = vz; + packet->afx = afx; + packet->afy = afy; + packet->afz = afz; + packet->yaw = yaw; + packet->yaw_rate = yaw_rate; + packet->type_mask = type_mask; + packet->target_system = target_system; + packet->target_component = target_component; + packet->coordinate_frame = coordinate_frame; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC); #endif } #endif @@ -385,7 +402,7 @@ static inline void mavlink_msg_set_position_target_local_ned_send_buf(mavlink_me */ static inline uint32_t mavlink_msg_set_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -395,7 +412,7 @@ static inline uint32_t mavlink_msg_set_position_target_local_ned_get_time_boot_m */ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 50); + return _MAV_RETURN_uint8_t(msg, 50); } /** @@ -405,7 +422,7 @@ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_syste */ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 51); + return _MAV_RETURN_uint8_t(msg, 51); } /** @@ -415,7 +432,7 @@ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_compo */ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 52); + return _MAV_RETURN_uint8_t(msg, 52); } /** @@ -425,7 +442,7 @@ static inline uint8_t mavlink_msg_set_position_target_local_ned_get_coordinate_f */ static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 48); + return _MAV_RETURN_uint16_t(msg, 48); } /** @@ -435,7 +452,7 @@ static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(c */ static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -445,7 +462,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlin */ static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -455,7 +472,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlin */ static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -465,7 +482,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlin */ static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -475,7 +492,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavli */ static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -485,7 +502,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavli */ static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -495,7 +512,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavli */ static inline float mavlink_msg_set_position_target_local_ned_get_afx(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -505,7 +522,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_afx(const mavl */ static inline float mavlink_msg_set_position_target_local_ned_get_afy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -515,7 +532,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_afy(const mavl */ static inline float mavlink_msg_set_position_target_local_ned_get_afz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -525,7 +542,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_afz(const mavl */ static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -535,7 +552,7 @@ static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavl */ static inline float mavlink_msg_set_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -546,24 +563,26 @@ static inline float mavlink_msg_set_position_target_local_ned_get_yaw_rate(const */ static inline void mavlink_msg_set_position_target_local_ned_decode(const mavlink_message_t* msg, mavlink_set_position_target_local_ned_t* set_position_target_local_ned) { -#if MAVLINK_NEED_BYTE_SWAP - set_position_target_local_ned->time_boot_ms = mavlink_msg_set_position_target_local_ned_get_time_boot_ms(msg); - set_position_target_local_ned->x = mavlink_msg_set_position_target_local_ned_get_x(msg); - set_position_target_local_ned->y = mavlink_msg_set_position_target_local_ned_get_y(msg); - set_position_target_local_ned->z = mavlink_msg_set_position_target_local_ned_get_z(msg); - set_position_target_local_ned->vx = mavlink_msg_set_position_target_local_ned_get_vx(msg); - set_position_target_local_ned->vy = mavlink_msg_set_position_target_local_ned_get_vy(msg); - set_position_target_local_ned->vz = mavlink_msg_set_position_target_local_ned_get_vz(msg); - set_position_target_local_ned->afx = mavlink_msg_set_position_target_local_ned_get_afx(msg); - set_position_target_local_ned->afy = mavlink_msg_set_position_target_local_ned_get_afy(msg); - set_position_target_local_ned->afz = mavlink_msg_set_position_target_local_ned_get_afz(msg); - set_position_target_local_ned->yaw = mavlink_msg_set_position_target_local_ned_get_yaw(msg); - set_position_target_local_ned->yaw_rate = mavlink_msg_set_position_target_local_ned_get_yaw_rate(msg); - set_position_target_local_ned->type_mask = mavlink_msg_set_position_target_local_ned_get_type_mask(msg); - set_position_target_local_ned->target_system = mavlink_msg_set_position_target_local_ned_get_target_system(msg); - set_position_target_local_ned->target_component = mavlink_msg_set_position_target_local_ned_get_target_component(msg); - set_position_target_local_ned->coordinate_frame = mavlink_msg_set_position_target_local_ned_get_coordinate_frame(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_position_target_local_ned->time_boot_ms = mavlink_msg_set_position_target_local_ned_get_time_boot_ms(msg); + set_position_target_local_ned->x = mavlink_msg_set_position_target_local_ned_get_x(msg); + set_position_target_local_ned->y = mavlink_msg_set_position_target_local_ned_get_y(msg); + set_position_target_local_ned->z = mavlink_msg_set_position_target_local_ned_get_z(msg); + set_position_target_local_ned->vx = mavlink_msg_set_position_target_local_ned_get_vx(msg); + set_position_target_local_ned->vy = mavlink_msg_set_position_target_local_ned_get_vy(msg); + set_position_target_local_ned->vz = mavlink_msg_set_position_target_local_ned_get_vz(msg); + set_position_target_local_ned->afx = mavlink_msg_set_position_target_local_ned_get_afx(msg); + set_position_target_local_ned->afy = mavlink_msg_set_position_target_local_ned_get_afy(msg); + set_position_target_local_ned->afz = mavlink_msg_set_position_target_local_ned_get_afz(msg); + set_position_target_local_ned->yaw = mavlink_msg_set_position_target_local_ned_get_yaw(msg); + set_position_target_local_ned->yaw_rate = mavlink_msg_set_position_target_local_ned_get_yaw_rate(msg); + set_position_target_local_ned->type_mask = mavlink_msg_set_position_target_local_ned_get_type_mask(msg); + set_position_target_local_ned->target_system = mavlink_msg_set_position_target_local_ned_get_target_system(msg); + set_position_target_local_ned->target_component = mavlink_msg_set_position_target_local_ned_get_target_component(msg); + set_position_target_local_ned->coordinate_frame = mavlink_msg_set_position_target_local_ned_get_coordinate_frame(msg); #else - memcpy(set_position_target_local_ned, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN? msg->len : MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN; + memset(set_position_target_local_ned, 0, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN); + memcpy(set_position_target_local_ned, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sim_state.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sim_state.h index 263a1b6..363160f 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sim_state.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sim_state.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SIM_STATE PACKING #define MAVLINK_MSG_ID_SIM_STATE 108 -typedef struct __mavlink_sim_state_t -{ +MAVPACKED( +typedef struct __mavlink_sim_state_t { float q1; /*< True attitude quaternion component 1, w (1 in null-rotation)*/ float q2; /*< True attitude quaternion component 2, x (0 in null-rotation)*/ float q3; /*< True attitude quaternion component 3, y (0 in null-rotation)*/ @@ -25,20 +26,24 @@ typedef struct __mavlink_sim_state_t float vn; /*< True velocity in m/s in NORTH direction in earth-fixed NED frame*/ float ve; /*< True velocity in m/s in EAST direction in earth-fixed NED frame*/ float vd; /*< True velocity in m/s in DOWN direction in earth-fixed NED frame*/ -} mavlink_sim_state_t; +}) mavlink_sim_state_t; #define MAVLINK_MSG_ID_SIM_STATE_LEN 84 +#define MAVLINK_MSG_ID_SIM_STATE_MIN_LEN 84 #define MAVLINK_MSG_ID_108_LEN 84 +#define MAVLINK_MSG_ID_108_MIN_LEN 84 #define MAVLINK_MSG_ID_SIM_STATE_CRC 32 #define MAVLINK_MSG_ID_108_CRC 32 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SIM_STATE { \ - "SIM_STATE", \ - 21, \ - { { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) }, \ + 108, \ + "SIM_STATE", \ + 21, \ + { { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) }, \ { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) }, \ { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) }, \ { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) }, \ @@ -61,7 +66,34 @@ typedef struct __mavlink_sim_state_t { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SIM_STATE { \ + "SIM_STATE", \ + 21, \ + { { "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sim_state_t, q1) }, \ + { "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sim_state_t, q2) }, \ + { "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sim_state_t, q3) }, \ + { "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sim_state_t, q4) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sim_state_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sim_state_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sim_state_t, yaw) }, \ + { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sim_state_t, xacc) }, \ + { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sim_state_t, yacc) }, \ + { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_sim_state_t, zacc) }, \ + { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_sim_state_t, xgyro) }, \ + { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_sim_state_t, ygyro) }, \ + { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_sim_state_t, zgyro) }, \ + { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_sim_state_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_sim_state_t, lon) }, \ + { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_sim_state_t, alt) }, \ + { "std_dev_horz", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_sim_state_t, std_dev_horz) }, \ + { "std_dev_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_sim_state_t, std_dev_vert) }, \ + { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_sim_state_t, vn) }, \ + { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_sim_state_t, ve) }, \ + { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_sim_state_t, vd) }, \ + } \ +} +#endif /** * @brief Pack a sim_state message @@ -93,66 +125,62 @@ typedef struct __mavlink_sim_state_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd) + float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; - _mav_put_float(buf, 0, q1); - _mav_put_float(buf, 4, q2); - _mav_put_float(buf, 8, q3); - _mav_put_float(buf, 12, q4); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); - _mav_put_float(buf, 28, xacc); - _mav_put_float(buf, 32, yacc); - _mav_put_float(buf, 36, zacc); - _mav_put_float(buf, 40, xgyro); - _mav_put_float(buf, 44, ygyro); - _mav_put_float(buf, 48, zgyro); - _mav_put_float(buf, 52, lat); - _mav_put_float(buf, 56, lon); - _mav_put_float(buf, 60, alt); - _mav_put_float(buf, 64, std_dev_horz); - _mav_put_float(buf, 68, std_dev_vert); - _mav_put_float(buf, 72, vn); - _mav_put_float(buf, 76, ve); - _mav_put_float(buf, 80, vd); + char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; + _mav_put_float(buf, 0, q1); + _mav_put_float(buf, 4, q2); + _mav_put_float(buf, 8, q3); + _mav_put_float(buf, 12, q4); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); + _mav_put_float(buf, 28, xacc); + _mav_put_float(buf, 32, yacc); + _mav_put_float(buf, 36, zacc); + _mav_put_float(buf, 40, xgyro); + _mav_put_float(buf, 44, ygyro); + _mav_put_float(buf, 48, zgyro); + _mav_put_float(buf, 52, lat); + _mav_put_float(buf, 56, lon); + _mav_put_float(buf, 60, alt); + _mav_put_float(buf, 64, std_dev_horz); + _mav_put_float(buf, 68, std_dev_vert); + _mav_put_float(buf, 72, vn); + _mav_put_float(buf, 76, ve); + _mav_put_float(buf, 80, vd); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN); #else - mavlink_sim_state_t packet; - packet.q1 = q1; - packet.q2 = q2; - packet.q3 = q3; - packet.q4 = q4; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.std_dev_horz = std_dev_horz; - packet.std_dev_vert = std_dev_vert; - packet.vn = vn; - packet.ve = ve; - packet.vd = vd; + mavlink_sim_state_t packet; + packet.q1 = q1; + packet.q2 = q2; + packet.q3 = q3; + packet.q4 = q4; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.std_dev_horz = std_dev_horz; + packet.std_dev_vert = std_dev_vert; + packet.vn = vn; + packet.ve = ve; + packet.vd = vd; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SIM_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SIM_STATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); } /** @@ -185,67 +213,63 @@ static inline uint16_t mavlink_msg_sim_state_pack(uint8_t system_id, uint8_t com * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sim_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float q1,float q2,float q3,float q4,float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lon,float alt,float std_dev_horz,float std_dev_vert,float vn,float ve,float vd) + mavlink_message_t* msg, + float q1,float q2,float q3,float q4,float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lon,float alt,float std_dev_horz,float std_dev_vert,float vn,float ve,float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; - _mav_put_float(buf, 0, q1); - _mav_put_float(buf, 4, q2); - _mav_put_float(buf, 8, q3); - _mav_put_float(buf, 12, q4); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); - _mav_put_float(buf, 28, xacc); - _mav_put_float(buf, 32, yacc); - _mav_put_float(buf, 36, zacc); - _mav_put_float(buf, 40, xgyro); - _mav_put_float(buf, 44, ygyro); - _mav_put_float(buf, 48, zgyro); - _mav_put_float(buf, 52, lat); - _mav_put_float(buf, 56, lon); - _mav_put_float(buf, 60, alt); - _mav_put_float(buf, 64, std_dev_horz); - _mav_put_float(buf, 68, std_dev_vert); - _mav_put_float(buf, 72, vn); - _mav_put_float(buf, 76, ve); - _mav_put_float(buf, 80, vd); + char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; + _mav_put_float(buf, 0, q1); + _mav_put_float(buf, 4, q2); + _mav_put_float(buf, 8, q3); + _mav_put_float(buf, 12, q4); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); + _mav_put_float(buf, 28, xacc); + _mav_put_float(buf, 32, yacc); + _mav_put_float(buf, 36, zacc); + _mav_put_float(buf, 40, xgyro); + _mav_put_float(buf, 44, ygyro); + _mav_put_float(buf, 48, zgyro); + _mav_put_float(buf, 52, lat); + _mav_put_float(buf, 56, lon); + _mav_put_float(buf, 60, alt); + _mav_put_float(buf, 64, std_dev_horz); + _mav_put_float(buf, 68, std_dev_vert); + _mav_put_float(buf, 72, vn); + _mav_put_float(buf, 76, ve); + _mav_put_float(buf, 80, vd); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIM_STATE_LEN); #else - mavlink_sim_state_t packet; - packet.q1 = q1; - packet.q2 = q2; - packet.q3 = q3; - packet.q4 = q4; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.std_dev_horz = std_dev_horz; - packet.std_dev_vert = std_dev_vert; - packet.vn = vn; - packet.ve = ve; - packet.vd = vd; + mavlink_sim_state_t packet; + packet.q1 = q1; + packet.q2 = q2; + packet.q3 = q3; + packet.q4 = q4; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.std_dev_horz = std_dev_horz; + packet.std_dev_vert = std_dev_vert; + packet.vn = vn; + packet.ve = ve; + packet.vd = vd; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SIM_STATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SIM_STATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SIM_STATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); } /** @@ -258,7 +282,7 @@ static inline uint16_t mavlink_msg_sim_state_pack_chan(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_sim_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state) { - return mavlink_msg_sim_state_pack(system_id, component_id, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd); + return mavlink_msg_sim_state_pack(system_id, component_id, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd); } /** @@ -272,7 +296,7 @@ static inline uint16_t mavlink_msg_sim_state_encode(uint8_t system_id, uint8_t c */ static inline uint16_t mavlink_msg_sim_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sim_state_t* sim_state) { - return mavlink_msg_sim_state_pack_chan(system_id, component_id, chan, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd); + return mavlink_msg_sim_state_pack_chan(system_id, component_id, chan, msg, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd); } /** @@ -306,63 +330,69 @@ static inline uint16_t mavlink_msg_sim_state_encode_chan(uint8_t system_id, uint static inline void mavlink_msg_sim_state_send(mavlink_channel_t chan, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; - _mav_put_float(buf, 0, q1); - _mav_put_float(buf, 4, q2); - _mav_put_float(buf, 8, q3); - _mav_put_float(buf, 12, q4); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); - _mav_put_float(buf, 28, xacc); - _mav_put_float(buf, 32, yacc); - _mav_put_float(buf, 36, zacc); - _mav_put_float(buf, 40, xgyro); - _mav_put_float(buf, 44, ygyro); - _mav_put_float(buf, 48, zgyro); - _mav_put_float(buf, 52, lat); - _mav_put_float(buf, 56, lon); - _mav_put_float(buf, 60, alt); - _mav_put_float(buf, 64, std_dev_horz); - _mav_put_float(buf, 68, std_dev_vert); - _mav_put_float(buf, 72, vn); - _mav_put_float(buf, 76, ve); - _mav_put_float(buf, 80, vd); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); + char buf[MAVLINK_MSG_ID_SIM_STATE_LEN]; + _mav_put_float(buf, 0, q1); + _mav_put_float(buf, 4, q2); + _mav_put_float(buf, 8, q3); + _mav_put_float(buf, 12, q4); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); + _mav_put_float(buf, 28, xacc); + _mav_put_float(buf, 32, yacc); + _mav_put_float(buf, 36, zacc); + _mav_put_float(buf, 40, xgyro); + _mav_put_float(buf, 44, ygyro); + _mav_put_float(buf, 48, zgyro); + _mav_put_float(buf, 52, lat); + _mav_put_float(buf, 56, lon); + _mav_put_float(buf, 60, alt); + _mav_put_float(buf, 64, std_dev_horz); + _mav_put_float(buf, 68, std_dev_vert); + _mav_put_float(buf, 72, vn); + _mav_put_float(buf, 76, ve); + _mav_put_float(buf, 80, vd); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN); + mavlink_sim_state_t packet; + packet.q1 = q1; + packet.q2 = q2; + packet.q3 = q3; + packet.q4 = q4; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + packet.xacc = xacc; + packet.yacc = yacc; + packet.zacc = zacc; + packet.xgyro = xgyro; + packet.ygyro = ygyro; + packet.zgyro = zgyro; + packet.lat = lat; + packet.lon = lon; + packet.alt = alt; + packet.std_dev_horz = std_dev_horz; + packet.std_dev_vert = std_dev_vert; + packet.vn = vn; + packet.ve = ve; + packet.vd = vd; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #endif +} + +/** + * @brief Send a sim_state message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_sim_state_send_struct(mavlink_channel_t chan, const mavlink_sim_state_t* sim_state) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_sim_state_send(chan, sim_state->q1, sim_state->q2, sim_state->q3, sim_state->q4, sim_state->roll, sim_state->pitch, sim_state->yaw, sim_state->xacc, sim_state->yacc, sim_state->zacc, sim_state->xgyro, sim_state->ygyro, sim_state->zgyro, sim_state->lat, sim_state->lon, sim_state->alt, sim_state->std_dev_horz, sim_state->std_dev_vert, sim_state->vn, sim_state->ve, sim_state->vd); #else - mavlink_sim_state_t packet; - packet.q1 = q1; - packet.q2 = q2; - packet.q3 = q3; - packet.q4 = q4; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - packet.xacc = xacc; - packet.yacc = yacc; - packet.zacc = zacc; - packet.xgyro = xgyro; - packet.ygyro = ygyro; - packet.zgyro = zgyro; - packet.lat = lat; - packet.lon = lon; - packet.alt = alt; - packet.std_dev_horz = std_dev_horz; - packet.std_dev_vert = std_dev_vert; - packet.vn = vn; - packet.ve = ve; - packet.vd = vd; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)&packet, MAVLINK_MSG_ID_SIM_STATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)sim_state, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #endif } @@ -377,63 +407,55 @@ static inline void mavlink_msg_sim_state_send(mavlink_channel_t chan, float q1, static inline void mavlink_msg_sim_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float q1, float q2, float q3, float q4, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lon, float alt, float std_dev_horz, float std_dev_vert, float vn, float ve, float vd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, q1); - _mav_put_float(buf, 4, q2); - _mav_put_float(buf, 8, q3); - _mav_put_float(buf, 12, q4); - _mav_put_float(buf, 16, roll); - _mav_put_float(buf, 20, pitch); - _mav_put_float(buf, 24, yaw); - _mav_put_float(buf, 28, xacc); - _mav_put_float(buf, 32, yacc); - _mav_put_float(buf, 36, zacc); - _mav_put_float(buf, 40, xgyro); - _mav_put_float(buf, 44, ygyro); - _mav_put_float(buf, 48, zgyro); - _mav_put_float(buf, 52, lat); - _mav_put_float(buf, 56, lon); - _mav_put_float(buf, 60, alt); - _mav_put_float(buf, 64, std_dev_horz); - _mav_put_float(buf, 68, std_dev_vert); - _mav_put_float(buf, 72, vn); - _mav_put_float(buf, 76, ve); - _mav_put_float(buf, 80, vd); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, q1); + _mav_put_float(buf, 4, q2); + _mav_put_float(buf, 8, q3); + _mav_put_float(buf, 12, q4); + _mav_put_float(buf, 16, roll); + _mav_put_float(buf, 20, pitch); + _mav_put_float(buf, 24, yaw); + _mav_put_float(buf, 28, xacc); + _mav_put_float(buf, 32, yacc); + _mav_put_float(buf, 36, zacc); + _mav_put_float(buf, 40, xgyro); + _mav_put_float(buf, 44, ygyro); + _mav_put_float(buf, 48, zgyro); + _mav_put_float(buf, 52, lat); + _mav_put_float(buf, 56, lon); + _mav_put_float(buf, 60, alt); + _mav_put_float(buf, 64, std_dev_horz); + _mav_put_float(buf, 68, std_dev_vert); + _mav_put_float(buf, 72, vn); + _mav_put_float(buf, 76, ve); + _mav_put_float(buf, 80, vd); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, buf, MAVLINK_MSG_ID_SIM_STATE_LEN); -#endif -#else - mavlink_sim_state_t *packet = (mavlink_sim_state_t *)msgbuf; - packet->q1 = q1; - packet->q2 = q2; - packet->q3 = q3; - packet->q4 = q4; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - packet->xacc = xacc; - packet->yacc = yacc; - packet->zacc = zacc; - packet->xgyro = xgyro; - packet->ygyro = ygyro; - packet->zgyro = zgyro; - packet->lat = lat; - packet->lon = lon; - packet->alt = alt; - packet->std_dev_horz = std_dev_horz; - packet->std_dev_vert = std_dev_vert; - packet->vn = vn; - packet->ve = ve; - packet->vd = vd; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)packet, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)packet, MAVLINK_MSG_ID_SIM_STATE_LEN); -#endif + mavlink_sim_state_t *packet = (mavlink_sim_state_t *)msgbuf; + packet->q1 = q1; + packet->q2 = q2; + packet->q3 = q3; + packet->q4 = q4; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + packet->xacc = xacc; + packet->yacc = yacc; + packet->zacc = zacc; + packet->xgyro = xgyro; + packet->ygyro = ygyro; + packet->zgyro = zgyro; + packet->lat = lat; + packet->lon = lon; + packet->alt = alt; + packet->std_dev_horz = std_dev_horz; + packet->std_dev_vert = std_dev_vert; + packet->vn = vn; + packet->ve = ve; + packet->vd = vd; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIM_STATE, (const char *)packet, MAVLINK_MSG_ID_SIM_STATE_MIN_LEN, MAVLINK_MSG_ID_SIM_STATE_LEN, MAVLINK_MSG_ID_SIM_STATE_CRC); #endif } #endif @@ -450,7 +472,7 @@ static inline void mavlink_msg_sim_state_send_buf(mavlink_message_t *msgbuf, mav */ static inline float mavlink_msg_sim_state_get_q1(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -460,7 +482,7 @@ static inline float mavlink_msg_sim_state_get_q1(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_q2(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -470,7 +492,7 @@ static inline float mavlink_msg_sim_state_get_q2(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_q3(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -480,7 +502,7 @@ static inline float mavlink_msg_sim_state_get_q3(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_q4(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -490,7 +512,7 @@ static inline float mavlink_msg_sim_state_get_q4(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -500,7 +522,7 @@ static inline float mavlink_msg_sim_state_get_roll(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -510,7 +532,7 @@ static inline float mavlink_msg_sim_state_get_pitch(const mavlink_message_t* msg */ static inline float mavlink_msg_sim_state_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -520,7 +542,7 @@ static inline float mavlink_msg_sim_state_get_yaw(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_xacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -530,7 +552,7 @@ static inline float mavlink_msg_sim_state_get_xacc(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_yacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -540,7 +562,7 @@ static inline float mavlink_msg_sim_state_get_yacc(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_zacc(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -550,7 +572,7 @@ static inline float mavlink_msg_sim_state_get_zacc(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_xgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 40); + return _MAV_RETURN_float(msg, 40); } /** @@ -560,7 +582,7 @@ static inline float mavlink_msg_sim_state_get_xgyro(const mavlink_message_t* msg */ static inline float mavlink_msg_sim_state_get_ygyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 44); + return _MAV_RETURN_float(msg, 44); } /** @@ -570,7 +592,7 @@ static inline float mavlink_msg_sim_state_get_ygyro(const mavlink_message_t* msg */ static inline float mavlink_msg_sim_state_get_zgyro(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 48); + return _MAV_RETURN_float(msg, 48); } /** @@ -580,7 +602,7 @@ static inline float mavlink_msg_sim_state_get_zgyro(const mavlink_message_t* msg */ static inline float mavlink_msg_sim_state_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 52); + return _MAV_RETURN_float(msg, 52); } /** @@ -590,7 +612,7 @@ static inline float mavlink_msg_sim_state_get_lat(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 56); + return _MAV_RETURN_float(msg, 56); } /** @@ -600,7 +622,7 @@ static inline float mavlink_msg_sim_state_get_lon(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 60); + return _MAV_RETURN_float(msg, 60); } /** @@ -610,7 +632,7 @@ static inline float mavlink_msg_sim_state_get_alt(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_std_dev_horz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 64); + return _MAV_RETURN_float(msg, 64); } /** @@ -620,7 +642,7 @@ static inline float mavlink_msg_sim_state_get_std_dev_horz(const mavlink_message */ static inline float mavlink_msg_sim_state_get_std_dev_vert(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 68); + return _MAV_RETURN_float(msg, 68); } /** @@ -630,7 +652,7 @@ static inline float mavlink_msg_sim_state_get_std_dev_vert(const mavlink_message */ static inline float mavlink_msg_sim_state_get_vn(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 72); + return _MAV_RETURN_float(msg, 72); } /** @@ -640,7 +662,7 @@ static inline float mavlink_msg_sim_state_get_vn(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_ve(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 76); + return _MAV_RETURN_float(msg, 76); } /** @@ -650,7 +672,7 @@ static inline float mavlink_msg_sim_state_get_ve(const mavlink_message_t* msg) */ static inline float mavlink_msg_sim_state_get_vd(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 80); + return _MAV_RETURN_float(msg, 80); } /** @@ -661,29 +683,31 @@ static inline float mavlink_msg_sim_state_get_vd(const mavlink_message_t* msg) */ static inline void mavlink_msg_sim_state_decode(const mavlink_message_t* msg, mavlink_sim_state_t* sim_state) { -#if MAVLINK_NEED_BYTE_SWAP - sim_state->q1 = mavlink_msg_sim_state_get_q1(msg); - sim_state->q2 = mavlink_msg_sim_state_get_q2(msg); - sim_state->q3 = mavlink_msg_sim_state_get_q3(msg); - sim_state->q4 = mavlink_msg_sim_state_get_q4(msg); - sim_state->roll = mavlink_msg_sim_state_get_roll(msg); - sim_state->pitch = mavlink_msg_sim_state_get_pitch(msg); - sim_state->yaw = mavlink_msg_sim_state_get_yaw(msg); - sim_state->xacc = mavlink_msg_sim_state_get_xacc(msg); - sim_state->yacc = mavlink_msg_sim_state_get_yacc(msg); - sim_state->zacc = mavlink_msg_sim_state_get_zacc(msg); - sim_state->xgyro = mavlink_msg_sim_state_get_xgyro(msg); - sim_state->ygyro = mavlink_msg_sim_state_get_ygyro(msg); - sim_state->zgyro = mavlink_msg_sim_state_get_zgyro(msg); - sim_state->lat = mavlink_msg_sim_state_get_lat(msg); - sim_state->lon = mavlink_msg_sim_state_get_lon(msg); - sim_state->alt = mavlink_msg_sim_state_get_alt(msg); - sim_state->std_dev_horz = mavlink_msg_sim_state_get_std_dev_horz(msg); - sim_state->std_dev_vert = mavlink_msg_sim_state_get_std_dev_vert(msg); - sim_state->vn = mavlink_msg_sim_state_get_vn(msg); - sim_state->ve = mavlink_msg_sim_state_get_ve(msg); - sim_state->vd = mavlink_msg_sim_state_get_vd(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + sim_state->q1 = mavlink_msg_sim_state_get_q1(msg); + sim_state->q2 = mavlink_msg_sim_state_get_q2(msg); + sim_state->q3 = mavlink_msg_sim_state_get_q3(msg); + sim_state->q4 = mavlink_msg_sim_state_get_q4(msg); + sim_state->roll = mavlink_msg_sim_state_get_roll(msg); + sim_state->pitch = mavlink_msg_sim_state_get_pitch(msg); + sim_state->yaw = mavlink_msg_sim_state_get_yaw(msg); + sim_state->xacc = mavlink_msg_sim_state_get_xacc(msg); + sim_state->yacc = mavlink_msg_sim_state_get_yacc(msg); + sim_state->zacc = mavlink_msg_sim_state_get_zacc(msg); + sim_state->xgyro = mavlink_msg_sim_state_get_xgyro(msg); + sim_state->ygyro = mavlink_msg_sim_state_get_ygyro(msg); + sim_state->zgyro = mavlink_msg_sim_state_get_zgyro(msg); + sim_state->lat = mavlink_msg_sim_state_get_lat(msg); + sim_state->lon = mavlink_msg_sim_state_get_lon(msg); + sim_state->alt = mavlink_msg_sim_state_get_alt(msg); + sim_state->std_dev_horz = mavlink_msg_sim_state_get_std_dev_horz(msg); + sim_state->std_dev_vert = mavlink_msg_sim_state_get_std_dev_vert(msg); + sim_state->vn = mavlink_msg_sim_state_get_vn(msg); + sim_state->ve = mavlink_msg_sim_state_get_ve(msg); + sim_state->vd = mavlink_msg_sim_state_get_vd(msg); #else - memcpy(sim_state, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SIM_STATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SIM_STATE_LEN? msg->len : MAVLINK_MSG_ID_SIM_STATE_LEN; + memset(sim_state, 0, MAVLINK_MSG_ID_SIM_STATE_LEN); + memcpy(sim_state, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_statustext.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_statustext.h index 9408d49..10d104b 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_statustext.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_statustext.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE STATUSTEXT PACKING #define MAVLINK_MSG_ID_STATUSTEXT 253 -typedef struct __mavlink_statustext_t -{ +MAVPACKED( +typedef struct __mavlink_statustext_t { uint8_t severity; /*< Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.*/ char text[50]; /*< Status text message, without null termination character*/ -} mavlink_statustext_t; +}) mavlink_statustext_t; #define MAVLINK_MSG_ID_STATUSTEXT_LEN 51 +#define MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN 51 #define MAVLINK_MSG_ID_253_LEN 51 +#define MAVLINK_MSG_ID_253_MIN_LEN 51 #define MAVLINK_MSG_ID_STATUSTEXT_CRC 83 #define MAVLINK_MSG_ID_253_CRC 83 #define MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN 50 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_STATUSTEXT { \ - "STATUSTEXT", \ - 2, \ - { { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \ + 253, \ + "STATUSTEXT", \ + 2, \ + { { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \ { "text", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_statustext_t, text) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_STATUSTEXT { \ + "STATUSTEXT", \ + 2, \ + { { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \ + { "text", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_statustext_t, text) }, \ + } \ +} +#endif /** * @brief Pack a statustext message @@ -36,26 +49,22 @@ typedef struct __mavlink_statustext_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t severity, const char *text) + uint8_t severity, const char *text) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; - _mav_put_uint8_t(buf, 0, severity); - _mav_put_char_array(buf, 1, text, 50); + char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; + _mav_put_uint8_t(buf, 0, severity); + _mav_put_char_array(buf, 1, text, 50); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN); #else - mavlink_statustext_t packet; - packet.severity = severity; - mav_array_memcpy(packet.text, text, sizeof(char)*50); + mavlink_statustext_t packet; + packet.severity = severity; + mav_array_memcpy(packet.text, text, sizeof(char)*50); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); } /** @@ -69,27 +78,23 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t severity,const char *text) + mavlink_message_t* msg, + uint8_t severity,const char *text) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; - _mav_put_uint8_t(buf, 0, severity); - _mav_put_char_array(buf, 1, text, 50); + char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; + _mav_put_uint8_t(buf, 0, severity); + _mav_put_char_array(buf, 1, text, 50); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN); #else - mavlink_statustext_t packet; - packet.severity = severity; - mav_array_memcpy(packet.text, text, sizeof(char)*50); + mavlink_statustext_t packet; + packet.severity = severity; + mav_array_memcpy(packet.text, text, sizeof(char)*50); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); } /** @@ -102,7 +107,7 @@ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_statustext_t* statustext) { - return mavlink_msg_statustext_pack(system_id, component_id, msg, statustext->severity, statustext->text); + return mavlink_msg_statustext_pack(system_id, component_id, msg, statustext->severity, statustext->text); } /** @@ -116,7 +121,7 @@ static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_statustext_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_statustext_t* statustext) { - return mavlink_msg_statustext_pack_chan(system_id, component_id, chan, msg, statustext->severity, statustext->text); + return mavlink_msg_statustext_pack_chan(system_id, component_id, chan, msg, statustext->severity, statustext->text); } /** @@ -131,23 +136,29 @@ static inline uint16_t mavlink_msg_statustext_encode_chan(uint8_t system_id, uin static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t severity, const char *text) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; - _mav_put_uint8_t(buf, 0, severity); - _mav_put_char_array(buf, 1, text, 50); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); + char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN]; + _mav_put_uint8_t(buf, 0, severity); + _mav_put_char_array(buf, 1, text, 50); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN); + mavlink_statustext_t packet; + packet.severity = severity; + mav_array_memcpy(packet.text, text, sizeof(char)*50); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); #endif +} + +/** + * @brief Send a statustext message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_statustext_send_struct(mavlink_channel_t chan, const mavlink_statustext_t* statustext) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_statustext_send(chan, statustext->severity, statustext->text); #else - mavlink_statustext_t packet; - packet.severity = severity; - mav_array_memcpy(packet.text, text, sizeof(char)*50); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)statustext, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); #endif } @@ -162,23 +173,15 @@ static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t s static inline void mavlink_msg_statustext_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t severity, const char *text) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, severity); - _mav_put_char_array(buf, 1, text, 50); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN); -#endif + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, severity); + _mav_put_char_array(buf, 1, text, 50); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); #else - mavlink_statustext_t *packet = (mavlink_statustext_t *)msgbuf; - packet->severity = severity; - mav_array_memcpy(packet->text, text, sizeof(char)*50); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)packet, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)packet, MAVLINK_MSG_ID_STATUSTEXT_LEN); -#endif + mavlink_statustext_t *packet = (mavlink_statustext_t *)msgbuf; + packet->severity = severity; + mav_array_memcpy(packet->text, text, sizeof(char)*50); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)packet, MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC); #endif } #endif @@ -195,7 +198,7 @@ static inline void mavlink_msg_statustext_send_buf(mavlink_message_t *msgbuf, ma */ static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 0); + return _MAV_RETURN_uint8_t(msg, 0); } /** @@ -205,7 +208,7 @@ static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_ */ static inline uint16_t mavlink_msg_statustext_get_text(const mavlink_message_t* msg, char *text) { - return _MAV_RETURN_char_array(msg, text, 50, 1); + return _MAV_RETURN_char_array(msg, text, 50, 1); } /** @@ -216,10 +219,12 @@ static inline uint16_t mavlink_msg_statustext_get_text(const mavlink_message_t* */ static inline void mavlink_msg_statustext_decode(const mavlink_message_t* msg, mavlink_statustext_t* statustext) { -#if MAVLINK_NEED_BYTE_SWAP - statustext->severity = mavlink_msg_statustext_get_severity(msg); - mavlink_msg_statustext_get_text(msg, statustext->text); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + statustext->severity = mavlink_msg_statustext_get_severity(msg); + mavlink_msg_statustext_get_text(msg, statustext->text); #else - memcpy(statustext, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_STATUSTEXT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_STATUSTEXT_LEN? msg->len : MAVLINK_MSG_ID_STATUSTEXT_LEN; + memset(statustext, 0, MAVLINK_MSG_ID_STATUSTEXT_LEN); + memcpy(statustext, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sys_status.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sys_status.h index ae1293e..41280f8 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sys_status.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_sys_status.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE SYS_STATUS PACKING #define MAVLINK_MSG_ID_SYS_STATUS 1 -typedef struct __mavlink_sys_status_t -{ +MAVPACKED( +typedef struct __mavlink_sys_status_t { uint32_t onboard_control_sensors_present; /*< Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/ uint32_t onboard_control_sensors_enabled; /*< Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/ uint32_t onboard_control_sensors_health; /*< Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/ @@ -17,20 +18,24 @@ typedef struct __mavlink_sys_status_t uint16_t errors_count3; /*< Autopilot-specific errors*/ uint16_t errors_count4; /*< Autopilot-specific errors*/ int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery*/ -} mavlink_sys_status_t; +}) mavlink_sys_status_t; #define MAVLINK_MSG_ID_SYS_STATUS_LEN 31 +#define MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN 31 #define MAVLINK_MSG_ID_1_LEN 31 +#define MAVLINK_MSG_ID_1_MIN_LEN 31 #define MAVLINK_MSG_ID_SYS_STATUS_CRC 124 #define MAVLINK_MSG_ID_1_CRC 124 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SYS_STATUS { \ - "SYS_STATUS", \ - 13, \ - { { "onboard_control_sensors_present", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_sys_status_t, onboard_control_sensors_present) }, \ + 1, \ + "SYS_STATUS", \ + 13, \ + { { "onboard_control_sensors_present", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_sys_status_t, onboard_control_sensors_present) }, \ { "onboard_control_sensors_enabled", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_sys_status_t, onboard_control_sensors_enabled) }, \ { "onboard_control_sensors_health", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_sys_status_t, onboard_control_sensors_health) }, \ { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \ @@ -45,7 +50,26 @@ typedef struct __mavlink_sys_status_t { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SYS_STATUS { \ + "SYS_STATUS", \ + 13, \ + { { "onboard_control_sensors_present", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_sys_status_t, onboard_control_sensors_present) }, \ + { "onboard_control_sensors_enabled", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_sys_status_t, onboard_control_sensors_enabled) }, \ + { "onboard_control_sensors_health", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_sys_status_t, onboard_control_sensors_health) }, \ + { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \ + { "voltage_battery", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sys_status_t, voltage_battery) }, \ + { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_sys_status_t, current_battery) }, \ + { "drop_rate_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sys_status_t, drop_rate_comm) }, \ + { "errors_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sys_status_t, errors_comm) }, \ + { "errors_count1", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sys_status_t, errors_count1) }, \ + { "errors_count2", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sys_status_t, errors_count2) }, \ + { "errors_count3", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sys_status_t, errors_count3) }, \ + { "errors_count4", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sys_status_t, errors_count4) }, \ + { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \ + } \ +} +#endif /** * @brief Pack a sys_status message @@ -69,50 +93,46 @@ typedef struct __mavlink_sys_status_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4) + uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; - _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); - _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); - _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); - _mav_put_uint16_t(buf, 12, load); - _mav_put_uint16_t(buf, 14, voltage_battery); - _mav_put_int16_t(buf, 16, current_battery); - _mav_put_uint16_t(buf, 18, drop_rate_comm); - _mav_put_uint16_t(buf, 20, errors_comm); - _mav_put_uint16_t(buf, 22, errors_count1); - _mav_put_uint16_t(buf, 24, errors_count2); - _mav_put_uint16_t(buf, 26, errors_count3); - _mav_put_uint16_t(buf, 28, errors_count4); - _mav_put_int8_t(buf, 30, battery_remaining); + char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; + _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); + _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); + _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); + _mav_put_uint16_t(buf, 12, load); + _mav_put_uint16_t(buf, 14, voltage_battery); + _mav_put_int16_t(buf, 16, current_battery); + _mav_put_uint16_t(buf, 18, drop_rate_comm); + _mav_put_uint16_t(buf, 20, errors_comm); + _mav_put_uint16_t(buf, 22, errors_count1); + _mav_put_uint16_t(buf, 24, errors_count2); + _mav_put_uint16_t(buf, 26, errors_count3); + _mav_put_uint16_t(buf, 28, errors_count4); + _mav_put_int8_t(buf, 30, battery_remaining); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN); #else - mavlink_sys_status_t packet; - packet.onboard_control_sensors_present = onboard_control_sensors_present; - packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled; - packet.onboard_control_sensors_health = onboard_control_sensors_health; - packet.load = load; - packet.voltage_battery = voltage_battery; - packet.current_battery = current_battery; - packet.drop_rate_comm = drop_rate_comm; - packet.errors_comm = errors_comm; - packet.errors_count1 = errors_count1; - packet.errors_count2 = errors_count2; - packet.errors_count3 = errors_count3; - packet.errors_count4 = errors_count4; - packet.battery_remaining = battery_remaining; + mavlink_sys_status_t packet; + packet.onboard_control_sensors_present = onboard_control_sensors_present; + packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled; + packet.onboard_control_sensors_health = onboard_control_sensors_health; + packet.load = load; + packet.voltage_battery = voltage_battery; + packet.current_battery = current_battery; + packet.drop_rate_comm = drop_rate_comm; + packet.errors_comm = errors_comm; + packet.errors_count1 = errors_count1; + packet.errors_count2 = errors_count2; + packet.errors_count3 = errors_count3; + packet.errors_count4 = errors_count4; + packet.battery_remaining = battery_remaining; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYS_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); } /** @@ -137,51 +157,47 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint32_t onboard_control_sensors_present,uint32_t onboard_control_sensors_enabled,uint32_t onboard_control_sensors_health,uint16_t load,uint16_t voltage_battery,int16_t current_battery,int8_t battery_remaining,uint16_t drop_rate_comm,uint16_t errors_comm,uint16_t errors_count1,uint16_t errors_count2,uint16_t errors_count3,uint16_t errors_count4) + mavlink_message_t* msg, + uint32_t onboard_control_sensors_present,uint32_t onboard_control_sensors_enabled,uint32_t onboard_control_sensors_health,uint16_t load,uint16_t voltage_battery,int16_t current_battery,int8_t battery_remaining,uint16_t drop_rate_comm,uint16_t errors_comm,uint16_t errors_count1,uint16_t errors_count2,uint16_t errors_count3,uint16_t errors_count4) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; - _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); - _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); - _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); - _mav_put_uint16_t(buf, 12, load); - _mav_put_uint16_t(buf, 14, voltage_battery); - _mav_put_int16_t(buf, 16, current_battery); - _mav_put_uint16_t(buf, 18, drop_rate_comm); - _mav_put_uint16_t(buf, 20, errors_comm); - _mav_put_uint16_t(buf, 22, errors_count1); - _mav_put_uint16_t(buf, 24, errors_count2); - _mav_put_uint16_t(buf, 26, errors_count3); - _mav_put_uint16_t(buf, 28, errors_count4); - _mav_put_int8_t(buf, 30, battery_remaining); + char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; + _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); + _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); + _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); + _mav_put_uint16_t(buf, 12, load); + _mav_put_uint16_t(buf, 14, voltage_battery); + _mav_put_int16_t(buf, 16, current_battery); + _mav_put_uint16_t(buf, 18, drop_rate_comm); + _mav_put_uint16_t(buf, 20, errors_comm); + _mav_put_uint16_t(buf, 22, errors_count1); + _mav_put_uint16_t(buf, 24, errors_count2); + _mav_put_uint16_t(buf, 26, errors_count3); + _mav_put_uint16_t(buf, 28, errors_count4); + _mav_put_int8_t(buf, 30, battery_remaining); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN); #else - mavlink_sys_status_t packet; - packet.onboard_control_sensors_present = onboard_control_sensors_present; - packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled; - packet.onboard_control_sensors_health = onboard_control_sensors_health; - packet.load = load; - packet.voltage_battery = voltage_battery; - packet.current_battery = current_battery; - packet.drop_rate_comm = drop_rate_comm; - packet.errors_comm = errors_comm; - packet.errors_count1 = errors_count1; - packet.errors_count2 = errors_count2; - packet.errors_count3 = errors_count3; - packet.errors_count4 = errors_count4; - packet.battery_remaining = battery_remaining; + mavlink_sys_status_t packet; + packet.onboard_control_sensors_present = onboard_control_sensors_present; + packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled; + packet.onboard_control_sensors_health = onboard_control_sensors_health; + packet.load = load; + packet.voltage_battery = voltage_battery; + packet.current_battery = current_battery; + packet.drop_rate_comm = drop_rate_comm; + packet.errors_comm = errors_comm; + packet.errors_count1 = errors_count1; + packet.errors_count2 = errors_count2; + packet.errors_count3 = errors_count3; + packet.errors_count4 = errors_count4; + packet.battery_remaining = battery_remaining; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYS_STATUS_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SYS_STATUS; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); } /** @@ -194,7 +210,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_sys_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sys_status_t* sys_status) { - return mavlink_msg_sys_status_pack(system_id, component_id, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4); + return mavlink_msg_sys_status_pack(system_id, component_id, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4); } /** @@ -208,7 +224,7 @@ static inline uint16_t mavlink_msg_sys_status_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_sys_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sys_status_t* sys_status) { - return mavlink_msg_sys_status_pack_chan(system_id, component_id, chan, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4); + return mavlink_msg_sys_status_pack_chan(system_id, component_id, chan, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4); } /** @@ -234,47 +250,53 @@ static inline uint16_t mavlink_msg_sys_status_encode_chan(uint8_t system_id, uin static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; - _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); - _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); - _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); - _mav_put_uint16_t(buf, 12, load); - _mav_put_uint16_t(buf, 14, voltage_battery); - _mav_put_int16_t(buf, 16, current_battery); - _mav_put_uint16_t(buf, 18, drop_rate_comm); - _mav_put_uint16_t(buf, 20, errors_comm); - _mav_put_uint16_t(buf, 22, errors_count1); - _mav_put_uint16_t(buf, 24, errors_count2); - _mav_put_uint16_t(buf, 26, errors_count3); - _mav_put_uint16_t(buf, 28, errors_count4); - _mav_put_int8_t(buf, 30, battery_remaining); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); + char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN]; + _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); + _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); + _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); + _mav_put_uint16_t(buf, 12, load); + _mav_put_uint16_t(buf, 14, voltage_battery); + _mav_put_int16_t(buf, 16, current_battery); + _mav_put_uint16_t(buf, 18, drop_rate_comm); + _mav_put_uint16_t(buf, 20, errors_comm); + _mav_put_uint16_t(buf, 22, errors_count1); + _mav_put_uint16_t(buf, 24, errors_count2); + _mav_put_uint16_t(buf, 26, errors_count3); + _mav_put_uint16_t(buf, 28, errors_count4); + _mav_put_int8_t(buf, 30, battery_remaining); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_LEN); + mavlink_sys_status_t packet; + packet.onboard_control_sensors_present = onboard_control_sensors_present; + packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled; + packet.onboard_control_sensors_health = onboard_control_sensors_health; + packet.load = load; + packet.voltage_battery = voltage_battery; + packet.current_battery = current_battery; + packet.drop_rate_comm = drop_rate_comm; + packet.errors_comm = errors_comm; + packet.errors_count1 = errors_count1; + packet.errors_count2 = errors_count2; + packet.errors_count3 = errors_count3; + packet.errors_count4 = errors_count4; + packet.battery_remaining = battery_remaining; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); #endif +} + +/** + * @brief Send a sys_status message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_sys_status_send_struct(mavlink_channel_t chan, const mavlink_sys_status_t* sys_status) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_sys_status_send(chan, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4); #else - mavlink_sys_status_t packet; - packet.onboard_control_sensors_present = onboard_control_sensors_present; - packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled; - packet.onboard_control_sensors_health = onboard_control_sensors_health; - packet.load = load; - packet.voltage_battery = voltage_battery; - packet.current_battery = current_battery; - packet.drop_rate_comm = drop_rate_comm; - packet.errors_comm = errors_comm; - packet.errors_count1 = errors_count1; - packet.errors_count2 = errors_count2; - packet.errors_count3 = errors_count3; - packet.errors_count4 = errors_count4; - packet.battery_remaining = battery_remaining; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_SYS_STATUS_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)sys_status, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); #endif } @@ -289,47 +311,39 @@ static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t static inline void mavlink_msg_sys_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); - _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); - _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); - _mav_put_uint16_t(buf, 12, load); - _mav_put_uint16_t(buf, 14, voltage_battery); - _mav_put_int16_t(buf, 16, current_battery); - _mav_put_uint16_t(buf, 18, drop_rate_comm); - _mav_put_uint16_t(buf, 20, errors_comm); - _mav_put_uint16_t(buf, 22, errors_count1); - _mav_put_uint16_t(buf, 24, errors_count2); - _mav_put_uint16_t(buf, 26, errors_count3); - _mav_put_uint16_t(buf, 28, errors_count4); - _mav_put_int8_t(buf, 30, battery_remaining); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, onboard_control_sensors_present); + _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled); + _mav_put_uint32_t(buf, 8, onboard_control_sensors_health); + _mav_put_uint16_t(buf, 12, load); + _mav_put_uint16_t(buf, 14, voltage_battery); + _mav_put_int16_t(buf, 16, current_battery); + _mav_put_uint16_t(buf, 18, drop_rate_comm); + _mav_put_uint16_t(buf, 20, errors_comm); + _mav_put_uint16_t(buf, 22, errors_count1); + _mav_put_uint16_t(buf, 24, errors_count2); + _mav_put_uint16_t(buf, 26, errors_count3); + _mav_put_uint16_t(buf, 28, errors_count4); + _mav_put_int8_t(buf, 30, battery_remaining); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_LEN); -#endif -#else - mavlink_sys_status_t *packet = (mavlink_sys_status_t *)msgbuf; - packet->onboard_control_sensors_present = onboard_control_sensors_present; - packet->onboard_control_sensors_enabled = onboard_control_sensors_enabled; - packet->onboard_control_sensors_health = onboard_control_sensors_health; - packet->load = load; - packet->voltage_battery = voltage_battery; - packet->current_battery = current_battery; - packet->drop_rate_comm = drop_rate_comm; - packet->errors_comm = errors_comm; - packet->errors_count1 = errors_count1; - packet->errors_count2 = errors_count2; - packet->errors_count3 = errors_count3; - packet->errors_count4 = errors_count4; - packet->battery_remaining = battery_remaining; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)packet, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)packet, MAVLINK_MSG_ID_SYS_STATUS_LEN); -#endif + mavlink_sys_status_t *packet = (mavlink_sys_status_t *)msgbuf; + packet->onboard_control_sensors_present = onboard_control_sensors_present; + packet->onboard_control_sensors_enabled = onboard_control_sensors_enabled; + packet->onboard_control_sensors_health = onboard_control_sensors_health; + packet->load = load; + packet->voltage_battery = voltage_battery; + packet->current_battery = current_battery; + packet->drop_rate_comm = drop_rate_comm; + packet->errors_comm = errors_comm; + packet->errors_count1 = errors_count1; + packet->errors_count2 = errors_count2; + packet->errors_count3 = errors_count3; + packet->errors_count4 = errors_count4; + packet->battery_remaining = battery_remaining; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)packet, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC); #endif } #endif @@ -346,7 +360,7 @@ static inline void mavlink_msg_sys_status_send_buf(mavlink_message_t *msgbuf, ma */ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_present(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 0); + return _MAV_RETURN_uint32_t(msg, 0); } /** @@ -356,7 +370,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_presen */ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enabled(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 4); + return _MAV_RETURN_uint32_t(msg, 4); } /** @@ -366,7 +380,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enable */ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -376,7 +390,7 @@ static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health */ static inline uint16_t mavlink_msg_sys_status_get_load(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 12); + return _MAV_RETURN_uint16_t(msg, 12); } /** @@ -386,7 +400,7 @@ static inline uint16_t mavlink_msg_sys_status_get_load(const mavlink_message_t* */ static inline uint16_t mavlink_msg_sys_status_get_voltage_battery(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 14); + return _MAV_RETURN_uint16_t(msg, 14); } /** @@ -396,7 +410,7 @@ static inline uint16_t mavlink_msg_sys_status_get_voltage_battery(const mavlink_ */ static inline int16_t mavlink_msg_sys_status_get_current_battery(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -406,7 +420,7 @@ static inline int16_t mavlink_msg_sys_status_get_current_battery(const mavlink_m */ static inline int8_t mavlink_msg_sys_status_get_battery_remaining(const mavlink_message_t* msg) { - return _MAV_RETURN_int8_t(msg, 30); + return _MAV_RETURN_int8_t(msg, 30); } /** @@ -416,7 +430,7 @@ static inline int8_t mavlink_msg_sys_status_get_battery_remaining(const mavlink_ */ static inline uint16_t mavlink_msg_sys_status_get_drop_rate_comm(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -426,7 +440,7 @@ static inline uint16_t mavlink_msg_sys_status_get_drop_rate_comm(const mavlink_m */ static inline uint16_t mavlink_msg_sys_status_get_errors_comm(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 20); + return _MAV_RETURN_uint16_t(msg, 20); } /** @@ -436,7 +450,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_comm(const mavlink_mess */ static inline uint16_t mavlink_msg_sys_status_get_errors_count1(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 22); + return _MAV_RETURN_uint16_t(msg, 22); } /** @@ -446,7 +460,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_count1(const mavlink_me */ static inline uint16_t mavlink_msg_sys_status_get_errors_count2(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 24); + return _MAV_RETURN_uint16_t(msg, 24); } /** @@ -456,7 +470,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_count2(const mavlink_me */ static inline uint16_t mavlink_msg_sys_status_get_errors_count3(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 26); + return _MAV_RETURN_uint16_t(msg, 26); } /** @@ -466,7 +480,7 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_count3(const mavlink_me */ static inline uint16_t mavlink_msg_sys_status_get_errors_count4(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 28); + return _MAV_RETURN_uint16_t(msg, 28); } /** @@ -477,21 +491,23 @@ static inline uint16_t mavlink_msg_sys_status_get_errors_count4(const mavlink_me */ static inline void mavlink_msg_sys_status_decode(const mavlink_message_t* msg, mavlink_sys_status_t* sys_status) { -#if MAVLINK_NEED_BYTE_SWAP - sys_status->onboard_control_sensors_present = mavlink_msg_sys_status_get_onboard_control_sensors_present(msg); - sys_status->onboard_control_sensors_enabled = mavlink_msg_sys_status_get_onboard_control_sensors_enabled(msg); - sys_status->onboard_control_sensors_health = mavlink_msg_sys_status_get_onboard_control_sensors_health(msg); - sys_status->load = mavlink_msg_sys_status_get_load(msg); - sys_status->voltage_battery = mavlink_msg_sys_status_get_voltage_battery(msg); - sys_status->current_battery = mavlink_msg_sys_status_get_current_battery(msg); - sys_status->drop_rate_comm = mavlink_msg_sys_status_get_drop_rate_comm(msg); - sys_status->errors_comm = mavlink_msg_sys_status_get_errors_comm(msg); - sys_status->errors_count1 = mavlink_msg_sys_status_get_errors_count1(msg); - sys_status->errors_count2 = mavlink_msg_sys_status_get_errors_count2(msg); - sys_status->errors_count3 = mavlink_msg_sys_status_get_errors_count3(msg); - sys_status->errors_count4 = mavlink_msg_sys_status_get_errors_count4(msg); - sys_status->battery_remaining = mavlink_msg_sys_status_get_battery_remaining(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + sys_status->onboard_control_sensors_present = mavlink_msg_sys_status_get_onboard_control_sensors_present(msg); + sys_status->onboard_control_sensors_enabled = mavlink_msg_sys_status_get_onboard_control_sensors_enabled(msg); + sys_status->onboard_control_sensors_health = mavlink_msg_sys_status_get_onboard_control_sensors_health(msg); + sys_status->load = mavlink_msg_sys_status_get_load(msg); + sys_status->voltage_battery = mavlink_msg_sys_status_get_voltage_battery(msg); + sys_status->current_battery = mavlink_msg_sys_status_get_current_battery(msg); + sys_status->drop_rate_comm = mavlink_msg_sys_status_get_drop_rate_comm(msg); + sys_status->errors_comm = mavlink_msg_sys_status_get_errors_comm(msg); + sys_status->errors_count1 = mavlink_msg_sys_status_get_errors_count1(msg); + sys_status->errors_count2 = mavlink_msg_sys_status_get_errors_count2(msg); + sys_status->errors_count3 = mavlink_msg_sys_status_get_errors_count3(msg); + sys_status->errors_count4 = mavlink_msg_sys_status_get_errors_count4(msg); + sys_status->battery_remaining = mavlink_msg_sys_status_get_battery_remaining(msg); #else - memcpy(sys_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SYS_STATUS_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SYS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_SYS_STATUS_LEN; + memset(sys_status, 0, MAVLINK_MSG_ID_SYS_STATUS_LEN); + memcpy(sys_status, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_system_time.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_system_time.h index c8d7459..b3fdd17 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_system_time.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_system_time.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE SYSTEM_TIME PACKING #define MAVLINK_MSG_ID_SYSTEM_TIME 2 -typedef struct __mavlink_system_time_t -{ +MAVPACKED( +typedef struct __mavlink_system_time_t { uint64_t time_unix_usec; /*< Timestamp of the master clock in microseconds since UNIX epoch.*/ uint32_t time_boot_ms; /*< Timestamp of the component clock since boot time in milliseconds.*/ -} mavlink_system_time_t; +}) mavlink_system_time_t; #define MAVLINK_MSG_ID_SYSTEM_TIME_LEN 12 +#define MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN 12 #define MAVLINK_MSG_ID_2_LEN 12 +#define MAVLINK_MSG_ID_2_MIN_LEN 12 #define MAVLINK_MSG_ID_SYSTEM_TIME_CRC 137 #define MAVLINK_MSG_ID_2_CRC 137 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \ - "SYSTEM_TIME", \ - 2, \ - { { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_unix_usec) }, \ + 2, \ + "SYSTEM_TIME", \ + 2, \ + { { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_unix_usec) }, \ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_system_time_t, time_boot_ms) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \ + "SYSTEM_TIME", \ + 2, \ + { { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_unix_usec) }, \ + { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_system_time_t, time_boot_ms) }, \ + } \ +} +#endif /** * @brief Pack a system_time message @@ -36,28 +49,24 @@ typedef struct __mavlink_system_time_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_unix_usec, uint32_t time_boot_ms) + uint64_t time_unix_usec, uint32_t time_boot_ms) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; - _mav_put_uint64_t(buf, 0, time_unix_usec); - _mav_put_uint32_t(buf, 8, time_boot_ms); + char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; + _mav_put_uint64_t(buf, 0, time_unix_usec); + _mav_put_uint32_t(buf, 8, time_boot_ms); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #else - mavlink_system_time_t packet; - packet.time_unix_usec = time_unix_usec; - packet.time_boot_ms = time_boot_ms; + mavlink_system_time_t packet; + packet.time_unix_usec = time_unix_usec; + packet.time_boot_ms = time_boot_ms; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t c * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_unix_usec,uint32_t time_boot_ms) + mavlink_message_t* msg, + uint64_t time_unix_usec,uint32_t time_boot_ms) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; - _mav_put_uint64_t(buf, 0, time_unix_usec); - _mav_put_uint32_t(buf, 8, time_boot_ms); + char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; + _mav_put_uint64_t(buf, 0, time_unix_usec); + _mav_put_uint32_t(buf, 8, time_boot_ms); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #else - mavlink_system_time_t packet; - packet.time_unix_usec = time_unix_usec; - packet.time_boot_ms = time_boot_ms; + mavlink_system_time_t packet; + packet.time_unix_usec = time_unix_usec; + packet.time_boot_ms = time_boot_ms; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_system_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_system_time_t* system_time) { - return mavlink_msg_system_time_pack(system_id, component_id, msg, system_time->time_unix_usec, system_time->time_boot_ms); + return mavlink_msg_system_time_pack(system_id, component_id, msg, system_time->time_unix_usec, system_time->time_boot_ms); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_system_time_encode(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_system_time_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_system_time_t* system_time) { - return mavlink_msg_system_time_pack_chan(system_id, component_id, chan, msg, system_time->time_unix_usec, system_time->time_boot_ms); + return mavlink_msg_system_time_pack_chan(system_id, component_id, chan, msg, system_time->time_unix_usec, system_time->time_boot_ms); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_system_time_encode_chan(uint8_t system_id, ui static inline void mavlink_msg_system_time_send(mavlink_channel_t chan, uint64_t time_unix_usec, uint32_t time_boot_ms) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; - _mav_put_uint64_t(buf, 0, time_unix_usec); - _mav_put_uint32_t(buf, 8, time_boot_ms); + char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN]; + _mav_put_uint64_t(buf, 0, time_unix_usec); + _mav_put_uint32_t(buf, 8, time_boot_ms); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); + mavlink_system_time_t packet; + packet.time_unix_usec = time_unix_usec; + packet.time_boot_ms = time_boot_ms; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); #endif -#else - mavlink_system_time_t packet; - packet.time_unix_usec = time_unix_usec; - packet.time_boot_ms = time_boot_ms; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); +/** + * @brief Send a system_time message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_system_time_send_struct(mavlink_channel_t chan, const mavlink_system_time_t* system_time) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_system_time_send(chan, system_time->time_unix_usec, system_time->time_boot_ms); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)system_time, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_system_time_send(mavlink_channel_t chan, uint64_t static inline void mavlink_msg_system_time_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_unix_usec, uint32_t time_boot_ms) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_unix_usec); - _mav_put_uint32_t(buf, 8, time_boot_ms); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_unix_usec); + _mav_put_uint32_t(buf, 8, time_boot_ms); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); #else - mavlink_system_time_t *packet = (mavlink_system_time_t *)msgbuf; - packet->time_unix_usec = time_unix_usec; - packet->time_boot_ms = time_boot_ms; + mavlink_system_time_t *packet = (mavlink_system_time_t *)msgbuf; + packet->time_unix_usec = time_unix_usec; + packet->time_boot_ms = time_boot_ms; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)packet, MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_system_time_send_buf(mavlink_message_t *msgbuf, m */ static inline uint64_t mavlink_msg_system_time_get_time_unix_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline uint64_t mavlink_msg_system_time_get_time_unix_usec(const mavlink_ */ static inline uint32_t mavlink_msg_system_time_get_time_boot_ms(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 8); + return _MAV_RETURN_uint32_t(msg, 8); } /** @@ -224,10 +227,12 @@ static inline uint32_t mavlink_msg_system_time_get_time_boot_ms(const mavlink_me */ static inline void mavlink_msg_system_time_decode(const mavlink_message_t* msg, mavlink_system_time_t* system_time) { -#if MAVLINK_NEED_BYTE_SWAP - system_time->time_unix_usec = mavlink_msg_system_time_get_time_unix_usec(msg); - system_time->time_boot_ms = mavlink_msg_system_time_get_time_boot_ms(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + system_time->time_unix_usec = mavlink_msg_system_time_get_time_unix_usec(msg); + system_time->time_boot_ms = mavlink_msg_system_time_get_time_boot_ms(msg); #else - memcpy(system_time, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SYSTEM_TIME_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_SYSTEM_TIME_LEN? msg->len : MAVLINK_MSG_ID_SYSTEM_TIME_LEN; + memset(system_time, 0, MAVLINK_MSG_ID_SYSTEM_TIME_LEN); + memcpy(system_time, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_check.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_check.h index fefa32b..7107498 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_check.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_check.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE TERRAIN_CHECK PACKING #define MAVLINK_MSG_ID_TERRAIN_CHECK 135 -typedef struct __mavlink_terrain_check_t -{ +MAVPACKED( +typedef struct __mavlink_terrain_check_t { int32_t lat; /*< Latitude (degrees *10^7)*/ int32_t lon; /*< Longitude (degrees *10^7)*/ -} mavlink_terrain_check_t; +}) mavlink_terrain_check_t; #define MAVLINK_MSG_ID_TERRAIN_CHECK_LEN 8 +#define MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN 8 #define MAVLINK_MSG_ID_135_LEN 8 +#define MAVLINK_MSG_ID_135_MIN_LEN 8 #define MAVLINK_MSG_ID_TERRAIN_CHECK_CRC 203 #define MAVLINK_MSG_ID_135_CRC 203 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_TERRAIN_CHECK { \ - "TERRAIN_CHECK", \ - 2, \ - { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_check_t, lat) }, \ + 135, \ + "TERRAIN_CHECK", \ + 2, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_check_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_check_t, lon) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_TERRAIN_CHECK { \ + "TERRAIN_CHECK", \ + 2, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_check_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_check_t, lon) }, \ + } \ +} +#endif /** * @brief Pack a terrain_check message @@ -36,28 +49,24 @@ typedef struct __mavlink_terrain_check_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_check_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t lat, int32_t lon) + int32_t lat, int32_t lon) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); + char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); #else - mavlink_terrain_check_t packet; - packet.lat = lat; - packet.lon = lon; + mavlink_terrain_check_t packet; + packet.lat = lat; + packet.lon = lon; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_terrain_check_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_check_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t lat,int32_t lon) + mavlink_message_t* msg, + int32_t lat,int32_t lon) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); + char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); #else - mavlink_terrain_check_t packet; - packet.lat = lat; - packet.lon = lon; + mavlink_terrain_check_t packet; + packet.lat = lat; + packet.lon = lon; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_terrain_check_pack_chan(uint8_t system_id, ui */ static inline uint16_t mavlink_msg_terrain_check_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_check_t* terrain_check) { - return mavlink_msg_terrain_check_pack(system_id, component_id, msg, terrain_check->lat, terrain_check->lon); + return mavlink_msg_terrain_check_pack(system_id, component_id, msg, terrain_check->lat, terrain_check->lon); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_terrain_check_encode(uint8_t system_id, uint8 */ static inline uint16_t mavlink_msg_terrain_check_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_check_t* terrain_check) { - return mavlink_msg_terrain_check_pack_chan(system_id, component_id, chan, msg, terrain_check->lat, terrain_check->lon); + return mavlink_msg_terrain_check_pack_chan(system_id, component_id, chan, msg, terrain_check->lat, terrain_check->lon); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_terrain_check_encode_chan(uint8_t system_id, static inline void mavlink_msg_terrain_check_send(mavlink_channel_t chan, int32_t lat, int32_t lon) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); + char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); + mavlink_terrain_check_t packet; + packet.lat = lat; + packet.lon = lon; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); #endif -#else - mavlink_terrain_check_t packet; - packet.lat = lat; - packet.lon = lon; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); +/** + * @brief Send a terrain_check message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_terrain_check_send_struct(mavlink_channel_t chan, const mavlink_terrain_check_t* terrain_check) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_terrain_check_send(chan, terrain_check->lat, terrain_check->lon); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)terrain_check, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_terrain_check_send(mavlink_channel_t chan, int32_ static inline void mavlink_msg_terrain_check_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); #else - mavlink_terrain_check_t *packet = (mavlink_terrain_check_t *)msgbuf; - packet->lat = lat; - packet->lon = lon; + mavlink_terrain_check_t *packet = (mavlink_terrain_check_t *)msgbuf; + packet->lat = lat; + packet->lon = lon; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_terrain_check_send_buf(mavlink_message_t *msgbuf, */ static inline int32_t mavlink_msg_terrain_check_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline int32_t mavlink_msg_terrain_check_get_lat(const mavlink_message_t* */ static inline int32_t mavlink_msg_terrain_check_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -224,10 +227,12 @@ static inline int32_t mavlink_msg_terrain_check_get_lon(const mavlink_message_t* */ static inline void mavlink_msg_terrain_check_decode(const mavlink_message_t* msg, mavlink_terrain_check_t* terrain_check) { -#if MAVLINK_NEED_BYTE_SWAP - terrain_check->lat = mavlink_msg_terrain_check_get_lat(msg); - terrain_check->lon = mavlink_msg_terrain_check_get_lon(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + terrain_check->lat = mavlink_msg_terrain_check_get_lat(msg); + terrain_check->lon = mavlink_msg_terrain_check_get_lon(msg); #else - memcpy(terrain_check, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_CHECK_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_CHECK_LEN; + memset(terrain_check, 0, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN); + memcpy(terrain_check, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_data.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_data.h index 545821e..9d94981 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_data.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_data.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE TERRAIN_DATA PACKING #define MAVLINK_MSG_ID_TERRAIN_DATA 134 -typedef struct __mavlink_terrain_data_t -{ +MAVPACKED( +typedef struct __mavlink_terrain_data_t { int32_t lat; /*< Latitude of SW corner of first grid (degrees *10^7)*/ int32_t lon; /*< Longitude of SW corner of first grid (in degrees *10^7)*/ uint16_t grid_spacing; /*< Grid spacing in meters*/ int16_t data[16]; /*< Terrain data in meters AMSL*/ uint8_t gridbit; /*< bit within the terrain request mask*/ -} mavlink_terrain_data_t; +}) mavlink_terrain_data_t; #define MAVLINK_MSG_ID_TERRAIN_DATA_LEN 43 +#define MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN 43 #define MAVLINK_MSG_ID_134_LEN 43 +#define MAVLINK_MSG_ID_134_MIN_LEN 43 #define MAVLINK_MSG_ID_TERRAIN_DATA_CRC 229 #define MAVLINK_MSG_ID_134_CRC 229 #define MAVLINK_MSG_TERRAIN_DATA_FIELD_DATA_LEN 16 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_TERRAIN_DATA { \ - "TERRAIN_DATA", \ - 5, \ - { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \ + 134, \ + "TERRAIN_DATA", \ + 5, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_data_t, lon) }, \ { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_terrain_data_t, grid_spacing) }, \ { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \ { "gridbit", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_terrain_data_t, gridbit) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_TERRAIN_DATA { \ + "TERRAIN_DATA", \ + 5, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_data_t, lon) }, \ + { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_terrain_data_t, grid_spacing) }, \ + { "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \ + { "gridbit", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_terrain_data_t, gridbit) }, \ + } \ +} +#endif /** * @brief Pack a terrain_data message @@ -45,32 +61,28 @@ typedef struct __mavlink_terrain_data_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data) + int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_uint16_t(buf, 8, grid_spacing); - _mav_put_uint8_t(buf, 42, gridbit); - _mav_put_int16_t_array(buf, 10, data, 16); + char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_uint16_t(buf, 8, grid_spacing); + _mav_put_uint8_t(buf, 42, gridbit); + _mav_put_int16_t_array(buf, 10, data, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); #else - mavlink_terrain_data_t packet; - packet.lat = lat; - packet.lon = lon; - packet.grid_spacing = grid_spacing; - packet.gridbit = gridbit; - mav_array_memcpy(packet.data, data, sizeof(int16_t)*16); + mavlink_terrain_data_t packet; + packet.lat = lat; + packet.lon = lon; + packet.grid_spacing = grid_spacing; + packet.gridbit = gridbit; + mav_array_memcpy(packet.data, data, sizeof(int16_t)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); } /** @@ -87,33 +99,29 @@ static inline uint16_t mavlink_msg_terrain_data_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t lat,int32_t lon,uint16_t grid_spacing,uint8_t gridbit,const int16_t *data) + mavlink_message_t* msg, + int32_t lat,int32_t lon,uint16_t grid_spacing,uint8_t gridbit,const int16_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_uint16_t(buf, 8, grid_spacing); - _mav_put_uint8_t(buf, 42, gridbit); - _mav_put_int16_t_array(buf, 10, data, 16); + char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_uint16_t(buf, 8, grid_spacing); + _mav_put_uint8_t(buf, 42, gridbit); + _mav_put_int16_t_array(buf, 10, data, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); #else - mavlink_terrain_data_t packet; - packet.lat = lat; - packet.lon = lon; - packet.grid_spacing = grid_spacing; - packet.gridbit = gridbit; - mav_array_memcpy(packet.data, data, sizeof(int16_t)*16); + mavlink_terrain_data_t packet; + packet.lat = lat; + packet.lon = lon; + packet.grid_spacing = grid_spacing; + packet.gridbit = gridbit; + mav_array_memcpy(packet.data, data, sizeof(int16_t)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); } /** @@ -126,7 +134,7 @@ static inline uint16_t mavlink_msg_terrain_data_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_terrain_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_data_t* terrain_data) { - return mavlink_msg_terrain_data_pack(system_id, component_id, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data); + return mavlink_msg_terrain_data_pack(system_id, component_id, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data); } /** @@ -140,7 +148,7 @@ static inline uint16_t mavlink_msg_terrain_data_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_terrain_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_data_t* terrain_data) { - return mavlink_msg_terrain_data_pack_chan(system_id, component_id, chan, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data); + return mavlink_msg_terrain_data_pack_chan(system_id, component_id, chan, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data); } /** @@ -158,29 +166,35 @@ static inline uint16_t mavlink_msg_terrain_data_encode_chan(uint8_t system_id, u static inline void mavlink_msg_terrain_data_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_uint16_t(buf, 8, grid_spacing); - _mav_put_uint8_t(buf, 42, gridbit); - _mav_put_int16_t_array(buf, 10, data, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); + char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_uint16_t(buf, 8, grid_spacing); + _mav_put_uint8_t(buf, 42, gridbit); + _mav_put_int16_t_array(buf, 10, data, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); + mavlink_terrain_data_t packet; + packet.lat = lat; + packet.lon = lon; + packet.grid_spacing = grid_spacing; + packet.gridbit = gridbit; + mav_array_memcpy(packet.data, data, sizeof(int16_t)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); #endif +} + +/** + * @brief Send a terrain_data message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_terrain_data_send_struct(mavlink_channel_t chan, const mavlink_terrain_data_t* terrain_data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_terrain_data_send(chan, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data); #else - mavlink_terrain_data_t packet; - packet.lat = lat; - packet.lon = lon; - packet.grid_spacing = grid_spacing; - packet.gridbit = gridbit; - mav_array_memcpy(packet.data, data, sizeof(int16_t)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)terrain_data, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); #endif } @@ -195,29 +209,21 @@ static inline void mavlink_msg_terrain_data_send(mavlink_channel_t chan, int32_t static inline void mavlink_msg_terrain_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_uint16_t(buf, 8, grid_spacing); - _mav_put_uint8_t(buf, 42, gridbit); - _mav_put_int16_t_array(buf, 10, data, 16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_uint16_t(buf, 8, grid_spacing); + _mav_put_uint8_t(buf, 42, gridbit); + _mav_put_int16_t_array(buf, 10, data, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); -#endif -#else - mavlink_terrain_data_t *packet = (mavlink_terrain_data_t *)msgbuf; - packet->lat = lat; - packet->lon = lon; - packet->grid_spacing = grid_spacing; - packet->gridbit = gridbit; - mav_array_memcpy(packet->data, data, sizeof(int16_t)*16); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); -#endif + mavlink_terrain_data_t *packet = (mavlink_terrain_data_t *)msgbuf; + packet->lat = lat; + packet->lon = lon; + packet->grid_spacing = grid_spacing; + packet->gridbit = gridbit; + mav_array_memcpy(packet->data, data, sizeof(int16_t)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC); #endif } #endif @@ -234,7 +240,7 @@ static inline void mavlink_msg_terrain_data_send_buf(mavlink_message_t *msgbuf, */ static inline int32_t mavlink_msg_terrain_data_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -244,7 +250,7 @@ static inline int32_t mavlink_msg_terrain_data_get_lat(const mavlink_message_t* */ static inline int32_t mavlink_msg_terrain_data_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -254,7 +260,7 @@ static inline int32_t mavlink_msg_terrain_data_get_lon(const mavlink_message_t* */ static inline uint16_t mavlink_msg_terrain_data_get_grid_spacing(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 8); + return _MAV_RETURN_uint16_t(msg, 8); } /** @@ -264,7 +270,7 @@ static inline uint16_t mavlink_msg_terrain_data_get_grid_spacing(const mavlink_m */ static inline uint8_t mavlink_msg_terrain_data_get_gridbit(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 42); + return _MAV_RETURN_uint8_t(msg, 42); } /** @@ -274,7 +280,7 @@ static inline uint8_t mavlink_msg_terrain_data_get_gridbit(const mavlink_message */ static inline uint16_t mavlink_msg_terrain_data_get_data(const mavlink_message_t* msg, int16_t *data) { - return _MAV_RETURN_int16_t_array(msg, data, 16, 10); + return _MAV_RETURN_int16_t_array(msg, data, 16, 10); } /** @@ -285,13 +291,15 @@ static inline uint16_t mavlink_msg_terrain_data_get_data(const mavlink_message_t */ static inline void mavlink_msg_terrain_data_decode(const mavlink_message_t* msg, mavlink_terrain_data_t* terrain_data) { -#if MAVLINK_NEED_BYTE_SWAP - terrain_data->lat = mavlink_msg_terrain_data_get_lat(msg); - terrain_data->lon = mavlink_msg_terrain_data_get_lon(msg); - terrain_data->grid_spacing = mavlink_msg_terrain_data_get_grid_spacing(msg); - mavlink_msg_terrain_data_get_data(msg, terrain_data->data); - terrain_data->gridbit = mavlink_msg_terrain_data_get_gridbit(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + terrain_data->lat = mavlink_msg_terrain_data_get_lat(msg); + terrain_data->lon = mavlink_msg_terrain_data_get_lon(msg); + terrain_data->grid_spacing = mavlink_msg_terrain_data_get_grid_spacing(msg); + mavlink_msg_terrain_data_get_data(msg, terrain_data->data); + terrain_data->gridbit = mavlink_msg_terrain_data_get_gridbit(msg); #else - memcpy(terrain_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_DATA_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_DATA_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_DATA_LEN; + memset(terrain_data, 0, MAVLINK_MSG_ID_TERRAIN_DATA_LEN); + memcpy(terrain_data, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_report.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_report.h index d34b106..275c8e7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_report.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_report.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE TERRAIN_REPORT PACKING #define MAVLINK_MSG_ID_TERRAIN_REPORT 136 -typedef struct __mavlink_terrain_report_t -{ +MAVPACKED( +typedef struct __mavlink_terrain_report_t { int32_t lat; /*< Latitude (degrees *10^7)*/ int32_t lon; /*< Longitude (degrees *10^7)*/ float terrain_height; /*< Terrain height in meters AMSL*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_terrain_report_t uint16_t spacing; /*< grid spacing (zero if terrain at this location unavailable)*/ uint16_t pending; /*< Number of 4x4 terrain blocks waiting to be received or read from disk*/ uint16_t loaded; /*< Number of 4x4 terrain blocks in memory*/ -} mavlink_terrain_report_t; +}) mavlink_terrain_report_t; #define MAVLINK_MSG_ID_TERRAIN_REPORT_LEN 22 +#define MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN 22 #define MAVLINK_MSG_ID_136_LEN 22 +#define MAVLINK_MSG_ID_136_MIN_LEN 22 #define MAVLINK_MSG_ID_TERRAIN_REPORT_CRC 1 #define MAVLINK_MSG_ID_136_CRC 1 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_TERRAIN_REPORT { \ - "TERRAIN_REPORT", \ - 7, \ - { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \ + 136, \ + "TERRAIN_REPORT", \ + 7, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \ { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \ { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_terrain_report_t { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_TERRAIN_REPORT { \ + "TERRAIN_REPORT", \ + 7, \ + { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \ + { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \ + { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \ + { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \ + { "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_terrain_report_t, pending) }, \ + { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \ + } \ +} +#endif /** * @brief Pack a terrain_report message @@ -51,38 +69,34 @@ typedef struct __mavlink_terrain_report_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t lat, int32_t lon, uint16_t spacing, float terrain_height, float current_height, uint16_t pending, uint16_t loaded) + int32_t lat, int32_t lon, uint16_t spacing, float terrain_height, float current_height, uint16_t pending, uint16_t loaded) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_float(buf, 8, terrain_height); - _mav_put_float(buf, 12, current_height); - _mav_put_uint16_t(buf, 16, spacing); - _mav_put_uint16_t(buf, 18, pending); - _mav_put_uint16_t(buf, 20, loaded); + char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_float(buf, 8, terrain_height); + _mav_put_float(buf, 12, current_height); + _mav_put_uint16_t(buf, 16, spacing); + _mav_put_uint16_t(buf, 18, pending); + _mav_put_uint16_t(buf, 20, loaded); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); #else - mavlink_terrain_report_t packet; - packet.lat = lat; - packet.lon = lon; - packet.terrain_height = terrain_height; - packet.current_height = current_height; - packet.spacing = spacing; - packet.pending = pending; - packet.loaded = loaded; + mavlink_terrain_report_t packet; + packet.lat = lat; + packet.lon = lon; + packet.terrain_height = terrain_height; + packet.current_height = current_height; + packet.spacing = spacing; + packet.pending = pending; + packet.loaded = loaded; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_terrain_report_pack(uint8_t system_id, uint8_ * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t lat,int32_t lon,uint16_t spacing,float terrain_height,float current_height,uint16_t pending,uint16_t loaded) + mavlink_message_t* msg, + int32_t lat,int32_t lon,uint16_t spacing,float terrain_height,float current_height,uint16_t pending,uint16_t loaded) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_float(buf, 8, terrain_height); - _mav_put_float(buf, 12, current_height); - _mav_put_uint16_t(buf, 16, spacing); - _mav_put_uint16_t(buf, 18, pending); - _mav_put_uint16_t(buf, 20, loaded); + char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_float(buf, 8, terrain_height); + _mav_put_float(buf, 12, current_height); + _mav_put_uint16_t(buf, 16, spacing); + _mav_put_uint16_t(buf, 18, pending); + _mav_put_uint16_t(buf, 20, loaded); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); #else - mavlink_terrain_report_t packet; - packet.lat = lat; - packet.lon = lon; - packet.terrain_height = terrain_height; - packet.current_height = current_height; - packet.spacing = spacing; - packet.pending = pending; - packet.loaded = loaded; + mavlink_terrain_report_t packet; + packet.lat = lat; + packet.lon = lon; + packet.terrain_height = terrain_height; + packet.current_height = current_height; + packet.spacing = spacing; + packet.pending = pending; + packet.loaded = loaded; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_terrain_report_pack_chan(uint8_t system_id, u */ static inline uint16_t mavlink_msg_terrain_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_report_t* terrain_report) { - return mavlink_msg_terrain_report_pack(system_id, component_id, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded); + return mavlink_msg_terrain_report_pack(system_id, component_id, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_terrain_report_encode(uint8_t system_id, uint */ static inline uint16_t mavlink_msg_terrain_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_report_t* terrain_report) { - return mavlink_msg_terrain_report_pack_chan(system_id, component_id, chan, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded); + return mavlink_msg_terrain_report_pack_chan(system_id, component_id, chan, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_terrain_report_encode_chan(uint8_t system_id, static inline void mavlink_msg_terrain_report_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t spacing, float terrain_height, float current_height, uint16_t pending, uint16_t loaded) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN]; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_float(buf, 8, terrain_height); - _mav_put_float(buf, 12, current_height); - _mav_put_uint16_t(buf, 16, spacing); - _mav_put_uint16_t(buf, 18, pending); - _mav_put_uint16_t(buf, 20, loaded); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); + char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN]; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_float(buf, 8, terrain_height); + _mav_put_float(buf, 12, current_height); + _mav_put_uint16_t(buf, 16, spacing); + _mav_put_uint16_t(buf, 18, pending); + _mav_put_uint16_t(buf, 20, loaded); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); + mavlink_terrain_report_t packet; + packet.lat = lat; + packet.lon = lon; + packet.terrain_height = terrain_height; + packet.current_height = current_height; + packet.spacing = spacing; + packet.pending = pending; + packet.loaded = loaded; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); #endif +} + +/** + * @brief Send a terrain_report message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_terrain_report_send_struct(mavlink_channel_t chan, const mavlink_terrain_report_t* terrain_report) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_terrain_report_send(chan, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded); #else - mavlink_terrain_report_t packet; - packet.lat = lat; - packet.lon = lon; - packet.terrain_height = terrain_height; - packet.current_height = current_height; - packet.spacing = spacing; - packet.pending = pending; - packet.loaded = loaded; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)terrain_report, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_terrain_report_send(mavlink_channel_t chan, int32 static inline void mavlink_msg_terrain_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t spacing, float terrain_height, float current_height, uint16_t pending, uint16_t loaded) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int32_t(buf, 0, lat); - _mav_put_int32_t(buf, 4, lon); - _mav_put_float(buf, 8, terrain_height); - _mav_put_float(buf, 12, current_height); - _mav_put_uint16_t(buf, 16, spacing); - _mav_put_uint16_t(buf, 18, pending); - _mav_put_uint16_t(buf, 20, loaded); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); -#endif -#else - mavlink_terrain_report_t *packet = (mavlink_terrain_report_t *)msgbuf; - packet->lat = lat; - packet->lon = lon; - packet->terrain_height = terrain_height; - packet->current_height = current_height; - packet->spacing = spacing; - packet->pending = pending; - packet->loaded = loaded; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); + char *buf = (char *)msgbuf; + _mav_put_int32_t(buf, 0, lat); + _mav_put_int32_t(buf, 4, lon); + _mav_put_float(buf, 8, terrain_height); + _mav_put_float(buf, 12, current_height); + _mav_put_uint16_t(buf, 16, spacing); + _mav_put_uint16_t(buf, 18, pending); + _mav_put_uint16_t(buf, 20, loaded); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); -#endif + mavlink_terrain_report_t *packet = (mavlink_terrain_report_t *)msgbuf; + packet->lat = lat; + packet->lon = lon; + packet->terrain_height = terrain_height; + packet->current_height = current_height; + packet->spacing = spacing; + packet->pending = pending; + packet->loaded = loaded; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_terrain_report_send_buf(mavlink_message_t *msgbuf */ static inline int32_t mavlink_msg_terrain_report_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 0); + return _MAV_RETURN_int32_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline int32_t mavlink_msg_terrain_report_get_lat(const mavlink_message_t */ static inline int32_t mavlink_msg_terrain_report_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 4); + return _MAV_RETURN_int32_t(msg, 4); } /** @@ -288,7 +296,7 @@ static inline int32_t mavlink_msg_terrain_report_get_lon(const mavlink_message_t */ static inline uint16_t mavlink_msg_terrain_report_get_spacing(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 16); + return _MAV_RETURN_uint16_t(msg, 16); } /** @@ -298,7 +306,7 @@ static inline uint16_t mavlink_msg_terrain_report_get_spacing(const mavlink_mess */ static inline float mavlink_msg_terrain_report_get_terrain_height(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_terrain_report_get_terrain_height(const mavlink_ */ static inline float mavlink_msg_terrain_report_get_current_height(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_terrain_report_get_current_height(const mavlink_ */ static inline uint16_t mavlink_msg_terrain_report_get_pending(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -328,7 +336,7 @@ static inline uint16_t mavlink_msg_terrain_report_get_pending(const mavlink_mess */ static inline uint16_t mavlink_msg_terrain_report_get_loaded(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 20); + return _MAV_RETURN_uint16_t(msg, 20); } /** @@ -339,15 +347,17 @@ static inline uint16_t mavlink_msg_terrain_report_get_loaded(const mavlink_messa */ static inline void mavlink_msg_terrain_report_decode(const mavlink_message_t* msg, mavlink_terrain_report_t* terrain_report) { -#if MAVLINK_NEED_BYTE_SWAP - terrain_report->lat = mavlink_msg_terrain_report_get_lat(msg); - terrain_report->lon = mavlink_msg_terrain_report_get_lon(msg); - terrain_report->terrain_height = mavlink_msg_terrain_report_get_terrain_height(msg); - terrain_report->current_height = mavlink_msg_terrain_report_get_current_height(msg); - terrain_report->spacing = mavlink_msg_terrain_report_get_spacing(msg); - terrain_report->pending = mavlink_msg_terrain_report_get_pending(msg); - terrain_report->loaded = mavlink_msg_terrain_report_get_loaded(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + terrain_report->lat = mavlink_msg_terrain_report_get_lat(msg); + terrain_report->lon = mavlink_msg_terrain_report_get_lon(msg); + terrain_report->terrain_height = mavlink_msg_terrain_report_get_terrain_height(msg); + terrain_report->current_height = mavlink_msg_terrain_report_get_current_height(msg); + terrain_report->spacing = mavlink_msg_terrain_report_get_spacing(msg); + terrain_report->pending = mavlink_msg_terrain_report_get_pending(msg); + terrain_report->loaded = mavlink_msg_terrain_report_get_loaded(msg); #else - memcpy(terrain_report, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_REPORT_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_REPORT_LEN; + memset(terrain_report, 0, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN); + memcpy(terrain_report, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_request.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_request.h index d3b1805..f64656f 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_request.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_terrain_request.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE TERRAIN_REQUEST PACKING #define MAVLINK_MSG_ID_TERRAIN_REQUEST 133 -typedef struct __mavlink_terrain_request_t -{ +MAVPACKED( +typedef struct __mavlink_terrain_request_t { uint64_t mask; /*< Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)*/ int32_t lat; /*< Latitude of SW corner of first grid (degrees *10^7)*/ int32_t lon; /*< Longitude of SW corner of first grid (in degrees *10^7)*/ uint16_t grid_spacing; /*< Grid spacing in meters*/ -} mavlink_terrain_request_t; +}) mavlink_terrain_request_t; #define MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN 18 +#define MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN 18 #define MAVLINK_MSG_ID_133_LEN 18 +#define MAVLINK_MSG_ID_133_MIN_LEN 18 #define MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC 6 #define MAVLINK_MSG_ID_133_CRC 6 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST { \ - "TERRAIN_REQUEST", \ - 4, \ - { { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \ + 133, \ + "TERRAIN_REQUEST", \ + 4, \ + { { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \ { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST { \ + "TERRAIN_REQUEST", \ + 4, \ + { { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \ + { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \ + { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \ + { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \ + } \ +} +#endif /** * @brief Pack a terrain_request message @@ -42,32 +57,28 @@ typedef struct __mavlink_terrain_request_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask) + int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN]; - _mav_put_uint64_t(buf, 0, mask); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_uint16_t(buf, 16, grid_spacing); + char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN]; + _mav_put_uint64_t(buf, 0, mask); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_uint16_t(buf, 16, grid_spacing); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); #else - mavlink_terrain_request_t packet; - packet.mask = mask; - packet.lat = lat; - packet.lon = lon; - packet.grid_spacing = grid_spacing; + mavlink_terrain_request_t packet; + packet.mask = mask; + packet.lat = lat; + packet.lon = lon; + packet.grid_spacing = grid_spacing; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_terrain_request_pack(uint8_t system_id, uint8 * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_terrain_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int32_t lat,int32_t lon,uint16_t grid_spacing,uint64_t mask) + mavlink_message_t* msg, + int32_t lat,int32_t lon,uint16_t grid_spacing,uint64_t mask) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN]; - _mav_put_uint64_t(buf, 0, mask); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_uint16_t(buf, 16, grid_spacing); + char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN]; + _mav_put_uint64_t(buf, 0, mask); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_uint16_t(buf, 16, grid_spacing); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); #else - mavlink_terrain_request_t packet; - packet.mask = mask; - packet.lat = lat; - packet.lon = lon; - packet.grid_spacing = grid_spacing; + mavlink_terrain_request_t packet; + packet.mask = mask; + packet.lat = lat; + packet.lon = lon; + packet.grid_spacing = grid_spacing; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_terrain_request_pack_chan(uint8_t system_id, */ static inline uint16_t mavlink_msg_terrain_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_request_t* terrain_request) { - return mavlink_msg_terrain_request_pack(system_id, component_id, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask); + return mavlink_msg_terrain_request_pack(system_id, component_id, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_terrain_request_encode(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_terrain_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_request_t* terrain_request) { - return mavlink_msg_terrain_request_pack_chan(system_id, component_id, chan, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask); + return mavlink_msg_terrain_request_pack_chan(system_id, component_id, chan, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_terrain_request_encode_chan(uint8_t system_id static inline void mavlink_msg_terrain_request_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN]; - _mav_put_uint64_t(buf, 0, mask); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_uint16_t(buf, 16, grid_spacing); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); + char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN]; + _mav_put_uint64_t(buf, 0, mask); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_uint16_t(buf, 16, grid_spacing); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); + mavlink_terrain_request_t packet; + packet.mask = mask; + packet.lat = lat; + packet.lon = lon; + packet.grid_spacing = grid_spacing; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); #endif +} + +/** + * @brief Send a terrain_request message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_terrain_request_send_struct(mavlink_channel_t chan, const mavlink_terrain_request_t* terrain_request) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_terrain_request_send(chan, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask); #else - mavlink_terrain_request_t packet; - packet.mask = mask; - packet.lat = lat; - packet.lon = lon; - packet.grid_spacing = grid_spacing; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)terrain_request, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_terrain_request_send(mavlink_channel_t chan, int3 static inline void mavlink_msg_terrain_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, mask); - _mav_put_int32_t(buf, 8, lat); - _mav_put_int32_t(buf, 12, lon); - _mav_put_uint16_t(buf, 16, grid_spacing); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); -#endif -#else - mavlink_terrain_request_t *packet = (mavlink_terrain_request_t *)msgbuf; - packet->mask = mask; - packet->lat = lat; - packet->lon = lon; - packet->grid_spacing = grid_spacing; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, mask); + _mav_put_int32_t(buf, 8, lat); + _mav_put_int32_t(buf, 12, lon); + _mav_put_uint16_t(buf, 16, grid_spacing); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); -#endif + mavlink_terrain_request_t *packet = (mavlink_terrain_request_t *)msgbuf; + packet->mask = mask; + packet->lat = lat; + packet->lon = lon; + packet->grid_spacing = grid_spacing; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_terrain_request_send_buf(mavlink_message_t *msgbu */ static inline int32_t mavlink_msg_terrain_request_get_lat(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 8); + return _MAV_RETURN_int32_t(msg, 8); } /** @@ -239,7 +244,7 @@ static inline int32_t mavlink_msg_terrain_request_get_lat(const mavlink_message_ */ static inline int32_t mavlink_msg_terrain_request_get_lon(const mavlink_message_t* msg) { - return _MAV_RETURN_int32_t(msg, 12); + return _MAV_RETURN_int32_t(msg, 12); } /** @@ -249,7 +254,7 @@ static inline int32_t mavlink_msg_terrain_request_get_lon(const mavlink_message_ */ static inline uint16_t mavlink_msg_terrain_request_get_grid_spacing(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 16); + return _MAV_RETURN_uint16_t(msg, 16); } /** @@ -259,7 +264,7 @@ static inline uint16_t mavlink_msg_terrain_request_get_grid_spacing(const mavlin */ static inline uint64_t mavlink_msg_terrain_request_get_mask(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -270,12 +275,14 @@ static inline uint64_t mavlink_msg_terrain_request_get_mask(const mavlink_messag */ static inline void mavlink_msg_terrain_request_decode(const mavlink_message_t* msg, mavlink_terrain_request_t* terrain_request) { -#if MAVLINK_NEED_BYTE_SWAP - terrain_request->mask = mavlink_msg_terrain_request_get_mask(msg); - terrain_request->lat = mavlink_msg_terrain_request_get_lat(msg); - terrain_request->lon = mavlink_msg_terrain_request_get_lon(msg); - terrain_request->grid_spacing = mavlink_msg_terrain_request_get_grid_spacing(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + terrain_request->mask = mavlink_msg_terrain_request_get_mask(msg); + terrain_request->lat = mavlink_msg_terrain_request_get_lat(msg); + terrain_request->lon = mavlink_msg_terrain_request_get_lon(msg); + terrain_request->grid_spacing = mavlink_msg_terrain_request_get_grid_spacing(msg); #else - memcpy(terrain_request, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN; + memset(terrain_request, 0, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN); + memcpy(terrain_request, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_timesync.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_timesync.h index db4b479..c80f095 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_timesync.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_timesync.h @@ -1,29 +1,42 @@ +#pragma once // MESSAGE TIMESYNC PACKING #define MAVLINK_MSG_ID_TIMESYNC 111 -typedef struct __mavlink_timesync_t -{ +MAVPACKED( +typedef struct __mavlink_timesync_t { int64_t tc1; /*< Time sync timestamp 1*/ int64_t ts1; /*< Time sync timestamp 2*/ -} mavlink_timesync_t; +}) mavlink_timesync_t; #define MAVLINK_MSG_ID_TIMESYNC_LEN 16 +#define MAVLINK_MSG_ID_TIMESYNC_MIN_LEN 16 #define MAVLINK_MSG_ID_111_LEN 16 +#define MAVLINK_MSG_ID_111_MIN_LEN 16 #define MAVLINK_MSG_ID_TIMESYNC_CRC 34 #define MAVLINK_MSG_ID_111_CRC 34 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_TIMESYNC { \ - "TIMESYNC", \ - 2, \ - { { "tc1", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_timesync_t, tc1) }, \ + 111, \ + "TIMESYNC", \ + 2, \ + { { "tc1", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_timesync_t, tc1) }, \ { "ts1", NULL, MAVLINK_TYPE_INT64_T, 0, 8, offsetof(mavlink_timesync_t, ts1) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_TIMESYNC { \ + "TIMESYNC", \ + 2, \ + { { "tc1", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_timesync_t, tc1) }, \ + { "ts1", NULL, MAVLINK_TYPE_INT64_T, 0, 8, offsetof(mavlink_timesync_t, ts1) }, \ + } \ +} +#endif /** * @brief Pack a timesync message @@ -36,28 +49,24 @@ typedef struct __mavlink_timesync_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_timesync_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - int64_t tc1, int64_t ts1) + int64_t tc1, int64_t ts1) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TIMESYNC_LEN]; - _mav_put_int64_t(buf, 0, tc1); - _mav_put_int64_t(buf, 8, ts1); + char buf[MAVLINK_MSG_ID_TIMESYNC_LEN]; + _mav_put_int64_t(buf, 0, tc1); + _mav_put_int64_t(buf, 8, ts1); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TIMESYNC_LEN); #else - mavlink_timesync_t packet; - packet.tc1 = tc1; - packet.ts1 = ts1; + mavlink_timesync_t packet; + packet.tc1 = tc1; + packet.ts1 = ts1; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIMESYNC_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TIMESYNC; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TIMESYNC_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TIMESYNC; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); } /** @@ -71,29 +80,25 @@ static inline uint16_t mavlink_msg_timesync_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_timesync_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - int64_t tc1,int64_t ts1) + mavlink_message_t* msg, + int64_t tc1,int64_t ts1) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TIMESYNC_LEN]; - _mav_put_int64_t(buf, 0, tc1); - _mav_put_int64_t(buf, 8, ts1); + char buf[MAVLINK_MSG_ID_TIMESYNC_LEN]; + _mav_put_int64_t(buf, 0, tc1); + _mav_put_int64_t(buf, 8, ts1); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TIMESYNC_LEN); #else - mavlink_timesync_t packet; - packet.tc1 = tc1; - packet.ts1 = ts1; + mavlink_timesync_t packet; + packet.tc1 = tc1; + packet.ts1 = ts1; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIMESYNC_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_TIMESYNC; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TIMESYNC_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_TIMESYNC; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); } /** @@ -106,7 +111,7 @@ static inline uint16_t mavlink_msg_timesync_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_timesync_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_timesync_t* timesync) { - return mavlink_msg_timesync_pack(system_id, component_id, msg, timesync->tc1, timesync->ts1); + return mavlink_msg_timesync_pack(system_id, component_id, msg, timesync->tc1, timesync->ts1); } /** @@ -120,7 +125,7 @@ static inline uint16_t mavlink_msg_timesync_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_timesync_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_timesync_t* timesync) { - return mavlink_msg_timesync_pack_chan(system_id, component_id, chan, msg, timesync->tc1, timesync->ts1); + return mavlink_msg_timesync_pack_chan(system_id, component_id, chan, msg, timesync->tc1, timesync->ts1); } /** @@ -135,25 +140,31 @@ static inline uint16_t mavlink_msg_timesync_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_timesync_send(mavlink_channel_t chan, int64_t tc1, int64_t ts1) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TIMESYNC_LEN]; - _mav_put_int64_t(buf, 0, tc1); - _mav_put_int64_t(buf, 8, ts1); + char buf[MAVLINK_MSG_ID_TIMESYNC_LEN]; + _mav_put_int64_t(buf, 0, tc1); + _mav_put_int64_t(buf, 8, ts1); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_LEN); + mavlink_timesync_t packet; + packet.tc1 = tc1; + packet.ts1 = ts1; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)&packet, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); #endif -#else - mavlink_timesync_t packet; - packet.tc1 = tc1; - packet.ts1 = ts1; +} -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)&packet, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); +/** + * @brief Send a timesync message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_timesync_send_struct(mavlink_channel_t chan, const mavlink_timesync_t* timesync) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_timesync_send(chan, timesync->tc1, timesync->ts1); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)&packet, MAVLINK_MSG_ID_TIMESYNC_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)timesync, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); #endif } @@ -168,25 +179,17 @@ static inline void mavlink_msg_timesync_send(mavlink_channel_t chan, int64_t tc1 static inline void mavlink_msg_timesync_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int64_t tc1, int64_t ts1) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_int64_t(buf, 0, tc1); - _mav_put_int64_t(buf, 8, ts1); + char *buf = (char *)msgbuf; + _mav_put_int64_t(buf, 0, tc1); + _mav_put_int64_t(buf, 8, ts1); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); #else - mavlink_timesync_t *packet = (mavlink_timesync_t *)msgbuf; - packet->tc1 = tc1; - packet->ts1 = ts1; + mavlink_timesync_t *packet = (mavlink_timesync_t *)msgbuf; + packet->tc1 = tc1; + packet->ts1 = ts1; -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)packet, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)packet, MAVLINK_MSG_ID_TIMESYNC_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (const char *)packet, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC); #endif } #endif @@ -203,7 +206,7 @@ static inline void mavlink_msg_timesync_send_buf(mavlink_message_t *msgbuf, mavl */ static inline int64_t mavlink_msg_timesync_get_tc1(const mavlink_message_t* msg) { - return _MAV_RETURN_int64_t(msg, 0); + return _MAV_RETURN_int64_t(msg, 0); } /** @@ -213,7 +216,7 @@ static inline int64_t mavlink_msg_timesync_get_tc1(const mavlink_message_t* msg) */ static inline int64_t mavlink_msg_timesync_get_ts1(const mavlink_message_t* msg) { - return _MAV_RETURN_int64_t(msg, 8); + return _MAV_RETURN_int64_t(msg, 8); } /** @@ -224,10 +227,12 @@ static inline int64_t mavlink_msg_timesync_get_ts1(const mavlink_message_t* msg) */ static inline void mavlink_msg_timesync_decode(const mavlink_message_t* msg, mavlink_timesync_t* timesync) { -#if MAVLINK_NEED_BYTE_SWAP - timesync->tc1 = mavlink_msg_timesync_get_tc1(msg); - timesync->ts1 = mavlink_msg_timesync_get_ts1(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + timesync->tc1 = mavlink_msg_timesync_get_tc1(msg); + timesync->ts1 = mavlink_msg_timesync_get_ts1(msg); #else - memcpy(timesync, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TIMESYNC_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_TIMESYNC_LEN? msg->len : MAVLINK_MSG_ID_TIMESYNC_LEN; + memset(timesync, 0, MAVLINK_MSG_ID_TIMESYNC_LEN); + memcpy(timesync, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_v2_extension.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_v2_extension.h index e4c8848..89c60f0 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_v2_extension.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_v2_extension.h @@ -1,35 +1,51 @@ +#pragma once // MESSAGE V2_EXTENSION PACKING #define MAVLINK_MSG_ID_V2_EXTENSION 248 -typedef struct __mavlink_v2_extension_t -{ +MAVPACKED( +typedef struct __mavlink_v2_extension_t { uint16_t message_type; /*< A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.*/ uint8_t target_network; /*< Network ID (0 for broadcast)*/ uint8_t target_system; /*< System ID (0 for broadcast)*/ uint8_t target_component; /*< Component ID (0 for broadcast)*/ uint8_t payload[249]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/ -} mavlink_v2_extension_t; +}) mavlink_v2_extension_t; #define MAVLINK_MSG_ID_V2_EXTENSION_LEN 254 +#define MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN 254 #define MAVLINK_MSG_ID_248_LEN 254 +#define MAVLINK_MSG_ID_248_MIN_LEN 254 #define MAVLINK_MSG_ID_V2_EXTENSION_CRC 8 #define MAVLINK_MSG_ID_248_CRC 8 #define MAVLINK_MSG_V2_EXTENSION_FIELD_PAYLOAD_LEN 249 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_V2_EXTENSION { \ - "V2_EXTENSION", \ - 5, \ - { { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \ + 248, \ + "V2_EXTENSION", \ + 5, \ + { { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \ { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) }, \ { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) }, \ { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_V2_EXTENSION { \ + "V2_EXTENSION", \ + 5, \ + { { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) }, \ + { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) }, \ + { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) }, \ + { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) }, \ + { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) }, \ + } \ +} +#endif /** * @brief Pack a v2_extension message @@ -45,32 +61,28 @@ typedef struct __mavlink_v2_extension_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_v2_extension_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload) + uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN]; - _mav_put_uint16_t(buf, 0, message_type); - _mav_put_uint8_t(buf, 2, target_network); - _mav_put_uint8_t(buf, 3, target_system); - _mav_put_uint8_t(buf, 4, target_component); - _mav_put_uint8_t_array(buf, 5, payload, 249); + char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN]; + _mav_put_uint16_t(buf, 0, message_type); + _mav_put_uint8_t(buf, 2, target_network); + _mav_put_uint8_t(buf, 3, target_system); + _mav_put_uint8_t(buf, 4, target_component); + _mav_put_uint8_t_array(buf, 5, payload, 249); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN); #else - mavlink_v2_extension_t packet; - packet.message_type = message_type; - packet.target_network = target_network; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249); + mavlink_v2_extension_t packet; + packet.message_type = message_type; + packet.target_network = target_network; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_V2_EXTENSION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); } /** @@ -87,33 +99,29 @@ static inline uint16_t mavlink_msg_v2_extension_pack(uint8_t system_id, uint8_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_v2_extension_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t target_network,uint8_t target_system,uint8_t target_component,uint16_t message_type,const uint8_t *payload) + mavlink_message_t* msg, + uint8_t target_network,uint8_t target_system,uint8_t target_component,uint16_t message_type,const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN]; - _mav_put_uint16_t(buf, 0, message_type); - _mav_put_uint8_t(buf, 2, target_network); - _mav_put_uint8_t(buf, 3, target_system); - _mav_put_uint8_t(buf, 4, target_component); - _mav_put_uint8_t_array(buf, 5, payload, 249); + char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN]; + _mav_put_uint16_t(buf, 0, message_type); + _mav_put_uint8_t(buf, 2, target_network); + _mav_put_uint8_t(buf, 3, target_system); + _mav_put_uint8_t(buf, 4, target_component); + _mav_put_uint8_t_array(buf, 5, payload, 249); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN); #else - mavlink_v2_extension_t packet; - packet.message_type = message_type; - packet.target_network = target_network; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249); + mavlink_v2_extension_t packet; + packet.message_type = message_type; + packet.target_network = target_network; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_V2_EXTENSION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); } /** @@ -126,7 +134,7 @@ static inline uint16_t mavlink_msg_v2_extension_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_v2_extension_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_v2_extension_t* v2_extension) { - return mavlink_msg_v2_extension_pack(system_id, component_id, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload); + return mavlink_msg_v2_extension_pack(system_id, component_id, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload); } /** @@ -140,7 +148,7 @@ static inline uint16_t mavlink_msg_v2_extension_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_v2_extension_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_v2_extension_t* v2_extension) { - return mavlink_msg_v2_extension_pack_chan(system_id, component_id, chan, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload); + return mavlink_msg_v2_extension_pack_chan(system_id, component_id, chan, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload); } /** @@ -158,29 +166,35 @@ static inline uint16_t mavlink_msg_v2_extension_encode_chan(uint8_t system_id, u static inline void mavlink_msg_v2_extension_send(mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN]; - _mav_put_uint16_t(buf, 0, message_type); - _mav_put_uint8_t(buf, 2, target_network); - _mav_put_uint8_t(buf, 3, target_system); - _mav_put_uint8_t(buf, 4, target_component); - _mav_put_uint8_t_array(buf, 5, payload, 249); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); + char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN]; + _mav_put_uint16_t(buf, 0, message_type); + _mav_put_uint8_t(buf, 2, target_network); + _mav_put_uint8_t(buf, 3, target_system); + _mav_put_uint8_t(buf, 4, target_component); + _mav_put_uint8_t_array(buf, 5, payload, 249); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN); + mavlink_v2_extension_t packet; + packet.message_type = message_type; + packet.target_network = target_network; + packet.target_system = target_system; + packet.target_component = target_component; + mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)&packet, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); #endif +} + +/** + * @brief Send a v2_extension message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_v2_extension_send_struct(mavlink_channel_t chan, const mavlink_v2_extension_t* v2_extension) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_v2_extension_send(chan, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload); #else - mavlink_v2_extension_t packet; - packet.message_type = message_type; - packet.target_network = target_network; - packet.target_system = target_system; - packet.target_component = target_component; - mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)&packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)&packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)v2_extension, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); #endif } @@ -195,29 +209,21 @@ static inline void mavlink_msg_v2_extension_send(mavlink_channel_t chan, uint8_t static inline void mavlink_msg_v2_extension_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, message_type); - _mav_put_uint8_t(buf, 2, target_network); - _mav_put_uint8_t(buf, 3, target_system); - _mav_put_uint8_t(buf, 4, target_component); - _mav_put_uint8_t_array(buf, 5, payload, 249); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, message_type); + _mav_put_uint8_t(buf, 2, target_network); + _mav_put_uint8_t(buf, 3, target_system); + _mav_put_uint8_t(buf, 4, target_component); + _mav_put_uint8_t_array(buf, 5, payload, 249); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN); -#endif -#else - mavlink_v2_extension_t *packet = (mavlink_v2_extension_t *)msgbuf; - packet->message_type = message_type; - packet->target_network = target_network; - packet->target_system = target_system; - packet->target_component = target_component; - mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*249); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN); -#endif + mavlink_v2_extension_t *packet = (mavlink_v2_extension_t *)msgbuf; + packet->message_type = message_type; + packet->target_network = target_network; + packet->target_system = target_system; + packet->target_component = target_component; + mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*249); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)packet, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC); #endif } #endif @@ -234,7 +240,7 @@ static inline void mavlink_msg_v2_extension_send_buf(mavlink_message_t *msgbuf, */ static inline uint8_t mavlink_msg_v2_extension_get_target_network(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 2); + return _MAV_RETURN_uint8_t(msg, 2); } /** @@ -244,7 +250,7 @@ static inline uint8_t mavlink_msg_v2_extension_get_target_network(const mavlink_ */ static inline uint8_t mavlink_msg_v2_extension_get_target_system(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 3); + return _MAV_RETURN_uint8_t(msg, 3); } /** @@ -254,7 +260,7 @@ static inline uint8_t mavlink_msg_v2_extension_get_target_system(const mavlink_m */ static inline uint8_t mavlink_msg_v2_extension_get_target_component(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 4); + return _MAV_RETURN_uint8_t(msg, 4); } /** @@ -264,7 +270,7 @@ static inline uint8_t mavlink_msg_v2_extension_get_target_component(const mavlin */ static inline uint16_t mavlink_msg_v2_extension_get_message_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 0); + return _MAV_RETURN_uint16_t(msg, 0); } /** @@ -274,7 +280,7 @@ static inline uint16_t mavlink_msg_v2_extension_get_message_type(const mavlink_m */ static inline uint16_t mavlink_msg_v2_extension_get_payload(const mavlink_message_t* msg, uint8_t *payload) { - return _MAV_RETURN_uint8_t_array(msg, payload, 249, 5); + return _MAV_RETURN_uint8_t_array(msg, payload, 249, 5); } /** @@ -285,13 +291,15 @@ static inline uint16_t mavlink_msg_v2_extension_get_payload(const mavlink_messag */ static inline void mavlink_msg_v2_extension_decode(const mavlink_message_t* msg, mavlink_v2_extension_t* v2_extension) { -#if MAVLINK_NEED_BYTE_SWAP - v2_extension->message_type = mavlink_msg_v2_extension_get_message_type(msg); - v2_extension->target_network = mavlink_msg_v2_extension_get_target_network(msg); - v2_extension->target_system = mavlink_msg_v2_extension_get_target_system(msg); - v2_extension->target_component = mavlink_msg_v2_extension_get_target_component(msg); - mavlink_msg_v2_extension_get_payload(msg, v2_extension->payload); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + v2_extension->message_type = mavlink_msg_v2_extension_get_message_type(msg); + v2_extension->target_network = mavlink_msg_v2_extension_get_target_network(msg); + v2_extension->target_system = mavlink_msg_v2_extension_get_target_system(msg); + v2_extension->target_component = mavlink_msg_v2_extension_get_target_component(msg); + mavlink_msg_v2_extension_get_payload(msg, v2_extension->payload); #else - memcpy(v2_extension, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_V2_EXTENSION_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_V2_EXTENSION_LEN? msg->len : MAVLINK_MSG_ID_V2_EXTENSION_LEN; + memset(v2_extension, 0, MAVLINK_MSG_ID_V2_EXTENSION_LEN); + memcpy(v2_extension, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vfr_hud.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vfr_hud.h index fe67f18..7c7d7f7 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vfr_hud.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vfr_hud.h @@ -1,29 +1,34 @@ +#pragma once // MESSAGE VFR_HUD PACKING #define MAVLINK_MSG_ID_VFR_HUD 74 -typedef struct __mavlink_vfr_hud_t -{ +MAVPACKED( +typedef struct __mavlink_vfr_hud_t { float airspeed; /*< Current airspeed in m/s*/ float groundspeed; /*< Current ground speed in m/s*/ float alt; /*< Current altitude (MSL), in meters*/ float climb; /*< Current climb rate in meters/second*/ int16_t heading; /*< Current heading in degrees, in compass units (0..360, 0=north)*/ uint16_t throttle; /*< Current throttle setting in integer percent, 0 to 100*/ -} mavlink_vfr_hud_t; +}) mavlink_vfr_hud_t; #define MAVLINK_MSG_ID_VFR_HUD_LEN 20 +#define MAVLINK_MSG_ID_VFR_HUD_MIN_LEN 20 #define MAVLINK_MSG_ID_74_LEN 20 +#define MAVLINK_MSG_ID_74_MIN_LEN 20 #define MAVLINK_MSG_ID_VFR_HUD_CRC 20 #define MAVLINK_MSG_ID_74_CRC 20 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_VFR_HUD { \ - "VFR_HUD", \ - 6, \ - { { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \ + 74, \ + "VFR_HUD", \ + 6, \ + { { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \ { "groundspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vfr_hud_t, groundspeed) }, \ { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \ { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \ @@ -31,7 +36,19 @@ typedef struct __mavlink_vfr_hud_t { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vfr_hud_t, throttle) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_VFR_HUD { \ + "VFR_HUD", \ + 6, \ + { { "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_vfr_hud_t, airspeed) }, \ + { "groundspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_vfr_hud_t, groundspeed) }, \ + { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vfr_hud_t, alt) }, \ + { "climb", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vfr_hud_t, climb) }, \ + { "heading", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_vfr_hud_t, heading) }, \ + { "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vfr_hud_t, throttle) }, \ + } \ +} +#endif /** * @brief Pack a vfr_hud message @@ -48,36 +65,32 @@ typedef struct __mavlink_vfr_hud_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) + float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; - _mav_put_float(buf, 0, airspeed); - _mav_put_float(buf, 4, groundspeed); - _mav_put_float(buf, 8, alt); - _mav_put_float(buf, 12, climb); - _mav_put_int16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, throttle); + char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; + _mav_put_float(buf, 0, airspeed); + _mav_put_float(buf, 4, groundspeed); + _mav_put_float(buf, 8, alt); + _mav_put_float(buf, 12, climb); + _mav_put_int16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, throttle); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VFR_HUD_LEN); #else - mavlink_vfr_hud_t packet; - packet.airspeed = airspeed; - packet.groundspeed = groundspeed; - packet.alt = alt; - packet.climb = climb; - packet.heading = heading; - packet.throttle = throttle; + mavlink_vfr_hud_t packet; + packet.airspeed = airspeed; + packet.groundspeed = groundspeed; + packet.alt = alt; + packet.climb = climb; + packet.heading = heading; + packet.throttle = throttle; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VFR_HUD_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VFR_HUD; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VFR_HUD_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VFR_HUD; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); } /** @@ -95,37 +108,33 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - float airspeed,float groundspeed,int16_t heading,uint16_t throttle,float alt,float climb) + mavlink_message_t* msg, + float airspeed,float groundspeed,int16_t heading,uint16_t throttle,float alt,float climb) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; - _mav_put_float(buf, 0, airspeed); - _mav_put_float(buf, 4, groundspeed); - _mav_put_float(buf, 8, alt); - _mav_put_float(buf, 12, climb); - _mav_put_int16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, throttle); + char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; + _mav_put_float(buf, 0, airspeed); + _mav_put_float(buf, 4, groundspeed); + _mav_put_float(buf, 8, alt); + _mav_put_float(buf, 12, climb); + _mav_put_int16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, throttle); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VFR_HUD_LEN); #else - mavlink_vfr_hud_t packet; - packet.airspeed = airspeed; - packet.groundspeed = groundspeed; - packet.alt = alt; - packet.climb = climb; - packet.heading = heading; - packet.throttle = throttle; + mavlink_vfr_hud_t packet; + packet.airspeed = airspeed; + packet.groundspeed = groundspeed; + packet.alt = alt; + packet.climb = climb; + packet.heading = heading; + packet.throttle = throttle; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VFR_HUD_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VFR_HUD; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VFR_HUD_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VFR_HUD; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); } /** @@ -138,7 +147,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_vfr_hud_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vfr_hud_t* vfr_hud) { - return mavlink_msg_vfr_hud_pack(system_id, component_id, msg, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb); + return mavlink_msg_vfr_hud_pack(system_id, component_id, msg, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb); } /** @@ -152,7 +161,7 @@ static inline uint16_t mavlink_msg_vfr_hud_encode(uint8_t system_id, uint8_t com */ static inline uint16_t mavlink_msg_vfr_hud_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vfr_hud_t* vfr_hud) { - return mavlink_msg_vfr_hud_pack_chan(system_id, component_id, chan, msg, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb); + return mavlink_msg_vfr_hud_pack_chan(system_id, component_id, chan, msg, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb); } /** @@ -171,33 +180,39 @@ static inline uint16_t mavlink_msg_vfr_hud_encode_chan(uint8_t system_id, uint8_ static inline void mavlink_msg_vfr_hud_send(mavlink_channel_t chan, float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; - _mav_put_float(buf, 0, airspeed); - _mav_put_float(buf, 4, groundspeed); - _mav_put_float(buf, 8, alt); - _mav_put_float(buf, 12, climb); - _mav_put_int16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, throttle); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); + char buf[MAVLINK_MSG_ID_VFR_HUD_LEN]; + _mav_put_float(buf, 0, airspeed); + _mav_put_float(buf, 4, groundspeed); + _mav_put_float(buf, 8, alt); + _mav_put_float(buf, 12, climb); + _mav_put_int16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, throttle); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_LEN); + mavlink_vfr_hud_t packet; + packet.airspeed = airspeed; + packet.groundspeed = groundspeed; + packet.alt = alt; + packet.climb = climb; + packet.heading = heading; + packet.throttle = throttle; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); #endif +} + +/** + * @brief Send a vfr_hud message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_vfr_hud_send_struct(mavlink_channel_t chan, const mavlink_vfr_hud_t* vfr_hud) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_vfr_hud_send(chan, vfr_hud->airspeed, vfr_hud->groundspeed, vfr_hud->heading, vfr_hud->throttle, vfr_hud->alt, vfr_hud->climb); #else - mavlink_vfr_hud_t packet; - packet.airspeed = airspeed; - packet.groundspeed = groundspeed; - packet.alt = alt; - packet.climb = climb; - packet.heading = heading; - packet.throttle = throttle; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)&packet, MAVLINK_MSG_ID_VFR_HUD_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)vfr_hud, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); #endif } @@ -212,33 +227,25 @@ static inline void mavlink_msg_vfr_hud_send(mavlink_channel_t chan, float airspe static inline void mavlink_msg_vfr_hud_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float airspeed, float groundspeed, int16_t heading, uint16_t throttle, float alt, float climb) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_float(buf, 0, airspeed); - _mav_put_float(buf, 4, groundspeed); - _mav_put_float(buf, 8, alt); - _mav_put_float(buf, 12, climb); - _mav_put_int16_t(buf, 16, heading); - _mav_put_uint16_t(buf, 18, throttle); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); + char *buf = (char *)msgbuf; + _mav_put_float(buf, 0, airspeed); + _mav_put_float(buf, 4, groundspeed); + _mav_put_float(buf, 8, alt); + _mav_put_float(buf, 12, climb); + _mav_put_int16_t(buf, 16, heading); + _mav_put_uint16_t(buf, 18, throttle); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, buf, MAVLINK_MSG_ID_VFR_HUD_LEN); -#endif -#else - mavlink_vfr_hud_t *packet = (mavlink_vfr_hud_t *)msgbuf; - packet->airspeed = airspeed; - packet->groundspeed = groundspeed; - packet->alt = alt; - packet->climb = climb; - packet->heading = heading; - packet->throttle = throttle; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)packet, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)packet, MAVLINK_MSG_ID_VFR_HUD_LEN); -#endif + mavlink_vfr_hud_t *packet = (mavlink_vfr_hud_t *)msgbuf; + packet->airspeed = airspeed; + packet->groundspeed = groundspeed; + packet->alt = alt; + packet->climb = climb; + packet->heading = heading; + packet->throttle = throttle; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VFR_HUD, (const char *)packet, MAVLINK_MSG_ID_VFR_HUD_MIN_LEN, MAVLINK_MSG_ID_VFR_HUD_LEN, MAVLINK_MSG_ID_VFR_HUD_CRC); #endif } #endif @@ -255,7 +262,7 @@ static inline void mavlink_msg_vfr_hud_send_buf(mavlink_message_t *msgbuf, mavli */ static inline float mavlink_msg_vfr_hud_get_airspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 0); + return _MAV_RETURN_float(msg, 0); } /** @@ -265,7 +272,7 @@ static inline float mavlink_msg_vfr_hud_get_airspeed(const mavlink_message_t* ms */ static inline float mavlink_msg_vfr_hud_get_groundspeed(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 4); + return _MAV_RETURN_float(msg, 4); } /** @@ -275,7 +282,7 @@ static inline float mavlink_msg_vfr_hud_get_groundspeed(const mavlink_message_t* */ static inline int16_t mavlink_msg_vfr_hud_get_heading(const mavlink_message_t* msg) { - return _MAV_RETURN_int16_t(msg, 16); + return _MAV_RETURN_int16_t(msg, 16); } /** @@ -285,7 +292,7 @@ static inline int16_t mavlink_msg_vfr_hud_get_heading(const mavlink_message_t* m */ static inline uint16_t mavlink_msg_vfr_hud_get_throttle(const mavlink_message_t* msg) { - return _MAV_RETURN_uint16_t(msg, 18); + return _MAV_RETURN_uint16_t(msg, 18); } /** @@ -295,7 +302,7 @@ static inline uint16_t mavlink_msg_vfr_hud_get_throttle(const mavlink_message_t* */ static inline float mavlink_msg_vfr_hud_get_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -305,7 +312,7 @@ static inline float mavlink_msg_vfr_hud_get_alt(const mavlink_message_t* msg) */ static inline float mavlink_msg_vfr_hud_get_climb(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -316,14 +323,16 @@ static inline float mavlink_msg_vfr_hud_get_climb(const mavlink_message_t* msg) */ static inline void mavlink_msg_vfr_hud_decode(const mavlink_message_t* msg, mavlink_vfr_hud_t* vfr_hud) { -#if MAVLINK_NEED_BYTE_SWAP - vfr_hud->airspeed = mavlink_msg_vfr_hud_get_airspeed(msg); - vfr_hud->groundspeed = mavlink_msg_vfr_hud_get_groundspeed(msg); - vfr_hud->alt = mavlink_msg_vfr_hud_get_alt(msg); - vfr_hud->climb = mavlink_msg_vfr_hud_get_climb(msg); - vfr_hud->heading = mavlink_msg_vfr_hud_get_heading(msg); - vfr_hud->throttle = mavlink_msg_vfr_hud_get_throttle(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + vfr_hud->airspeed = mavlink_msg_vfr_hud_get_airspeed(msg); + vfr_hud->groundspeed = mavlink_msg_vfr_hud_get_groundspeed(msg); + vfr_hud->alt = mavlink_msg_vfr_hud_get_alt(msg); + vfr_hud->climb = mavlink_msg_vfr_hud_get_climb(msg); + vfr_hud->heading = mavlink_msg_vfr_hud_get_heading(msg); + vfr_hud->throttle = mavlink_msg_vfr_hud_get_throttle(msg); #else - memcpy(vfr_hud, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VFR_HUD_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_VFR_HUD_LEN? msg->len : MAVLINK_MSG_ID_VFR_HUD_LEN; + memset(vfr_hud, 0, MAVLINK_MSG_ID_VFR_HUD_LEN); + memcpy(vfr_hud, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vibration.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vibration.h index 83495a7..1c01776 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vibration.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vibration.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE VIBRATION PACKING #define MAVLINK_MSG_ID_VIBRATION 241 -typedef struct __mavlink_vibration_t -{ +MAVPACKED( +typedef struct __mavlink_vibration_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float vibration_x; /*< Vibration levels on X-axis*/ float vibration_y; /*< Vibration levels on Y-axis*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_vibration_t uint32_t clipping_0; /*< first accelerometer clipping count*/ uint32_t clipping_1; /*< second accelerometer clipping count*/ uint32_t clipping_2; /*< third accelerometer clipping count*/ -} mavlink_vibration_t; +}) mavlink_vibration_t; #define MAVLINK_MSG_ID_VIBRATION_LEN 32 +#define MAVLINK_MSG_ID_VIBRATION_MIN_LEN 32 #define MAVLINK_MSG_ID_241_LEN 32 +#define MAVLINK_MSG_ID_241_MIN_LEN 32 #define MAVLINK_MSG_ID_VIBRATION_CRC 90 #define MAVLINK_MSG_ID_241_CRC 90 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_VIBRATION { \ - "VIBRATION", \ - 7, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vibration_t, time_usec) }, \ + 241, \ + "VIBRATION", \ + 7, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vibration_t, time_usec) }, \ { "vibration_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vibration_t, vibration_x) }, \ { "vibration_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vibration_t, vibration_y) }, \ { "vibration_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vibration_t, vibration_z) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_vibration_t { "clipping_2", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_vibration_t, clipping_2) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_VIBRATION { \ + "VIBRATION", \ + 7, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vibration_t, time_usec) }, \ + { "vibration_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vibration_t, vibration_x) }, \ + { "vibration_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vibration_t, vibration_y) }, \ + { "vibration_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vibration_t, vibration_z) }, \ + { "clipping_0", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_vibration_t, clipping_0) }, \ + { "clipping_1", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_vibration_t, clipping_1) }, \ + { "clipping_2", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_vibration_t, clipping_2) }, \ + } \ +} +#endif /** * @brief Pack a vibration message @@ -51,38 +69,34 @@ typedef struct __mavlink_vibration_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vibration_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float vibration_x, float vibration_y, float vibration_z, uint32_t clipping_0, uint32_t clipping_1, uint32_t clipping_2) + uint64_t time_usec, float vibration_x, float vibration_y, float vibration_z, uint32_t clipping_0, uint32_t clipping_1, uint32_t clipping_2) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VIBRATION_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vibration_x); - _mav_put_float(buf, 12, vibration_y); - _mav_put_float(buf, 16, vibration_z); - _mav_put_uint32_t(buf, 20, clipping_0); - _mav_put_uint32_t(buf, 24, clipping_1); - _mav_put_uint32_t(buf, 28, clipping_2); + char buf[MAVLINK_MSG_ID_VIBRATION_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vibration_x); + _mav_put_float(buf, 12, vibration_y); + _mav_put_float(buf, 16, vibration_z); + _mav_put_uint32_t(buf, 20, clipping_0); + _mav_put_uint32_t(buf, 24, clipping_1); + _mav_put_uint32_t(buf, 28, clipping_2); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIBRATION_LEN); #else - mavlink_vibration_t packet; - packet.time_usec = time_usec; - packet.vibration_x = vibration_x; - packet.vibration_y = vibration_y; - packet.vibration_z = vibration_z; - packet.clipping_0 = clipping_0; - packet.clipping_1 = clipping_1; - packet.clipping_2 = clipping_2; + mavlink_vibration_t packet; + packet.time_usec = time_usec; + packet.vibration_x = vibration_x; + packet.vibration_y = vibration_y; + packet.vibration_z = vibration_z; + packet.clipping_0 = clipping_0; + packet.clipping_1 = clipping_1; + packet.clipping_2 = clipping_2; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIBRATION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VIBRATION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VIBRATION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VIBRATION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_vibration_pack(uint8_t system_id, uint8_t com * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vibration_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float vibration_x,float vibration_y,float vibration_z,uint32_t clipping_0,uint32_t clipping_1,uint32_t clipping_2) + mavlink_message_t* msg, + uint64_t time_usec,float vibration_x,float vibration_y,float vibration_z,uint32_t clipping_0,uint32_t clipping_1,uint32_t clipping_2) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VIBRATION_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vibration_x); - _mav_put_float(buf, 12, vibration_y); - _mav_put_float(buf, 16, vibration_z); - _mav_put_uint32_t(buf, 20, clipping_0); - _mav_put_uint32_t(buf, 24, clipping_1); - _mav_put_uint32_t(buf, 28, clipping_2); + char buf[MAVLINK_MSG_ID_VIBRATION_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vibration_x); + _mav_put_float(buf, 12, vibration_y); + _mav_put_float(buf, 16, vibration_z); + _mav_put_uint32_t(buf, 20, clipping_0); + _mav_put_uint32_t(buf, 24, clipping_1); + _mav_put_uint32_t(buf, 28, clipping_2); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIBRATION_LEN); #else - mavlink_vibration_t packet; - packet.time_usec = time_usec; - packet.vibration_x = vibration_x; - packet.vibration_y = vibration_y; - packet.vibration_z = vibration_z; - packet.clipping_0 = clipping_0; - packet.clipping_1 = clipping_1; - packet.clipping_2 = clipping_2; + mavlink_vibration_t packet; + packet.time_usec = time_usec; + packet.vibration_x = vibration_x; + packet.vibration_y = vibration_y; + packet.vibration_z = vibration_z; + packet.clipping_0 = clipping_0; + packet.clipping_1 = clipping_1; + packet.clipping_2 = clipping_2; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIBRATION_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VIBRATION; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VIBRATION_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VIBRATION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_vibration_pack_chan(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_vibration_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vibration_t* vibration) { - return mavlink_msg_vibration_pack(system_id, component_id, msg, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2); + return mavlink_msg_vibration_pack(system_id, component_id, msg, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_vibration_encode(uint8_t system_id, uint8_t c */ static inline uint16_t mavlink_msg_vibration_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vibration_t* vibration) { - return mavlink_msg_vibration_pack_chan(system_id, component_id, chan, msg, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2); + return mavlink_msg_vibration_pack_chan(system_id, component_id, chan, msg, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_vibration_encode_chan(uint8_t system_id, uint static inline void mavlink_msg_vibration_send(mavlink_channel_t chan, uint64_t time_usec, float vibration_x, float vibration_y, float vibration_z, uint32_t clipping_0, uint32_t clipping_1, uint32_t clipping_2) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VIBRATION_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vibration_x); - _mav_put_float(buf, 12, vibration_y); - _mav_put_float(buf, 16, vibration_z); - _mav_put_uint32_t(buf, 20, clipping_0); - _mav_put_uint32_t(buf, 24, clipping_1); - _mav_put_uint32_t(buf, 28, clipping_2); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); + char buf[MAVLINK_MSG_ID_VIBRATION_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vibration_x); + _mav_put_float(buf, 12, vibration_y); + _mav_put_float(buf, 16, vibration_z); + _mav_put_uint32_t(buf, 20, clipping_0); + _mav_put_uint32_t(buf, 24, clipping_1); + _mav_put_uint32_t(buf, 28, clipping_2); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_LEN); + mavlink_vibration_t packet; + packet.time_usec = time_usec; + packet.vibration_x = vibration_x; + packet.vibration_y = vibration_y; + packet.vibration_z = vibration_z; + packet.clipping_0 = clipping_0; + packet.clipping_1 = clipping_1; + packet.clipping_2 = clipping_2; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)&packet, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); #endif +} + +/** + * @brief Send a vibration message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_vibration_send_struct(mavlink_channel_t chan, const mavlink_vibration_t* vibration) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_vibration_send(chan, vibration->time_usec, vibration->vibration_x, vibration->vibration_y, vibration->vibration_z, vibration->clipping_0, vibration->clipping_1, vibration->clipping_2); #else - mavlink_vibration_t packet; - packet.time_usec = time_usec; - packet.vibration_x = vibration_x; - packet.vibration_y = vibration_y; - packet.vibration_z = vibration_z; - packet.clipping_0 = clipping_0; - packet.clipping_1 = clipping_1; - packet.clipping_2 = clipping_2; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)&packet, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)&packet, MAVLINK_MSG_ID_VIBRATION_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)vibration, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_vibration_send(mavlink_channel_t chan, uint64_t t static inline void mavlink_msg_vibration_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float vibration_x, float vibration_y, float vibration_z, uint32_t clipping_0, uint32_t clipping_1, uint32_t clipping_2) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, vibration_x); - _mav_put_float(buf, 12, vibration_y); - _mav_put_float(buf, 16, vibration_z); - _mav_put_uint32_t(buf, 20, clipping_0); - _mav_put_uint32_t(buf, 24, clipping_1); - _mav_put_uint32_t(buf, 28, clipping_2); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_LEN); -#endif -#else - mavlink_vibration_t *packet = (mavlink_vibration_t *)msgbuf; - packet->time_usec = time_usec; - packet->vibration_x = vibration_x; - packet->vibration_y = vibration_y; - packet->vibration_z = vibration_z; - packet->clipping_0 = clipping_0; - packet->clipping_1 = clipping_1; - packet->clipping_2 = clipping_2; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)packet, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, vibration_x); + _mav_put_float(buf, 12, vibration_y); + _mav_put_float(buf, 16, vibration_z); + _mav_put_uint32_t(buf, 20, clipping_0); + _mav_put_uint32_t(buf, 24, clipping_1); + _mav_put_uint32_t(buf, 28, clipping_2); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, buf, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)packet, MAVLINK_MSG_ID_VIBRATION_LEN); -#endif + mavlink_vibration_t *packet = (mavlink_vibration_t *)msgbuf; + packet->time_usec = time_usec; + packet->vibration_x = vibration_x; + packet->vibration_y = vibration_y; + packet->vibration_z = vibration_z; + packet->clipping_0 = clipping_0; + packet->clipping_1 = clipping_1; + packet->clipping_2 = clipping_2; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIBRATION, (const char *)packet, MAVLINK_MSG_ID_VIBRATION_MIN_LEN, MAVLINK_MSG_ID_VIBRATION_LEN, MAVLINK_MSG_ID_VIBRATION_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_vibration_send_buf(mavlink_message_t *msgbuf, mav */ static inline uint64_t mavlink_msg_vibration_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint64_t mavlink_msg_vibration_get_time_usec(const mavlink_message */ static inline float mavlink_msg_vibration_get_vibration_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_vibration_get_vibration_x(const mavlink_message_ */ static inline float mavlink_msg_vibration_get_vibration_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_vibration_get_vibration_y(const mavlink_message_ */ static inline float mavlink_msg_vibration_get_vibration_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_vibration_get_vibration_z(const mavlink_message_ */ static inline uint32_t mavlink_msg_vibration_get_clipping_0(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 20); + return _MAV_RETURN_uint32_t(msg, 20); } /** @@ -318,7 +326,7 @@ static inline uint32_t mavlink_msg_vibration_get_clipping_0(const mavlink_messag */ static inline uint32_t mavlink_msg_vibration_get_clipping_1(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 24); + return _MAV_RETURN_uint32_t(msg, 24); } /** @@ -328,7 +336,7 @@ static inline uint32_t mavlink_msg_vibration_get_clipping_1(const mavlink_messag */ static inline uint32_t mavlink_msg_vibration_get_clipping_2(const mavlink_message_t* msg) { - return _MAV_RETURN_uint32_t(msg, 28); + return _MAV_RETURN_uint32_t(msg, 28); } /** @@ -339,15 +347,17 @@ static inline uint32_t mavlink_msg_vibration_get_clipping_2(const mavlink_messag */ static inline void mavlink_msg_vibration_decode(const mavlink_message_t* msg, mavlink_vibration_t* vibration) { -#if MAVLINK_NEED_BYTE_SWAP - vibration->time_usec = mavlink_msg_vibration_get_time_usec(msg); - vibration->vibration_x = mavlink_msg_vibration_get_vibration_x(msg); - vibration->vibration_y = mavlink_msg_vibration_get_vibration_y(msg); - vibration->vibration_z = mavlink_msg_vibration_get_vibration_z(msg); - vibration->clipping_0 = mavlink_msg_vibration_get_clipping_0(msg); - vibration->clipping_1 = mavlink_msg_vibration_get_clipping_1(msg); - vibration->clipping_2 = mavlink_msg_vibration_get_clipping_2(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + vibration->time_usec = mavlink_msg_vibration_get_time_usec(msg); + vibration->vibration_x = mavlink_msg_vibration_get_vibration_x(msg); + vibration->vibration_y = mavlink_msg_vibration_get_vibration_y(msg); + vibration->vibration_z = mavlink_msg_vibration_get_vibration_z(msg); + vibration->clipping_0 = mavlink_msg_vibration_get_clipping_0(msg); + vibration->clipping_1 = mavlink_msg_vibration_get_clipping_1(msg); + vibration->clipping_2 = mavlink_msg_vibration_get_clipping_2(msg); #else - memcpy(vibration, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VIBRATION_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_VIBRATION_LEN? msg->len : MAVLINK_MSG_ID_VIBRATION_LEN; + memset(vibration, 0, MAVLINK_MSG_ID_VIBRATION_LEN); + memcpy(vibration, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vicon_position_estimate.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vicon_position_estimate.h index fc13260..388e711 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vicon_position_estimate.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vicon_position_estimate.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE VICON_POSITION_ESTIMATE PACKING #define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 104 -typedef struct __mavlink_vicon_position_estimate_t -{ +MAVPACKED( +typedef struct __mavlink_vicon_position_estimate_t { uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ float x; /*< Global X position*/ float y; /*< Global Y position*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_vicon_position_estimate_t float roll; /*< Roll angle in rad*/ float pitch; /*< Pitch angle in rad*/ float yaw; /*< Yaw angle in rad*/ -} mavlink_vicon_position_estimate_t; +}) mavlink_vicon_position_estimate_t; #define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32 +#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN 32 #define MAVLINK_MSG_ID_104_LEN 32 +#define MAVLINK_MSG_ID_104_MIN_LEN 32 #define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC 56 #define MAVLINK_MSG_ID_104_CRC 56 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE { \ - "VICON_POSITION_ESTIMATE", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) }, \ + 104, \ + "VICON_POSITION_ESTIMATE", \ + 7, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_vicon_position_estimate_t { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE { \ + "VICON_POSITION_ESTIMATE", \ + 7, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vicon_position_estimate_t, usec) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vicon_position_estimate_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vicon_position_estimate_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vicon_position_estimate_t, z) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vicon_position_estimate_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vicon_position_estimate_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vicon_position_estimate_t, yaw) }, \ + } \ +} +#endif /** * @brief Pack a vicon_position_estimate message @@ -51,38 +69,34 @@ typedef struct __mavlink_vicon_position_estimate_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) + uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); + char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #else - mavlink_vicon_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_vicon_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) + mavlink_message_t* msg, + uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); + char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #else - mavlink_vicon_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_vicon_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys */ static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate) { - return mavlink_msg_vicon_position_estimate_pack(system_id, component_id, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw); + return mavlink_msg_vicon_position_estimate_pack(system_id, component_id, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system */ static inline uint16_t mavlink_msg_vicon_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vicon_position_estimate_t* vicon_position_estimate) { - return mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, chan, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw); + return mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, chan, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode_chan(uint8_t s static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); + char buf[MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); + mavlink_vicon_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); #endif +} + +/** + * @brief Send a vicon_position_estimate message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_vicon_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_vicon_position_estimate_t* vicon_position_estimate) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_vicon_position_estimate_send(chan, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw); #else - mavlink_vicon_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)vicon_position_estimate, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t ch static inline void mavlink_msg_vicon_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); -#endif -#else - mavlink_vicon_position_estimate_t *packet = (mavlink_vicon_position_estimate_t *)msgbuf; - packet->usec = usec; - packet->x = x; - packet->y = y; - packet->z = z; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); -#endif + mavlink_vicon_position_estimate_t *packet = (mavlink_vicon_position_estimate_t *)msgbuf; + packet->usec = usec; + packet->x = x; + packet->y = y; + packet->z = z; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_vicon_position_estimate_send_buf(mavlink_message_ */ static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlin */ static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_x(const mavlink_mess */ static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_y(const mavlink_mess */ static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_z(const mavlink_mess */ static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_roll(const mavlink_m */ static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_vicon_position_estimate_get_pitch(const mavlink_ */ static inline float mavlink_msg_vicon_position_estimate_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_vicon_position_estimate_get_yaw(const mavlink_me */ static inline void mavlink_msg_vicon_position_estimate_decode(const mavlink_message_t* msg, mavlink_vicon_position_estimate_t* vicon_position_estimate) { -#if MAVLINK_NEED_BYTE_SWAP - vicon_position_estimate->usec = mavlink_msg_vicon_position_estimate_get_usec(msg); - vicon_position_estimate->x = mavlink_msg_vicon_position_estimate_get_x(msg); - vicon_position_estimate->y = mavlink_msg_vicon_position_estimate_get_y(msg); - vicon_position_estimate->z = mavlink_msg_vicon_position_estimate_get_z(msg); - vicon_position_estimate->roll = mavlink_msg_vicon_position_estimate_get_roll(msg); - vicon_position_estimate->pitch = mavlink_msg_vicon_position_estimate_get_pitch(msg); - vicon_position_estimate->yaw = mavlink_msg_vicon_position_estimate_get_yaw(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + vicon_position_estimate->usec = mavlink_msg_vicon_position_estimate_get_usec(msg); + vicon_position_estimate->x = mavlink_msg_vicon_position_estimate_get_x(msg); + vicon_position_estimate->y = mavlink_msg_vicon_position_estimate_get_y(msg); + vicon_position_estimate->z = mavlink_msg_vicon_position_estimate_get_z(msg); + vicon_position_estimate->roll = mavlink_msg_vicon_position_estimate_get_roll(msg); + vicon_position_estimate->pitch = mavlink_msg_vicon_position_estimate_get_pitch(msg); + vicon_position_estimate->yaw = mavlink_msg_vicon_position_estimate_get_yaw(msg); #else - memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN; + memset(vicon_position_estimate, 0, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN); + memcpy(vicon_position_estimate, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_position_estimate.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_position_estimate.h index fbe5a81..3e6d1da 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_position_estimate.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_position_estimate.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE VISION_POSITION_ESTIMATE PACKING #define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 102 -typedef struct __mavlink_vision_position_estimate_t -{ +MAVPACKED( +typedef struct __mavlink_vision_position_estimate_t { uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ float x; /*< Global X position*/ float y; /*< Global Y position*/ @@ -11,20 +12,24 @@ typedef struct __mavlink_vision_position_estimate_t float roll; /*< Roll angle in rad*/ float pitch; /*< Pitch angle in rad*/ float yaw; /*< Yaw angle in rad*/ -} mavlink_vision_position_estimate_t; +}) mavlink_vision_position_estimate_t; #define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32 +#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN 32 #define MAVLINK_MSG_ID_102_LEN 32 +#define MAVLINK_MSG_ID_102_MIN_LEN 32 #define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC 158 #define MAVLINK_MSG_ID_102_CRC 158 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \ - "VISION_POSITION_ESTIMATE", \ - 7, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \ + 102, \ + "VISION_POSITION_ESTIMATE", \ + 7, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \ @@ -33,7 +38,20 @@ typedef struct __mavlink_vision_position_estimate_t { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE { \ + "VISION_POSITION_ESTIMATE", \ + 7, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_position_estimate_t, usec) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_position_estimate_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_position_estimate_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_position_estimate_t, z) }, \ + { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vision_position_estimate_t, roll) }, \ + { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vision_position_estimate_t, pitch) }, \ + { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vision_position_estimate_t, yaw) }, \ + } \ +} +#endif /** * @brief Pack a vision_position_estimate message @@ -51,38 +69,34 @@ typedef struct __mavlink_vision_position_estimate_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) + uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); + char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #else - mavlink_vision_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_vision_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); } /** @@ -101,39 +115,35 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_ * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) + mavlink_message_t* msg, + uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); + char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #else - mavlink_vision_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; + mavlink_vision_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); } /** @@ -146,7 +156,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy */ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate) { - return mavlink_msg_vision_position_estimate_pack(system_id, component_id, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw); + return mavlink_msg_vision_position_estimate_pack(system_id, component_id, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw); } /** @@ -160,7 +170,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t syste */ static inline uint16_t mavlink_msg_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_position_estimate_t* vision_position_estimate) { - return mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw); + return mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw); } /** @@ -180,35 +190,41 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode_chan(uint8_t static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); + char buf[MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); + mavlink_vision_position_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + packet.roll = roll; + packet.pitch = pitch; + packet.yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); #endif +} + +/** + * @brief Send a vision_position_estimate message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_vision_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_vision_position_estimate_t* vision_position_estimate) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_vision_position_estimate_send(chan, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw); #else - mavlink_vision_position_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - packet.roll = roll; - packet.pitch = pitch; - packet.yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)vision_position_estimate, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); #endif } @@ -223,35 +239,27 @@ static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t c static inline void mavlink_msg_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - _mav_put_float(buf, 20, roll); - _mav_put_float(buf, 24, pitch); - _mav_put_float(buf, 28, yaw); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); -#endif -#else - mavlink_vision_position_estimate_t *packet = (mavlink_vision_position_estimate_t *)msgbuf; - packet->usec = usec; - packet->x = x; - packet->y = y; - packet->z = z; - packet->roll = roll; - packet->pitch = pitch; - packet->yaw = yaw; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + _mav_put_float(buf, 20, roll); + _mav_put_float(buf, 24, pitch); + _mav_put_float(buf, 28, yaw); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); -#endif + mavlink_vision_position_estimate_t *packet = (mavlink_vision_position_estimate_t *)msgbuf; + packet->usec = usec; + packet->x = x; + packet->y = y; + packet->z = z; + packet->roll = roll; + packet->pitch = pitch; + packet->yaw = yaw; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_CRC); #endif } #endif @@ -268,7 +276,7 @@ static inline void mavlink_msg_vision_position_estimate_send_buf(mavlink_message */ static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -278,7 +286,7 @@ static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavli */ static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -288,7 +296,7 @@ static inline float mavlink_msg_vision_position_estimate_get_x(const mavlink_mes */ static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -298,7 +306,7 @@ static inline float mavlink_msg_vision_position_estimate_get_y(const mavlink_mes */ static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -308,7 +316,7 @@ static inline float mavlink_msg_vision_position_estimate_get_z(const mavlink_mes */ static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -318,7 +326,7 @@ static inline float mavlink_msg_vision_position_estimate_get_roll(const mavlink_ */ static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -328,7 +336,7 @@ static inline float mavlink_msg_vision_position_estimate_get_pitch(const mavlink */ static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -339,15 +347,17 @@ static inline float mavlink_msg_vision_position_estimate_get_yaw(const mavlink_m */ static inline void mavlink_msg_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_vision_position_estimate_t* vision_position_estimate) { -#if MAVLINK_NEED_BYTE_SWAP - vision_position_estimate->usec = mavlink_msg_vision_position_estimate_get_usec(msg); - vision_position_estimate->x = mavlink_msg_vision_position_estimate_get_x(msg); - vision_position_estimate->y = mavlink_msg_vision_position_estimate_get_y(msg); - vision_position_estimate->z = mavlink_msg_vision_position_estimate_get_z(msg); - vision_position_estimate->roll = mavlink_msg_vision_position_estimate_get_roll(msg); - vision_position_estimate->pitch = mavlink_msg_vision_position_estimate_get_pitch(msg); - vision_position_estimate->yaw = mavlink_msg_vision_position_estimate_get_yaw(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + vision_position_estimate->usec = mavlink_msg_vision_position_estimate_get_usec(msg); + vision_position_estimate->x = mavlink_msg_vision_position_estimate_get_x(msg); + vision_position_estimate->y = mavlink_msg_vision_position_estimate_get_y(msg); + vision_position_estimate->z = mavlink_msg_vision_position_estimate_get_z(msg); + vision_position_estimate->roll = mavlink_msg_vision_position_estimate_get_roll(msg); + vision_position_estimate->pitch = mavlink_msg_vision_position_estimate_get_pitch(msg); + vision_position_estimate->yaw = mavlink_msg_vision_position_estimate_get_yaw(msg); #else - memcpy(vision_position_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN; + memset(vision_position_estimate, 0, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN); + memcpy(vision_position_estimate, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_speed_estimate.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_speed_estimate.h index 27c5412..c33a119 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_speed_estimate.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_vision_speed_estimate.h @@ -1,33 +1,48 @@ +#pragma once // MESSAGE VISION_SPEED_ESTIMATE PACKING #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 103 -typedef struct __mavlink_vision_speed_estimate_t -{ +MAVPACKED( +typedef struct __mavlink_vision_speed_estimate_t { uint64_t usec; /*< Timestamp (microseconds, synced to UNIX time or since system boot)*/ float x; /*< Global X speed*/ float y; /*< Global Y speed*/ float z; /*< Global Z speed*/ -} mavlink_vision_speed_estimate_t; +}) mavlink_vision_speed_estimate_t; #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20 +#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN 20 #define MAVLINK_MSG_ID_103_LEN 20 +#define MAVLINK_MSG_ID_103_MIN_LEN 20 #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC 208 #define MAVLINK_MSG_ID_103_CRC 208 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \ - "VISION_SPEED_ESTIMATE", \ - 4, \ - { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \ + 103, \ + "VISION_SPEED_ESTIMATE", \ + 4, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \ { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \ { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \ + "VISION_SPEED_ESTIMATE", \ + 4, \ + { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \ + { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \ + { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \ + { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \ + } \ +} +#endif /** * @brief Pack a vision_speed_estimate message @@ -42,32 +57,28 @@ typedef struct __mavlink_vision_speed_estimate_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t usec, float x, float y, float z) + uint64_t usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); + char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #else - mavlink_vision_speed_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; + mavlink_vision_speed_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); } /** @@ -83,33 +94,29 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t usec,float x,float y,float z) + mavlink_message_t* msg, + uint64_t usec,float x,float y,float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); + char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #else - mavlink_vision_speed_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; + mavlink_vision_speed_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); } /** @@ -122,7 +129,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste */ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate) { - return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z); + return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z); } /** @@ -136,7 +143,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_i */ static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate) { - return mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, chan, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z); + return mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, chan, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z); } /** @@ -153,29 +160,35 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode_chan(uint8_t sys static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); + char buf[MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN]; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); + mavlink_vision_speed_estimate_t packet; + packet.usec = usec; + packet.x = x; + packet.y = y; + packet.z = z; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); #endif +} + +/** + * @brief Send a vision_speed_estimate message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_vision_speed_estimate_send_struct(mavlink_channel_t chan, const mavlink_vision_speed_estimate_t* vision_speed_estimate) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_vision_speed_estimate_send(chan, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z); #else - mavlink_vision_speed_estimate_t packet; - packet.usec = usec; - packet.x = x; - packet.y = y; - packet.z = z; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)vision_speed_estimate, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); #endif } @@ -190,29 +203,21 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, usec); - _mav_put_float(buf, 8, x); - _mav_put_float(buf, 12, y); - _mav_put_float(buf, 16, z); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); -#endif -#else - mavlink_vision_speed_estimate_t *packet = (mavlink_vision_speed_estimate_t *)msgbuf; - packet->usec = usec; - packet->x = x; - packet->y = y; - packet->z = z; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, usec); + _mav_put_float(buf, 8, x); + _mav_put_float(buf, 12, y); + _mav_put_float(buf, 16, z); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); -#endif + mavlink_vision_speed_estimate_t *packet = (mavlink_vision_speed_estimate_t *)msgbuf; + packet->usec = usec; + packet->x = x; + packet->y = y; + packet->z = z; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_CRC); #endif } #endif @@ -229,7 +234,7 @@ static inline void mavlink_msg_vision_speed_estimate_send_buf(mavlink_message_t */ static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -239,7 +244,7 @@ static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_ */ static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -249,7 +254,7 @@ static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_messag */ static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -259,7 +264,7 @@ static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_messag */ static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -270,12 +275,14 @@ static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_messag */ static inline void mavlink_msg_vision_speed_estimate_decode(const mavlink_message_t* msg, mavlink_vision_speed_estimate_t* vision_speed_estimate) { -#if MAVLINK_NEED_BYTE_SWAP - vision_speed_estimate->usec = mavlink_msg_vision_speed_estimate_get_usec(msg); - vision_speed_estimate->x = mavlink_msg_vision_speed_estimate_get_x(msg); - vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg); - vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + vision_speed_estimate->usec = mavlink_msg_vision_speed_estimate_get_usec(msg); + vision_speed_estimate->x = mavlink_msg_vision_speed_estimate_get_x(msg); + vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg); + vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg); #else - memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN; + memset(vision_speed_estimate, 0, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN); + memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_wind_cov.h b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_wind_cov.h index 931de81..a3e9b9d 100755 --- a/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_wind_cov.h +++ b/oroca_bldc_FW/lib/mavlink/common/mavlink_msg_wind_cov.h @@ -1,9 +1,10 @@ +#pragma once // MESSAGE WIND_COV PACKING #define MAVLINK_MSG_ID_WIND_COV 231 -typedef struct __mavlink_wind_cov_t -{ +MAVPACKED( +typedef struct __mavlink_wind_cov_t { uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/ float wind_x; /*< Wind in X (NED) direction in m/s*/ float wind_y; /*< Wind in Y (NED) direction in m/s*/ @@ -13,20 +14,24 @@ typedef struct __mavlink_wind_cov_t float wind_alt; /*< AMSL altitude (m) this measurement was taken at*/ float horiz_accuracy; /*< Horizontal speed 1-STD accuracy*/ float vert_accuracy; /*< Vertical speed 1-STD accuracy*/ -} mavlink_wind_cov_t; +}) mavlink_wind_cov_t; #define MAVLINK_MSG_ID_WIND_COV_LEN 40 +#define MAVLINK_MSG_ID_WIND_COV_MIN_LEN 40 #define MAVLINK_MSG_ID_231_LEN 40 +#define MAVLINK_MSG_ID_231_MIN_LEN 40 #define MAVLINK_MSG_ID_WIND_COV_CRC 105 #define MAVLINK_MSG_ID_231_CRC 105 +#if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_WIND_COV { \ - "WIND_COV", \ - 9, \ - { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \ + 231, \ + "WIND_COV", \ + 9, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \ { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \ { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \ { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \ @@ -37,7 +42,22 @@ typedef struct __mavlink_wind_cov_t { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \ } \ } - +#else +#define MAVLINK_MESSAGE_INFO_WIND_COV { \ + "WIND_COV", \ + 9, \ + { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) }, \ + { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) }, \ + { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) }, \ + { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) }, \ + { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) }, \ + { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) }, \ + { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) }, \ + { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) }, \ + { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) }, \ + } \ +} +#endif /** * @brief Pack a wind_cov message @@ -57,42 +77,38 @@ typedef struct __mavlink_wind_cov_t * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy) + uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_WIND_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, wind_x); - _mav_put_float(buf, 12, wind_y); - _mav_put_float(buf, 16, wind_z); - _mav_put_float(buf, 20, var_horiz); - _mav_put_float(buf, 24, var_vert); - _mav_put_float(buf, 28, wind_alt); - _mav_put_float(buf, 32, horiz_accuracy); - _mav_put_float(buf, 36, vert_accuracy); + char buf[MAVLINK_MSG_ID_WIND_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, wind_x); + _mav_put_float(buf, 12, wind_y); + _mav_put_float(buf, 16, wind_z); + _mav_put_float(buf, 20, var_horiz); + _mav_put_float(buf, 24, var_vert); + _mav_put_float(buf, 28, wind_alt); + _mav_put_float(buf, 32, horiz_accuracy); + _mav_put_float(buf, 36, vert_accuracy); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN); #else - mavlink_wind_cov_t packet; - packet.time_usec = time_usec; - packet.wind_x = wind_x; - packet.wind_y = wind_y; - packet.wind_z = wind_z; - packet.var_horiz = var_horiz; - packet.var_vert = var_vert; - packet.wind_alt = wind_alt; - packet.horiz_accuracy = horiz_accuracy; - packet.vert_accuracy = vert_accuracy; + mavlink_wind_cov_t packet; + packet.time_usec = time_usec; + packet.wind_x = wind_x; + packet.wind_y = wind_y; + packet.wind_z = wind_z; + packet.var_horiz = var_horiz; + packet.var_vert = var_vert; + packet.wind_alt = wind_alt; + packet.horiz_accuracy = horiz_accuracy; + packet.vert_accuracy = vert_accuracy; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_WIND_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_WIND_COV; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); } /** @@ -113,43 +129,39 @@ static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t comp * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint64_t time_usec,float wind_x,float wind_y,float wind_z,float var_horiz,float var_vert,float wind_alt,float horiz_accuracy,float vert_accuracy) + mavlink_message_t* msg, + uint64_t time_usec,float wind_x,float wind_y,float wind_z,float var_horiz,float var_vert,float wind_alt,float horiz_accuracy,float vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_WIND_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, wind_x); - _mav_put_float(buf, 12, wind_y); - _mav_put_float(buf, 16, wind_z); - _mav_put_float(buf, 20, var_horiz); - _mav_put_float(buf, 24, var_vert); - _mav_put_float(buf, 28, wind_alt); - _mav_put_float(buf, 32, horiz_accuracy); - _mav_put_float(buf, 36, vert_accuracy); + char buf[MAVLINK_MSG_ID_WIND_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, wind_x); + _mav_put_float(buf, 12, wind_y); + _mav_put_float(buf, 16, wind_z); + _mav_put_float(buf, 20, var_horiz); + _mav_put_float(buf, 24, var_vert); + _mav_put_float(buf, 28, wind_alt); + _mav_put_float(buf, 32, horiz_accuracy); + _mav_put_float(buf, 36, vert_accuracy); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN); #else - mavlink_wind_cov_t packet; - packet.time_usec = time_usec; - packet.wind_x = wind_x; - packet.wind_y = wind_y; - packet.wind_z = wind_z; - packet.var_horiz = var_horiz; - packet.var_vert = var_vert; - packet.wind_alt = wind_alt; - packet.horiz_accuracy = horiz_accuracy; - packet.vert_accuracy = vert_accuracy; + mavlink_wind_cov_t packet; + packet.time_usec = time_usec; + packet.wind_x = wind_x; + packet.wind_y = wind_y; + packet.wind_z = wind_z; + packet.var_horiz = var_horiz; + packet.var_vert = var_vert; + packet.wind_alt = wind_alt; + packet.horiz_accuracy = horiz_accuracy; + packet.vert_accuracy = vert_accuracy; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN); #endif - msg->msgid = MAVLINK_MSG_ID_WIND_COV; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_LEN); -#endif + msg->msgid = MAVLINK_MSG_ID_WIND_COV; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); } /** @@ -162,7 +174,7 @@ static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t */ static inline uint16_t mavlink_msg_wind_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov) { - return mavlink_msg_wind_cov_pack(system_id, component_id, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy); + return mavlink_msg_wind_cov_pack(system_id, component_id, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy); } /** @@ -176,7 +188,7 @@ static inline uint16_t mavlink_msg_wind_cov_encode(uint8_t system_id, uint8_t co */ static inline uint16_t mavlink_msg_wind_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov) { - return mavlink_msg_wind_cov_pack_chan(system_id, component_id, chan, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy); + return mavlink_msg_wind_cov_pack_chan(system_id, component_id, chan, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy); } /** @@ -198,39 +210,45 @@ static inline uint16_t mavlink_msg_wind_cov_encode_chan(uint8_t system_id, uint8 static inline void mavlink_msg_wind_cov_send(mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_WIND_COV_LEN]; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, wind_x); - _mav_put_float(buf, 12, wind_y); - _mav_put_float(buf, 16, wind_z); - _mav_put_float(buf, 20, var_horiz); - _mav_put_float(buf, 24, var_vert); - _mav_put_float(buf, 28, wind_alt); - _mav_put_float(buf, 32, horiz_accuracy); - _mav_put_float(buf, 36, vert_accuracy); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); + char buf[MAVLINK_MSG_ID_WIND_COV_LEN]; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, wind_x); + _mav_put_float(buf, 12, wind_y); + _mav_put_float(buf, 16, wind_z); + _mav_put_float(buf, 20, var_horiz); + _mav_put_float(buf, 24, var_vert); + _mav_put_float(buf, 28, wind_alt); + _mav_put_float(buf, 32, horiz_accuracy); + _mav_put_float(buf, 36, vert_accuracy); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN); + mavlink_wind_cov_t packet; + packet.time_usec = time_usec; + packet.wind_x = wind_x; + packet.wind_y = wind_y; + packet.wind_z = wind_z; + packet.var_horiz = var_horiz; + packet.var_vert = var_vert; + packet.wind_alt = wind_alt; + packet.horiz_accuracy = horiz_accuracy; + packet.vert_accuracy = vert_accuracy; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); #endif +} + +/** + * @brief Send a wind_cov message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_wind_cov_send_struct(mavlink_channel_t chan, const mavlink_wind_cov_t* wind_cov) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_wind_cov_send(chan, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy); #else - mavlink_wind_cov_t packet; - packet.time_usec = time_usec; - packet.wind_x = wind_x; - packet.wind_y = wind_y; - packet.wind_z = wind_z; - packet.var_horiz = var_horiz; - packet.var_vert = var_vert; - packet.wind_alt = wind_alt; - packet.horiz_accuracy = horiz_accuracy; - packet.vert_accuracy = vert_accuracy; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_LEN); -#endif + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)wind_cov, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); #endif } @@ -245,39 +263,31 @@ static inline void mavlink_msg_wind_cov_send(mavlink_channel_t chan, uint64_t ti static inline void mavlink_msg_wind_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, time_usec); - _mav_put_float(buf, 8, wind_x); - _mav_put_float(buf, 12, wind_y); - _mav_put_float(buf, 16, wind_z); - _mav_put_float(buf, 20, var_horiz); - _mav_put_float(buf, 24, var_vert); - _mav_put_float(buf, 28, wind_alt); - _mav_put_float(buf, 32, horiz_accuracy); - _mav_put_float(buf, 36, vert_accuracy); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_LEN); -#endif -#else - mavlink_wind_cov_t *packet = (mavlink_wind_cov_t *)msgbuf; - packet->time_usec = time_usec; - packet->wind_x = wind_x; - packet->wind_y = wind_y; - packet->wind_z = wind_z; - packet->var_horiz = var_horiz; - packet->var_vert = var_vert; - packet->wind_alt = wind_alt; - packet->horiz_accuracy = horiz_accuracy; - packet->vert_accuracy = vert_accuracy; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); + char *buf = (char *)msgbuf; + _mav_put_uint64_t(buf, 0, time_usec); + _mav_put_float(buf, 8, wind_x); + _mav_put_float(buf, 12, wind_y); + _mav_put_float(buf, 16, wind_z); + _mav_put_float(buf, 20, var_horiz); + _mav_put_float(buf, 24, var_vert); + _mav_put_float(buf, 28, wind_alt); + _mav_put_float(buf, 32, horiz_accuracy); + _mav_put_float(buf, 36, vert_accuracy); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); #else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_LEN); -#endif + mavlink_wind_cov_t *packet = (mavlink_wind_cov_t *)msgbuf; + packet->time_usec = time_usec; + packet->wind_x = wind_x; + packet->wind_y = wind_y; + packet->wind_z = wind_z; + packet->var_horiz = var_horiz; + packet->var_vert = var_vert; + packet->wind_alt = wind_alt; + packet->horiz_accuracy = horiz_accuracy; + packet->vert_accuracy = vert_accuracy; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC); #endif } #endif @@ -294,7 +304,7 @@ static inline void mavlink_msg_wind_cov_send_buf(mavlink_message_t *msgbuf, mavl */ static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_t* msg) { - return _MAV_RETURN_uint64_t(msg, 0); + return _MAV_RETURN_uint64_t(msg, 0); } /** @@ -304,7 +314,7 @@ static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_ */ static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 8); + return _MAV_RETURN_float(msg, 8); } /** @@ -314,7 +324,7 @@ static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg */ static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 12); + return _MAV_RETURN_float(msg, 12); } /** @@ -324,7 +334,7 @@ static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg */ static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 16); + return _MAV_RETURN_float(msg, 16); } /** @@ -334,7 +344,7 @@ static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg */ static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 20); + return _MAV_RETURN_float(msg, 20); } /** @@ -344,7 +354,7 @@ static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* */ static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 24); + return _MAV_RETURN_float(msg, 24); } /** @@ -354,7 +364,7 @@ static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* m */ static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 28); + return _MAV_RETURN_float(msg, 28); } /** @@ -364,7 +374,7 @@ static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* m */ static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 32); + return _MAV_RETURN_float(msg, 32); } /** @@ -374,7 +384,7 @@ static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_messag */ static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message_t* msg) { - return _MAV_RETURN_float(msg, 36); + return _MAV_RETURN_float(msg, 36); } /** @@ -385,17 +395,19 @@ static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message */ static inline void mavlink_msg_wind_cov_decode(const mavlink_message_t* msg, mavlink_wind_cov_t* wind_cov) { -#if MAVLINK_NEED_BYTE_SWAP - wind_cov->time_usec = mavlink_msg_wind_cov_get_time_usec(msg); - wind_cov->wind_x = mavlink_msg_wind_cov_get_wind_x(msg); - wind_cov->wind_y = mavlink_msg_wind_cov_get_wind_y(msg); - wind_cov->wind_z = mavlink_msg_wind_cov_get_wind_z(msg); - wind_cov->var_horiz = mavlink_msg_wind_cov_get_var_horiz(msg); - wind_cov->var_vert = mavlink_msg_wind_cov_get_var_vert(msg); - wind_cov->wind_alt = mavlink_msg_wind_cov_get_wind_alt(msg); - wind_cov->horiz_accuracy = mavlink_msg_wind_cov_get_horiz_accuracy(msg); - wind_cov->vert_accuracy = mavlink_msg_wind_cov_get_vert_accuracy(msg); +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + wind_cov->time_usec = mavlink_msg_wind_cov_get_time_usec(msg); + wind_cov->wind_x = mavlink_msg_wind_cov_get_wind_x(msg); + wind_cov->wind_y = mavlink_msg_wind_cov_get_wind_y(msg); + wind_cov->wind_z = mavlink_msg_wind_cov_get_wind_z(msg); + wind_cov->var_horiz = mavlink_msg_wind_cov_get_var_horiz(msg); + wind_cov->var_vert = mavlink_msg_wind_cov_get_var_vert(msg); + wind_cov->wind_alt = mavlink_msg_wind_cov_get_wind_alt(msg); + wind_cov->horiz_accuracy = mavlink_msg_wind_cov_get_horiz_accuracy(msg); + wind_cov->vert_accuracy = mavlink_msg_wind_cov_get_vert_accuracy(msg); #else - memcpy(wind_cov, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WIND_COV_LEN); + uint8_t len = msg->len < MAVLINK_MSG_ID_WIND_COV_LEN? msg->len : MAVLINK_MSG_ID_WIND_COV_LEN; + memset(wind_cov, 0, MAVLINK_MSG_ID_WIND_COV_LEN); + memcpy(wind_cov, _MAV_PAYLOAD(msg), len); #endif } diff --git a/oroca_bldc_FW/lib/mavlink/common/testsuite.h b/oroca_bldc_FW/lib/mavlink/common/testsuite.h index a924785..3f784a3 100755 --- a/oroca_bldc_FW/lib/mavlink/common/testsuite.h +++ b/oroca_bldc_FW/lib/mavlink/common/testsuite.h @@ -1,7 +1,8 @@ /** @file - * @brief MAVLink comm protocol testsuite generated from common.xml - * @see http://qgroundcontrol.org/mavlink/ + * @brief MAVLink comm protocol testsuite generated from common.xml + * @see http://qgroundcontrol.org/mavlink/ */ +#pragma once #ifndef COMMON_TESTSUITE_H #define COMMON_TESTSUITE_H @@ -17,7 +18,7 @@ static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg); static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) { - mavlink_test_common(system_id, component_id, last_msg); + mavlink_test_common(system_id, component_id, last_msg); } #endif @@ -26,6592 +27,8033 @@ static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_me static void mavlink_test_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) { - mavlink_message_t msg; +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0); + if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HEARTBEAT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_heartbeat_t packet_in = { - 963497464,17,84,151,218,3 + mavlink_heartbeat_t packet_in = { + 963497464,17,84,151,218,3 }; - mavlink_heartbeat_t packet1, packet2; + mavlink_heartbeat_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.custom_mode = packet_in.custom_mode; - packet1.type = packet_in.type; - packet1.autopilot = packet_in.autopilot; - packet1.base_mode = packet_in.base_mode; - packet1.system_status = packet_in.system_status; - packet1.mavlink_version = packet_in.mavlink_version; + packet1.custom_mode = packet_in.custom_mode; + packet1.type = packet_in.type; + packet1.autopilot = packet_in.autopilot; + packet1.base_mode = packet_in.base_mode; + packet1.system_status = packet_in.system_status; + packet1.mavlink_version = packet_in.mavlink_version; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_heartbeat_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_heartbeat_decode(&msg, &packet2); + mavlink_msg_heartbeat_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_heartbeat_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_heartbeat_pack(system_id, component_id, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status ); - mavlink_msg_heartbeat_decode(&msg, &packet2); + mavlink_msg_heartbeat_pack(system_id, component_id, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status ); + mavlink_msg_heartbeat_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status ); - mavlink_msg_heartbeat_decode(&msg, &packet2); + mavlink_msg_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status ); + mavlink_msg_heartbeat_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYS_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_sys_status_t packet_in = { - 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,18587,18691,223 + mavlink_sys_status_t packet_in = { + 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,18587,18691,223 }; - mavlink_sys_status_t packet1, packet2; + mavlink_sys_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.onboard_control_sensors_present = packet_in.onboard_control_sensors_present; - packet1.onboard_control_sensors_enabled = packet_in.onboard_control_sensors_enabled; - packet1.onboard_control_sensors_health = packet_in.onboard_control_sensors_health; - packet1.load = packet_in.load; - packet1.voltage_battery = packet_in.voltage_battery; - packet1.current_battery = packet_in.current_battery; - packet1.drop_rate_comm = packet_in.drop_rate_comm; - packet1.errors_comm = packet_in.errors_comm; - packet1.errors_count1 = packet_in.errors_count1; - packet1.errors_count2 = packet_in.errors_count2; - packet1.errors_count3 = packet_in.errors_count3; - packet1.errors_count4 = packet_in.errors_count4; - packet1.battery_remaining = packet_in.battery_remaining; + packet1.onboard_control_sensors_present = packet_in.onboard_control_sensors_present; + packet1.onboard_control_sensors_enabled = packet_in.onboard_control_sensors_enabled; + packet1.onboard_control_sensors_health = packet_in.onboard_control_sensors_health; + packet1.load = packet_in.load; + packet1.voltage_battery = packet_in.voltage_battery; + packet1.current_battery = packet_in.current_battery; + packet1.drop_rate_comm = packet_in.drop_rate_comm; + packet1.errors_comm = packet_in.errors_comm; + packet1.errors_count1 = packet_in.errors_count1; + packet1.errors_count2 = packet_in.errors_count2; + packet1.errors_count3 = packet_in.errors_count3; + packet1.errors_count4 = packet_in.errors_count4; + packet1.battery_remaining = packet_in.battery_remaining; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_sys_status_decode(&msg, &packet2); + mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_sys_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sys_status_pack(system_id, component_id, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 ); - mavlink_msg_sys_status_decode(&msg, &packet2); + mavlink_msg_sys_status_pack(system_id, component_id, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 ); + mavlink_msg_sys_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sys_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 ); - mavlink_msg_sys_status_decode(&msg, &packet2); + mavlink_msg_sys_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 ); + mavlink_msg_sys_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYSTEM_TIME >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_system_time_t packet_in = { - 93372036854775807ULL,963497880 + mavlink_system_time_t packet_in = { + 93372036854775807ULL,963497880 }; - mavlink_system_time_t packet1, packet2; + mavlink_system_time_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_unix_usec = packet_in.time_unix_usec; - packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.time_unix_usec = packet_in.time_unix_usec; + packet1.time_boot_ms = packet_in.time_boot_ms; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_system_time_decode(&msg, &packet2); + mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_system_time_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_system_time_pack(system_id, component_id, &msg , packet1.time_unix_usec , packet1.time_boot_ms ); - mavlink_msg_system_time_decode(&msg, &packet2); + mavlink_msg_system_time_pack(system_id, component_id, &msg , packet1.time_unix_usec , packet1.time_boot_ms ); + mavlink_msg_system_time_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_unix_usec , packet1.time_boot_ms ); - mavlink_msg_system_time_decode(&msg, &packet2); + mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_unix_usec , packet1.time_boot_ms ); + mavlink_msg_system_time_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PING >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_ping_t packet_in = { - 93372036854775807ULL,963497880,41,108 + mavlink_ping_t packet_in = { + 93372036854775807ULL,963497880,41,108 }; - mavlink_ping_t packet1, packet2; + mavlink_ping_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.seq = packet_in.seq; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.time_usec = packet_in.time_usec; + packet1.seq = packet_in.seq; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_PING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PING_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_ping_decode(&msg, &packet2); + mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_ping_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_ping_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component ); - mavlink_msg_ping_decode(&msg, &packet2); + mavlink_msg_ping_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component ); + mavlink_msg_ping_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component ); - mavlink_msg_ping_decode(&msg, &packet2); + mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component ); + mavlink_msg_ping_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_change_operator_control_t packet_in = { - 5,72,139,"DEFGHIJKLMNOPQRSTUVWXYZA" + mavlink_change_operator_control_t packet_in = { + 5,72,139,"DEFGHIJKLMNOPQRSTUVWXYZA" }; - mavlink_change_operator_control_t packet1, packet2; + mavlink_change_operator_control_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.control_request = packet_in.control_request; - packet1.version = packet_in.version; + packet1.target_system = packet_in.target_system; + packet1.control_request = packet_in.control_request; + packet1.version = packet_in.version; - mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char)*25); + mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char)*25); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_change_operator_control_decode(&msg, &packet2); + mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_change_operator_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_change_operator_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey ); - mavlink_msg_change_operator_control_decode(&msg, &packet2); + mavlink_msg_change_operator_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey ); + mavlink_msg_change_operator_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_change_operator_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey ); - mavlink_msg_change_operator_control_decode(&msg, &packet2); + mavlink_msg_change_operator_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey ); + mavlink_msg_change_operator_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_change_operator_control_ack_t packet_in = { - 5,72,139 + mavlink_change_operator_control_ack_t packet_in = { + 5,72,139 }; - mavlink_change_operator_control_ack_t packet1, packet2; + mavlink_change_operator_control_ack_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.gcs_system_id = packet_in.gcs_system_id; - packet1.control_request = packet_in.control_request; - packet1.ack = packet_in.ack; + packet1.gcs_system_id = packet_in.gcs_system_id; + packet1.control_request = packet_in.control_request; + packet1.ack = packet_in.ack; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_change_operator_control_ack_decode(&msg, &packet2); + mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_change_operator_control_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack ); - mavlink_msg_change_operator_control_ack_decode(&msg, &packet2); + mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack ); + mavlink_msg_change_operator_control_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack ); - mavlink_msg_change_operator_control_ack_decode(&msg, &packet2); + mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack ); + mavlink_msg_change_operator_control_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTH_KEY >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_auth_key_t packet_in = { - "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE" + mavlink_auth_key_t packet_in = { + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE" }; - mavlink_auth_key_t packet1, packet2; + mavlink_auth_key_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - mav_array_memcpy(packet1.key, packet_in.key, sizeof(char)*32); + mav_array_memcpy(packet1.key, packet_in.key, sizeof(char)*32); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_auth_key_decode(&msg, &packet2); + mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_auth_key_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_auth_key_pack(system_id, component_id, &msg , packet1.key ); - mavlink_msg_auth_key_decode(&msg, &packet2); + mavlink_msg_auth_key_pack(system_id, component_id, &msg , packet1.key ); + mavlink_msg_auth_key_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.key ); - mavlink_msg_auth_key_decode(&msg, &packet2); + mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.key ); + mavlink_msg_auth_key_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_MODE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_set_mode_t packet_in = { - 963497464,17,84 + mavlink_set_mode_t packet_in = { + 963497464,17,84 }; - mavlink_set_mode_t packet1, packet2; + mavlink_set_mode_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.custom_mode = packet_in.custom_mode; - packet1.target_system = packet_in.target_system; - packet1.base_mode = packet_in.base_mode; + packet1.custom_mode = packet_in.custom_mode; + packet1.target_system = packet_in.target_system; + packet1.base_mode = packet_in.base_mode; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_MODE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_MODE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_set_mode_decode(&msg, &packet2); + mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_mode_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_mode_pack(system_id, component_id, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode ); - mavlink_msg_set_mode_decode(&msg, &packet2); + mavlink_msg_set_mode_pack(system_id, component_id, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode ); + mavlink_msg_set_mode_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode ); - mavlink_msg_set_mode_decode(&msg, &packet2); + mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode ); + mavlink_msg_set_mode_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_READ >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_param_request_read_t packet_in = { - 17235,139,206,"EFGHIJKLMNOPQRS" + mavlink_param_request_read_t packet_in = { + 17235,139,206,"EFGHIJKLMNOPQRS" }; - mavlink_param_request_read_t packet1, packet2; + mavlink_param_request_read_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param_index = packet_in.param_index; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.param_index = packet_in.param_index; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); + mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_param_request_read_decode(&msg, &packet2); + mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_param_request_read_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index ); - mavlink_msg_param_request_read_decode(&msg, &packet2); + mavlink_msg_param_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index ); + mavlink_msg_param_request_read_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index ); - mavlink_msg_param_request_read_decode(&msg, &packet2); + mavlink_msg_param_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index ); + mavlink_msg_param_request_read_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_LIST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_param_request_list_t packet_in = { - 5,72 + mavlink_param_request_list_t packet_in = { + 5,72 }; - mavlink_param_request_list_t packet1, packet2; + mavlink_param_request_list_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_param_request_list_decode(&msg, &packet2); + mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_param_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_param_request_list_decode(&msg, &packet2); + mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_param_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_param_request_list_decode(&msg, &packet2); + mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_param_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_VALUE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_param_value_t packet_in = { - 17.0,17443,17547,"IJKLMNOPQRSTUVW",77 + mavlink_param_value_t packet_in = { + 17.0,17443,17547,"IJKLMNOPQRSTUVW",77 }; - mavlink_param_value_t packet1, packet2; + mavlink_param_value_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param_value = packet_in.param_value; - packet1.param_count = packet_in.param_count; - packet1.param_index = packet_in.param_index; - packet1.param_type = packet_in.param_type; + packet1.param_value = packet_in.param_value; + packet1.param_count = packet_in.param_count; + packet1.param_index = packet_in.param_index; + packet1.param_type = packet_in.param_type; - mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); + mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_param_value_decode(&msg, &packet2); + mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_param_value_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_value_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index ); - mavlink_msg_param_value_decode(&msg, &packet2); + mavlink_msg_param_value_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index ); + mavlink_msg_param_value_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index ); - mavlink_msg_param_value_decode(&msg, &packet2); + mavlink_msg_param_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index ); + mavlink_msg_param_value_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_SET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_param_set_t packet_in = { - 17.0,17,84,"GHIJKLMNOPQRSTU",199 + mavlink_param_set_t packet_in = { + 17.0,17,84,"GHIJKLMNOPQRSTU",199 }; - mavlink_param_set_t packet1, packet2; + mavlink_param_set_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param_value = packet_in.param_value; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.param_type = packet_in.param_type; + packet1.param_value = packet_in.param_value; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.param_type = packet_in.param_type; - mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); + mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_PARAM_SET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_SET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_param_set_decode(&msg, &packet2); + mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_param_set_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type ); - mavlink_msg_param_set_decode(&msg, &packet2); + mavlink_msg_param_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type ); + mavlink_msg_param_set_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type ); - mavlink_msg_param_set_decode(&msg, &packet2); + mavlink_msg_param_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type ); + mavlink_msg_param_set_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RAW_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_gps_raw_int_t packet_in = { - 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156 + mavlink_gps_raw_int_t packet_in = { + 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156 }; - mavlink_gps_raw_int_t packet1, packet2; + mavlink_gps_raw_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.eph = packet_in.eph; - packet1.epv = packet_in.epv; - packet1.vel = packet_in.vel; - packet1.cog = packet_in.cog; - packet1.fix_type = packet_in.fix_type; - packet1.satellites_visible = packet_in.satellites_visible; + packet1.time_usec = packet_in.time_usec; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.eph = packet_in.eph; + packet1.epv = packet_in.epv; + packet1.vel = packet_in.vel; + packet1.cog = packet_in.cog; + packet1.fix_type = packet_in.fix_type; + packet1.satellites_visible = packet_in.satellites_visible; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_gps_raw_int_decode(&msg, &packet2); + mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_gps_raw_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_raw_int_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible ); - mavlink_msg_gps_raw_int_decode(&msg, &packet2); + mavlink_msg_gps_raw_int_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible ); + mavlink_msg_gps_raw_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible ); - mavlink_msg_gps_raw_int_decode(&msg, &packet2); + mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible ); + mavlink_msg_gps_raw_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_gps_status_t packet_in = { - 5,{ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91 },{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151 },{ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 },{ 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },{ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 } + mavlink_gps_status_t packet_in = { + 5,{ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91 },{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151 },{ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 },{ 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },{ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 } }; - mavlink_gps_status_t packet1, packet2; + mavlink_gps_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.satellites_visible = packet_in.satellites_visible; + packet1.satellites_visible = packet_in.satellites_visible; - mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn, sizeof(uint8_t)*20); - mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used, sizeof(uint8_t)*20); - mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation, sizeof(uint8_t)*20); - mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth, sizeof(uint8_t)*20); - mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr, sizeof(uint8_t)*20); + mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn, sizeof(uint8_t)*20); + mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used, sizeof(uint8_t)*20); + mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation, sizeof(uint8_t)*20); + mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth, sizeof(uint8_t)*20); + mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr, sizeof(uint8_t)*20); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_gps_status_decode(&msg, &packet2); + mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_gps_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_status_pack(system_id, component_id, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr ); - mavlink_msg_gps_status_decode(&msg, &packet2); + mavlink_msg_gps_status_pack(system_id, component_id, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr ); + mavlink_msg_gps_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr ); - mavlink_msg_gps_status_decode(&msg, &packet2); + mavlink_msg_gps_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr ); + mavlink_msg_gps_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_scaled_imu_t packet_in = { - 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275 + mavlink_scaled_imu_t packet_in = { + 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275 }; - mavlink_scaled_imu_t packet1, packet2; + mavlink_scaled_imu_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; - packet1.xgyro = packet_in.xgyro; - packet1.ygyro = packet_in.ygyro; - packet1.zgyro = packet_in.zgyro; - packet1.xmag = packet_in.xmag; - packet1.ymag = packet_in.ymag; - packet1.zmag = packet_in.zmag; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; + packet1.xgyro = packet_in.xgyro; + packet1.ygyro = packet_in.ygyro; + packet1.zgyro = packet_in.zgyro; + packet1.xmag = packet_in.xmag; + packet1.ymag = packet_in.ymag; + packet1.zmag = packet_in.zmag; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_scaled_imu_decode(&msg, &packet2); + mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_scaled_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_scaled_imu_decode(&msg, &packet2); + mavlink_msg_scaled_imu_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_scaled_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_scaled_imu_decode(&msg, &packet2); + mavlink_msg_scaled_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_scaled_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_IMU >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_raw_imu_t packet_in = { - 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483 + mavlink_raw_imu_t packet_in = { + 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483 }; - mavlink_raw_imu_t packet1, packet2; + mavlink_raw_imu_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; - packet1.xgyro = packet_in.xgyro; - packet1.ygyro = packet_in.ygyro; - packet1.zgyro = packet_in.zgyro; - packet1.xmag = packet_in.xmag; - packet1.ymag = packet_in.ymag; - packet1.zmag = packet_in.zmag; + packet1.time_usec = packet_in.time_usec; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; + packet1.xgyro = packet_in.xgyro; + packet1.ygyro = packet_in.ygyro; + packet1.zgyro = packet_in.zgyro; + packet1.xmag = packet_in.xmag; + packet1.ymag = packet_in.ymag; + packet1.zmag = packet_in.zmag; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RAW_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_IMU_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_raw_imu_decode(&msg, &packet2); + mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_raw_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_raw_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_raw_imu_decode(&msg, &packet2); + mavlink_msg_raw_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_raw_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_raw_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_raw_imu_decode(&msg, &packet2); + mavlink_msg_raw_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_raw_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_PRESSURE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_raw_pressure_t packet_in = { - 93372036854775807ULL,17651,17755,17859,17963 + mavlink_raw_pressure_t packet_in = { + 93372036854775807ULL,17651,17755,17859,17963 }; - mavlink_raw_pressure_t packet1, packet2; + mavlink_raw_pressure_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.press_abs = packet_in.press_abs; - packet1.press_diff1 = packet_in.press_diff1; - packet1.press_diff2 = packet_in.press_diff2; - packet1.temperature = packet_in.temperature; + packet1.time_usec = packet_in.time_usec; + packet1.press_abs = packet_in.press_abs; + packet1.press_diff1 = packet_in.press_diff1; + packet1.press_diff2 = packet_in.press_diff2; + packet1.temperature = packet_in.temperature; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_raw_pressure_decode(&msg, &packet2); + mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_raw_pressure_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_raw_pressure_pack(system_id, component_id, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature ); - mavlink_msg_raw_pressure_decode(&msg, &packet2); + mavlink_msg_raw_pressure_pack(system_id, component_id, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature ); + mavlink_msg_raw_pressure_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_raw_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature ); - mavlink_msg_raw_pressure_decode(&msg, &packet2); + mavlink_msg_raw_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature ); + mavlink_msg_raw_pressure_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_scaled_pressure_t packet_in = { - 963497464,45.0,73.0,17859 + mavlink_scaled_pressure_t packet_in = { + 963497464,45.0,73.0,17859 }; - mavlink_scaled_pressure_t packet1, packet2; + mavlink_scaled_pressure_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.press_abs = packet_in.press_abs; - packet1.press_diff = packet_in.press_diff; - packet1.temperature = packet_in.temperature; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.press_abs = packet_in.press_abs; + packet1.press_diff = packet_in.press_diff; + packet1.temperature = packet_in.temperature; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_scaled_pressure_decode(&msg, &packet2); + mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_scaled_pressure_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); - mavlink_msg_scaled_pressure_decode(&msg, &packet2); + mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); + mavlink_msg_scaled_pressure_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); - mavlink_msg_scaled_pressure_decode(&msg, &packet2); + mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); + mavlink_msg_scaled_pressure_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_attitude_t packet_in = { - 963497464,45.0,73.0,101.0,129.0,157.0,185.0 + mavlink_attitude_t packet_in = { + 963497464,45.0,73.0,101.0,129.0,157.0,185.0 }; - mavlink_attitude_t packet1, packet2; + mavlink_attitude_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.roll = packet_in.roll; - packet1.pitch = packet_in.pitch; - packet1.yaw = packet_in.yaw; - packet1.rollspeed = packet_in.rollspeed; - packet1.pitchspeed = packet_in.pitchspeed; - packet1.yawspeed = packet_in.yawspeed; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; + packet1.rollspeed = packet_in.rollspeed; + packet1.pitchspeed = packet_in.pitchspeed; + packet1.yawspeed = packet_in.yawspeed; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_attitude_decode(&msg, &packet2); + mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_attitude_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); - mavlink_msg_attitude_decode(&msg, &packet2); + mavlink_msg_attitude_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); + mavlink_msg_attitude_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); - mavlink_msg_attitude_decode(&msg, &packet2); + mavlink_msg_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); + mavlink_msg_attitude_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_attitude_quaternion_t packet_in = { - 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0 + mavlink_attitude_quaternion_t packet_in = { + 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0 }; - mavlink_attitude_quaternion_t packet1, packet2; + mavlink_attitude_quaternion_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.q1 = packet_in.q1; - packet1.q2 = packet_in.q2; - packet1.q3 = packet_in.q3; - packet1.q4 = packet_in.q4; - packet1.rollspeed = packet_in.rollspeed; - packet1.pitchspeed = packet_in.pitchspeed; - packet1.yawspeed = packet_in.yawspeed; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.q1 = packet_in.q1; + packet1.q2 = packet_in.q2; + packet1.q3 = packet_in.q3; + packet1.q4 = packet_in.q4; + packet1.rollspeed = packet_in.rollspeed; + packet1.pitchspeed = packet_in.pitchspeed; + packet1.yawspeed = packet_in.yawspeed; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_attitude_quaternion_decode(&msg, &packet2); + mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_attitude_quaternion_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_quaternion_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); - mavlink_msg_attitude_quaternion_decode(&msg, &packet2); + mavlink_msg_attitude_quaternion_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); + mavlink_msg_attitude_quaternion_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); - mavlink_msg_attitude_quaternion_decode(&msg, &packet2); + mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed ); + mavlink_msg_attitude_quaternion_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_local_position_ned_t packet_in = { - 963497464,45.0,73.0,101.0,129.0,157.0,185.0 + mavlink_local_position_ned_t packet_in = { + 963497464,45.0,73.0,101.0,129.0,157.0,185.0 }; - mavlink_local_position_ned_t packet1, packet2; + mavlink_local_position_ned_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_local_position_ned_decode(&msg, &packet2); + mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_local_position_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz ); - mavlink_msg_local_position_ned_decode(&msg, &packet2); + mavlink_msg_local_position_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz ); + mavlink_msg_local_position_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz ); - mavlink_msg_local_position_ned_decode(&msg, &packet2); + mavlink_msg_local_position_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz ); + mavlink_msg_local_position_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_global_position_int_t packet_in = { - 963497464,963497672,963497880,963498088,963498296,18275,18379,18483,18587 + mavlink_global_position_int_t packet_in = { + 963497464,963497672,963497880,963498088,963498296,18275,18379,18483,18587 }; - mavlink_global_position_int_t packet1, packet2; + mavlink_global_position_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.relative_alt = packet_in.relative_alt; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.hdg = packet_in.hdg; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.relative_alt = packet_in.relative_alt; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.hdg = packet_in.hdg; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_position_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_global_position_int_decode(&msg, &packet2); + mavlink_msg_global_position_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_global_position_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_position_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg ); - mavlink_msg_global_position_int_decode(&msg, &packet2); + mavlink_msg_global_position_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg ); + mavlink_msg_global_position_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_position_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg ); - mavlink_msg_global_position_int_decode(&msg, &packet2); + mavlink_msg_global_position_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg ); + mavlink_msg_global_position_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_SCALED >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_rc_channels_scaled_t packet_in = { - 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132 + mavlink_rc_channels_scaled_t packet_in = { + 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132 }; - mavlink_rc_channels_scaled_t packet1, packet2; + mavlink_rc_channels_scaled_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.chan1_scaled = packet_in.chan1_scaled; - packet1.chan2_scaled = packet_in.chan2_scaled; - packet1.chan3_scaled = packet_in.chan3_scaled; - packet1.chan4_scaled = packet_in.chan4_scaled; - packet1.chan5_scaled = packet_in.chan5_scaled; - packet1.chan6_scaled = packet_in.chan6_scaled; - packet1.chan7_scaled = packet_in.chan7_scaled; - packet1.chan8_scaled = packet_in.chan8_scaled; - packet1.port = packet_in.port; - packet1.rssi = packet_in.rssi; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.chan1_scaled = packet_in.chan1_scaled; + packet1.chan2_scaled = packet_in.chan2_scaled; + packet1.chan3_scaled = packet_in.chan3_scaled; + packet1.chan4_scaled = packet_in.chan4_scaled; + packet1.chan5_scaled = packet_in.chan5_scaled; + packet1.chan6_scaled = packet_in.chan6_scaled; + packet1.chan7_scaled = packet_in.chan7_scaled; + packet1.chan8_scaled = packet_in.chan8_scaled; + packet1.port = packet_in.port; + packet1.rssi = packet_in.rssi; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_rc_channels_scaled_decode(&msg, &packet2); + mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_rc_channels_scaled_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_scaled_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi ); - mavlink_msg_rc_channels_scaled_decode(&msg, &packet2); + mavlink_msg_rc_channels_scaled_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi ); + mavlink_msg_rc_channels_scaled_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi ); - mavlink_msg_rc_channels_scaled_decode(&msg, &packet2); + mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi ); + mavlink_msg_rc_channels_scaled_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_RAW >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_rc_channels_raw_t packet_in = { - 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132 + mavlink_rc_channels_raw_t packet_in = { + 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132 }; - mavlink_rc_channels_raw_t packet1, packet2; + mavlink_rc_channels_raw_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.chan1_raw = packet_in.chan1_raw; - packet1.chan2_raw = packet_in.chan2_raw; - packet1.chan3_raw = packet_in.chan3_raw; - packet1.chan4_raw = packet_in.chan4_raw; - packet1.chan5_raw = packet_in.chan5_raw; - packet1.chan6_raw = packet_in.chan6_raw; - packet1.chan7_raw = packet_in.chan7_raw; - packet1.chan8_raw = packet_in.chan8_raw; - packet1.port = packet_in.port; - packet1.rssi = packet_in.rssi; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.chan1_raw = packet_in.chan1_raw; + packet1.chan2_raw = packet_in.chan2_raw; + packet1.chan3_raw = packet_in.chan3_raw; + packet1.chan4_raw = packet_in.chan4_raw; + packet1.chan5_raw = packet_in.chan5_raw; + packet1.chan6_raw = packet_in.chan6_raw; + packet1.chan7_raw = packet_in.chan7_raw; + packet1.chan8_raw = packet_in.chan8_raw; + packet1.port = packet_in.port; + packet1.rssi = packet_in.rssi; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_rc_channels_raw_decode(&msg, &packet2); + mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_rc_channels_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_raw_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi ); - mavlink_msg_rc_channels_raw_decode(&msg, &packet2); + mavlink_msg_rc_channels_raw_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi ); + mavlink_msg_rc_channels_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi ); - mavlink_msg_rc_channels_raw_decode(&msg, &packet2); + mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi ); + mavlink_msg_rc_channels_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERVO_OUTPUT_RAW >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_servo_output_raw_t packet_in = { - 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65 + mavlink_servo_output_raw_t packet_in = { + 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65 }; - mavlink_servo_output_raw_t packet1, packet2; + mavlink_servo_output_raw_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.servo1_raw = packet_in.servo1_raw; - packet1.servo2_raw = packet_in.servo2_raw; - packet1.servo3_raw = packet_in.servo3_raw; - packet1.servo4_raw = packet_in.servo4_raw; - packet1.servo5_raw = packet_in.servo5_raw; - packet1.servo6_raw = packet_in.servo6_raw; - packet1.servo7_raw = packet_in.servo7_raw; - packet1.servo8_raw = packet_in.servo8_raw; - packet1.port = packet_in.port; + packet1.time_usec = packet_in.time_usec; + packet1.servo1_raw = packet_in.servo1_raw; + packet1.servo2_raw = packet_in.servo2_raw; + packet1.servo3_raw = packet_in.servo3_raw; + packet1.servo4_raw = packet_in.servo4_raw; + packet1.servo5_raw = packet_in.servo5_raw; + packet1.servo6_raw = packet_in.servo6_raw; + packet1.servo7_raw = packet_in.servo7_raw; + packet1.servo8_raw = packet_in.servo8_raw; + packet1.port = packet_in.port; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_servo_output_raw_decode(&msg, &packet2); + mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_servo_output_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw ); - mavlink_msg_servo_output_raw_decode(&msg, &packet2); + mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw ); + mavlink_msg_servo_output_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw ); - mavlink_msg_servo_output_raw_decode(&msg, &packet2); + mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw ); + mavlink_msg_servo_output_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_request_partial_list_t packet_in = { - 17235,17339,17,84 + mavlink_mission_request_partial_list_t packet_in = { + 17235,17339,17,84 }; - mavlink_mission_request_partial_list_t packet1, packet2; + mavlink_mission_request_partial_list_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.start_index = packet_in.start_index; - packet1.end_index = packet_in.end_index; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.start_index = packet_in.start_index; + packet1.end_index = packet_in.end_index; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_request_partial_list_decode(&msg, &packet2); + mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_request_partial_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); - mavlink_msg_mission_request_partial_list_decode(&msg, &packet2); + mavlink_msg_mission_request_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); + mavlink_msg_mission_request_partial_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); - mavlink_msg_mission_request_partial_list_decode(&msg, &packet2); + mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); + mavlink_msg_mission_request_partial_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_write_partial_list_t packet_in = { - 17235,17339,17,84 + mavlink_mission_write_partial_list_t packet_in = { + 17235,17339,17,84 }; - mavlink_mission_write_partial_list_t packet1, packet2; + mavlink_mission_write_partial_list_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.start_index = packet_in.start_index; - packet1.end_index = packet_in.end_index; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.start_index = packet_in.start_index; + packet1.end_index = packet_in.end_index; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_write_partial_list_decode(&msg, &packet2); + mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_write_partial_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_write_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); - mavlink_msg_mission_write_partial_list_decode(&msg, &packet2); + mavlink_msg_mission_write_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); + mavlink_msg_mission_write_partial_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); - mavlink_msg_mission_write_partial_list_decode(&msg, &packet2); + mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index ); + mavlink_msg_mission_write_partial_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_item_t packet_in = { - 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,18795,101,168,235,46,113 + mavlink_mission_item_t packet_in = { + 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,18795,101,168,235,46,113 }; - mavlink_mission_item_t packet1, packet2; + mavlink_mission_item_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param1 = packet_in.param1; - packet1.param2 = packet_in.param2; - packet1.param3 = packet_in.param3; - packet1.param4 = packet_in.param4; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.seq = packet_in.seq; - packet1.command = packet_in.command; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.frame = packet_in.frame; - packet1.current = packet_in.current; - packet1.autocontinue = packet_in.autocontinue; + packet1.param1 = packet_in.param1; + packet1.param2 = packet_in.param2; + packet1.param3 = packet_in.param3; + packet1.param4 = packet_in.param4; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.seq = packet_in.seq; + packet1.command = packet_in.command; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.frame = packet_in.frame; + packet1.current = packet_in.current; + packet1.autocontinue = packet_in.autocontinue; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_item_decode(&msg, &packet2); + mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_item_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); - mavlink_msg_mission_item_decode(&msg, &packet2); + mavlink_msg_mission_item_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); + mavlink_msg_mission_item_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); - mavlink_msg_mission_item_decode(&msg, &packet2); + mavlink_msg_mission_item_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); + mavlink_msg_mission_item_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_request_t packet_in = { - 17235,139,206 + mavlink_mission_request_t packet_in = { + 17235,139,206 }; - mavlink_mission_request_t packet1, packet2; + mavlink_mission_request_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.seq = packet_in.seq; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.seq = packet_in.seq; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_request_decode(&msg, &packet2); + mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq ); - mavlink_msg_mission_request_decode(&msg, &packet2); + mavlink_msg_mission_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq ); + mavlink_msg_mission_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq ); - mavlink_msg_mission_request_decode(&msg, &packet2); + mavlink_msg_mission_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq ); + mavlink_msg_mission_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_SET_CURRENT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_set_current_t packet_in = { - 17235,139,206 + mavlink_mission_set_current_t packet_in = { + 17235,139,206 }; - mavlink_mission_set_current_t packet1, packet2; + mavlink_mission_set_current_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.seq = packet_in.seq; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.seq = packet_in.seq; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_set_current_decode(&msg, &packet2); + mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_set_current_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_set_current_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq ); - mavlink_msg_mission_set_current_decode(&msg, &packet2); + mavlink_msg_mission_set_current_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq ); + mavlink_msg_mission_set_current_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq ); - mavlink_msg_mission_set_current_decode(&msg, &packet2); + mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq ); + mavlink_msg_mission_set_current_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CURRENT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_current_t packet_in = { - 17235 + mavlink_mission_current_t packet_in = { + 17235 }; - mavlink_mission_current_t packet1, packet2; + mavlink_mission_current_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.seq = packet_in.seq; + packet1.seq = packet_in.seq; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_current_decode(&msg, &packet2); + mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_current_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_current_pack(system_id, component_id, &msg , packet1.seq ); - mavlink_msg_mission_current_decode(&msg, &packet2); + mavlink_msg_mission_current_pack(system_id, component_id, &msg , packet1.seq ); + mavlink_msg_mission_current_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq ); - mavlink_msg_mission_current_decode(&msg, &packet2); + mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq ); + mavlink_msg_mission_current_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_LIST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_request_list_t packet_in = { - 5,72 + mavlink_mission_request_list_t packet_in = { + 5,72 }; - mavlink_mission_request_list_t packet1, packet2; + mavlink_mission_request_list_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_request_list_decode(&msg, &packet2); + mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_mission_request_list_decode(&msg, &packet2); + mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_mission_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_mission_request_list_decode(&msg, &packet2); + mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_mission_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_COUNT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_count_t packet_in = { - 17235,139,206 + mavlink_mission_count_t packet_in = { + 17235,139,206 }; - mavlink_mission_count_t packet1, packet2; + mavlink_mission_count_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.count = packet_in.count; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.count = packet_in.count; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_count_decode(&msg, &packet2); + mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_count_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_count_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.count ); - mavlink_msg_mission_count_decode(&msg, &packet2); + mavlink_msg_mission_count_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.count ); + mavlink_msg_mission_count_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_count_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.count ); - mavlink_msg_mission_count_decode(&msg, &packet2); + mavlink_msg_mission_count_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.count ); + mavlink_msg_mission_count_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CLEAR_ALL >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_clear_all_t packet_in = { - 5,72 + mavlink_mission_clear_all_t packet_in = { + 5,72 }; - mavlink_mission_clear_all_t packet1, packet2; + mavlink_mission_clear_all_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_clear_all_decode(&msg, &packet2); + mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_clear_all_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_mission_clear_all_decode(&msg, &packet2); + mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_mission_clear_all_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_mission_clear_all_decode(&msg, &packet2); + mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_mission_clear_all_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_REACHED >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_item_reached_t packet_in = { - 17235 + mavlink_mission_item_reached_t packet_in = { + 17235 }; - mavlink_mission_item_reached_t packet1, packet2; + mavlink_mission_item_reached_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.seq = packet_in.seq; + packet1.seq = packet_in.seq; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_item_reached_decode(&msg, &packet2); + mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_item_reached_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq ); - mavlink_msg_mission_item_reached_decode(&msg, &packet2); + mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq ); + mavlink_msg_mission_item_reached_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq ); - mavlink_msg_mission_item_reached_decode(&msg, &packet2); + mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq ); + mavlink_msg_mission_item_reached_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ACK >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_ack_t packet_in = { - 5,72,139 + mavlink_mission_ack_t packet_in = { + 5,72,139 }; - mavlink_mission_ack_t packet1, packet2; + mavlink_mission_ack_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.type = packet_in.type; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.type = packet_in.type; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_ack_decode(&msg, &packet2); + mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.type ); - mavlink_msg_mission_ack_decode(&msg, &packet2); + mavlink_msg_mission_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.type ); + mavlink_msg_mission_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.type ); - mavlink_msg_mission_ack_decode(&msg, &packet2); + mavlink_msg_mission_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.type ); + mavlink_msg_mission_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_set_gps_global_origin_t packet_in = { - 963497464,963497672,963497880,41 + mavlink_set_gps_global_origin_t packet_in = { + 963497464,963497672,963497880,41 }; - mavlink_set_gps_global_origin_t packet1, packet2; + mavlink_set_gps_global_origin_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.latitude = packet_in.latitude; - packet1.longitude = packet_in.longitude; - packet1.altitude = packet_in.altitude; - packet1.target_system = packet_in.target_system; + packet1.latitude = packet_in.latitude; + packet1.longitude = packet_in.longitude; + packet1.altitude = packet_in.altitude; + packet1.target_system = packet_in.target_system; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_set_gps_global_origin_decode(&msg, &packet2); + mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_gps_global_origin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude ); - mavlink_msg_set_gps_global_origin_decode(&msg, &packet2); + mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude ); + mavlink_msg_set_gps_global_origin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude ); - mavlink_msg_set_gps_global_origin_decode(&msg, &packet2); + mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude ); + mavlink_msg_set_gps_global_origin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_gps_global_origin_t packet_in = { - 963497464,963497672,963497880 + mavlink_gps_global_origin_t packet_in = { + 963497464,963497672,963497880 }; - mavlink_gps_global_origin_t packet1, packet2; + mavlink_gps_global_origin_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.latitude = packet_in.latitude; - packet1.longitude = packet_in.longitude; - packet1.altitude = packet_in.altitude; + packet1.latitude = packet_in.latitude; + packet1.longitude = packet_in.longitude; + packet1.altitude = packet_in.altitude; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_gps_global_origin_decode(&msg, &packet2); + mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_gps_global_origin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude ); - mavlink_msg_gps_global_origin_decode(&msg, &packet2); + mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude ); + mavlink_msg_gps_global_origin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude ); - mavlink_msg_gps_global_origin_decode(&msg, &packet2); + mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude ); + mavlink_msg_gps_global_origin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_MAP_RC >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_param_map_rc_t packet_in = { - 17.0,45.0,73.0,101.0,18067,187,254,"UVWXYZABCDEFGHI",113 + mavlink_param_map_rc_t packet_in = { + 17.0,45.0,73.0,101.0,18067,187,254,"UVWXYZABCDEFGHI",113 }; - mavlink_param_map_rc_t packet1, packet2; + mavlink_param_map_rc_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param_value0 = packet_in.param_value0; - packet1.scale = packet_in.scale; - packet1.param_value_min = packet_in.param_value_min; - packet1.param_value_max = packet_in.param_value_max; - packet1.param_index = packet_in.param_index; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index; + packet1.param_value0 = packet_in.param_value0; + packet1.scale = packet_in.scale; + packet1.param_value_min = packet_in.param_value_min; + packet1.param_value_max = packet_in.param_value_max; + packet1.param_index = packet_in.param_index; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index; - mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); + mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_param_map_rc_decode(&msg, &packet2); + mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_param_map_rc_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_map_rc_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max ); - mavlink_msg_param_map_rc_decode(&msg, &packet2); + mavlink_msg_param_map_rc_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max ); + mavlink_msg_param_map_rc_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_param_map_rc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max ); - mavlink_msg_param_map_rc_decode(&msg, &packet2); + mavlink_msg_param_map_rc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max ); + mavlink_msg_param_map_rc_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_request_int_t packet_in = { - 17235,139,206 + mavlink_mission_request_int_t packet_in = { + 17235,139,206 }; - mavlink_mission_request_int_t packet1, packet2; + mavlink_mission_request_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.seq = packet_in.seq; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.seq = packet_in.seq; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_request_int_decode(&msg, &packet2); + mavlink_msg_mission_request_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_request_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq ); - mavlink_msg_mission_request_int_decode(&msg, &packet2); + mavlink_msg_mission_request_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq ); + mavlink_msg_mission_request_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_request_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq ); - mavlink_msg_mission_request_int_decode(&msg, &packet2); + mavlink_msg_mission_request_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq ); + mavlink_msg_mission_request_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_safety_set_allowed_area_t packet_in = { - 17.0,45.0,73.0,101.0,129.0,157.0,77,144,211 + mavlink_safety_set_allowed_area_t packet_in = { + 17.0,45.0,73.0,101.0,129.0,157.0,77,144,211 }; - mavlink_safety_set_allowed_area_t packet1, packet2; + mavlink_safety_set_allowed_area_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.p1x = packet_in.p1x; - packet1.p1y = packet_in.p1y; - packet1.p1z = packet_in.p1z; - packet1.p2x = packet_in.p2x; - packet1.p2y = packet_in.p2y; - packet1.p2z = packet_in.p2z; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.frame = packet_in.frame; + packet1.p1x = packet_in.p1x; + packet1.p1y = packet_in.p1y; + packet1.p1z = packet_in.p1z; + packet1.p2x = packet_in.p2x; + packet1.p2y = packet_in.p2y; + packet1.p2z = packet_in.p2z; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.frame = packet_in.frame; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2); + mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); - mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2); + mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); + mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); - mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2); + mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); + mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_safety_allowed_area_t packet_in = { - 17.0,45.0,73.0,101.0,129.0,157.0,77 + mavlink_safety_allowed_area_t packet_in = { + 17.0,45.0,73.0,101.0,129.0,157.0,77 }; - mavlink_safety_allowed_area_t packet1, packet2; + mavlink_safety_allowed_area_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.p1x = packet_in.p1x; - packet1.p1y = packet_in.p1y; - packet1.p1z = packet_in.p1z; - packet1.p2x = packet_in.p2x; - packet1.p2y = packet_in.p2y; - packet1.p2z = packet_in.p2z; - packet1.frame = packet_in.frame; + packet1.p1x = packet_in.p1x; + packet1.p1y = packet_in.p1y; + packet1.p1z = packet_in.p1z; + packet1.p2x = packet_in.p2x; + packet1.p2y = packet_in.p2y; + packet1.p2z = packet_in.p2z; + packet1.frame = packet_in.frame; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_safety_allowed_area_decode(&msg, &packet2); + mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_safety_allowed_area_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_safety_allowed_area_pack(system_id, component_id, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); - mavlink_msg_safety_allowed_area_decode(&msg, &packet2); + mavlink_msg_safety_allowed_area_pack(system_id, component_id, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); + mavlink_msg_safety_allowed_area_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); - mavlink_msg_safety_allowed_area_decode(&msg, &packet2); + mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z ); + mavlink_msg_safety_allowed_area_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_attitude_quaternion_cov_t packet_in = { - 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0 } + mavlink_attitude_quaternion_cov_t packet_in = { + 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0 } }; - mavlink_attitude_quaternion_cov_t packet1, packet2; + mavlink_attitude_quaternion_cov_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.rollspeed = packet_in.rollspeed; - packet1.pitchspeed = packet_in.pitchspeed; - packet1.yawspeed = packet_in.yawspeed; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.rollspeed = packet_in.rollspeed; + packet1.pitchspeed = packet_in.pitchspeed; + packet1.yawspeed = packet_in.yawspeed; - mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); - mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9); + mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); + mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2); + mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance ); - mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2); + mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance ); + mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance ); - mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2); + mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance ); + mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_nav_controller_output_t packet_in = { - 17.0,45.0,73.0,101.0,129.0,18275,18379,18483 + mavlink_nav_controller_output_t packet_in = { + 17.0,45.0,73.0,101.0,129.0,18275,18379,18483 }; - mavlink_nav_controller_output_t packet1, packet2; + mavlink_nav_controller_output_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.nav_roll = packet_in.nav_roll; - packet1.nav_pitch = packet_in.nav_pitch; - packet1.alt_error = packet_in.alt_error; - packet1.aspd_error = packet_in.aspd_error; - packet1.xtrack_error = packet_in.xtrack_error; - packet1.nav_bearing = packet_in.nav_bearing; - packet1.target_bearing = packet_in.target_bearing; - packet1.wp_dist = packet_in.wp_dist; + packet1.nav_roll = packet_in.nav_roll; + packet1.nav_pitch = packet_in.nav_pitch; + packet1.alt_error = packet_in.alt_error; + packet1.aspd_error = packet_in.aspd_error; + packet1.xtrack_error = packet_in.xtrack_error; + packet1.nav_bearing = packet_in.nav_bearing; + packet1.target_bearing = packet_in.target_bearing; + packet1.wp_dist = packet_in.wp_dist; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_nav_controller_output_decode(&msg, &packet2); + mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_nav_controller_output_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_nav_controller_output_pack(system_id, component_id, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error ); - mavlink_msg_nav_controller_output_decode(&msg, &packet2); + mavlink_msg_nav_controller_output_pack(system_id, component_id, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error ); + mavlink_msg_nav_controller_output_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error ); - mavlink_msg_nav_controller_output_decode(&msg, &packet2); + mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error ); + mavlink_msg_nav_controller_output_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_global_position_int_cov_t packet_in = { - 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,213.0,241.0,269.0,{ 297.0, 298.0, 299.0, 300.0, 301.0, 302.0, 303.0, 304.0, 305.0, 306.0, 307.0, 308.0, 309.0, 310.0, 311.0, 312.0, 313.0, 314.0, 315.0, 316.0, 317.0, 318.0, 319.0, 320.0, 321.0, 322.0, 323.0, 324.0, 325.0, 326.0, 327.0, 328.0, 329.0, 330.0, 331.0, 332.0 },45 + mavlink_global_position_int_cov_t packet_in = { + 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,213.0,241.0,269.0,{ 297.0, 298.0, 299.0, 300.0, 301.0, 302.0, 303.0, 304.0, 305.0, 306.0, 307.0, 308.0, 309.0, 310.0, 311.0, 312.0, 313.0, 314.0, 315.0, 316.0, 317.0, 318.0, 319.0, 320.0, 321.0, 322.0, 323.0, 324.0, 325.0, 326.0, 327.0, 328.0, 329.0, 330.0, 331.0, 332.0 },45 }; - mavlink_global_position_int_cov_t packet1, packet2; + mavlink_global_position_int_cov_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_utc = packet_in.time_utc; - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.relative_alt = packet_in.relative_alt; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.estimator_type = packet_in.estimator_type; + packet1.time_utc = packet_in.time_utc; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.relative_alt = packet_in.relative_alt; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.estimator_type = packet_in.estimator_type; - mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*36); + mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*36); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_global_position_int_cov_decode(&msg, &packet2); + mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_global_position_int_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_position_int_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance ); - mavlink_msg_global_position_int_cov_decode(&msg, &packet2); + mavlink_msg_global_position_int_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance ); + mavlink_msg_global_position_int_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance ); - mavlink_msg_global_position_int_cov_decode(&msg, &packet2); + mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance ); + mavlink_msg_global_position_int_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_local_position_ned_cov_t packet_in = { - 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0, 360.0, 361.0, 362.0, 363.0, 364.0, 365.0, 366.0, 367.0, 368.0, 369.0, 370.0, 371.0, 372.0, 373.0, 374.0, 375.0, 376.0, 377.0, 378.0, 379.0, 380.0, 381.0, 382.0, 383.0, 384.0, 385.0, 386.0, 387.0, 388.0, 389.0, 390.0, 391.0, 392.0, 393.0, 394.0, 395.0, 396.0, 397.0 },177 + mavlink_local_position_ned_cov_t packet_in = { + 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0, 360.0, 361.0, 362.0, 363.0, 364.0, 365.0, 366.0, 367.0, 368.0, 369.0, 370.0, 371.0, 372.0, 373.0, 374.0, 375.0, 376.0, 377.0, 378.0, 379.0, 380.0, 381.0, 382.0, 383.0, 384.0, 385.0, 386.0, 387.0, 388.0, 389.0, 390.0, 391.0, 392.0, 393.0, 394.0, 395.0, 396.0, 397.0 },177 }; - mavlink_local_position_ned_cov_t packet1, packet2; + mavlink_local_position_ned_cov_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_utc = packet_in.time_utc; - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.ax = packet_in.ax; - packet1.ay = packet_in.ay; - packet1.az = packet_in.az; - packet1.estimator_type = packet_in.estimator_type; + packet1.time_utc = packet_in.time_utc; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.ax = packet_in.ax; + packet1.ay = packet_in.ay; + packet1.az = packet_in.az; + packet1.estimator_type = packet_in.estimator_type; - mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*45); + mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*45); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_local_position_ned_cov_decode(&msg, &packet2); + mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_local_position_ned_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance ); - mavlink_msg_local_position_ned_cov_decode(&msg, &packet2); + mavlink_msg_local_position_ned_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance ); + mavlink_msg_local_position_ned_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance ); - mavlink_msg_local_position_ned_cov_decode(&msg, &packet2); + mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance ); + mavlink_msg_local_position_ned_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_rc_channels_t packet_in = { + 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125,192 + }; + mavlink_rc_channels_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.chan1_raw = packet_in.chan1_raw; + packet1.chan2_raw = packet_in.chan2_raw; + packet1.chan3_raw = packet_in.chan3_raw; + packet1.chan4_raw = packet_in.chan4_raw; + packet1.chan5_raw = packet_in.chan5_raw; + packet1.chan6_raw = packet_in.chan6_raw; + packet1.chan7_raw = packet_in.chan7_raw; + packet1.chan8_raw = packet_in.chan8_raw; + packet1.chan9_raw = packet_in.chan9_raw; + packet1.chan10_raw = packet_in.chan10_raw; + packet1.chan11_raw = packet_in.chan11_raw; + packet1.chan12_raw = packet_in.chan12_raw; + packet1.chan13_raw = packet_in.chan13_raw; + packet1.chan14_raw = packet_in.chan14_raw; + packet1.chan15_raw = packet_in.chan15_raw; + packet1.chan16_raw = packet_in.chan16_raw; + packet1.chan17_raw = packet_in.chan17_raw; + packet1.chan18_raw = packet_in.chan18_raw; + packet1.chancount = packet_in.chancount; + packet1.rssi = packet_in.rssi; + + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_rc_channels_decode(&msg, &packet2); + mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_rc_channels_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi ); - mavlink_msg_rc_channels_decode(&msg, &packet2); + mavlink_msg_rc_channels_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi ); + mavlink_msg_rc_channels_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi ); - mavlink_msg_rc_channels_decode(&msg, &packet2); + mavlink_msg_rc_channels_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi ); + mavlink_msg_rc_channels_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REQUEST_DATA_STREAM >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_request_data_stream_t packet_in = { - 17235,139,206,17,84 + mavlink_request_data_stream_t packet_in = { + 17235,139,206,17,84 }; - mavlink_request_data_stream_t packet1, packet2; + mavlink_request_data_stream_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.req_message_rate = packet_in.req_message_rate; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.req_stream_id = packet_in.req_stream_id; - packet1.start_stop = packet_in.start_stop; + packet1.req_message_rate = packet_in.req_message_rate; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.req_stream_id = packet_in.req_stream_id; + packet1.start_stop = packet_in.start_stop; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_request_data_stream_decode(&msg, &packet2); + mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_request_data_stream_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_request_data_stream_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop ); - mavlink_msg_request_data_stream_decode(&msg, &packet2); + mavlink_msg_request_data_stream_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop ); + mavlink_msg_request_data_stream_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_request_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop ); - mavlink_msg_request_data_stream_decode(&msg, &packet2); + mavlink_msg_request_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop ); + mavlink_msg_request_data_stream_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_STREAM >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_data_stream_t packet_in = { - 17235,139,206 + mavlink_data_stream_t packet_in = { + 17235,139,206 }; - mavlink_data_stream_t packet1, packet2; + mavlink_data_stream_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.message_rate = packet_in.message_rate; - packet1.stream_id = packet_in.stream_id; - packet1.on_off = packet_in.on_off; + packet1.message_rate = packet_in.message_rate; + packet1.stream_id = packet_in.stream_id; + packet1.on_off = packet_in.on_off; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_data_stream_decode(&msg, &packet2); + mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_data_stream_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off ); - mavlink_msg_data_stream_decode(&msg, &packet2); + mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off ); + mavlink_msg_data_stream_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off ); - mavlink_msg_data_stream_decode(&msg, &packet2); + mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off ); + mavlink_msg_data_stream_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_CONTROL >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_manual_control_t packet_in = { - 17235,17339,17443,17547,17651,163 + mavlink_manual_control_t packet_in = { + 17235,17339,17443,17547,17651,163 }; - mavlink_manual_control_t packet1, packet2; + mavlink_manual_control_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.r = packet_in.r; - packet1.buttons = packet_in.buttons; - packet1.target = packet_in.target; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.r = packet_in.r; + packet1.buttons = packet_in.buttons; + packet1.target = packet_in.target; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_manual_control_decode(&msg, &packet2); + mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_manual_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons ); - mavlink_msg_manual_control_decode(&msg, &packet2); + mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons ); + mavlink_msg_manual_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons ); - mavlink_msg_manual_control_decode(&msg, &packet2); + mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons ); + mavlink_msg_manual_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_rc_channels_override_t packet_in = { - 17235,17339,17443,17547,17651,17755,17859,17963,53,120 + mavlink_rc_channels_override_t packet_in = { + 17235,17339,17443,17547,17651,17755,17859,17963,53,120 }; - mavlink_rc_channels_override_t packet1, packet2; + mavlink_rc_channels_override_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.chan1_raw = packet_in.chan1_raw; - packet1.chan2_raw = packet_in.chan2_raw; - packet1.chan3_raw = packet_in.chan3_raw; - packet1.chan4_raw = packet_in.chan4_raw; - packet1.chan5_raw = packet_in.chan5_raw; - packet1.chan6_raw = packet_in.chan6_raw; - packet1.chan7_raw = packet_in.chan7_raw; - packet1.chan8_raw = packet_in.chan8_raw; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.chan1_raw = packet_in.chan1_raw; + packet1.chan2_raw = packet_in.chan2_raw; + packet1.chan3_raw = packet_in.chan3_raw; + packet1.chan4_raw = packet_in.chan4_raw; + packet1.chan5_raw = packet_in.chan5_raw; + packet1.chan6_raw = packet_in.chan6_raw; + packet1.chan7_raw = packet_in.chan7_raw; + packet1.chan8_raw = packet_in.chan8_raw; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_rc_channels_override_decode(&msg, &packet2); + mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_rc_channels_override_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_override_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw ); - mavlink_msg_rc_channels_override_decode(&msg, &packet2); + mavlink_msg_rc_channels_override_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw ); + mavlink_msg_rc_channels_override_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw ); - mavlink_msg_rc_channels_override_decode(&msg, &packet2); + mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw ); + mavlink_msg_rc_channels_override_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_mission_item_int_t packet_in = { - 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113 + mavlink_mission_item_int_t packet_in = { + 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113 }; - mavlink_mission_item_int_t packet1, packet2; + mavlink_mission_item_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param1 = packet_in.param1; - packet1.param2 = packet_in.param2; - packet1.param3 = packet_in.param3; - packet1.param4 = packet_in.param4; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.seq = packet_in.seq; - packet1.command = packet_in.command; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.frame = packet_in.frame; - packet1.current = packet_in.current; - packet1.autocontinue = packet_in.autocontinue; + packet1.param1 = packet_in.param1; + packet1.param2 = packet_in.param2; + packet1.param3 = packet_in.param3; + packet1.param4 = packet_in.param4; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.seq = packet_in.seq; + packet1.command = packet_in.command; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.frame = packet_in.frame; + packet1.current = packet_in.current; + packet1.autocontinue = packet_in.autocontinue; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_mission_item_int_decode(&msg, &packet2); + mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_mission_item_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); - mavlink_msg_mission_item_int_decode(&msg, &packet2); + mavlink_msg_mission_item_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); + mavlink_msg_mission_item_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_mission_item_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); - mavlink_msg_mission_item_int_decode(&msg, &packet2); + mavlink_msg_mission_item_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); + mavlink_msg_mission_item_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VFR_HUD >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_vfr_hud_t packet_in = { - 17.0,45.0,73.0,101.0,18067,18171 + mavlink_vfr_hud_t packet_in = { + 17.0,45.0,73.0,101.0,18067,18171 }; - mavlink_vfr_hud_t packet1, packet2; + mavlink_vfr_hud_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.airspeed = packet_in.airspeed; - packet1.groundspeed = packet_in.groundspeed; - packet1.alt = packet_in.alt; - packet1.climb = packet_in.climb; - packet1.heading = packet_in.heading; - packet1.throttle = packet_in.throttle; + packet1.airspeed = packet_in.airspeed; + packet1.groundspeed = packet_in.groundspeed; + packet1.alt = packet_in.alt; + packet1.climb = packet_in.climb; + packet1.heading = packet_in.heading; + packet1.throttle = packet_in.throttle; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_VFR_HUD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VFR_HUD_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_vfr_hud_decode(&msg, &packet2); + mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_vfr_hud_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb ); - mavlink_msg_vfr_hud_decode(&msg, &packet2); + mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb ); + mavlink_msg_vfr_hud_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vfr_hud_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb ); - mavlink_msg_vfr_hud_decode(&msg, &packet2); + mavlink_msg_vfr_hud_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb ); + mavlink_msg_vfr_hud_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_command_int_t packet_in = { - 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235 + mavlink_command_int_t packet_in = { + 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235 }; - mavlink_command_int_t packet1, packet2; + mavlink_command_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param1 = packet_in.param1; - packet1.param2 = packet_in.param2; - packet1.param3 = packet_in.param3; - packet1.param4 = packet_in.param4; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.command = packet_in.command; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.frame = packet_in.frame; - packet1.current = packet_in.current; - packet1.autocontinue = packet_in.autocontinue; + packet1.param1 = packet_in.param1; + packet1.param2 = packet_in.param2; + packet1.param3 = packet_in.param3; + packet1.param4 = packet_in.param4; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.command = packet_in.command; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.frame = packet_in.frame; + packet1.current = packet_in.current; + packet1.autocontinue = packet_in.autocontinue; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_command_int_decode(&msg, &packet2); + mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_command_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); - mavlink_msg_command_int_decode(&msg, &packet2); + mavlink_msg_command_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); + mavlink_msg_command_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); - mavlink_msg_command_int_decode(&msg, &packet2); + mavlink_msg_command_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z ); + mavlink_msg_command_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_LONG >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_command_long_t packet_in = { - 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101 + mavlink_command_long_t packet_in = { + 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101 }; - mavlink_command_long_t packet1, packet2; + mavlink_command_long_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.param1 = packet_in.param1; - packet1.param2 = packet_in.param2; - packet1.param3 = packet_in.param3; - packet1.param4 = packet_in.param4; - packet1.param5 = packet_in.param5; - packet1.param6 = packet_in.param6; - packet1.param7 = packet_in.param7; - packet1.command = packet_in.command; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.confirmation = packet_in.confirmation; + packet1.param1 = packet_in.param1; + packet1.param2 = packet_in.param2; + packet1.param3 = packet_in.param3; + packet1.param4 = packet_in.param4; + packet1.param5 = packet_in.param5; + packet1.param6 = packet_in.param6; + packet1.param7 = packet_in.param7; + packet1.command = packet_in.command; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.confirmation = packet_in.confirmation; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_command_long_decode(&msg, &packet2); + mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_command_long_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_long_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 ); - mavlink_msg_command_long_decode(&msg, &packet2); + mavlink_msg_command_long_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 ); + mavlink_msg_command_long_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_long_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 ); - mavlink_msg_command_long_decode(&msg, &packet2); + mavlink_msg_command_long_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 ); + mavlink_msg_command_long_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_ACK >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_command_ack_t packet_in = { - 17235,139 + mavlink_command_ack_t packet_in = { + 17235,139 }; - mavlink_command_ack_t packet1, packet2; + mavlink_command_ack_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.command = packet_in.command; - packet1.result = packet_in.result; + packet1.command = packet_in.command; + packet1.result = packet_in.result; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_command_ack_decode(&msg, &packet2); + mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_command_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_ack_pack(system_id, component_id, &msg , packet1.command , packet1.result ); - mavlink_msg_command_ack_decode(&msg, &packet2); + mavlink_msg_command_ack_pack(system_id, component_id, &msg , packet1.command , packet1.result ); + mavlink_msg_command_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command , packet1.result ); - mavlink_msg_command_ack_decode(&msg, &packet2); + mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command , packet1.result ); + mavlink_msg_command_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_SETPOINT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_manual_setpoint_t packet_in = { - 963497464,45.0,73.0,101.0,129.0,65,132 + mavlink_manual_setpoint_t packet_in = { + 963497464,45.0,73.0,101.0,129.0,65,132 }; - mavlink_manual_setpoint_t packet1, packet2; + mavlink_manual_setpoint_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.roll = packet_in.roll; - packet1.pitch = packet_in.pitch; - packet1.yaw = packet_in.yaw; - packet1.thrust = packet_in.thrust; - packet1.mode_switch = packet_in.mode_switch; - packet1.manual_override_switch = packet_in.manual_override_switch; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; + packet1.thrust = packet_in.thrust; + packet1.mode_switch = packet_in.mode_switch; + packet1.manual_override_switch = packet_in.manual_override_switch; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_manual_setpoint_decode(&msg, &packet2); + mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_manual_setpoint_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_manual_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch ); - mavlink_msg_manual_setpoint_decode(&msg, &packet2); + mavlink_msg_manual_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch ); + mavlink_msg_manual_setpoint_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch ); - mavlink_msg_manual_setpoint_decode(&msg, &packet2); + mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch ); + mavlink_msg_manual_setpoint_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ATTITUDE_TARGET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_set_attitude_target_t packet_in = { - 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247 + mavlink_set_attitude_target_t packet_in = { + 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247 }; - mavlink_set_attitude_target_t packet1, packet2; + mavlink_set_attitude_target_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.body_roll_rate = packet_in.body_roll_rate; - packet1.body_pitch_rate = packet_in.body_pitch_rate; - packet1.body_yaw_rate = packet_in.body_yaw_rate; - packet1.thrust = packet_in.thrust; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.type_mask = packet_in.type_mask; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.body_roll_rate = packet_in.body_roll_rate; + packet1.body_pitch_rate = packet_in.body_pitch_rate; + packet1.body_yaw_rate = packet_in.body_yaw_rate; + packet1.thrust = packet_in.thrust; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.type_mask = packet_in.type_mask; - mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); + mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_set_attitude_target_decode(&msg, &packet2); + mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_attitude_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); - mavlink_msg_set_attitude_target_decode(&msg, &packet2); + mavlink_msg_set_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); + mavlink_msg_set_attitude_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); - mavlink_msg_set_attitude_target_decode(&msg, &packet2); + mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); + mavlink_msg_set_attitude_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_TARGET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_attitude_target_t packet_in = { - 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113 + mavlink_attitude_target_t packet_in = { + 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113 }; - mavlink_attitude_target_t packet1, packet2; + mavlink_attitude_target_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.body_roll_rate = packet_in.body_roll_rate; - packet1.body_pitch_rate = packet_in.body_pitch_rate; - packet1.body_yaw_rate = packet_in.body_yaw_rate; - packet1.thrust = packet_in.thrust; - packet1.type_mask = packet_in.type_mask; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.body_roll_rate = packet_in.body_roll_rate; + packet1.body_pitch_rate = packet_in.body_pitch_rate; + packet1.body_yaw_rate = packet_in.body_yaw_rate; + packet1.thrust = packet_in.thrust; + packet1.type_mask = packet_in.type_mask; - mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); + mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_attitude_target_decode(&msg, &packet2); + mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_attitude_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); - mavlink_msg_attitude_target_decode(&msg, &packet2); + mavlink_msg_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); + mavlink_msg_attitude_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); - mavlink_msg_attitude_target_decode(&msg, &packet2); + mavlink_msg_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust ); + mavlink_msg_attitude_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_set_position_target_local_ned_t packet_in = { - 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161 + mavlink_set_position_target_local_ned_t packet_in = { + 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161 }; - mavlink_set_position_target_local_ned_t packet1, packet2; + mavlink_set_position_target_local_ned_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.afx = packet_in.afx; - packet1.afy = packet_in.afy; - packet1.afz = packet_in.afz; - packet1.yaw = packet_in.yaw; - packet1.yaw_rate = packet_in.yaw_rate; - packet1.type_mask = packet_in.type_mask; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.coordinate_frame = packet_in.coordinate_frame; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.afx = packet_in.afx; + packet1.afy = packet_in.afy; + packet1.afz = packet_in.afz; + packet1.yaw = packet_in.yaw; + packet1.yaw_rate = packet_in.yaw_rate; + packet1.type_mask = packet_in.type_mask; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.coordinate_frame = packet_in.coordinate_frame; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2); + mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2); + mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2); + mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_position_target_local_ned_t packet_in = { - 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27 + mavlink_position_target_local_ned_t packet_in = { + 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27 }; - mavlink_position_target_local_ned_t packet1, packet2; + mavlink_position_target_local_ned_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.afx = packet_in.afx; - packet1.afy = packet_in.afy; - packet1.afz = packet_in.afz; - packet1.yaw = packet_in.yaw; - packet1.yaw_rate = packet_in.yaw_rate; - packet1.type_mask = packet_in.type_mask; - packet1.coordinate_frame = packet_in.coordinate_frame; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.afx = packet_in.afx; + packet1.afy = packet_in.afy; + packet1.afz = packet_in.afz; + packet1.yaw = packet_in.yaw; + packet1.yaw_rate = packet_in.yaw_rate; + packet1.type_mask = packet_in.type_mask; + packet1.coordinate_frame = packet_in.coordinate_frame; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_position_target_local_ned_decode(&msg, &packet2); + mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_position_target_local_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_position_target_local_ned_decode(&msg, &packet2); + mavlink_msg_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_position_target_local_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_position_target_local_ned_decode(&msg, &packet2); + mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_position_target_local_ned_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_set_position_target_global_int_t packet_in = { - 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161 + mavlink_set_position_target_global_int_t packet_in = { + 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161 }; - mavlink_set_position_target_global_int_t packet1, packet2; + mavlink_set_position_target_global_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.lat_int = packet_in.lat_int; - packet1.lon_int = packet_in.lon_int; - packet1.alt = packet_in.alt; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.afx = packet_in.afx; - packet1.afy = packet_in.afy; - packet1.afz = packet_in.afz; - packet1.yaw = packet_in.yaw; - packet1.yaw_rate = packet_in.yaw_rate; - packet1.type_mask = packet_in.type_mask; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.coordinate_frame = packet_in.coordinate_frame; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.lat_int = packet_in.lat_int; + packet1.lon_int = packet_in.lon_int; + packet1.alt = packet_in.alt; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.afx = packet_in.afx; + packet1.afy = packet_in.afy; + packet1.afz = packet_in.afz; + packet1.yaw = packet_in.yaw; + packet1.yaw_rate = packet_in.yaw_rate; + packet1.type_mask = packet_in.type_mask; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.coordinate_frame = packet_in.coordinate_frame; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_set_position_target_global_int_decode(&msg, &packet2); + mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_position_target_global_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_set_position_target_global_int_decode(&msg, &packet2); + mavlink_msg_set_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_set_position_target_global_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_set_position_target_global_int_decode(&msg, &packet2); + mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_set_position_target_global_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_position_target_global_int_t packet_in = { - 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27 + mavlink_position_target_global_int_t packet_in = { + 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27 }; - mavlink_position_target_global_int_t packet1, packet2; + mavlink_position_target_global_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.lat_int = packet_in.lat_int; - packet1.lon_int = packet_in.lon_int; - packet1.alt = packet_in.alt; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.afx = packet_in.afx; - packet1.afy = packet_in.afy; - packet1.afz = packet_in.afz; - packet1.yaw = packet_in.yaw; - packet1.yaw_rate = packet_in.yaw_rate; - packet1.type_mask = packet_in.type_mask; - packet1.coordinate_frame = packet_in.coordinate_frame; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.lat_int = packet_in.lat_int; + packet1.lon_int = packet_in.lon_int; + packet1.alt = packet_in.alt; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.afx = packet_in.afx; + packet1.afy = packet_in.afy; + packet1.afz = packet_in.afz; + packet1.yaw = packet_in.yaw; + packet1.yaw_rate = packet_in.yaw_rate; + packet1.type_mask = packet_in.type_mask; + packet1.coordinate_frame = packet_in.coordinate_frame; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_position_target_global_int_decode(&msg, &packet2); + mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_position_target_global_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_position_target_global_int_decode(&msg, &packet2); + mavlink_msg_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_position_target_global_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); - mavlink_msg_position_target_global_int_decode(&msg, &packet2); + mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate ); + mavlink_msg_position_target_global_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_local_position_ned_system_global_offset_t packet_in = { - 963497464,45.0,73.0,101.0,129.0,157.0,185.0 + mavlink_local_position_ned_system_global_offset_t packet_in = { + 963497464,45.0,73.0,101.0,129.0,157.0,185.0 }; - mavlink_local_position_ned_system_global_offset_t packet1, packet2; + mavlink_local_position_ned_system_global_offset_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.roll = packet_in.roll; - packet1.pitch = packet_in.pitch; - packet1.yaw = packet_in.yaw; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2); + mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2); + mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2); + mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_hil_state_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043 + mavlink_hil_state_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043 }; - mavlink_hil_state_t packet1, packet2; + mavlink_hil_state_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.roll = packet_in.roll; - packet1.pitch = packet_in.pitch; - packet1.yaw = packet_in.yaw; - packet1.rollspeed = packet_in.rollspeed; - packet1.pitchspeed = packet_in.pitchspeed; - packet1.yawspeed = packet_in.yawspeed; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; + packet1.time_usec = packet_in.time_usec; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; + packet1.rollspeed = packet_in.rollspeed; + packet1.pitchspeed = packet_in.pitchspeed; + packet1.yawspeed = packet_in.yawspeed; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIL_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_hil_state_decode(&msg, &packet2); + mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_hil_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc ); - mavlink_msg_hil_state_decode(&msg, &packet2); + mavlink_msg_hil_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc ); + mavlink_msg_hil_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc ); - mavlink_msg_hil_state_decode(&msg, &packet2); + mavlink_msg_hil_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc ); + mavlink_msg_hil_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_CONTROLS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_hil_controls_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192 + mavlink_hil_controls_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192 }; - mavlink_hil_controls_t packet1, packet2; + mavlink_hil_controls_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.roll_ailerons = packet_in.roll_ailerons; - packet1.pitch_elevator = packet_in.pitch_elevator; - packet1.yaw_rudder = packet_in.yaw_rudder; - packet1.throttle = packet_in.throttle; - packet1.aux1 = packet_in.aux1; - packet1.aux2 = packet_in.aux2; - packet1.aux3 = packet_in.aux3; - packet1.aux4 = packet_in.aux4; - packet1.mode = packet_in.mode; - packet1.nav_mode = packet_in.nav_mode; + packet1.time_usec = packet_in.time_usec; + packet1.roll_ailerons = packet_in.roll_ailerons; + packet1.pitch_elevator = packet_in.pitch_elevator; + packet1.yaw_rudder = packet_in.yaw_rudder; + packet1.throttle = packet_in.throttle; + packet1.aux1 = packet_in.aux1; + packet1.aux2 = packet_in.aux2; + packet1.aux3 = packet_in.aux3; + packet1.aux4 = packet_in.aux4; + packet1.mode = packet_in.mode; + packet1.nav_mode = packet_in.nav_mode; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_hil_controls_decode(&msg, &packet2); + mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_hil_controls_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode ); - mavlink_msg_hil_controls_decode(&msg, &packet2); + mavlink_msg_hil_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode ); + mavlink_msg_hil_controls_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode ); - mavlink_msg_hil_controls_decode(&msg, &packet2); + mavlink_msg_hil_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode ); + mavlink_msg_hil_controls_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_hil_rc_inputs_raw_t packet_in = { - 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101 + mavlink_hil_rc_inputs_raw_t packet_in = { + 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101 }; - mavlink_hil_rc_inputs_raw_t packet1, packet2; + mavlink_hil_rc_inputs_raw_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.chan1_raw = packet_in.chan1_raw; - packet1.chan2_raw = packet_in.chan2_raw; - packet1.chan3_raw = packet_in.chan3_raw; - packet1.chan4_raw = packet_in.chan4_raw; - packet1.chan5_raw = packet_in.chan5_raw; - packet1.chan6_raw = packet_in.chan6_raw; - packet1.chan7_raw = packet_in.chan7_raw; - packet1.chan8_raw = packet_in.chan8_raw; - packet1.chan9_raw = packet_in.chan9_raw; - packet1.chan10_raw = packet_in.chan10_raw; - packet1.chan11_raw = packet_in.chan11_raw; - packet1.chan12_raw = packet_in.chan12_raw; - packet1.rssi = packet_in.rssi; + packet1.time_usec = packet_in.time_usec; + packet1.chan1_raw = packet_in.chan1_raw; + packet1.chan2_raw = packet_in.chan2_raw; + packet1.chan3_raw = packet_in.chan3_raw; + packet1.chan4_raw = packet_in.chan4_raw; + packet1.chan5_raw = packet_in.chan5_raw; + packet1.chan6_raw = packet_in.chan6_raw; + packet1.chan7_raw = packet_in.chan7_raw; + packet1.chan8_raw = packet_in.chan8_raw; + packet1.chan9_raw = packet_in.chan9_raw; + packet1.chan10_raw = packet_in.chan10_raw; + packet1.chan11_raw = packet_in.chan11_raw; + packet1.chan12_raw = packet_in.chan12_raw; + packet1.rssi = packet_in.rssi; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2); + mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi ); - mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2); + mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi ); + mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi ); - mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2); + mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi ); + mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_optical_flow_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144 + mavlink_optical_flow_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144 }; - mavlink_optical_flow_t packet1, packet2; + mavlink_optical_flow_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.flow_comp_m_x = packet_in.flow_comp_m_x; - packet1.flow_comp_m_y = packet_in.flow_comp_m_y; - packet1.ground_distance = packet_in.ground_distance; - packet1.flow_x = packet_in.flow_x; - packet1.flow_y = packet_in.flow_y; - packet1.sensor_id = packet_in.sensor_id; - packet1.quality = packet_in.quality; + packet1.time_usec = packet_in.time_usec; + packet1.flow_comp_m_x = packet_in.flow_comp_m_x; + packet1.flow_comp_m_y = packet_in.flow_comp_m_y; + packet1.ground_distance = packet_in.ground_distance; + packet1.flow_x = packet_in.flow_x; + packet1.flow_y = packet_in.flow_y; + packet1.sensor_id = packet_in.sensor_id; + packet1.quality = packet_in.quality; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_optical_flow_decode(&msg, &packet2); + mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_optical_flow_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance ); - mavlink_msg_optical_flow_decode(&msg, &packet2); + mavlink_msg_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance ); + mavlink_msg_optical_flow_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance ); - mavlink_msg_optical_flow_decode(&msg, &packet2); + mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance ); + mavlink_msg_optical_flow_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_global_vision_position_estimate_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 + mavlink_global_vision_position_estimate_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 }; - mavlink_global_vision_position_estimate_t packet1, packet2; + mavlink_global_vision_position_estimate_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.usec = packet_in.usec; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.roll = packet_in.roll; - packet1.pitch = packet_in.pitch; - packet1.yaw = packet_in.yaw; + packet1.usec = packet_in.usec; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2); + mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2); + mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2); + mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_vision_position_estimate_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 + mavlink_vision_position_estimate_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 }; - mavlink_vision_position_estimate_t packet1, packet2; + mavlink_vision_position_estimate_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.usec = packet_in.usec; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.roll = packet_in.roll; - packet1.pitch = packet_in.pitch; - packet1.yaw = packet_in.yaw; + packet1.usec = packet_in.usec; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_vision_position_estimate_decode(&msg, &packet2); + mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_vision_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_vision_position_estimate_decode(&msg, &packet2); + mavlink_msg_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_vision_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_vision_position_estimate_decode(&msg, &packet2); + mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_vision_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_vision_speed_estimate_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0 + mavlink_vision_speed_estimate_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0 }; - mavlink_vision_speed_estimate_t packet1, packet2; + mavlink_vision_speed_estimate_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.usec = packet_in.usec; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; + packet1.usec = packet_in.usec; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_vision_speed_estimate_decode(&msg, &packet2); + mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_vision_speed_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z ); - mavlink_msg_vision_speed_estimate_decode(&msg, &packet2); + mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z ); + mavlink_msg_vision_speed_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z ); - mavlink_msg_vision_speed_estimate_decode(&msg, &packet2); + mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z ); + mavlink_msg_vision_speed_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_vicon_position_estimate_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 + mavlink_vicon_position_estimate_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 }; - mavlink_vicon_position_estimate_t packet1, packet2; + mavlink_vicon_position_estimate_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.usec = packet_in.usec; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.roll = packet_in.roll; - packet1.pitch = packet_in.pitch; - packet1.yaw = packet_in.yaw; + packet1.usec = packet_in.usec; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_vicon_position_estimate_decode(&msg, &packet2); + mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_vicon_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vicon_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_vicon_position_estimate_decode(&msg, &packet2); + mavlink_msg_vicon_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_vicon_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); - mavlink_msg_vicon_position_estimate_decode(&msg, &packet2); + mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw ); + mavlink_msg_vicon_position_estimate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGHRES_IMU >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_highres_imu_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,20355 + mavlink_highres_imu_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,20355 }; - mavlink_highres_imu_t packet1, packet2; + mavlink_highres_imu_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; - packet1.xgyro = packet_in.xgyro; - packet1.ygyro = packet_in.ygyro; - packet1.zgyro = packet_in.zgyro; - packet1.xmag = packet_in.xmag; - packet1.ymag = packet_in.ymag; - packet1.zmag = packet_in.zmag; - packet1.abs_pressure = packet_in.abs_pressure; - packet1.diff_pressure = packet_in.diff_pressure; - packet1.pressure_alt = packet_in.pressure_alt; - packet1.temperature = packet_in.temperature; - packet1.fields_updated = packet_in.fields_updated; + packet1.time_usec = packet_in.time_usec; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; + packet1.xgyro = packet_in.xgyro; + packet1.ygyro = packet_in.ygyro; + packet1.zgyro = packet_in.zgyro; + packet1.xmag = packet_in.xmag; + packet1.ymag = packet_in.ymag; + packet1.zmag = packet_in.zmag; + packet1.abs_pressure = packet_in.abs_pressure; + packet1.diff_pressure = packet_in.diff_pressure; + packet1.pressure_alt = packet_in.pressure_alt; + packet1.temperature = packet_in.temperature; + packet1.fields_updated = packet_in.fields_updated; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_highres_imu_decode(&msg, &packet2); + mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_highres_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); - mavlink_msg_highres_imu_decode(&msg, &packet2); + mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); + mavlink_msg_highres_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); - mavlink_msg_highres_imu_decode(&msg, &packet2); + mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); + mavlink_msg_highres_imu_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW_RAD >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_optical_flow_rad_t packet_in = { - 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70 + mavlink_optical_flow_rad_t packet_in = { + 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70 }; - mavlink_optical_flow_rad_t packet1, packet2; + mavlink_optical_flow_rad_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.integration_time_us = packet_in.integration_time_us; - packet1.integrated_x = packet_in.integrated_x; - packet1.integrated_y = packet_in.integrated_y; - packet1.integrated_xgyro = packet_in.integrated_xgyro; - packet1.integrated_ygyro = packet_in.integrated_ygyro; - packet1.integrated_zgyro = packet_in.integrated_zgyro; - packet1.time_delta_distance_us = packet_in.time_delta_distance_us; - packet1.distance = packet_in.distance; - packet1.temperature = packet_in.temperature; - packet1.sensor_id = packet_in.sensor_id; - packet1.quality = packet_in.quality; + packet1.time_usec = packet_in.time_usec; + packet1.integration_time_us = packet_in.integration_time_us; + packet1.integrated_x = packet_in.integrated_x; + packet1.integrated_y = packet_in.integrated_y; + packet1.integrated_xgyro = packet_in.integrated_xgyro; + packet1.integrated_ygyro = packet_in.integrated_ygyro; + packet1.integrated_zgyro = packet_in.integrated_zgyro; + packet1.time_delta_distance_us = packet_in.time_delta_distance_us; + packet1.distance = packet_in.distance; + packet1.temperature = packet_in.temperature; + packet1.sensor_id = packet_in.sensor_id; + packet1.quality = packet_in.quality; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_optical_flow_rad_decode(&msg, &packet2); + mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_optical_flow_rad_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_optical_flow_rad_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); - mavlink_msg_optical_flow_rad_decode(&msg, &packet2); + mavlink_msg_optical_flow_rad_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); + mavlink_msg_optical_flow_rad_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); - mavlink_msg_optical_flow_rad_decode(&msg, &packet2); + mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); + mavlink_msg_optical_flow_rad_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_SENSOR >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_hil_sensor_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,963500584 + mavlink_hil_sensor_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,963500584 }; - mavlink_hil_sensor_t packet1, packet2; + mavlink_hil_sensor_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; - packet1.xgyro = packet_in.xgyro; - packet1.ygyro = packet_in.ygyro; - packet1.zgyro = packet_in.zgyro; - packet1.xmag = packet_in.xmag; - packet1.ymag = packet_in.ymag; - packet1.zmag = packet_in.zmag; - packet1.abs_pressure = packet_in.abs_pressure; - packet1.diff_pressure = packet_in.diff_pressure; - packet1.pressure_alt = packet_in.pressure_alt; - packet1.temperature = packet_in.temperature; - packet1.fields_updated = packet_in.fields_updated; + packet1.time_usec = packet_in.time_usec; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; + packet1.xgyro = packet_in.xgyro; + packet1.ygyro = packet_in.ygyro; + packet1.zgyro = packet_in.zgyro; + packet1.xmag = packet_in.xmag; + packet1.ymag = packet_in.ymag; + packet1.zmag = packet_in.zmag; + packet1.abs_pressure = packet_in.abs_pressure; + packet1.diff_pressure = packet_in.diff_pressure; + packet1.pressure_alt = packet_in.pressure_alt; + packet1.temperature = packet_in.temperature; + packet1.fields_updated = packet_in.fields_updated; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_hil_sensor_decode(&msg, &packet2); + mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_hil_sensor_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_sensor_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); - mavlink_msg_hil_sensor_decode(&msg, &packet2); + mavlink_msg_hil_sensor_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); + mavlink_msg_hil_sensor_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); - mavlink_msg_hil_sensor_decode(&msg, &packet2); + mavlink_msg_hil_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated ); + mavlink_msg_hil_sensor_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SIM_STATE >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_sim_state_t packet_in = { + 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,465.0,493.0,521.0,549.0,577.0 + }; + mavlink_sim_state_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.q1 = packet_in.q1; + packet1.q2 = packet_in.q2; + packet1.q3 = packet_in.q3; + packet1.q4 = packet_in.q4; + packet1.roll = packet_in.roll; + packet1.pitch = packet_in.pitch; + packet1.yaw = packet_in.yaw; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; + packet1.xgyro = packet_in.xgyro; + packet1.ygyro = packet_in.ygyro; + packet1.zgyro = packet_in.zgyro; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.std_dev_horz = packet_in.std_dev_horz; + packet1.std_dev_vert = packet_in.std_dev_vert; + packet1.vn = packet_in.vn; + packet1.ve = packet_in.ve; + packet1.vd = packet_in.vd; + + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SIM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SIM_STATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sim_state_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_sim_state_decode(&msg, &packet2); + mavlink_msg_sim_state_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_sim_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sim_state_pack(system_id, component_id, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd ); - mavlink_msg_sim_state_decode(&msg, &packet2); + mavlink_msg_sim_state_pack(system_id, component_id, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd ); + mavlink_msg_sim_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_sim_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd ); - mavlink_msg_sim_state_decode(&msg, &packet2); + mavlink_msg_sim_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd ); + mavlink_msg_sim_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RADIO_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_radio_status_t packet_in = { - 17235,17339,17,84,151,218,29 + mavlink_radio_status_t packet_in = { + 17235,17339,17,84,151,218,29 }; - mavlink_radio_status_t packet1, packet2; + mavlink_radio_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.rxerrors = packet_in.rxerrors; - packet1.fixed = packet_in.fixed; - packet1.rssi = packet_in.rssi; - packet1.remrssi = packet_in.remrssi; - packet1.txbuf = packet_in.txbuf; - packet1.noise = packet_in.noise; - packet1.remnoise = packet_in.remnoise; + packet1.rxerrors = packet_in.rxerrors; + packet1.fixed = packet_in.fixed; + packet1.rssi = packet_in.rssi; + packet1.remrssi = packet_in.remrssi; + packet1.txbuf = packet_in.txbuf; + packet1.noise = packet_in.noise; + packet1.remnoise = packet_in.remnoise; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_radio_status_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_radio_status_decode(&msg, &packet2); + mavlink_msg_radio_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_radio_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_radio_status_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed ); - mavlink_msg_radio_status_decode(&msg, &packet2); + mavlink_msg_radio_status_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed ); + mavlink_msg_radio_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_radio_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed ); - mavlink_msg_radio_status_decode(&msg, &packet2); + mavlink_msg_radio_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed ); + mavlink_msg_radio_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_file_transfer_protocol_t packet_in = { - 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200 } + mavlink_file_transfer_protocol_t packet_in = { + 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200 } }; - mavlink_file_transfer_protocol_t packet1, packet2; + mavlink_file_transfer_protocol_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_network = packet_in.target_network; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.target_network = packet_in.target_network; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*251); + mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*251); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_file_transfer_protocol_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_file_transfer_protocol_decode(&msg, &packet2); + mavlink_msg_file_transfer_protocol_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_file_transfer_protocol_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_file_transfer_protocol_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload ); - mavlink_msg_file_transfer_protocol_decode(&msg, &packet2); + mavlink_msg_file_transfer_protocol_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload ); + mavlink_msg_file_transfer_protocol_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload ); - mavlink_msg_file_transfer_protocol_decode(&msg, &packet2); + mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload ); + mavlink_msg_file_transfer_protocol_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIMESYNC >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_timesync_t packet_in = { - 93372036854775807LL,93372036854776311LL + mavlink_timesync_t packet_in = { + 93372036854775807LL,93372036854776311LL }; - mavlink_timesync_t packet1, packet2; + mavlink_timesync_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.tc1 = packet_in.tc1; - packet1.ts1 = packet_in.ts1; + packet1.tc1 = packet_in.tc1; + packet1.ts1 = packet_in.ts1; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_TIMESYNC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TIMESYNC_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_timesync_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_timesync_decode(&msg, &packet2); + mavlink_msg_timesync_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_timesync_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_timesync_pack(system_id, component_id, &msg , packet1.tc1 , packet1.ts1 ); - mavlink_msg_timesync_decode(&msg, &packet2); + mavlink_msg_timesync_pack(system_id, component_id, &msg , packet1.tc1 , packet1.ts1 ); + mavlink_msg_timesync_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_timesync_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tc1 , packet1.ts1 ); - mavlink_msg_timesync_decode(&msg, &packet2); + mavlink_msg_timesync_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tc1 , packet1.ts1 ); + mavlink_msg_timesync_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRIGGER >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_camera_trigger_t packet_in = { - 93372036854775807ULL,963497880 + mavlink_camera_trigger_t packet_in = { + 93372036854775807ULL,963497880 }; - mavlink_camera_trigger_t packet1, packet2; + mavlink_camera_trigger_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.seq = packet_in.seq; + packet1.time_usec = packet_in.time_usec; + packet1.seq = packet_in.seq; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_camera_trigger_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_camera_trigger_decode(&msg, &packet2); + mavlink_msg_camera_trigger_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_camera_trigger_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_camera_trigger_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq ); - mavlink_msg_camera_trigger_decode(&msg, &packet2); + mavlink_msg_camera_trigger_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq ); + mavlink_msg_camera_trigger_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_camera_trigger_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq ); - mavlink_msg_camera_trigger_decode(&msg, &packet2); + mavlink_msg_camera_trigger_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq ); + mavlink_msg_camera_trigger_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_GPS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_hil_gps_t packet_in = { - 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,235,46 + mavlink_hil_gps_t packet_in = { + 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,235,46 }; - mavlink_hil_gps_t packet1, packet2; + mavlink_hil_gps_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.eph = packet_in.eph; - packet1.epv = packet_in.epv; - packet1.vel = packet_in.vel; - packet1.vn = packet_in.vn; - packet1.ve = packet_in.ve; - packet1.vd = packet_in.vd; - packet1.cog = packet_in.cog; - packet1.fix_type = packet_in.fix_type; - packet1.satellites_visible = packet_in.satellites_visible; + packet1.time_usec = packet_in.time_usec; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.eph = packet_in.eph; + packet1.epv = packet_in.epv; + packet1.vel = packet_in.vel; + packet1.vn = packet_in.vn; + packet1.ve = packet_in.ve; + packet1.vd = packet_in.vd; + packet1.cog = packet_in.cog; + packet1.fix_type = packet_in.fix_type; + packet1.satellites_visible = packet_in.satellites_visible; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIL_GPS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_GPS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_gps_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_hil_gps_decode(&msg, &packet2); + mavlink_msg_hil_gps_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_hil_gps_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_gps_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible ); - mavlink_msg_hil_gps_decode(&msg, &packet2); + mavlink_msg_hil_gps_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible ); + mavlink_msg_hil_gps_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_gps_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible ); - mavlink_msg_hil_gps_decode(&msg, &packet2); + mavlink_msg_hil_gps_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible ); + mavlink_msg_hil_gps_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_OPTICAL_FLOW >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_hil_optical_flow_t packet_in = { - 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70 + mavlink_hil_optical_flow_t packet_in = { + 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70 }; - mavlink_hil_optical_flow_t packet1, packet2; + mavlink_hil_optical_flow_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.integration_time_us = packet_in.integration_time_us; - packet1.integrated_x = packet_in.integrated_x; - packet1.integrated_y = packet_in.integrated_y; - packet1.integrated_xgyro = packet_in.integrated_xgyro; - packet1.integrated_ygyro = packet_in.integrated_ygyro; - packet1.integrated_zgyro = packet_in.integrated_zgyro; - packet1.time_delta_distance_us = packet_in.time_delta_distance_us; - packet1.distance = packet_in.distance; - packet1.temperature = packet_in.temperature; - packet1.sensor_id = packet_in.sensor_id; - packet1.quality = packet_in.quality; + packet1.time_usec = packet_in.time_usec; + packet1.integration_time_us = packet_in.integration_time_us; + packet1.integrated_x = packet_in.integrated_x; + packet1.integrated_y = packet_in.integrated_y; + packet1.integrated_xgyro = packet_in.integrated_xgyro; + packet1.integrated_ygyro = packet_in.integrated_ygyro; + packet1.integrated_zgyro = packet_in.integrated_zgyro; + packet1.time_delta_distance_us = packet_in.time_delta_distance_us; + packet1.distance = packet_in.distance; + packet1.temperature = packet_in.temperature; + packet1.sensor_id = packet_in.sensor_id; + packet1.quality = packet_in.quality; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_optical_flow_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_hil_optical_flow_decode(&msg, &packet2); + mavlink_msg_hil_optical_flow_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_hil_optical_flow_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); - mavlink_msg_hil_optical_flow_decode(&msg, &packet2); + mavlink_msg_hil_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); + mavlink_msg_hil_optical_flow_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); - mavlink_msg_hil_optical_flow_decode(&msg, &packet2); + mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance ); + mavlink_msg_hil_optical_flow_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE_QUATERNION >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_hil_state_quaternion_t packet_in = { - 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,963499336,963499544,963499752,19731,19835,19939,20043,20147,20251,20355,20459 + mavlink_hil_state_quaternion_t packet_in = { + 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,963499336,963499544,963499752,19731,19835,19939,20043,20147,20251,20355,20459 }; - mavlink_hil_state_quaternion_t packet1, packet2; + mavlink_hil_state_quaternion_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.rollspeed = packet_in.rollspeed; - packet1.pitchspeed = packet_in.pitchspeed; - packet1.yawspeed = packet_in.yawspeed; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.vx = packet_in.vx; - packet1.vy = packet_in.vy; - packet1.vz = packet_in.vz; - packet1.ind_airspeed = packet_in.ind_airspeed; - packet1.true_airspeed = packet_in.true_airspeed; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; + packet1.time_usec = packet_in.time_usec; + packet1.rollspeed = packet_in.rollspeed; + packet1.pitchspeed = packet_in.pitchspeed; + packet1.yawspeed = packet_in.yawspeed; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.vx = packet_in.vx; + packet1.vy = packet_in.vy; + packet1.vz = packet_in.vz; + packet1.ind_airspeed = packet_in.ind_airspeed; + packet1.true_airspeed = packet_in.true_airspeed; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; - mav_array_memcpy(packet1.attitude_quaternion, packet_in.attitude_quaternion, sizeof(float)*4); + mav_array_memcpy(packet1.attitude_quaternion, packet_in.attitude_quaternion, sizeof(float)*4); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_state_quaternion_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_hil_state_quaternion_decode(&msg, &packet2); + mavlink_msg_hil_state_quaternion_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_hil_state_quaternion_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_state_quaternion_pack(system_id, component_id, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc ); - mavlink_msg_hil_state_quaternion_decode(&msg, &packet2); + mavlink_msg_hil_state_quaternion_pack(system_id, component_id, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc ); + mavlink_msg_hil_state_quaternion_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc ); - mavlink_msg_hil_state_quaternion_decode(&msg, &packet2); + mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc ); + mavlink_msg_hil_state_quaternion_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU2 >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_scaled_imu2_t packet_in = { - 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275 + mavlink_scaled_imu2_t packet_in = { + 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275 }; - mavlink_scaled_imu2_t packet1, packet2; + mavlink_scaled_imu2_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; - packet1.xgyro = packet_in.xgyro; - packet1.ygyro = packet_in.ygyro; - packet1.zgyro = packet_in.zgyro; - packet1.xmag = packet_in.xmag; - packet1.ymag = packet_in.ymag; - packet1.zmag = packet_in.zmag; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; + packet1.xgyro = packet_in.xgyro; + packet1.ygyro = packet_in.ygyro; + packet1.zgyro = packet_in.zgyro; + packet1.xmag = packet_in.xmag; + packet1.ymag = packet_in.ymag; + packet1.zmag = packet_in.zmag; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu2_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_scaled_imu2_decode(&msg, &packet2); + mavlink_msg_scaled_imu2_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_scaled_imu2_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_scaled_imu2_decode(&msg, &packet2); + mavlink_msg_scaled_imu2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_scaled_imu2_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_scaled_imu2_decode(&msg, &packet2); + mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_scaled_imu2_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_LIST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_log_request_list_t packet_in = { - 17235,17339,17,84 + mavlink_log_request_list_t packet_in = { + 17235,17339,17,84 }; - mavlink_log_request_list_t packet1, packet2; + mavlink_log_request_list_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.start = packet_in.start; - packet1.end = packet_in.end; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.start = packet_in.start; + packet1.end = packet_in.end; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_list_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_log_request_list_decode(&msg, &packet2); + mavlink_msg_log_request_list_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_log_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end ); - mavlink_msg_log_request_list_decode(&msg, &packet2); + mavlink_msg_log_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end ); + mavlink_msg_log_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end ); - mavlink_msg_log_request_list_decode(&msg, &packet2); + mavlink_msg_log_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end ); + mavlink_msg_log_request_list_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ENTRY >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_log_entry_t packet_in = { - 963497464,963497672,17651,17755,17859 + mavlink_log_entry_t packet_in = { + 963497464,963497672,17651,17755,17859 }; - mavlink_log_entry_t packet1, packet2; + mavlink_log_entry_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_utc = packet_in.time_utc; - packet1.size = packet_in.size; - packet1.id = packet_in.id; - packet1.num_logs = packet_in.num_logs; - packet1.last_log_num = packet_in.last_log_num; + packet1.time_utc = packet_in.time_utc; + packet1.size = packet_in.size; + packet1.id = packet_in.id; + packet1.num_logs = packet_in.num_logs; + packet1.last_log_num = packet_in.last_log_num; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_entry_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_log_entry_decode(&msg, &packet2); + mavlink_msg_log_entry_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_log_entry_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_entry_pack(system_id, component_id, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size ); - mavlink_msg_log_entry_decode(&msg, &packet2); + mavlink_msg_log_entry_pack(system_id, component_id, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size ); + mavlink_msg_log_entry_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_entry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size ); - mavlink_msg_log_entry_decode(&msg, &packet2); + mavlink_msg_log_entry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size ); + mavlink_msg_log_entry_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_DATA >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_log_request_data_t packet_in = { - 963497464,963497672,17651,163,230 + mavlink_log_request_data_t packet_in = { + 963497464,963497672,17651,163,230 }; - mavlink_log_request_data_t packet1, packet2; + mavlink_log_request_data_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.ofs = packet_in.ofs; - packet1.count = packet_in.count; - packet1.id = packet_in.id; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.ofs = packet_in.ofs; + packet1.count = packet_in.count; + packet1.id = packet_in.id; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_data_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_log_request_data_decode(&msg, &packet2); + mavlink_msg_log_request_data_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_log_request_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count ); - mavlink_msg_log_request_data_decode(&msg, &packet2); + mavlink_msg_log_request_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count ); + mavlink_msg_log_request_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count ); - mavlink_msg_log_request_data_decode(&msg, &packet2); + mavlink_msg_log_request_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count ); + mavlink_msg_log_request_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_DATA >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_log_data_t packet_in = { - 963497464,17443,151,{ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 } + mavlink_log_data_t packet_in = { + 963497464,17443,151,{ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 } }; - mavlink_log_data_t packet1, packet2; + mavlink_log_data_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.ofs = packet_in.ofs; - packet1.id = packet_in.id; - packet1.count = packet_in.count; + packet1.ofs = packet_in.ofs; + packet1.id = packet_in.id; + packet1.count = packet_in.count; - mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*90); + mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*90); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOG_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_DATA_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_data_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_log_data_decode(&msg, &packet2); + mavlink_msg_log_data_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_log_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_data_pack(system_id, component_id, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data ); - mavlink_msg_log_data_decode(&msg, &packet2); + mavlink_msg_log_data_pack(system_id, component_id, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data ); + mavlink_msg_log_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data ); - mavlink_msg_log_data_decode(&msg, &packet2); + mavlink_msg_log_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data ); + mavlink_msg_log_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ERASE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_log_erase_t packet_in = { - 5,72 + mavlink_log_erase_t packet_in = { + 5,72 }; - mavlink_log_erase_t packet1, packet2; + mavlink_log_erase_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_erase_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_log_erase_decode(&msg, &packet2); + mavlink_msg_log_erase_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_log_erase_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_erase_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_log_erase_decode(&msg, &packet2); + mavlink_msg_log_erase_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_log_erase_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_log_erase_decode(&msg, &packet2); + mavlink_msg_log_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_log_erase_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_END >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_log_request_end_t packet_in = { - 5,72 + mavlink_log_request_end_t packet_in = { + 5,72 }; - mavlink_log_request_end_t packet1, packet2; + mavlink_log_request_end_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_end_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_log_request_end_decode(&msg, &packet2); + mavlink_msg_log_request_end_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_log_request_end_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_end_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_log_request_end_decode(&msg, &packet2); + mavlink_msg_log_request_end_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_log_request_end_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_log_request_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); - mavlink_msg_log_request_end_decode(&msg, &packet2); + mavlink_msg_log_request_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component ); + mavlink_msg_log_request_end_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INJECT_DATA >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_gps_inject_data_t packet_in = { - 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 } + mavlink_gps_inject_data_t packet_in = { + 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 } }; - mavlink_gps_inject_data_t packet1, packet2; + mavlink_gps_inject_data_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; - packet1.len = packet_in.len; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; + packet1.len = packet_in.len; - mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*110); + mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*110); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_inject_data_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_gps_inject_data_decode(&msg, &packet2); + mavlink_msg_gps_inject_data_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_gps_inject_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_inject_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data ); - mavlink_msg_gps_inject_data_decode(&msg, &packet2); + mavlink_msg_gps_inject_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data ); + mavlink_msg_gps_inject_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data ); - mavlink_msg_gps_inject_data_decode(&msg, &packet2); + mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data ); + mavlink_msg_gps_inject_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RAW >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_gps2_raw_t packet_in = { - 93372036854775807ULL,963497880,963498088,963498296,963498504,18483,18587,18691,18795,101,168,235 + mavlink_gps2_raw_t packet_in = { + 93372036854775807ULL,963497880,963498088,963498296,963498504,18483,18587,18691,18795,101,168,235 }; - mavlink_gps2_raw_t packet1, packet2; + mavlink_gps2_raw_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.dgps_age = packet_in.dgps_age; - packet1.eph = packet_in.eph; - packet1.epv = packet_in.epv; - packet1.vel = packet_in.vel; - packet1.cog = packet_in.cog; - packet1.fix_type = packet_in.fix_type; - packet1.satellites_visible = packet_in.satellites_visible; - packet1.dgps_numch = packet_in.dgps_numch; + packet1.time_usec = packet_in.time_usec; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.dgps_age = packet_in.dgps_age; + packet1.eph = packet_in.eph; + packet1.epv = packet_in.epv; + packet1.vel = packet_in.vel; + packet1.cog = packet_in.cog; + packet1.fix_type = packet_in.fix_type; + packet1.satellites_visible = packet_in.satellites_visible; + packet1.dgps_numch = packet_in.dgps_numch; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps2_raw_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_gps2_raw_decode(&msg, &packet2); + mavlink_msg_gps2_raw_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_gps2_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps2_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age ); - mavlink_msg_gps2_raw_decode(&msg, &packet2); + mavlink_msg_gps2_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age ); + mavlink_msg_gps2_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps2_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age ); - mavlink_msg_gps2_raw_decode(&msg, &packet2); + mavlink_msg_gps2_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age ); + mavlink_msg_gps2_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POWER_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_power_status_t packet_in = { - 17235,17339,17443 + mavlink_power_status_t packet_in = { + 17235,17339,17443 }; - mavlink_power_status_t packet1, packet2; + mavlink_power_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.Vcc = packet_in.Vcc; - packet1.Vservo = packet_in.Vservo; - packet1.flags = packet_in.flags; + packet1.Vcc = packet_in.Vcc; + packet1.Vservo = packet_in.Vservo; + packet1.flags = packet_in.flags; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_power_status_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_power_status_decode(&msg, &packet2); + mavlink_msg_power_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_power_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_power_status_pack(system_id, component_id, &msg , packet1.Vcc , packet1.Vservo , packet1.flags ); - mavlink_msg_power_status_decode(&msg, &packet2); + mavlink_msg_power_status_pack(system_id, component_id, &msg , packet1.Vcc , packet1.Vservo , packet1.flags ); + mavlink_msg_power_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_power_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.Vservo , packet1.flags ); - mavlink_msg_power_status_decode(&msg, &packet2); + mavlink_msg_power_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.Vservo , packet1.flags ); + mavlink_msg_power_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_CONTROL >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_serial_control_t packet_in = { - 963497464,17443,151,218,29,{ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165 } + mavlink_serial_control_t packet_in = { + 963497464,17443,151,218,29,{ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165 } }; - mavlink_serial_control_t packet1, packet2; + mavlink_serial_control_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.baudrate = packet_in.baudrate; - packet1.timeout = packet_in.timeout; - packet1.device = packet_in.device; - packet1.flags = packet_in.flags; - packet1.count = packet_in.count; + packet1.baudrate = packet_in.baudrate; + packet1.timeout = packet_in.timeout; + packet1.device = packet_in.device; + packet1.flags = packet_in.flags; + packet1.count = packet_in.count; - mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*70); + mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*70); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_serial_control_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_serial_control_decode(&msg, &packet2); + mavlink_msg_serial_control_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_serial_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_serial_control_pack(system_id, component_id, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data ); - mavlink_msg_serial_control_decode(&msg, &packet2); + mavlink_msg_serial_control_pack(system_id, component_id, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data ); + mavlink_msg_serial_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_serial_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data ); - mavlink_msg_serial_control_decode(&msg, &packet2); + mavlink_msg_serial_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data ); + mavlink_msg_serial_control_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTK >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_gps_rtk_t packet_in = { - 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235 + mavlink_gps_rtk_t packet_in = { + 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235 }; - mavlink_gps_rtk_t packet1, packet2; + mavlink_gps_rtk_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms; - packet1.tow = packet_in.tow; - packet1.baseline_a_mm = packet_in.baseline_a_mm; - packet1.baseline_b_mm = packet_in.baseline_b_mm; - packet1.baseline_c_mm = packet_in.baseline_c_mm; - packet1.accuracy = packet_in.accuracy; - packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses; - packet1.wn = packet_in.wn; - packet1.rtk_receiver_id = packet_in.rtk_receiver_id; - packet1.rtk_health = packet_in.rtk_health; - packet1.rtk_rate = packet_in.rtk_rate; - packet1.nsats = packet_in.nsats; - packet1.baseline_coords_type = packet_in.baseline_coords_type; + packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms; + packet1.tow = packet_in.tow; + packet1.baseline_a_mm = packet_in.baseline_a_mm; + packet1.baseline_b_mm = packet_in.baseline_b_mm; + packet1.baseline_c_mm = packet_in.baseline_c_mm; + packet1.accuracy = packet_in.accuracy; + packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses; + packet1.wn = packet_in.wn; + packet1.rtk_receiver_id = packet_in.rtk_receiver_id; + packet1.rtk_health = packet_in.rtk_health; + packet1.rtk_rate = packet_in.rtk_rate; + packet1.nsats = packet_in.nsats; + packet1.baseline_coords_type = packet_in.baseline_coords_type; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GPS_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTK_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_rtk_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_gps_rtk_decode(&msg, &packet2); + mavlink_msg_gps_rtk_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_gps_rtk_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); - mavlink_msg_gps_rtk_decode(&msg, &packet2); + mavlink_msg_gps_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); + mavlink_msg_gps_rtk_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); - mavlink_msg_gps_rtk_decode(&msg, &packet2); + mavlink_msg_gps_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); + mavlink_msg_gps_rtk_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RTK >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_gps2_rtk_t packet_in = { - 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235 + mavlink_gps2_rtk_t packet_in = { + 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235 }; - mavlink_gps2_rtk_t packet1, packet2; + mavlink_gps2_rtk_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms; - packet1.tow = packet_in.tow; - packet1.baseline_a_mm = packet_in.baseline_a_mm; - packet1.baseline_b_mm = packet_in.baseline_b_mm; - packet1.baseline_c_mm = packet_in.baseline_c_mm; - packet1.accuracy = packet_in.accuracy; - packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses; - packet1.wn = packet_in.wn; - packet1.rtk_receiver_id = packet_in.rtk_receiver_id; - packet1.rtk_health = packet_in.rtk_health; - packet1.rtk_rate = packet_in.rtk_rate; - packet1.nsats = packet_in.nsats; - packet1.baseline_coords_type = packet_in.baseline_coords_type; + packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms; + packet1.tow = packet_in.tow; + packet1.baseline_a_mm = packet_in.baseline_a_mm; + packet1.baseline_b_mm = packet_in.baseline_b_mm; + packet1.baseline_c_mm = packet_in.baseline_c_mm; + packet1.accuracy = packet_in.accuracy; + packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses; + packet1.wn = packet_in.wn; + packet1.rtk_receiver_id = packet_in.rtk_receiver_id; + packet1.rtk_health = packet_in.rtk_health; + packet1.rtk_rate = packet_in.rtk_rate; + packet1.nsats = packet_in.nsats; + packet1.baseline_coords_type = packet_in.baseline_coords_type; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps2_rtk_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_gps2_rtk_decode(&msg, &packet2); + mavlink_msg_gps2_rtk_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_gps2_rtk_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps2_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); - mavlink_msg_gps2_rtk_decode(&msg, &packet2); + mavlink_msg_gps2_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); + mavlink_msg_gps2_rtk_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); - mavlink_msg_gps2_rtk_decode(&msg, &packet2); + mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses ); + mavlink_msg_gps2_rtk_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU3 >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_scaled_imu3_t packet_in = { - 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275 + mavlink_scaled_imu3_t packet_in = { + 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275 }; - mavlink_scaled_imu3_t packet1, packet2; + mavlink_scaled_imu3_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.xacc = packet_in.xacc; - packet1.yacc = packet_in.yacc; - packet1.zacc = packet_in.zacc; - packet1.xgyro = packet_in.xgyro; - packet1.ygyro = packet_in.ygyro; - packet1.zgyro = packet_in.zgyro; - packet1.xmag = packet_in.xmag; - packet1.ymag = packet_in.ymag; - packet1.zmag = packet_in.zmag; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.xacc = packet_in.xacc; + packet1.yacc = packet_in.yacc; + packet1.zacc = packet_in.zacc; + packet1.xgyro = packet_in.xgyro; + packet1.ygyro = packet_in.ygyro; + packet1.zgyro = packet_in.zgyro; + packet1.xmag = packet_in.xmag; + packet1.ymag = packet_in.ymag; + packet1.zmag = packet_in.zmag; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu3_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_scaled_imu3_decode(&msg, &packet2); + mavlink_msg_scaled_imu3_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_scaled_imu3_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_scaled_imu3_decode(&msg, &packet2); + mavlink_msg_scaled_imu3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_scaled_imu3_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); - mavlink_msg_scaled_imu3_decode(&msg, &packet2); + mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag ); + mavlink_msg_scaled_imu3_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_data_transmission_handshake_t packet_in = { - 963497464,17443,17547,17651,163,230,41 + mavlink_data_transmission_handshake_t packet_in = { + 963497464,17443,17547,17651,163,230,41 }; - mavlink_data_transmission_handshake_t packet1, packet2; + mavlink_data_transmission_handshake_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.size = packet_in.size; - packet1.width = packet_in.width; - packet1.height = packet_in.height; - packet1.packets = packet_in.packets; - packet1.type = packet_in.type; - packet1.payload = packet_in.payload; - packet1.jpg_quality = packet_in.jpg_quality; + packet1.size = packet_in.size; + packet1.width = packet_in.width; + packet1.height = packet_in.height; + packet1.packets = packet_in.packets; + packet1.type = packet_in.type; + packet1.payload = packet_in.payload; + packet1.jpg_quality = packet_in.jpg_quality; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_data_transmission_handshake_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_data_transmission_handshake_decode(&msg, &packet2); + mavlink_msg_data_transmission_handshake_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_data_transmission_handshake_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_data_transmission_handshake_pack(system_id, component_id, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality ); - mavlink_msg_data_transmission_handshake_decode(&msg, &packet2); + mavlink_msg_data_transmission_handshake_pack(system_id, component_id, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality ); + mavlink_msg_data_transmission_handshake_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality ); - mavlink_msg_data_transmission_handshake_decode(&msg, &packet2); + mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality ); + mavlink_msg_data_transmission_handshake_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ENCAPSULATED_DATA >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_encapsulated_data_t packet_in = { - 17235,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 } + mavlink_encapsulated_data_t packet_in = { + 17235,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 } }; - mavlink_encapsulated_data_t packet1, packet2; + mavlink_encapsulated_data_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.seqnr = packet_in.seqnr; + packet1.seqnr = packet_in.seqnr; - mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*253); + mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*253); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_encapsulated_data_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_encapsulated_data_decode(&msg, &packet2); + mavlink_msg_encapsulated_data_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_encapsulated_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_encapsulated_data_pack(system_id, component_id, &msg , packet1.seqnr , packet1.data ); - mavlink_msg_encapsulated_data_decode(&msg, &packet2); + mavlink_msg_encapsulated_data_pack(system_id, component_id, &msg , packet1.seqnr , packet1.data ); + mavlink_msg_encapsulated_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seqnr , packet1.data ); - mavlink_msg_encapsulated_data_decode(&msg, &packet2); + mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seqnr , packet1.data ); + mavlink_msg_encapsulated_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DISTANCE_SENSOR >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_distance_sensor_t packet_in = { - 963497464,17443,17547,17651,163,230,41,108 + mavlink_distance_sensor_t packet_in = { + 963497464,17443,17547,17651,163,230,41,108 }; - mavlink_distance_sensor_t packet1, packet2; + mavlink_distance_sensor_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.min_distance = packet_in.min_distance; - packet1.max_distance = packet_in.max_distance; - packet1.current_distance = packet_in.current_distance; - packet1.type = packet_in.type; - packet1.id = packet_in.id; - packet1.orientation = packet_in.orientation; - packet1.covariance = packet_in.covariance; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.min_distance = packet_in.min_distance; + packet1.max_distance = packet_in.max_distance; + packet1.current_distance = packet_in.current_distance; + packet1.type = packet_in.type; + packet1.id = packet_in.id; + packet1.orientation = packet_in.orientation; + packet1.covariance = packet_in.covariance; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_distance_sensor_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_distance_sensor_decode(&msg, &packet2); + mavlink_msg_distance_sensor_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_distance_sensor_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance ); - mavlink_msg_distance_sensor_decode(&msg, &packet2); + mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance ); + mavlink_msg_distance_sensor_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance ); - mavlink_msg_distance_sensor_decode(&msg, &packet2); + mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance ); + mavlink_msg_distance_sensor_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REQUEST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_terrain_request_t packet_in = { - 93372036854775807ULL,963497880,963498088,18067 + mavlink_terrain_request_t packet_in = { + 93372036854775807ULL,963497880,963498088,18067 }; - mavlink_terrain_request_t packet1, packet2; + mavlink_terrain_request_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.mask = packet_in.mask; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.grid_spacing = packet_in.grid_spacing; + packet1.mask = packet_in.mask; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.grid_spacing = packet_in.grid_spacing; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_terrain_request_decode(&msg, &packet2); + mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_terrain_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask ); - mavlink_msg_terrain_request_decode(&msg, &packet2); + mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask ); + mavlink_msg_terrain_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask ); - mavlink_msg_terrain_request_decode(&msg, &packet2); + mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask ); + mavlink_msg_terrain_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_DATA >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_terrain_data_t packet_in = { - 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },3 + mavlink_terrain_data_t packet_in = { + 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },3 }; - mavlink_terrain_data_t packet1, packet2; + mavlink_terrain_data_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.grid_spacing = packet_in.grid_spacing; - packet1.gridbit = packet_in.gridbit; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.grid_spacing = packet_in.grid_spacing; + packet1.gridbit = packet_in.gridbit; - mav_array_memcpy(packet1.data, packet_in.data, sizeof(int16_t)*16); + mav_array_memcpy(packet1.data, packet_in.data, sizeof(int16_t)*16); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_terrain_data_decode(&msg, &packet2); + mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_terrain_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data ); - mavlink_msg_terrain_data_decode(&msg, &packet2); + mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data ); + mavlink_msg_terrain_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data ); - mavlink_msg_terrain_data_decode(&msg, &packet2); + mavlink_msg_terrain_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data ); + mavlink_msg_terrain_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_CHECK >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_terrain_check_t packet_in = { - 963497464,963497672 + mavlink_terrain_check_t packet_in = { + 963497464,963497672 }; - mavlink_terrain_check_t packet1, packet2; + mavlink_terrain_check_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_terrain_check_decode(&msg, &packet2); + mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_terrain_check_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon ); - mavlink_msg_terrain_check_decode(&msg, &packet2); + mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon ); + mavlink_msg_terrain_check_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon ); - mavlink_msg_terrain_check_decode(&msg, &packet2); + mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon ); + mavlink_msg_terrain_check_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REPORT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_terrain_report_t packet_in = { - 963497464,963497672,73.0,101.0,18067,18171,18275 + mavlink_terrain_report_t packet_in = { + 963497464,963497672,73.0,101.0,18067,18171,18275 }; - mavlink_terrain_report_t packet1, packet2; + mavlink_terrain_report_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.terrain_height = packet_in.terrain_height; - packet1.current_height = packet_in.current_height; - packet1.spacing = packet_in.spacing; - packet1.pending = packet_in.pending; - packet1.loaded = packet_in.loaded; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.terrain_height = packet_in.terrain_height; + packet1.current_height = packet_in.current_height; + packet1.spacing = packet_in.spacing; + packet1.pending = packet_in.pending; + packet1.loaded = packet_in.loaded; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_terrain_report_decode(&msg, &packet2); + mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_terrain_report_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_report_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded ); - mavlink_msg_terrain_report_decode(&msg, &packet2); + mavlink_msg_terrain_report_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded ); + mavlink_msg_terrain_report_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_terrain_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded ); - mavlink_msg_terrain_report_decode(&msg, &packet2); + mavlink_msg_terrain_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded ); + mavlink_msg_terrain_report_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE2 >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_scaled_pressure2_t packet_in = { - 963497464,45.0,73.0,17859 + mavlink_scaled_pressure2_t packet_in = { + 963497464,45.0,73.0,17859 }; - mavlink_scaled_pressure2_t packet1, packet2; + mavlink_scaled_pressure2_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.press_abs = packet_in.press_abs; - packet1.press_diff = packet_in.press_diff; - packet1.temperature = packet_in.temperature; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.press_abs = packet_in.press_abs; + packet1.press_diff = packet_in.press_diff; + packet1.temperature = packet_in.temperature; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure2_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_scaled_pressure2_decode(&msg, &packet2); + mavlink_msg_scaled_pressure2_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_scaled_pressure2_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); - mavlink_msg_scaled_pressure2_decode(&msg, &packet2); + mavlink_msg_scaled_pressure2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); + mavlink_msg_scaled_pressure2_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); - mavlink_msg_scaled_pressure2_decode(&msg, &packet2); + mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); + mavlink_msg_scaled_pressure2_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATT_POS_MOCAP >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_att_pos_mocap_t packet_in = { - 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0 + mavlink_att_pos_mocap_t packet_in = { + 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0 }; - mavlink_att_pos_mocap_t packet1, packet2; + mavlink_att_pos_mocap_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; + packet1.time_usec = packet_in.time_usec; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; - mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); + mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_att_pos_mocap_decode(&msg, &packet2); + mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_att_pos_mocap_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z ); - mavlink_msg_att_pos_mocap_decode(&msg, &packet2); + mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z ); + mavlink_msg_att_pos_mocap_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z ); - mavlink_msg_att_pos_mocap_decode(&msg, &packet2); + mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z ); + mavlink_msg_att_pos_mocap_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_set_actuator_control_target_t packet_in = { - 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3 + mavlink_set_actuator_control_target_t packet_in = { + 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3 }; - mavlink_set_actuator_control_target_t packet1, packet2; + mavlink_set_actuator_control_target_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.group_mlx = packet_in.group_mlx; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.time_usec = packet_in.time_usec; + packet1.group_mlx = packet_in.group_mlx; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8); + mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_set_actuator_control_target_decode(&msg, &packet2); + mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_actuator_control_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls ); - mavlink_msg_set_actuator_control_target_decode(&msg, &packet2); + mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls ); + mavlink_msg_set_actuator_control_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls ); - mavlink_msg_set_actuator_control_target_decode(&msg, &packet2); + mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls ); + mavlink_msg_set_actuator_control_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_actuator_control_target_t packet_in = { - 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125 + mavlink_actuator_control_target_t packet_in = { + 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125 }; - mavlink_actuator_control_target_t packet1, packet2; + mavlink_actuator_control_target_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.group_mlx = packet_in.group_mlx; + packet1.time_usec = packet_in.time_usec; + packet1.group_mlx = packet_in.group_mlx; - mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8); + mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_actuator_control_target_decode(&msg, &packet2); + mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_actuator_control_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls ); - mavlink_msg_actuator_control_target_decode(&msg, &packet2); + mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls ); + mavlink_msg_actuator_control_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls ); - mavlink_msg_actuator_control_target_decode(&msg, &packet2); + mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls ); + mavlink_msg_actuator_control_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ALTITUDE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_altitude_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 + mavlink_altitude_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0 }; - mavlink_altitude_t packet1, packet2; + mavlink_altitude_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.altitude_monotonic = packet_in.altitude_monotonic; - packet1.altitude_amsl = packet_in.altitude_amsl; - packet1.altitude_local = packet_in.altitude_local; - packet1.altitude_relative = packet_in.altitude_relative; - packet1.altitude_terrain = packet_in.altitude_terrain; - packet1.bottom_clearance = packet_in.bottom_clearance; + packet1.time_usec = packet_in.time_usec; + packet1.altitude_monotonic = packet_in.altitude_monotonic; + packet1.altitude_amsl = packet_in.altitude_amsl; + packet1.altitude_local = packet_in.altitude_local; + packet1.altitude_relative = packet_in.altitude_relative; + packet1.altitude_terrain = packet_in.altitude_terrain; + packet1.bottom_clearance = packet_in.bottom_clearance; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ALTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ALTITUDE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_altitude_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_altitude_decode(&msg, &packet2); + mavlink_msg_altitude_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_altitude_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_altitude_pack(system_id, component_id, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance ); - mavlink_msg_altitude_decode(&msg, &packet2); + mavlink_msg_altitude_pack(system_id, component_id, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance ); + mavlink_msg_altitude_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_altitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance ); - mavlink_msg_altitude_decode(&msg, &packet2); + mavlink_msg_altitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance ); + mavlink_msg_altitude_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RESOURCE_REQUEST >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_resource_request_t packet_in = { - 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2 },243,{ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173 } + mavlink_resource_request_t packet_in = { + 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2 },243,{ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173 } }; - mavlink_resource_request_t packet1, packet2; + mavlink_resource_request_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.request_id = packet_in.request_id; - packet1.uri_type = packet_in.uri_type; - packet1.transfer_type = packet_in.transfer_type; + packet1.request_id = packet_in.request_id; + packet1.uri_type = packet_in.uri_type; + packet1.transfer_type = packet_in.transfer_type; - mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(uint8_t)*120); - mav_array_memcpy(packet1.storage, packet_in.storage, sizeof(uint8_t)*120); + mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(uint8_t)*120); + mav_array_memcpy(packet1.storage, packet_in.storage, sizeof(uint8_t)*120); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_resource_request_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_resource_request_decode(&msg, &packet2); + mavlink_msg_resource_request_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_resource_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_resource_request_pack(system_id, component_id, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage ); - mavlink_msg_resource_request_decode(&msg, &packet2); + mavlink_msg_resource_request_pack(system_id, component_id, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage ); + mavlink_msg_resource_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_resource_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage ); - mavlink_msg_resource_request_decode(&msg, &packet2); + mavlink_msg_resource_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage ); + mavlink_msg_resource_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE3 >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_scaled_pressure3_t packet_in = { - 963497464,45.0,73.0,17859 + mavlink_scaled_pressure3_t packet_in = { + 963497464,45.0,73.0,17859 }; - mavlink_scaled_pressure3_t packet1, packet2; + mavlink_scaled_pressure3_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.press_abs = packet_in.press_abs; - packet1.press_diff = packet_in.press_diff; - packet1.temperature = packet_in.temperature; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.press_abs = packet_in.press_abs; + packet1.press_diff = packet_in.press_diff; + packet1.temperature = packet_in.temperature; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure3_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_scaled_pressure3_decode(&msg, &packet2); + mavlink_msg_scaled_pressure3_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_scaled_pressure3_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); - mavlink_msg_scaled_pressure3_decode(&msg, &packet2); + mavlink_msg_scaled_pressure3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); + mavlink_msg_scaled_pressure3_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); - mavlink_msg_scaled_pressure3_decode(&msg, &packet2); + mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature ); + mavlink_msg_scaled_pressure3_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FOLLOW_TARGET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_follow_target_t packet_in = { - 93372036854775807ULL,93372036854776311ULL,963498296,963498504,185.0,{ 213.0, 214.0, 215.0 },{ 297.0, 298.0, 299.0 },{ 381.0, 382.0, 383.0, 384.0 },{ 493.0, 494.0, 495.0 },{ 577.0, 578.0, 579.0 },25 + mavlink_follow_target_t packet_in = { + 93372036854775807ULL,93372036854776311ULL,963498296,963498504,185.0,{ 213.0, 214.0, 215.0 },{ 297.0, 298.0, 299.0 },{ 381.0, 382.0, 383.0, 384.0 },{ 493.0, 494.0, 495.0 },{ 577.0, 578.0, 579.0 },25 }; - mavlink_follow_target_t packet1, packet2; + mavlink_follow_target_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.timestamp = packet_in.timestamp; - packet1.custom_state = packet_in.custom_state; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.alt = packet_in.alt; - packet1.est_capabilities = packet_in.est_capabilities; + packet1.timestamp = packet_in.timestamp; + packet1.custom_state = packet_in.custom_state; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.alt = packet_in.alt; + packet1.est_capabilities = packet_in.est_capabilities; - mav_array_memcpy(packet1.vel, packet_in.vel, sizeof(float)*3); - mav_array_memcpy(packet1.acc, packet_in.acc, sizeof(float)*3); - mav_array_memcpy(packet1.attitude_q, packet_in.attitude_q, sizeof(float)*4); - mav_array_memcpy(packet1.rates, packet_in.rates, sizeof(float)*3); - mav_array_memcpy(packet1.position_cov, packet_in.position_cov, sizeof(float)*3); + mav_array_memcpy(packet1.vel, packet_in.vel, sizeof(float)*3); + mav_array_memcpy(packet1.acc, packet_in.acc, sizeof(float)*3); + mav_array_memcpy(packet1.attitude_q, packet_in.attitude_q, sizeof(float)*4); + mav_array_memcpy(packet1.rates, packet_in.rates, sizeof(float)*3); + mav_array_memcpy(packet1.position_cov, packet_in.position_cov, sizeof(float)*3); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_follow_target_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_follow_target_decode(&msg, &packet2); + mavlink_msg_follow_target_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_follow_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_follow_target_pack(system_id, component_id, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state ); - mavlink_msg_follow_target_decode(&msg, &packet2); + mavlink_msg_follow_target_pack(system_id, component_id, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state ); + mavlink_msg_follow_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_follow_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state ); - mavlink_msg_follow_target_decode(&msg, &packet2); + mavlink_msg_follow_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state ); + mavlink_msg_follow_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_control_system_state_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0 },{ 437.0, 438.0, 439.0 },{ 521.0, 522.0, 523.0, 524.0 },633.0,661.0,689.0 + }; + mavlink_control_system_state_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.time_usec = packet_in.time_usec; + packet1.x_acc = packet_in.x_acc; + packet1.y_acc = packet_in.y_acc; + packet1.z_acc = packet_in.z_acc; + packet1.x_vel = packet_in.x_vel; + packet1.y_vel = packet_in.y_vel; + packet1.z_vel = packet_in.z_vel; + packet1.x_pos = packet_in.x_pos; + packet1.y_pos = packet_in.y_pos; + packet1.z_pos = packet_in.z_pos; + packet1.airspeed = packet_in.airspeed; + packet1.roll_rate = packet_in.roll_rate; + packet1.pitch_rate = packet_in.pitch_rate; + packet1.yaw_rate = packet_in.yaw_rate; + + mav_array_memcpy(packet1.vel_variance, packet_in.vel_variance, sizeof(float)*3); + mav_array_memcpy(packet1.pos_variance, packet_in.pos_variance, sizeof(float)*3); + mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); + +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_control_system_state_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_control_system_state_decode(&msg, &packet2); + mavlink_msg_control_system_state_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_control_system_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_control_system_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate ); - mavlink_msg_control_system_state_decode(&msg, &packet2); + mavlink_msg_control_system_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate ); + mavlink_msg_control_system_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_control_system_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate ); - mavlink_msg_control_system_state_decode(&msg, &packet2); + mavlink_msg_control_system_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate ); + mavlink_msg_control_system_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_battery_status_t packet_in = { - 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46 + mavlink_battery_status_t packet_in = { + 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46 }; - mavlink_battery_status_t packet1, packet2; + mavlink_battery_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.current_consumed = packet_in.current_consumed; - packet1.energy_consumed = packet_in.energy_consumed; - packet1.temperature = packet_in.temperature; - packet1.current_battery = packet_in.current_battery; - packet1.id = packet_in.id; - packet1.battery_function = packet_in.battery_function; - packet1.type = packet_in.type; - packet1.battery_remaining = packet_in.battery_remaining; + packet1.current_consumed = packet_in.current_consumed; + packet1.energy_consumed = packet_in.energy_consumed; + packet1.temperature = packet_in.temperature; + packet1.current_battery = packet_in.current_battery; + packet1.id = packet_in.id; + packet1.battery_function = packet_in.battery_function; + packet1.type = packet_in.type; + packet1.battery_remaining = packet_in.battery_remaining; - mav_array_memcpy(packet1.voltages, packet_in.voltages, sizeof(uint16_t)*10); + mav_array_memcpy(packet1.voltages, packet_in.voltages, sizeof(uint16_t)*10); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_battery_status_decode(&msg, &packet2); + mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_battery_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining ); - mavlink_msg_battery_status_decode(&msg, &packet2); + mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining ); + mavlink_msg_battery_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining ); - mavlink_msg_battery_status_decode(&msg, &packet2); + mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining ); + mavlink_msg_battery_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_VERSION >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_autopilot_version_t packet_in = { - 93372036854775807ULL,93372036854776311ULL,963498296,963498504,963498712,963498920,18899,19003,{ 113, 114, 115, 116, 117, 118, 119, 120 },{ 137, 138, 139, 140, 141, 142, 143, 144 },{ 161, 162, 163, 164, 165, 166, 167, 168 } + mavlink_autopilot_version_t packet_in = { + 93372036854775807ULL,93372036854776311ULL,963498296,963498504,963498712,963498920,18899,19003,{ 113, 114, 115, 116, 117, 118, 119, 120 },{ 137, 138, 139, 140, 141, 142, 143, 144 },{ 161, 162, 163, 164, 165, 166, 167, 168 } }; - mavlink_autopilot_version_t packet1, packet2; + mavlink_autopilot_version_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.capabilities = packet_in.capabilities; - packet1.uid = packet_in.uid; - packet1.flight_sw_version = packet_in.flight_sw_version; - packet1.middleware_sw_version = packet_in.middleware_sw_version; - packet1.os_sw_version = packet_in.os_sw_version; - packet1.board_version = packet_in.board_version; - packet1.vendor_id = packet_in.vendor_id; - packet1.product_id = packet_in.product_id; + packet1.capabilities = packet_in.capabilities; + packet1.uid = packet_in.uid; + packet1.flight_sw_version = packet_in.flight_sw_version; + packet1.middleware_sw_version = packet_in.middleware_sw_version; + packet1.os_sw_version = packet_in.os_sw_version; + packet1.board_version = packet_in.board_version; + packet1.vendor_id = packet_in.vendor_id; + packet1.product_id = packet_in.product_id; - mav_array_memcpy(packet1.flight_custom_version, packet_in.flight_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet1.middleware_custom_version, packet_in.middleware_custom_version, sizeof(uint8_t)*8); - mav_array_memcpy(packet1.os_custom_version, packet_in.os_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet1.flight_custom_version, packet_in.flight_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet1.middleware_custom_version, packet_in.middleware_custom_version, sizeof(uint8_t)*8); + mav_array_memcpy(packet1.os_custom_version, packet_in.os_custom_version, sizeof(uint8_t)*8); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_autopilot_version_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_autopilot_version_decode(&msg, &packet2); + mavlink_msg_autopilot_version_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_autopilot_version_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_autopilot_version_pack(system_id, component_id, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid ); - mavlink_msg_autopilot_version_decode(&msg, &packet2); + mavlink_msg_autopilot_version_pack(system_id, component_id, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid ); + mavlink_msg_autopilot_version_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_autopilot_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid ); - mavlink_msg_autopilot_version_decode(&msg, &packet2); + mavlink_msg_autopilot_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid ); + mavlink_msg_autopilot_version_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LANDING_TARGET >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_landing_target_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,89,156 + mavlink_landing_target_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,89,156 }; - mavlink_landing_target_t packet1, packet2; + mavlink_landing_target_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.angle_x = packet_in.angle_x; - packet1.angle_y = packet_in.angle_y; - packet1.distance = packet_in.distance; - packet1.size_x = packet_in.size_x; - packet1.size_y = packet_in.size_y; - packet1.target_num = packet_in.target_num; - packet1.frame = packet_in.frame; + packet1.time_usec = packet_in.time_usec; + packet1.angle_x = packet_in.angle_x; + packet1.angle_y = packet_in.angle_y; + packet1.distance = packet_in.distance; + packet1.size_x = packet_in.size_x; + packet1.size_y = packet_in.size_y; + packet1.target_num = packet_in.target_num; + packet1.frame = packet_in.frame; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_landing_target_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_landing_target_decode(&msg, &packet2); + mavlink_msg_landing_target_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_landing_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_landing_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y ); - mavlink_msg_landing_target_decode(&msg, &packet2); + mavlink_msg_landing_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y ); + mavlink_msg_landing_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_landing_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y ); - mavlink_msg_landing_target_decode(&msg, &packet2); + mavlink_msg_landing_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y ); + mavlink_msg_landing_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESTIMATOR_STATUS >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_estimator_status_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315 + mavlink_estimator_status_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315 }; - mavlink_estimator_status_t packet1, packet2; + mavlink_estimator_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.vel_ratio = packet_in.vel_ratio; - packet1.pos_horiz_ratio = packet_in.pos_horiz_ratio; - packet1.pos_vert_ratio = packet_in.pos_vert_ratio; - packet1.mag_ratio = packet_in.mag_ratio; - packet1.hagl_ratio = packet_in.hagl_ratio; - packet1.tas_ratio = packet_in.tas_ratio; - packet1.pos_horiz_accuracy = packet_in.pos_horiz_accuracy; - packet1.pos_vert_accuracy = packet_in.pos_vert_accuracy; - packet1.flags = packet_in.flags; + packet1.time_usec = packet_in.time_usec; + packet1.vel_ratio = packet_in.vel_ratio; + packet1.pos_horiz_ratio = packet_in.pos_horiz_ratio; + packet1.pos_vert_ratio = packet_in.pos_vert_ratio; + packet1.mag_ratio = packet_in.mag_ratio; + packet1.hagl_ratio = packet_in.hagl_ratio; + packet1.tas_ratio = packet_in.tas_ratio; + packet1.pos_horiz_accuracy = packet_in.pos_horiz_accuracy; + packet1.pos_vert_accuracy = packet_in.pos_vert_accuracy; + packet1.flags = packet_in.flags; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_estimator_status_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_estimator_status_decode(&msg, &packet2); + mavlink_msg_estimator_status_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_estimator_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_estimator_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy ); - mavlink_msg_estimator_status_decode(&msg, &packet2); + mavlink_msg_estimator_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy ); + mavlink_msg_estimator_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_estimator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy ); - mavlink_msg_estimator_status_decode(&msg, &packet2); + mavlink_msg_estimator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy ); + mavlink_msg_estimator_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIND_COV >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_wind_cov_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0 + mavlink_wind_cov_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0 }; - mavlink_wind_cov_t packet1, packet2; + mavlink_wind_cov_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.wind_x = packet_in.wind_x; - packet1.wind_y = packet_in.wind_y; - packet1.wind_z = packet_in.wind_z; - packet1.var_horiz = packet_in.var_horiz; - packet1.var_vert = packet_in.var_vert; - packet1.wind_alt = packet_in.wind_alt; - packet1.horiz_accuracy = packet_in.horiz_accuracy; - packet1.vert_accuracy = packet_in.vert_accuracy; + packet1.time_usec = packet_in.time_usec; + packet1.wind_x = packet_in.wind_x; + packet1.wind_y = packet_in.wind_y; + packet1.wind_z = packet_in.wind_z; + packet1.var_horiz = packet_in.var_horiz; + packet1.var_vert = packet_in.var_vert; + packet1.wind_alt = packet_in.wind_alt; + packet1.horiz_accuracy = packet_in.horiz_accuracy; + packet1.vert_accuracy = packet_in.vert_accuracy; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_WIND_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIND_COV_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_wind_cov_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_wind_cov_decode(&msg, &packet2); + mavlink_msg_wind_cov_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_wind_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_wind_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy ); - mavlink_msg_wind_cov_decode(&msg, &packet2); + mavlink_msg_wind_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy ); + mavlink_msg_wind_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_wind_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy ); - mavlink_msg_wind_cov_decode(&msg, &packet2); + mavlink_msg_wind_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy ); + mavlink_msg_wind_cov_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIBRATION >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_vibration_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,963498920 + mavlink_vibration_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,963498920 }; - mavlink_vibration_t packet1, packet2; + mavlink_vibration_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.vibration_x = packet_in.vibration_x; - packet1.vibration_y = packet_in.vibration_y; - packet1.vibration_z = packet_in.vibration_z; - packet1.clipping_0 = packet_in.clipping_0; - packet1.clipping_1 = packet_in.clipping_1; - packet1.clipping_2 = packet_in.clipping_2; + packet1.time_usec = packet_in.time_usec; + packet1.vibration_x = packet_in.vibration_x; + packet1.vibration_y = packet_in.vibration_y; + packet1.vibration_z = packet_in.vibration_z; + packet1.clipping_0 = packet_in.clipping_0; + packet1.clipping_1 = packet_in.clipping_1; + packet1.clipping_2 = packet_in.clipping_2; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_VIBRATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIBRATION_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vibration_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_vibration_decode(&msg, &packet2); + mavlink_msg_vibration_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_vibration_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vibration_pack(system_id, component_id, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 ); - mavlink_msg_vibration_decode(&msg, &packet2); + mavlink_msg_vibration_pack(system_id, component_id, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 ); + mavlink_msg_vibration_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_vibration_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 ); - mavlink_msg_vibration_decode(&msg, &packet2); + mavlink_msg_vibration_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 ); + mavlink_msg_vibration_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HOME_POSITION >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_home_position_t packet_in = { - 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0 + mavlink_home_position_t packet_in = { + 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0 }; - mavlink_home_position_t packet1, packet2; + mavlink_home_position_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.latitude = packet_in.latitude; - packet1.longitude = packet_in.longitude; - packet1.altitude = packet_in.altitude; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.approach_x = packet_in.approach_x; - packet1.approach_y = packet_in.approach_y; - packet1.approach_z = packet_in.approach_z; + packet1.latitude = packet_in.latitude; + packet1.longitude = packet_in.longitude; + packet1.altitude = packet_in.altitude; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.approach_x = packet_in.approach_x; + packet1.approach_y = packet_in.approach_y; + packet1.approach_z = packet_in.approach_z; - mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); + mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_home_position_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_home_position_decode(&msg, &packet2); + mavlink_msg_home_position_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_home_position_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_home_position_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); - mavlink_msg_home_position_decode(&msg, &packet2); + mavlink_msg_home_position_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); + mavlink_msg_home_position_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); - mavlink_msg_home_position_decode(&msg, &packet2); + mavlink_msg_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); + mavlink_msg_home_position_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_HOME_POSITION >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_set_home_position_t packet_in = { - 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,161 + mavlink_set_home_position_t packet_in = { + 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,161 }; - mavlink_set_home_position_t packet1, packet2; + mavlink_set_home_position_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.latitude = packet_in.latitude; - packet1.longitude = packet_in.longitude; - packet1.altitude = packet_in.altitude; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; - packet1.approach_x = packet_in.approach_x; - packet1.approach_y = packet_in.approach_y; - packet1.approach_z = packet_in.approach_z; - packet1.target_system = packet_in.target_system; + packet1.latitude = packet_in.latitude; + packet1.longitude = packet_in.longitude; + packet1.altitude = packet_in.altitude; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; + packet1.approach_x = packet_in.approach_x; + packet1.approach_y = packet_in.approach_y; + packet1.approach_z = packet_in.approach_z; + packet1.target_system = packet_in.target_system; - mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); + mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_home_position_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_set_home_position_decode(&msg, &packet2); + mavlink_msg_set_home_position_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_home_position_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_home_position_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); - mavlink_msg_set_home_position_decode(&msg, &packet2); + mavlink_msg_set_home_position_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); + mavlink_msg_set_home_position_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_set_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); - mavlink_msg_set_home_position_decode(&msg, &packet2); + mavlink_msg_set_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z ); + mavlink_msg_set_home_position_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MESSAGE_INTERVAL >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_message_interval_t packet_in = { - 963497464,17443 + mavlink_message_interval_t packet_in = { + 963497464,17443 }; - mavlink_message_interval_t packet1, packet2; + mavlink_message_interval_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.interval_us = packet_in.interval_us; - packet1.message_id = packet_in.message_id; + packet1.interval_us = packet_in.interval_us; + packet1.message_id = packet_in.message_id; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_message_interval_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_message_interval_decode(&msg, &packet2); + mavlink_msg_message_interval_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_message_interval_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_message_interval_pack(system_id, component_id, &msg , packet1.message_id , packet1.interval_us ); - mavlink_msg_message_interval_decode(&msg, &packet2); + mavlink_msg_message_interval_pack(system_id, component_id, &msg , packet1.message_id , packet1.interval_us ); + mavlink_msg_message_interval_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_message_interval_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.message_id , packet1.interval_us ); - mavlink_msg_message_interval_decode(&msg, &packet2); + mavlink_msg_message_interval_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.message_id , packet1.interval_us ); + mavlink_msg_message_interval_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EXTENDED_SYS_STATE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_extended_sys_state_t packet_in = { - 5,72 + mavlink_extended_sys_state_t packet_in = { + 5,72 }; - mavlink_extended_sys_state_t packet1, packet2; + mavlink_extended_sys_state_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.vtol_state = packet_in.vtol_state; - packet1.landed_state = packet_in.landed_state; + packet1.vtol_state = packet_in.vtol_state; + packet1.landed_state = packet_in.landed_state; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_extended_sys_state_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_extended_sys_state_decode(&msg, &packet2); + mavlink_msg_extended_sys_state_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_extended_sys_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_extended_sys_state_pack(system_id, component_id, &msg , packet1.vtol_state , packet1.landed_state ); - mavlink_msg_extended_sys_state_decode(&msg, &packet2); + mavlink_msg_extended_sys_state_pack(system_id, component_id, &msg , packet1.vtol_state , packet1.landed_state ); + mavlink_msg_extended_sys_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vtol_state , packet1.landed_state ); - mavlink_msg_extended_sys_state_decode(&msg, &packet2); + mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vtol_state , packet1.landed_state ); + mavlink_msg_extended_sys_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ADSB_VEHICLE >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_adsb_vehicle_t packet_in = { - 963497464,963497672,963497880,963498088,18067,18171,18275,18379,18483,211,"BCDEFGHI",113,180 + mavlink_adsb_vehicle_t packet_in = { + 963497464,963497672,963497880,963498088,18067,18171,18275,18379,18483,211,"BCDEFGHI",113,180 }; - mavlink_adsb_vehicle_t packet1, packet2; + mavlink_adsb_vehicle_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.ICAO_address = packet_in.ICAO_address; - packet1.lat = packet_in.lat; - packet1.lon = packet_in.lon; - packet1.altitude = packet_in.altitude; - packet1.heading = packet_in.heading; - packet1.hor_velocity = packet_in.hor_velocity; - packet1.ver_velocity = packet_in.ver_velocity; - packet1.flags = packet_in.flags; - packet1.squawk = packet_in.squawk; - packet1.altitude_type = packet_in.altitude_type; - packet1.emitter_type = packet_in.emitter_type; - packet1.tslc = packet_in.tslc; + packet1.ICAO_address = packet_in.ICAO_address; + packet1.lat = packet_in.lat; + packet1.lon = packet_in.lon; + packet1.altitude = packet_in.altitude; + packet1.heading = packet_in.heading; + packet1.hor_velocity = packet_in.hor_velocity; + packet1.ver_velocity = packet_in.ver_velocity; + packet1.flags = packet_in.flags; + packet1.squawk = packet_in.squawk; + packet1.altitude_type = packet_in.altitude_type; + packet1.emitter_type = packet_in.emitter_type; + packet1.tslc = packet_in.tslc; - mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*9); + mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*9); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_adsb_vehicle_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_adsb_vehicle_decode(&msg, &packet2); + mavlink_msg_adsb_vehicle_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_adsb_vehicle_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_adsb_vehicle_pack(system_id, component_id, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk ); - mavlink_msg_adsb_vehicle_decode(&msg, &packet2); + mavlink_msg_adsb_vehicle_pack(system_id, component_id, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk ); + mavlink_msg_adsb_vehicle_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk ); - mavlink_msg_adsb_vehicle_decode(&msg, &packet2); + mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk ); + mavlink_msg_adsb_vehicle_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_V2_EXTENSION >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_v2_extension_t packet_in = { - 17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 } + mavlink_v2_extension_t packet_in = { + 17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 } }; - mavlink_v2_extension_t packet1, packet2; + mavlink_v2_extension_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.message_type = packet_in.message_type; - packet1.target_network = packet_in.target_network; - packet1.target_system = packet_in.target_system; - packet1.target_component = packet_in.target_component; + packet1.message_type = packet_in.message_type; + packet1.target_network = packet_in.target_network; + packet1.target_system = packet_in.target_system; + packet1.target_component = packet_in.target_component; - mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*249); + mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*249); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_v2_extension_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_v2_extension_decode(&msg, &packet2); + mavlink_msg_v2_extension_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_v2_extension_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_v2_extension_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload ); - mavlink_msg_v2_extension_decode(&msg, &packet2); + mavlink_msg_v2_extension_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload ); + mavlink_msg_v2_extension_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_v2_extension_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload ); - mavlink_msg_v2_extension_decode(&msg, &packet2); + mavlink_msg_v2_extension_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload ); + mavlink_msg_v2_extension_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MEMORY_VECT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_memory_vect_t packet_in = { - 17235,139,206,{ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 } + mavlink_memory_vect_t packet_in = { + 17235,139,206,{ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 } }; - mavlink_memory_vect_t packet1, packet2; + mavlink_memory_vect_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.address = packet_in.address; - packet1.ver = packet_in.ver; - packet1.type = packet_in.type; + packet1.address = packet_in.address; + packet1.ver = packet_in.ver; + packet1.type = packet_in.type; - mav_array_memcpy(packet1.value, packet_in.value, sizeof(int8_t)*32); + mav_array_memcpy(packet1.value, packet_in.value, sizeof(int8_t)*32); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_memory_vect_decode(&msg, &packet2); + mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_memory_vect_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_memory_vect_pack(system_id, component_id, &msg , packet1.address , packet1.ver , packet1.type , packet1.value ); - mavlink_msg_memory_vect_decode(&msg, &packet2); + mavlink_msg_memory_vect_pack(system_id, component_id, &msg , packet1.address , packet1.ver , packet1.type , packet1.value ); + mavlink_msg_memory_vect_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.ver , packet1.type , packet1.value ); - mavlink_msg_memory_vect_decode(&msg, &packet2); + mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.ver , packet1.type , packet1.value ); + mavlink_msg_memory_vect_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_VECT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_debug_vect_t packet_in = { - 93372036854775807ULL,73.0,101.0,129.0,"UVWXYZABC" + mavlink_debug_vect_t packet_in = { + 93372036854775807ULL,73.0,101.0,129.0,"UVWXYZABC" }; - mavlink_debug_vect_t packet1, packet2; + mavlink_debug_vect_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_usec = packet_in.time_usec; - packet1.x = packet_in.x; - packet1.y = packet_in.y; - packet1.z = packet_in.z; + packet1.time_usec = packet_in.time_usec; + packet1.x = packet_in.x; + packet1.y = packet_in.y; + packet1.z = packet_in.z; - mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10); + mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_debug_vect_decode(&msg, &packet2); + mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_debug_vect_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_debug_vect_pack(system_id, component_id, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z ); - mavlink_msg_debug_vect_decode(&msg, &packet2); + mavlink_msg_debug_vect_pack(system_id, component_id, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z ); + mavlink_msg_debug_vect_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_debug_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z ); - mavlink_msg_debug_vect_decode(&msg, &packet2); + mavlink_msg_debug_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z ); + mavlink_msg_debug_vect_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_FLOAT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_named_value_float_t packet_in = { - 963497464,45.0,"IJKLMNOPQ" + mavlink_named_value_float_t packet_in = { + 963497464,45.0,"IJKLMNOPQ" }; - mavlink_named_value_float_t packet1, packet2; + mavlink_named_value_float_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.value = packet_in.value; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.value = packet_in.value; - mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10); + mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_named_value_float_decode(&msg, &packet2); + mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_named_value_float_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_named_value_float_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); - mavlink_msg_named_value_float_decode(&msg, &packet2); + mavlink_msg_named_value_float_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); + mavlink_msg_named_value_float_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); - mavlink_msg_named_value_float_decode(&msg, &packet2); + mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); + mavlink_msg_named_value_float_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_INT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_named_value_int_t packet_in = { - 963497464,963497672,"IJKLMNOPQ" + mavlink_named_value_int_t packet_in = { + 963497464,963497672,"IJKLMNOPQ" }; - mavlink_named_value_int_t packet1, packet2; + mavlink_named_value_int_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.value = packet_in.value; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.value = packet_in.value; - mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10); + mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_named_value_int_decode(&msg, &packet2); + mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_named_value_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_named_value_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); - mavlink_msg_named_value_int_decode(&msg, &packet2); + mavlink_msg_named_value_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); + mavlink_msg_named_value_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); - mavlink_msg_named_value_int_decode(&msg, &packet2); + mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value ); + mavlink_msg_named_value_int_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STATUSTEXT >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_statustext_t packet_in = { - 5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX" + mavlink_statustext_t packet_in = { + 5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX" }; - mavlink_statustext_t packet1, packet2; + mavlink_statustext_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.severity = packet_in.severity; + packet1.severity = packet_in.severity; - mav_array_memcpy(packet1.text, packet_in.text, sizeof(char)*50); + mav_array_memcpy(packet1.text, packet_in.text, sizeof(char)*50); - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_statustext_decode(&msg, &packet2); + mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_statustext_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_statustext_pack(system_id, component_id, &msg , packet1.severity , packet1.text ); - mavlink_msg_statustext_decode(&msg, &packet2); + mavlink_msg_statustext_pack(system_id, component_id, &msg , packet1.severity , packet1.text ); + mavlink_msg_statustext_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.severity , packet1.text ); - mavlink_msg_statustext_decode(&msg, &packet2); + mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.severity , packet1.text ); + mavlink_msg_statustext_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG >= 256) { + return; + } +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_debug_t packet_in = { - 963497464,45.0,29 + mavlink_debug_t packet_in = { + 963497464,45.0,29 }; - mavlink_debug_t packet1, packet2; + mavlink_debug_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.time_boot_ms = packet_in.time_boot_ms; - packet1.value = packet_in.value; - packet1.ind = packet_in.ind; + packet1.time_boot_ms = packet_in.time_boot_ms; + packet1.value = packet_in.value; + packet1.ind = packet_in.ind; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_DEBUG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_debug_decode(&msg, &packet2); + mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_debug_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_debug_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.ind , packet1.value ); - mavlink_msg_debug_decode(&msg, &packet2); + mavlink_msg_debug_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.ind , packet1.value ); + mavlink_msg_debug_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.ind , packet1.value ); - mavlink_msg_debug_decode(&msg, &packet2); + mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.ind , packet1.value ); + mavlink_msg_debug_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; imagic = MAVLINK_STX; msg->len = length; @@ -97,9 +99,9 @@ MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, ui */ #if MAVLINK_CRC_EXTRA MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, - uint8_t length, uint8_t crc_extra) + uint8_t min_length, uint8_t length, uint8_t crc_extra) { - return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, length, crc_extra); + return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, min_length, length, crc_extra); } #else MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, @@ -117,7 +119,7 @@ MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, */ #if MAVLINK_CRC_EXTRA MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, - uint8_t length, uint8_t crc_extra) + uint8_t min_length, uint8_t length, uint8_t crc_extra) #else MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, uint8_t length) #endif diff --git a/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink.h b/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink.h index 555d06e..26e9faf 100755 --- a/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink.h +++ b/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink.h @@ -1,10 +1,13 @@ /** @file - * @brief MAVLink comm protocol built from oroca_bldc.xml - * @see http://mavlink.org + * @brief MAVLink comm protocol built from oroca_bldc.xml + * @see http://mavlink.org */ +#pragma once #ifndef MAVLINK_H #define MAVLINK_H +#define MAVLINK_PRIMARY_XML_IDX 0 + #ifndef MAVLINK_STX #define MAVLINK_STX 254 #endif @@ -21,6 +24,10 @@ #define MAVLINK_CRC_EXTRA 1 #endif +#ifndef MAVLINK_COMMAND_24BIT +#define MAVLINK_COMMAND_24BIT 0 +#endif + #include "version.h" #include "oroca_bldc.h" diff --git a/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_set_velocity.h b/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_set_velocity.h new file mode 100644 index 0000000..0ad2acf --- /dev/null +++ b/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_set_velocity.h @@ -0,0 +1,213 @@ +#pragma once +// MESSAGE SET_VELOCITY PACKING + +#define MAVLINK_MSG_ID_SET_VELOCITY 220 + +MAVPACKED( +typedef struct __mavlink_set_velocity_t { + uint16_t ref_angular_velocity; /*< velocity value*/ +}) mavlink_set_velocity_t; + +#define MAVLINK_MSG_ID_SET_VELOCITY_LEN 2 +#define MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN 2 +#define MAVLINK_MSG_ID_220_LEN 2 +#define MAVLINK_MSG_ID_220_MIN_LEN 2 + +#define MAVLINK_MSG_ID_SET_VELOCITY_CRC 100 +#define MAVLINK_MSG_ID_220_CRC 100 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_SET_VELOCITY { \ + 220, \ + "SET_VELOCITY", \ + 1, \ + { { "ref_angular_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_set_velocity_t, ref_angular_velocity) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_SET_VELOCITY { \ + "SET_VELOCITY", \ + 1, \ + { { "ref_angular_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_set_velocity_t, ref_angular_velocity) }, \ + } \ +} +#endif + +/** + * @brief Pack a set_velocity message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param ref_angular_velocity velocity value + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_set_velocity_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint16_t ref_angular_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_SET_VELOCITY_LEN]; + _mav_put_uint16_t(buf, 0, ref_angular_velocity); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_VELOCITY_LEN); +#else + mavlink_set_velocity_t packet; + packet.ref_angular_velocity = ref_angular_velocity; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_VELOCITY_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_SET_VELOCITY; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN, MAVLINK_MSG_ID_SET_VELOCITY_LEN, MAVLINK_MSG_ID_SET_VELOCITY_CRC); +} + +/** + * @brief Pack a set_velocity message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param ref_angular_velocity velocity value + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_set_velocity_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint16_t ref_angular_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_SET_VELOCITY_LEN]; + _mav_put_uint16_t(buf, 0, ref_angular_velocity); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_VELOCITY_LEN); +#else + mavlink_set_velocity_t packet; + packet.ref_angular_velocity = ref_angular_velocity; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_VELOCITY_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_SET_VELOCITY; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN, MAVLINK_MSG_ID_SET_VELOCITY_LEN, MAVLINK_MSG_ID_SET_VELOCITY_CRC); +} + +/** + * @brief Encode a set_velocity struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param set_velocity C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_set_velocity_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_velocity_t* set_velocity) +{ + return mavlink_msg_set_velocity_pack(system_id, component_id, msg, set_velocity->ref_angular_velocity); +} + +/** + * @brief Encode a set_velocity struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param set_velocity C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_set_velocity_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_velocity_t* set_velocity) +{ + return mavlink_msg_set_velocity_pack_chan(system_id, component_id, chan, msg, set_velocity->ref_angular_velocity); +} + +/** + * @brief Send a set_velocity message + * @param chan MAVLink channel to send the message + * + * @param ref_angular_velocity velocity value + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_set_velocity_send(mavlink_channel_t chan, uint16_t ref_angular_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_SET_VELOCITY_LEN]; + _mav_put_uint16_t(buf, 0, ref_angular_velocity); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VELOCITY, buf, MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN, MAVLINK_MSG_ID_SET_VELOCITY_LEN, MAVLINK_MSG_ID_SET_VELOCITY_CRC); +#else + mavlink_set_velocity_t packet; + packet.ref_angular_velocity = ref_angular_velocity; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VELOCITY, (const char *)&packet, MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN, MAVLINK_MSG_ID_SET_VELOCITY_LEN, MAVLINK_MSG_ID_SET_VELOCITY_CRC); +#endif +} + +/** + * @brief Send a set_velocity message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_set_velocity_send_struct(mavlink_channel_t chan, const mavlink_set_velocity_t* set_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_set_velocity_send(chan, set_velocity->ref_angular_velocity); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VELOCITY, (const char *)set_velocity, MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN, MAVLINK_MSG_ID_SET_VELOCITY_LEN, MAVLINK_MSG_ID_SET_VELOCITY_CRC); +#endif +} + +#if MAVLINK_MSG_ID_SET_VELOCITY_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_set_velocity_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t ref_angular_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, ref_angular_velocity); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VELOCITY, buf, MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN, MAVLINK_MSG_ID_SET_VELOCITY_LEN, MAVLINK_MSG_ID_SET_VELOCITY_CRC); +#else + mavlink_set_velocity_t *packet = (mavlink_set_velocity_t *)msgbuf; + packet->ref_angular_velocity = ref_angular_velocity; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VELOCITY, (const char *)packet, MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN, MAVLINK_MSG_ID_SET_VELOCITY_LEN, MAVLINK_MSG_ID_SET_VELOCITY_CRC); +#endif +} +#endif + +#endif + +// MESSAGE SET_VELOCITY UNPACKING + + +/** + * @brief Get field ref_angular_velocity from set_velocity message + * + * @return velocity value + */ +static inline uint16_t mavlink_msg_set_velocity_get_ref_angular_velocity(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 0); +} + +/** + * @brief Decode a set_velocity message into a struct + * + * @param msg The message to decode + * @param set_velocity C-struct to decode the message contents into + */ +static inline void mavlink_msg_set_velocity_decode(const mavlink_message_t* msg, mavlink_set_velocity_t* set_velocity) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + set_velocity->ref_angular_velocity = mavlink_msg_set_velocity_get_ref_angular_velocity(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_SET_VELOCITY_LEN? msg->len : MAVLINK_MSG_ID_SET_VELOCITY_LEN; + memset(set_velocity, 0, MAVLINK_MSG_ID_SET_VELOCITY_LEN); + memcpy(set_velocity, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_test_cmd.h b/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_test_cmd.h deleted file mode 100755 index 1093d73..0000000 --- a/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_test_cmd.h +++ /dev/null @@ -1,257 +0,0 @@ -// MESSAGE TEST_CMD PACKING - -#define MAVLINK_MSG_ID_TEST_CMD 220 - -typedef struct __mavlink_test_cmd_t -{ - uint16_t arg2; /*< argument 2*/ - uint8_t cmd_1; /*< test cmd 1*/ - uint8_t arg1; /*< argument 1*/ -} mavlink_test_cmd_t; - -#define MAVLINK_MSG_ID_TEST_CMD_LEN 4 -#define MAVLINK_MSG_ID_220_LEN 4 - -#define MAVLINK_MSG_ID_TEST_CMD_CRC 37 -#define MAVLINK_MSG_ID_220_CRC 37 - - - -#define MAVLINK_MESSAGE_INFO_TEST_CMD { \ - "TEST_CMD", \ - 3, \ - { { "arg2", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_test_cmd_t, arg2) }, \ - { "cmd_1", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_test_cmd_t, cmd_1) }, \ - { "arg1", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_test_cmd_t, arg1) }, \ - } \ -} - - -/** - * @brief Pack a test_cmd message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param cmd_1 test cmd 1 - * @param arg1 argument 1 - * @param arg2 argument 2 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_test_cmd_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t cmd_1, uint8_t arg1, uint16_t arg2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TEST_CMD_LEN]; - _mav_put_uint16_t(buf, 0, arg2); - _mav_put_uint8_t(buf, 2, cmd_1); - _mav_put_uint8_t(buf, 3, arg1); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TEST_CMD_LEN); -#else - mavlink_test_cmd_t packet; - packet.arg2 = arg2; - packet.cmd_1 = cmd_1; - packet.arg1 = arg1; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_TEST_CMD; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TEST_CMD_LEN, MAVLINK_MSG_ID_TEST_CMD_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif -} - -/** - * @brief Pack a test_cmd message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message will be sent over - * @param msg The MAVLink message to compress the data into - * @param cmd_1 test cmd 1 - * @param arg1 argument 1 - * @param arg2 argument 2 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_test_cmd_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t cmd_1,uint8_t arg1,uint16_t arg2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TEST_CMD_LEN]; - _mav_put_uint16_t(buf, 0, arg2); - _mav_put_uint8_t(buf, 2, cmd_1); - _mav_put_uint8_t(buf, 3, arg1); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TEST_CMD_LEN); -#else - mavlink_test_cmd_t packet; - packet.arg2 = arg2; - packet.cmd_1 = cmd_1; - packet.arg1 = arg1; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_TEST_CMD; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TEST_CMD_LEN, MAVLINK_MSG_ID_TEST_CMD_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif -} - -/** - * @brief Encode a test_cmd struct - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param test_cmd C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_test_cmd_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_test_cmd_t* test_cmd) -{ - return mavlink_msg_test_cmd_pack(system_id, component_id, msg, test_cmd->cmd_1, test_cmd->arg1, test_cmd->arg2); -} - -/** - * @brief Encode a test_cmd struct on a channel - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message will be sent over - * @param msg The MAVLink message to compress the data into - * @param test_cmd C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_test_cmd_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_test_cmd_t* test_cmd) -{ - return mavlink_msg_test_cmd_pack_chan(system_id, component_id, chan, msg, test_cmd->cmd_1, test_cmd->arg1, test_cmd->arg2); -} - -/** - * @brief Send a test_cmd message - * @param chan MAVLink channel to send the message - * - * @param cmd_1 test cmd 1 - * @param arg1 argument 1 - * @param arg2 argument 2 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_test_cmd_send(mavlink_channel_t chan, uint8_t cmd_1, uint8_t arg1, uint16_t arg2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TEST_CMD_LEN]; - _mav_put_uint16_t(buf, 0, arg2); - _mav_put_uint8_t(buf, 2, cmd_1); - _mav_put_uint8_t(buf, 3, arg1); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, buf, MAVLINK_MSG_ID_TEST_CMD_LEN, MAVLINK_MSG_ID_TEST_CMD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, buf, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif -#else - mavlink_test_cmd_t packet; - packet.arg2 = arg2; - packet.cmd_1 = cmd_1; - packet.arg1 = arg1; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, (const char *)&packet, MAVLINK_MSG_ID_TEST_CMD_LEN, MAVLINK_MSG_ID_TEST_CMD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, (const char *)&packet, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_TEST_CMD_LEN <= MAVLINK_MAX_PAYLOAD_LEN -/* - This varient of _send() can be used to save stack space by re-using - memory from the receive buffer. The caller provides a - mavlink_message_t which is the size of a full mavlink message. This - is usually the receive buffer for the channel, and allows a reply to an - incoming message with minimum stack space usage. - */ -static inline void mavlink_msg_test_cmd_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t cmd_1, uint8_t arg1, uint16_t arg2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint16_t(buf, 0, arg2); - _mav_put_uint8_t(buf, 2, cmd_1); - _mav_put_uint8_t(buf, 3, arg1); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, buf, MAVLINK_MSG_ID_TEST_CMD_LEN, MAVLINK_MSG_ID_TEST_CMD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, buf, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif -#else - mavlink_test_cmd_t *packet = (mavlink_test_cmd_t *)msgbuf; - packet->arg2 = arg2; - packet->cmd_1 = cmd_1; - packet->arg1 = arg1; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, (const char *)packet, MAVLINK_MSG_ID_TEST_CMD_LEN, MAVLINK_MSG_ID_TEST_CMD_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_CMD, (const char *)packet, MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE TEST_CMD UNPACKING - - -/** - * @brief Get field cmd_1 from test_cmd message - * - * @return test cmd 1 - */ -static inline uint8_t mavlink_msg_test_cmd_get_cmd_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 2); -} - -/** - * @brief Get field arg1 from test_cmd message - * - * @return argument 1 - */ -static inline uint8_t mavlink_msg_test_cmd_get_arg1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 3); -} - -/** - * @brief Get field arg2 from test_cmd message - * - * @return argument 2 - */ -static inline uint16_t mavlink_msg_test_cmd_get_arg2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 0); -} - -/** - * @brief Decode a test_cmd message into a struct - * - * @param msg The message to decode - * @param test_cmd C-struct to decode the message contents into - */ -static inline void mavlink_msg_test_cmd_decode(const mavlink_message_t* msg, mavlink_test_cmd_t* test_cmd) -{ -#if MAVLINK_NEED_BYTE_SWAP - test_cmd->arg2 = mavlink_msg_test_cmd_get_arg2(msg); - test_cmd->cmd_1 = mavlink_msg_test_cmd_get_cmd_1(msg); - test_cmd->arg1 = mavlink_msg_test_cmd_get_arg1(msg); -#else - memcpy(test_cmd, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TEST_CMD_LEN); -#endif -} diff --git a/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_test_resp1.h b/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_test_resp1.h deleted file mode 100755 index e6c6bfd..0000000 --- a/oroca_bldc_FW/lib/mavlink/oroca_bldc/mavlink_msg_test_resp1.h +++ /dev/null @@ -1,209 +0,0 @@ -// MESSAGE TEST_RESP1 PACKING - -#define MAVLINK_MSG_ID_TEST_RESP1 221 - -typedef struct __mavlink_test_resp1_t -{ - uint8_t status; /*< status 1*/ -} mavlink_test_resp1_t; - -#define MAVLINK_MSG_ID_TEST_RESP1_LEN 1 -#define MAVLINK_MSG_ID_221_LEN 1 - -#define MAVLINK_MSG_ID_TEST_RESP1_CRC 177 -#define MAVLINK_MSG_ID_221_CRC 177 - - - -#define MAVLINK_MESSAGE_INFO_TEST_RESP1 { \ - "TEST_RESP1", \ - 1, \ - { { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_test_resp1_t, status) }, \ - } \ -} - - -/** - * @brief Pack a test_resp1 message - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * - * @param status status 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_test_resp1_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t status) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TEST_RESP1_LEN]; - _mav_put_uint8_t(buf, 0, status); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#else - mavlink_test_resp1_t packet; - packet.status = status; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_TEST_RESP1; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TEST_RESP1_LEN, MAVLINK_MSG_ID_TEST_RESP1_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif -} - -/** - * @brief Pack a test_resp1 message on a channel - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message will be sent over - * @param msg The MAVLink message to compress the data into - * @param status status 1 - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_test_resp1_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t status) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TEST_RESP1_LEN]; - _mav_put_uint8_t(buf, 0, status); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#else - mavlink_test_resp1_t packet; - packet.status = status; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_TEST_RESP1; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TEST_RESP1_LEN, MAVLINK_MSG_ID_TEST_RESP1_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif -} - -/** - * @brief Encode a test_resp1 struct - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param msg The MAVLink message to compress the data into - * @param test_resp1 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_test_resp1_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_test_resp1_t* test_resp1) -{ - return mavlink_msg_test_resp1_pack(system_id, component_id, msg, test_resp1->status); -} - -/** - * @brief Encode a test_resp1 struct on a channel - * - * @param system_id ID of this system - * @param component_id ID of this component (e.g. 200 for IMU) - * @param chan The MAVLink channel this message will be sent over - * @param msg The MAVLink message to compress the data into - * @param test_resp1 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_test_resp1_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_test_resp1_t* test_resp1) -{ - return mavlink_msg_test_resp1_pack_chan(system_id, component_id, chan, msg, test_resp1->status); -} - -/** - * @brief Send a test_resp1 message - * @param chan MAVLink channel to send the message - * - * @param status status 1 - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_test_resp1_send(mavlink_channel_t chan, uint8_t status) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_TEST_RESP1_LEN]; - _mav_put_uint8_t(buf, 0, status); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, buf, MAVLINK_MSG_ID_TEST_RESP1_LEN, MAVLINK_MSG_ID_TEST_RESP1_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, buf, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif -#else - mavlink_test_resp1_t packet; - packet.status = status; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, (const char *)&packet, MAVLINK_MSG_ID_TEST_RESP1_LEN, MAVLINK_MSG_ID_TEST_RESP1_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, (const char *)&packet, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_TEST_RESP1_LEN <= MAVLINK_MAX_PAYLOAD_LEN -/* - This varient of _send() can be used to save stack space by re-using - memory from the receive buffer. The caller provides a - mavlink_message_t which is the size of a full mavlink message. This - is usually the receive buffer for the channel, and allows a reply to an - incoming message with minimum stack space usage. - */ -static inline void mavlink_msg_test_resp1_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t status) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, status); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, buf, MAVLINK_MSG_ID_TEST_RESP1_LEN, MAVLINK_MSG_ID_TEST_RESP1_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, buf, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif -#else - mavlink_test_resp1_t *packet = (mavlink_test_resp1_t *)msgbuf; - packet->status = status; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, (const char *)packet, MAVLINK_MSG_ID_TEST_RESP1_LEN, MAVLINK_MSG_ID_TEST_RESP1_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TEST_RESP1, (const char *)packet, MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE TEST_RESP1 UNPACKING - - -/** - * @brief Get field status from test_resp1 message - * - * @return status 1 - */ -static inline uint8_t mavlink_msg_test_resp1_get_status(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Decode a test_resp1 message into a struct - * - * @param msg The message to decode - * @param test_resp1 C-struct to decode the message contents into - */ -static inline void mavlink_msg_test_resp1_decode(const mavlink_message_t* msg, mavlink_test_resp1_t* test_resp1) -{ -#if MAVLINK_NEED_BYTE_SWAP - test_resp1->status = mavlink_msg_test_resp1_get_status(msg); -#else - memcpy(test_resp1, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TEST_RESP1_LEN); -#endif -} diff --git a/oroca_bldc_FW/lib/mavlink/oroca_bldc/oroca_bldc.h b/oroca_bldc_FW/lib/mavlink/oroca_bldc/oroca_bldc.h index 1206c14..20cd484 100755 --- a/oroca_bldc_FW/lib/mavlink/oroca_bldc/oroca_bldc.h +++ b/oroca_bldc_FW/lib/mavlink/oroca_bldc/oroca_bldc.h @@ -1,7 +1,8 @@ /** @file - * @brief MAVLink comm protocol generated from oroca_bldc.xml - * @see http://mavlink.org + * @brief MAVLink comm protocol generated from oroca_bldc.xml + * @see http://mavlink.org */ +#pragma once #ifndef MAVLINK_OROCA_BLDC_H #define MAVLINK_OROCA_BLDC_H @@ -9,6 +10,9 @@ #error Wrong include order: MAVLINK_OROCA_BLDC.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call. #endif +#undef MAVLINK_THIS_XML_IDX +#define MAVLINK_THIS_XML_IDX 0 + #ifdef __cplusplus extern "C" { #endif @@ -16,15 +20,11 @@ extern "C" { // MESSAGE LENGTHS AND CRCS #ifndef MAVLINK_MESSAGE_LENGTHS -#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 4, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 229, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 12, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 32, 243, 14, 93, 0, 100, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 42, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 6, 2, 38, 0, 254, 36, 30, 18, 18, 51, 9, 0} +#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 4, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 229, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 12, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 32, 243, 14, 93, 0, 100, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 6, 2, 38, 0, 254, 36, 30, 18, 18, 51, 9, 0} #endif #ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 59, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 177, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 0, 8, 204, 49, 170, 44, 83, 46, 0} -#endif - -#ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, MAVLINK_MESSAGE_INFO_FOLLOW_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_TEST_CMD, MAVLINK_MESSAGE_INFO_TEST_RESP1, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS, MAVLINK_MESSAGE_INFO_WIND_COV, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} +#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 59, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 0, 8, 204, 49, 170, 44, 83, 46, 0} #endif #include "../protocol.h" @@ -35,8 +35,6 @@ extern "C" { -#include "../common/common.h" - // MAVLINK VERSION #ifndef MAVLINK_VERSION @@ -49,8 +47,20 @@ extern "C" { #endif // MESSAGE DEFINITIONS -#include "./mavlink_msg_test_cmd.h" -#include "./mavlink_msg_test_resp1.h" +#include "./mavlink_msg_set_velocity.h" + +// base include +#include "../common/common.h" + +#undef MAVLINK_THIS_XML_IDX +#define MAVLINK_THIS_XML_IDX 0 + +#if MAVLINK_THIS_XML_IDX == MAVLINK_PRIMARY_XML_IDX +# define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, MAVLINK_MESSAGE_INFO_FOLLOW_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_VELOCITY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS, MAVLINK_MESSAGE_INFO_WIND_COV, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} +# if MAVLINK_COMMAND_24BIT +# include "../mavlink_get_info.h" +# endif +#endif #ifdef __cplusplus } diff --git a/oroca_bldc_FW/lib/mavlink/oroca_bldc/testsuite.h b/oroca_bldc_FW/lib/mavlink/oroca_bldc/testsuite.h index 20b4ade..4ccff5d 100755 --- a/oroca_bldc_FW/lib/mavlink/oroca_bldc/testsuite.h +++ b/oroca_bldc_FW/lib/mavlink/oroca_bldc/testsuite.h @@ -1,7 +1,8 @@ /** @file - * @brief MAVLink comm protocol testsuite generated from oroca_bldc.xml - * @see http://qgroundcontrol.org/mavlink/ + * @brief MAVLink comm protocol testsuite generated from oroca_bldc.xml + * @see http://qgroundcontrol.org/mavlink/ */ +#pragma once #ifndef OROCA_BLDC_TESTSUITE_H #define OROCA_BLDC_TESTSUITE_H @@ -16,106 +17,71 @@ static void mavlink_test_oroca_bldc(uint8_t, uint8_t, mavlink_message_t *last_ms static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) { - mavlink_test_common(system_id, component_id, last_msg); - mavlink_test_oroca_bldc(system_id, component_id, last_msg); + mavlink_test_common(system_id, component_id, last_msg); + mavlink_test_oroca_bldc(system_id, component_id, last_msg); } #endif #include "../common/testsuite.h" -static void mavlink_test_test_cmd(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) +static void mavlink_test_set_velocity(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) { - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_test_cmd_t packet_in = { - 17235,139,206 - }; - mavlink_test_cmd_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.arg2 = packet_in.arg2; - packet1.cmd_1 = packet_in.cmd_1; - packet1.arg1 = packet_in.arg1; - - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_test_cmd_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_test_cmd_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_test_cmd_pack(system_id, component_id, &msg , packet1.cmd_1 , packet1.arg1 , packet1.arg2 ); - mavlink_msg_test_cmd_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_test_cmd_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cmd_1 , packet1.arg1 , packet1.arg2 ); - mavlink_msg_test_cmd_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_VELOCITY >= 256) { + return; } - mavlink_msg_test_cmd_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_test_cmd_send(MAVLINK_COMM_1 , packet1.cmd_1 , packet1.arg1 , packet1.arg2 ); - mavlink_msg_test_cmd_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_test_resp1(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; +#endif + mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; - mavlink_test_resp1_t packet_in = { - 5 + mavlink_set_velocity_t packet_in = { + 17235 }; - mavlink_test_resp1_t packet1, packet2; + mavlink_set_velocity_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); - packet1.status = packet_in.status; + packet1.ref_angular_velocity = packet_in.ref_angular_velocity; - +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { + // cope with extensions + memset(MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_VELOCITY_MIN_LEN); + } +#endif memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_test_resp1_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_test_resp1_decode(&msg, &packet2); + mavlink_msg_set_velocity_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_set_velocity_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_test_resp1_pack(system_id, component_id, &msg , packet1.status ); - mavlink_msg_test_resp1_decode(&msg, &packet2); + mavlink_msg_set_velocity_pack(system_id, component_id, &msg , packet1.ref_angular_velocity ); + mavlink_msg_set_velocity_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_test_resp1_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status ); - mavlink_msg_test_resp1_decode(&msg, &packet2); + mavlink_msg_set_velocity_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ref_angular_velocity ); + mavlink_msg_set_velocity_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; i. - */ - -/* - * mcconf_outrunner1.h - * - * A configuration for my 2kw hobbyking 215kv outrunner. Similar size outrunners - * should have a similar configuration. - * - * Created on: 14 apr 2014 - * Author: benjamin - */ - -#ifndef MCCONF_OUTRUNNER1_H_ -#define MCCONF_OUTRUNNER1_H_ - -/* - * Parameters - */ -#define MCPWM_CURRENT_MAX 60.0 // Current limit in Amperes (Upper) -#define MCPWM_CURRENT_MIN -60.0 // Current limit in Amperes (Lower) -#define MCPWM_IN_CURRENT_MAX 60.0 // Input current limit in Amperes (Upper) -#define MCPWM_IN_CURRENT_MIN -20.0 // Input current limit in Amperes (Lower) -#define MCPWM_MAX_ABS_CURRENT 100.0 // The maximum absolute current above which a fault is generated - -// Sensorless settings -#define MCPWM_IS_SENSORLESS 1 // Use sensorless commutation -#define MCPWM_MIN_RPM 200 // Auto-commutate below this RPM -#define MCPWM_CYCLE_INT_LIMIT_MIN_RPM 800.0 // Minimum RPM to calculate the BEMF coupling from -// D-Connected version TODO! -//#define MCPWM_CYCLE_INT_LIMIT 50.0 // Flux integrator limit 0 ERPM -//#define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC 0.5 // Flux integrator limit percentage at MCPWM_CYCLE_INT_START_RPM_BR ERPM -//#define MCPWM_BEMF_INPUT_COUPLING_K 300.0 // Input voltage to bemf coupling constant -// Y-connected version -#define MCPWM_CYCLE_INT_LIMIT 132.0 // Flux integrator limit 0 ERPM -#define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC 0.8 // Flux integrator limit percentage at MCPWM_CYCLE_INT_START_RPM_BR ERPM -#define MCPWM_BEMF_INPUT_COUPLING_K 600.0 // Input voltage to bemf coupling constant - -// Speed PID parameters -#define MCPWM_PID_KP 0.0001 // Proportional gain -#define MCPWM_PID_KI 0.002 // Integral gain -#define MCPWM_PID_KD 0.0 // Derivative gain -#define MCPWM_PID_MIN_RPM 1200.0 // Minimum allowed RPM - -// Position PID parameters -#define MCPWM_P_PID_KP 0.0001 // Proportional gain -#define MCPWM_P_PID_KI 0.002 // Integral gain -#define MCPWM_P_PID_KD 0.0 // Derivative gain - -// Current control parameters -#define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain -#define MCPWM_CURRENT_CONTROL_MIN 1.0 // Minimum allowed current - -// Hall sensor - -#endif /* MCCONF_OUTRUNNER1_H_ */ diff --git a/oroca_bldc_FW/lib/mcconf/mcconf_outrunner2.h b/oroca_bldc_FW/lib/mcconf/mcconf_outrunner2.h deleted file mode 100755 index 3240ae7..0000000 --- a/oroca_bldc_FW/lib/mcconf/mcconf_outrunner2.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * mcconf_outrunner2.h - * - * A configuration for my scorpion 225kv outrunner. - * - * Created on: 14 apr 2014 - * Author: benjamin - */ - -#ifndef MCCONF_OUTRUNNER2_H_ -#define MCCONF_OUTRUNNER2_H_ - -/* - * Parameters - */ -#define MCPWM_CURRENT_MAX 60.0 // Current limit in Amperes (Upper) -#define MCPWM_CURRENT_MIN -60.0 // Current limit in Amperes (Lower) -#define MCPWM_IN_CURRENT_MAX 60.0 // Input current limit in Amperes (Upper) -#define MCPWM_IN_CURRENT_MIN -20.0 // Input current limit in Amperes (Lower) -#define MCPWM_MAX_ABS_CURRENT 130.0 // The maximum absolute current above which a fault is generated -#define MCPWM_SLOW_ABS_OVERCURRENT 1 // Use the filtered (and hence slower) current for the overcurrent fault detection - -// Sensorless settings -#define MCPWM_IS_SENSORLESS 1 // Use sensorless commutation -#define MCPWM_MIN_RPM 150 // Auto-commutate below this RPM -#define MCPWM_CYCLE_INT_LIMIT_MIN_RPM 1100.0 // Minimum RPM to calculate the BEMF coupling from -#define MCPWM_CYCLE_INT_LIMIT 62.0 // Flux integrator limit 0 ERPM -#define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC 0.8 // Flux integrator limit percentage at MCPWM_CYCLE_INT_START_RPM_BR ERPM -#define MCPWM_BEMF_INPUT_COUPLING_K 600.0 // Input voltage to bemf coupling constant - -// Speed PID parameters -#define MCPWM_PID_KP 0.0001 // Proportional gain -#define MCPWM_PID_KI 0.002 // Integral gain -#define MCPWM_PID_KD 0.0 // Derivative gain -#define MCPWM_PID_MIN_RPM 900.0 // Minimum allowed RPM - -// Position PID parameters -#define MCPWM_P_PID_KP 0.0001 // Proportional gain -#define MCPWM_P_PID_KI 0.002 // Integral gain -#define MCPWM_P_PID_KD 0.0 // Derivative gain - -// Current control parameters -#define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain -#define MCPWM_CURRENT_CONTROL_MIN 1.0 // Minimum allowed current - -#endif /* MCCONF_OUTRUNNER2_H_ */ diff --git a/oroca_bldc_FW/lib/mcconf/mcconf_sten.h b/oroca_bldc_FW/lib/mcconf/mcconf_sten.h deleted file mode 100755 index 7a6172d..0000000 --- a/oroca_bldc_FW/lib/mcconf/mcconf_sten.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * mcconf_sten.h - * - * Created on: 14 apr 2014 - * Author: benjamin - */ - -#ifndef MCCONF_STEN_H_ -#define MCCONF_STEN_H_ - -/* - * Parameters - */ -#define MCPWM_CURRENT_MAX 35.0 // Current limit in Amperes (Upper) -#define MCPWM_CURRENT_MIN -30.0 // Current limit in Amperes (Lower) -#define MCPWM_MAX_ABS_CURRENT 100.0 // The maximum absolute current above which a fault is generated -#define MCPWM_SLOW_ABS_OVERCURRENT 1 // Use the filtered (and hence slower) current for the overcurrent fault detection -#define MCPWM_IN_CURRENT_MAX 25.0 // Input current limit in Amperes (Upper) -#define MCPWM_IN_CURRENT_MIN -20.0 // Input current limit in Amperes (Lower) -#define MCPWM_RPM_MAX 80000.0 // The motor speed limit (Upper) -#define MCPWM_RPM_MIN -80000.0 // The motor speed limit (Lower) -#define MCPWM_MIN_VOLTAGE 20.0 // Minimum input voltage -#define MCPWM_MAX_VOLTAGE 50.0 // Maximum input voltage -#define MCPWM_CURRENT_STARTUP_BOOST 0.02 // The lowest duty cycle to use in current control mode (has to be > MCPWM_MIN_DUTY_CYCLE) -#define MCPWM_RPM_LIMIT_NEG_TORQUE 0 // Use negative torque to limit the RPM -#define MCPWM_CURR_MAX_RPM_FBRAKE 1500 // Maximum electrical RPM to use full brake at - -// Sensorless settings -#define MCPWM_IS_SENSORLESS 1 // Use sensorless commutation -#define MCPWM_MIN_RPM 250 // Auto-commutate below this RPM -#define MCPWM_CYCLE_INT_LIMIT_MIN_RPM 500.0 // Minimum RPM to calculate the BEMF coupling from -#define MCPWM_CYCLE_INT_LIMIT 80.0 // Flux integrator limit 0 ERPM -#define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC 0.8 // Flux integrator limit percentage at MCPWM_CYCLE_INT_START_RPM_BR ERPM -#define MCPWM_BEMF_INPUT_COUPLING_K 750.0 // Input voltage to bemf coupling constant - -// Speed PID parameters -#define MCPWM_PID_KP 0.0001 // Proportional gain -#define MCPWM_PID_KI 0.002 // Integral gain -#define MCPWM_PID_KD 0.0 // Derivative gain -#define MCPWM_PID_MIN_RPM 1200.0 // Minimum allowed RPM - -// Position PID parameters -#define MCPWM_P_PID_KP 0.0001 // Proportional gain -#define MCPWM_P_PID_KI 0.002 // Integral gain -#define MCPWM_P_PID_KD 0.0 // Derivative gain - -// Current control parameters -#define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain -#define MCPWM_CURRENT_CONTROL_MIN 0.05 // Minimum allowed current - -#endif /* MCCONF_STEN_H_ */ diff --git a/oroca_bldc_FW/main.cpp b/oroca_bldc_FW/main.cpp index 99cd36c..da3dae5 100755 --- a/oroca_bldc_FW/main.cpp +++ b/oroca_bldc_FW/main.cpp @@ -4,15 +4,22 @@ */ +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" +#include "hw.h" +#include "timeout.h" + +#include +#include +#include +#include +#include +#include #include "main.h" - - -//-- 내부함수 -// -void main_init(void); - +#include "src/core/uart3.h" class cTest { @@ -38,29 +45,24 @@ cTest test; ---------------------------------------------------------------------------*/ int main(void) { - main_init(); +//================================= +// hardware setup + + bldc_init(); - test.print(); + user_interface_configure(); - //-- BLDC 시작 - // - bldc_start(); + timeout_init(); + timeout_configure(1000); + test.print(); + +//================================= + for(;;) + { + chThdSleepMilliseconds(10); + } return 0; } - - - - -/*--------------------------------------------------------------------------- - TITLE : main_init - WORK : - ARG : void - RET : void ----------------------------------------------------------------------------*/ -void main_init(void) -{ - bldc_init(); -} diff --git a/oroca_bldc_FW/main.h b/oroca_bldc_FW/main.h index 1e34bea..d2a5259 100755 --- a/oroca_bldc_FW/main.h +++ b/oroca_bldc_FW/main.h @@ -4,9 +4,6 @@ #include "bldc.h" - - - - +#include "user_interface_app.h" #endif diff --git a/oroca_bldc_FW/mcuconf.h b/oroca_bldc_FW/mcuconf.h index 188c832..179e0b4 100755 --- a/oroca_bldc_FW/mcuconf.h +++ b/oroca_bldc_FW/mcuconf.h @@ -155,8 +155,10 @@ */ #define STM32_ICU_USE_TIM1 FALSE #define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 TRUE -#define STM32_ICU_USE_TIM4 FALSE +//#define STM32_ICU_USE_TIM3 TRUE +#define STM32_ICU_USE_TIM3 FALSE +//#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM4 TRUE #define STM32_ICU_USE_TIM5 FALSE #define STM32_ICU_USE_TIM8 FALSE #define STM32_ICU_TIM1_IRQ_PRIORITY 7 @@ -190,12 +192,12 @@ //#define STM32_SERIAL_USE_USART2 FALSE //jsyoon #ifdef _TEST_STM32F4_DISCOVERY -#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART2 FALSE #else // _TEST_STM32F4_DISCOVERY #define STM32_SERIAL_USE_USART2 FALSE #endif // _TEST_STM32F4_DISCOVERY -#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_USART3 TRUE #define STM32_SERIAL_USE_UART4 FALSE #define STM32_SERIAL_USE_UART5 FALSE #define STM32_SERIAL_USE_USART6 FALSE @@ -231,8 +233,8 @@ */ #define STM32_UART_USE_USART1 FALSE #define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 TRUE -#define STM32_UART_USE_USART6 TRUE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USE_USART6 FALSE #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) diff --git a/oroca_bldc_FW/src/app/local_ppm_proc.c b/oroca_bldc_FW/src/app/local_ppm_proc.c new file mode 100644 index 0000000..e85a8c9 --- /dev/null +++ b/oroca_bldc_FW/src/app/local_ppm_proc.c @@ -0,0 +1,127 @@ +/* + Copyright 2012-2015 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * app_ppm.c + * + * Created on: 18 apr 2014 + * Author: bakchajang + */ + +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" + +#include "servo_dec.h" +#include "mcpwm.h" +#include "timeout.h" +#include "utils.h" + +#include +#include +#include + +#include "user_interface_app.h" +#include "local_ppm_proc.h" +#include "../core/uart3.h" + +// Settings +#define MAX_CAN_AGE 0.1 +#define MIN_PULSES_WITHOUT_POWER 50 + +// Threads +static THD_FUNCTION(ppm_thread, arg); +static THD_WORKING_AREA(ppm_thread_wa, 1024); +static thread_t*ppm_tp; +virtual_timer_t vt; + +// Private functions +static void servodec_func(void); + +// Private variables +static volatile bool is_running = false; +static volatile ppm_config config; +static volatile int pulses_without_power = 0; + +// Private functions +static void update(void *p); + +void app_ppm_configure(ppm_config *conf) { + config = *conf; + pulses_without_power = 0; + + if (is_running) { + servodec_set_pulse_options(config.pulse_start, config.pulse_end, config.median_filter); + } +} + +void app_ppm_start(void) { + chThdCreateStatic(ppm_thread_wa, sizeof(ppm_thread_wa), NORMALPRIO, ppm_thread, NULL); + + + //Uart3_printf(&SD3, (uint8_t *)"app_ppm_start.....\r\n"); //170530 + + chSysLock(); + chVTSetI(&vt, MS2ST(1), update, NULL); + chSysUnlock(); +} + +static void servodec_func(void) { + chSysLockFromISR(); + timeout_reset(); + + chEvtSignalI(ppm_tp, (eventmask_t) 1); + chSysUnlockFromISR(); +} + + +static void update(void *p) { + chSysLockFromISR(); + chVTSetI(&vt, MS2ST(2), update, p); + + chEvtSignalI(ppm_tp, (eventmask_t) 1); + chSysUnlockFromISR(); +} + +static THD_FUNCTION(ppm_thread, arg) +{ + (void)arg; + + chRegSetThreadName("APP_PPM"); + ppm_tp = chThdGetSelfX(); + + //servodec_set_pulse_options(config.pulse_start, config.pulse_end, config.median_filter); + servodec_set_pulse_options(1.0f, 2.0f, false); + servodec_init(servodec_func); + is_running = true; + + for(;;) { + + chEvtWaitAny((eventmask_t) 1); + + float servo_val = servodec_get_servo(0); + + //-------------------------------------------------------------------------------- + //test code + Uart3_printf(&SD3, (uint8_t *)"servo : %f\r\n",(float)servo_val); //170530 + //CtrlParm.qVelRef=servo_val/100.0f; + //-------------------------------------------------------------------------------- + + ui_events |= EVT_PPM; + } + +} diff --git a/oroca_bldc_FW/src/app/local_ppm_proc.h b/oroca_bldc_FW/src/app/local_ppm_proc.h new file mode 100644 index 0000000..d9c4bc1 --- /dev/null +++ b/oroca_bldc_FW/src/app/local_ppm_proc.h @@ -0,0 +1,73 @@ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * app.h + * + * Created on: 18 apr 2014 + * Author: bakchajang + */ + +#ifndef __LOCAL_PPM_PROC_H__ +#define __LOCAL_PPM_PROC_H__ + +#include + +// PPM control types +typedef enum { + PPM_CTRL_TYPE_NONE = 0, + PPM_CTRL_TYPE_CURRENT, + PPM_CTRL_TYPE_CURRENT_NOREV, + PPM_CTRL_TYPE_CURRENT_NOREV_BRAKE, + PPM_CTRL_TYPE_DUTY, + PPM_CTRL_TYPE_DUTY_NOREV, + PPM_CTRL_TYPE_PID, + PPM_CTRL_TYPE_PID_NOREV +} ppm_control_type; + +typedef struct { + ppm_control_type ctrl_type; + float pid_max_erpm; + float hyst; + float pulse_start; + float pulse_end; + bool median_filter; + bool safe_start; + float rpm_lim_start; + float rpm_lim_end; + bool multi_esc; + bool tc; + float tc_max_diff; +} ppm_config; + + +#ifdef __cplusplus +extern "C" { +#endif + +#define EVT_PPM EVENT_MASK(0) + +// Standard apps +void app_ppm_start(void); +void app_ppm_init(void); + +#ifdef __cplusplus +} +#endif + + +#endif /* APP_H_ */ diff --git a/oroca_bldc_FW/src/app/mavlink_can_proc.c b/oroca_bldc_FW/src/app/mavlink_can_proc.c new file mode 100644 index 0000000..3072ddf --- /dev/null +++ b/oroca_bldc_FW/src/app/mavlink_can_proc.c @@ -0,0 +1,327 @@ +/* + Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * comm_can.c + * + * Created on: 7 dec 2014 + * Author: benjamin + */ + +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" + +#include +#include + +#include "buffer.h" +#include "timeout.h" +#include "utils.h" +#include "mcpwm.h" + +#include "user_interface_app.h" +#include "../../lib/mavlink/oroca_bldc/mavlink.h" +#include "mavlink_can_proc.h" +#include "uart3.h" + + +// Settings +#define CANDx CAND1 +#define RX_FRAMES_SIZE 100 +#define RX_BUFFER_SIZE 1024 + +// Threads +static THD_WORKING_AREA(cancom_read_thread_wa, 512); +static THD_WORKING_AREA(cancom_process_thread_wa, 4096); +static THD_WORKING_AREA(cancom_status_thread_wa, 1024); +static THD_FUNCTION(cancom_read_thread, arg); +static THD_FUNCTION(cancom_status_thread, arg); +static THD_FUNCTION(cancom_process_thread, arg); + +// Variables +static can_status_msg stat_msgs[CAN_STATUS_MSGS_TO_STORE]; +static mutex_t can_mtx; +static uint8_t rx_buffer[RX_BUFFER_SIZE]; +static unsigned int rx_buffer_last_id; +static CANRxFrame rx_frames[RX_FRAMES_SIZE]; +static int rx_frame_read; +static int rx_frame_write; +static thread_t *process_tp; + + +uint8_t CtrlrID = 0x01; + + +/* + * 500KBaud, automatic wakeup, automatic recover + * from abort mode. + * See section 22.7.7 on the STM32 reference manual. + */ +static const CANConfig cancfg = { + CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP, + CAN_BTR_SJW(0) | CAN_BTR_TS2(1) | + CAN_BTR_TS1(8) | CAN_BTR_BRP(6)}; + + +// Private functions +static void send_packet_wrapper(unsigned char *data, unsigned int len); + +void comm_can_init(void) { + //for (int i = 0;i < CAN_STATUS_MSGS_TO_STORE;i++) { + // stat_msgs[i].id = -1; + //} + + rx_frame_read = 0; + rx_frame_write = 0; + + chMtxObjectInit(&can_mtx); + + palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(GPIO_AF_CAN1) |PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_MID1); + palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(GPIO_AF_CAN1) |PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_MID1); + + canStart(&CANDx, &cancfg); + + chThdCreateStatic(cancom_read_thread_wa, sizeof(cancom_read_thread_wa), NORMALPRIO + 1,cancom_read_thread, NULL); + chThdCreateStatic(cancom_status_thread_wa, sizeof(cancom_status_thread_wa), NORMALPRIO,cancom_status_thread, NULL); + chThdCreateStatic(cancom_process_thread_wa, sizeof(cancom_process_thread_wa), NORMALPRIO,cancom_process_thread, NULL); +} + +static THD_FUNCTION(cancom_read_thread, arg) +{ + (void)arg; + chRegSetThreadName("CAN"); + + event_listener_t el; + CANRxFrame rxmsg; + + chEvtRegister(&CANDx.rxfull_event, &el, 0); + + while(!chThdShouldTerminateX()) + { + if (chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(10)) == 0) + { + continue; + } + + msg_t result = canReceive(&CANDx, CAN_ANY_MAILBOX, &rxmsg, TIME_IMMEDIATE); + + while (result == MSG_OK) + { + rx_frames[rx_frame_write++] = rxmsg; + if (rx_frame_write == RX_FRAMES_SIZE) + { + rx_frame_write = 0; + } + + chEvtSignal(process_tp, (eventmask_t) 1); + result = canReceive(&CANDx, CAN_ANY_MAILBOX, &rxmsg, TIME_IMMEDIATE); + } + } + + chEvtUnregister(&CANDx.rxfull_event, &el); +} + +static THD_FUNCTION(cancom_process_thread, arg) { + (void)arg; + + chRegSetThreadName("Cancom process"); + process_tp = chThdGetSelfX(); + + int32_t ind = 0; + unsigned int rxbuf_len; + unsigned int rxbuf_ind; + uint8_t crc_low; + uint8_t crc_high; + bool commands_send; + + mavlink_message_t msg; + mavlink_status_t status; + + for(;;) + { + chEvtWaitAny((eventmask_t) 1); + + while (rx_frame_read != rx_frame_write) + { + CANRxFrame rxmsg = rx_frames[rx_frame_read++]; + + if (rxmsg.IDE == CAN_IDE_EXT) + { + uint8_t id = rxmsg.EID & 0xFF; + CAN_PACKET_ID cmd = rxmsg.EID >> 8; + can_status_msg *stat_tmp; + + + if (id == CtrlrID || id == CAN_PACKET_BROADCASTING) + { + for(char c=0; c < rxmsg.DLC; c++) + { + uint8_t temp = mavlink_parse_char(MAVLINK_COMM_0, rxmsg.data8[c], &msg, &status); + if( MAVLINK_MSG_ID_SET_VELOCITY == msg.msgid ) + { + mavlink_set_velocity_t set_velocity; + mavlink_msg_set_velocity_decode( &msg, &set_velocity); + + Uart3_printf(&SD3, "SET_VELOCITY\r\n"); + Uart3_printf(&SD3, "value : %d",set_velocity.ref_angular_velocity ); + + //-------------------------------------------------------------------------------- + //test code + int16_t tmp_value = set_velocity.ref_angular_velocity - 1500; + float vel = (float)tmp_value / 700.0f; + + //CtrlParm.qVelRef = vel / 100.0f; + //------------------------------------------------------------------------------ + } + + } + } + + +#if 0 + if (id == CtrlrID || id == CAN_PACKET_BROADCASTING) + { + switch (cmd) + { + case CAN_PACKET_SET_VELOCITY: + ind = 0; + + Uart3_printf(&SD3, "SET_VELOCITY\r\n"); + Uart3_printf(&SD3, "value : %d",set_velocity.ref_angular_velocity ); + + //-------------------------------------------------------------------------------- + //test code + int16_t tmp_value = (float)buffer_get_int32(rxmsg.data8, &ind) - 1500; + float vel = (float)tmp_value / 700.0f; + + CtrlParm.qVelRef = vel / 100.0f; + //------------------------------------------------------------------------------ + + timeout_reset(); + break; + default: break; + } + } + + switch (cmd) { + case CAN_PACKET_STATUS: + for (int i = 0;i < CAN_STATUS_MSGS_TO_STORE;i++) { + stat_tmp = &stat_msgs[i]; + if (stat_tmp->id == id || stat_tmp->id == CAN_PACKET_BROADCASTING) { + ind = 0; + stat_tmp->id = id; + stat_tmp->rx_time = chVTGetSystemTime(); + stat_tmp->rpm = (float)buffer_get_int32(rxmsg.data8, &ind); + stat_tmp->current = (float)buffer_get_int16(rxmsg.data8, &ind) / 10.0; + stat_tmp->duty = (float)buffer_get_int16(rxmsg.data8, &ind) / 1000.0; + break; + } + } + break; + + default: break; + } +#endif + } + } + + if (rx_frame_read == RX_FRAMES_SIZE) + { + rx_frame_read = 0; + } + + } +} + +static THD_FUNCTION(cancom_status_thread, arg) +{ + (void)arg; + chRegSetThreadName("CAN status"); + + for(;;) { + // if (app_get_configuration()->send_can_status) { + // // Send status message + // int32_t send_index = 0; + // uint8_t buffer[8]; + //buffer_append_int32(buffer, (int32_t)mc_interface_get_rpm(), &send_index); + //buffer_append_int16(buffer, (int16_t)(mc_interface_get_tot_current() * 10.0), &send_index); + //buffer_append_int16(buffer, (int16_t)(mc_interface_get_duty_cycle_now() * 1000.0), &send_index); + // comm_can_transmit(app_get_configuration()->controller_id | ((uint32_t)CAN_PACKET_STATUS << 8), buffer, send_index); + // } + + // systime_t sleep_time = CH_CFG_ST_FREQUENCY / app_get_configuration()->send_can_status_rate_hz; + // if (sleep_time == 0) { + // sleep_time = 1; + // } + + // chThdSleep(sleep_time); + chThdSleep(1000); + } +} + +void comm_can_transmit(uint32_t id, uint8_t *data, uint8_t len) { +#if CAN_ENABLE + CANTxFrame txmsg; + txmsg.IDE = CAN_IDE_EXT; + txmsg.EID = id; + txmsg.RTR = CAN_RTR_DATA; + txmsg.DLC = len; + memcpy(txmsg.data8, data, len); + + chMtxLock(&can_mtx); + canTransmit(&CANDx, CAN_ANY_MAILBOX, &txmsg, MS2ST(20)); + chMtxUnlock(&can_mtx); + +#else + (void)id; + (void)data; + (void)len; +#endif +} + +/** + * Send a buffer up to RX_BUFFER_SIZE bytes as fragments. If the buffer is 6 bytes or less + * it will be sent in a single CAN frame, otherwise it will be split into + * several frames. + * + * @param controller_id + * The controller id to send to. + * + * @param data + * The payload. + * + * @param len + * The payload length. + * + * @param send + * If true, this packet will be passed to the send function of commands. + * Otherwise, it will be passed to the process function. + */ +void comm_can_send_buffer(uint8_t controller_id, uint8_t *data, unsigned int len, bool send) +{ + uint8_t send_buffer[8]; + +// comm_can_transmit(controller_id | ((uint32_t)CAN_PACKET_PROCESS_RX_BUFFER << 8), send_buffer, ind++); + +} + + +static void send_packet_wrapper(unsigned char *data, unsigned int len) { + comm_can_send_buffer(rx_buffer_last_id, data, len, true); +} + diff --git a/oroca_bldc_FW/src/app/mavlink_can_proc.h b/oroca_bldc_FW/src/app/mavlink_can_proc.h new file mode 100644 index 0000000..e0ffc8f --- /dev/null +++ b/oroca_bldc_FW/src/app/mavlink_can_proc.h @@ -0,0 +1,74 @@ +/* + Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * comm_can.h + * + * Created on: 7 dec 2014 + * Author: benjamin + */ + +#ifndef __MAVLINK_CAN_PROC_H__ +#define __MAVLINK_CAN_PROC_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define EVT_CAN EVENT_MASK(2) + +// CAN commands +typedef enum { + CAN_PACKET_SET_VELOCITY = 0, + CAN_PACKET_SET_CURRENT, + CAN_PACKET_SET_RPM, + CAN_PACKET_SET_POS, + CAN_PACKET_FILL_RX_BUFFER, + CAN_PACKET_FILL_RX_BUFFER_LONG, + CAN_PACKET_PROCESS_RX_BUFFER, + CAN_PACKET_PROCESS_SHORT_BUFFER, + CAN_PACKET_STATUS +} CAN_PACKET_ID; + +#define CAN_PACKET_BROADCASTING 0xFF + +typedef struct { + int id; + systime_t rx_time; + float rpm; + float current;//????? + float duty;//????? +} can_status_msg; + + +// Settings +#define CAN_STATUS_MSG_INT_MS 1 +#define CAN_STATUS_MSGS_TO_STORE 10 + +// Functions +void comm_can_init(void); +void comm_can_transmit(uint32_t id, uint8_t *data, uint8_t len); +void comm_can_send_buffer(uint8_t controller_id, uint8_t *data, unsigned int len, bool send); + +#ifdef __cplusplus +} +#endif + + +#endif /* COMM_CAN_H_ */ diff --git a/oroca_bldc_FW/src/app/mavlink_uart_proc.c b/oroca_bldc_FW/src/app/mavlink_uart_proc.c new file mode 100644 index 0000000..375ee32 --- /dev/null +++ b/oroca_bldc_FW/src/app/mavlink_uart_proc.c @@ -0,0 +1,143 @@ +/* + Copyright 2012-2015 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * mavlink_proc.c + * + * Created on: 18 apr 2014 + * Author: bakchajang + */ + + +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" + +#include +#include +#include + +#include "timeout.h" +#include "utils.h" +#include "mcpwm.h" + +#include "user_interface_app.h" +#include "../../lib/mavlink/oroca_bldc/mavlink.h" +#include "mavlink_uart_proc.h" +#include "uart3.h" + + +// Threads +static THD_FUNCTION(mavlink_uart_thread, arg); +static THD_WORKING_AREA(mavlink_uart_thread_wa, 1024); + +thread_t *pMavlinkThread; + +int mavlink_uart_send( uint8_t data ) +{ + mavlink_message_t msg; + uint8_t buf[1024]; + + mavlink_msg_set_velocity_pack( 9, 121, &msg, data ); + + int len = mavlink_msg_to_send_buffer(buf, &msg); + + Uart3_write(buf, len); + + return 0; +} + + +bool mavlink_uart_recv( uint8_t ch ) +{ + bool ret = false; + + mavlink_message_t msg; + mavlink_status_t status; + + uint8_t temp = mavlink_parse_char(MAVLINK_COMM_0, ch, &msg, &status); + + //Uart3_printf(&SD3, "%02x ",ch); + + if (temp == MAVLINK_FRAMING_OK) + { + if( MAVLINK_MSG_ID_SET_VELOCITY == msg.msgid ) + { + mavlink_set_velocity_t set_velocity; + mavlink_msg_set_velocity_decode( &msg, &set_velocity); + + Uart3_printf(&SD3, "SET_VELOCITY\r\n"); + Uart3_printf(&SD3, "value : %d",(uint16_t)set_velocity.ref_angular_velocity ); + + //-------------------------------------------------------------------------------- + //test code + int16_t tmp_value = set_velocity.ref_angular_velocity - 1500; + float vel = (float)tmp_value / 700.0f; + + CtrlParm.qVelRef = vel / 100.0f; + //------------------------------------------------------------------------------ + ret = true; + } + } + + + return ret; +} + + + +static THD_FUNCTION(mavlink_uart_thread, arg) +{ + (void)arg; + + uint8_t Ch; + + chRegSetThreadName("mavlink_uart_rx_process"); + + for(;;) + { + //chThdSleepMilliseconds(1); + Ch = Uart3_getch(); + + if( mavlink_uart_recv( Ch ) ) + { + //mavlink_uart_send( 1 ); //hand shake? + + ui_events |= EVT_UART_RX; + } + } + + return 0; + +} + + +void mavlink_uart_proc_configure(void) +{ + Uart3_init(); + return; +} + +void mavlink_uart_proc_start(void) +{ + chThdCreateStatic(mavlink_uart_thread_wa, sizeof(mavlink_uart_thread_wa), NORMALPRIO, mavlink_uart_thread, NULL); +} + + +//-------------------------------------------------------------- +//function below + diff --git a/oroca_bldc_FW/src/app/mavlink_uart_proc.h b/oroca_bldc_FW/src/app/mavlink_uart_proc.h new file mode 100644 index 0000000..9ef23cd --- /dev/null +++ b/oroca_bldc_FW/src/app/mavlink_uart_proc.h @@ -0,0 +1,43 @@ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * app.h + * + * Created on: 18 apr 2014 + * Author: bakchajang + */ + +#ifndef __MAVLINK_UART_PROC_H__ +#define __MAVLINK_UART_PROC_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define EVT_UART_RX EVENT_MASK(1) + +void mavlink_uart_proc_configure(void); +void mavlink_uart_proc_start(void); + +#ifdef __cplusplus +} +#endif + +#endif /* APP_H_ */ diff --git a/oroca_bldc_FW/src/app/user_interface_app.c b/oroca_bldc_FW/src/app/user_interface_app.c new file mode 100644 index 0000000..33c2c27 --- /dev/null +++ b/oroca_bldc_FW/src/app/user_interface_app.c @@ -0,0 +1,79 @@ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * app.c + * + */ +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" +#include "hw.h" + +#include +#include +#include +#include +#include +#include + +#include "mavlink_uart_proc.h" +#include "user_interface_app.h" +#include "uart3.h" + +eventmask_t ui_events = 0; + +// Threads +static THD_FUNCTION(user_interface_thread, arg); +static THD_WORKING_AREA(user_interface_thread_wa, 512); + +void user_interface_configure(void) +{ + //Uart3_printf(&SD3, (uint8_t *)"oroca_bldc\r\n");//170530 + mavlink_uart_proc_configure(); + mavlink_uart_proc_start(); + + //Uart3_printf(&SD3, (uint8_t *)"app_init.....\r\n"); + app_ppm_configure(); + app_ppm_start(); +} + +static THD_FUNCTION(user_interface_thread, arg) +{ + (void)arg; + + //uint8_t Ch; + + chRegSetThreadName("user_interface_process"); + + for(;;) + { + if (ui_events) + { + chSysLockFromISR(); + //chEvtSignalI(pMavlinkThread, ui_events); + chSysUnlockFromISR(); + } + } + +} + + +void user_interface_start(void) +{ + chThdCreateStatic(user_interface_thread_wa, sizeof(user_interface_thread_wa), NORMALPRIO, user_interface_thread, NULL); +} diff --git a/oroca_bldc_FW/src/app/user_interface_app.h b/oroca_bldc_FW/src/app/user_interface_app.h new file mode 100644 index 0000000..af608c8 --- /dev/null +++ b/oroca_bldc_FW/src/app/user_interface_app.h @@ -0,0 +1,45 @@ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * app.h + * + * Created on: 18 apr 2014 + * Author: bakchajang + */ + +#ifndef __USER_INTERFACE_APP_H__ +#define __USER_INTERFACE_APP_H__ + +#include "local_ppm_proc.h" +#include "mavlink_uart_proc.h" +#include "mavlink_can_proc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern eventmask_t ui_events; + +// Standard apps +void user_interface_configure(void); + +#ifdef __cplusplus +} +#endif + +#endif /* APP_H_ */ diff --git a/oroca_bldc_FW/src/bldc/bldc.c b/oroca_bldc_FW/src/bldc/bldc.c index 1c96e10..154f497 100755 --- a/oroca_bldc_FW/src/bldc/bldc.c +++ b/oroca_bldc_FW/src/bldc/bldc.c @@ -1,5 +1,5 @@ -/* - Copyright 2012-2015 Benjamin Vedder benjamin@vedder.se +/* + Copyright 2012-2015 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,13 +16,19 @@ */ /* OROCA BLDC PROJECT. +*/ +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" - - */ - +#include "hw.h" #include "bldc.h" -#include "usb_uart.h" -#include "../../mavlink/oroca_bldc/mavlink.h" +#include "Mcpwm.h" +#include +#include +#include +#include +#include "../core/uart3.h" @@ -49,36 +55,26 @@ * */ -int send( uint8_t data ); -bool recv( uint8_t ch ); - - - -static THD_WORKING_AREA(periodic_thread_wa, 1024); -static THD_WORKING_AREA(uart_thread_wa, 128); - - - -static msg_t periodic_thread(void *arg) { +static THD_WORKING_AREA(periodic_thread_wa, 128); +static THD_FUNCTION(periodic_thread, arg) +{ (void)arg; - chRegSetThreadName("Main periodic"); + chRegSetThreadName("BLDC periodic"); - int fault_print = 0; + //Uart3_printf(&SD3, (uint8_t *)"periodic_thread\r\n");//170530 for(;;) { - - chThdSleepMilliseconds(10); + LED_GREEN_ON(); + chThdSleepMilliseconds(500); + LED_GREEN_OFF(); + chThdSleepMilliseconds(500); } - - return 0; } - - int bldc_init(void) { halInit(); @@ -86,45 +82,16 @@ int bldc_init(void) chThdSleepMilliseconds(1000); - conf_general_init(); hw_init_gpio(); + //spi_dac_hw_init(); + //spi_dac_write_A( 100) ; - mc_configuration mcconf; - conf_general_read_mc_configuration(&mcconf); - mcpwm_init(&mcconf); - - comm_usb_init(); - - app_configuration appconf; - conf_general_read_app_configuration(&appconf); + mcpwm_init(); + //chThdSleepMilliseconds(1000); - - return 0; -} - - -uint8_t Ch; - -static msg_t uart_process_thread(void *arg) { - (void)arg; - - chRegSetThreadName("uart rx process"); - - //process_tp = chThdSelf(); - - for(;;) - { - //chThdSleepMilliseconds(1); - - Ch = usb_uart_getch(); - if( recv( Ch ) ) - { - send( 1 ); - } - } - + bldc_start(); return 0; } @@ -137,89 +104,11 @@ uint16_t dbg_AccumTheta; int bldc_start(void) { - - - - //-- 스레드 ìƒì„± - // chThdCreateStatic(periodic_thread_wa, sizeof(periodic_thread_wa), NORMALPRIO, periodic_thread, NULL); - chThdCreateStatic(uart_thread_wa, sizeof(uart_thread_wa), NORMALPRIO, uart_process_thread, NULL); - + //CtrlParm.qVelRef=-0.01f; - //-- IDLE - // - for(;;) - { - //palSetPad(GPIOA, 7); - chThdSleepMilliseconds(1); - //palClearPad(GPIOA, 7); - - //Ch = usb_uart_getch(); - - /* - if( Ch == 'q' ) - { - Ch = 0; - qVelRef += 0.01; - //debug_print_usb("Enter q : %f\r\n", qVelRef); - - } - if( Ch == 'a' ) - { - Ch = 0; - qVelRef -= 0.01; - //debug_print_usb("Enter a : %f\r\n", qVelRef); - } - - //debug_print_usb("8 %f 0\r\n", dbg_fTheta ); - //debug_print_usb("%d\r\n", dbg_AccumTheta ); - usb_uart_printf("500 %f %f 0\r\n", qVelRef*10000, dbg_fMea*10000 ); - */ - } -} - - -int send( uint8_t data ) -{ - mavlink_message_t msg; // Mavlink 메세지 구조체 - uint8_t buf[1024]; // ë©”ì„¸ì§€ì˜ ì—”ì½”ë”©ëœ ì „ì†¡ 프레임 - - // TEST_CMD ë©”ì„¸ì§€ì— ëŒ€í•œ ìžë™ìœ¼ë¡œ ìƒì„±ëœ 함수, - // ì¸ìž 1ì€ System ID ==> ex)ê°™ì€ ë©”ì„¸ì§€ë„ ì—¬ëŸ¬ 보드로 구분할때 사용. - // ì¸ìž 2는 ì»´í¬ë„ŒíЏ ID ==> ex) 한 ë³´ë“œë‚´ì— ì—¬ëŸ¬ êµ¬ë£¹ì´ ìžˆì„때 구분용으로 사용 . - // ì¸ìž 4 부터는 메세지 ì •ì˜ì‹œ 필드 항목 - cmd_1, arg1,arg2 - mavlink_msg_test_cmd_pack( 9, 121, &msg, data ,92,93); - - // ë‹¤ìŒ í•¨ìˆ˜ë‚´ë¶€ì—서 전송할 í”„ë ˆìž„ì„ ì™„ì„±í•¨, CRC ìƒì„±ë“± - int len = mavlink_msg_to_send_buffer(buf, &msg); - - // 시리얼 í¬íŠ¸ë¡œ ë²„í¼ í¬ì¸í„°ëŠ” buf, 길ì´ëŠ” len ë‚´ìš©ì„ ì „ë‹¬ 하면 ì™„ì„±ë¨ + return 0; - usb_uart_write(buf, len); } - -bool recv( uint8_t ch ) -{ - bool ret = false; - - - mavlink_message_t msg; // 로컬변수로 ì„ ì–¸í•´ë„ ìž˜ 수행 ë˜ëŠ”ë° ì•„ë§ˆë„ ì‹¤ì œ ìžë£Œêµ¬ì¡°ëŠ” static 으로 구현 ë˜ëŠ”ê±° 같아요. - mavlink_status_t status; // 현재 ìˆ˜ì‹ ëœ ë°ì´í„° 파싱한 ìƒíƒœ 리턴값. - - if (mavlink_parse_char(MAVLINK_COMM_0, ch, &msg, &status) == MAVLINK_FRAMING_OK) - { - if( MAVLINK_MSG_ID_TEST_CMD == msg.msgid ) // 메세지 ID ê°€ TEST_CMD ë¼ë©´ í•´ì„ - { - mavlink_test_cmd_t test_cmd; - mavlink_msg_test_cmd_decode( &msg, &test_cmd); // 메세지 디코딩 - - //Serial.print("seq= "); - //Serial.println(test_cmd.arg1); - ret = true; - } - } - - return ret; -} diff --git a/oroca_bldc_FW/src/bldc/bldc.h b/oroca_bldc_FW/src/bldc/bldc.h index 0a99725..8dd8af9 100755 --- a/oroca_bldc_FW/src/bldc/bldc.h +++ b/oroca_bldc_FW/src/bldc/bldc.h @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,17 +36,12 @@ #include "hal.h" #include "stm32f4xx_conf.h" -#include "conf_general.h" +//#include "conf_general.h" +#define MCCONF_OUTRUNNER2 -#include "mcpwm.h" -#include "comm_usb.h" #include "hw.h" - -//jsyoon -#include "chprintf.h" -#include "memstreams.h" - +#include "mcpwm.h" #ifdef __cplusplus extern "C" { diff --git a/oroca_bldc_FW/src/bldc/mcpwm.c b/oroca_bldc_FW/src/bldc/mcpwm.c index d437ee4..cc5d348 100755 --- a/oroca_bldc_FW/src/bldc/mcpwm.c +++ b/oroca_bldc_FW/src/bldc/mcpwm.c @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,26 +19,28 @@ * mcpwm.c * * Created on: 13 okt 2012 - * Author: benjamin + * Author: bakchajang */ #include "ch.h" #include "hal.h" #include "stm32f4xx_conf.h" +#include "hw.h" + +//#include "main.h" +#include "mcpwm.h" +#include "utils.h" +#include +#include #include #include #include #include -#include "main.h" -#include "mcpwm.h" -#include "utils.h" -#include "hw.h" +#include "../core/uart3.h" + -#include -#include -// Structs union{ struct { unsigned OpenLoop:1; // Indicates if motor is running in open or closed loop @@ -56,152 +58,8 @@ union{ WORD Word; } uGF; -typedef struct { - float qKa; - short Offseta; - - float qKb; - short Offsetb; -} tMeasCurrParm; - -typedef struct { - float Valpha; // Input: Stationary alfa-axis stator voltage - float Ealpha; // Variable: Stationary alfa-axis back EMF - float EalphaFinal; // Variable: Filtered EMF for Angle calculation - float Zalpha; // Output: Stationary alfa-axis sliding control - float Gsmopos; // Parameter: Motor dependent control gain - float EstIalpha; // Variable: Estimated stationary alfa-axis stator current - float Fsmopos; // Parameter: Motor dependent plant matrix - float Vbeta; // Input: Stationary beta-axis stator voltage - float Ebeta; // Variable: Stationary beta-axis back EMF - float EbetaFinal; // Variable: Filtered EMF for Angle calculation - float Zbeta; // Output: Stationary beta-axis sliding control - float EstIbeta; // Variable: Estimated stationary beta-axis stator current - float Ialpha; // Input: Stationary alfa-axis stator current - float IalphaError; // Variable: Stationary alfa-axis current error - float Kslide; // Parameter: Sliding control gain - float MaxSMCError; // Parameter: Maximum current error for linear SMC - float Ibeta; // Input: Stationary beta-axis stator current - float IbetaError; // Variable: Stationary beta-axis current error - float Kslf; // Parameter: Sliding control filter gain - float KslfFinal; // Parameter: BEMF Filter for angle calculation - float FiltOmCoef; // Parameter: Filter Coef for Omega filtered calc - float ThetaOffset; // Output: Offset used to compensate rotor angle - float Theta; // Output: Compensated rotor angle - float Omega; // Output: Rotor speed - float OmegaFltred; // Output: Filtered Rotor speed for speed PI -} SMC; -typedef SMC *SMC_handle; - -typedef struct { - float qdSum; // 1.31 format - float qKp; - float qKi; - float qKc; - float qOutMax; - float qOutMin; - float qInRef; - float qInMeas; - float qOut; - } tPIParm; - -typedef struct { - float qAngle; - float qSin; - float qCos; - float qIa; - float qIb; - float qIalpha; - float qIbeta; - float qId; - float qIq; - float qVd; - float qVq; - float qValpha; - float qVbeta; - float qV1; - float qV2; - float qV3; - } tParkParm; - -typedef struct { - float qVelRef; // Reference velocity - float qVdRef; // Vd flux reference value - float qVqRef; // Vq torque reference value - } tCtrlParm; - -//------------------ C API for FdWeak routine --------------------- - -typedef struct { - float qK1; // < Nominal speed value - float qIdRef; - float qFwOnSpeed; - float qFwActiv; - int qIndex; - float qFWPercentage; - float qInterpolPortion; - float qFwCurve[16]; // Curve for magnetizing current - } tFdWeakParm; - -//------------------ C API for SVGen routine --------------------- - -typedef struct { - unsigned int iPWMPeriod; - - float qVr1; - float qVr2; - float qVr3; - - float T1; - float T2; - - unsigned int Ta; - unsigned int Tb; - unsigned int Tc; - - } tSVGenParm; - - - -//============================================================== -//define -#define Digital_PI_controller(out, ref, in, err0, limit, kp, ki, tsample) \ - { \ - float err, tmp_kp, tmp_kpi; \ - tmp_kp = (float)(kp); \ - tmp_kpi = (float)(kp + ki*tsample); \ - err = ref - in; \ - out += ((tmp_kpi * err) - (tmp_kp * err0)); \ - out = Bound_limit(out, limit); \ - err0 = err; \ - } -#define Bound_limit(in,lim) ((in > (lim)) ? (lim) : ((in < -(lim)) ? -(lim) : in)) -#define Bound_min_max(in, min, max) ((in > (max)) ? (max) : ((in < (min)) ? (min) : in)) - -#define Low_pass_filter(out, in, in_old, alpha) \ - { \ - float tmp; \ - tmp = alpha*(in + in_old - (out*2)); \ - out += tmp; \ - in_old = in; \ - } - - -static volatile mc_fault_code fault_now; -static volatile bool dccal_done; - - -// Private variables -int count = 0; // delay for ramping the reference velocity -int VelReq = 0; - - -static volatile tMeasCurrParm MeasCurrParm; -SMC smc1 = SMC_DEFAULTS; - -// Global variables -uint16_t ADC_Value[HW_ADC_CHANNELS]; +SMC smc1; tParkParm ParkParm; tPIParm PIParmD; // Structure definition for Flux component of current, or Id @@ -212,8 +70,15 @@ tPIParm PIParmPLL; tCtrlParm CtrlParm; tSVGenParm SVGenParm; tFdWeakParm FdWeakParm; +static volatile tMeasCurrParm MeasCurrParm; + +static volatile bool dccal_done; + +int VelReq = 0; + +// Global variables +uint16_t ADC_Value[HW_ADC_CHANNELS]; -int SpeedReference = 0; unsigned int switching_frequency_now = PWMFREQUENCY; // Speed Calculation Variables @@ -240,75 +105,19 @@ static volatile float TargetDCbus = 0;// DC Bus is measured before running motor // variable. Any variation on DC bus will be compared to this value // and compensated linearly. -static volatile float Theta_error = 0;// This value is used to transition from open loop to closed looop. - // At the end of open loop ramp, there is a difference between - // forced angle and estimated angle. This difference is stored in - // Theta_error, and added to estimated theta (smc1.Theta) so the - // effective angle used for commutating the motor is the same at - // the end of open loop, and at the begining of closed loop. - // This Theta_error is then substracted from estimated theta - // gradually in increments of 0.05 degrees until the error is less - // than 0.05 degrees. - -// Private functions - -bool SetupParm(void); - -void MeasCompCurr( int curr1, int curr2 ); -void InitMeasCompCurr( short Offset_a, short Offset_b ); - -//void InitPI( tPIParm *pParm); -//void CalcPI( tPIParm *pParm); - -void SinCos(void); // Calculate qSin,qCos from iAngle -void ClarkePark(void); // Calculate qId,qIq from qCos,qSin,qIa,qIb -void InvPark(void); // Calculate qValpha, qVbeta from qSin,qCos,qVd,qVq -void FWInit (void); -float FieldWeakening(float qMotorSpeed); - -void CalcRefVec( void ); -void CalcSVGen( void ); -void CorrectPhase( void ); -void update_timer_Duty(unsigned int duty_A,unsigned int duty_B,unsigned int duty_C); - -float VoltRippleComp(float Vdq); - -mc_rpm_dep_struct mcpwm_get_rpm_dep(void); -const volatile mc_configuration* mcpwm_get_configuration(void); -void mcpwm_set_configuration(mc_configuration *configuration); - - -// Interrupt handlers -void mcpwm_adc_inj_int_handler(void); -void mcpwm_adc_int_handler(void *p, uint32_t flags); - - -static void do_dc_cal(void); -void SMC_HallSensor_Estimation (SMC *s); -void CalcPI( tPIParm *pParm); -void DoControl( void ); -void InitPI( tPIParm *pParm); -void SetupControlParameters(void); -void update_timer_Duty(unsigned int duty_A,unsigned int duty_B,unsigned int duty_C); - -// Threads -static THD_WORKING_AREA(SEQUENCE_thread_wa, 2048); -static msg_t SEQUENCE_thread(void *arg); -//static WORKING_AREA(rpm_thread_wa, 1024); -//static msg_t rpm_thread(void *arg); - +void mcpwm_init(void) +{ -void mcpwm_init(mc_configuration *configuration) { + //Uart3_printf(&SD3, (uint8_t *)"mcpwm_init....\r\n");//170530 utils_sys_lock_cnt(); TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_OCInitTypeDef TIM_OCInitStructure; TIM_BDTRInitTypeDef TIM_BDTRInitStructure; - NVIC_InitTypeDef NVIC_InitStructure; + //NVIC_InitTypeDef NVIC_InitStructure; // Initialize variables - fault_now = FAULT_CODE_NONE; dccal_done = false; TIM_DeInit(TIM1); @@ -417,8 +226,6 @@ void mcpwm_init(mc_configuration *configuration) { ADC_InitStructure.ADC_NbrOfConversion = HW_ADC_NBR_CONV; ADC_Init(ADC1, &ADC_InitStructure); - ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None; - ADC_InitStructure.ADC_ExternalTrigConv = 0; ADC_Init(ADC2, &ADC_InitStructure); ADC_Init(ADC3, &ADC_InitStructure); @@ -427,29 +234,9 @@ void mcpwm_init(mc_configuration *configuration) { // Enable DMA request after last transfer (Multi-ADC mode) ADC_MultiModeDMARequestAfterLastTransferCmd(ENABLE); - // Injected channels for current measurement at end of cycle - ADC_ExternalTrigInjectedConvConfig(ADC1, ADC_ExternalTrigInjecConv_T8_CC2); - ADC_ExternalTrigInjectedConvConfig(ADC2, ADC_ExternalTrigInjecConv_T8_CC3); - ADC_ExternalTrigInjectedConvEdgeConfig(ADC1, ADC_ExternalTrigInjecConvEdge_Falling); - ADC_ExternalTrigInjectedConvEdgeConfig(ADC2, ADC_ExternalTrigInjecConvEdge_Falling); - ADC_InjectedSequencerLengthConfig(ADC1, 1); - ADC_InjectedSequencerLengthConfig(ADC2, 1); - - // Interrupt - ADC_ITConfig(ADC1, ADC_IT_JEOC, ENABLE); - NVIC_InitStructure.NVIC_IRQChannel = ADC_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); - - // Enable ADC1 + // Enable ADC ADC_Cmd(ADC1, ENABLE); - - // Enable ADC2 ADC_Cmd(ADC2, ENABLE); - - // Enable ADC3 ADC_Cmd(ADC3, ENABLE); // ------------- Timer8 for ADC sampling ------------- // @@ -510,7 +297,6 @@ void mcpwm_init(mc_configuration *configuration) { // TIM2 enable counter TIM_Cmd(TIM2, ENABLE); - // ADC sampling locations //stop_pwm_hw(); utils_sys_lock_cnt(); @@ -519,7 +305,7 @@ void mcpwm_init(mc_configuration *configuration) { TIM1->CR1 |= TIM_CR1_UDIS; TIM8->CR1 |= TIM_CR1_UDIS; - TIM8->CCR1 = 500;//for vdc + TIM8->CCR1 = TIM1->ARR;//for vdc TIM8->CCR2 = TIM1->ARR;//for Ib TIM8->CCR3 = TIM1->ARR;//for Ia @@ -529,12 +315,13 @@ void mcpwm_init(mc_configuration *configuration) { utils_sys_unlock_cnt(); - // Calibrate current offset ENABLE_GATE(); DCCAL_OFF(); GAIN_FULLDN(); do_dc_cal(); + //Uart3_printf(&SD3, (uint8_t *)"5-1\r\n"); + // Enable transfer complete interrupt // Various time measurements @@ -551,10 +338,6 @@ void mcpwm_init(mc_configuration *configuration) { // TIM3 enable counter TIM_Cmd(TIM12, ENABLE); - // Start threads - chThdCreateStatic(SEQUENCE_thread_wa, sizeof(SEQUENCE_thread_wa), NORMALPRIO, SEQUENCE_thread, NULL); - ////chThdCreateStatic(rpm_thread_wa, sizeof(rpm_thread_wa), NORMALPRIO, rpm_thread, NULL); - // WWDG configuration RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE); WWDG_SetPrescaler(WWDG_Prescaler_1); @@ -562,10 +345,17 @@ void mcpwm_init(mc_configuration *configuration) { WWDG_Enable(100); -//--------------------------------------------------------------------------- +//-------------------------------------------------- +//main ctrl setup + SetupParm(); SetupControlParameters(); + + //dmaStreamAllocate(STM32_DMA_STREAM(STM32_DMA_STREAM_ID(2, 4)),3,(stm32_dmaisr_t)mcpwm_adc_int_handler,(void *)0); + //DMA_ITConfig(DMA2_Stream4, DMA_IT_TC, ENABLE); + + uGF.Word = 0; // clear flags #ifdef TORQUEMODE uGF.bit.EnTorqueMod = 1; @@ -577,6 +367,8 @@ void mcpwm_init(mc_configuration *configuration) { uGF.bit.RunMotor = 1; + +// } @@ -585,7 +377,7 @@ static volatile int curr1_sum; static volatile int curr_start_samples; static volatile int curr0_offset; static volatile int curr1_offset; -static void do_dc_cal(void) +void do_dc_cal(void) { DCCAL_ON(); while(IS_DRV_FAULT()){}; @@ -598,280 +390,130 @@ static void do_dc_cal(void) curr1_offset = curr1_sum / curr_start_samples; DCCAL_OFF(); dccal_done = true; + + //Uart3_printf(&SD3, (uint8_t *)"curr0_offset : %u\r\n",curr0_offset);//170530 + //Uart3_printf(&SD3, (uint8_t *)"curr1_offset : %u\r\n",curr1_offset);//170530 } -void mcpwm_adc_inj_int_handler(void) +void mcpwm_adc_int_prehandler(void *p, uint32_t flags) { - TIM12->CNT = 0; - - int curr0 = ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1); - int curr1 = ADC_GetInjectedConversionValue(ADC2, ADC_InjectedChannel_1); + (void)p; + (void)flags; +// LED_RED_ON(); - curr0_sum += curr0; - curr1_sum += curr1; curr_start_samples++; + curr0_sum += ADC_Value[ADC_IND_CURR1] ; + curr1_sum += ADC_Value[ADC_IND_CURR2] ; - SMC_HallSensor_Estimation (&smc1); - - //spi_dac_write_A( dacDataA++); - //spi_dac_write_B( dacDataB--); - - - if( uGF.bit.RunMotor ) - { - ENABLE_GATE(); - LED_RED_ON(); - - // Calculate qIa,qIb - MeasCompCurr(curr0,curr1); - - - //debug_print_usb( "%f,%d,%d\r\n",ParkParm.qAngle ,curr0,curr1); - - - // Calculate commutation angle using estimator - ParkParm.qAngle = smc1.Theta; - - //ParkParm.qAngle = (float)IN[2]; - //smc1.Omega = (float)IN[3] *LOOPTIMEINSEC * IRP_PERCALC * POLEPAIRS/PI; - - AccumThetaCnt++; - if (AccumThetaCnt == IRP_PERCALC) - { - AccumThetaCnt = 0; - } - - - // Calculate qId,qIq from qSin,qCos,qIa,qIb - ClarkePark(); - - // Calculate control values - DoControl(); +// LED_RED_OFF(); - - //ParkParm.qVd =0.5f; - //ParkParm.qVq = 0.0f; - - //ParkParm.qAngle = 0.0f; - - //ParkParm.qAngle -= 0.002f; - //if( ParkParm.qAngle < 0)ParkParm.qAngle=2*PI; - - //ParkParm.qAngle += 0.002f; - //if(2*PI < ParkParm.qAngle)ParkParm.qAngle=2*PI - ParkParm.qAngle; - - - // Calculate qValpha, qVbeta from qSin,qCos,qVd,qVq - InvPark(); - - // Calculate Vr1,Vr2,Vr3 from qValpha, qVbeta - CalcRefVec(); - - // Calculate and set PWM duty cycles from Vr1,Vr2,Vr3 - CalcSVGen(); - - LED_RED_OFF(); - //DISABLE_GATE(); - - - } - else - { - DISABLE_GATE(); - } - - + // Reset the watchdog + WWDG_SetCounter(100); } /* * New ADC samples ready. Do commutation! */ -void mcpwm_adc_int_handler(void *p, uint32_t flags) { +void mcpwm_adc_int_handler(void *p, uint32_t flags) +{ (void)p; (void)flags; TIM12->CNT = 0; - LED_GREEN_ON(); - LED_GREEN_OFF(); + curr_start_samples++; + curr0_sum += ADC_Value[ADC_IND_CURR1] ; + curr1_sum += ADC_Value[ADC_IND_CURR2] ; - // Reset the watchdog - WWDG_SetCounter(100); - + SMC_HallSensor_Estimation (&smc1); // Check for faults that should stop the motor + uGF.bit.RunMotor = 1; + if( uGF.bit.RunMotor ) + { + ENABLE_GATE(); +// LED_RED_ON(); + + // Calculate qIa,qIb + int CorrADC1, CorrADC2; -} - - -int Seq = 0; -int Fault_seq = 0; -int Init_Charge_cnt_EN = 0; -long Init_Charge_cnt = 0.; -unsigned int Init_Charge_Time = 3000; // 3å ì™ì˜™ - -//int Retry_cnt_En = 0; -//long Retry_cnt = 0; -//int Retry_Time_set = 0; -//int DRIVE_ENABLE = 0; - -unsigned int Drive_Status = 0; -unsigned int State_Index = 0; + CorrADC1 = ADC_Value[ADC_IND_CURR1] - MeasCurrParm.Offseta; + CorrADC2 = ADC_Value[ADC_IND_CURR2] - MeasCurrParm.Offsetb; + // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); + ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; + ParkParm.qIb = MeasCurrParm.qKb * (float)CorrADC2; + + //Uart3_printf(&SD3, "%f,%d,%d\r\n",ParkParm.qAngle ,ParkParm.qIa,CorrADC2); -static msg_t SEQUENCE_thread(void *arg) -{ - (void)arg; + // Calculate commutation angle using estimator + ParkParm.qAngle = smc1.Theta; + + //ParkParm.qAngle = (float)IN[2]; + //smc1.Omega = (float)IN[3] *LOOPTIMEINSEC * IRP_PERCALC * POLEPAIRS/PI; + + AccumThetaCnt++; + if (AccumThetaCnt == IRP_PERCALC) + { + AccumThetaCnt = 0; + } + + + // Calculate qId,qIq from qSin,qCos,qIa,qIb + ParkParm.qIalpha = ParkParm.qIa; + ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; + // Ialpha and Ibeta have been calculated. Now do rotation. + // Get qSin, qCos from ParkParm structure + + ParkParm.qId = -ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); + ParkParm.qIq = ParkParm.qIalpha*sinf(ParkParm.qAngle) + ParkParm.qIbeta*cosf(ParkParm.qAngle); + + // Calculate control values + DoControl(); + + //============================================================================= + //for open loop test + //ParkParm.qVd =0.5f; + //ParkParm.qVq = 0.0f; + + //ParkParm.qAngle = 0.0f; + + //ParkParm.qAngle -= 0.002f; + //if( ParkParm.qAngle < 0)ParkParm.qAngle=2*PI; + + //ParkParm.qAngle += 0.002f; + //if(2*PI < ParkParm.qAngle)ParkParm.qAngle=2*PI - ParkParm.qAngle; + //============================================================================== + + // Calculate qValpha, qVbeta from qSin,qCos,qVd,qVq + ParkParm.qValpha = ParkParm.qVd*cosf(ParkParm.qAngle) - ParkParm.qVq*sinf(ParkParm.qAngle); + ParkParm.qVbeta = ParkParm.qVd*sinf(ParkParm.qAngle) + ParkParm.qVq*cosf(ParkParm.qAngle); + + // Calculate Vr1,Vr2,Vr3 from qValpha, qVbeta + SVGenParm.qVr1 = ParkParm.qVbeta; + SVGenParm.qVr2 = (-ParkParm.qVbeta + SQRT3 * ParkParm.qValpha)/2; + SVGenParm.qVr3 = (-ParkParm.qVbeta - SQRT3 * ParkParm.qValpha)/2; - chRegSetThreadName("mcpwm timer"); -#if 0 //pbhp 151001 - fault_now = Flag.Fault1.all; - if( fault_now) - { - Fault_seq = Seq; - Seq=SEQ_Fault; + CalcSVGen(); + +// LED_RED_OFF(); + //DISABLE_GATE(); + + } - - switch(Seq) + else { - // å ì‹œì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ?å ì‹¤ëŒì˜™ Runå ì™ì˜™í˜¸ å ì‹¸ê³¤ì˜™ å ì™ì˜™ å ì‹œì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì™ì˜™ å ì™ì˜™å ? - case SEQ_NoReady: // " 0 " - stop_pwm_hw(); - // å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™ å ì™ì˜™ å ì‹œê³¤ì˜™ å ì½ë ˆå ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì‹¹ë¤„옙 å ì™ì˜™í˜¸ å ìŒ©ì‚¼ì˜™ - Init_Charge_cnt_EN=1; - if(Init_Charge_cnt >= (float)Init_Charge_Time * 1e-3 / LOOPTIMEINSEC) // å ì‹­ê¹ì˜™ å ì™ì˜™å ì™ì˜™ å ì‹œê³¤ì˜™ 3å ì™ì˜™ - { - nDC_CONTACT_CLEAR; - Flag.Fault_Cntl.bit.UV_Check_En = 1; - if(Init_Charge_cnt >= ((float)Init_Charge_Time + 100.) * 1e-3 / LOOPTIMEINSEC) // å ì‹­ê¹ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™ å ì™ì˜™ 3.1å ì™ì˜™ å ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì™ì˜™í™˜ - { - // å ì™ì˜™å ì™ì˜™ å ì‹­ê¹ì˜™ å ì™ì˜™å ì™ì˜™ 회å ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™è‡¼å ?å ìŒ•뤄옙 å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™ å ì‹¼ì–µì˜™ å ì™ì˜™å ì™ì˜™ å ì‹­ê³¤ì˜™ - // å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™ 확å ì™ì˜™ å ì™ì˜™ å ì‹¼ì–´ê°€å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™ å ì™ì˜™ å ì™ì˜™ - Seq = SEQ_Wait; - Init_Charge_cnt_EN=0; - } - } - // Seq = SEQ_Wait; - Green_LED_off; - break; - - - // å ì‹œì™ì˜™å ì™ì˜™ Ready å ì™ì˜™å ì™ì˜™å ì‹±ëªŒì˜™ Run Signal å ì™ì˜™å ?å ì™ì˜™å ì™ì˜™ å ì™ì˜™ - case SEQ_Wait: // " 1 " - if(( FaultReg1[1] )||( FaultReg2[1] )) Fault_seq = SEQ_Wait, Seq=SEQ_Fault; - else - { - State_Index = STATE_READY; - Run_Stop_Status = 0; - Run_Stop_Operation(); - if(DRIVE_ENABLE==RUNN) Seq=SEQ_Normal; - else Drive_Off(); - } - Red_LED_off; - State_Index = STATE_STOP; - break; - - // Run å ì™ì˜™í˜¸ å ì‹¸ê³¤ì˜™ å ì™ì˜™ å ì‹œì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™ - case SEQ_Normal: // " 2 " - if(( FaultReg1[1] )||( FaultReg2[1] )) Fault_seq = SEQ_Normal, Seq=SEQ_Fault; - else - { - State_Index = STATE_RUNNING; - // Run_Time_Delay_time å ì™ì˜™ Machine_state 1å ì™ì˜™ å ì‹«ëŒì˜™ - /* if (Machine_state == RUNN) - { - // Flag.Monitoring.bit. - } - */ - Run_Stop_Operation(); - if(DRIVE_ENABLE==RUNN) Drive_On(); - else - { - if((Position_Flag)||(Start_Flag)) Seq=SEQ_Wait; - else Wrpm_ref_set = 0.0; - } - } - Red_LED_off; - Green_LED_on; - break; - - - // System Fault - case SEQ_Fault: // " 3 " - - State_Index = STATE_FAULT; - Run_Stop_Status = 0; - stop_pwm_hw(); // Converter Off - // å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ì™ì˜™å ì™ì˜™å ì™ì˜™ å ì™ì˜™íЏ å ì™ì˜™å ì™ì˜™ å ì™ì˜™í™˜ å ì™ì˜™å ì™ì˜™ 표å ì™ì˜™ - - if((!FaultReg1[1])&&(!FaultReg2[1])) Seq=SEQ_Retrial; - - if ((( FaultReg1[1] ) || ( FaultReg2[1] )) - && (( FaultReg1[1] > FaultReg1[0] ) || ( FaultReg2[1] > FaultReg2[0] ))) - { - // å ì™ì˜™å ì™ì˜™ å ì™ì˜™å ?å ì™ì˜™å ì‹œë“¸ì˜™ å ì™ì˜™íЏå ì™ì˜™ å ì™ì˜™å ìŒ”쇽옙 å ì™ì˜™å ì™ì˜™ å ì‹ë°ì˜™å ì‹ ëªŒì˜™å ì™ì˜™å ?å ì‹­ê¹ì˜™í™” - Fault_count++; - Word_Write_data(2379, Fault_count); // Fault 횟å ì™ì˜™å ì™ì˜™ EEPROMå ì™ì˜™ å ì™ì˜™å ì™ì˜™ å ìŒ”억옙 å ì‹¼ëŒì˜™. - Flag.Fault_Cntl.bit.Rec_Complete = 0; - Flag.Fault_Cntl.bit.Rst_Complete = 0; - // if (!FAULT_RECORD_COMPLETE) Fault_Recording( Fault_count ); - Fault_Recording( Fault_count ); - } - - if ((!Flag.Fault_Cntl.bit.Rst_Complete)&&((Flag.DI.bit.FAULT_RESET == 1)||(Flag.Fault_Cntl.bit.Reset == 1))) - { - FaultReg1= 0; - - OL_TimeOver_Count = 0; - MaxCon_Curr_Count = 0; - OverVoltCount = 0; - UnderVoltCount = 0; - Flag.Fault_Cntl.bit.Reset = 0; - Flag.Fault1.all=0; - Flag.Fault2.all=0; - Flag.Fault3.all=0; - Seq = SEQ_Retrial; - Flag.Fault_Cntl.bit.Rst_Complete = 1; - } - - FaultReg1[0] = FaultReg1[1]; - FaultReg2[0] = FaultReg2[1]; - - Red_LED_on; - Green_LED_off; - - break; - - - // Retrial for Operation - case SEQ_Retrial: // " 4 " - { - State_Index = STATE_STOP; - Retry_cnt_En = 1; - if( Retry_cnt >= Retry_Time_set) - { - Retry_cnt_En = 0; - Seq = SEQ_Wait; - } - } - break; - default: Seq=SEQ_NoReady; + DISABLE_GATE(); } - // asm(" nop"); //END_SEQ: - -#endif //pbhp 151001 - - chThdSleepMilliseconds(1); + // Reset the watchdog + WWDG_SetCounter(100); - return 0; } -//========================================================================================================== - bool SetupParm(void) { @@ -895,78 +537,54 @@ bool SetupParm(void) return False; } -void ClarkePark(void) -{ - ParkParm.qIalpha = ParkParm.qIa; - ParkParm.qIbeta = ParkParm.qIa*INV_SQRT3 + 2*ParkParm.qIb*INV_SQRT3; - // Ialpha and Ibeta have been calculated. Now do rotation. - // Get qSin, qCos from ParkParm structure - - ParkParm.qId = ParkParm.qIalpha*cosf(ParkParm.qAngle) + ParkParm.qIbeta*sinf(ParkParm.qAngle); - ParkParm.qIq = -ParkParm.qIalpha*sinf(ParkParm.qAngle) + ParkParm.qIbeta*cosf(ParkParm.qAngle); - return; -} //--------------------------------------------------------------------- // Executes one PI itteration for each of the three loops Id,Iq,Speed, void DoControl( void ) +{ + if(AccumThetaCnt == 0) { + // Execute the velocity control loop + PIParmW.qInMeas = smc1.Omega; + PIParmW.qInRef = CtrlParm.qVelRef; + CalcPI(&PIParmW); + CtrlParm.qVqRef = PIParmW.qOut; + } - if( uGF.bit.OpenLoop ) - { + if (uGF.bit.EnTorqueMod) + CtrlParm.qVqRef = CtrlParm.qVelRef; - } - else - // Closed Loop Vector Control - { - if(AccumThetaCnt == 0) - { - // Execute the velocity control loop - PIParmW.qInMeas = smc1.Omega; - PIParmW.qInRef = 0.01f;//CtrlParm.qVelRef; - CalcPI(&PIParmW); - CtrlParm.qVqRef = PIParmW.qOut; - } + //CtrlParm.qVdRef = FieldWeakening(fabsf(CtrlParm.qVelRef)); - if (uGF.bit.EnTorqueMod) - CtrlParm.qVqRef = CtrlParm.qVelRef; + // PI control for D + PIParmD.qInMeas = ParkParm.qId; + //PIParmD.qInRef = CtrlParm.qVdRef; + PIParmD.qInRef = 0.0f; + CalcPI(&PIParmD); - //CtrlParm.qVdRef = FieldWeakening(fabsf(CtrlParm.qVelRef)); - - // PI control for D - PIParmD.qInMeas = ParkParm.qId; - PIParmD.qInRef = CtrlParm.qVdRef; - CalcPI(&PIParmD); - - if(uGF.bit.EnVoltRipCo) - ParkParm.qVd = VoltRippleComp(PIParmD.qOut); - else - ParkParm.qVd = PIParmD.qOut; + if(uGF.bit.EnVoltRipCo) + ParkParm.qVd = VoltRippleComp(PIParmD.qOut); + else + ParkParm.qVd = PIParmD.qOut; - qVdSquared = ParkParm.qVd * ParkParm.qVd; - PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); - PIParmQ.qOutMin = -PIParmQ.qOutMax; - - // PI control for Q - PIParmQ.qInMeas = ParkParm.qIq; - PIParmQ.qInRef = CtrlParm.qVqRef; - CalcPI(&PIParmQ); - - // If voltage ripple compensation flag is set, adjust the output - // of the Q controller depending on measured DC Bus voltage - if(uGF.bit.EnVoltRipCo) - ParkParm.qVq = VoltRippleComp(PIParmQ.qOut); - else - ParkParm.qVq = PIParmQ.qOut; - - // Limit, if motor is stalled, stop motor commutation - if (smc1.OmegaFltred < 0) - { - uGF.bit.RunMotor = 0; - } - } - } + qVdSquared = ParkParm.qVd * ParkParm.qVd; + PIParmQ.qOutMax = sqrtf((0.95*0.95) - qVdSquared); + PIParmQ.qOutMin = -PIParmQ.qOutMax; + + // PI control for Q + PIParmQ.qInMeas = ParkParm.qIq; + PIParmQ.qInRef = CtrlParm.qVqRef; + CalcPI(&PIParmQ); + + // If voltage ripple compensation flag is set, adjust the output + // of the Q controller depending on measured DC Bus voltage + if(uGF.bit.EnVoltRipCo) + ParkParm.qVq = VoltRippleComp(PIParmQ.qOut); + else + ParkParm.qVq = PIParmQ.qOut; + +} void InitPI( tPIParm *pParm) { @@ -1022,10 +640,10 @@ void SetupControlParameters(void) InitPI(&PIParmW); // ============= PI PLL Term =============== - PIParmPLL.qKp = WKP; - PIParmPLL.qKi = WKI; - PIParmPLL.qKc = WKC; - PIParmPLL.qOutMax = WOUTMAX; + PIParmPLL.qKp = PLLKP; + PIParmPLL.qKi = PLLKI; + PIParmPLL.qKc = PLLKC; + PIParmPLL.qOutMax = PLLOUTMAX; PIParmPLL.qOutMin = -PIParmPLL.qOutMax; InitPI(&PIParmPLL); @@ -1071,43 +689,15 @@ float VoltRippleComp(float Vdq) return CompVdq; } -void MeasCompCurr( int curr1, int curr2 ) -{ - int CorrADC1, CorrADC2; - - CorrADC1 = curr1 - MeasCurrParm.Offseta; - CorrADC2 = curr2 - MeasCurrParm.Offsetb; - // ADC_curr_norm_value[2] = -(ADC_curr_norm_value[0] + ADC_curr_norm_value[1]); - ParkParm.qIa = MeasCurrParm.qKa * (float)CorrADC1; - ParkParm.qIb = MeasCurrParm.qKb * (float)CorrADC2; - - return; -} void InitMeasCompCurr( short Offset_a, short Offset_b ) { MeasCurrParm.Offseta = Offset_a; MeasCurrParm.Offsetb = Offset_b; return; } -void InvPark(void) -{ - ParkParm.qValpha = ParkParm.qVd*cosf(ParkParm.qAngle) - ParkParm.qVq*sinf(ParkParm.qAngle); - ParkParm.qVbeta = ParkParm.qVd*sinf(ParkParm.qAngle) + ParkParm.qVq*cosf(ParkParm.qAngle); - return; -} -void CalcRefVec(void) -{ - //SVGenParm.qVr1 =ParkParm.qValpha; - //SVGenParm.qVr2 = (-ParkParm.qValpha + SQRT3 * ParkParm.qVbeta)/2; - //SVGenParm.qVr3 = (-ParkParm.qValpha - SQRT3 * ParkParm.qVbeta)/2; - SVGenParm.qVr1 =ParkParm.qVbeta; - SVGenParm.qVr2 = (-ParkParm.qVbeta + SQRT3 * ParkParm.qValpha)/2; - SVGenParm.qVr3 = (-ParkParm.qVbeta - SQRT3 * ParkParm.qValpha)/2; - return; -} void CalcTimes(void) { SVGenParm.iPWMPeriod = LOOPINTCY; @@ -1145,6 +735,7 @@ void update_timer_Duty(unsigned int duty_A,unsigned int duty_B,unsigned int duty utils_sys_unlock_cnt(); } + void CalcSVGen( void ) { if( SVGenParm.qVr1 >= 0 ) @@ -1221,85 +812,43 @@ void CalcSVGen( void ) /********************************PLL loop **********************************/ -#define Fsamp 16000 -#define Tsamp 1./16000 - -float HallPLLlead = 0.0; -float HallPLLlead1 = 0.0; -float HallPLLlead2 = 0.0; -float HallPLLqe = 0.0; -float HallPLLde = 0.0; -float HallPLLde1 = 0.0; -float HallPLLdef = 0.0; -float HallPLLdef1 = 0.0; -#define WMd 2.*3.141592654*180. -#define AMd (WMd-(2./Tsamp))/(WMd+(2./Tsamp)) -#define BMd WMd/(WMd+(2./Tsamp)) - -static volatile float Theta = 0.0; -static volatile float ThetaCal = 0.0; - -static volatile float Futi = 0.0; -float Wpll = 0.0; -float Wpll1 = 0.0; -float Wpllp = 0.0; -float Wplli = 0.0; - -float Kpll = 0.428; -float Ipll = 28.83; - - -static volatile float Hall_KA = 0.0; -static volatile float Hall_KB = 0.0; - -static volatile float Hall_PIout = 0.0; -static volatile float Hall_Err0 = 0.0; - - -float HallPLLA = 0.0f; // inverter output voltage -float HallPLLA1 = 0.0f; -float HallPLLB = 0.0f; - -float HallPLLA_old = 0.0f; -float HallPLLB_old = 0.0f; - -float HallPLLA_filtered = 0.0f; -float HallPLLB_filtered = 0.0f; - -float Hall_SinCos; -float Hall_CosSin; - -float costh; -float sinth; - - +#if 0 void SMC_HallSensor_Estimation (SMC *s) { - HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; + + cos3th = cosf(3.0f * Theta); + sin3th = sinf(3.0f * Theta); + + HallPLLA_sin3th = HallPLLA * sin3th * Gamma; + HallPLLA_cos3th = HallPLLA * cos3th * Gamma; - //if(HallPLLA > Hall_KA )Hall_KA = HallPLLA; - //if(HallPLLB > Hall_KB )Hall_KB = HallPLLB; + HallPLLB_cos3th = HallPLLB* cos3th * Gamma; + HallPLLB_sin3th = HallPLLB * sin3th * Gamma; + + HallPLLA_cos3th_Integral += HallPLLA_cos3th; + HallPLLA_sin3th_Integral += HallPLLA_sin3th; - //HallPLLA = HallPLLA / Hall_KA; - //HallPLLB = HallPLLB / Hall_KB; + HallPLLB_sin3th_Integral += HallPLLB_sin3th; + HallPLLB_cos3th_Integral += HallPLLB_cos3th; + + Asin3th= HallPLLA_sin3th_Integral * sin3th; + Acos3th= HallPLLA_cos3th_Integral * cos3th; + + Bsin3th= HallPLLB_sin3th_Integral * sin3th; + Bcos3th= HallPLLB_cos3th_Integral * cos3th; - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); - //Low_pass_filter(HallPLLA_filtered, HallPLLA, HallPLLA_old, alpha); + ANF_PLLA = HallPLLA - Asin3th - Acos3th; + ANF_PLLB = HallPLLB - Bsin3th - Bcos3th; costh = cosf(Theta); sinth = sinf(Theta); - - //Hall_SinCos = HallPLLA_filtered * costh; - //Hall_CosSin = HallPLLB_filtered * sinth; - - Hall_SinCos = HallPLLA * costh; - Hall_CosSin = HallPLLB * sinth; - //Digital_PI_controller(Hall_PIout, Hall_SinCos, Hall_CosSin, Hall_Err0, 10, 1, 1, Tsamp); + Hall_SinCos = ANF_PLLA * costh; + Hall_CosSin = ANF_PLLB * sinth; float err, tmp_kp, tmp_kpi; tmp_kp = 1.0f; @@ -1321,39 +870,72 @@ void SMC_HallSensor_Estimation (SMC *s) s->Omega = Hall_PIout; //Futi = Hall_PIout / (2.* PI) *Fsamp; + //spi_dac_write_A((HallPLLA+ 1.0f) * 200.0f); + //spi_dac_write_B((HallPLLB+ 1.0f) * 200.0f); + + //spi_dac_write_A((costh + 1.0f) * 2000.0f); + //spi_dac_write_B((sinth + 1.0f) * 2047.0f); + + //spi_dac_write_A( (Hall_SinCos+ 1.0f) * 2048.0f); + //spi_dac_write_B( (Hall_CosSin+ 1.0f) * 2048.0f); + + //spi_dac_write_A( (Hall_err+ 1.0f) * 2048.0f); + //spi_dac_write_B( (Theta * 200.0f) ); + + //spi_dac_write_B( Hall_PIout * 100.0f); + + + //spi_dac_write_A( (ParkParm.qAngle * 200.0f) ); + //spi_dac_write_B( (smc1.Theta * 200.0f) ); + -#if 0 // pll locked loop - /************************* Phase lead(90 degree) ***************************/ - HallPLLlead = -0.931727141f * HallPLLlead1 + 0.931727141f * HallPLLA - HallPLLA1;//all pass filter + //s->Omega = Wpll; + //s->Theta =Theta; + + //DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) +} + +#else +void SMC_HallSensor_Estimation (SMC *s) +{ - HallPLLA2 = HallPLLA1; - HallPLLA1 = HallPLLA; - HallPLLlead2 = HallPLLlead1; - HallPLLlead1 = HallPLLlead; + s->HallPLLA = ((float)ADC_Value[ADC_IND_SENS1] - 1241.0f)/ 4095.0f; + s->HallPLLB = ((float)ADC_Value[ADC_IND_SENS2] - 1241.0f)/ 4095.0f; + s->costh = cosf(s->Theta); + s->sinth = sinf(s->Theta); + + s->Hall_SinCos = s->HallPLLA * s->costh; + s->Hall_CosSin = s->HallPLLB * s->sinth; - /***************************************************************************/ - /********************************* PLL ***********************************/ - costh = cosf(Theta); - sinth = sinf(Theta ); - HallPLLqe = costh * HallPLLA - sinth * (HallPLLlead); - HallPLLde = sinth * HallPLLA + costh * (HallPLLlead); + float err, tmp_kp, tmp_kpi; + tmp_kp = 1.0f; + tmp_kpi = (1.0f + 1.0f * PWMPEROID); + err = s->Hall_SinCos - s->Hall_CosSin; + s->Hall_PIout += ((tmp_kpi * err) - (tmp_kp * s->Hall_Err0)); + s->Hall_PIout = Bound_limit(s->Hall_PIout, 10.0f); + s->Hall_Err0= err; - HallPLLdef = -AMd * HallPLLdef1 + BMd * HallPLLde + BMd * HallPLLde1; - HallPLLde1 = HallPLLde; - HallPLLdef1 = HallPLLdef; + s->Theta += s->Hall_PIout ; + if((2.0f * PI) < s->Theta) s->Theta = s->Theta - (2.0f * PI); + else if(s->Theta < 0.0f) s->Theta = (2.0f * PI) + s->Theta; - Wpllp = -HallPLLdef * Kpll; // modify by LEE Y J 0.428 - Wplli = Wplli - HallPLLdef * Tsamp * Ipll; //28.83 + s->ThetaCal= s->Theta + 0.3f; - Wpll = Wpllp + Wplli + (2. * 3.141592654 * 60.0); - Theta += (Wpll) * Tsamp ; - Wpll1 = Wpll; - if(Theta >= 3.141592654 * 3.141592654) Theta =0.0; + if((2.0f * PI) < s->ThetaCal) s->ThetaCal = s->ThetaCal - (2.0f * PI); + else if(s->ThetaCal < 0.0f) s->ThetaCal = (2.0f * PI) + s->ThetaCal; - Futi = Wpll / (2.*3.141592654); -#endif + s->Omega = s->Hall_PIout; + + + s->trueTheta += (s->Hall_PIout /7.0f) ; + if((2.0f * PI) < s->trueTheta) s->trueTheta = s->trueTheta - (2.0f * PI); + else if(s->trueTheta < 0.0f) s->trueTheta = (2.0f * PI) + s->trueTheta; + + s->Futi = s->Hall_PIout / (2.* PI) * PWMFREQUENCY; + s->rpm = 120.0f * s->Futi / 7.0f; + //spi_dac_write_A((HallPLLA+ 1.0f) * 200.0f); //spi_dac_write_B((HallPLLB+ 1.0f) * 200.0f); @@ -1380,6 +962,7 @@ void SMC_HallSensor_Estimation (SMC *s) //DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) } +#endif void stop_pwm_hw(void) { TIM_SelectOCxM(TIM1, TIM_Channel_1, TIM_ForcedAction_InActive); @@ -1396,41 +979,3 @@ void stop_pwm_hw(void) { TIM_GenerateEvent(TIM1, TIM_EventSource_COM); } - - - - -//===================================================================== -//API -//float mcpwm_get_rpm(void); -//mc_state mcpwm_get_state(void); -//mc_fault_code mcpwm_get_fault(void); -//const char* mcpwm_fault_to_string(mc_fault_code fault); - -int fputc(int ch, FILE *f) -{ - return(ITM_SendChar(ch)); -} - -void mcpwm_Set_RunStop(bool run_stop) -{ - if(run_stop) uGF.bit.RunMotor = 1; - else uGF.bit.RunMotor = 0; - - return; -} - -WORD mcpwm_Get_Control(void) -{ - return uGF.Word; -} - -void mcpwm_Set_Velocity(float Velocity) -{ - CtrlParm.qVelRef = Velocity; - return; -} -tCtrlParm mcpwm_Get_CtrlParm(void) -{ - return CtrlParm; -} diff --git a/oroca_bldc_FW/src/bldc/mcpwm.h b/oroca_bldc_FW/src/bldc/mcpwm.h index 4d47d49..0c4478a 100755 --- a/oroca_bldc_FW/src/bldc/mcpwm.h +++ b/oroca_bldc_FW/src/bldc/mcpwm.h @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,22 +19,187 @@ * mc_pwm.h * * Created on: 13 okt 2012 - * Author: benjamin + * Author: bakchajang */ #ifndef MCPWM_H_ #define MCPWM_H_ -#include "conf_general.h" -#include "datatypes.h" +//#include "conf_general.h" +//#include "datatypes.h" #include + + +#ifdef __cplusplus +extern "C" { +#endif + + + +void spi_dac_hw_init(void); +void spi_dac_write_A( short data); +void spi_dac_write_B( short data); +void spi_dac_write_AB( short data); + +#define SYSTEM_CORE_CLOCK 168000000 + //Defines typedef unsigned short WORD; //typedef signed int SFRAC16; typedef unsigned char BYTE; //typedef unsigned char BOOL; +// Structs +typedef struct { + float qKa; + short Offseta; + + float qKb; + short Offsetb; +} tMeasCurrParm; + + +typedef struct { + float HallPLLlead ; + float HallPLLlead1 ; + float HallPLLlead2 ; + float HallPLLqe ; + float HallPLLde ; + float HallPLLde1 ; + float HallPLLdef ; + float HallPLLdef1 ; + + float Wpll ; + float Wpll1 ; + float Wpllp ; + float Wplli ; + + float Kpll ; // = 0.428; + float Ipll ; //= 28.83; + + float Hall_KA ; + float Hall_KB ; + + float Hall_PIout ; + float Hall_Err0 ; + + float HallPLLA ; + float HallPLLA1 ; + float HallPLLB ; + + float HallPLLA_cos3th; + float HallPLLA_sin3th; + float HallPLLB_sin3th; + float HallPLLB_cos3th; + + float HallPLLA_cos3th_Integral; + float HallPLLA_sin3th_Integral; + float HallPLLB_sin3th_Integral; + float HallPLLB_cos3th_Integral; + + float HallPLLA_old ; + float HallPLLB_old ; + + float HallPLLA_filtered; + float HallPLLB_filtered; + + float Hall_SinCos; + float Hall_CosSin; + + float Gamma; //= 1.0f; + + float costh; + float sinth; + + float Asin3th ;// = 0.0f; + float Acos3th ;// = 0.0f; + float Bsin3th ;//= 0.0f; + float Bcos3th ;//= 0.0f; + float ANF_PLLA ;//= 0.0f; + float ANF_PLLB ;//= 0.0f; + + float cos3th; + float sin3th; + + float Theta ; + float ThetaCal ; + float trueTheta ; + float Futi ; + float Omega; // Output: Rotor speed + float rpm; // Output: Rotor speed + +} SMC; + +typedef struct { + float qdSum; // 1.31 format + float qKp; + float qKi; + float qKc; + float qOutMax; + float qOutMin; + float qInRef; + float qInMeas; + float qOut; + } tPIParm; + + +typedef struct { + float qAngle; + float qSin; + float qCos; + float qIa; + float qIb; + float qIalpha; + float qIbeta; + float qId; + float qIq; + float qVd; + float qVq; + float qValpha; + float qVbeta; + float qV1; + float qV2; + float qV3; + } tParkParm; + +typedef struct { + float qVelRef; // Reference velocity + float qVdRef; // Vd flux reference value + float qVqRef; // Vq torque reference value + } tCtrlParm; + +//------------------ C API for FdWeak routine --------------------- + +typedef struct { + float qK1; // < Nominal speed value + float qIdRef; + float qFwOnSpeed; + float qFwActiv; + int qIndex; + float qFWPercentage; + float qInterpolPortion; + float qFwCurve[16]; // Curve for magnetizing current + } tFdWeakParm; + +//------------------ C API for SVGen routine --------------------- + +typedef struct { + unsigned int iPWMPeriod; + + float qVr1; + float qVr2; + float qVr3; + + float T1; + float T2; + + unsigned int Ta; + unsigned int Tb; + unsigned int Tc; + + } tSVGenParm; + #define False 0 #define True 1 @@ -46,92 +211,18 @@ typedef unsigned char BYTE; #define MCPWM_RAMP_STEP_CURRENT_MAX 0.04 // Maximum ramping step (1000 times/sec) for the current control #define MCPWM_RAMP_STEP_RPM_LIMIT 0.0005 // Ramping step when limiting the RPM -#define SMC_DEFAULTS {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - - -//************** Start-Up Parameters ************** - -#define LOCKTIMEINSEC 0.25 // Initial rotor lock time in seconds - // Make sure LOCKTIMEINSEC*(1.0/LOOPTIMEINSEC) - // is less than 65535. -#define OPENLOOPTIMEINSEC 5.0 // Open loop time in seconds. This is the time that - // will take from stand still to closed loop. - // Optimized to overcome the brake inertia. - // (Magtrol AHB-3 brake inertia = 6.89 kg x cm2). -#define INITIALTORQUE 1 // Initial Torque demand in Amps. - // Enter initial torque demand in Amps using REFINAMPS() - // macro. Maximum Value for reference is defined by - // shunt resistor value and differential amplifier gain. - // Use this equation to calculate maximum torque in - // Amperes: - // - // Max REFINAMPS = (VDD/2)/(RSHUNT*DIFFAMPGAIN) - // - // For example: - // - // RSHUNT = 0.005 - // VDD = 3.3 - // DIFFAMPGAIN = 75 - // - // Maximum torque reference in Amps is: - // - // (3.3/2)/(.005*75) = 4.4 Amperes, or REFINAMPS(4.4) -#define ENDSPEEDOPENLOOP MINSPEEDINRPM - -//************** Motor Parameters ************** - -// Values used to test Bejing Eletechnic Motor "Dia 80-252140-220" at 320VDC input. Motor datasheet at www.eletechnic.com -#define POLEPAIRS 12 // Number of pole pairs -#define PHASERES ((float)0.15) // Phase resistance in Ohms. -#define PHASEIND ((float)0.0006)// Phase inductance in Henrys. -#define NOMINALSPEEDINRPM 1000 // Make sure NOMINALSPEEDINRPM generates a MAXOMEGA < 1.0 - //50Hz // Use this formula: - // MAXOMEGA = NOMINALSPEEDINRPM*SPEEDLOOPTIME*POLEPAIRS*2/60 - // If MAXOMEGA > 1.0, reduce NOMINALSPEEDINRPM or execute - // speed loop faster by reducing SpeedLoopTime. - // Maximum position of POT will set a reference of - // NOMINALSPEEDINRPM. -#define MINSPEEDINRPM 10 // Minimum speed in RPM. Closed loop will operate at this - //8.47Hz // speed. Open loop will transition to closed loop at - // this minimum speed. Minimum POT position (CCW) will set - // a speed reference of MINSPEEDINRPM -#define FIELDWEAKSPEEDRPM 1000 // Make sure FIELDWEAKSPEEDRPM generates a MAXOMEGA < 1.0 - // Use this formula: - // MAXOMEGA = FIELDWEAKSPEEDRPM*SPEEDLOOPTIME*POLEPAIRS*2/60 - // If MAXOMEGA > 1.0, reduce FIELDWEAKSPEEDRPM or execute - // speed loop faster by reducing SpeedLoopTime. - // Maximum position of POT will set a reference of - // FIELDWEAKSPEEDRPM. - //************** PWM and Control Timing Parameters ********** #define PWMFREQUENCY 16000 // PWM Frequency in Hertz -#define DEADTIMESEC 0.000002f // Deadtime in seconds -#define BUTPOLLOOPTIME 0.100f // Button polling loop period in sec +#define PWMPEROID 1.0f/PWMFREQUENCY #define SPEEDLOOPFREQ 1000 // Speed loop Frequency in Hertz. This value must // be an integer to avoid pre-compiler error // Use this value to test low speed motor -//************** Slide Mode Controller Parameters ********** - -#define SMCGAIN 0.85f // Slide Mode Controller Gain (0.0 to 0.9999) -#define MAXLINEARSMC 0.005f // If measured current - estimated current - // is less than MAXLINEARSMC, the slide mode - // Controller will have a linear behavior - // instead of ON/OFF. Value from (0.0 to 0.9999) -#define FILTERDELAY 90 // Phase delay of two low pass filters for - // theta estimation. Value in Degrees from - // from 0 to 359. - //************** Hardware Parameters **************** #define RSHUNT 0.001f // Value in Ohms of shunt resistors used. -#define DIFFAMPGAIN 10 // Gain of differential amplifier. #define VDD 3.3f // VDD voltage, only used to convert torque - // reference from Amps to internal variables - -#define SPEEDDELAY 1000 * LOOPTIMEINSEC; // Delay for the speed ramp. - // Necessary for the PI control to work properly at high speeds. //*************** Optional Modes ************** //#define TORQUEMODE @@ -152,56 +243,20 @@ typedef unsigned char BYTE; #define QOUTMAX 0.99999 //*** Velocity Control Loop Coefficients ***** -#define WKP 2.0 -#define WKI 0.01 +#define WKP 12.0 +#define WKI 2.0 #define WKC 0.99999 #define WOUTMAX 0.95 -//************** ADC Scaling ************** -// Scaling constants: Determined by calibration or hardware design. -#define DQK (OMEGA10 - OMEGA1)/2.0 // POT Scaling + +#define PLLKP 2.0 +#define PLLKI 0.01 +#define PLLKC 0.99999 +#define PLLOUTMAX 0.95 + #define DQKA 0.0008058608f // Current feedback software gain : adc*(1/resol)*(AVDD/AmpGAIN)*(1/R) #define DQKB 0.0008058608f // Current feedback software gain : adc*(1/4096)*(3.3/10)*(1/0.001) -//************** Field Weakening ************** -// Enter flux demand Amperes using REFINAMPS() macro. Maximum Value for -// reference is defined by shunt resistor value and differential amplifier gain. -// Use this equation to calculate maximum torque in Amperes: -// -// Max REFINAMPS = (VDD/2)/(RSHUNT*DIFFAMPGAIN) -// -// For example: -// -// RSHUNT = 0.005 -// VDD = 3.3 -// DIFFAMPGAIN = 75 -// -// Maximum torque reference in Amps is: -// -// (3.3/2)/(.005*75) = 4.4 Amperes, or REFINAMPS(4.4) -// -// in order to have field weakening, this reference value should be negative, -// so maximum value in this example is -4.4, or REFINAMPS(-4.4) - -//****Values for Field weakening used to test Sander Motor at 160VDC input**** -// For other motors, FW was not used to reach the rated speed -#define dqKFw0 REFINAMPS(0) -#define dqKFw1 REFINAMPS(-0.320) -#define dqKFw2 REFINAMPS(-0.325) -#define dqKFw3 REFINAMPS(-0.330) -#define dqKFw4 REFINAMPS(-0.335) -#define dqKFw5 REFINAMPS(-0.340) -#define dqKFw6 REFINAMPS(-0.345) -#define dqKFw7 REFINAMPS(-0.350) -#define dqKFw8 REFINAMPS(-0.355) -#define dqKFw9 REFINAMPS(-0.360) -#define dqKFw10 REFINAMPS(-0.365) -#define dqKFw11 REFINAMPS(-0.370) -#define dqKFw12 REFINAMPS(-0.375) -#define dqKFw13 REFINAMPS(-0.380) -#define dqKFw14 REFINAMPS(-0.385) -#define dqKFw15 REFINAMPS(-0.390) - //************** Derived Parameters **************** @@ -209,11 +264,6 @@ typedef unsigned char BYTE; #define IRP_PERCALC (unsigned int)(SPEEDLOOPTIME/LOOPTIMEINSEC) // PWM loops per velocity calculation #define SPEEDLOOPTIME (float)(1.0/SPEEDLOOPFREQ) // Speed Control Period #define LOOPINTCY TIM1->ARR -#define LOCKTIME (unsigned int)(LOCKTIMEINSEC*(1.0/LOOPTIMEINSEC)) -// Time it takes to ramp from zero to MINSPEEDINRPM. Time represented in seconds -#define DELTA_STARTUP_RAMP (unsigned int)(MINSPEEDINRPM*POLEPAIRS*LOOPTIMEINSEC* LOOPTIMEINSEC*65536*65536/(60*OPENLOOPTIMEINSEC)) -// Number of control loops that must execute before the button routine is executed. -#define BUTPOLLOOPCNT (unsigned int)(BUTPOLLOOPTIME/LOOPTIMEINSEC) #define PI 3.14159265358979f @@ -221,66 +271,80 @@ typedef unsigned char BYTE; #define SQRT3 1.732050808f #define INV_SQRT3 (float)(1./SQRT3) -#define REFINAMPS(Amperes_Value) ( Amperes_Value*DQKA*RSHUNT*DIFFAMPGAIN/(VDD/2)) + +#define WMd 2.*3.141592654*180. +#define AMd (WMd-(2./PWMPEROID))/(WMd+(2./PWMPEROID)) +#define BMd WMd/(WMd+(2./PWMPEROID)) + // External variables extern uint16_t ADC_Value[]; -extern int SpeedReference; -//extern unsigned int switching_frequency_now; +extern unsigned int switching_frequency_now; + + +//============================================================== +//define +#define Digital_PI_controller(out, ref, in, err0, limit, kp, ki, tsample) \ + { \ + float err, tmp_kp, tmp_kpi; \ + tmp_kp = (float)(kp); \ + tmp_kpi = (float)(kp + ki*tsample); \ + err = ref - in; \ + out += ((tmp_kpi * err) - (tmp_kp * err0)); \ + out = Bound_limit(out, limit); \ + err0 = err; \ + } +#define Bound_limit(in,lim) ((in > (lim)) ? (lim) : ((in < -(lim)) ? -(lim) : in)) +#define Bound_min_max(in, min, max) ((in > (max)) ? (max) : ((in < (min)) ? (min) : in)) + +#define Low_pass_filter(out, in, in_old, alpha) \ + { \ + float tmp; \ + tmp = alpha*(in + in_old - (out*2)); \ + out += tmp; \ + in_old = in; \ + } + +extern tCtrlParm CtrlParm; +extern tParkParm ParkParm; +extern SMC smc1; -#ifdef __cplusplus -extern "C" { -#endif - // Functions bool SetupParm(void); -void MeasCompCurr( int curr1, int curr2 ); void InitMeasCompCurr( short Offset_a, short Offset_b ); -//void InitPI( tPIParm *pParm); -//void CalcPI( tPIParm *pParm); - void SinCos(void); // Calculate qSin,qCos from iAngle -void ClarkePark(void); // Calculate qId,qIq from qCos,qSin,qIa,qIb -void InvPark(void); // Calculate qValpha, qVbeta from qSin,qCos,qVd,qVq -void mcpwm_init(mc_configuration *configuration); -float mcpwm_get_rpm(void); -mc_state mcpwm_get_state(void); -mc_fault_code mcpwm_get_fault(void); -const char* mcpwm_fault_to_string(mc_fault_code fault); - - -//------------------------------------------------------------------------------------------------------------------------------------ -//smc(sliding mode control ) - -//------------------------------------------------------------------------------------------------------------------------------------ -//CalcRef.s +void mcpwm_init(void); +float mcpwm_get_rpm(void); -void FWInit (void); float FieldWeakening(float qMotorSpeed); - void CalcRefVec( void ); -void CalcSVGen( void ); void CorrectPhase( void ); void update_timer_Duty(unsigned int duty_A,unsigned int duty_B,unsigned int duty_C); float VoltRippleComp(float Vdq); -mc_rpm_dep_struct mcpwm_get_rpm_dep(void); -const volatile mc_configuration* mcpwm_get_configuration(void); -void mcpwm_set_configuration(mc_configuration *configuration); +void do_dc_cal(void); +void SMC_HallSensor_Estimation (SMC *s); +void CalcPI( tPIParm *pParm); +void DoControl( void ); +void InitPI( tPIParm *pParm); +void SetupControlParameters(void); + +void CalcSVGen( void ); + // Interrupt handlers -void mcpwm_adc_inj_int_handler(void); +void mcpwm_adc_int_prehandler(void *p, uint32_t flags) ; void mcpwm_adc_int_handler(void *p, uint32_t flags); #ifdef __cplusplus diff --git a/oroca_bldc_FW/src/bldc/spi_dac.c b/oroca_bldc_FW/src/bldc/spi_dac.c new file mode 100644 index 0000000..2dde31d --- /dev/null +++ b/oroca_bldc_FW/src/bldc/spi_dac.c @@ -0,0 +1,215 @@ + + +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" + +#include "../core/uart3.h" + +// pin +/* +PA15 ==> SPI_NSS ,GPIO +PB3 ==> SPI_SCK , AF5, SPI1_SCK +PB4 ==> SPI_MISO, GPIO, /LOADDACS +PB5 ==> SPI_MOSI , AF5, SPI1_MOSI +*/ + +#define GPIOA_PIN15_SPI_NSS 15 +#define GPIOB_PIN4_LOADDACS 4 + +#define GPIOB_PIN3_SCK 3 +#define GPIOB_PIN5_MOSI 5 + + +static void gpt_cb(GPTDriver *gptp) { + + (void)gptp; + //palSetPad(IOPORT3, GPIOC_LED); +} + + +//TIM5 �̸� APB1, 42MHZ �� ����� �ֳ�!!!, 32bit �̿� +static const GPTConfig gpt_cfg = { + 1000000, // 1MHz timer clock. + //100000, // 100KHz timer clock. + //10000, // 10KHz timer clock. + gpt_cb, // Timer callback. ������ �־�� �ϳ�!!! + 0 +}; + + +void initGPT( void) +{ + //gptStart(&GPTD7, &gpt_cfg); + gptStart(&GPTD5, &gpt_cfg); + gptStartContinuous(&GPTD5, 0xFFFFFFFF); +} + +// TIM2,TIM5 �� 32bit �̰�, �������� ��� , 16bit �� +uint32_t get_GPT_value( void) +{ + //return GPTD7.tim->CNT; + return GPTD5.tim->CNT; +} + +void _udelay( uint32_t udelay) +{ + uint32_t t1 = get_GPT_value(); + uint32_t t2 = get_GPT_value(); + while( (t2-t1) < udelay ) + { + t2 = get_GPT_value(); + } +} + + + + +void spi_hw_init_gpio(void) { + // SPI clock enable + + //RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE); + //RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); + //RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); + RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE); + + + RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, ENABLE); + RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1, DISABLE); + + + + palSetPadMode(GPIOA, GPIOA_PIN15_SPI_NSS, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); + palSetPadMode(GPIOB, GPIOB_PIN4_LOADDACS, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); + + //palClearPad(GPIOA, GPIOA_PIN15_SPI_NSS); + palSetPad( GPIOA, GPIOA_PIN15_SPI_NSS); + + palSetPad(GPIOB, GPIOB_PIN4_LOADDACS); + + + + //PWM ( GPIOA Configuration: Channel 1 to 3 as alternate function push-pull) + //palSetPadMode(GPIOA, GPIOA_PIN15_SPI_NSS, PAL_MODE_ALTERNATE(GPIO_AF_SPI1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_FLOATING); + //palSetPadMode(GPIOA, GPIOA_PIN15_SPI_NSS, PAL_MODE_ALTERNATE(GPIO_AF_SPI1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_PULLUP); + + palSetPadMode(GPIOB, GPIOB_PIN3_SCK, PAL_MODE_ALTERNATE(GPIO_AF_SPI1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_FLOATING); + + // ����� ���� �������� ��ȣ�� �̻��� + //palSetPadMode(GPIOB, GPIOB_PIN5_MOSI, PAL_MODE_ALTERNATE(GPIO_AF_SPI1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_FLOATING); + palSetPadMode(GPIOB, GPIOB_PIN5_MOSI, PAL_MODE_ALTERNATE(GPIO_AF_SPI1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_PULLUP); + //palSetPadMode(GPIOB, GPIOB_PIN5_MOSI, PAL_MODE_ALTERNATE(GPIO_AF_SPI1) |PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUDR_PULLDOWN); + + +} + + + + + +void SPI_Init_for_DAC_7612(SPI_TypeDef* SPIx) +{ + uint16_t tmpreg = 0; + + // Transmit-only mode is similar to full-duplex mode (BIDIMODE=0, RXONLY=0): + // RXNE �� �̿��ؼ� LOADDACS ���� ����ϱ� ���ؼ� + + // CPOL = 1, CPHA =1 + // 16-bit data frame format + // APB2 84 MHz �ִ� 20Mhz �̹Ƿ� �ּ� 1/4 �� �ؾ��� + // 001: fPCLK/4, 010: fPCLK/8, 011: fPCLK/16, 100: fPCLK/32 + + + tmpreg |= SPI_CR1_DFF; //16 bit + + //tmpreg |= SPI_CR1_BR_1; // 1/8, 10MHZ + //tmpreg |= SPI_CR1_BR_1 | SPI_CR1_BR_0 ; // 1/16, , 5MHZ + tmpreg |= SPI_CR1_BR_2; // 1/32, , 2.5MHZ + + tmpreg |= SPI_CR1_MSTR; // Master + tmpreg |= SPI_CR1_CPOL | SPI_CR1_CPHA ; + + SPIx->CR1 = tmpreg; + + //Uart3_printf( &SD3,"CR1=%X,%X \r\n", SPIx->CR1, tmpreg );//170530 + + + SPIx->CR2 = SPI_CR2_SSOE; // �ϵ���� NSS ��� + + + SPIx->CR1 |= SPI_CR1_SPE; + + +} + +void spi_dac_hw_init(void) +{ + spi_hw_init_gpio(); + initGPT(); + + SPI_Init_for_DAC_7612( SPI1); +} + +static void _spi_dac_write( short data) +{ + volatile short data_temp; + SPI_TypeDef* SPIx = SPI1; + + + //Uart3_printf(&SD3, "CR1=%X \r\n", SPIx->CR1 );//170530 + //Uart3_printf(&SD3, "CR2=%X \r\n", SPIx->CR2 ); + //Uart3_printf(&SD3, "SR=%X \r\n", SPIx->SR ); + + + while( (SPIx->SR & SPI_SR_TXE) == 0); // ������ �� ���� ������ ��� + + + // ����� ���� ���� ���� �ֱ� ���ؼ� + palClearPad( GPIOA, GPIOA_PIN15_SPI_NSS); + _udelay( 1); + palSetPad( GPIOA, GPIOA_PIN15_SPI_NSS); + _udelay( 1); + palClearPad( GPIOA, GPIOA_PIN15_SPI_NSS); + + + data_temp = SPIx->DR ; // for Clear RXNE + + //palClearPad(GPIOA, GPIOA_PIN15_SPI_NSS); // CS LOW + //SPIx->DR = data; + //SPIx->DR = data | 0x8000; // ����� ���� ���� ���� �ֱ� ���ؼ� + SPIx->DR = data | 0x4000; // ����� ���� ���� ���� �ֱ� ���ؼ� + + + + while( (SPIx->SR & SPI_SR_RXNE) == 0); + + _udelay( 1); + + palSetPad( GPIOA, GPIOA_PIN15_SPI_NSS); + _udelay( 1); + + + + palClearPad(GPIOB, GPIOB_PIN4_LOADDACS); + // �ּ� 20ns �ʿ��� + _udelay( 1); + palSetPad(GPIOB, GPIOB_PIN4_LOADDACS); + + +} + +void spi_dac_write_AB( short data) +{ + data &= 0xFFF; + _spi_dac_write( data); +} +void spi_dac_write_A( short data) +{ + data &= 0xFFF; + _spi_dac_write( data | 0x2000); +} +void spi_dac_write_B( short data) +{ + data &= 0xFFF; + _spi_dac_write( data | 0x3000); +} diff --git a/oroca_bldc_FW/src/core/buffer.c b/oroca_bldc_FW/src/core/buffer.c new file mode 100644 index 0000000..81f09ba --- /dev/null +++ b/oroca_bldc_FW/src/core/buffer.c @@ -0,0 +1,97 @@ +/* + Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * buffer.c + * + * Created on: 13 maj 2013 + * Author: benjamin + */ + +#include "buffer.h" + +void buffer_append_int16(uint8_t* buffer, int16_t number, int32_t *index) { + buffer[(*index)++] = number >> 8; + buffer[(*index)++] = number; +} + +void buffer_append_uint16(uint8_t* buffer, uint16_t number, int32_t *index) { + buffer[(*index)++] = number >> 8; + buffer[(*index)++] = number; +} + +void buffer_append_int32(uint8_t* buffer, int32_t number, int32_t *index) { + buffer[(*index)++] = number >> 24; + buffer[(*index)++] = number >> 16; + buffer[(*index)++] = number >> 8; + buffer[(*index)++] = number; +} + +void buffer_append_uint32(uint8_t* buffer, uint32_t number, int32_t *index) { + buffer[(*index)++] = number >> 24; + buffer[(*index)++] = number >> 16; + buffer[(*index)++] = number >> 8; + buffer[(*index)++] = number; +} + +void buffer_append_float16(uint8_t* buffer, float number, float scale, int32_t *index) { + buffer_append_int16(buffer, (int16_t)(number * scale), index); +} + +void buffer_append_float32(uint8_t* buffer, float number, float scale, int32_t *index) { + buffer_append_int32(buffer, (int32_t)(number * scale), index); +} + +int16_t buffer_get_int16(const uint8_t *buffer, int32_t *index) { + int16_t res = ((uint16_t) buffer[*index]) << 8 | + ((uint16_t) buffer[*index + 1]); + *index += 2; + return res; +} + +uint16_t buffer_get_uint16(const uint8_t *buffer, int32_t *index) { + uint16_t res = ((uint16_t) buffer[*index]) << 8 | + ((uint16_t) buffer[*index + 1]); + *index += 2; + return res; +} + +int32_t buffer_get_int32(const uint8_t *buffer, int32_t *index) { + int32_t res = ((uint32_t) buffer[*index]) << 24 | + ((uint32_t) buffer[*index + 1]) << 16 | + ((uint32_t) buffer[*index + 2]) << 8 | + ((uint32_t) buffer[*index + 3]); + *index += 4; + return res; +} + +uint32_t buffer_get_uint32(const uint8_t *buffer, int32_t *index) { + uint32_t res = ((uint32_t) buffer[*index]) << 24 | + ((uint32_t) buffer[*index + 1]) << 16 | + ((uint32_t) buffer[*index + 2]) << 8 | + ((uint32_t) buffer[*index + 3]); + *index += 4; + return res; +} + +float buffer_get_float16(const uint8_t *buffer, float scale, int32_t *index) { + return (float)buffer_get_int16(buffer, index) / scale; +} + +float buffer_get_float32(const uint8_t *buffer, float scale, int32_t *index) { + return (float)buffer_get_int32(buffer, index) / scale; +} diff --git a/oroca_bldc_FW/src/core/buffer.h b/oroca_bldc_FW/src/core/buffer.h new file mode 100644 index 0000000..074303a --- /dev/null +++ b/oroca_bldc_FW/src/core/buffer.h @@ -0,0 +1,43 @@ +/* + Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * buffer.h + * + * Created on: 13 maj 2013 + * Author: benjamin + */ + +#ifndef BUFFER_H_ +#define BUFFER_H_ + +#include + +void buffer_append_int16(uint8_t* buffer, int16_t number, int32_t *index); +void buffer_append_uint16(uint8_t* buffer, uint16_t number, int32_t *index); +void buffer_append_int32(uint8_t* buffer, int32_t number, int32_t *index); +void buffer_append_uint32(uint8_t* buffer, uint32_t number, int32_t *index); +void buffer_append_float16(uint8_t* buffer, float number, float scale, int32_t *index); +void buffer_append_float32(uint8_t* buffer, float number, float scale, int32_t *index); +int16_t buffer_get_int16(const uint8_t *buffer, int32_t *index); +uint16_t buffer_get_uint16(const uint8_t *buffer, int32_t *index); +int32_t buffer_get_int32(const uint8_t *buffer, int32_t *index); +uint32_t buffer_get_uint32(const uint8_t *buffer, int32_t *index); +float buffer_get_float16(const uint8_t *buffer, float scale, int32_t *index); +float buffer_get_float32(const uint8_t *buffer, float scale, int32_t *index); + +#endif /* BUFFER_H_ */ diff --git a/oroca_bldc_FW/src/core/comm_usb.c b/oroca_bldc_FW/src/core/comm_usb.c-- old mode 100755 new mode 100644 similarity index 93% rename from oroca_bldc_FW/src/core/comm_usb.c rename to oroca_bldc_FW/src/core/comm_usb.c-- index 8f05f5b..00bf8fb --- a/oroca_bldc_FW/src/core/comm_usb.c +++ b/oroca_bldc_FW/src/core/comm_usb.c-- @@ -1,127 +1,127 @@ -/* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * comm.c - * - * Created on: 22 nov 2012 - * Author: benjamin - */ - -#include "ch.h" -#include "hal.h" -#include "comm_usb.h" -#include "usb_uart.h" - - -// Settings -#define PACKET_HANDLER 0 - -// Private variables -#define SERIAL_RX_BUFFER_SIZE 2048 -static uint8_t serial_rx_buffer[SERIAL_RX_BUFFER_SIZE]; -static int serial_rx_read_pos = 0; -static int serial_rx_write_pos = 0; -static THD_WORKING_AREA(serial_read_thread_wa, 512); -static THD_WORKING_AREA(serial_process_thread_wa, 4096); -static mutex_t send_mutex; -static thread_t *process_tp; - -// Private functions -static void process_packet(unsigned char *data, unsigned int len); -static void send_packet(unsigned char *buffer, unsigned int len); -static void send_packet_wrapper(unsigned char *data, unsigned int len); - -static msg_t serial_read_thread(void *arg) { - (void)arg; - - chRegSetThreadName("USB-Serial read"); - - uint8_t buffer[128]; - int i; - int len; - int had_data = 0; - - for(;;) { - len = chSequentialStreamRead(&SDU1, (uint8_t*) buffer, 1); - - for (i = 0;i < len;i++) { - serial_rx_buffer[serial_rx_write_pos++] = buffer[i]; - - if (serial_rx_write_pos == SERIAL_RX_BUFFER_SIZE) { - serial_rx_write_pos = 0; - } - - had_data = 1; - } - - if (had_data) { - chEvtSignal(process_tp, (eventmask_t) 1); - had_data = 0; - } - } - - return 0; -} - -static msg_t serial_process_thread(void *arg) { - (void)arg; - - chRegSetThreadName("USB-Serial process"); - - process_tp = chThdSelf(); - - for(;;) { - chEvtWaitAny((eventmask_t) 1); - - while (serial_rx_read_pos != serial_rx_write_pos) { - packet_process_byte(serial_rx_buffer[serial_rx_read_pos++], PACKET_HANDLER); - - if (serial_rx_read_pos == SERIAL_RX_BUFFER_SIZE) { - serial_rx_read_pos = 0; - } - } - } - - return 0; -} - -static void process_packet(unsigned char *data, unsigned int len) { - commands_set_send_func(send_packet_wrapper); - commands_process_packet(data, len); -} - -static void send_packet_wrapper(unsigned char *data, unsigned int len) { - packet_send_packet(data, len, PACKET_HANDLER); -} - -static void send_packet(unsigned char *buffer, unsigned int len) { - chMtxLock(&send_mutex); - chSequentialStreamWrite(&SDU1, buffer, len); - chMtxUnlock(&send_mutex); -} - -void comm_usb_init(void) { - usb_uart_init(); - //packet_init(send_packet, process_packet, PACKET_HANDLER); - - chMtxObjectInit(&send_mutex); - - // Threads - //chThdCreateStatic(serial_read_thread_wa, sizeof(serial_read_thread_wa), NORMALPRIO, serial_read_thread, NULL); - //chThdCreateStatic(serial_process_thread_wa, sizeof(serial_process_thread_wa), NORMALPRIO, serial_process_thread, NULL); -} +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * comm.c + * + * Created on: 22 nov 2012 + * Author: bakchajang + */ + +#include "ch.h" +#include "hal.h" +#include "comm_usb.h" +#include "usb_uart.h" + + +// Settings +#define PACKET_HANDLER 0 + +// Private variables +#define SERIAL_RX_BUFFER_SIZE 2048 +static uint8_t serial_rx_buffer[SERIAL_RX_BUFFER_SIZE]; +static int serial_rx_read_pos = 0; +static int serial_rx_write_pos = 0; +static THD_WORKING_AREA(serial_read_thread_wa, 512); +static THD_WORKING_AREA(serial_process_thread_wa, 4096); +static mutex_t send_mutex; +static thread_t *process_tp; + +// Private functions +static void process_packet(unsigned char *data, unsigned int len); +static void send_packet(unsigned char *buffer, unsigned int len); +static void send_packet_wrapper(unsigned char *data, unsigned int len); + +static msg_t serial_read_thread(void *arg) { + (void)arg; + + chRegSetThreadName("USB-Serial read"); + + uint8_t buffer[128]; + int i; + int len; + int had_data = 0; + + for(;;) { + len = chSequentialStreamRead(&SDU1, (uint8_t*) buffer, 1); + + for (i = 0;i < len;i++) { + serial_rx_buffer[serial_rx_write_pos++] = buffer[i]; + + if (serial_rx_write_pos == SERIAL_RX_BUFFER_SIZE) { + serial_rx_write_pos = 0; + } + + had_data = 1; + } + + if (had_data) { + chEvtSignal(process_tp, (eventmask_t) 1); + had_data = 0; + } + } + + return 0; +} + +static msg_t serial_process_thread(void *arg) { + (void)arg; + + chRegSetThreadName("USB-Serial process"); + + process_tp = chThdSelf(); + + for(;;) { + chEvtWaitAny((eventmask_t) 1); + + while (serial_rx_read_pos != serial_rx_write_pos) { + packet_process_byte(serial_rx_buffer[serial_rx_read_pos++], PACKET_HANDLER); + + if (serial_rx_read_pos == SERIAL_RX_BUFFER_SIZE) { + serial_rx_read_pos = 0; + } + } + } + + return 0; +} + +static void process_packet(unsigned char *data, unsigned int len) { + commands_set_send_func(send_packet_wrapper); + commands_process_packet(data, len); +} + +static void send_packet_wrapper(unsigned char *data, unsigned int len) { + packet_send_packet(data, len, PACKET_HANDLER); +} + +static void send_packet(unsigned char *buffer, unsigned int len) { + chMtxLock(&send_mutex); + chSequentialStreamWrite(&SDU1, buffer, len); + chMtxUnlock(&send_mutex); +} + +void comm_usb_init(void) { + usb_uart_init(); + //packet_init(send_packet, process_packet, PACKET_HANDLER); + + chMtxObjectInit(&send_mutex); + + // Threads + //chThdCreateStatic(serial_read_thread_wa, sizeof(serial_read_thread_wa), NORMALPRIO, serial_read_thread, NULL); + //chThdCreateStatic(serial_process_thread_wa, sizeof(serial_process_thread_wa), NORMALPRIO, serial_process_thread, NULL); +} diff --git a/oroca_bldc_FW/src/core/comm_usb.h b/oroca_bldc_FW/src/core/comm_usb.h-- old mode 100755 new mode 100644 similarity index 85% rename from oroca_bldc_FW/src/core/comm_usb.h rename to oroca_bldc_FW/src/core/comm_usb.h-- index c693b7a..b0a66fc --- a/oroca_bldc_FW/src/core/comm_usb.h +++ b/oroca_bldc_FW/src/core/comm_usb.h-- @@ -1,33 +1,33 @@ -/* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * comm_usb.h - * - * Created on: 22 nov 2012 - * Author: benjamin - */ - -#ifndef COMM_USB_H_ -#define COMM_USB_H_ - -#include "conf_general.h" - -// Functions -void comm_usb_init(void); - -#endif /* COMM_USB_H_ */ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * comm_usb.h + * + * Created on: 22 nov 2012 + * Author: bakchajang + */ + +#ifndef COMM_USB_H_ +#define COMM_USB_H_ + +//#include "conf_general.h" + +// Functions +void comm_usb_init(void); + +#endif /* COMM_USB_H_ */ diff --git a/oroca_bldc_FW/src/core/conf_general.c b/oroca_bldc_FW/src/core/conf_general.c deleted file mode 100755 index c704057..0000000 --- a/oroca_bldc_FW/src/core/conf_general.c +++ /dev/null @@ -1,454 +0,0 @@ -/* - * conf_general.c - * - * Created on: 14 sep 2014 - * Author: benjamin - */ - -#include "conf_general.h" -#include "ch.h" -#include "eeprom.h" -#include "mcpwm.h" -#include "hw.h" -#include "utils.h" - -#include - -// Default configuration file -#ifdef MCCONF_OUTRUNNER1 -#include "mcconf_outrunner1.h" -#elif defined MCCONF_OUTRUNNER2 -#include "mcconf_outrunner2.h" -#elif defined MCCONF_STEN -#include "mcconf_sten.h" -#endif - -#include "stm32f4xx_conf.h" - - -// Parameters that can be overridden -#ifndef MC_DEFAULT_MOTOR_TYPE -#define MC_DEFAULT_MOTOR_TYPE MOTOR_TYPE_BLDC -#endif -#ifndef MCPWM_PWM_MODE -#define MCPWM_PWM_MODE PWM_MODE_SYNCHRONOUS // Default PWM mode -#endif -#ifndef MCPWM_HALL_DIR -#define MCPWM_HALL_DIR 0 // Hall sensor direction [0 or 1] -#endif -#ifndef MCPWM_HALL_FWD_ADD -#define MCPWM_HALL_FWD_ADD 0 // Hall sensor offset fwd [0 to 5] -#endif -#ifndef MCPWM_HALL_REV_ADD -#define MCPWM_HALL_REV_ADD 0 // Hall sensor offset rev [0 to 5] -#endif -#ifndef MCPWM_MIN_VOLTAGE -#define MCPWM_MIN_VOLTAGE 8.0 // Minimum input voltage -#endif -#ifndef MCPWM_MAX_VOLTAGE -#define MCPWM_MAX_VOLTAGE 50.0 // Maximum input voltage -#endif -#ifndef MCPWM_RPM_MAX -#define MCPWM_RPM_MAX 100000.0 // The motor speed limit (Upper) -#endif -#ifndef MCPWM_RPM_MIN -#define MCPWM_RPM_MIN -100000.0 // The motor speed limit (Lower) -#endif -#ifndef MCPWM_CURRENT_STARTUP_BOOST -#define MCPWM_CURRENT_STARTUP_BOOST 0.01 // The lowest duty cycle to use in current control mode (has to be > MCPWM_MIN_DUTY_CYCLE) -#endif -#ifndef MCPWM_RPM_LIMIT_NEG_TORQUE -#define MCPWM_RPM_LIMIT_NEG_TORQUE true // Use negative torque to limit the RPM -#endif -#ifndef MCPWM_CURR_MAX_RPM_FBRAKE -#define MCPWM_CURR_MAX_RPM_FBRAKE 300 // Maximum electrical RPM to use full brake at -#endif -#ifndef MCPWM_CURR_MAX_RPM_FBRAKE_CC -#define MCPWM_CURR_MAX_RPM_FBRAKE_CC 1500 // Maximum electrical RPM to use full brake at with current control -#endif -#ifndef MCPWM_SLOW_ABS_OVERCURRENT -#define MCPWM_SLOW_ABS_OVERCURRENT false // Use the filtered (and hence slower) current for the overcurrent fault detection -#endif -#ifndef MCPWM_COMM_MODE -#define MCPWM_COMM_MODE COMM_MODE_INTEGRATE // The commutation mode to use -#endif -#ifndef MCPWM_CYCLE_INT_LIMIT_HIGH_FAC -#define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC 0.8 // Flux integrator limit percentage at MCPWM_CYCLE_INT_START_RPM_BR ERPM -#endif -#ifndef MCPWM_CYCLE_INT_START_RPM_BR -#define MCPWM_CYCLE_INT_START_RPM_BR 80000.0 // RPM border between the START and LOW interval -#endif -#ifndef MCPWM_FAULT_STOP_TIME -#define MCPWM_FAULT_STOP_TIME 3000 // Ignore commands for this duration in msec when faults occur -#endif -#ifndef MCPWM_LIM_TEMP_FET_START -#define MCPWM_LIM_TEMP_FET_START 80.0 // MOSFET temperature where current limiting should begin -#endif -#ifndef MCPWM_LIM_TEMP_FET_END -#define MCPWM_LIM_TEMP_FET_END 100.0 // MOSFET temperature where everything should be shut off -#endif -#ifndef MCPWM_LIM_TEMP_MOTOR_START -#define MCPWM_LIM_TEMP_MOTOR_START 80.0 // MOTOR temperature where current limiting should begin -#endif -#ifndef MCPWM_LIM_TEMP_MOTOR_END -#define MCPWM_LIM_TEMP_MOTOR_END 100.0 // MOTOR temperature where everything should be shut off -#endif -#ifndef MCPWM_MAX_FB_CURR_DIR_CHANGE -#define MCPWM_MAX_FB_CURR_DIR_CHANGE 10.0 // Maximum current during full brake during which a direction change is allowed -#endif -#ifndef MCPWM_MIN_DUTY -#define MCPWM_MIN_DUTY 0.01 // Minimum duty cycle -#endif -#ifndef MCPWM_MAX_DUTY -#define MCPWM_MAX_DUTY 0.95 // Maximum duty cycle -#endif - -// EEPROM settings -#define EEPROM_BASE_MCCONF 1000 -#define EEPROM_BASE_APPCONF 2000 - -// Global variables -uint16_t VirtAddVarTab[NB_OF_VAR]; - -void conf_general_init(void) { - // First, make sure that all relevant virtual addresses are assigned for page swapping. - memset(VirtAddVarTab, 0, sizeof(VirtAddVarTab)); - - int ind = 0; - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - VirtAddVarTab[ind++] = EEPROM_BASE_MCCONF + i; - } - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - VirtAddVarTab[ind++] = EEPROM_BASE_APPCONF + i; - } - - FLASH_Unlock(); - FLASH_ClearFlag(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | - FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - EE_Init(); -} - -/** - * Read app_configuration from EEPROM. If this fails, default values will be used. - * - * @param conf - * A pointer to a app_configuration struct to write the read configuration to. - */ -void conf_general_read_app_configuration(app_configuration *conf) { - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - if (EE_ReadVariable(EEPROM_BASE_APPCONF + i, &var) == 0) { - conf_addr[2 * i] = (var >> 8) & 0xFF; - conf_addr[2 * i + 1] = var & 0xFF; - } else { - is_ok = false; - break; - } - } - - // Set the default configuration - if (!is_ok) { - memset(conf, 0, sizeof(app_configuration)); - conf->controller_id = 0; - conf->timeout_msec = 1000; - conf->timeout_brake_current = 0.0; - conf->send_can_status = false; - conf->send_can_status_rate_hz = 500; - - // The default app is UART in case the UART port is used for - // firmware updates. - conf->app_to_use = APP_UART; - - conf->app_ppm_conf.ctrl_type = PPM_CTRL_TYPE_NONE; - conf->app_ppm_conf.pid_max_erpm = 15000; - conf->app_ppm_conf.hyst = 0.15; - conf->app_ppm_conf.pulse_start = 1.0; - conf->app_ppm_conf.pulse_end = 2.0; - conf->app_ppm_conf.median_filter = false; - conf->app_ppm_conf.safe_start = true; - conf->app_ppm_conf.rpm_lim_start = 150000.0; - conf->app_ppm_conf.rpm_lim_end = 200000.0; - conf->app_ppm_conf.multi_esc = false; - conf->app_ppm_conf.tc = false; - conf->app_ppm_conf.tc_max_diff = 3000.0; - - conf->app_adc_conf.ctrl_type = ADC_CTRL_TYPE_NONE; - conf->app_adc_conf.hyst = 0.15; - conf->app_adc_conf.voltage_start = 0.9; - conf->app_adc_conf.voltage_end = 3.0; - conf->app_adc_conf.use_filter = true; - conf->app_adc_conf.safe_start = true; - conf->app_adc_conf.button_inverted = false; - conf->app_adc_conf.voltage_inverted = false; - conf->app_adc_conf.rpm_lim_start = 150000; - conf->app_adc_conf.rpm_lim_end = 200000; - conf->app_adc_conf.multi_esc = false; - conf->app_adc_conf.tc = false; - conf->app_adc_conf.tc_max_diff = 3000.0; - conf->app_adc_conf.update_rate_hz = 500; - - conf->app_uart_baudrate = 115200; - - conf->app_chuk_conf.ctrl_type = CHUK_CTRL_TYPE_CURRENT; - conf->app_chuk_conf.hyst = 0.15; - conf->app_chuk_conf.rpm_lim_start = 150000.0; - conf->app_chuk_conf.rpm_lim_end = 250000.0; - conf->app_chuk_conf.ramp_time_pos = 0.5; - conf->app_chuk_conf.ramp_time_neg = 0.25; - conf->app_chuk_conf.multi_esc = true; - conf->app_chuk_conf.tc = false; - conf->app_chuk_conf.tc_max_diff = 3000.0; - } -} - -/** - * Write app_configuration to EEPROM. - * - * @param conf - * A pointer to the configuration that should be stored. - */ -bool conf_general_store_app_configuration(app_configuration *conf) { - //--->mcpwm_release_motor(); - - utils_sys_lock_cnt(); - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, DISABLE); - - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - FLASH_ClearFlag(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | - FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) { - var = (conf_addr[2 * i] << 8) & 0xFF00; - var |= conf_addr[2 * i + 1] & 0xFF; - - if (EE_WriteVariable(EEPROM_BASE_APPCONF + i, var) != FLASH_COMPLETE) { - is_ok = false; - break; - } - } - - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE); - utils_sys_unlock_cnt(); - - return is_ok; -} - -/** - * Read mc_configuration from EEPROM. If this fails, default values will be used. - * - * @param conf - * A pointer to a mc_configuration struct to write the read configuration to. - */ -void conf_general_read_mc_configuration(mc_configuration *conf) { - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - for (unsigned int i = 0;i < (sizeof(mc_configuration) / 2);i++) { - if (EE_ReadVariable(EEPROM_BASE_MCCONF + i, &var) == 0) { - conf_addr[2 * i] = (var >> 8) & 0xFF; - conf_addr[2 * i + 1] = var & 0xFF; - } else { - is_ok = false; - break; - } - } - - if (!is_ok) { - conf->pwm_mode = MCPWM_PWM_MODE; - conf->comm_mode = MCPWM_COMM_MODE; - conf->motor_type = MC_DEFAULT_MOTOR_TYPE; - - conf->l_current_max = MCPWM_CURRENT_MAX; - conf->l_current_min = MCPWM_CURRENT_MIN; - conf->l_in_current_max = MCPWM_IN_CURRENT_MAX; - conf->l_in_current_min = MCPWM_IN_CURRENT_MIN; - conf->l_abs_current_max = MCPWM_MAX_ABS_CURRENT; - conf->l_min_erpm = MCPWM_RPM_MIN; - conf->l_max_erpm = MCPWM_RPM_MAX; - conf->l_max_erpm_fbrake = MCPWM_CURR_MAX_RPM_FBRAKE; - conf->l_max_erpm_fbrake_cc = MCPWM_CURR_MAX_RPM_FBRAKE_CC; - conf->l_min_vin = MCPWM_MIN_VOLTAGE; - conf->l_max_vin = MCPWM_MAX_VOLTAGE; - conf->l_slow_abs_current = MCPWM_SLOW_ABS_OVERCURRENT; - conf->l_rpm_lim_neg_torque = MCPWM_RPM_LIMIT_NEG_TORQUE; - conf->l_temp_fet_start = MCPWM_LIM_TEMP_FET_START; - conf->l_temp_fet_end = MCPWM_LIM_TEMP_FET_END; - conf->l_temp_motor_start = MCPWM_LIM_TEMP_MOTOR_START; - conf->l_temp_motor_end = MCPWM_LIM_TEMP_MOTOR_END; - conf->l_min_duty = MCPWM_MIN_DUTY; - conf->l_max_duty = MCPWM_MAX_DUTY; - - conf->lo_current_max = conf->l_current_max; - conf->lo_current_min = conf->l_current_min; - conf->lo_in_current_max = conf->l_in_current_max; - conf->lo_in_current_min = conf->l_in_current_min; - - conf->sl_is_sensorless = MCPWM_IS_SENSORLESS; - conf->sl_min_erpm = MCPWM_MIN_RPM; - conf->sl_max_fullbreak_current_dir_change = MCPWM_MAX_FB_CURR_DIR_CHANGE; - conf->sl_min_erpm_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT_MIN_RPM; - conf->sl_cycle_int_limit = MCPWM_CYCLE_INT_LIMIT; - conf->sl_phase_advance_at_br = MCPWM_CYCLE_INT_LIMIT_HIGH_FAC; - conf->sl_cycle_int_rpm_br = MCPWM_CYCLE_INT_START_RPM_BR; - conf->sl_bemf_coupling_k = MCPWM_BEMF_INPUT_COUPLING_K; - - conf->hall_dir = MCPWM_HALL_DIR; - conf->hall_fwd_add = MCPWM_HALL_FWD_ADD; - conf->hall_rev_add = MCPWM_HALL_REV_ADD; - - conf->s_pid_kp = MCPWM_PID_KP; - conf->s_pid_ki = MCPWM_PID_KI; - conf->s_pid_kd = MCPWM_PID_KD; - conf->s_pid_min_rpm = MCPWM_PID_MIN_RPM; - - conf->p_pid_kp = MCPWM_P_PID_KP; - conf->p_pid_ki = MCPWM_P_PID_KI; - conf->p_pid_kd = MCPWM_P_PID_KD; - - conf->cc_startup_boost_duty = MCPWM_CURRENT_STARTUP_BOOST; - conf->cc_min_current = MCPWM_CURRENT_CONTROL_MIN; - conf->cc_gain = MCPWM_CURRENT_CONTROL_GAIN; - conf->cc_ramp_step_max = 0.04; - - conf->m_fault_stop_time_ms = MCPWM_FAULT_STOP_TIME; - } -} - -/** - * Write mc_configuration to EEPROM. - * - * @param conf - * A pointer to the configuration that should be stored. - */ -bool conf_general_store_mc_configuration(mc_configuration *conf) { - //--->mcpwm_release_motor(); - - utils_sys_lock_cnt(); - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, DISABLE); - - bool is_ok = true; - uint8_t *conf_addr = (uint8_t*)conf; - uint16_t var; - - FLASH_ClearFlag(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | - FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - for (unsigned int i = 0;i < (sizeof(mc_configuration) / 2);i++) { - var = (conf_addr[2 * i] << 8) & 0xFF00; - var |= conf_addr[2 * i + 1] & 0xFF; - - if (EE_WriteVariable(EEPROM_BASE_MCCONF + i, var) != FLASH_COMPLETE) { - is_ok = false; - break; - } - } - - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE); - utils_sys_unlock_cnt(); - - return is_ok; -} - -bool conf_general_detect_motor_param(float current, float min_rpm, float low_duty, - float *int_limit, float *bemf_coupling_k) { - - int ok_steps = 0; -#if 0 - mc_configuration mcconf_old = *mcpwm_get_configuration(); - mc_configuration mcconf = *mcpwm_get_configuration(); - - mcconf.comm_mode = COMM_MODE_DELAY; - mcconf.sl_phase_advance_at_br = 1.0; - mcconf.sl_min_erpm = min_rpm; - mcpwm_set_configuration(&mcconf); - - - //--->mcpwm_set_current(current); - - // Spin up the motor - for (int i = 0;i < 5000;i++) { - if (mcpwm_get_duty_cycle_now() < 0.6) { - chThdSleepMilliseconds(1); - } else { - ok_steps++; - break; - } - } - - // Release the motor and wait a few commutations - mcpwm_set_current(0.0); - int tacho = mcpwm_get_tachometer_value(0); - for (int i = 0;i < 2000;i++) { - if ((mcpwm_get_tachometer_value(0) - tacho) < 3) { - chThdSleepMilliseconds(1); - } else { - ok_steps++; - break; - } - } - - // Average the cycle integrator for 50 commutations - mcpwm_read_reset_avg_cycle_integrator(); - tacho = mcpwm_get_tachometer_value(0); - for (int i = 0;i < 3000;i++) { - if ((mcpwm_get_tachometer_value(0) - tacho) < 50) { - chThdSleepMilliseconds(1); - } else { - ok_steps++; - break; - } - } - - *int_limit = mcpwm_read_reset_avg_cycle_integrator(); - - // Wait for the motor to slow down - for (int i = 0;i < 5000;i++) { - if (mcpwm_get_duty_cycle_now() > low_duty) { - chThdSleepMilliseconds(1); - } else { - ok_steps++; - break; - } - } - mcpwm_set_duty(low_duty); - - // Average the cycle integrator for 100 commutations - mcpwm_read_reset_avg_cycle_integrator(); - tacho = mcpwm_get_tachometer_value(0); - float rpm_sum = 0.0; - float rpm_iterations = 0.0; - for (int i = 0;i < 3000;i++) { - if ((mcpwm_get_tachometer_value(0) - tacho) < 100) { - rpm_sum += mcpwm_get_rpm(); - rpm_iterations += 1; - chThdSleepMilliseconds(1); - } else { - ok_steps++; - break; - } - } - - float avg_cycle_integrator_running = mcpwm_read_reset_avg_cycle_integrator(); - float rpm = rpm_sum / rpm_iterations; - - mcpwm_set_current(0.0); - - // Try to figure out the coupling factor - avg_cycle_integrator_running -= *int_limit; - avg_cycle_integrator_running /= (float)ADC_Value[ADC_IND_VIN_SENS]; - avg_cycle_integrator_running *= rpm; - *bemf_coupling_k = avg_cycle_integrator_running; - - // Restore settings - mcpwm_set_configuration(&mcconf_old); -#endif - return ok_steps == 5 ? true : false; -} diff --git a/oroca_bldc_FW/src/core/conf_general.h b/oroca_bldc_FW/src/core/conf_general.h deleted file mode 100755 index eb71313..0000000 --- a/oroca_bldc_FW/src/core/conf_general.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * conf_general.h - * - * Created on: 14 apr 2014 - * Author: benjamin - */ - -#ifndef CONF_GENERAL_H_ -#define CONF_GENERAL_H_ - -// Firmware version -#define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 2 - -#include "datatypes.h" - -/* - * Settings - */ -#define AUTO_PRINT_FAULTS 0 -#define SYSTEM_CORE_CLOCK 168000000 - -// Component parameters to override -//#define V_REG 3.3 -#define VIN_R1 39000.0 -//#define VIN_R2 2200.0 -//#define CURRENT_AMP_GAIN 10.0 -//#define CURRENT_SHUNT_RES 0.001 - -// Correction factor for computations that depend on the old resistor division factor -#define VDIV_CORR ((VIN_R2 / (VIN_R2 + VIN_R1)) / (2.2 / (2.2 + 33.0))) - -/* - * Select only one hardware version - */ -//#define HW_VERSION_BW -//#define HW_VERSION_40 -//#define HW_VERSION_45 -//#define HW_VERSION_46 -//#define HW_VERSION_R2 -//#define HW_VERSION_VICTOR_R1A -#define HW_VERSION_OROCA - - -/* - * Select only one (default) motor configuration - */ -//#define MCCONF_OUTRUNNER1 -#define MCCONF_OUTRUNNER2 -//#define MCCONF_STEN - -/* - * Select which custom application to use. To configure the default applications and - * their settings, go to conf_general_read_app_configuration and enter the default init - * values. - */ -//#define USE_APP_STEN -//#define USE_APP_GURGALOF - -/* - * Use encoder - */ -#define ENCODER_ENABLE 0 -#define ENCODER_COUNTS 14400 -//#define ENCODER_COUNTS 10000 - -/* - * Enable CAN-bus - */ -#define CAN_ENABLE 0 - -/* - * Settings for the external LEDs (hardcoded for now) - */ -#define LED_EXT_BATT_LOW 25.6 -#define LED_EXT_BATT_HIGH 33.0 - -/* - * Output WS2811 signal on the HALL1 pin. Notice that hall sensors can't be used - * at the same time. - */ -#define WS2811_ENABLE 0 -#define WS2811_CLK_HZ 800000 -#define WS2811_LED_NUM 14 -#define WS2811_USE_CH2 1 // 0: CH1 (PB6) 1: CH2 (PB7) - -// Functions -void conf_general_init(void); -void conf_general_read_app_configuration(app_configuration *conf); -bool conf_general_store_app_configuration(app_configuration *conf); -void conf_general_read_mc_configuration(mc_configuration *conf); -bool conf_general_store_mc_configuration(mc_configuration *conf); -bool conf_general_detect_motor_param(float current, float min_rpm, float low_duty, - float *int_limit, float *bemf_coupling_k); - -#endif /* CONF_GENERAL_H_ */ diff --git a/oroca_bldc_FW/src/core/datatypes.h b/oroca_bldc_FW/src/core/datatypes.h deleted file mode 100755 index 929eb09..0000000 --- a/oroca_bldc_FW/src/core/datatypes.h +++ /dev/null @@ -1,366 +0,0 @@ -/* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * datatypes.h - * - * Created on: 14 sep 2014 - * Author: benjamin - */ - -#ifndef DATATYPES_H_ -#define DATATYPES_H_ - -#include -#include -#include "ch.h" - - - -// Data types -typedef enum { - MC_STATE_OFF = 0, - MC_STATE_DETECTING, - MC_STATE_RUNNING, - MC_STATE_FULL_BRAKE, -} mc_state; - -typedef enum { - PWM_MODE_NONSYNCHRONOUS_HISW = 0, // This mode is not recommended - PWM_MODE_SYNCHRONOUS, // The recommended and most tested mode - PWM_MODE_BIPOLAR // Some glitches occasionally, can kill MOSFETs -} mc_pwm_mode; - -typedef enum { - COMM_MODE_INTEGRATE = 0, - COMM_MODE_DELAY -} mc_comm_mode; - -typedef enum { - MOTOR_TYPE_BLDC = 0, - MOTOR_TYPE_DC, -} mc_motor_type; - -typedef enum { - FAULT_CODE_NONE = 0, - FAULT_CODE_OVER_VOLTAGE, - FAULT_CODE_UNDER_VOLTAGE, - FAULT_CODE_DRV8302, - FAULT_CODE_ABS_OVER_CURRENT, - FAULT_CODE_OVER_TEMP_FET, - FAULT_CODE_OVER_TEMP_MOTOR -} mc_fault_code; - -typedef enum { - CONTROL_MODE_DUTY = 0, - CONTROL_MODE_SPEED, - CONTROL_MODE_CURRENT, - CONTROL_MODE_CURRENT_BRAKE, - CONTROL_MODE_POS, - CONTROL_MODE_NONE -} mc_control_mode; - -typedef struct { - float cycle_int_limit; - float cycle_int_limit_running; - float cycle_int_limit_max; - float comm_time_sum; - float comm_time_sum_min_rpm; - int32_t comms; - uint32_t time_at_comm; -} mc_rpm_dep_struct; - -typedef struct { - // Switching and drive - mc_pwm_mode pwm_mode; - mc_comm_mode comm_mode; - mc_motor_type motor_type; - // Limits - float l_current_max; - float l_current_min; - float l_in_current_max; - float l_in_current_min; - float l_abs_current_max; - float l_min_erpm; - float l_max_erpm; - float l_max_erpm_fbrake; - float l_max_erpm_fbrake_cc; - float l_min_vin; - float l_max_vin; - bool l_slow_abs_current; - bool l_rpm_lim_neg_torque; - float l_temp_fet_start; - float l_temp_fet_end; - float l_temp_motor_start; - float l_temp_motor_end; - float l_min_duty; - float l_max_duty; - // Overridden limits (Computed during runtime) - float lo_current_max; - float lo_current_min; - float lo_in_current_max; - float lo_in_current_min; - // Sensorless - bool sl_is_sensorless; - float sl_min_erpm; - float sl_min_erpm_cycle_int_limit; - float sl_max_fullbreak_current_dir_change; - float sl_cycle_int_limit; - float sl_phase_advance_at_br; - float sl_cycle_int_rpm_br; - float sl_bemf_coupling_k; - // Hall sensor - int8_t hall_dir; - int8_t hall_fwd_add; - int8_t hall_rev_add; - // Speed PID - float s_pid_kp; - float s_pid_ki; - float s_pid_kd; - float s_pid_min_rpm; - // Pos PID - float p_pid_kp; - float p_pid_ki; - float p_pid_kd; - // Current controller - float cc_startup_boost_duty; - float cc_min_current; - float cc_gain; - float cc_ramp_step_max; - // Misc - int32_t m_fault_stop_time_ms; -} mc_configuration; - -// Applications to use -typedef enum { - APP_NONE = 0, - APP_PPM, - APP_ADC, - APP_UART, - APP_PPM_UART, - APP_ADC_UART, - APP_NUNCHUK, - APP_NRF, - APP_CUSTOM -} app_use; - -// PPM control types -typedef enum { - PPM_CTRL_TYPE_NONE = 0, - PPM_CTRL_TYPE_CURRENT, - PPM_CTRL_TYPE_CURRENT_NOREV, - PPM_CTRL_TYPE_CURRENT_NOREV_BRAKE, - PPM_CTRL_TYPE_DUTY, - PPM_CTRL_TYPE_DUTY_NOREV, - PPM_CTRL_TYPE_PID, - PPM_CTRL_TYPE_PID_NOREV -} ppm_control_type; - -typedef struct { - ppm_control_type ctrl_type; - float pid_max_erpm; - float hyst; - float pulse_start; - float pulse_end; - bool median_filter; - bool safe_start; - float rpm_lim_start; - float rpm_lim_end; - bool multi_esc; - bool tc; - float tc_max_diff; -} ppm_config; - -// ADC control types -typedef enum { - ADC_CTRL_TYPE_NONE = 0, - ADC_CTRL_TYPE_CURRENT, - ADC_CTRL_TYPE_CURRENT_REV_CENTER, - ADC_CTRL_TYPE_CURRENT_REV_BUTTON, - ADC_CTRL_TYPE_CURRENT_NOREV_BRAKE_CENTER, - ADC_CTRL_TYPE_CURRENT_NOREV_BRAKE_BUTTON, - ADC_CTRL_TYPE_DUTY, - ADC_CTRL_TYPE_DUTY_REV_CENTER, - ADC_CTRL_TYPE_DUTY_REV_BUTTON -} adc_control_type; - -typedef struct { - adc_control_type ctrl_type; - float hyst; - float voltage_start; - float voltage_end; - bool use_filter; - bool safe_start; - bool button_inverted; - bool voltage_inverted; - float rpm_lim_start; - float rpm_lim_end; - bool multi_esc; - bool tc; - float tc_max_diff; - uint32_t update_rate_hz; -} adc_config; - -// Nunchuk control types -typedef enum { - CHUK_CTRL_TYPE_NONE = 0, - CHUK_CTRL_TYPE_CURRENT, - CHUK_CTRL_TYPE_CURRENT_NOREV -} chuk_control_type; - -typedef struct { - chuk_control_type ctrl_type; - float hyst; - float rpm_lim_start; - float rpm_lim_end; - float ramp_time_pos; - float ramp_time_neg; - bool multi_esc; - bool tc; - float tc_max_diff; -} chuk_config; - -typedef struct { - // Settings - uint8_t controller_id; - uint32_t timeout_msec; - float timeout_brake_current; - bool send_can_status; - uint32_t send_can_status_rate_hz; - - // Application to use - app_use app_to_use; - - // PPM application settings - ppm_config app_ppm_conf; - - // ADC application settings - adc_config app_adc_conf; - - // UART application settings - uint32_t app_uart_baudrate; - - // Nunchuk application settings - chuk_config app_chuk_conf; -} app_configuration; - -// Communication commands -typedef enum { - COMM_FW_VERSION = 0, - COMM_JUMP_TO_BOOTLOADER, - COMM_ERASE_NEW_APP, - COMM_WRITE_NEW_APP_DATA, - COMM_GET_VALUES, - COMM_SET_DUTY, - COMM_SET_CURRENT, - COMM_SET_CURRENT_BRAKE, - COMM_SET_RPM, - COMM_SET_POS, - COMM_SET_DETECT, - COMM_SET_SERVO_OFFSET, - COMM_SET_MCCONF, - COMM_GET_MCCONF, - COMM_SET_APPCONF, - COMM_GET_APPCONF, - COMM_SAMPLE_PRINT, - COMM_TERMINAL_CMD, - COMM_PRINT, - COMM_ROTOR_POSITION, - COMM_EXPERIMENT_SAMPLE, - COMM_DETECT_MOTOR_PARAM, - COMM_REBOOT, - COMM_ALIVE, - COMM_GET_DECODED_PPM, - COMM_GET_DECODED_ADC, - COMM_GET_DECODED_CHUK, - COMM_FORWARD_CAN -} COMM_PACKET_ID; - -// CAN commands -typedef enum { - CAN_PACKET_SET_DUTY = 0, - CAN_PACKET_SET_CURRENT, - CAN_PACKET_SET_CURRENT_BRAKE, - CAN_PACKET_SET_RPM, - CAN_PACKET_SET_POS, - CAN_PACKET_FILL_RX_BUFFER, - CAN_PACKET_FILL_RX_BUFFER_LONG, - CAN_PACKET_PROCESS_RX_BUFFER, - CAN_PACKET_PROCESS_SHORT_BUFFER, - CAN_PACKET_STATUS -} CAN_PACKET_ID; - -// Logged fault data -typedef struct { - mc_fault_code fault; - float current; - float current_filtered; - float voltage; - float duty; - float rpm; - int tacho; - int tim_pwm_cnt; - int tim_samp_cnt; - int comm_step; - float temperature; -} fault_data; - -// External LED state -typedef enum { - LED_EXT_OFF = 0, - LED_EXT_NORMAL, - LED_EXT_BRAKE, - LED_EXT_TURN_LEFT, - LED_EXT_TURN_RIGHT, - LED_EXT_BRAKE_TURN_LEFT, - LED_EXT_BRAKE_TURN_RIGHT, - LED_EXT_BATT -} LED_EXT_STATE; - -typedef struct { - int js_x; - int js_y; - int acc_x; - int acc_y; - int acc_z; - bool bt_c; - bool bt_z; -} chuck_data; - -typedef struct { - int id; - systime_t rx_time; - float rpm; - float current; - float duty; -} can_status_msg; - -typedef struct { - uint8_t js_x; - uint8_t js_y; - bool bt_c; - bool bt_z; - bool bt_push; - float vbat; -} mote_state; - -typedef enum { - MOTE_PACKET_BATT_LEVEL = 0, - MOTE_PACKET_BUTTONS -} MOTE_PACKET; - -#endif /* DATATYPES_H_ */ diff --git a/oroca_bldc_FW/src/core/eeprom.c b/oroca_bldc_FW/src/core/eeprom.c deleted file mode 100755 index c71b1d2..0000000 --- a/oroca_bldc_FW/src/core/eeprom.c +++ /dev/null @@ -1,634 +0,0 @@ -/** - ****************************************************************************** - * @file EEPROM_Emulation/src/eeprom.c - * @author MCD Application Team - * @version V1.0.0 - * @date 10-October-2011 - * @brief This file provides all the EEPROM emulation firmware functions. - ****************************************************************************** - * @attention - * - * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS - * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE - * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY - * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING - * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE - * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. - * - *

© COPYRIGHT 2011 STMicroelectronics

- ****************************************************************************** - */ - -/** @addtogroup EEPROM_Emulation - * @{ - */ - -/* Includes ------------------------------------------------------------------*/ -#include "eeprom.h" -#include "flash_helper.h" - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ - -/* Global variable used to store variable value in read sequence */ -uint16_t DataVar = 0; - -/* Virtual address defined by the user: 0xFFFF value is prohibited */ -extern uint16_t VirtAddVarTab[NB_OF_VAR]; - -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ -static FLASH_Status EE_Format(void); -static uint16_t EE_FindValidPage(uint8_t Operation); -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data); -static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data); -static uint16_t EE_EraseSectorIfNotEmpty(uint32_t FLASH_Sector, uint8_t VoltageRange); - -/** - * @brief Restore the pages to a known good state in case of page's status - * corruption after a power loss. - * @param None. - * @retval - Flash error code: on write Flash error - * - FLASH_COMPLETE: on success - */ -uint16_t EE_Init(void) -{ - uint16_t PageStatus0 = 6, PageStatus1 = 6; - uint16_t VarIdx = 0; - uint16_t EepromStatus = 0, ReadStatus = 0; - int16_t x = -1; - uint16_t FlashStatus; - - /* Get Page0 status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - /* Get Page1 status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - /* Check for invalid header states and repair if necessary */ - switch (PageStatus0) - { - case ERASED: - if (PageStatus1 == VALID_PAGE) /* Page0 erased, Page1 valid */ - { - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID,VOLTAGE_RANGE); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else if (PageStatus1 == RECEIVE_DATA) /* Page0 erased, Page1 receive */ - { - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID, VOLTAGE_RANGE); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - /* Mark Page1 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE1_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else /* First EEPROM access (Page0&1 are erased) or invalid state -> format EEPROM */ - { - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - break; - - case RECEIVE_DATA: - if (PageStatus1 == VALID_PAGE) /* Page0 receive, Page1 valid */ - { - /* Transfer data from Page1 to Page0 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - { - x = VarIdx; - } - if (VarIdx != x) - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) - { - /* Transfer the variable to the Page0 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != FLASH_COMPLETE) - { - return EepromStatus; - } - } - } - } - /* Mark Page0 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else if (PageStatus1 == ERASED) /* Page0 receive, Page1 erased */ - { - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - /* Mark Page0 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE0_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else /* Invalid state -> format eeprom */ - { - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - break; - - case VALID_PAGE: - if (PageStatus1 == VALID_PAGE) /* Invalid state -> format eeprom */ - { - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else if (PageStatus1 == ERASED) /* Page0 valid, Page1 erased */ - { - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - else /* Page0 valid, Page1 receive */ - { - /* Transfer data from Page0 to Page1 */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) - { - x = VarIdx; - } - if (VarIdx != x) - { - /* Read the last variables' updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) - { - /* Transfer the variable to the Page1 */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != FLASH_COMPLETE) - { - return EepromStatus; - } - } - } - } - /* Mark Page1 as valid */ - FlashStatus = FLASH_ProgramHalfWord(PAGE1_BASE_ADDRESS, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID, VOLTAGE_RANGE); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - } - break; - - default: /* Any other state -> format eeprom */ - /* Erase both Page0 and Page1 and set Page0 as valid page */ - FlashStatus = EE_Format(); - /* If erase/program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - break; - } - - return FLASH_COMPLETE; -} - -/** - * @brief Returns the last stored variable data, if found, which correspond to - * the passed virtual address - * @param VirtAddress: Variable virtual address - * @param Data: Global variable contains the read variable value - * @retval Success or error status: - * - 0: if variable was found - * - 1: if the variable was not found - * - NO_VALID_PAGE: if no valid page was found. - */ -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) -{ - uint16_t ValidPage = PAGE0; - uint16_t AddressValue = 0x5555, ReadStatus = 1; - uint32_t Address = EEPROM_START_ADDRESS, PageStartAddress = EEPROM_START_ADDRESS; - - /* Get active Page for read operation */ - ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) - { - return NO_VALID_PAGE; - } - - /* Get the valid Page start Address */ - PageStartAddress = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - - /* Get the valid Page end Address */ - Address = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - - /* Check each active page address starting from end */ - while (Address > (PageStartAddress + 2)) - { - /* Get the current location content to be compared with virtual address */ - AddressValue = (*(__IO uint16_t*)Address); - - /* Compare the read address with the virtual address */ - if (AddressValue == VirtAddress) - { - /* Get content of Address-2 which is variable value */ - *Data = (*(__IO uint16_t*)(Address - 2)); - - /* In case variable value is read, reset ReadStatus flag */ - ReadStatus = 0; - - break; - } - else - { - /* Next address location */ - Address = Address - 4; - } - } - - /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ - return ReadStatus; -} - -/** - * @brief Writes/upadtes variable data in EEPROM. - * @param VirtAddress: Variable virtual address - * @param Data: 16 bit data to be written - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) -{ - uint16_t Status = 0; - - /* Write the variable virtual address and value in the EEPROM */ - Status = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - - /* In case the EEPROM active page is full */ - if (Status == PAGE_FULL) - { - /* Perform Page transfer */ - Status = EE_PageTransfer(VirtAddress, Data); - } - - /* Return last operation status */ - return Status; -} - -/** - * @brief Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE - * @param None - * @retval Status of the last operation (Flash write or erase) done during - * EEPROM formating - */ -static FLASH_Status EE_Format(void) -{ - FLASH_Status FlashStatus = FLASH_COMPLETE; - - /* Erase Page0 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE0_ID, VOLTAGE_RANGE); - - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - - /* Set Page0 as valid page: Write VALID_PAGE at Page0 base address */ - FlashStatus = FLASH_ProgramHalfWord(PAGE0_BASE_ADDRESS, VALID_PAGE); - - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - - /* Erase Page1 */ - FlashStatus = EE_EraseSectorIfNotEmpty(PAGE1_ID, VOLTAGE_RANGE); - - /* Return Page1 erase operation status */ - return FlashStatus; -} - -/** - * @brief Find valid Page for write or read operation - * @param Operation: operation to achieve on the valid page. - * This parameter can be one of the following values: - * @arg READ_FROM_VALID_PAGE: read operation from valid page - * @arg WRITE_IN_VALID_PAGE: write operation from valid page - * @retval Valid page number (PAGE or PAGE1) or NO_VALID_PAGE in case - * of no valid page was found - */ -static uint16_t EE_FindValidPage(uint8_t Operation) -{ - uint16_t PageStatus0 = 6, PageStatus1 = 6; - - /* Get Page0 actual status */ - PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); - - /* Get Page1 actual status */ - PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); - - /* Write or read operation */ - switch (Operation) - { - case WRITE_IN_VALID_PAGE: /* ---- Write operation ---- */ - if (PageStatus1 == VALID_PAGE) - { - /* Page0 receiving data */ - if (PageStatus0 == RECEIVE_DATA) - { - return PAGE0; /* Page0 valid */ - } - else - { - return PAGE1; /* Page1 valid */ - } - } - else if (PageStatus0 == VALID_PAGE) - { - /* Page1 receiving data */ - if (PageStatus1 == RECEIVE_DATA) - { - return PAGE1; /* Page1 valid */ - } - else - { - return PAGE0; /* Page0 valid */ - } - } - else - { - return NO_VALID_PAGE; /* No valid Page */ - } - - case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ - if (PageStatus0 == VALID_PAGE) - { - return PAGE0; /* Page0 valid */ - } - else if (PageStatus1 == VALID_PAGE) - { - return PAGE1; /* Page1 valid */ - } - else - { - return NO_VALID_PAGE ; /* No valid Page */ - } - - default: - return PAGE0; /* Page0 valid */ - } -} - -/** - * @brief Verify if active page is full and Writes variable in EEPROM. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data) -{ - FLASH_Status FlashStatus = FLASH_COMPLETE; - uint16_t ValidPage = PAGE0; - uint32_t Address = EEPROM_START_ADDRESS, PageEndAddress = EEPROM_START_ADDRESS+PAGE_SIZE; - - /* Get valid Page for write operation */ - ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); - - /* Check if there is no valid page */ - if (ValidPage == NO_VALID_PAGE) - { - return NO_VALID_PAGE; - } - - /* Get the valid Page start Address */ - Address = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); - - /* Get the valid Page end Address */ - PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 2) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); - - /* Check each active page address starting from begining */ - while (Address < PageEndAddress) - { - /* Verify if Address and Address+2 contents are 0xFFFFFFFF */ - if ((*(__IO uint32_t*)Address) == 0xFFFFFFFF) - { - /* Set variable data */ - FlashStatus = FLASH_ProgramHalfWord(Address, Data); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - /* Set variable virtual address */ - FlashStatus = FLASH_ProgramHalfWord(Address + 2, VirtAddress); - /* Return program operation status */ - return FlashStatus; - } - else - { - /* Next address location */ - Address = Address + 4; - } - } - - /* Return PAGE_FULL in case the valid page is full */ - return PAGE_FULL; -} - -/** - * @brief Transfers last updated variables data from the full Page to - * an empty one. - * @param VirtAddress: 16 bit virtual address of the variable - * @param Data: 16 bit data to be written as variable value - * @retval Success or error status: - * - FLASH_COMPLETE: on success - * - PAGE_FULL: if valid page is full - * - NO_VALID_PAGE: if no valid page was found - * - Flash error code: on write Flash error - */ -static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) -{ - FLASH_Status FlashStatus = FLASH_COMPLETE; - uint32_t NewPageAddress = EEPROM_START_ADDRESS; - uint16_t OldPageId=0; - uint16_t ValidPage = PAGE0, VarIdx = 0; - uint16_t EepromStatus = 0, ReadStatus = 0; - - /* Get active Page for read operation */ - ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); - - if (ValidPage == PAGE1) /* Page1 valid */ - { - /* New page address where variable will be moved to */ - NewPageAddress = PAGE0_BASE_ADDRESS; - - /* Old page ID where variable will be taken from */ - OldPageId = PAGE1_ID; - } - else if (ValidPage == PAGE0) /* Page0 valid */ - { - /* New page address where variable will be moved to */ - NewPageAddress = PAGE1_BASE_ADDRESS; - - /* Old page ID where variable will be taken from */ - OldPageId = PAGE0_ID; - } - else - { - return NO_VALID_PAGE; /* No valid Page */ - } - - /* Set the new Page status to RECEIVE_DATA status */ - FlashStatus = FLASH_ProgramHalfWord(NewPageAddress, RECEIVE_DATA); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - - /* Write the variable passed as parameter in the new active page */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != FLASH_COMPLETE) - { - return EepromStatus; - } - - /* Transfer process: transfer variables from old to the new active page */ - for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) - { - if (VirtAddVarTab[VarIdx] != VirtAddress) /* Check each variable except the one passed as parameter */ - { - /* Read the other last variable updates */ - ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); - /* In case variable corresponding to the virtual address was found */ - if (ReadStatus != 0x1) - { - /* Transfer the variable to the new active page */ - EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); - /* If program operation was failed, a Flash error code is returned */ - if (EepromStatus != FLASH_COMPLETE) - { - return EepromStatus; - } - } - } - } - - /* Erase the old Page: Set old Page status to ERASED status */ - FlashStatus = EE_EraseSectorIfNotEmpty(OldPageId, VOLTAGE_RANGE); - /* If erase operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - - /* Set new Page status to VALID_PAGE status */ - FlashStatus = FLASH_ProgramHalfWord(NewPageAddress, VALID_PAGE); - /* If program operation was failed, a Flash error code is returned */ - if (FlashStatus != FLASH_COMPLETE) - { - return FlashStatus; - } - - /* Return last operation flash status */ - return FlashStatus; -} - -/* - * Erase flash page if it is not already erased. This is to save write cycles and - * prevent the memory from getting erased in case of unstable voltage at boot. - */ -static uint16_t EE_EraseSectorIfNotEmpty(uint32_t FLASH_Sector, uint8_t VoltageRange) { - uint8_t *addr = flash_helper_get_sector_address(FLASH_Sector); - - for (unsigned int i = 0;i < PAGE_SIZE;i++) { - if (addr[i] != 0xFF) { - return FLASH_EraseSector(FLASH_Sector, VoltageRange); - } - } - - return FLASH_COMPLETE; -} - -/** - * @} - */ - -/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ diff --git a/oroca_bldc_FW/src/core/eeprom.h b/oroca_bldc_FW/src/core/eeprom.h deleted file mode 100755 index 5f46770..0000000 --- a/oroca_bldc_FW/src/core/eeprom.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - ****************************************************************************** - * @file EEPROM_Emulation/inc/eeprom.h - * @author MCD Application Team - * @version V1.0.0 - * @date 10-October-2011 - * @brief This file contains all the functions prototypes for the EEPROM - * emulation firmware library. - ****************************************************************************** - * @attention - * - * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS - * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE - * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY - * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING - * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE - * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. - * - *

© COPYRIGHT 2011 STMicroelectronics

- ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __EEPROM_H -#define __EEPROM_H - -/* Includes ------------------------------------------------------------------*/ -#include "stm32f4xx_conf.h" - -/* Exported constants --------------------------------------------------------*/ -/* Define the size of the sectors to be used */ -#define PAGE_SIZE (uint32_t)0x4000 /* Page size = 16KByte */ - -/* Device voltage range supposed to be [2.7V to 3.6V], the operation will - be done by word */ -#define VOLTAGE_RANGE (uint8_t)VoltageRange_3 - -/* EEPROM start address in Flash */ -#define EEPROM_START_ADDRESS ((uint32_t)0x08004000) /* EEPROM emulation start address: - from sector1 : after 16KByte of used - Flash memory */ - -/* Pages 0 and 1 base and end addresses */ -#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000)) -#define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1))) -#define PAGE0_ID FLASH_Sector_1 - -#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x4000)) -#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1))) -#define PAGE1_ID FLASH_Sector_2 - -/* Used Flash pages for EEPROM emulation */ -#define PAGE0 ((uint16_t)0x0000) -#define PAGE1 ((uint16_t)0x0001) - -/* No valid page define */ -#define NO_VALID_PAGE ((uint16_t)0x00AB) - -/* Page status definitions */ -#define ERASED ((uint16_t)0xFFFF) /* Page is empty */ -#define RECEIVE_DATA ((uint16_t)0xEEEE) /* Page is marked to receive data */ -#define VALID_PAGE ((uint16_t)0x0000) /* Page containing valid data */ - -/* Valid pages in read and write defines */ -#define READ_FROM_VALID_PAGE ((uint8_t)0x00) -#define WRITE_IN_VALID_PAGE ((uint8_t)0x01) - -/* Page full define */ -#define PAGE_FULL ((uint8_t)0x80) - -/* Variables' number */ -#define NB_OF_VAR ((uint8_t)160) - -/* Exported types ------------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -uint16_t EE_Init(void); -uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); -uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); - -#endif /* __EEPROM_H */ - -/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ diff --git a/oroca_bldc_FW/src/core/flash_helper.c b/oroca_bldc_FW/src/core/flash_helper.c deleted file mode 100755 index a0c73a1..0000000 --- a/oroca_bldc_FW/src/core/flash_helper.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - Copyright 2012-2015 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * flash_helper.c - * - * Created on: 6 maj 2015 - * Author: benjamin - */ - -#include "flash_helper.h" -#include "ch.h" -#include "hal.h" -#include "stm32f4xx_conf.h" -#include "utils.h" -//#include "mc_interface.h" -#include "hw.h" -#include - -/* - * Defines - */ -#define FLASH_SECTORS 12 -#define BOOTLOADER_BASE 11 -#define APP_BASE 0 -#define NEW_APP_BASE 8 -#define NEW_APP_SECTORS 3 - -// Base address of the Flash sectors -#define ADDR_FLASH_SECTOR_0 ((uint32_t)0x08000000) // Base @ of Sector 0, 16 Kbytes -#define ADDR_FLASH_SECTOR_1 ((uint32_t)0x08004000) // Base @ of Sector 1, 16 Kbytes -#define ADDR_FLASH_SECTOR_2 ((uint32_t)0x08008000) // Base @ of Sector 2, 16 Kbytes -#define ADDR_FLASH_SECTOR_3 ((uint32_t)0x0800C000) // Base @ of Sector 3, 16 Kbytes -#define ADDR_FLASH_SECTOR_4 ((uint32_t)0x08010000) // Base @ of Sector 4, 64 Kbytes -#define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08020000) // Base @ of Sector 5, 128 Kbytes -#define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08040000) // Base @ of Sector 6, 128 Kbytes -#define ADDR_FLASH_SECTOR_7 ((uint32_t)0x08060000) // Base @ of Sector 7, 128 Kbytes -#define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08080000) // Base @ of Sector 8, 128 Kbytes -#define ADDR_FLASH_SECTOR_9 ((uint32_t)0x080A0000) // Base @ of Sector 9, 128 Kbytes -#define ADDR_FLASH_SECTOR_10 ((uint32_t)0x080C0000) // Base @ of Sector 10, 128 Kbytes -#define ADDR_FLASH_SECTOR_11 ((uint32_t)0x080E0000) // Base @ of Sector 11, 128 Kbytes - -// Private constants -static const uint32_t flash_addr[FLASH_SECTORS] = { - ADDR_FLASH_SECTOR_0, - ADDR_FLASH_SECTOR_1, - ADDR_FLASH_SECTOR_2, - ADDR_FLASH_SECTOR_3, - ADDR_FLASH_SECTOR_4, - ADDR_FLASH_SECTOR_5, - ADDR_FLASH_SECTOR_6, - ADDR_FLASH_SECTOR_7, - ADDR_FLASH_SECTOR_8, - ADDR_FLASH_SECTOR_9, - ADDR_FLASH_SECTOR_10, - ADDR_FLASH_SECTOR_11 -}; -static const uint16_t flash_sector[12] = { - FLASH_Sector_0, - FLASH_Sector_1, - FLASH_Sector_2, - FLASH_Sector_3, - FLASH_Sector_4, - FLASH_Sector_5, - FLASH_Sector_6, - FLASH_Sector_7, - FLASH_Sector_8, - FLASH_Sector_9, - FLASH_Sector_10, - FLASH_Sector_11 -}; - -uint16_t flash_helper_erase_new_app(uint32_t new_app_size) { - FLASH_Unlock(); - FLASH_ClearFlag(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | - FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - new_app_size += flash_addr[NEW_APP_BASE]; - - mc_interface_unlock(); - mc_interface_release_motor(); - utils_sys_lock_cnt(); - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, DISABLE); - - for (int i = 0;i < NEW_APP_SECTORS;i++) { - if (new_app_size > flash_addr[NEW_APP_BASE + i]) { - uint16_t res = FLASH_EraseSector(flash_sector[NEW_APP_BASE + i], VoltageRange_3); - if (res != FLASH_COMPLETE) { - return res; - } - } else { - break; - } - } - - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE); - utils_sys_unlock_cnt(); - - return FLASH_COMPLETE; -} - -uint16_t flash_helper_write_new_app_data(uint32_t offset, uint8_t *data, uint32_t len) { - FLASH_ClearFlag(FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | - FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); - - mc_interface_unlock(); - mc_interface_release_motor(); - utils_sys_lock_cnt(); - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, DISABLE); - - for (uint32_t i = 0;i < len;i++) { - uint16_t res = FLASH_ProgramByte(flash_addr[NEW_APP_BASE] + offset + i, data[i]); - if (res != FLASH_COMPLETE) { - return res; - } - } - - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE); - utils_sys_unlock_cnt(); - - return FLASH_COMPLETE; -} - -/** - * Stop the system and jump to the bootloader. - */ -void flash_helper_jump_to_bootloader(void) { - typedef void (*pFunction)(void); - - mc_interface_unlock(); - mc_interface_release_motor(); - usbDisconnectBus(&USBD1); - usbStop(&USBD1); - - uartStop(&HW_UART_DEV); - palSetPadMode(HW_UART_TX_PORT, HW_UART_TX_PIN, PAL_MODE_INPUT); - palSetPadMode(HW_UART_RX_PORT, HW_UART_RX_PIN, PAL_MODE_INPUT); - - // Disable watchdog - RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, DISABLE); - - chSysDisable(); - - pFunction jump_to_bootloader; - - // Variable that will be loaded with the start address of the application - volatile uint32_t* jump_address; - const volatile uint32_t* bootloader_address = (volatile uint32_t*)0x080E0000; - - // Get jump address from application vector table - jump_address = (volatile uint32_t*) bootloader_address[1]; - - // Load this address into function pointer - jump_to_bootloader = (pFunction) jump_address; - - // Clear pending interrupts - SCB->ICSR = SCB_ICSR_PENDSVCLR_Msk; - - // Disable all interrupts - for(int i = 0;i < 8;i++) { - NVIC->ICER[i] = NVIC->IABR[i]; - } - - // Set stack pointer - __set_MSP((uint32_t) (bootloader_address[0])); - - // Jump to the bootloader - jump_to_bootloader(); -} - -uint8_t* flash_helper_get_sector_address(uint32_t fsector) { - uint8_t *res = 0; - - for (int i = 0;i < FLASH_SECTORS;i++) { - if (flash_sector[i] == fsector) { - res = (uint8_t *)flash_addr[i]; - break; - } - } - - return res; -} diff --git a/oroca_bldc_FW/src/core/irq_handlers.c b/oroca_bldc_FW/src/core/irq_handlers.c index 663e695..3f603b0 100755 --- a/oroca_bldc_FW/src/core/irq_handlers.c +++ b/oroca_bldc_FW/src/core/irq_handlers.c @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,14 +30,14 @@ CH_IRQ_HANDLER(TIM7_IRQHandler) { CH_IRQ_EPILOGUE(); } - +/* CH_IRQ_HANDLER(ADC1_2_3_IRQHandler) { CH_IRQ_PROLOGUE(); ADC_ClearITPendingBit(ADC1, ADC_IT_JEOC); mcpwm_adc_inj_int_handler(); CH_IRQ_EPILOGUE(); } - +*/ CH_IRQ_HANDLER(HW_ENC_EXTI_ISR_VEC) { if (EXTI_GetITStatus(HW_ENC_EXTI_LINE) != RESET) { // Clear the encoder counter diff --git a/oroca_bldc_FW/src/core/servo_dec.c b/oroca_bldc_FW/src/core/servo_dec.c old mode 100755 new mode 100644 index 5aeb8d3..a9dce6f --- a/oroca_bldc_FW/src/core/servo_dec.c +++ b/oroca_bldc_FW/src/core/servo_dec.c @@ -1,187 +1,193 @@ -/* - Copyright 2012-2015 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * servo_dec.c - * - * Created on: 20 jan 2013 - * Author: benjamin - */ - -#include "servo_dec.h" -#include "stm32f4xx_conf.h" -#include "ch.h" -#include "hal.h" -#include "hw.h" -#include "utils.h" - -/* - * Settings - */ -#define SERVO_NUM 1 -#define TIMER_FREQ 1000000 - -// Private variables -static volatile systime_t last_update_time; -static volatile float servo_pos[SERVO_NUM]; -static volatile float pulse_start = 1.0; -static volatile float pulse_end = 2.0; -static volatile float last_len_received[SERVO_NUM]; -static volatile bool use_median_filter = false; - -// Function pointers -static void(*done_func)(void) = 0; - -static void icuwidthcb(ICUDriver *icup) { - last_len_received[0] = ((float)icuGetWidthX(icup) / ((float)TIMER_FREQ / 1000.0)); - float len = last_len_received[0] - pulse_start; - const float len_set = (pulse_end - pulse_start); - - if (len > len_set) { - if (len < (len_set * 1.2)) { - len = len_set; - } else { - // Too long pulse. Most likely something is wrong. - len = -1.0; - } - } else if (len < 0.0) { - if ((len + pulse_start) > (pulse_start * 0.8)) { - len = 0.0; - } else { - // Too short pulse. Most likely something is wrong. - len = -1.0; - } - } - - if (len >= 0.0) { - if (use_median_filter) { - float c = (len * 2.0 - len_set) / len_set; - static float c1 = 0.5; - static float c2 = 0.5; - float med = utils_middle_of_3(c, c1, c2); - - c2 = c1; - c1 = c; - - servo_pos[0] = med; - } else { - servo_pos[0] = (len * 2.0 - len_set) / len_set; - } - - last_update_time = chVTGetSystemTime(); - - if (done_func) { - done_func(); - } - } -} - -static void icuperiodcb(ICUDriver *icup) { - (void)icup; -} - -static ICUConfig icucfg = { - ICU_INPUT_ACTIVE_HIGH, - TIMER_FREQ, - icuwidthcb, - icuperiodcb, - NULL, - HW_ICU_CHANNEL, - 0 -}; - -/** - * Initialize the serve decoding driver. - * - * @param d_func - * A function that should be called every time the servo signals have been - * decoded. Can be NULL. - */ -void servodec_init(void (*d_func)(void)) { - icuStart(&HW_ICU_DEV, &icucfg); - palSetPadMode(HW_ICU_GPIO, HW_ICU_PIN, PAL_MODE_ALTERNATE(HW_ICU_GPIO_AF)); - icuStartCapture(&HW_ICU_DEV); - icuEnableNotifications(&HW_ICU_DEV); - - for (int i = 0;i < SERVO_NUM;i++) { - servo_pos[i] = 0.0; - last_len_received[i] = 0.0; - } - - // Set our function pointer - done_func = d_func; -} - -/** - * Change the limits of how the servo pulses should be decoded. - * - * @param start - * The amount of milliseconds the pulse starts at (default is 1.0) - * - * @param end - * he amount of milliseconds the pulse ends at (default is 2.0) - */ -void servodec_set_pulse_options(float start, float end, bool median_filter) { - pulse_start = start; - pulse_end = end; - use_median_filter = median_filter; -} - -/** - * Get a decoded servo value. - * - * @param servo_num - * The servo index. If it is out of range, 0.0 will be returned. - * - * @return - * The servo value in the range [-1.0 1.0]. - */ -float servodec_get_servo(int servo_num) { - if (servo_num < SERVO_NUM) { - return servo_pos[servo_num]; - } else { - return 0.0; - } -} - -/** - * Get the amount of milliseconds that has passed since - * the last time servo positions were received. - * - * @return - * The amount of milliseconds that have passed since an update. - */ -uint32_t servodec_get_time_since_update(void) { - return chVTTimeElapsedSinceX(last_update_time) / (CH_CFG_ST_FREQUENCY / 1000); -} - -/** - * Get the length of the last received pulse. - * - * @param servo_num - * The servo index. If it is out of range, 0.0 will be returned. - * - * @return - * The length of the last received pulse. - */ -float servodec_get_last_pulse_len(int servo_num) { - if (servo_num < SERVO_NUM) { - return last_len_received[servo_num]; - } else { - return 0.0; - } -} +/* + Copyright 2012-2015 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * servo_dec.c + * + * Created on: 20 jan 2013 + * Author: bakchajang + */ + +#include "servo_dec.h" +#include "stm32f4xx_conf.h" +#include "ch.h" +#include "hal.h" +#include "hw.h" +#include "uart3.h" +#include "utils.h" + + +/* + * Settings + */ +#define SERVO_NUM 1 +#define TIMER_FREQ 1000000 + +// Private variables +static volatile systime_t last_update_time; +static volatile float servo_pos[SERVO_NUM]; +static volatile float pulse_start = 1.0f; +static volatile float pulse_end = 2.0f; +static volatile float last_len_received[SERVO_NUM]; +static volatile bool use_median_filter = false; + +// Function pointers +static void(*done_func)(void) = 0; + +static void icuwidthcb(ICUDriver *icup) { + + last_len_received[0] = ((float) icuGetWidthX(icup) / ((float)TIMER_FREQ / 1000.0f)); + + float len = last_len_received[0] - pulse_start; + const float len_set = pulse_end - pulse_start; + + //Uart3_printf(&SD3, (uint8_t *)"len_set:%f\r\n",len_set); + + if (len > len_set) { + if (len < (len_set * 1.2)) { + len = len_set; + } else { + // Too long pulse. Most likely something is wrong. + len = -1.0; + } + } else if (len < 0.0) { + if ((len + pulse_start) > (pulse_start * 0.8)) { + len = 0.0; + } else { + // Too short pulse. Most likely something is wrong. + len = -1.0; + } + } + + if (len >= 0.0) { + if (use_median_filter) { + float c = (len * 2.0 - len_set) / len_set; + static float c1 = 0.5; + static float c2 = 0.5; + float med = utils_middle_of_3(c, c1, c2); + + c2 = c1; + c1 = c; + + servo_pos[0] = med; + } else { + servo_pos[0] = (len * 2.0 - len_set) / len_set; + } + + last_update_time = chVTGetSystemTime(); + + if (done_func) { + done_func(); + } + } +} + +static void icuperiodcb(ICUDriver *icup) { + (void)icup; +} + +static ICUConfig icucfg = { + ICU_INPUT_ACTIVE_HIGH, + TIMER_FREQ, + icuwidthcb, + icuperiodcb, + NULL, + HW_ICU_CHANNEL, + 0 +}; + +/** + * Initialize the serve decoding driver. + * + * @param d_func + * A function that should be called every time the servo signals have been + * decoded. Can be NULL. + */ +void servodec_init(void (*d_func)(void)) { + icuStart(&HW_ICU_DEV, &icucfg); + palSetPadMode(HW_ICU_GPIO, HW_ICU_PIN, PAL_MODE_ALTERNATE(HW_ICU_GPIO_AF)); + icuStartCapture(&HW_ICU_DEV); + icuEnableNotifications(&HW_ICU_DEV); + + for (int i = 0;i < SERVO_NUM;i++) { + servo_pos[i] = 0.0; + last_len_received[i] = 0.0; + } + + // Set our function pointer + done_func = d_func; +} + +/** + * Change the limits of how the servo pulses should be decoded. + * + * @param start + * The amount of milliseconds the pulse starts at (default is 1.0) + * + * @param end + * he amount of milliseconds the pulse ends at (default is 2.0) + */ +void servodec_set_pulse_options(float start, float end, bool median_filter) { + pulse_start = start; + pulse_end = end; + use_median_filter = median_filter; +} + +/** + * Get a decoded servo value. + * + * @param servo_num + * The servo index. If it is out of range, 0.0 will be returned. + * + * @return + * The servo value in the range [-1.0 1.0]. + */ +float servodec_get_servo(int servo_num) { + if (servo_num < SERVO_NUM) { + return servo_pos[servo_num]; + } else { + return 0.0; + } +} + +/** + * Get the amount of milliseconds that has passed since + * the last time servo positions were received. + * + * @return + * The amount of milliseconds that have passed since an update. + */ +uint32_t servodec_get_time_since_update(void) { + return chVTTimeElapsedSinceX(last_update_time) / (CH_CFG_ST_FREQUENCY / 1000); +} + +/** + * Get the length of the last received pulse. + * + * @param servo_num + * The servo index. If it is out of range, 0.0 will be returned. + * + * @return + * The length of the last received pulse. + */ +float servodec_get_last_pulse_len(int servo_num) { + if (servo_num < SERVO_NUM) { + return last_len_received[servo_num]; + } else { + return 0.0; + } +} diff --git a/oroca_bldc_FW/src/core/servo_dec.h b/oroca_bldc_FW/src/core/servo_dec.h old mode 100755 new mode 100644 index cb20431..ccb20a1 --- a/oroca_bldc_FW/src/core/servo_dec.h +++ b/oroca_bldc_FW/src/core/servo_dec.h @@ -1,38 +1,39 @@ -/* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * servo_dec.h - * - * Created on: 20 jan 2013 - * Author: benjamin - */ - -#ifndef SERVO_DEC_H_ -#define SERVO_DEC_H_ - -#include -#include - -// Functions -void servodec_init(void (*d_func)(void)); -void servodec_set_pulse_options(float start, float end, bool median_filter); -float servodec_get_servo(int servo_num); -uint32_t servodec_get_time_since_update(void); -float servodec_get_last_pulse_len(int servo_num); - -#endif /* SERVO_DEC_H_ */ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * servo_dec.h + * + * Created on: 20 jan 2013 + * Author: bakchajang + */ + +#ifndef SERVO_DEC_H_ +#define SERVO_DEC_H_ + +#include +#include +//#include + +// Functions +void servodec_init(void (*d_func)(void)); +void servodec_set_pulse_options(float start, float end, bool median_filter); +float servodec_get_servo(int servo_num); +uint32_t servodec_get_time_since_update(void); +float servodec_get_last_pulse_len(int servo_num); + +#endif /* SERVO_DEC_H_ */ diff --git a/oroca_bldc_FW/src/core/timeout.c b/oroca_bldc_FW/src/core/timeout.c new file mode 100644 index 0000000..fcb0962 --- /dev/null +++ b/oroca_bldc_FW/src/core/timeout.c @@ -0,0 +1,87 @@ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * timeout.c + * + * Created on: 20 sep 2014 + * Author: bakchajang + */ + +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" + +#include "timeout.h" +#include "mcpwm.h" + +// Private variables +static volatile systime_t timeout_msec; +static volatile systime_t last_update_time; +static volatile bool has_timeout; + +// Threads +static THD_WORKING_AREA(timeout_thread_wa, 512); +static THD_FUNCTION(timeout_thread, arg); + + +void timeout_configure(systime_t timeout) { + timeout_msec = timeout; +} + +void timeout_reset(void) { + last_update_time = chVTGetSystemTimeX(); +} + +bool timeout_has_timeout(void) { + return has_timeout; +} + +systime_t timeout_get_timeout_msec(void) { + return timeout_msec; +} + +static THD_FUNCTION(timeout_thread, arg) +{ + (void)arg; + + chRegSetThreadName("Timeout"); + + for(;;) + { + if (timeout_msec != 0 && chVTTimeElapsedSinceX(last_update_time) > MS2ST(timeout_msec)) + { + has_timeout = true; + } + else + { + has_timeout = false; + } + + chThdSleepMilliseconds(10); + } + +} + +void timeout_init(void) { + timeout_msec = 1000; + last_update_time = 0; + has_timeout = false; + + chThdCreateStatic(timeout_thread_wa, sizeof(timeout_thread_wa), NORMALPRIO, timeout_thread, NULL); +} + diff --git a/oroca_bldc_FW/src/core/flash_helper.h b/oroca_bldc_FW/src/core/timeout.h old mode 100755 new mode 100644 similarity index 57% rename from oroca_bldc_FW/src/core/flash_helper.h rename to oroca_bldc_FW/src/core/timeout.h index 326c2f3..81cdd83 --- a/oroca_bldc_FW/src/core/flash_helper.h +++ b/oroca_bldc_FW/src/core/timeout.h @@ -1,36 +1,47 @@ -/* - Copyright 2012-2015 Benjamin Vedder benjamin@vedder.se - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -/* - * flash_helper.h - * - * Created on: 6 maj 2015 - * Author: benjamin - */ - -#ifndef FLASH_HELPER_H_ -#define FLASH_HELPER_H_ - -#include "conf_general.h" - -// Functions -uint16_t flash_helper_erase_new_app(uint32_t new_app_size); -uint16_t flash_helper_write_new_app_data(uint32_t offset, uint8_t *data, uint32_t len); -void flash_helper_jump_to_bootloader(void); -uint8_t* flash_helper_get_sector_address(uint32_t fsector); - -#endif /* FLASH_HELPER_H_ */ +/* + Copyright 2012-2014 OROCA ESC Project www.oroca.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * timeout.h + * + * Created on: 20 sep 2014 + * Author: bakchajang + */ + +#ifndef TIMEOUT_H_ +#define TIMEOUT_H_ + +#include "chtypes.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +// Functions +void timeout_init(void); +void timeout_configure(systime_t timeout); +void timeout_reset(void); +bool timeout_has_timeout(void); +systime_t timeout_get_timeout_msec(void); + +#ifdef __cplusplus +} +#endif + + +#endif /* TIMEOUT_H_ */ diff --git a/oroca_bldc_FW/src/core/uart3.c b/oroca_bldc_FW/src/core/uart3.c new file mode 100644 index 0000000..4d871df --- /dev/null +++ b/oroca_bldc_FW/src/core/uart3.c @@ -0,0 +1,138 @@ +// NOTE: this file is created from the USB_CDC testhal example + +#include "ch.h" +#include "hal.h" +#include "stm32f4xx_conf.h" + +#include +#include +#include +#include + +#include "uart3.h" + +#define USART_CR1_9BIT_WORD (1 << 12) /* CR1 9 bit word */ +#define USART_CR1_PARITY_SET (1 << 10) /* CR1 parity bit enable */ +#define USART_CR1_EVEN_PARITY (0 << 9) /* CR1 even parity */ + +#define PrintS2(x) Uart3_SendString(&SD3, x); /* for example 4 */ + +static SerialConfig sd3cfg = { + 115200, /* 115200 baud rate */ + USART_CR1_9BIT_WORD | USART_CR1_PARITY_SET | USART_CR1_EVEN_PARITY, + USART_CR2_STOP1_BITS | USART_CR2_LINEN, + 0 +}; + + + void Uart3_init(void) +{ + + /* + * Activates the serial driver 3 using the driver sd3cfg configuration. + * PC10(TX) and PC11(RX) are routed to USART3. + * PAL_MODE_ALTERNATE is the value that you pass from Table 9. Alternate function mapping + * in DM00037051 - STM32F405xx/STM32F407xx Datasheet + */ + sdStart(&SD3, &sd3cfg); + palSetPadMode(GPIOC, 10, PAL_MODE_ALTERNATE(7)); + palSetPadMode(GPIOC, 11, PAL_MODE_ALTERNATE(7)); + +} + + void Uart3_print(char *p) +{ + while (*p) chSequentialStreamPut(&SD3, *p++); +} + + void Uart3_println(char *p) +{ + while (*p) chSequentialStreamPut(&SD3, *p++); + chSequentialStreamWrite(&SD3, (uint8_t *)"\r\n", 2); +} + + void Uart3_printn(uint32_t n) +{ + char buf[16], *p; + + if (!n) chSequentialStreamPut(&SD3, '0'); + else { + p = buf; + while (n) + *p++ = (n % 10) + '0', n /= 10; + while (p > buf) + chSequentialStreamPut(&SD3, *--p); + } +} + + void Uart3_SendString(SerialDriver *sdp, const char *string) +{ + uint8_t i; + for (i=0; string[i]!='\0'; i++) + sdPut(sdp, string[i]); +} + + void Uart3_printf(BaseSequentialStream * chp,const char * fmt,...) +{ + //chprintf((BaseSequentialStream *)&SD3, "Example: %d\r\n", 2); + chprintf(chp,fmt); +} + + + +void Uart3_write(char *pbuf, uint8_t len) +{ + int i; + for(i=0;i +#include "chprintf.h" + +void Uart3_init(void); +void Uart3_printf(BaseSequentialStream * chp,const char * fmt,...); + +void Uart3_write(char *pbuf, uint8_t len); +uint8_t Uart3_getch( void ); + + +#endif diff --git a/oroca_bldc_FW/src/core/usb_uart.c b/oroca_bldc_FW/src/core/usb_uart.c-- old mode 100755 new mode 100644 similarity index 96% rename from oroca_bldc_FW/src/core/usb_uart.c rename to oroca_bldc_FW/src/core/usb_uart.c-- index 6f1cb71..c1b18f9 --- a/oroca_bldc_FW/src/core/usb_uart.c +++ b/oroca_bldc_FW/src/core/usb_uart.c-- @@ -1,371 +1,371 @@ -// NOTE: this file is created from the USB_CDC testhal example - -#include "ch.h" -#include "hal.h" - -#include -#include -#include -#include - -/* - * Endpoints to be used for USBD2. - */ -#define USBD2_DATA_REQUEST_EP 1 -#define USBD2_DATA_AVAILABLE_EP 1 -#define USBD2_INTERRUPT_REQUEST_EP 2 - -/* - * Serial over USB Driver structure. - */ -SerialUSBDriver SDU1; - -/* - * USB Device Descriptor. - */ -static const uint8_t vcom_device_descriptor_data[18] = { - USB_DESC_DEVICE (0x0110, /* bcdUSB (1.1). */ - 0x02, /* bDeviceClass (CDC). */ - 0x00, /* bDeviceSubClass. */ - 0x00, /* bDeviceProtocol. */ - 0x40, /* bMaxPacketSize. */ - 0x0483, /* idVendor (ST). */ - 0x5740, /* idProduct. */ - 0x0200, /* bcdDevice. */ - 1, /* iManufacturer. */ - 2, /* iProduct. */ - 3, /* iSerialNumber. */ - 1) /* bNumConfigurations. */ -}; - -/* - * Device Descriptor wrapper. - */ -static const USBDescriptor vcom_device_descriptor = { - sizeof vcom_device_descriptor_data, - vcom_device_descriptor_data -}; - -/* Configuration Descriptor tree for a CDC.*/ -static const uint8_t vcom_configuration_descriptor_data[67] = { - /* Configuration Descriptor.*/ - USB_DESC_CONFIGURATION(67, /* wTotalLength. */ - 0x02, /* bNumInterfaces. */ - 0x01, /* bConfigurationValue. */ - 0, /* iConfiguration. */ - 0xC0, /* bmAttributes (self powered). */ - 50), /* bMaxPower (100mA). */ - /* Interface Descriptor.*/ - USB_DESC_INTERFACE (0x00, /* bInterfaceNumber. */ - 0x00, /* bAlternateSetting. */ - 0x01, /* bNumEndpoints. */ - 0x02, /* bInterfaceClass (Communications - Interface Class, CDC section - 4.2). */ - 0x02, /* bInterfaceSubClass (Abstract - Control Model, CDC section 4.3). */ - 0x01, /* bInterfaceProtocol (AT commands, - CDC section 4.4). */ - 0), /* iInterface. */ - /* Header Functional Descriptor (CDC section 5.2.3).*/ - USB_DESC_BYTE (5), /* bLength. */ - USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ - USB_DESC_BYTE (0x00), /* bDescriptorSubtype (Header - Functional Descriptor. */ - USB_DESC_BCD (0x0110), /* bcdCDC. */ - /* Call Management Functional Descriptor. */ - USB_DESC_BYTE (5), /* bFunctionLength. */ - USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ - USB_DESC_BYTE (0x01), /* bDescriptorSubtype (Call Management - Functional Descriptor). */ - USB_DESC_BYTE (0x00), /* bmCapabilities (D0+D1). */ - USB_DESC_BYTE (0x01), /* bDataInterface. */ - /* ACM Functional Descriptor.*/ - USB_DESC_BYTE (4), /* bFunctionLength. */ - USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ - USB_DESC_BYTE (0x02), /* bDescriptorSubtype (Abstract - Control Management Descriptor). */ - USB_DESC_BYTE (0x02), /* bmCapabilities. */ - /* Union Functional Descriptor.*/ - USB_DESC_BYTE (5), /* bFunctionLength. */ - USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ - USB_DESC_BYTE (0x06), /* bDescriptorSubtype (Union - Functional Descriptor). */ - USB_DESC_BYTE (0x00), /* bMasterInterface (Communication - Class Interface). */ - USB_DESC_BYTE (0x01), /* bSlaveInterface0 (Data Class - Interface). */ - /* Endpoint 2 Descriptor.*/ - USB_DESC_ENDPOINT (USBD2_INTERRUPT_REQUEST_EP|0x80, - 0x03, /* bmAttributes (Interrupt). */ - 0x0008, /* wMaxPacketSize. */ - 0xFF), /* bInterval. */ - /* Interface Descriptor.*/ - USB_DESC_INTERFACE (0x01, /* bInterfaceNumber. */ - 0x00, /* bAlternateSetting. */ - 0x02, /* bNumEndpoints. */ - 0x0A, /* bInterfaceClass (Data Class - Interface, CDC section 4.5). */ - 0x00, /* bInterfaceSubClass (CDC section - 4.6). */ - 0x00, /* bInterfaceProtocol (CDC section - 4.7). */ - 0x00), /* iInterface. */ - /* Endpoint 3 Descriptor.*/ - USB_DESC_ENDPOINT (USBD2_DATA_AVAILABLE_EP, /* bEndpointAddress.*/ - 0x02, /* bmAttributes (Bulk). */ - 0x0040, /* wMaxPacketSize. */ - 0x00), /* bInterval. */ - /* Endpoint 1 Descriptor.*/ - USB_DESC_ENDPOINT (USBD2_DATA_REQUEST_EP|0x80, /* bEndpointAddress.*/ - 0x02, /* bmAttributes (Bulk). */ - 0x0040, /* wMaxPacketSize. */ - 0x00) /* bInterval. */ -}; - -/* - * Configuration Descriptor wrapper. - */ -static const USBDescriptor vcom_configuration_descriptor = { - sizeof vcom_configuration_descriptor_data, - vcom_configuration_descriptor_data -}; - -/* - * U.S. English language identifier. - */ -static const uint8_t vcom_string0[] = { - USB_DESC_BYTE(4), /* bLength. */ - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ - USB_DESC_WORD(0x0409) /* wLANGID (U.S. English). */ -}; - -/* - * Vendor string. - */ -static const uint8_t vcom_string1[] = { - USB_DESC_BYTE(38), /* bLength. */ - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ - 'S', 0, 'T', 0, 'M', 0, 'i', 0, 'c', 0, 'r', 0, 'o', 0, 'e', 0, - 'l', 0, 'e', 0, 'c', 0, 't', 0, 'r', 0, 'o', 0, 'n', 0, 'i', 0, - 'c', 0, 's', 0 -}; - -/* - * Device Description string. - */ -static const uint8_t vcom_string2[] = { - USB_DESC_BYTE(56), /* bLength. */ - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ - 'C', 0, 'h', 0, 'i', 0, 'b', 0, 'i', 0, 'O', 0, 'S', 0, '/', 0, - 'R', 0, 'T', 0, ' ', 0, 'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0, - 'a', 0, 'l', 0, ' ', 0, 'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0, - 'o', 0, 'r', 0, 't', 0 -}; - -/* - * Serial Number string. - */ -static const uint8_t vcom_string3[] = { - USB_DESC_BYTE(8), /* bLength. */ - USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ - '0' + CH_KERNEL_MAJOR, 0, - '0' + CH_KERNEL_MINOR, 0, - '0' + CH_KERNEL_PATCH, 0 -}; - -/* - * Strings wrappers array. - */ -static const USBDescriptor vcom_strings[] = { - {sizeof vcom_string0, vcom_string0}, - {sizeof vcom_string1, vcom_string1}, - {sizeof vcom_string2, vcom_string2}, - {sizeof vcom_string3, vcom_string3} -}; - -/* - * Handles the GET_DESCRIPTOR callback. All required descriptors must be - * handled here. - */ -static const USBDescriptor *get_descriptor(USBDriver *usbp, - uint8_t dtype, - uint8_t dindex, - uint16_t lang) { - - (void)usbp; - (void)lang; - switch (dtype) { - case USB_DESCRIPTOR_DEVICE: - return &vcom_device_descriptor; - case USB_DESCRIPTOR_CONFIGURATION: - return &vcom_configuration_descriptor; - case USB_DESCRIPTOR_STRING: - if (dindex < 4) - return &vcom_strings[dindex]; - } - return NULL; -} - -/** - * @brief IN EP1 state. - */ -static USBInEndpointState ep1instate; - -/** - * @brief OUT EP1 state. - */ -static USBOutEndpointState ep1outstate; - -/** - * @brief EP1 initialization structure (both IN and OUT). - */ -static const USBEndpointConfig ep1config = { - USB_EP_MODE_TYPE_BULK, - NULL, - sduDataTransmitted, - sduDataReceived, - 0x0040, - 0x0040, - &ep1instate, - &ep1outstate, - 2, - NULL -}; - -/** - * @brief IN EP2 state. - */ -static USBInEndpointState ep2instate; - -/** - * @brief EP2 initialization structure (IN only). - */ -static const USBEndpointConfig ep2config = { - USB_EP_MODE_TYPE_INTR, - NULL, - sduInterruptTransmitted, - NULL, - 0x0010, - 0x0000, - &ep2instate, - NULL, - 1, - NULL -}; - -/* - * Handles the USB driver global events. - */ -static void usb_event(USBDriver *usbp, usbevent_t event) { - - switch (event) { - case USB_EVENT_RESET: - return; - case USB_EVENT_ADDRESS: - return; - case USB_EVENT_CONFIGURED: - chSysLockFromISR(); - - /* Enables the endpoints specified into the configuration. - Note, this callback is invoked from an ISR so I-Class functions - must be used.*/ - usbInitEndpointI(usbp, USBD2_DATA_REQUEST_EP, &ep1config); - usbInitEndpointI(usbp, USBD2_INTERRUPT_REQUEST_EP, &ep2config); - - /* Resetting the state of the CDC subsystem.*/ - sduConfigureHookI(&SDU1); - - chSysUnlockFromISR(); - return; - case USB_EVENT_SUSPEND: - return; - case USB_EVENT_WAKEUP: - return; - case USB_EVENT_STALLED: - return; - } - return; -} - -/* - * USB driver configuration. - */ -static const USBConfig usbcfg = { - usb_event, - get_descriptor, - sduRequestsHook, - NULL -}; - -/* - * Serial over USB driver configuration. - */ -const SerialUSBConfig serusbcfg = { - &USBD1, - USBD2_DATA_REQUEST_EP, - USBD2_DATA_AVAILABLE_EP, - USBD2_INTERRUPT_REQUEST_EP -}; - - -void usb_uart_init(void) -{ - sduObjectInit(&SDU1); - sduStart(&SDU1, &serusbcfg); - - /* - * Activates the USB driver and then the USB bus pull-up on D+. - * Note, a delay is inserted in order to not have to disconnect the cable - * after a reset. - */ - usbDisconnectBus(serusbcfg.usbp); - chThdSleepMilliseconds(1500); - usbStart(serusbcfg.usbp, &usbcfg); - usbConnectBus(serusbcfg.usbp); -} - -int usb_uart_isActive(void) -{ - return SDU1.config->usbp->state == USB_ACTIVE; -} - - -int usb_uart_printf( const char *fmt, ...) -{ - int ret = 0; - va_list arg; - va_start (arg, fmt); - int len; - static char print_buffer[255]; - - len = vsnprintf(print_buffer, 255, fmt, arg); - va_end (arg); - - ret = chSequentialStreamWrite(&SDU1, print_buffer, len); - - return ret; -} - - -int usb_uart_write( uint8_t *p_data, uint32_t len ) -{ - int ret = 0; - - ret = chSequentialStreamWrite(&SDU1, p_data, len); - - return ret; -} - -uint8_t usb_uart_getch( void ) -{ - uint8_t buffer[128]; - int len; - - - len = chSequentialStreamRead(&SDU1, (uint8_t*) buffer, 1); - - return buffer[0]; -} - - +// NOTE: this file is created from the USB_CDC testhal example + +#include "ch.h" +#include "hal.h" + +#include +#include +#include +#include + +/* + * Endpoints to be used for USBD2. + */ +#define USBD2_DATA_REQUEST_EP 1 +#define USBD2_DATA_AVAILABLE_EP 1 +#define USBD2_INTERRUPT_REQUEST_EP 2 + +/* + * Serial over USB Driver structure. + */ +SerialUSBDriver SDU1; + +/* + * USB Device Descriptor. + */ +static const uint8_t vcom_device_descriptor_data[18] = { + USB_DESC_DEVICE (0x0110, /* bcdUSB (1.1). */ + 0x02, /* bDeviceClass (CDC). */ + 0x00, /* bDeviceSubClass. */ + 0x00, /* bDeviceProtocol. */ + 0x40, /* bMaxPacketSize. */ + 0x0483, /* idVendor (ST). */ + 0x5740, /* idProduct. */ + 0x0200, /* bcdDevice. */ + 1, /* iManufacturer. */ + 2, /* iProduct. */ + 3, /* iSerialNumber. */ + 1) /* bNumConfigurations. */ +}; + +/* + * Device Descriptor wrapper. + */ +static const USBDescriptor vcom_device_descriptor = { + sizeof vcom_device_descriptor_data, + vcom_device_descriptor_data +}; + +/* Configuration Descriptor tree for a CDC.*/ +static const uint8_t vcom_configuration_descriptor_data[67] = { + /* Configuration Descriptor.*/ + USB_DESC_CONFIGURATION(67, /* wTotalLength. */ + 0x02, /* bNumInterfaces. */ + 0x01, /* bConfigurationValue. */ + 0, /* iConfiguration. */ + 0xC0, /* bmAttributes (self powered). */ + 50), /* bMaxPower (100mA). */ + /* Interface Descriptor.*/ + USB_DESC_INTERFACE (0x00, /* bInterfaceNumber. */ + 0x00, /* bAlternateSetting. */ + 0x01, /* bNumEndpoints. */ + 0x02, /* bInterfaceClass (Communications + Interface Class, CDC section + 4.2). */ + 0x02, /* bInterfaceSubClass (Abstract + Control Model, CDC section 4.3). */ + 0x01, /* bInterfaceProtocol (AT commands, + CDC section 4.4). */ + 0), /* iInterface. */ + /* Header Functional Descriptor (CDC section 5.2.3).*/ + USB_DESC_BYTE (5), /* bLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x00), /* bDescriptorSubtype (Header + Functional Descriptor. */ + USB_DESC_BCD (0x0110), /* bcdCDC. */ + /* Call Management Functional Descriptor. */ + USB_DESC_BYTE (5), /* bFunctionLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x01), /* bDescriptorSubtype (Call Management + Functional Descriptor). */ + USB_DESC_BYTE (0x00), /* bmCapabilities (D0+D1). */ + USB_DESC_BYTE (0x01), /* bDataInterface. */ + /* ACM Functional Descriptor.*/ + USB_DESC_BYTE (4), /* bFunctionLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x02), /* bDescriptorSubtype (Abstract + Control Management Descriptor). */ + USB_DESC_BYTE (0x02), /* bmCapabilities. */ + /* Union Functional Descriptor.*/ + USB_DESC_BYTE (5), /* bFunctionLength. */ + USB_DESC_BYTE (0x24), /* bDescriptorType (CS_INTERFACE). */ + USB_DESC_BYTE (0x06), /* bDescriptorSubtype (Union + Functional Descriptor). */ + USB_DESC_BYTE (0x00), /* bMasterInterface (Communication + Class Interface). */ + USB_DESC_BYTE (0x01), /* bSlaveInterface0 (Data Class + Interface). */ + /* Endpoint 2 Descriptor.*/ + USB_DESC_ENDPOINT (USBD2_INTERRUPT_REQUEST_EP|0x80, + 0x03, /* bmAttributes (Interrupt). */ + 0x0008, /* wMaxPacketSize. */ + 0xFF), /* bInterval. */ + /* Interface Descriptor.*/ + USB_DESC_INTERFACE (0x01, /* bInterfaceNumber. */ + 0x00, /* bAlternateSetting. */ + 0x02, /* bNumEndpoints. */ + 0x0A, /* bInterfaceClass (Data Class + Interface, CDC section 4.5). */ + 0x00, /* bInterfaceSubClass (CDC section + 4.6). */ + 0x00, /* bInterfaceProtocol (CDC section + 4.7). */ + 0x00), /* iInterface. */ + /* Endpoint 3 Descriptor.*/ + USB_DESC_ENDPOINT (USBD2_DATA_AVAILABLE_EP, /* bEndpointAddress.*/ + 0x02, /* bmAttributes (Bulk). */ + 0x0040, /* wMaxPacketSize. */ + 0x00), /* bInterval. */ + /* Endpoint 1 Descriptor.*/ + USB_DESC_ENDPOINT (USBD2_DATA_REQUEST_EP|0x80, /* bEndpointAddress.*/ + 0x02, /* bmAttributes (Bulk). */ + 0x0040, /* wMaxPacketSize. */ + 0x00) /* bInterval. */ +}; + +/* + * Configuration Descriptor wrapper. + */ +static const USBDescriptor vcom_configuration_descriptor = { + sizeof vcom_configuration_descriptor_data, + vcom_configuration_descriptor_data +}; + +/* + * U.S. English language identifier. + */ +static const uint8_t vcom_string0[] = { + USB_DESC_BYTE(4), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + USB_DESC_WORD(0x0409) /* wLANGID (U.S. English). */ +}; + +/* + * Vendor string. + */ +static const uint8_t vcom_string1[] = { + USB_DESC_BYTE(38), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + 'S', 0, 'T', 0, 'M', 0, 'i', 0, 'c', 0, 'r', 0, 'o', 0, 'e', 0, + 'l', 0, 'e', 0, 'c', 0, 't', 0, 'r', 0, 'o', 0, 'n', 0, 'i', 0, + 'c', 0, 's', 0 +}; + +/* + * Device Description string. + */ +static const uint8_t vcom_string2[] = { + USB_DESC_BYTE(56), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + 'C', 0, 'h', 0, 'i', 0, 'b', 0, 'i', 0, 'O', 0, 'S', 0, '/', 0, + 'R', 0, 'T', 0, ' ', 0, 'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0, + 'a', 0, 'l', 0, ' ', 0, 'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0, + 'o', 0, 'r', 0, 't', 0 +}; + +/* + * Serial Number string. + */ +static const uint8_t vcom_string3[] = { + USB_DESC_BYTE(8), /* bLength. */ + USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */ + '0' + CH_KERNEL_MAJOR, 0, + '0' + CH_KERNEL_MINOR, 0, + '0' + CH_KERNEL_PATCH, 0 +}; + +/* + * Strings wrappers array. + */ +static const USBDescriptor vcom_strings[] = { + {sizeof vcom_string0, vcom_string0}, + {sizeof vcom_string1, vcom_string1}, + {sizeof vcom_string2, vcom_string2}, + {sizeof vcom_string3, vcom_string3} +}; + +/* + * Handles the GET_DESCRIPTOR callback. All required descriptors must be + * handled here. + */ +static const USBDescriptor *get_descriptor(USBDriver *usbp, + uint8_t dtype, + uint8_t dindex, + uint16_t lang) { + + (void)usbp; + (void)lang; + switch (dtype) { + case USB_DESCRIPTOR_DEVICE: + return &vcom_device_descriptor; + case USB_DESCRIPTOR_CONFIGURATION: + return &vcom_configuration_descriptor; + case USB_DESCRIPTOR_STRING: + if (dindex < 4) + return &vcom_strings[dindex]; + } + return NULL; +} + +/** + * @brief IN EP1 state. + */ +static USBInEndpointState ep1instate; + +/** + * @brief OUT EP1 state. + */ +static USBOutEndpointState ep1outstate; + +/** + * @brief EP1 initialization structure (both IN and OUT). + */ +static const USBEndpointConfig ep1config = { + USB_EP_MODE_TYPE_BULK, + NULL, + sduDataTransmitted, + sduDataReceived, + 0x0040, + 0x0040, + &ep1instate, + &ep1outstate, + 2, + NULL +}; + +/** + * @brief IN EP2 state. + */ +static USBInEndpointState ep2instate; + +/** + * @brief EP2 initialization structure (IN only). + */ +static const USBEndpointConfig ep2config = { + USB_EP_MODE_TYPE_INTR, + NULL, + sduInterruptTransmitted, + NULL, + 0x0010, + 0x0000, + &ep2instate, + NULL, + 1, + NULL +}; + +/* + * Handles the USB driver global events. + */ +static void usb_event(USBDriver *usbp, usbevent_t event) { + + switch (event) { + case USB_EVENT_RESET: + return; + case USB_EVENT_ADDRESS: + return; + case USB_EVENT_CONFIGURED: + chSysLockFromISR(); + + /* Enables the endpoints specified into the configuration. + Note, this callback is invoked from an ISR so I-Class functions + must be used.*/ + usbInitEndpointI(usbp, USBD2_DATA_REQUEST_EP, &ep1config); + usbInitEndpointI(usbp, USBD2_INTERRUPT_REQUEST_EP, &ep2config); + + /* Resetting the state of the CDC subsystem.*/ + sduConfigureHookI(&SDU1); + + chSysUnlockFromISR(); + return; + case USB_EVENT_SUSPEND: + return; + case USB_EVENT_WAKEUP: + return; + case USB_EVENT_STALLED: + return; + } + return; +} + +/* + * USB driver configuration. + */ +static const USBConfig usbcfg = { + usb_event, + get_descriptor, + sduRequestsHook, + NULL +}; + +/* + * Serial over USB driver configuration. + */ +const SerialUSBConfig serusbcfg = { + &USBD1, + USBD2_DATA_REQUEST_EP, + USBD2_DATA_AVAILABLE_EP, + USBD2_INTERRUPT_REQUEST_EP +}; + + +void usb_uart_init(void) +{ + sduObjectInit(&SDU1); + sduStart(&SDU1, &serusbcfg); + + /* + * Activates the USB driver and then the USB bus pull-up on D+. + * Note, a delay is inserted in order to not have to disconnect the cable + * after a reset. + */ + usbDisconnectBus(serusbcfg.usbp); + chThdSleepMilliseconds(1500); + usbStart(serusbcfg.usbp, &usbcfg); + usbConnectBus(serusbcfg.usbp); +} + +int usb_uart_isActive(void) +{ + return SDU1.config->usbp->state == USB_ACTIVE; +} + + +int usb_uart_printf( const char *fmt, ...) +{ + int ret = 0; + va_list arg; + va_start (arg, fmt); + int len; + static char print_buffer[255]; + + len = vsnprintf(print_buffer, 255, fmt, arg); + va_end (arg); + + ret = chSequentialStreamWrite(&SDU1, print_buffer, len); + + return ret; +} + + +int usb_uart_write( uint8_t *p_data, uint32_t len ) +{ + int ret = 0; + + ret = chSequentialStreamWrite(&SDU1, p_data, len); + + return ret; +} + +uint8_t usb_uart_getch( void ) +{ + uint8_t buffer[128]; + int len; + + + len = chSequentialStreamRead(&SDU1, (uint8_t*) buffer, 1); + + return buffer[0]; +} + + diff --git a/oroca_bldc_FW/src/core/usb_uart.h b/oroca_bldc_FW/src/core/usb_uart.h-- old mode 100755 new mode 100644 similarity index 80% rename from oroca_bldc_FW/src/core/usb_uart.h rename to oroca_bldc_FW/src/core/usb_uart.h-- index d5164b6..7f9b910 --- a/oroca_bldc_FW/src/core/usb_uart.h +++ b/oroca_bldc_FW/src/core/usb_uart.h-- @@ -1,20 +1,20 @@ -/* - * comm_usb_serial.h - * - * Created on: 8 okt 2015 - * Author: benjamin - */ - -#ifndef USB_UART_H_INCLUDED -#define USB_UART_H_INCLUDED - -extern SerialUSBDriver SDU1; - -void usb_uart_init(void); -int usb_uart_isActive(void); - -int usb_uart_write( uint8_t *p_data, uint32_t len ); -int usb_uart_printf( const char *fmt, ...); -uint8_t usb_uart_getch( void ); - -#endif +/* + * comm_usb_serial.h + * + * Created on: 8 okt 2015 + * Author: bakchajang + */ + +#ifndef USB_UART_H_INCLUDED +#define USB_UART_H_INCLUDED + +//extern SerialUSBDriver SDU1; + +void usb_uart_init(void); +int usb_uart_isActive(void); + +int usb_uart_write( uint8_t *p_data, uint32_t len ); +int usb_uart_printf( const char *fmt, ...); +uint8_t usb_uart_getch( void ); + +#endif diff --git a/oroca_bldc_FW/src/core/utils.c b/oroca_bldc_FW/src/core/utils.c index f7436ce..1344a52 100755 --- a/oroca_bldc_FW/src/core/utils.c +++ b/oroca_bldc_FW/src/core/utils.c @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2014 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * utils.c * * Created on: 16 maj 2013 - * Author: benjamin + * Author: bakchajang */ #include "utils.h" @@ -52,6 +52,7 @@ float utils_calc_ratio(float low, float high, float val) { /** * Make sure that 0 <= angle < 360 + * * @param angle * The angle to normalize. */ @@ -63,6 +64,25 @@ void utils_norm_angle(float *angle) { } } +/** + * Make sure that -pi <= angle < pi, + * + * TODO: Maybe use fmodf instead? + * + * @param angle + * The angle to normalize in radians. + * WARNING: Don't use too large angles. + */ +void utils_norm_angle_rad(float *angle) { + while (*angle < -M_PI) { + *angle += 2.0 * M_PI; + } + + while (*angle > M_PI) { + *angle -= 2.0 * M_PI; + } +} + int utils_truncate_number(float *number, float min, float max) { int did_trunc = 0; @@ -81,6 +101,10 @@ float utils_map(float x, float in_min, float in_max, float out_min, float out_ma return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; } +int utils_map_int(int x, int in_min, int in_max, int out_min, int out_max) { + return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; +} + /** * Truncate absolute values less than tres to zero. The value * tres will be mapped to 0 and the value max to max. @@ -109,18 +133,324 @@ void utils_deadband(float *value, float tres, float max) { * The difference between the angles */ float utils_angle_difference(float angle1, float angle2) { - utils_norm_angle(&angle1); - utils_norm_angle(&angle2); +// utils_norm_angle(&angle1); +// utils_norm_angle(&angle2); +// +// if (fabsf(angle1 - angle2) > 180.0) { +// if (angle1 < angle2) { +// angle1 += 360.0; +// } else { +// angle2 += 360.0; +// } +// } +// +// return angle1 - angle2; + + // Faster in most cases + float difference = angle1 - angle2; + while (difference < -180.0) difference += 2.0 * 180.0; + while (difference > 180.0) difference -= 2.0 * 180.0; + return difference; +} + +/** + * Get the difference between two angles. Will always be between -pi and +pi radians. + * @param angle1 + * The first angle in radians + * @param angle2 + * The second angle in radians + * @return + * The difference between the angles in radians + */ +float utils_angle_difference_rad(float angle1, float angle2) { + float difference = angle1 - angle2; + while (difference < -M_PI) difference += 2.0 * M_PI; + while (difference > M_PI) difference -= 2.0 * M_PI; + return difference; +} + +/** + * Takes the average of a number of angles. + * + * @param angles + * The angles in radians. + * + * @param angles_num + * The number of angles. + * + * @param weights + * The weight of the summarized angles + * + * @return + * The average angle. + */ +float utils_avg_angles_rad_fast(float *angles, float *weights, int angles_num) { + float s_sum = 0.0; + float c_sum = 0.0; + + for (int i = 0; i < angles_num; i++) { + float s, c; + utils_fast_sincos_better(angles[i], &s, &c); + s_sum += s * weights[i]; + c_sum += c * weights[i]; + } + + return utils_fast_atan2(s_sum, c_sum); +} + +/** + * Get the middle value of three values + * + * @param a + * First value + * + * @param b + * Second value + * + * @param c + * Third value + * + * @return + * The middle value + */ +float utils_middle_of_3(float a, float b, float c) { + float middle; + + if ((a <= b) && (a <= c)) { + middle = (b <= c) ? b : c; + } else if ((b <= a) && (b <= c)) { + middle = (a <= c) ? a : c; + } else { + middle = (a <= b) ? a : b; + } + return middle; +} + +/** + * Get the middle value of three values + * + * @param a + * First value + * + * @param b + * Second value + * + * @param c + * Third value + * + * @return + * The middle value + */ +int utils_middle_of_3_int(int a, int b, int c) { + int middle; + + if ((a <= b) && (a <= c)) { + middle = (b <= c) ? b : c; + } else if ((b <= a) && (b <= c)) { + middle = (a <= c) ? a : c; + } else { + middle = (a <= b) ? a : b; + } + return middle; +} + +// Fast inverse square-root +// See: http://en.wikipedia.org/wiki/Fast_inverse_square_root +float utils_fast_inv_sqrt(float x) { + union { + float as_float; + long as_int; + } un; + + float xhalf = 0.5f*x; + un.as_float = x; + un.as_int = 0x5f3759df - (un.as_int >> 1); + un.as_float = un.as_float * (1.5f - xhalf * un.as_float * un.as_float); + return un.as_float; +} + +/** + * Fast atan2 + * + * See http://www.dspguru.com/dsp/tricks/fixed-point-atan2-with-self-normalization + * + * @param y + * y + * + * @param x + * x + * + * @return + * The angle in radians + */ +float utils_fast_atan2(float y, float x) { + float abs_y = fabsf(y) + 1e-10; // kludge to prevent 0/0 condition + float angle; + + if (x >= 0) { + float r = (x - abs_y) / (x + abs_y); + float rsq = r * r; + angle = ((0.1963 * rsq) - 0.9817) * r + (M_PI / 4.0); + } else { + float r = (x + abs_y) / (abs_y - x); + float rsq = r * r; + angle = ((0.1963 * rsq) - 0.9817) * r + (3.0 * M_PI / 4.0); + } + + if (y < 0) { + return(-angle); + } else { + return(angle); + } +} + +/** + * Truncate the magnitude of a vector. + * + * @param x + * The first component. + * + * @param y + * The second component. + * + * @param max + * The maximum magnitude. + * + * @return + * True if saturation happened, false otherwise + */ +bool utils_saturate_vector_2d(float *x, float *y, float max) { + bool retval = false; + float mag = sqrtf(*x * *x + *y * *y); + max = fabsf(max); + + if (mag < 1e-10) { + mag = 1e-10; + } - if (fabsf(angle1 - angle2) > 180.0) { - if (angle1 < angle2) { - angle1 += 360.0; + if (mag > max) { + const float f = max / mag; + *x *= f; + *y *= f; + retval = true; + } + + return retval; +} + +/** + * Fast sine and cosine implementation. + * + * See http://lab.polygonal.de/?p=205 + * + * @param angle + * The angle in radians + * WARNING: Don't use too large angles. + * + * @param sin + * A pointer to store the sine value. + * + * @param cos + * A pointer to store the cosine value. + */ +void utils_fast_sincos(float angle, float *sin, float *cos) { + //always wrap input angle to -PI..PI + while (angle < -M_PI) { + angle += 2.0 * M_PI; + } + + while (angle > M_PI) { + angle -= 2.0 * M_PI; + } + + // compute sine + if (angle < 0.0) { + *sin = 1.27323954 * angle + 0.405284735 * angle * angle; + } else { + *sin = 1.27323954 * angle - 0.405284735 * angle * angle; + } + + // compute cosine: sin(x + PI/2) = cos(x) + angle += 0.5 * M_PI; + + if (angle > M_PI) { + angle -= 2.0 * M_PI; + } + + if (angle < 0.0) { + *cos = 1.27323954 * angle + 0.405284735 * angle * angle; + } else { + *cos = 1.27323954 * angle - 0.405284735 * angle * angle; + } +} + +/** + * Fast sine and cosine implementation. + * + * See http://lab.polygonal.de/?p=205 + * + * @param angle + * The angle in radians + * WARNING: Don't use too large angles. + * + * @param sin + * A pointer to store the sine value. + * + * @param cos + * A pointer to store the cosine value. + */ +void utils_fast_sincos_better(float angle, float *sin, float *cos) { + //always wrap input angle to -PI..PI + while (angle < -M_PI) { + angle += 2.0 * M_PI; + } + + while (angle > M_PI) { + angle -= 2.0 * M_PI; + } + + //compute sine + if (angle < 0.0) { + *sin = 1.27323954 * angle + 0.405284735 * angle * angle; + + if (*sin < 0.0) { + *sin = 0.225 * (*sin * -*sin - *sin) + *sin; } else { - angle2 += 360.0; + *sin = 0.225 * (*sin * *sin - *sin) + *sin; } + } else { + *sin = 1.27323954 * angle - 0.405284735 * angle * angle; + + if (*sin < 0.0) { + *sin = 0.225 * (*sin * -*sin - *sin) + *sin; + } else { + *sin = 0.225 * (*sin * *sin - *sin) + *sin; + } + } + + // compute cosine: sin(x + PI/2) = cos(x) + angle += 0.5 * M_PI; + if (angle > M_PI) { + angle -= 2.0 * M_PI; } - return angle1 - angle2; + if (angle < 0.0) { + *cos = 1.27323954 * angle + 0.405284735 * angle * angle; + + if (*cos < 0.0) { + *cos = 0.225 * (*cos * -*cos - *cos) + *cos; + } else { + *cos = 0.225 * (*cos * *cos - *cos) + *cos; + } + } else { + *cos = 1.27323954 * angle - 0.405284735 * angle * angle; + + if (*cos < 0.0) { + *cos = 0.225 * (*cos * -*cos - *cos) + *cos; + } else { + *cos = 0.225 * (*cos * *cos - *cos) + *cos; + } + } } /** diff --git a/oroca_bldc_FW/src/core/utils.h b/oroca_bldc_FW/src/core/utils.h index 68769a3..446e4ce 100755 --- a/oroca_bldc_FW/src/core/utils.h +++ b/oroca_bldc_FW/src/core/utils.h @@ -1,5 +1,5 @@ /* - Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se + Copyright 2012-2015 OROCA ESC Project www.oroca.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,19 +19,32 @@ * utils.h * * Created on: 16 maj 2013 - * Author: benjamin + * Author: bakchajang */ #ifndef UTILS_H_ #define UTILS_H_ +#include + void utils_step_towards(float *value, float goal, float step); float utils_calc_ratio(float low, float high, float val); void utils_norm_angle(float *angle); +void utils_norm_angle_rad(float *angle); int utils_truncate_number(float *number, float min, float max); float utils_map(float x, float in_min, float in_max, float out_min, float out_max); +int utils_map_int(int x, int in_min, int in_max, int out_min, int out_max); void utils_deadband(float *value, float tres, float max); float utils_angle_difference(float angle1, float angle2); +float utils_angle_difference_rad(float angle1, float angle2); +float utils_avg_angles_rad_fast(float *angles, float *weights, int angles_num); +float utils_middle_of_3(float a, float b, float c); +int utils_middle_of_3_int(int a, int b, int c); +float utils_fast_inv_sqrt(float x); +float utils_fast_atan2(float y, float x); +bool utils_saturate_vector_2d(float *x, float *y, float max); +void utils_fast_sincos(float angle, float *sin, float *cos); +void utils_fast_sincos_better(float angle, float *sin, float *cos); void utils_sys_lock_cnt(void); void utils_sys_unlock_cnt(void); @@ -39,6 +52,24 @@ void utils_sys_unlock_cnt(void); #define SIGN(x) ((x<0)?-1:1) // Return the age of a timestamp in seconds -#define UTILS_AGE_S(x) ((float)chTimeElapsedSince(x) / (float)CH_FREQUENCY) +#define UTILS_AGE_S(x) ((float)chVTTimeElapsedSinceX(x) / (float)CH_CFG_ST_FREQUENCY) + +// nan and infinity check for floats +#define UTILS_IS_INF(x) ((x) == (1.0 / 0.0) || (x) == (-1.0 / 0.0)) +#define UTILS_IS_NAN(x) ((x) != (x)) + +/** + * A simple low pass filter. + * + * @param value + * The filtered value. + * + * @param sample + * Next sample. + * + * @param filter_constant + * Filter constant. Range 0.0 to 1.0, where 1.0 gives the unfiltered value. + */ +#define UTILS_LP_FAST(value, sample, filter_constant) (value -= (filter_constant) * (value - (sample))) #endif /* UTILS_H_ */ diff --git a/oroca_bldc_PC/README.md b/oroca_bldc_PC/README.md deleted file mode 100755 index 8ddf3ae..0000000 --- a/oroca_bldc_PC/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# oroca_bldc_dev r2 -BLDC Driver Development Version for OROCA BLDC diff --git a/oroca_bldc_gui/Serial/Serial.sln b/oroca_bldc_gui/Serial/Serial.sln new file mode 100644 index 0000000..33ff211 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serial", "Serial\Serial.csproj", "{15F40E62-90A1-4072-950D-D4CA59BF2B6A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {15F40E62-90A1-4072-950D-D4CA59BF2B6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15F40E62-90A1-4072-950D-D4CA59BF2B6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15F40E62-90A1-4072-950D-D4CA59BF2B6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15F40E62-90A1-4072-950D-D4CA59BF2B6A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/oroca_bldc_gui/Serial/Serial/ByteArrayUtil.cs b/oroca_bldc_gui/Serial/Serial/ByteArrayUtil.cs new file mode 100644 index 0000000..0c2844e --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/ByteArrayUtil.cs @@ -0,0 +1,198 @@ +using System; +using System.Text; + +namespace MavLink +{ + internal static class ByteArrayUtil + { +#if MF_FRAMEWORK_VERSION_V4_1 + private static readonly MavBitConverter bitConverter = new MavBitConverter(); +#else + private static readonly FrameworkBitConverter bitConverter = new FrameworkBitConverter(); +#endif + + public static byte[] ToChar(byte[] source, int sourceOffset, int size) + { + var bytes = new byte[size]; + + for (int i = 0; i < size; i++) + bytes[i] = source[i + sourceOffset]; + + return bytes; + } + + public static byte[] ToUInt8(byte[] source, int sourceOffset, int size) + { + var bytes = new byte[size]; + Array.Copy(source, sourceOffset, bytes, 0, size); + return bytes; + } + + public static sbyte[] ToInt8(byte[] source, int sourceOffset, int size) + { + var bytes = new sbyte[size]; + + for (int i = 0; i < size; i++) + bytes[i] = unchecked((sbyte)source[i + sourceOffset]); + + return bytes; + } + + public static UInt16[] ToUInt16(byte[] source, int sourceOffset, int size) + { + var arr = new UInt16[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToUInt16(source, sourceOffset + (i * sizeof (UInt16))); + return arr; + } + + public static Int16[] ToInt16(byte[] source, int sourceOffset, int size) + { + var arr = new Int16[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToInt16(source, sourceOffset + (i * sizeof(Int16))); + return arr; + } + + public static UInt32[] ToUInt32(byte[] source, int sourceOffset, int size) + { + var arr = new UInt32[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToUInt32(source, sourceOffset + (i * sizeof(UInt32))); + return arr; + } + + public static Int32[] ToInt32(byte[] source, int sourceOffset, int size) + { + var arr = new Int32[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToInt32(source, sourceOffset + (i * sizeof(Int32))); + return arr; + } + + public static UInt64[] ToUInt64(byte[] source, int sourceOffset, int size) + { + var arr = new UInt64[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToUInt64(source, sourceOffset + (i * sizeof(UInt64))); + return arr; + } + + public static Int64[] ToInt64(byte[] source, int sourceOffset, int size) + { + var arr = new Int64[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToInt64(source, sourceOffset + (i * sizeof(Int64))); + return arr; + } + + public static Single[] ToSingle(byte[] source, int sourceOffset, int size) + { + var arr = new Single[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToSingle(source, sourceOffset + (i * sizeof(Single))); + return arr; + } + + public static Double[] ToDouble(byte[] source, int sourceOffset, int size) + { + var arr = new Double[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToDouble(source, sourceOffset + (i * sizeof(Double))); + return arr; + } + + public static void ToByteArray(byte[] src, byte[] dst, int offset, int size) + { + int i; + for (i = 0; i < src.Length; i++) + dst[offset + i] = src[i]; + while (i++ < size) + dst[offset + i] = 0; + } + + public static void ToByteArray(sbyte[] src, byte[] dst, int offset, int size) + { + int i; + for (i = 0; i < size && i + /// 필수 ë””ìžì´ë„ˆ 변수입니다. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 사용 ì¤‘ì¸ ëª¨ë“  리소스를 정리합니다. + /// + /// 관리ë˜ëŠ” 리소스를 삭제해야 하면 trueì´ê³ , 그렇지 않으면 false입니다. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form ë””ìžì´ë„ˆì—서 ìƒì„±í•œ 코드 + + /// + /// ë””ìžì´ë„ˆ ì§€ì›ì— 필요한 메서드입니다. + /// ì´ ë©”ì„œë“œì˜ ë‚´ìš©ì„ ì½”ë“œ 편집기로 수정하지 마십시오. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.rbText = new System.Windows.Forms.RichTextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.btnPortClose = new System.Windows.Forms.Button(); + this.lbStatus = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.cmbStopBits = new System.Windows.Forms.ComboBox(); + this.label4 = new System.Windows.Forms.Label(); + this.cmbParity = new System.Windows.Forms.ComboBox(); + this.label3 = new System.Windows.Forms.Label(); + this.cmbDataBits = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.btnOpen = new System.Windows.Forms.Button(); + this.cmbBRate = new System.Windows.Forms.ComboBox(); + this.cmbPort = new System.Windows.Forms.ComboBox(); + this.SerialPort = new System.IO.Ports.SerialPort(this.components); + this.lbResult = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.button1 = new System.Windows.Forms.Button(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); + this.SuspendLayout(); + // + // rbText + // + this.rbText.Location = new System.Drawing.Point(14, 18); + this.rbText.Name = "rbText"; + this.rbText.ReadOnly = true; + this.rbText.Size = new System.Drawing.Size(636, 457); + this.rbText.TabIndex = 0; + this.rbText.Text = ""; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.btnPortClose); + this.groupBox1.Controls.Add(this.lbStatus); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.cmbStopBits); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.cmbParity); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.cmbDataBits); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.btnOpen); + this.groupBox1.Controls.Add(this.cmbBRate); + this.groupBox1.Controls.Add(this.cmbPort); + this.groupBox1.Location = new System.Drawing.Point(667, 9); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(229, 336); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + // + // btnPortClose + // + this.btnPortClose.BackColor = System.Drawing.Color.Yellow; + this.btnPortClose.ForeColor = System.Drawing.Color.Black; + this.btnPortClose.Location = new System.Drawing.Point(30, 299); + this.btnPortClose.Name = "btnPortClose"; + this.btnPortClose.Size = new System.Drawing.Size(171, 27); + this.btnPortClose.TabIndex = 13; + this.btnPortClose.Text = "Port Close"; + this.btnPortClose.UseVisualStyleBackColor = false; + this.btnPortClose.Visible = false; + this.btnPortClose.Click += new System.EventHandler(this.btnPortClose_Click); + // + // lbStatus + // + this.lbStatus.AutoSize = true; + this.lbStatus.BackColor = System.Drawing.SystemColors.ActiveCaption; + this.lbStatus.Font = new System.Drawing.Font("ë§‘ì€ ê³ ë”•", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.lbStatus.ForeColor = System.Drawing.Color.Yellow; + this.lbStatus.Location = new System.Drawing.Point(34, 266); + this.lbStatus.Name = "lbStatus"; + this.lbStatus.Size = new System.Drawing.Size(123, 25); + this.lbStatus.TabIndex = 12; + this.lbStatus.Text = "Not Connect"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.ForeColor = System.Drawing.Color.Gray; + this.label6.Location = new System.Drawing.Point(8, 248); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(42, 14); + this.label6.TabIndex = 11; + this.label6.Text = "State"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.ForeColor = System.Drawing.Color.Gray; + this.label5.Location = new System.Drawing.Point(8, 203); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(66, 14); + this.label5.TabIndex = 10; + this.label5.Text = "Stop Bits"; + // + // cmbStopBits + // + this.cmbStopBits.FormattingEnabled = true; + this.cmbStopBits.Items.AddRange(new object[] { + "NONE", + "1", + "1.5", + "2"}); + this.cmbStopBits.Location = new System.Drawing.Point(32, 220); + this.cmbStopBits.Name = "cmbStopBits"; + this.cmbStopBits.Size = new System.Drawing.Size(171, 22); + this.cmbStopBits.TabIndex = 9; + this.cmbStopBits.SelectedIndexChanged += new System.EventHandler(this.cmbStopBits_SelectedIndexChanged); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.ForeColor = System.Drawing.Color.Gray; + this.label4.Location = new System.Drawing.Point(8, 160); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(47, 14); + this.label4.TabIndex = 8; + this.label4.Text = "Parity"; + // + // cmbParity + // + this.cmbParity.FormattingEnabled = true; + this.cmbParity.Items.AddRange(new object[] { + "EVEN", + "MARK", + "NONE", + "ODD", + "SPACE"}); + this.cmbParity.Location = new System.Drawing.Point(32, 176); + this.cmbParity.Name = "cmbParity"; + this.cmbParity.Size = new System.Drawing.Size(171, 22); + this.cmbParity.TabIndex = 7; + this.cmbParity.SelectedIndexChanged += new System.EventHandler(this.cmbParity_SelectedIndexChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.ForeColor = System.Drawing.Color.Gray; + this.label3.Location = new System.Drawing.Point(6, 115); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(66, 14); + this.label3.TabIndex = 6; + this.label3.Text = "Data bits"; + // + // cmbDataBits + // + this.cmbDataBits.FormattingEnabled = true; + this.cmbDataBits.Items.AddRange(new object[] { + "8 bits", + "7 bits"}); + this.cmbDataBits.Location = new System.Drawing.Point(30, 132); + this.cmbDataBits.Name = "cmbDataBits"; + this.cmbDataBits.Size = new System.Drawing.Size(171, 22); + this.cmbDataBits.TabIndex = 5; + this.cmbDataBits.SelectedIndexChanged += new System.EventHandler(this.cmbDataBits_SelectedIndexChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.ForeColor = System.Drawing.Color.Gray; + this.label2.Location = new System.Drawing.Point(6, 71); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(74, 14); + this.label2.TabIndex = 4; + this.label2.Text = "Baud Rate"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.ForeColor = System.Drawing.Color.Gray; + this.label1.Location = new System.Drawing.Point(6, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(70, 14); + this.label1.TabIndex = 3; + this.label1.Text = "COM Port"; + // + // btnOpen + // + this.btnOpen.BackColor = System.Drawing.Color.Yellow; + this.btnOpen.ForeColor = System.Drawing.Color.Black; + this.btnOpen.Location = new System.Drawing.Point(30, 299); + this.btnOpen.Name = "btnOpen"; + this.btnOpen.Size = new System.Drawing.Size(171, 27); + this.btnOpen.TabIndex = 2; + this.btnOpen.Text = "Port Open"; + this.btnOpen.UseVisualStyleBackColor = false; + this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click); + // + // cmbBRate + // + this.cmbBRate.FormattingEnabled = true; + this.cmbBRate.Items.AddRange(new object[] { + "9600 bps", + "14400 bps", + "19200 bps", + "38400 bps", + "57600 bps", + "115200 bps"}); + this.cmbBRate.Location = new System.Drawing.Point(30, 87); + this.cmbBRate.Name = "cmbBRate"; + this.cmbBRate.Size = new System.Drawing.Size(171, 22); + this.cmbBRate.TabIndex = 1; + this.cmbBRate.SelectedIndexChanged += new System.EventHandler(this.cmbBRate_SelectedIndexChanged); + // + // cmbPort + // + this.cmbPort.FormattingEnabled = true; + this.cmbPort.Location = new System.Drawing.Point(30, 43); + this.cmbPort.Name = "cmbPort"; + this.cmbPort.Size = new System.Drawing.Size(171, 22); + this.cmbPort.TabIndex = 0; + this.cmbPort.SelectedIndexChanged += new System.EventHandler(this.cmbPort_SelectedIndexChanged); + // + // SerialPort + // + this.SerialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.SP_DataReceived); + // + // lbResult + // + this.lbResult.AutoSize = true; + this.lbResult.BackColor = System.Drawing.SystemColors.ActiveCaption; + this.lbResult.Font = new System.Drawing.Font("ë§‘ì€ ê³ ë”•", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.lbResult.ForeColor = System.Drawing.Color.Yellow; + this.lbResult.Location = new System.Drawing.Point(48, 37); + this.lbResult.Name = "lbResult"; + this.lbResult.Size = new System.Drawing.Size(0, 25); + this.lbResult.TabIndex = 14; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.lbResult); + this.groupBox2.Location = new System.Drawing.Point(667, 385); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(229, 90); + this.groupBox2.TabIndex = 15; + this.groupBox2.TabStop = false; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(668, 357); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 16; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // numericUpDown1 + // + this.numericUpDown1.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDown1.Location = new System.Drawing.Point(776, 357); + this.numericUpDown1.Maximum = new decimal(new int[] { + 2200, + 0, + 0, + 0}); + this.numericUpDown1.Minimum = new decimal(new int[] { + 800, + 0, + 0, + 0}); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(120, 22); + this.numericUpDown1.TabIndex = 17; + this.numericUpDown1.Value = new decimal(new int[] { + 1500, + 0, + 0, + 0}); + this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScroll = true; + this.BackColor = System.Drawing.SystemColors.Menu; + this.ClientSize = new System.Drawing.Size(910, 493); + this.Controls.Add(this.numericUpDown1); + this.Controls.Add(this.button1); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.rbText); + this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ForeColor = System.Drawing.Color.White; + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(926, 531); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(926, 531); + this.Name = "Form1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "시리얼 통신 V1.0"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed); + this.Load += new System.EventHandler(this.Form1_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.RichTextBox rbText; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ComboBox cmbPort; + private System.Windows.Forms.ComboBox cmbBRate; + private System.Windows.Forms.Button btnOpen; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label lbStatus; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ComboBox cmbStopBits; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox cmbParity; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox cmbDataBits; + private System.IO.Ports.SerialPort SerialPort; + private System.Windows.Forms.Button btnPortClose; + private System.Windows.Forms.Label lbResult; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.NumericUpDown numericUpDown1; + } +} + diff --git a/oroca_bldc_gui/Serial/Serial/Form1.cs b/oroca_bldc_gui/Serial/Serial/Form1.cs new file mode 100644 index 0000000..09a58b1 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Form1.cs @@ -0,0 +1,255 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.IO.Ports; +using System.Threading; + +using MavLink; + +namespace Serial +{ + public partial class Form1 : Form + { + + public Form1() + { + InitializeComponent(); + + //í…스스 박스 초기화; + //rbText.ScrollBars = RichTextBoxScrollBars.Vertical; + + //Port + cmbPort.BeginUpdate(); + foreach (string comport in SerialPort.GetPortNames()) + { + cmbPort.Items.Add(comport); + } + cmbPort.EndUpdate(); + + //SerialPort 초기 설정 + // SerialPort.PortName = "COM10"; + //SerialPort.BaudRate = (int)19200; + //SerialPort.DataBits = (int)8; + //SerialPort.Parity = Parity.None; + //SerialPort.StopBits = StopBits.One; + //SP.ReadTimeout = (int)100; + //SP.WriteTimeout = (int)100; + + cmbPort.SelectedIndex = 0; + cmbBRate.SelectedIndex = 5; + cmbDataBits.SelectedIndex = 0; + cmbParity.SelectedIndex = 2; + cmbStopBits.SelectedIndex = 2; + + SerialPort.PortName = cmbPort.SelectedItem.ToString(); + + switch (cmbBRate.SelectedIndex) + { + case 0: SerialPort.BaudRate = (int)9600; break; + case 1: SerialPort.BaudRate = (int)14400; break; + case 2: SerialPort.BaudRate = (int)19200; break; + case 3: SerialPort.BaudRate = (int)38400; break; + case 4: SerialPort.BaudRate = (int)57600; break; + case 5: SerialPort.BaudRate = (int)115200; break; + default: SerialPort.BaudRate = (int)19200; break; + } + + switch (cmbDataBits.SelectedIndex) + { + case 0: SerialPort.DataBits = 8; break; + case 1: SerialPort.DataBits = 7; break; + default: SerialPort.DataBits = 8; break; + } + + switch (cmbParity.SelectedIndex) + { + case 0: SerialPort.Parity = Parity.Even; break; + case 1: SerialPort.Parity = Parity.Mark; break; + case 2: SerialPort.Parity = Parity.None; break; + case 3: SerialPort.Parity = Parity.Odd; break; + case 4: SerialPort.Parity = Parity.Space; break; + default: SerialPort.Parity = Parity.None; break; + } + switch (cmbStopBits.SelectedIndex) + { + case 0: + //SP.StopBits = StopBits.None; + MessageBox.Show("ì´ ê°’ì€ ì§€ì›ë˜ì§€ 않습니다"); + break; + case 1: SerialPort.StopBits = StopBits.One; break; + case 2: SerialPort.StopBits = StopBits.OnePointFive; break; + case 3: SerialPort.StopBits = StopBits.Two; break; + default: SerialPort.StopBits = StopBits.One; break; + } + } + + private void SP_DataReceived(object sender, SerialDataReceivedEventArgs e) + { + if (SerialPort.IsOpen) + { + // string str = SerialPort.ReadLine(); + + string str = SerialPort.ReadExisting(); + + //str = str.Trim().Replace("\r\n", ""); + //lbResult.Text = str; + //rbText.Text = string.Format("{0}{1}{2}", rbText.Text, "[Received]", str+"\r\n"); + //rbText.SelectionStart = rbText.Text.Length; + //rbText.ScrollToCaret(); + rbText.Text += "[ì „ì†¡ëœ Data] " + str; + Thread.Sleep(1000); + } + } + + private void btnOpen_Click(object sender, EventArgs e) + { + SerialPort.Open(); + if (SerialPort.IsOpen) + { + //rbText.Text = string.Format("{0}{1}", rbText.Text, "\r\n[Succed] Port Open!!"); + rbText.Text = "["+SerialPort.PortName.ToString() +"] Port Open Connect!!"; + lbStatus.Text = "Connect!!"; + btnOpen.Visible = false; + btnPortClose.Visible = true; + } + else + { + //rbText.Text = string.Format("{0}{1}", rbText.Text, "\r\n[Fail] Port Open!!"); + rbText.Text = "[" + SerialPort.PortName.ToString() + "] Port Open Failed!"; + lbStatus.Text = "[Fail] Port Open!"; + lbStatus.ForeColor = Color.Red; + } + } + + private void cmbPort_SelectedIndexChanged(object sender, EventArgs e) + { + SerialPort.PortName = cmbPort.SelectedItem.ToString(); + } + + private void cmbBRate_SelectedIndexChanged(object sender, EventArgs e) + { + switch (cmbBRate.SelectedIndex) + { + case 0 : SerialPort.BaudRate = (int)9600; break; + case 1 : SerialPort.BaudRate = (int)14400; break; + case 2 : SerialPort.BaudRate = (int)19200; break; + case 3 : SerialPort.BaudRate = (int)38400; break; + case 4 : SerialPort.BaudRate = (int)57600; break; + case 5 : SerialPort.BaudRate = (int)115200; break; + default: SerialPort.BaudRate = (int)19200; break; + } + } + + private void cmbDataBits_SelectedIndexChanged(object sender, EventArgs e) + { + switch (cmbDataBits.SelectedIndex) + { + case 0: SerialPort.DataBits = 8; break; + case 1: SerialPort.DataBits = 7; break; + default : SerialPort.DataBits = 8; break; + } + } + + private void cmbParity_SelectedIndexChanged(object sender, EventArgs e) + { + switch (cmbParity.SelectedIndex) + { + case 0: SerialPort.Parity = Parity.Even; break; + case 1: SerialPort.Parity = Parity.Mark; break; + case 2: SerialPort.Parity = Parity.None; break; + case 3: SerialPort.Parity = Parity.Odd; break; + case 4: SerialPort.Parity = Parity.Space; break; + default: SerialPort.Parity = Parity.None; break; + } + } + + private void cmbStopBits_SelectedIndexChanged(object sender, EventArgs e) + { + switch (cmbStopBits.SelectedIndex) + { + case 0: + //SP.StopBits = StopBits.None; + MessageBox.Show("ì´ ê°’ì€ ì§€ì›ë˜ì§€ 않습니다"); + break; + case 1: SerialPort.StopBits = StopBits.One; break; + case 2: SerialPort.StopBits = StopBits.OnePointFive; break; + case 3: SerialPort.StopBits = StopBits.Two; break; + default: SerialPort.StopBits = StopBits.One; break; + } + } + + private void Form1_Load(object sender, EventArgs e) + { + CheckForIllegalCrossThreadCalls = false; + } + + private void btnPortClose_Click(object sender, EventArgs e) + { + SerialPort.Close(); + rbText.Text += "\r\n" + "[" + SerialPort.PortName.ToString() + "] Port Close!!"; + lbStatus.Text = "Not Connect!!"; + btnOpen.Visible = true; + btnPortClose.Visible = false; + } + + private void Form1_FormClosed(object sender, FormClosedEventArgs e) + { + if (SerialPort.IsOpen) + { + SerialPort.Close(); + } + } + + private void button1_Click(object sender, EventArgs e) + { + byte[] sendbuf = new byte[100]; + + Msg_set_velocity msg_set_velocity = new Msg_set_velocity(); + msg_set_velocity.ref_angular_velocity = 1500; + + MavlinkPacket mavlink_packet = new MavlinkPacket(); + mavlink_packet.ComponentId = 121; + mavlink_packet.SystemId = 9; + mavlink_packet.Message = msg_set_velocity; + + Mavlink mav_link = new Mavlink(); + sendbuf = mav_link.Send(mavlink_packet); + + // string result = System.Text.Encoding.UTF8.GetString(sendbuf); + string result = BitConverter.ToString(sendbuf); + rbText.Text += "\r\n" + "[" + SerialPort.PortName.ToString() + "] " + result; + + if (SerialPort.IsOpen) + { + SerialPort.Write(sendbuf, 0, sendbuf.Length); + } + } + + private void numericUpDown1_ValueChanged(object sender, EventArgs e) + { + byte[] sendbuf = new byte[100]; + + Msg_set_velocity msg_set_velocity = new Msg_set_velocity(); + msg_set_velocity.ref_angular_velocity = (UInt16)numericUpDown1.Value; + + MavlinkPacket mavlink_packet = new MavlinkPacket(); + mavlink_packet.ComponentId = 121; + mavlink_packet.SystemId = 9; + mavlink_packet.Message = msg_set_velocity; + + Mavlink mav_link = new Mavlink(); + sendbuf = mav_link.Send(mavlink_packet); + + // string result = System.Text.Encoding.UTF8.GetString(sendbuf); + string result = BitConverter.ToString(sendbuf); + rbText.Text += "\r\n" + "[" + SerialPort.PortName.ToString() + "] " + result; + + if (SerialPort.IsOpen) + { + SerialPort.Write(sendbuf, 0, sendbuf.Length); + } + } + + + } +} diff --git a/oroca_bldc_gui/Serial/Serial/Form1.resx b/oroca_bldc_gui/Serial/Serial/Form1.resx new file mode 100644 index 0000000..66000d3 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/oroca_bldc_gui/Serial/Serial/FrameworkBitConverter.cs b/oroca_bldc_gui/Serial/Serial/FrameworkBitConverter.cs new file mode 100644 index 0000000..842e3b5 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/FrameworkBitConverter.cs @@ -0,0 +1,188 @@ +using System; + +namespace MavLink +{ + /// + /// converter from byte[] => primitive CLR types + /// delegates to the .Net framework bitconverter for speed, and to avoid using unsafe pointer + /// casting for Silverlight. + /// + internal class FrameworkBitConverter + { + private bool _shouldReverse = false; + + public void SetDataIsLittleEndian(bool islittle) + { + _shouldReverse = islittle == !BitConverter.IsLittleEndian; + } + + public UInt16 ToUInt16(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new[] {value[startIndex + 1], value[startIndex]}; + return BitConverter.ToUInt16(bytes,0); + } + return BitConverter.ToUInt16(value, startIndex); + } + + public Int16 ToInt16(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new[] { value[startIndex + 1], value[startIndex] }; + return BitConverter.ToInt16(bytes, 0); + } + return BitConverter.ToInt16(value, startIndex); + } + + public sbyte ToInt8(byte[] value, int startIndex) + { + return unchecked((sbyte)value[startIndex]); + } + + public Int32 ToInt32(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[4]; + Array.Copy(value,startIndex,bytes,0,4); + Array.Reverse(bytes); + return BitConverter.ToInt32(bytes, 0); + } + return BitConverter.ToInt32(value, startIndex); + } + + public UInt32 ToUInt32(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[4]; + Array.Copy(value, startIndex, bytes, 0, 4); + Array.Reverse(bytes); + return BitConverter.ToUInt32(bytes, 0); + } + return BitConverter.ToUInt32(value, startIndex); + } + + public UInt64 ToUInt64(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[8]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToUInt64(bytes, 0); + } + return BitConverter.ToUInt64(value, startIndex); + } + + public Int64 ToInt64(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[8]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToInt64(bytes, 0); + } + return BitConverter.ToInt64(value, startIndex); + } + + public Single ToSingle(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[4]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToSingle(bytes, 0); + } + return BitConverter.ToSingle(value, startIndex); + } + + public Double ToDouble(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[8]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToDouble(bytes, 0); + } + return BitConverter.ToDouble(value, startIndex); + } + + public void GetBytes(Double value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + Array.Copy(bytes, 0, dst, offset, bytes.Length); + + } + + public void GetBytes(Single value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(UInt64 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(Int64 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(UInt32 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(Int16 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(Int32 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(UInt16 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public byte[] GetBytes(sbyte value) + { + return new byte[1] + { + (byte)value, + }; + } + } +} \ No newline at end of file diff --git a/oroca_bldc_gui/Serial/Serial/Mavlink.cs b/oroca_bldc_gui/Serial/Serial/Mavlink.cs new file mode 100644 index 0000000..299728d --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Mavlink.cs @@ -0,0 +1,437 @@ +using System; +using MavLink; + +namespace MavLink +{ + /// + /// Mavlink communication class. + /// + /// + /// Keeps track of state across send and receive of packets. + /// User of this class can just send Mavlink Messsages, and + /// receive them by feeding this class bytes off the wire as + /// they arrive + /// + public class Mavlink + { + private byte[] leftovers; + + /// + /// Event raised when a message is decoded successfully + /// + public event PacketReceivedEventHandler PacketReceived; + + /// + /// Total number of packets successfully received so far + /// + public UInt32 PacketsReceived { get; private set; } + + /// + /// Total number of packets which have been rejected due to a failed crc + /// + public UInt32 BadCrcPacketsReceived { get; private set; } + + /// + /// Raised when a packet does not pass CRC + /// + public event PacketCRCFailEventHandler PacketFailedCRC; + + /// + /// Raised when a number of bytes are passed over and cannot + /// be used to decode a packet + /// + public event PacketCRCFailEventHandler BytesUnused; + + // The current packet sequence number for transmission + // public so it can be manipulated for testing + // Normal usage would only read this + public byte txPacketSequence; + + /// + /// Create a new MavlinkLink Object + /// + public Mavlink() + { + MavLinkSerializer.SetDataIsLittleEndian(MavlinkSettings.IsLittleEndian); + leftovers = new byte[] {}; + } + + + /// + /// Process latest bytes from the stream. Received packets will be raised in the event + /// + public void ParseBytes(byte[] newlyReceived) + { + uint i = 0; + + // copy the old and new into a contiguous array + // This is pretty inefficient... + var bytesToProcess = new byte[newlyReceived.Length + leftovers.Length]; + int j = 0; + + for (i = 0; i < leftovers.Length; i++) + bytesToProcess[j++] = leftovers[i]; + + for (i = 0; i < newlyReceived.Length; i++) + bytesToProcess[j++] = newlyReceived[i]; + + i = 0; + + // we are going to loop and decode packets until we use up the data + // at which point we will return. Hence one call to this method could + // result in multiple packet decode events + while (true) + { + // Hunt for the start char + int huntStartPos = (int)i; + + while (i < bytesToProcess.Length && bytesToProcess[i] != MavlinkSettings.ProtocolMarker) + i++; + + if (i == bytesToProcess.Length) + { + // No start byte found in all our bytes. Dump them, Exit. + leftovers = new byte[] { }; + return; + } + + if (i > huntStartPos) + { + // if we get here then are some bytes which this code thinks are + // not interesting and would be dumped. For diagnostics purposes, + // lets pop these bytes up in an event. + if (BytesUnused != null) + { + var badBytes = new byte[i - huntStartPos]; + Array.Copy(bytesToProcess, huntStartPos, badBytes, 0, (int)(i - huntStartPos)); + BytesUnused(this, new PacketCRCFailEventArgs(badBytes, bytesToProcess.Length - huntStartPos)); + } + } + + // We need at least the minimum length of a packet to process it. + // The minimum packet length is 8 bytes for acknowledgement packets without payload + // if we don't have the minimum now, go round again + if (bytesToProcess.Length - i < 8) + { + leftovers = new byte[bytesToProcess.Length - i]; + j = 0; + while (i < bytesToProcess.Length) + leftovers[j++] = bytesToProcess[i++]; + return; + } + + /* + * Byte order: + * + * 0 Packet start sign + * 1 Payload length 0 - 255 + * 2 Packet sequence 0 - 255 + * 3 System ID 1 - 255 + * 4 Component ID 0 - 255 + * 5 Message ID 0 - 255 + * 6 to (n+6) Data (0 - 255) bytes + * (n+7) to (n+8) Checksum (high byte, low byte) for v0.9, lowbyte, highbyte for 1.0 + * + */ + UInt16 payLoadLength = bytesToProcess[i + 1]; + + // Now we know the packet length, + // If we don't have enough bytes in this packet to satisfy that packet lenghth, + // then dump the whole lot in the leftovers and do nothing else - go round again + if (payLoadLength > (bytesToProcess.Length - i - 8)) // payload + 'overhead' bytes (crc, system etc) + { + // back up to the start char for next cycle + j = 0; + + leftovers = new byte[bytesToProcess.Length - i]; + + for (; i < bytesToProcess.Length; i++) + { + leftovers[j++] = bytesToProcess[i]; + } + return; + } + + i++; + + // Check the CRC. Does not include the starting 'U' byte but does include the length + var crc1 = Mavlink_Crc.Calculate(bytesToProcess, (UInt16)(i), (UInt16)(payLoadLength + 5)); + + if (MavlinkSettings.CrcExtra) + { + var possibleMsgId = bytesToProcess[i + 4]; + + if (!MavLinkSerializer.Lookup.ContainsKey(possibleMsgId)) + { + // we have received an unknown message. In this case we don't know the special + // CRC extra, so we have no choice but to fail. + + // The way we do this is to just let the procedure continue + // There will be a natural failure of the main packet CRC + } + else + { + var extra = MavLinkSerializer.Lookup[possibleMsgId]; + crc1 = Mavlink_Crc.CrcAccumulate(extra.CrcExtra, crc1); + } + } + + byte crcHigh = (byte)(crc1 & 0xFF); + byte crcLow = (byte)(crc1 >> 8); + + byte messageCrcHigh = bytesToProcess[i + 5 + payLoadLength]; + byte messageCrcLow = bytesToProcess[i + 6 + payLoadLength]; + + if (messageCrcHigh == crcHigh && messageCrcLow == crcLow) + { + // This is used for data drop outs metrics, not packet windows + // so we should consider this here. + // We pass up to subscribers only as an advisory thing + var rxPacketSequence = bytesToProcess[++i]; + i++; + var packet = new byte[payLoadLength + 3]; // +3 because we are going to send up the sys and comp id and msg type with the data + + for (j = 0; j < packet.Length; j++) + packet[j] = bytesToProcess[i + j]; + + var debugArray = new byte[payLoadLength + 7]; + Array.Copy(bytesToProcess, (int)(i - 3), debugArray, 0, debugArray.Length); + + //OnPacketDecoded(packet, rxPacketSequence, debugArray); + + ProcessPacketBytes(packet, rxPacketSequence); + + PacketsReceived++; + + // clear leftovers, just incase this is the last packet + leftovers = new byte[] { }; + + // advance i here by j to avoid unecessary hunting + // todo: could advance by j + 2 I think? + i = i + (uint)(j + 2); + } + else + { + var badBytes = new byte[i + 7 + payLoadLength]; + Array.Copy(bytesToProcess, (int)(i - 1), badBytes, 0, payLoadLength + 7); + + if (PacketFailedCRC != null) + { + PacketFailedCRC(this, new PacketCRCFailEventArgs(badBytes, (int)(bytesToProcess.Length - i - 1))); + } + + BadCrcPacketsReceived++; + } + } + } + + public byte[] Send(MavlinkPacket mavlinkPacket) + { + var bytes = this.Serialize(mavlinkPacket.Message, mavlinkPacket.SystemId, mavlinkPacket.ComponentId); + return SendPacketLinkLayer(bytes); + } + + // Send a raw message over the link - + // this will add start byte, lenghth, crc and other link layer stuff + private byte[] SendPacketLinkLayer(byte[] packetData) + { + /* + * Byte order: + * + * 0 Packet start sign + * 1 Payload length 0 - 255 + * 2 Packet sequence 0 - 255 + * 3 System ID 1 - 255 + * 4 Component ID 0 - 255 + * 5 Message ID 0 - 255 + * 6 to (n+6) Data (0 - 255) bytes + * (n+7) to (n+8) Checksum (high byte, low byte) + * + */ + var outBytes = new byte[packetData.Length + 5]; + + outBytes[0] = MavlinkSettings.ProtocolMarker; + outBytes[1] = (byte)(packetData.Length-3); // 3 bytes for sequence, id, msg type which this + // layer does not concern itself with + outBytes[2] = unchecked(txPacketSequence++); + + int i; + + for ( i = 0; i < packetData.Length; i++) + { + outBytes[i + 3] = packetData[i]; + } + + // Check the CRC. Does not include the starting byte but does include the length + var crc1 = Mavlink_Crc.Calculate(outBytes, 1, (UInt16)(packetData.Length + 2)); + + if (MavlinkSettings.CrcExtra) + { + var possibleMsgId = outBytes[5]; + var extra = MavLinkSerializer.Lookup[possibleMsgId]; + crc1 = Mavlink_Crc.CrcAccumulate(extra.CrcExtra, crc1); + } + + byte crc_high = (byte)(crc1 & 0xFF); + byte crc_low = (byte)(crc1 >> 8); + + outBytes[i + 3] = crc_high; + outBytes[i + 4] = crc_low; + + return outBytes; + } + + + // Process a raw packet in it's entirety in the given byte array + // if deserialization is successful, then the packetdecoded event will be raised + private void ProcessPacketBytes(byte[] packetBytes, byte rxPacketSequence) + { + // System ID 1 - 255 + // Component ID 0 - 255 + // Message ID 0 - 255 + // 6 to (n+6) Data (0 - 255) bytes + var packet = new MavlinkPacket + { + SystemId = packetBytes[0], + ComponentId = packetBytes[1], + SequenceNumber = rxPacketSequence, + Message = this.Deserialize(packetBytes, 2) + }; + + if (PacketReceived != null) + { + PacketReceived(this, packet); + } + + // else do what? + } + + + public MavlinkMessage Deserialize(byte[] bytes, int offset) + { + // first byte is the mavlink + var packetNum = (int)bytes[offset + 0]; + var packetGen = MavLinkSerializer.Lookup[packetNum].Deserializer; + return packetGen.Invoke(bytes, offset + 1); + } + + public byte[] Serialize(MavlinkMessage message, int systemId, int componentId) + { + var buff = new byte[256]; + + buff[0] = (byte)systemId; + buff[1] = (byte)componentId; + + var endPos = 3; + + var msgId = message.Serialize(buff, ref endPos); + + buff[2] = (byte)msgId; + + var resultBytes = new byte[endPos]; + Array.Copy(buff, resultBytes, endPos); + + return resultBytes; + } + } + + + /// + /// Describes an occurance when a packet fails CRC + /// + public class PacketCRCFailEventArgs : EventArgs + { + /// + /// + public PacketCRCFailEventArgs(byte[] badPacket, int offset) + { + BadPacket = badPacket; + Offset = offset; + } + + /// + /// The bytes that filed the CRC, including the starting character + /// + public byte[] BadPacket; + + /// + /// The offset in bytes where the start of the block begins, e.g + /// 50 would mean the block of badbytes would start 50 bytes ago + /// in the stread. No negative sign is necessary + /// + public int Offset; + } + + /// + /// Handler for an PacketFailedCRC Event + /// + public delegate void PacketCRCFailEventHandler(object sender, PacketCRCFailEventArgs e); + + + public delegate void PacketReceivedEventHandler(object sender, MavlinkPacket e); + + + /// + /// Represents a Mavlink message - both the message object itself + /// and the identified sending party + /// + public class MavlinkPacket + { + /// + /// The sender's system ID + /// + public int SystemId; + + /// + /// The sender's component ID + /// + public int ComponentId; + + /// + /// The sequence number received for this packet + /// + public byte SequenceNumber; + + + /// + /// Time of receipt + /// + public DateTime TimeStamp; + + /// + /// Object which is the mavlink message + /// + public MavlinkMessage Message; + } + + /// + /// Crc code copied/adapted from ardumega planner code + /// + internal static class Mavlink_Crc + { + const UInt16 X25_INIT_CRC = 0xffff; + + public static UInt16 CrcAccumulate(byte b, UInt16 crc) + { + unchecked + { + byte ch = (byte)(b ^ (byte)(crc & 0x00ff)); + ch = (byte)(ch ^ (ch << 4)); + return (UInt16)((crc >> 8) ^ (ch << 8) ^ (ch << 3) ^ (ch >> 4)); + } + } + + + // For a "message" of length bytes contained in the byte array + // pointed to by buffer, calculate the CRC + public static UInt16 Calculate(byte[] buffer, UInt16 start, UInt16 length) + { + UInt16 crcTmp = X25_INIT_CRC; + + for (int i = start; i < start + length; i++) + crcTmp = CrcAccumulate(buffer[i], crcTmp); + + return crcTmp; + } + } +} diff --git a/oroca_bldc_gui/Serial/Serial/Program.cs b/oroca_bldc_gui/Serial/Serial/Program.cs new file mode 100644 index 0000000..a2105f3 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace Serial +{ + static class Program + { + /// + /// 해당 ì‘ìš© í”„ë¡œê·¸ëž¨ì˜ ì£¼ ì§„ìž…ì ìž…니다. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/oroca_bldc_gui/Serial/Serial/Properties/AssemblyInfo.cs b/oroca_bldc_gui/Serial/Serial/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e4dbf48 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// ì–´ì…ˆë¸”ë¦¬ì˜ ì¼ë°˜ 정보는 ë‹¤ìŒ íŠ¹ì„± ì§‘í•©ì„ í†µí•´ 제어ë©ë‹ˆë‹¤. +// 어셈블리와 ê´€ë ¨ëœ ì •ë³´ë¥¼ 수정하려면 +// ì´ íŠ¹ì„± ê°’ì„ ë³€ê²½í•˜ì‹­ì‹œì˜¤. +//[assembly: AssemblyTitle("Serial")] +//[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +//[assembly: AssemblyProduct("Serial")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisibleì„ false로 설정하면 ì´ ì–´ì…ˆë¸”ë¦¬ì˜ í˜•ì‹ì´ COM 구성 ìš”ì†Œì— +// 표시ë˜ì§€ 않습니다. COMì—서 ì´ ì–´ì…ˆë¸”ë¦¬ì˜ í˜•ì‹ì— 액세스하려면 +// 해당 형ì‹ì— 대해 ComVisible íŠ¹ì„±ì„ true로 설정하십시오. +[assembly: ComVisible(false)] + +// ì´ í”„ë¡œì íŠ¸ê°€ COMì— ë…¸ì¶œë˜ëŠ” 경우 ë‹¤ìŒ GUID는 typelibì˜ ID를 나타냅니다. +[assembly: Guid("9f32a736-c9f5-43fe-93a3-1f28cac407be")] + +// ì–´ì…ˆë¸”ë¦¬ì˜ ë²„ì „ 정보는 ë‹¤ìŒ ë„¤ 가지 값으로 구성ë©ë‹ˆë‹¤. +// +// 주 버전 +// ë¶€ 버전 +// 빌드 번호 +// 수정 버전 +// +// 모든 ê°’ì„ ì§€ì •í•˜ê±°ë‚˜ 아래와 ê°™ì´ '*'를 사용하여 빌드 번호 ë° ìˆ˜ì • ë²„ì „ì´ ìžë™ìœ¼ë¡œ +// 지정ë˜ë„ë¡ í•  수 있습니다. +// [assembly: AssemblyVersion("1.0.*")] +//[assembly: AssemblyVersion("1.0.0.0")] +//[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/oroca_bldc_gui/Serial/Serial/Properties/Resources.Designer.cs b/oroca_bldc_gui/Serial/Serial/Properties/Resources.Designer.cs new file mode 100644 index 0000000..401a949 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// ì´ ì½”ë“œëŠ” ë„구를 사용하여 ìƒì„±ë˜ì—ˆìŠµë‹ˆë‹¤. +// 런타임 버전:4.0.30319.42000 +// +// íŒŒì¼ ë‚´ìš©ì„ ë³€ê²½í•˜ë©´ ìž˜ëª»ëœ ë™ìž‘ì´ ë°œìƒí•  수 있으며, 코드를 다시 ìƒì„±í•˜ë©´ +// ì´ëŸ¬í•œ 변경 ë‚´ìš©ì´ ì†ì‹¤ë©ë‹ˆë‹¤. +// +//------------------------------------------------------------------------------ + +namespace Serial.Properties { + using System; + + + /// + /// ì§€ì—­í™”ëœ ë¬¸ìžì—´ ë“±ì„ ì°¾ê¸° 위한 강력한 형ì‹ì˜ 리소스 í´ëž˜ìŠ¤ìž…ë‹ˆë‹¤. + /// + // ì´ í´ëž˜ìŠ¤ëŠ” ResGen ë˜ëŠ” Visual Studio와 ê°™ì€ ë„구를 통해 StronglyTypedResourceBuilder + // í´ëž˜ìФì—서 ìžë™ìœ¼ë¡œ ìƒì„±ë˜ì—ˆìŠµë‹ˆë‹¤. + // 멤버를 추가하거나 제거하려면 .ResX 파ì¼ì„ 편집한 ë‹¤ìŒ /str ì˜µì…˜ì„ ì‚¬ìš©í•˜ì—¬ ResGenì„ + // 다시 실행하거나 VS 프로ì íŠ¸ë¥¼ 다시 빌드하십시오. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// ì´ í´ëž˜ìФì—서 사용하는 ìºì‹œëœ ResourceManager ì¸ìŠ¤í„´ìŠ¤ë¥¼ 반환합니다. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Serial.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// ì´ ê°•ë ¥í•œ 형ì‹ì˜ 리소스 í´ëž˜ìŠ¤ë¥¼ 사용하여 모든 리소스 ì¡°íšŒì— ëŒ€í•œ 현재 ìŠ¤ë ˆë“œì˜ CurrentUICulture + /// ì†ì„±ì„ 재정ì˜í•©ë‹ˆë‹¤. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/oroca_bldc_gui/Serial/Serial/Properties/Resources.resx b/oroca_bldc_gui/Serial/Serial/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/oroca_bldc_gui/Serial/Serial/Properties/Settings.Designer.cs b/oroca_bldc_gui/Serial/Serial/Properties/Settings.Designer.cs new file mode 100644 index 0000000..b2cdb0f --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// ì´ ì½”ë“œëŠ” ë„구를 사용하여 ìƒì„±ë˜ì—ˆìŠµë‹ˆë‹¤. +// 런타임 버전:4.0.30319.42000 +// +// íŒŒì¼ ë‚´ìš©ì„ ë³€ê²½í•˜ë©´ ìž˜ëª»ëœ ë™ìž‘ì´ ë°œìƒí•  수 있으며, 코드를 다시 ìƒì„±í•˜ë©´ +// ì´ëŸ¬í•œ 변경 ë‚´ìš©ì´ ì†ì‹¤ë©ë‹ˆë‹¤. +// +//------------------------------------------------------------------------------ + +namespace Serial.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/oroca_bldc_gui/Serial/Serial/Properties/Settings.settings b/oroca_bldc_gui/Serial/Serial/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/oroca_bldc_gui/Serial/Serial/Serial.csproj b/oroca_bldc_gui/Serial/Serial/Serial.csproj new file mode 100644 index 0000000..cb02aef --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/Serial.csproj @@ -0,0 +1,134 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {15F40E62-90A1-4072-950D-D4CA59BF2B6A} + WinExe + Properties + Serial + Serial + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + Form + + + Form1.cs + + + + + + + + + Form1.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/oroca_bldc_gui/Serial/Serial/bin/Debug/Serial.vshost.exe.manifest b/oroca_bldc_gui/Serial/Serial/bin/Debug/Serial.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/bin/Debug/Serial.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/oroca_bldc_gui/Serial/Serial/obj/Debug/Serial.csproj.FileListAbsolute.txt b/oroca_bldc_gui/Serial/Serial/obj/Debug/Serial.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..5a89ae8 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/obj/Debug/Serial.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +D:\실습\C#\Serial\Serial\bin\Debug\Serial.exe +D:\실습\C#\Serial\Serial\bin\Debug\Serial.pdb +D:\실습\C#\Serial\Serial\obj\Debug\ResolveAssemblyReference.cache +D:\실습\C#\Serial\Serial\obj\Debug\Serial.Form1.resources +D:\실습\C#\Serial\Serial\obj\Debug\Serial.Properties.Resources.resources +D:\실습\C#\Serial\Serial\obj\Debug\Serial.csproj.GenerateResource.Cache +D:\실습\C#\Serial\Serial\obj\Debug\Serial.exe +D:\실습\C#\Serial\Serial\obj\Debug\Serial.pdb +V:\git\oroca_bldc_dev\oroca_bldc_gui\Serial\Serial\obj\Debug\Serial.exe +V:\git\oroca_bldc_dev\oroca_bldc_gui\Serial\Serial\obj\Debug\Serial.pdb +V:\git\oroca_bldc_dev\oroca_bldc_gui\Serial\Serial\bin\Debug\Serial.exe +V:\git\oroca_bldc_dev\oroca_bldc_gui\Serial\Serial\bin\Debug\Serial.pdb +V:\git\oroca_bldc_dev\oroca_bldc_gui\Serial\Serial\obj\Debug\Serial.Form1.resources +V:\git\oroca_bldc_dev\oroca_bldc_gui\Serial\Serial\obj\Debug\Serial.Properties.Resources.resources +V:\git\oroca_bldc_dev\oroca_bldc_gui\Serial\Serial\obj\Debug\Serial.csproj.GenerateResource.Cache diff --git a/oroca_bldc_gui/Serial/Serial/oroca.generated.cs b/oroca_bldc_gui/Serial/Serial/oroca.generated.cs new file mode 100644 index 0000000..f4a2c8d --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/oroca.generated.cs @@ -0,0 +1,8930 @@ +/* +MAVLink protocol implementation (auto-generated by mavgen.py) + +Generated from: oroca_bldc.xml,common.xml + +Note: this file has been auto-generated. DO NOT EDIT +*/ + +using System; + + +using System.Reflection; + +[assembly: AssemblyTitle("Mavlink Classes")] +[assembly: AssemblyDescription("Generated Message Classes for Mavlink. See http://qgroundcontrol.org/mavlink/start")] +[assembly: AssemblyProduct("Mavlink")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + + namespace MavLink +{ + + /// + /// Micro air vehicle / autopilot classes. This identifies the individual model. + /// + public enum MAV_AUTOPILOT : uint + { + + /// + /// Generic autopilot, full support for everything + /// + MAV_AUTOPILOT_GENERIC = 0, + + /// + /// Reserved for future use. + /// + MAV_AUTOPILOT_RESERVED = 1, + + /// + /// SLUGS autopilot, http://slugsuav.soe.ucsc.edu + /// + MAV_AUTOPILOT_SLUGS = 2, + + /// + /// ArduPilotMega / ArduCopter, http://diydrones.com + /// + MAV_AUTOPILOT_ARDUPILOTMEGA = 3, + + /// + /// OpenPilot, http://openpilot.org + /// + MAV_AUTOPILOT_OPENPILOT = 4, + + /// + /// Generic autopilot only supporting simple waypoints + /// + MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5, + + /// + /// Generic autopilot supporting waypoints and other simple navigation commands + /// + MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6, + + /// + /// Generic autopilot supporting the full mission command set + /// + MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7, + + /// + /// No valid autopilot, e.g. a GCS or other MAVLink component + /// + MAV_AUTOPILOT_INVALID = 8, + + /// + /// PPZ UAV - http://nongnu.org/paparazzi + /// + MAV_AUTOPILOT_PPZ = 9, + + /// + /// UAV Dev Board + /// + MAV_AUTOPILOT_UDB = 10, + + /// + /// FlexiPilot + /// + MAV_AUTOPILOT_FP = 11, + + /// + /// PX4 Autopilot - http://pixhawk.ethz.ch/px4/ + /// + MAV_AUTOPILOT_PX4 = 12, + + /// + /// SMACCMPilot - http://smaccmpilot.org + /// + MAV_AUTOPILOT_SMACCMPILOT = 13, + + /// + /// AutoQuad -- http://autoquad.org + /// + MAV_AUTOPILOT_AUTOQUAD = 14, + + /// + /// Armazila -- http://armazila.com + /// + MAV_AUTOPILOT_ARMAZILA = 15, + + /// + /// Aerob -- http://aerob.ru + /// + MAV_AUTOPILOT_AEROB = 16, + + /// + /// ASLUAV autopilot -- http://www.asl.ethz.ch + /// + MAV_AUTOPILOT_ASLUAV = 17, + MAV_AUTOPILOT_ENUM_END = 18, + + } + + + /// + /// + /// + public enum MAV_TYPE : uint + { + + /// + /// Generic micro air vehicle. + /// + MAV_TYPE_GENERIC = 0, + + /// + /// Fixed wing aircraft. + /// + MAV_TYPE_FIXED_WING = 1, + + /// + /// Quadrotor + /// + MAV_TYPE_QUADROTOR = 2, + + /// + /// Coaxial helicopter + /// + MAV_TYPE_COAXIAL = 3, + + /// + /// Normal helicopter with tail rotor. + /// + MAV_TYPE_HELICOPTER = 4, + + /// + /// Ground installation + /// + MAV_TYPE_ANTENNA_TRACKER = 5, + + /// + /// Operator control unit / ground control station + /// + MAV_TYPE_GCS = 6, + + /// + /// Airship, controlled + /// + MAV_TYPE_AIRSHIP = 7, + + /// + /// Free balloon, uncontrolled + /// + MAV_TYPE_FREE_BALLOON = 8, + + /// + /// Rocket + /// + MAV_TYPE_ROCKET = 9, + + /// + /// Ground rover + /// + MAV_TYPE_GROUND_ROVER = 10, + + /// + /// Surface vessel, boat, ship + /// + MAV_TYPE_SURFACE_BOAT = 11, + + /// + /// Submarine + /// + MAV_TYPE_SUBMARINE = 12, + + /// + /// Hexarotor + /// + MAV_TYPE_HEXAROTOR = 13, + + /// + /// Octorotor + /// + MAV_TYPE_OCTOROTOR = 14, + + /// + /// Octorotor + /// + MAV_TYPE_TRICOPTER = 15, + + /// + /// Flapping wing + /// + MAV_TYPE_FLAPPING_WING = 16, + + /// + /// Flapping wing + /// + MAV_TYPE_KITE = 17, + + /// + /// Onboard companion controller + /// + MAV_TYPE_ONBOARD_CONTROLLER = 18, + + /// + /// Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. + /// + MAV_TYPE_VTOL_DUOROTOR = 19, + + /// + /// Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. + /// + MAV_TYPE_VTOL_QUADROTOR = 20, + + /// + /// Tiltrotor VTOL + /// + MAV_TYPE_VTOL_TILTROTOR = 21, + + /// + /// VTOL reserved 2 + /// + MAV_TYPE_VTOL_RESERVED2 = 22, + + /// + /// VTOL reserved 3 + /// + MAV_TYPE_VTOL_RESERVED3 = 23, + + /// + /// VTOL reserved 4 + /// + MAV_TYPE_VTOL_RESERVED4 = 24, + + /// + /// VTOL reserved 5 + /// + MAV_TYPE_VTOL_RESERVED5 = 25, + + /// + /// Onboard gimbal + /// + MAV_TYPE_GIMBAL = 26, + + /// + /// Onboard ADSB peripheral + /// + MAV_TYPE_ADSB = 27, + MAV_TYPE_ENUM_END = 28, + + } + + + /// + /// These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65. + /// + public enum FIRMWARE_VERSION_TYPE : uint + { + + /// + /// development release + /// + FIRMWARE_VERSION_TYPE_DEV = 0, + + /// + /// alpha release + /// + FIRMWARE_VERSION_TYPE_ALPHA = 64, + + /// + /// beta release + /// + FIRMWARE_VERSION_TYPE_BETA = 128, + + /// + /// release candidate + /// + FIRMWARE_VERSION_TYPE_RC = 192, + + /// + /// official stable release + /// + FIRMWARE_VERSION_TYPE_OFFICIAL = 255, + FIRMWARE_VERSION_TYPE_ENUM_END = 256, + + } + + + /// + /// These flags encode the MAV mode. + /// + public enum MAV_MODE_FLAG : uint + { + + /// + /// 0b00000001 Reserved for future use. + /// + MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1, + + /// + /// 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. + /// + MAV_MODE_FLAG_TEST_ENABLED = 2, + + /// + /// 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. + /// + MAV_MODE_FLAG_AUTO_ENABLED = 4, + + /// + /// 0b00001000 guided mode enabled, system flies MISSIONs / mission items. + /// + MAV_MODE_FLAG_GUIDED_ENABLED = 8, + + /// + /// 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. + /// + MAV_MODE_FLAG_STABILIZE_ENABLED = 16, + + /// + /// 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. + /// + MAV_MODE_FLAG_HIL_ENABLED = 32, + + /// + /// 0b01000000 remote control input is enabled. + /// + MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64, + + /// + /// 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. + /// + MAV_MODE_FLAG_SAFETY_ARMED = 128, + MAV_MODE_FLAG_ENUM_END = 129, + + } + + + /// + /// These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. + /// + public enum MAV_MODE_FLAG_DECODE_POSITION : uint + { + + /// + /// Eighth bit: 00000001 + /// + MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1, + + /// + /// Seventh bit: 00000010 + /// + MAV_MODE_FLAG_DECODE_POSITION_TEST = 2, + + /// + /// Sixt bit: 00000100 + /// + MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4, + + /// + /// Fifth bit: 00001000 + /// + MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8, + + /// + /// Fourth bit: 00010000 + /// + MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16, + + /// + /// Third bit: 00100000 + /// + MAV_MODE_FLAG_DECODE_POSITION_HIL = 32, + + /// + /// Second bit: 01000000 + /// + MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64, + + /// + /// First bit: 10000000 + /// + MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128, + MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129, + + } + + + /// + /// Override command, pauses current mission execution and moves immediately to a position + /// + public enum MAV_GOTO : uint + { + + /// + /// Hold at the current position. + /// + MAV_GOTO_DO_HOLD = 0, + + /// + /// Continue with the next item in mission execution. + /// + MAV_GOTO_DO_CONTINUE = 1, + + /// + /// Hold at the current position of the system + /// + MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2, + + /// + /// Hold at the position specified in the parameters of the DO_HOLD action + /// + MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3, + MAV_GOTO_ENUM_END = 4, + + } + + + /// + /// These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it + /// simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. + /// + public enum MAV_MODE : uint + { + + /// + /// System is not ready to fly, booting, calibrating, etc. No flag is set. + /// + MAV_MODE_PREFLIGHT = 0, + + /// + /// System is allowed to be active, under manual (RC) control, no stabilization + /// + MAV_MODE_MANUAL_DISARMED = 64, + + /// + /// UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. + /// + MAV_MODE_TEST_DISARMED = 66, + + /// + /// System is allowed to be active, under assisted RC control. + /// + MAV_MODE_STABILIZE_DISARMED = 80, + + /// + /// System is allowed to be active, under autonomous control, manual setpoint + /// + MAV_MODE_GUIDED_DISARMED = 88, + + /// + /// System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) + /// + MAV_MODE_AUTO_DISARMED = 92, + + /// + /// System is allowed to be active, under manual (RC) control, no stabilization + /// + MAV_MODE_MANUAL_ARMED = 192, + + /// + /// UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. + /// + MAV_MODE_TEST_ARMED = 194, + + /// + /// System is allowed to be active, under assisted RC control. + /// + MAV_MODE_STABILIZE_ARMED = 208, + + /// + /// System is allowed to be active, under autonomous control, manual setpoint + /// + MAV_MODE_GUIDED_ARMED = 216, + + /// + /// System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) + /// + MAV_MODE_AUTO_ARMED = 220, + MAV_MODE_ENUM_END = 221, + + } + + + /// + /// + /// + public enum MAV_STATE : uint + { + + /// + /// Uninitialized system, state is unknown. + /// + MAV_STATE_UNINIT = 0, + + /// + /// System is booting up. + /// + MAV_STATE_BOOT = 1, + + /// + /// System is calibrating and not flight-ready. + /// + MAV_STATE_CALIBRATING = 2, + + /// + /// System is grounded and on standby. It can be launched any time. + /// + MAV_STATE_STANDBY = 3, + + /// + /// System is active and might be already airborne. Motors are engaged. + /// + MAV_STATE_ACTIVE = 4, + + /// + /// System is in a non-normal flight mode. It can however still navigate. + /// + MAV_STATE_CRITICAL = 5, + + /// + /// System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. + /// + MAV_STATE_EMERGENCY = 6, + + /// + /// System just initialized its power-down sequence, will shut down now. + /// + MAV_STATE_POWEROFF = 7, + MAV_STATE_ENUM_END = 8, + + } + + + /// + /// + /// + public enum MAV_COMPONENT : uint + { + MAV_COMP_ID_ALL = 0, + MAV_COMP_ID_CAMERA = 100, + MAV_COMP_ID_SERVO1 = 140, + MAV_COMP_ID_SERVO2 = 141, + MAV_COMP_ID_SERVO3 = 142, + MAV_COMP_ID_SERVO4 = 143, + MAV_COMP_ID_SERVO5 = 144, + MAV_COMP_ID_SERVO6 = 145, + MAV_COMP_ID_SERVO7 = 146, + MAV_COMP_ID_SERVO8 = 147, + MAV_COMP_ID_SERVO9 = 148, + MAV_COMP_ID_SERVO10 = 149, + MAV_COMP_ID_SERVO11 = 150, + MAV_COMP_ID_SERVO12 = 151, + MAV_COMP_ID_SERVO13 = 152, + MAV_COMP_ID_SERVO14 = 153, + MAV_COMP_ID_GIMBAL = 154, + MAV_COMP_ID_LOG = 155, + MAV_COMP_ID_ADSB = 156, + + /// + /// On Screen Display (OSD) devices for video links + /// + MAV_COMP_ID_OSD = 157, + + /// + /// Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol + /// + MAV_COMP_ID_PERIPHERAL = 158, + MAV_COMP_ID_MAPPER = 180, + MAV_COMP_ID_MISSIONPLANNER = 190, + MAV_COMP_ID_PATHPLANNER = 195, + MAV_COMP_ID_IMU = 200, + MAV_COMP_ID_IMU_2 = 201, + MAV_COMP_ID_IMU_3 = 202, + MAV_COMP_ID_GPS = 220, + MAV_COMP_ID_UDP_BRIDGE = 240, + MAV_COMP_ID_UART_BRIDGE = 241, + MAV_COMP_ID_SYSTEM_CONTROL = 250, + MAV_COMPONENT_ENUM_END = 251, + + } + + + /// + /// These encode the sensors whose status is sent as part of the SYS_STATUS message. + /// + public enum MAV_SYS_STATUS_SENSOR : uint + { + + /// + /// 0x01 3D gyro + /// + MAV_SYS_STATUS_SENSOR_3D_GYRO = 1, + + /// + /// 0x02 3D accelerometer + /// + MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2, + + /// + /// 0x04 3D magnetometer + /// + MAV_SYS_STATUS_SENSOR_3D_MAG = 4, + + /// + /// 0x08 absolute pressure + /// + MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8, + + /// + /// 0x10 differential pressure + /// + MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16, + + /// + /// 0x20 GPS + /// + MAV_SYS_STATUS_SENSOR_GPS = 32, + + /// + /// 0x40 optical flow + /// + MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64, + + /// + /// 0x80 computer vision position + /// + MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128, + + /// + /// 0x100 laser based position + /// + MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256, + + /// + /// 0x200 external ground truth (Vicon or Leica) + /// + MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512, + + /// + /// 0x400 3D angular rate control + /// + MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024, + + /// + /// 0x800 attitude stabilization + /// + MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048, + + /// + /// 0x1000 yaw position + /// + MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096, + + /// + /// 0x2000 z/altitude control + /// + MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192, + + /// + /// 0x4000 x/y position control + /// + MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384, + + /// + /// 0x8000 motor outputs / control + /// + MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768, + + /// + /// 0x10000 rc receiver + /// + MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536, + + /// + /// 0x20000 2nd 3D gyro + /// + MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072, + + /// + /// 0x40000 2nd 3D accelerometer + /// + MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144, + + /// + /// 0x80000 2nd 3D magnetometer + /// + MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288, + + /// + /// 0x100000 geofence + /// + MAV_SYS_STATUS_GEOFENCE = 1048576, + + /// + /// 0x200000 AHRS subsystem health + /// + MAV_SYS_STATUS_AHRS = 2097152, + + /// + /// 0x400000 Terrain subsystem health + /// + MAV_SYS_STATUS_TERRAIN = 4194304, + + /// + /// 0x800000 Motors are reversed + /// + MAV_SYS_STATUS_REVERSE_MOTOR = 8388608, + MAV_SYS_STATUS_SENSOR_ENUM_END = 8388609, + + } + + + /// + /// + /// + public enum MAV_FRAME : uint + { + + /// + /// Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) + /// + MAV_FRAME_GLOBAL = 0, + + /// + /// Local coordinate frame, Z-up (x: north, y: east, z: down). + /// + MAV_FRAME_LOCAL_NED = 1, + + /// + /// NOT a coordinate frame, indicates a mission command. + /// + MAV_FRAME_MISSION = 2, + + /// + /// Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. + /// + MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, + + /// + /// Local coordinate frame, Z-down (x: east, y: north, z: up) + /// + MAV_FRAME_LOCAL_ENU = 4, + + /// + /// Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) + /// + MAV_FRAME_GLOBAL_INT = 5, + + /// + /// Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. + /// + MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, + + /// + /// Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. + /// + MAV_FRAME_LOCAL_OFFSET_NED = 7, + + /// + /// Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. + /// + MAV_FRAME_BODY_NED = 8, + + /// + /// Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. + /// + MAV_FRAME_BODY_OFFSET_NED = 9, + + /// + /// Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. + /// + MAV_FRAME_GLOBAL_TERRAIN_ALT = 10, + + /// + /// Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. + /// + MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11, + MAV_FRAME_ENUM_END = 12, + + } + + + /// + /// + /// + public enum MAVLINK_DATA_STREAM_TYPE : uint + { + MAVLINK_DATA_STREAM_IMG_JPEG = 1, + MAVLINK_DATA_STREAM_IMG_BMP = 2, + MAVLINK_DATA_STREAM_IMG_RAW8U = 3, + MAVLINK_DATA_STREAM_IMG_RAW32U = 4, + MAVLINK_DATA_STREAM_IMG_PGM = 5, + MAVLINK_DATA_STREAM_IMG_PNG = 6, + MAVLINK_DATA_STREAM_TYPE_ENUM_END = 7, + + } + + + /// + /// + /// + public enum FENCE_ACTION : uint + { + + /// + /// Disable fenced mode + /// + FENCE_ACTION_NONE = 0, + + /// + /// Switched to guided mode to return point (fence point 0) + /// + FENCE_ACTION_GUIDED = 1, + + /// + /// Report fence breach, but don't take action + /// + FENCE_ACTION_REPORT = 2, + + /// + /// Switched to guided mode to return point (fence point 0) with manual throttle control + /// + FENCE_ACTION_GUIDED_THR_PASS = 3, + FENCE_ACTION_ENUM_END = 4, + + } + + + /// + /// + /// + public enum FENCE_BREACH : uint + { + + /// + /// No last fence breach + /// + FENCE_BREACH_NONE = 0, + + /// + /// Breached minimum altitude + /// + FENCE_BREACH_MINALT = 1, + + /// + /// Breached maximum altitude + /// + FENCE_BREACH_MAXALT = 2, + + /// + /// Breached fence boundary + /// + FENCE_BREACH_BOUNDARY = 3, + FENCE_BREACH_ENUM_END = 4, + + } + + + /// + /// Enumeration of possible mount operation modes + /// + public enum MAV_MOUNT_MODE : uint + { + + /// + /// Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization + /// + MAV_MOUNT_MODE_RETRACT = 0, + + /// + /// Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. + /// + MAV_MOUNT_MODE_NEUTRAL = 1, + + /// + /// Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization + /// + MAV_MOUNT_MODE_MAVLINK_TARGETING = 2, + + /// + /// Load neutral position and start RC Roll,Pitch,Yaw control with stabilization + /// + MAV_MOUNT_MODE_RC_TARGETING = 3, + + /// + /// Load neutral position and start to point to Lat,Lon,Alt + /// + MAV_MOUNT_MODE_GPS_POINT = 4, + MAV_MOUNT_MODE_ENUM_END = 5, + + } + + + /// + /// Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. + /// + public enum MAV_CMD : uint + { + + /// + /// Navigate to MISSION. + /// + MAV_CMD_NAV_WAYPOINT = 16, + + /// + /// Loiter around this MISSION an unlimited amount of time + /// + MAV_CMD_NAV_LOITER_UNLIM = 17, + + /// + /// Loiter around this MISSION for X turns + /// + MAV_CMD_NAV_LOITER_TURNS = 18, + + /// + /// Loiter around this MISSION for X seconds + /// + MAV_CMD_NAV_LOITER_TIME = 19, + + /// + /// Return to launch location + /// + MAV_CMD_NAV_RETURN_TO_LAUNCH = 20, + + /// + /// Land at location + /// + MAV_CMD_NAV_LAND = 21, + + /// + /// Takeoff from ground / hand + /// + MAV_CMD_NAV_TAKEOFF = 22, + + /// + /// Land at local position (local frame only) + /// + MAV_CMD_NAV_LAND_LOCAL = 23, + + /// + /// Takeoff from local position (local frame only) + /// + MAV_CMD_NAV_TAKEOFF_LOCAL = 24, + + /// + /// Vehicle following, i.e. this waypoint represents the position of a moving vehicle + /// + MAV_CMD_NAV_FOLLOW = 25, + + /// + /// Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. + /// + MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30, + + /// + /// Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. + /// + MAV_CMD_NAV_LOITER_TO_ALT = 31, + + /// + /// Being following a target + /// + MAV_CMD_DO_FOLLOW = 32, + + /// + /// Reposition the MAV after a follow target command has been sent + /// + MAV_CMD_DO_FOLLOW_REPOSITION = 33, + + /// + /// Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. + /// + MAV_CMD_NAV_ROI = 80, + + /// + /// Control autonomous path planning on the MAV. + /// + MAV_CMD_NAV_PATHPLANNING = 81, + + /// + /// Navigate to MISSION using a spline path. + /// + MAV_CMD_NAV_SPLINE_WAYPOINT = 82, + + /// + /// Takeoff from ground using VTOL mode + /// + MAV_CMD_NAV_VTOL_TAKEOFF = 84, + + /// + /// Land using VTOL mode + /// + MAV_CMD_NAV_VTOL_LAND = 85, + + /// + /// hand control over to an external controller + /// + MAV_CMD_NAV_GUIDED_ENABLE = 92, + + /// + /// Delay the next navigation command a number of seconds or until a specified time + /// + MAV_CMD_NAV_DELAY = 93, + + /// + /// NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration + /// + MAV_CMD_NAV_LAST = 95, + + /// + /// Delay mission state machine. + /// + MAV_CMD_CONDITION_DELAY = 112, + + /// + /// Ascend/descend at rate. Delay mission state machine until desired altitude reached. + /// + MAV_CMD_CONDITION_CHANGE_ALT = 113, + + /// + /// Delay mission state machine until within desired distance of next NAV point. + /// + MAV_CMD_CONDITION_DISTANCE = 114, + + /// + /// Reach a certain target angle. + /// + MAV_CMD_CONDITION_YAW = 115, + + /// + /// NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration + /// + MAV_CMD_CONDITION_LAST = 159, + + /// + /// Set system mode. + /// + MAV_CMD_DO_SET_MODE = 176, + + /// + /// Jump to the desired command in the mission list. Repeat this action only the specified number of times + /// + MAV_CMD_DO_JUMP = 177, + + /// + /// Change speed and/or throttle set points. + /// + MAV_CMD_DO_CHANGE_SPEED = 178, + + /// + /// Changes the home location either to the current location or a specified location. + /// + MAV_CMD_DO_SET_HOME = 179, + + /// + /// Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. + /// + MAV_CMD_DO_SET_PARAMETER = 180, + + /// + /// Set a relay to a condition. + /// + MAV_CMD_DO_SET_RELAY = 181, + + /// + /// Cycle a relay on and off for a desired number of cyles with a desired period. + /// + MAV_CMD_DO_REPEAT_RELAY = 182, + + /// + /// Set a servo to a desired PWM value. + /// + MAV_CMD_DO_SET_SERVO = 183, + + /// + /// Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. + /// + MAV_CMD_DO_REPEAT_SERVO = 184, + + /// + /// Terminate flight immediately + /// + MAV_CMD_DO_FLIGHTTERMINATION = 185, + + /// + /// Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. + /// + MAV_CMD_DO_LAND_START = 189, + + /// + /// Mission command to perform a landing from a rally point. + /// + MAV_CMD_DO_RALLY_LAND = 190, + + /// + /// Mission command to safely abort an autonmous landing. + /// + MAV_CMD_DO_GO_AROUND = 191, + + /// + /// Reposition the vehicle to a specific WGS84 global position. + /// + MAV_CMD_DO_REPOSITION = 192, + + /// + /// If in a GPS controlled position mode, hold the current position or continue. + /// + MAV_CMD_DO_PAUSE_CONTINUE = 193, + + /// + /// Control onboard camera system. + /// + MAV_CMD_DO_CONTROL_VIDEO = 200, + + /// + /// Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. + /// + MAV_CMD_DO_SET_ROI = 201, + + /// + /// Mission command to configure an on-board camera controller system. + /// + MAV_CMD_DO_DIGICAM_CONFIGURE = 202, + + /// + /// Mission command to control an on-board camera controller system. + /// + MAV_CMD_DO_DIGICAM_CONTROL = 203, + + /// + /// Mission command to configure a camera or antenna mount + /// + MAV_CMD_DO_MOUNT_CONFIGURE = 204, + + /// + /// Mission command to control a camera or antenna mount + /// + MAV_CMD_DO_MOUNT_CONTROL = 205, + + /// + /// Mission command to set CAM_TRIGG_DIST for this flight + /// + MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206, + + /// + /// Mission command to enable the geofence + /// + MAV_CMD_DO_FENCE_ENABLE = 207, + + /// + /// Mission command to trigger a parachute + /// + MAV_CMD_DO_PARACHUTE = 208, + + /// + /// Change to/from inverted flight + /// + MAV_CMD_DO_INVERTED_FLIGHT = 210, + + /// + /// Mission command to control a camera or antenna mount, using a quaternion as reference. + /// + MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220, + + /// + /// set id of master controller + /// + MAV_CMD_DO_GUIDED_MASTER = 221, + + /// + /// set limits for external control + /// + MAV_CMD_DO_GUIDED_LIMITS = 222, + + /// + /// NOP - This command is only used to mark the upper limit of the DO commands in the enumeration + /// + MAV_CMD_DO_LAST = 240, + + /// + /// Trigger calibration. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_CALIBRATION = 241, + + /// + /// Set sensor offsets. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242, + + /// + /// Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_UAVCAN = 243, + + /// + /// Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_STORAGE = 245, + + /// + /// Request the reboot or shutdown of system components. + /// + MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246, + + /// + /// Hold / continue the current action + /// + MAV_CMD_OVERRIDE_GOTO = 252, + + /// + /// start running a mission + /// + MAV_CMD_MISSION_START = 300, + + /// + /// Arms / Disarms a component + /// + MAV_CMD_COMPONENT_ARM_DISARM = 400, + + /// + /// Request the home position from the vehicle. + /// + MAV_CMD_GET_HOME_POSITION = 410, + + /// + /// Starts receiver pairing + /// + MAV_CMD_START_RX_PAIR = 500, + + /// + /// Request the interval between messages for a particular MAVLink message ID + /// + MAV_CMD_GET_MESSAGE_INTERVAL = 510, + + /// + /// Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM + /// + MAV_CMD_SET_MESSAGE_INTERVAL = 511, + + /// + /// Request autopilot capabilities + /// + MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520, + + /// + /// Start image capture sequence + /// + MAV_CMD_IMAGE_START_CAPTURE = 2000, + + /// + /// Stop image capture sequence + /// + MAV_CMD_IMAGE_STOP_CAPTURE = 2001, + + /// + /// Enable or disable on-board camera triggering system. + /// + MAV_CMD_DO_TRIGGER_CONTROL = 2003, + + /// + /// Starts video capture + /// + MAV_CMD_VIDEO_START_CAPTURE = 2500, + + /// + /// Stop the current video capture + /// + MAV_CMD_VIDEO_STOP_CAPTURE = 2501, + + /// + /// Create a panorama at the current position + /// + MAV_CMD_PANORAMA_CREATE = 2800, + + /// + /// Request VTOL transition + /// + MAV_CMD_DO_VTOL_TRANSITION = 3000, + + /// + /// Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. + /// + MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001, + + /// + /// Control the payload deployment. + /// + MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_1 = 31000, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_2 = 31001, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_3 = 31002, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_4 = 31003, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_5 = 31004, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_1 = 31005, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_2 = 31006, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_3 = 31007, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_4 = 31008, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_5 = 31009, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_1 = 31010, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_2 = 31011, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_3 = 31012, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_4 = 31013, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_5 = 31014, + MAV_CMD_ENUM_END = 31015, + + } + + + /// + /// THIS INTERFACE IS DEPRECATED AS OF JULY 2015. Please use MESSAGE_INTERVAL instead. A data stream is not a fixed set of messages, but rather a + /// recommendation to the autopilot software. Individual autopilots may or may not obey + /// the recommended messages. + /// + public enum MAV_DATA_STREAM : uint + { + + /// + /// Enable all data streams + /// + MAV_DATA_STREAM_ALL = 0, + + /// + /// Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. + /// + MAV_DATA_STREAM_RAW_SENSORS = 1, + + /// + /// Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS + /// + MAV_DATA_STREAM_EXTENDED_STATUS = 2, + + /// + /// Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW + /// + MAV_DATA_STREAM_RC_CHANNELS = 3, + + /// + /// Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. + /// + MAV_DATA_STREAM_RAW_CONTROLLER = 4, + + /// + /// Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. + /// + MAV_DATA_STREAM_POSITION = 6, + + /// + /// Dependent on the autopilot + /// + MAV_DATA_STREAM_EXTRA1 = 10, + + /// + /// Dependent on the autopilot + /// + MAV_DATA_STREAM_EXTRA2 = 11, + + /// + /// Dependent on the autopilot + /// + MAV_DATA_STREAM_EXTRA3 = 12, + MAV_DATA_STREAM_ENUM_END = 13, + + } + + + /// + /// The ROI (region of interest) for the vehicle. This can be + /// be used by the vehicle for camera/vehicle attitude alignment (see + /// MAV_CMD_NAV_ROI). + /// + public enum MAV_ROI : uint + { + + /// + /// No region of interest. + /// + MAV_ROI_NONE = 0, + + /// + /// Point toward next MISSION. + /// + MAV_ROI_WPNEXT = 1, + + /// + /// Point toward given MISSION. + /// + MAV_ROI_WPINDEX = 2, + + /// + /// Point toward fixed location. + /// + MAV_ROI_LOCATION = 3, + + /// + /// Point toward of given id. + /// + MAV_ROI_TARGET = 4, + MAV_ROI_ENUM_END = 5, + + } + + + /// + /// ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. + /// + public enum MAV_CMD_ACK : uint + { + + /// + /// Command / mission item is ok. + /// + MAV_CMD_ACK_OK = 1, + + /// + /// Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. + /// + MAV_CMD_ACK_ERR_FAIL = 2, + + /// + /// The system is refusing to accept this command from this source / communication partner. + /// + MAV_CMD_ACK_ERR_ACCESS_DENIED = 3, + + /// + /// Command or mission item is not supported, other commands would be accepted. + /// + MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4, + + /// + /// The coordinate frame of this command / mission item is not supported. + /// + MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5, + + /// + /// The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. + /// + MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6, + + /// + /// The X or latitude value is out of range. + /// + MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7, + + /// + /// The Y or longitude value is out of range. + /// + MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8, + + /// + /// The Z or altitude value is out of range. + /// + MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9, + MAV_CMD_ACK_ENUM_END = 10, + + } + + + /// + /// Specifies the datatype of a MAVLink parameter. + /// + public enum MAV_PARAM_TYPE : uint + { + + /// + /// 8-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT8 = 1, + + /// + /// 8-bit signed integer + /// + MAV_PARAM_TYPE_INT8 = 2, + + /// + /// 16-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT16 = 3, + + /// + /// 16-bit signed integer + /// + MAV_PARAM_TYPE_INT16 = 4, + + /// + /// 32-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT32 = 5, + + /// + /// 32-bit signed integer + /// + MAV_PARAM_TYPE_INT32 = 6, + + /// + /// 64-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT64 = 7, + + /// + /// 64-bit signed integer + /// + MAV_PARAM_TYPE_INT64 = 8, + + /// + /// 32-bit floating-point + /// + MAV_PARAM_TYPE_REAL32 = 9, + + /// + /// 64-bit floating-point + /// + MAV_PARAM_TYPE_REAL64 = 10, + MAV_PARAM_TYPE_ENUM_END = 11, + + } + + + /// + /// result from a mavlink command + /// + public enum MAV_RESULT : uint + { + + /// + /// Command ACCEPTED and EXECUTED + /// + MAV_RESULT_ACCEPTED = 0, + + /// + /// Command TEMPORARY REJECTED/DENIED + /// + MAV_RESULT_TEMPORARILY_REJECTED = 1, + + /// + /// Command PERMANENTLY DENIED + /// + MAV_RESULT_DENIED = 2, + + /// + /// Command UNKNOWN/UNSUPPORTED + /// + MAV_RESULT_UNSUPPORTED = 3, + + /// + /// Command executed, but failed + /// + MAV_RESULT_FAILED = 4, + MAV_RESULT_ENUM_END = 5, + + } + + + /// + /// result in a mavlink mission ack + /// + public enum MAV_MISSION_RESULT : uint + { + + /// + /// mission accepted OK + /// + MAV_MISSION_ACCEPTED = 0, + + /// + /// generic error / not accepting mission commands at all right now + /// + MAV_MISSION_ERROR = 1, + + /// + /// coordinate frame is not supported + /// + MAV_MISSION_UNSUPPORTED_FRAME = 2, + + /// + /// command is not supported + /// + MAV_MISSION_UNSUPPORTED = 3, + + /// + /// mission item exceeds storage space + /// + MAV_MISSION_NO_SPACE = 4, + + /// + /// one of the parameters has an invalid value + /// + MAV_MISSION_INVALID = 5, + + /// + /// param1 has an invalid value + /// + MAV_MISSION_INVALID_PARAM1 = 6, + + /// + /// param2 has an invalid value + /// + MAV_MISSION_INVALID_PARAM2 = 7, + + /// + /// param3 has an invalid value + /// + MAV_MISSION_INVALID_PARAM3 = 8, + + /// + /// param4 has an invalid value + /// + MAV_MISSION_INVALID_PARAM4 = 9, + + /// + /// x/param5 has an invalid value + /// + MAV_MISSION_INVALID_PARAM5_X = 10, + + /// + /// y/param6 has an invalid value + /// + MAV_MISSION_INVALID_PARAM6_Y = 11, + + /// + /// param7 has an invalid value + /// + MAV_MISSION_INVALID_PARAM7 = 12, + + /// + /// received waypoint out of sequence + /// + MAV_MISSION_INVALID_SEQUENCE = 13, + + /// + /// not accepting any mission commands from this communication partner + /// + MAV_MISSION_DENIED = 14, + MAV_MISSION_RESULT_ENUM_END = 15, + + } + + + /// + /// Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. + /// + public enum MAV_SEVERITY : uint + { + + /// + /// System is unusable. This is a "panic" condition. + /// + MAV_SEVERITY_EMERGENCY = 0, + + /// + /// Action should be taken immediately. Indicates error in non-critical systems. + /// + MAV_SEVERITY_ALERT = 1, + + /// + /// Action must be taken immediately. Indicates failure in a primary system. + /// + MAV_SEVERITY_CRITICAL = 2, + + /// + /// Indicates an error in secondary/redundant systems. + /// + MAV_SEVERITY_ERROR = 3, + + /// + /// Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. + /// + MAV_SEVERITY_WARNING = 4, + + /// + /// An unusual event has occured, though not an error condition. This should be investigated for the root cause. + /// + MAV_SEVERITY_NOTICE = 5, + + /// + /// Normal operational messages. Useful for logging. No action is required for these messages. + /// + MAV_SEVERITY_INFO = 6, + + /// + /// Useful non-operational messages that can assist in debugging. These should not occur during normal operation. + /// + MAV_SEVERITY_DEBUG = 7, + MAV_SEVERITY_ENUM_END = 8, + + } + + + /// + /// Power supply status flags (bitmask) + /// + public enum MAV_POWER_STATUS : uint + { + + /// + /// main brick power supply valid + /// + MAV_POWER_STATUS_BRICK_VALID = 1, + + /// + /// main servo power supply valid for FMU + /// + MAV_POWER_STATUS_SERVO_VALID = 2, + + /// + /// USB power is connected + /// + MAV_POWER_STATUS_USB_CONNECTED = 4, + + /// + /// peripheral supply is in over-current state + /// + MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8, + + /// + /// hi-power peripheral supply is in over-current state + /// + MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16, + + /// + /// Power status has changed since boot + /// + MAV_POWER_STATUS_CHANGED = 32, + MAV_POWER_STATUS_ENUM_END = 33, + + } + + + /// + /// SERIAL_CONTROL device types + /// + public enum SERIAL_CONTROL_DEV : uint + { + + /// + /// First telemetry port + /// + SERIAL_CONTROL_DEV_TELEM1 = 0, + + /// + /// Second telemetry port + /// + SERIAL_CONTROL_DEV_TELEM2 = 1, + + /// + /// First GPS port + /// + SERIAL_CONTROL_DEV_GPS1 = 2, + + /// + /// Second GPS port + /// + SERIAL_CONTROL_DEV_GPS2 = 3, + + /// + /// system shell + /// + SERIAL_CONTROL_DEV_SHELL = 10, + SERIAL_CONTROL_DEV_ENUM_END = 11, + + } + + + /// + /// SERIAL_CONTROL flags (bitmask) + /// + public enum SERIAL_CONTROL_FLAG : uint + { + + /// + /// Set if this is a reply + /// + SERIAL_CONTROL_FLAG_REPLY = 1, + + /// + /// Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message + /// + SERIAL_CONTROL_FLAG_RESPOND = 2, + + /// + /// Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set + /// + SERIAL_CONTROL_FLAG_EXCLUSIVE = 4, + + /// + /// Block on writes to the serial port + /// + SERIAL_CONTROL_FLAG_BLOCKING = 8, + + /// + /// Send multiple replies until port is drained + /// + SERIAL_CONTROL_FLAG_MULTI = 16, + SERIAL_CONTROL_FLAG_ENUM_END = 17, + + } + + + /// + /// Enumeration of distance sensor types + /// + public enum MAV_DISTANCE_SENSOR : uint + { + + /// + /// Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units + /// + MAV_DISTANCE_SENSOR_LASER = 0, + + /// + /// Ultrasound rangefinder, e.g. MaxBotix units + /// + MAV_DISTANCE_SENSOR_ULTRASOUND = 1, + + /// + /// Infrared rangefinder, e.g. Sharp units + /// + MAV_DISTANCE_SENSOR_INFRARED = 2, + MAV_DISTANCE_SENSOR_ENUM_END = 3, + + } + + + /// + /// Enumeration of sensor orientation, according to its rotations + /// + public enum MAV_SENSOR_ORIENTATION : uint + { + + /// + /// Roll: 0, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_NONE = 0, + + /// + /// Roll: 0, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_YAW_45 = 1, + + /// + /// Roll: 0, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_YAW_90 = 2, + + /// + /// Roll: 0, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_YAW_135 = 3, + + /// + /// Roll: 0, Pitch: 0, Yaw: 180 + /// + MAV_SENSOR_ROTATION_YAW_180 = 4, + + /// + /// Roll: 0, Pitch: 0, Yaw: 225 + /// + MAV_SENSOR_ROTATION_YAW_225 = 5, + + /// + /// Roll: 0, Pitch: 0, Yaw: 270 + /// + MAV_SENSOR_ROTATION_YAW_270 = 6, + + /// + /// Roll: 0, Pitch: 0, Yaw: 315 + /// + MAV_SENSOR_ROTATION_YAW_315 = 7, + + /// + /// Roll: 180, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_180 = 8, + + /// + /// Roll: 180, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9, + + /// + /// Roll: 180, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10, + + /// + /// Roll: 180, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11, + + /// + /// Roll: 0, Pitch: 180, Yaw: 0 + /// + MAV_SENSOR_ROTATION_PITCH_180 = 12, + + /// + /// Roll: 180, Pitch: 0, Yaw: 225 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13, + + /// + /// Roll: 180, Pitch: 0, Yaw: 270 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14, + + /// + /// Roll: 180, Pitch: 0, Yaw: 315 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15, + + /// + /// Roll: 90, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90 = 16, + + /// + /// Roll: 90, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17, + + /// + /// Roll: 90, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18, + + /// + /// Roll: 90, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19, + + /// + /// Roll: 270, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270 = 20, + + /// + /// Roll: 270, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21, + + /// + /// Roll: 270, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22, + + /// + /// Roll: 270, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23, + + /// + /// Roll: 0, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_PITCH_90 = 24, + + /// + /// Roll: 0, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_PITCH_270 = 25, + + /// + /// Roll: 0, Pitch: 180, Yaw: 90 + /// + MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26, + + /// + /// Roll: 0, Pitch: 180, Yaw: 270 + /// + MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27, + + /// + /// Roll: 90, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28, + + /// + /// Roll: 180, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29, + + /// + /// Roll: 270, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30, + + /// + /// Roll: 90, Pitch: 180, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31, + + /// + /// Roll: 270, Pitch: 180, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32, + + /// + /// Roll: 90, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33, + + /// + /// Roll: 180, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34, + + /// + /// Roll: 270, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35, + + /// + /// Roll: 90, Pitch: 180, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36, + + /// + /// Roll: 90, Pitch: 0, Yaw: 270 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37, + + /// + /// Roll: 315, Pitch: 315, Yaw: 315 + /// + MAV_SENSOR_ROTATION_ROLL_315_PITCH_315_YAW_315 = 38, + MAV_SENSOR_ORIENTATION_ENUM_END = 39, + + } + + + /// + /// Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. + /// + public enum MAV_PROTOCOL_CAPABILITY : uint + { + + /// + /// Autopilot supports MISSION float message type. + /// + MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1, + + /// + /// Autopilot supports the new param float message type. + /// + MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2, + + /// + /// Autopilot supports MISSION_INT scaled integer message type. + /// + MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4, + + /// + /// Autopilot supports COMMAND_INT scaled integer message type. + /// + MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8, + + /// + /// Autopilot supports the new param union message type. + /// + MAV_PROTOCOL_CAPABILITY_PARAM_UNION = 16, + + /// + /// Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. + /// + MAV_PROTOCOL_CAPABILITY_FTP = 32, + + /// + /// Autopilot supports commanding attitude offboard. + /// + MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64, + + /// + /// Autopilot supports commanding position and velocity targets in local NED frame. + /// + MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128, + + /// + /// Autopilot supports commanding position and velocity targets in global scaled integers. + /// + MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256, + + /// + /// Autopilot supports terrain protocol / data handling. + /// + MAV_PROTOCOL_CAPABILITY_TERRAIN = 512, + + /// + /// Autopilot supports direct actuator control. + /// + MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET = 1024, + + /// + /// Autopilot supports the flight termination command. + /// + MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048, + + /// + /// Autopilot supports onboard compass calibration. + /// + MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096, + MAV_PROTOCOL_CAPABILITY_ENUM_END = 4097, + + } + + + /// + /// Enumeration of estimator types + /// + public enum MAV_ESTIMATOR_TYPE : uint + { + + /// + /// This is a naive estimator without any real covariance feedback. + /// + MAV_ESTIMATOR_TYPE_NAIVE = 1, + + /// + /// Computer vision based estimate. Might be up to scale. + /// + MAV_ESTIMATOR_TYPE_VISION = 2, + + /// + /// Visual-inertial estimate. + /// + MAV_ESTIMATOR_TYPE_VIO = 3, + + /// + /// Plain GPS estimate. + /// + MAV_ESTIMATOR_TYPE_GPS = 4, + + /// + /// Estimator integrating GPS and inertial sensing. + /// + MAV_ESTIMATOR_TYPE_GPS_INS = 5, + MAV_ESTIMATOR_TYPE_ENUM_END = 6, + + } + + + /// + /// Enumeration of battery types + /// + public enum MAV_BATTERY_TYPE : uint + { + + /// + /// Not specified. + /// + MAV_BATTERY_TYPE_UNKNOWN = 0, + + /// + /// Lithium polymer battery + /// + MAV_BATTERY_TYPE_LIPO = 1, + + /// + /// Lithium-iron-phosphate battery + /// + MAV_BATTERY_TYPE_LIFE = 2, + + /// + /// Lithium-ION battery + /// + MAV_BATTERY_TYPE_LION = 3, + + /// + /// Nickel metal hydride battery + /// + MAV_BATTERY_TYPE_NIMH = 4, + MAV_BATTERY_TYPE_ENUM_END = 5, + + } + + + /// + /// Enumeration of battery functions + /// + public enum MAV_BATTERY_FUNCTION : uint + { + + /// + /// Battery function is unknown + /// + MAV_BATTERY_FUNCTION_UNKNOWN = 0, + + /// + /// Battery supports all flight systems + /// + MAV_BATTERY_FUNCTION_ALL = 1, + + /// + /// Battery for the propulsion system + /// + MAV_BATTERY_FUNCTION_PROPULSION = 2, + + /// + /// Avionics battery + /// + MAV_BATTERY_FUNCTION_AVIONICS = 3, + + /// + /// Payload battery + /// + MAV_BATTERY_TYPE_PAYLOAD = 4, + MAV_BATTERY_FUNCTION_ENUM_END = 5, + + } + + + /// + /// Enumeration of VTOL states + /// + public enum MAV_VTOL_STATE : uint + { + + /// + /// MAV is not configured as VTOL + /// + MAV_VTOL_STATE_UNDEFINED = 0, + + /// + /// VTOL is in transition from multicopter to fixed-wing + /// + MAV_VTOL_STATE_TRANSITION_TO_FW = 1, + + /// + /// VTOL is in transition from fixed-wing to multicopter + /// + MAV_VTOL_STATE_TRANSITION_TO_MC = 2, + + /// + /// VTOL is in multicopter state + /// + MAV_VTOL_STATE_MC = 3, + + /// + /// VTOL is in fixed-wing state + /// + MAV_VTOL_STATE_FW = 4, + MAV_VTOL_STATE_ENUM_END = 5, + + } + + + /// + /// Enumeration of landed detector states + /// + public enum MAV_LANDED_STATE : uint + { + + /// + /// MAV landed state is unknown + /// + MAV_LANDED_STATE_UNDEFINED = 0, + + /// + /// MAV is landed (on ground) + /// + MAV_LANDED_STATE_ON_GROUND = 1, + + /// + /// MAV is in air + /// + MAV_LANDED_STATE_IN_AIR = 2, + MAV_LANDED_STATE_ENUM_END = 3, + + } + + + /// + /// Enumeration of the ADSB altimeter types + /// + public enum ADSB_ALTITUDE_TYPE : uint + { + + /// + /// Altitude reported from a Baro source using QNH reference + /// + ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0, + + /// + /// Altitude reported from a GNSS source + /// + ADSB_ALTITUDE_TYPE_GEOMETRIC = 1, + ADSB_ALTITUDE_TYPE_ENUM_END = 2, + + } + + + /// + /// ADSB classification for the type of vehicle emitting the transponder signal + /// + public enum ADSB_EMITTER_TYPE : uint + { + ADSB_EMITTER_TYPE_NO_INFO = 0, + ADSB_EMITTER_TYPE_LIGHT = 1, + ADSB_EMITTER_TYPE_SMALL = 2, + ADSB_EMITTER_TYPE_LARGE = 3, + ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4, + ADSB_EMITTER_TYPE_HEAVY = 5, + ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6, + ADSB_EMITTER_TYPE_ROTOCRAFT = 7, + ADSB_EMITTER_TYPE_UNASSIGNED = 8, + ADSB_EMITTER_TYPE_GLIDER = 9, + ADSB_EMITTER_TYPE_LIGHTER_AIR = 10, + ADSB_EMITTER_TYPE_PARACHUTE = 11, + ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12, + ADSB_EMITTER_TYPE_UNASSIGNED2 = 13, + ADSB_EMITTER_TYPE_UAV = 14, + ADSB_EMITTER_TYPE_SPACE = 15, + ADSB_EMITTER_TYPE_UNASSGINED3 = 16, + ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17, + ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18, + ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19, + ADSB_EMITTER_TYPE_ENUM_END = 20, + + } + + + /// + /// These flags indicate status such as data validity of each data source. Set = data valid + /// + public enum ADSB_FLAGS : uint + { + ADSB_FLAGS_VALID_COORDS = 1, + ADSB_FLAGS_VALID_ALTITUDE = 2, + ADSB_FLAGS_VALID_HEADING = 4, + ADSB_FLAGS_VALID_VELOCITY = 8, + ADSB_FLAGS_VALID_CALLSIGN = 16, + ADSB_FLAGS_VALID_SQUAWK = 32, + ADSB_FLAGS_SIMULATED = 64, + ADSB_FLAGS_ENUM_END = 65, + + } + + + /// + /// Bitmask of options for the MAV_CMD_DO_REPOSITION + /// + public enum MAV_DO_REPOSITION_FLAGS : uint + { + + /// + /// The aircraft should immediately transition into guided. This should not be set for follow me applications + /// + MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1, + MAV_DO_REPOSITION_FLAGS_ENUM_END = 2, + + } + + + /// + /// Flags in EKF_STATUS message + /// + public enum ESTIMATOR_STATUS_FLAGS : uint + { + + /// + /// True if the attitude estimate is good + /// + ESTIMATOR_ATTITUDE = 1, + + /// + /// True if the horizontal velocity estimate is good + /// + ESTIMATOR_VELOCITY_HORIZ = 2, + + /// + /// True if the vertical velocity estimate is good + /// + ESTIMATOR_VELOCITY_VERT = 4, + + /// + /// True if the horizontal position (relative) estimate is good + /// + ESTIMATOR_POS_HORIZ_REL = 8, + + /// + /// True if the horizontal position (absolute) estimate is good + /// + ESTIMATOR_POS_HORIZ_ABS = 16, + + /// + /// True if the vertical position (absolute) estimate is good + /// + ESTIMATOR_POS_VERT_ABS = 32, + + /// + /// True if the vertical position (above ground) estimate is good + /// + ESTIMATOR_POS_VERT_AGL = 64, + + /// + /// True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow) + /// + ESTIMATOR_CONST_POS_MODE = 128, + + /// + /// True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate + /// + ESTIMATOR_PRED_POS_HORIZ_REL = 256, + + /// + /// True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate + /// + ESTIMATOR_PRED_POS_HORIZ_ABS = 512, + + /// + /// True if the EKF has detected a GPS glitch + /// + ESTIMATOR_GPS_GLITCH = 1024, + ESTIMATOR_STATUS_FLAGS_ENUM_END = 1025, + + } + + +} + + + +namespace MavLink +{ + + public abstract class MavlinkMessage + { + public abstract int Serialize(byte[] bytes, ref int offset); + } + + /// + /// Message For set angular velocity + /// + public class Msg_set_velocity : MavlinkMessage + { + + /// + /// velocity value + /// + public UInt16 ref_angular_velocity; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_VELOCITY(this, bytes, ref offset); + } + } + + + /// + /// The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). + /// + public class Msg_heartbeat : MavlinkMessage + { + + /// + /// Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) + /// + public byte type; + + /// + /// Autopilot type / class. defined in MAV_AUTOPILOT ENUM + /// + public byte autopilot; + + /// + /// System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h + /// + public byte base_mode; + + /// + /// A bitfield for use for autopilot-specific flags. + /// + public UInt32 custom_mode; + + /// + /// System status flag, see MAV_STATE ENUM + /// + public byte system_status; + + /// + /// MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version + /// + public byte mavlink_version; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HEARTBEAT(this, bytes, ref offset); + } + } + + + /// + /// The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. + /// + public class Msg_sys_status : MavlinkMessage + { + + /// + /// Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + /// + public UInt32 onboard_control_sensors_present; + + /// + /// Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + /// + public UInt32 onboard_control_sensors_enabled; + + /// + /// Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + /// + public UInt32 onboard_control_sensors_health; + + /// + /// Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 + /// + public UInt16 load; + + /// + /// Battery voltage, in millivolts (1 = 1 millivolt) + /// + public UInt16 voltage_battery; + + /// + /// Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + /// + public Int16 current_battery; + + /// + /// Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery + /// + public sbyte battery_remaining; + + /// + /// Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + /// + public UInt16 drop_rate_comm; + + /// + /// Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + /// + public UInt16 errors_comm; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count1; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count2; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count3; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count4; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SYS_STATUS(this, bytes, ref offset); + } + } + + + /// + /// The system time is the time of the master clock, typically the computer clock of the main onboard computer. + /// + public class Msg_system_time : MavlinkMessage + { + + /// + /// Timestamp of the master clock in microseconds since UNIX epoch. + /// + public UInt64 time_unix_usec; + + /// + /// Timestamp of the component clock since boot time in milliseconds. + /// + public UInt32 time_boot_ms; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SYSTEM_TIME(this, bytes, ref offset); + } + } + + + /// + /// A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. + /// + public class Msg_ping : MavlinkMessage + { + + /// + /// Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) + /// + public UInt64 time_usec; + + /// + /// PING sequence + /// + public UInt32 seq; + + /// + /// 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system + /// + public byte target_system; + + /// + /// 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PING(this, bytes, ref offset); + } + } + + + /// + /// Request to control this MAV + /// + public class Msg_change_operator_control : MavlinkMessage + { + + /// + /// System the GCS requests control for + /// + public byte target_system; + + /// + /// 0: request control of this MAV, 1: Release control of this MAV + /// + public byte control_request; + + /// + /// 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + /// + public byte version; + + /// + /// Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + /// + public byte[] passkey; // Array size 25 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CHANGE_OPERATOR_CONTROL(this, bytes, ref offset); + } + } + + + /// + /// Accept / deny control of this MAV + /// + public class Msg_change_operator_control_ack : MavlinkMessage + { + + /// + /// ID of the GCS this message + /// + public byte gcs_system_id; + + /// + /// 0: request control of this MAV, 1: Release control of this MAV + /// + public byte control_request; + + /// + /// 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + /// + public byte ack; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CHANGE_OPERATOR_CONTROL_ACK(this, bytes, ref offset); + } + } + + + /// + /// Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. + /// + public class Msg_auth_key : MavlinkMessage + { + public byte[] key; // Array size 32 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_AUTH_KEY(this, bytes, ref offset); + } + } + + + /// + /// THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with MAV_CMD_DO_SET_MODE INSTEAD. Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. + /// + public class Msg_set_mode : MavlinkMessage + { + + /// + /// The system setting the mode + /// + public byte target_system; + + /// + /// The new base mode + /// + public byte base_mode; + + /// + /// The new autopilot-specific mode. This field can be ignored by an autopilot. + /// + public UInt32 custom_mode; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_MODE(this, bytes, ref offset); + } + } + + + /// + /// Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. + /// + public class Msg_param_request_read : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + /// + public Int16 param_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_REQUEST_READ(this, bytes, ref offset); + } + } + + + /// + /// Request all parameters of this component. After his request, all parameters are emitted. + /// + public class Msg_param_request_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_REQUEST_LIST(this, bytes, ref offset); + } + } + + + /// + /// Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. + /// + public class Msg_param_value : MavlinkMessage + { + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Onboard parameter value + /// + public float param_value; + + /// + /// Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + /// + public byte param_type; + + /// + /// Total number of onboard parameters + /// + public UInt16 param_count; + + /// + /// Index of this onboard parameter + /// + public UInt16 param_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_VALUE(this, bytes, ref offset); + } + } + + + /// + /// Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. + /// + public class Msg_param_set : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Onboard parameter value + /// + public float param_value; + + /// + /// Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + /// + public byte param_type; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_SET(this, bytes, ref offset); + } + } + + + /// + /// The global position, as returned by the Global Positioning System (GPS). This is + /// NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). + /// + public class Msg_gps_raw_int : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + /// + public byte fix_type; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. + /// + public Int32 alt; + + /// + /// GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + /// + public UInt16 eph; + + /// + /// GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + /// + public UInt16 epv; + + /// + /// GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + /// + public UInt16 vel; + + /// + /// Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + /// + public UInt16 cog; + + /// + /// Number of satellites visible. If unknown, set to 255 + /// + public byte satellites_visible; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_RAW_INT(this, bytes, ref offset); + } + } + + + /// + /// The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. + /// + public class Msg_gps_status : MavlinkMessage + { + + /// + /// Number of satellites visible + /// + public byte satellites_visible; + + /// + /// Global satellite ID + /// + public byte[] satellite_prn; // Array size 20 + + /// + /// 0: Satellite not used, 1: used for localization + /// + public byte[] satellite_used; // Array size 20 + + /// + /// Elevation (0: right on top of receiver, 90: on the horizon) of satellite + /// + public byte[] satellite_elevation; // Array size 20 + + /// + /// Direction of satellite, 0: 0 deg, 255: 360 deg. + /// + public byte[] satellite_azimuth; // Array size 20 + + /// + /// Signal to noise ratio of satellite + /// + public byte[] satellite_snr; // Array size 20 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_STATUS(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units + /// + public class Msg_scaled_imu : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (millirad /sec) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (millirad /sec) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (millirad /sec) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (milli tesla) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (milli tesla) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (milli tesla) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_IMU(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. + /// + public class Msg_raw_imu : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// X acceleration (raw) + /// + public Int16 xacc; + + /// + /// Y acceleration (raw) + /// + public Int16 yacc; + + /// + /// Z acceleration (raw) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (raw) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (raw) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (raw) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (raw) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (raw) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (raw) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RAW_IMU(this, bytes, ref offset); + } + } + + + /// + /// The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. + /// + public class Msg_raw_pressure : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Absolute pressure (raw) + /// + public Int16 press_abs; + + /// + /// Differential pressure 1 (raw, 0 if nonexistant) + /// + public Int16 press_diff1; + + /// + /// Differential pressure 2 (raw, 0 if nonexistant) + /// + public Int16 press_diff2; + + /// + /// Raw Temperature measurement (raw) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RAW_PRESSURE(this, bytes, ref offset); + } + } + + + /// + /// The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. + /// + public class Msg_scaled_pressure : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Absolute pressure (hectopascal) + /// + public float press_abs; + + /// + /// Differential pressure 1 (hectopascal) + /// + public float press_diff; + + /// + /// Temperature measurement (0.01 degrees celsius) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_PRESSURE(this, bytes, ref offset); + } + } + + + /// + /// The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). + /// + public class Msg_attitude : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Roll angle (rad, -pi..+pi) + /// + public float roll; + + /// + /// Pitch angle (rad, -pi..+pi) + /// + public float pitch; + + /// + /// Yaw angle (rad, -pi..+pi) + /// + public float yaw; + + /// + /// Roll angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Pitch angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Yaw angular speed (rad/s) + /// + public float yawspeed; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE(this, bytes, ref offset); + } + } + + + /// + /// The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + /// + public class Msg_attitude_quaternion : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Quaternion component 1, w (1 in null-rotation) + /// + public float q1; + + /// + /// Quaternion component 2, x (0 in null-rotation) + /// + public float q2; + + /// + /// Quaternion component 3, y (0 in null-rotation) + /// + public float q3; + + /// + /// Quaternion component 4, z (0 in null-rotation) + /// + public float q4; + + /// + /// Roll angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Pitch angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Yaw angular speed (rad/s) + /// + public float yawspeed; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE_QUATERNION(this, bytes, ref offset); + } + } + + + /// + /// The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + /// + public class Msg_local_position_ned : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X Position + /// + public float x; + + /// + /// Y Position + /// + public float y; + + /// + /// Z Position + /// + public float z; + + /// + /// X Speed + /// + public float vx; + + /// + /// Y Speed + /// + public float vy; + + /// + /// Z Speed + /// + public float vz; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOCAL_POSITION_NED(this, bytes, ref offset); + } + } + + + /// + /// The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It + /// is designed as scaled integer message since the resolution of float is not sufficient. + /// + public class Msg_global_position_int : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Latitude, expressed as degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) + /// + public Int32 alt; + + /// + /// Altitude above ground in meters, expressed as * 1000 (millimeters) + /// + public Int32 relative_alt; + + /// + /// Ground X Speed (Latitude, positive north), expressed as m/s * 100 + /// + public Int16 vx; + + /// + /// Ground Y Speed (Longitude, positive east), expressed as m/s * 100 + /// + public Int16 vy; + + /// + /// Ground Z Speed (Altitude, positive down), expressed as m/s * 100 + /// + public Int16 vz; + + /// + /// Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + /// + public UInt16 hdg; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GLOBAL_POSITION_INT(this, bytes, ref offset); + } + } + + + /// + /// The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to UINT16_MAX. + /// + public class Msg_rc_channels_scaled : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + /// + public byte port; + + /// + /// RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan1_scaled; + + /// + /// RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan2_scaled; + + /// + /// RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan3_scaled; + + /// + /// RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan4_scaled; + + /// + /// RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan5_scaled; + + /// + /// RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan6_scaled; + + /// + /// RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan7_scaled; + + /// + /// RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan8_scaled; + + /// + /// Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS_SCALED(this, bytes, ref offset); + } + } + + + /// + /// The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_rc_channels_raw : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + /// + public byte port; + + /// + /// RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan8_raw; + + /// + /// Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS_RAW(this, bytes, ref offset); + } + } + + + /// + /// The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. + /// + public class Msg_servo_output_raw : MavlinkMessage + { + + /// + /// Timestamp (microseconds since system boot) + /// + public UInt32 time_usec; + + /// + /// Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. + /// + public byte port; + + /// + /// Servo output 1 value, in microseconds + /// + public UInt16 servo1_raw; + + /// + /// Servo output 2 value, in microseconds + /// + public UInt16 servo2_raw; + + /// + /// Servo output 3 value, in microseconds + /// + public UInt16 servo3_raw; + + /// + /// Servo output 4 value, in microseconds + /// + public UInt16 servo4_raw; + + /// + /// Servo output 5 value, in microseconds + /// + public UInt16 servo5_raw; + + /// + /// Servo output 6 value, in microseconds + /// + public UInt16 servo6_raw; + + /// + /// Servo output 7 value, in microseconds + /// + public UInt16 servo7_raw; + + /// + /// Servo output 8 value, in microseconds + /// + public UInt16 servo8_raw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SERVO_OUTPUT_RAW(this, bytes, ref offset); + } + } + + + /// + /// Request a partial list of mission items from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol. If start and end index are the same, just send one waypoint. + /// + public class Msg_mission_request_partial_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Start index, 0 by default + /// + public Int16 start_index; + + /// + /// End index, -1 by default (-1: send list to end). Else a valid index of the list + /// + public Int16 end_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST_PARTIAL_LIST(this, bytes, ref offset); + } + } + + + /// + /// This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! + /// + public class Msg_mission_write_partial_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Start index, 0 by default and smaller / equal to the largest index of the current onboard list. + /// + public Int16 start_index; + + /// + /// End index, equal or greater than start index. + /// + public Int16 end_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_WRITE_PARTIAL_LIST(this, bytes, ref offset); + } + } + + + /// + /// Message encoding a mission item. This message is emitted to announce + /// the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also http://qgroundcontrol.org/mavlink/waypoint_protocol. + /// + public class Msg_mission_item : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + /// + /// The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + /// + public byte frame; + + /// + /// The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + /// + public UInt16 command; + + /// + /// false:0, true:1 + /// + public byte current; + + /// + /// autocontinue to next wp + /// + public byte autocontinue; + + /// + /// PARAM1, see MAV_CMD enum + /// + public float param1; + + /// + /// PARAM2, see MAV_CMD enum + /// + public float param2; + + /// + /// PARAM3, see MAV_CMD enum + /// + public float param3; + + /// + /// PARAM4, see MAV_CMD enum + /// + public float param4; + + /// + /// PARAM5 / local: x position, global: latitude + /// + public float x; + + /// + /// PARAM6 / y position: global: longitude + /// + public float y; + + /// + /// PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ITEM(this, bytes, ref offset); + } + } + + + /// + /// Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol + /// + public class Msg_mission_request : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST(this, bytes, ref offset); + } + } + + + /// + /// Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). + /// + public class Msg_mission_set_current : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_SET_CURRENT(this, bytes, ref offset); + } + } + + + /// + /// Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. + /// + public class Msg_mission_current : MavlinkMessage + { + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_CURRENT(this, bytes, ref offset); + } + } + + + /// + /// Request the overall list of mission items from the system/component. + /// + public class Msg_mission_request_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST_LIST(this, bytes, ref offset); + } + } + + + /// + /// This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. + /// + public class Msg_mission_count : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Number of mission items in the sequence + /// + public UInt16 count; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_COUNT(this, bytes, ref offset); + } + } + + + /// + /// Delete all mission items at once. + /// + public class Msg_mission_clear_all : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_CLEAR_ALL(this, bytes, ref offset); + } + } + + + /// + /// A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. + /// + public class Msg_mission_item_reached : MavlinkMessage + { + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ITEM_REACHED(this, bytes, ref offset); + } + } + + + /// + /// Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). + /// + public class Msg_mission_ack : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// See MAV_MISSION_RESULT enum + /// + public byte type; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ACK(this, bytes, ref offset); + } + } + + + /// + /// As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. + /// + public class Msg_set_gps_global_origin : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84, in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_GPS_GLOBAL_ORIGIN(this, bytes, ref offset); + } + } + + + /// + /// Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position + /// + public class Msg_gps_global_origin : MavlinkMessage + { + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_GLOBAL_ORIGIN(this, bytes, ref offset); + } + } + + + /// + /// Bind a RC channel to a parameter. The parameter should change accoding to the RC channel value. + /// + public class Msg_param_map_rc : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + /// + public Int16 param_index; + + /// + /// Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC. + /// + public byte parameter_rc_channel_index; + + /// + /// Initial parameter value + /// + public float param_value0; + + /// + /// Scale, maps the RC range [-1, 1] to a parameter value + /// + public float scale; + + /// + /// Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + /// + public float param_value_min; + + /// + /// Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + /// + public float param_value_max; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_MAP_RC(this, bytes, ref offset); + } + } + + + /// + /// Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. http://qgroundcontrol.org/mavlink/waypoint_protocol + /// + public class Msg_mission_request_int : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST_INT(this, bytes, ref offset); + } + } + + + /// + /// Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. + /// + public class Msg_safety_set_allowed_area : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + /// + public byte frame; + + /// + /// x position 1 / Latitude 1 + /// + public float p1x; + + /// + /// y position 1 / Longitude 1 + /// + public float p1y; + + /// + /// z position 1 / Altitude 1 + /// + public float p1z; + + /// + /// x position 2 / Latitude 2 + /// + public float p2x; + + /// + /// y position 2 / Longitude 2 + /// + public float p2y; + + /// + /// z position 2 / Altitude 2 + /// + public float p2z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SAFETY_SET_ALLOWED_AREA(this, bytes, ref offset); + } + } + + + /// + /// Read out the safety zone the MAV currently assumes. + /// + public class Msg_safety_allowed_area : MavlinkMessage + { + + /// + /// Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + /// + public byte frame; + + /// + /// x position 1 / Latitude 1 + /// + public float p1x; + + /// + /// y position 1 / Longitude 1 + /// + public float p1y; + + /// + /// z position 1 / Altitude 1 + /// + public float p1z; + + /// + /// x position 2 / Latitude 2 + /// + public float p2x; + + /// + /// y position 2 / Longitude 2 + /// + public float p2y; + + /// + /// z position 2 / Altitude 2 + /// + public float p2z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SAFETY_ALLOWED_AREA(this, bytes, ref offset); + } + } + + + /// + /// The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + /// + public class Msg_attitude_quaternion_cov : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + /// + public float[] q; // Array size 4 + + /// + /// Roll angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Pitch angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Yaw angular speed (rad/s) + /// + public float yawspeed; + + /// + /// Attitude covariance + /// + public float[] covariance; // Array size 9 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE_QUATERNION_COV(this, bytes, ref offset); + } + } + + + /// + /// The state of the fixed wing navigation and position controller. + /// + public class Msg_nav_controller_output : MavlinkMessage + { + + /// + /// Current desired roll in degrees + /// + public float nav_roll; + + /// + /// Current desired pitch in degrees + /// + public float nav_pitch; + + /// + /// Current desired heading in degrees + /// + public Int16 nav_bearing; + + /// + /// Bearing to current MISSION/target in degrees + /// + public Int16 target_bearing; + + /// + /// Distance to active MISSION in meters + /// + public UInt16 wp_dist; + + /// + /// Current altitude error in meters + /// + public float alt_error; + + /// + /// Current airspeed error in meters/second + /// + public float aspd_error; + + /// + /// Current crosstrack error on x-y plane in meters + /// + public float xtrack_error; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_NAV_CONTROLLER_OUTPUT(this, bytes, ref offset); + } + } + + + /// + /// The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset. + /// + public class Msg_global_position_int_cov : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver. + /// + public UInt64 time_utc; + + /// + /// Class id of the estimator this estimate originated from. + /// + public byte estimator_type; + + /// + /// Latitude, expressed as degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters), above MSL + /// + public Int32 alt; + + /// + /// Altitude above ground in meters, expressed as * 1000 (millimeters) + /// + public Int32 relative_alt; + + /// + /// Ground X Speed (Latitude), expressed as m/s + /// + public float vx; + + /// + /// Ground Y Speed (Longitude), expressed as m/s + /// + public float vy; + + /// + /// Ground Z Speed (Altitude), expressed as m/s + /// + public float vz; + + /// + /// Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.) + /// + public float[] covariance; // Array size 36 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GLOBAL_POSITION_INT_COV(this, bytes, ref offset); + } + } + + + /// + /// The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + /// + public class Msg_local_position_ned_cov : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp + /// + public UInt32 time_boot_ms; + + /// + /// Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver. + /// + public UInt64 time_utc; + + /// + /// Class id of the estimator this estimate originated from. + /// + public byte estimator_type; + + /// + /// X Position + /// + public float x; + + /// + /// Y Position + /// + public float y; + + /// + /// Z Position + /// + public float z; + + /// + /// X Speed (m/s) + /// + public float vx; + + /// + /// Y Speed (m/s) + /// + public float vy; + + /// + /// Z Speed (m/s) + /// + public float vz; + + /// + /// X Acceleration (m/s^2) + /// + public float ax; + + /// + /// Y Acceleration (m/s^2) + /// + public float ay; + + /// + /// Z Acceleration (m/s^2) + /// + public float az; + + /// + /// Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.) + /// + public float[] covariance; // Array size 45 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOCAL_POSITION_NED_COV(this, bytes, ref offset); + } + } + + + /// + /// The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_rc_channels : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + /// + public byte chancount; + + /// + /// RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan8_raw; + + /// + /// RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan9_raw; + + /// + /// RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan10_raw; + + /// + /// RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan11_raw; + + /// + /// RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan12_raw; + + /// + /// RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan13_raw; + + /// + /// RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan14_raw; + + /// + /// RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan15_raw; + + /// + /// RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan16_raw; + + /// + /// RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan17_raw; + + /// + /// RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan18_raw; + + /// + /// Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS(this, bytes, ref offset); + } + } + + + /// + /// THIS INTERFACE IS DEPRECATED. USE SET_MESSAGE_INTERVAL INSTEAD. + /// + public class Msg_request_data_stream : MavlinkMessage + { + + /// + /// The target requested to send the message stream. + /// + public byte target_system; + + /// + /// The target requested to send the message stream. + /// + public byte target_component; + + /// + /// The ID of the requested data stream + /// + public byte req_stream_id; + + /// + /// The requested message rate + /// + public UInt16 req_message_rate; + + /// + /// 1 to start sending, 0 to stop sending. + /// + public byte start_stop; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_REQUEST_DATA_STREAM(this, bytes, ref offset); + } + } + + + /// + /// THIS INTERFACE IS DEPRECATED. USE MESSAGE_INTERVAL INSTEAD. + /// + public class Msg_data_stream : MavlinkMessage + { + + /// + /// The ID of the requested data stream + /// + public byte stream_id; + + /// + /// The message rate + /// + public UInt16 message_rate; + + /// + /// 1 stream is enabled, 0 stream is stopped. + /// + public byte on_off; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DATA_STREAM(this, bytes, ref offset); + } + } + + + /// + /// This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled an buttons are also transmit as boolean values of their + /// + public class Msg_manual_control : MavlinkMessage + { + + /// + /// The system to be controlled. + /// + public byte target; + + /// + /// X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + /// + public Int16 x; + + /// + /// Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + /// + public Int16 y; + + /// + /// Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + /// + public Int16 z; + + /// + /// R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + /// + public Int16 r; + + /// + /// A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + /// + public UInt16 buttons; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MANUAL_CONTROL(this, bytes, ref offset); + } + } + + + /// + /// The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of UINT16_MAX means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_rc_channels_override : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan8_raw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS_OVERRIDE(this, bytes, ref offset); + } + } + + + /// + /// Message encoding a mission item. This message is emitted to announce + /// the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See alsohttp://qgroundcontrol.org/mavlink/waypoint_protocol. + /// + public class Msg_mission_item_int : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + /// + public UInt16 seq; + + /// + /// The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + /// + public byte frame; + + /// + /// The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + /// + public UInt16 command; + + /// + /// false:0, true:1 + /// + public byte current; + + /// + /// autocontinue to next wp + /// + public byte autocontinue; + + /// + /// PARAM1, see MAV_CMD enum + /// + public float param1; + + /// + /// PARAM2, see MAV_CMD enum + /// + public float param2; + + /// + /// PARAM3, see MAV_CMD enum + /// + public float param3; + + /// + /// PARAM4, see MAV_CMD enum + /// + public float param4; + + /// + /// PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + /// + public Int32 x; + + /// + /// PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + /// + public Int32 y; + + /// + /// PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ITEM_INT(this, bytes, ref offset); + } + } + + + /// + /// Metrics typically displayed on a HUD for fixed wing aircraft + /// + public class Msg_vfr_hud : MavlinkMessage + { + + /// + /// Current airspeed in m/s + /// + public float airspeed; + + /// + /// Current ground speed in m/s + /// + public float groundspeed; + + /// + /// Current heading in degrees, in compass units (0..360, 0=north) + /// + public Int16 heading; + + /// + /// Current throttle setting in integer percent, 0 to 100 + /// + public UInt16 throttle; + + /// + /// Current altitude (MSL), in meters + /// + public float alt; + + /// + /// Current climb rate in meters/second + /// + public float climb; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VFR_HUD(this, bytes, ref offset); + } + } + + + /// + /// Message encoding a command with parameters as scaled integers. Scaling depends on the actual command value. + /// + public class Msg_command_int : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h + /// + public byte frame; + + /// + /// The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs + /// + public UInt16 command; + + /// + /// false:0, true:1 + /// + public byte current; + + /// + /// autocontinue to next wp + /// + public byte autocontinue; + + /// + /// PARAM1, see MAV_CMD enum + /// + public float param1; + + /// + /// PARAM2, see MAV_CMD enum + /// + public float param2; + + /// + /// PARAM3, see MAV_CMD enum + /// + public float param3; + + /// + /// PARAM4, see MAV_CMD enum + /// + public float param4; + + /// + /// PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + /// + public Int32 x; + + /// + /// PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + /// + public Int32 y; + + /// + /// PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_COMMAND_INT(this, bytes, ref offset); + } + } + + + /// + /// Send a command with up to seven parameters to the MAV + /// + public class Msg_command_long : MavlinkMessage + { + + /// + /// System which should execute the command + /// + public byte target_system; + + /// + /// Component which should execute the command, 0 for all components + /// + public byte target_component; + + /// + /// Command ID, as defined by MAV_CMD enum. + /// + public UInt16 command; + + /// + /// 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + /// + public byte confirmation; + + /// + /// Parameter 1, as defined by MAV_CMD enum. + /// + public float param1; + + /// + /// Parameter 2, as defined by MAV_CMD enum. + /// + public float param2; + + /// + /// Parameter 3, as defined by MAV_CMD enum. + /// + public float param3; + + /// + /// Parameter 4, as defined by MAV_CMD enum. + /// + public float param4; + + /// + /// Parameter 5, as defined by MAV_CMD enum. + /// + public float param5; + + /// + /// Parameter 6, as defined by MAV_CMD enum. + /// + public float param6; + + /// + /// Parameter 7, as defined by MAV_CMD enum. + /// + public float param7; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_COMMAND_LONG(this, bytes, ref offset); + } + } + + + /// + /// Report status of a command. Includes feedback wether the command was executed. + /// + public class Msg_command_ack : MavlinkMessage + { + + /// + /// Command ID, as defined by MAV_CMD enum. + /// + public UInt16 command; + + /// + /// See MAV_RESULT enum + /// + public byte result; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_COMMAND_ACK(this, bytes, ref offset); + } + } + + + /// + /// Setpoint in roll, pitch, yaw and thrust from the operator + /// + public class Msg_manual_setpoint : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Desired roll rate in radians per second + /// + public float roll; + + /// + /// Desired pitch rate in radians per second + /// + public float pitch; + + /// + /// Desired yaw rate in radians per second + /// + public float yaw; + + /// + /// Collective thrust, normalized to 0 .. 1 + /// + public float thrust; + + /// + /// Flight mode switch position, 0.. 255 + /// + public byte mode_switch; + + /// + /// Override mode switch position, 0.. 255 + /// + public byte manual_override_switch; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MANUAL_SETPOINT(this, bytes, ref offset); + } + } + + + /// + /// Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system). + /// + public class Msg_set_attitude_target : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude + /// + public byte type_mask; + + /// + /// Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + /// + public float[] q; // Array size 4 + + /// + /// Body roll rate in radians per second + /// + public float body_roll_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_pitch_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_yaw_rate; + + /// + /// Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + /// + public float thrust; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_ATTITUDE_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way. + /// + public class Msg_attitude_target : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + /// + public byte type_mask; + + /// + /// Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + /// + public float[] q; // Array size 4 + + /// + /// Body roll rate in radians per second + /// + public float body_roll_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_pitch_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_yaw_rate; + + /// + /// Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + /// + public float thrust; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system). + /// + public class Msg_set_position_target_local_ned : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in NED frame in meters + /// + public float x; + + /// + /// Y Position in NED frame in meters + /// + public float y; + + /// + /// Z Position in NED frame in meters (note, altitude is negative in NED) + /// + public float z; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_POSITION_TARGET_LOCAL_NED(this, bytes, ref offset); + } + } + + + /// + /// Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way. + /// + public class Msg_position_target_local_ned : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in NED frame in meters + /// + public float x; + + /// + /// Y Position in NED frame in meters + /// + public float y; + + /// + /// Z Position in NED frame in meters (note, altitude is negative in NED) + /// + public float z; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_POSITION_TARGET_LOCAL_NED(this, bytes, ref offset); + } + } + + + /// + /// Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system). + /// + public class Msg_set_position_target_global_int : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + /// + public UInt32 time_boot_ms; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in WGS84 frame in 1e7 * meters + /// + public Int32 lat_int; + + /// + /// Y Position in WGS84 frame in 1e7 * meters + /// + public Int32 lon_int; + + /// + /// Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + /// + public float alt; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_POSITION_TARGET_GLOBAL_INT(this, bytes, ref offset); + } + } + + + /// + /// Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way. + /// + public class Msg_position_target_global_int : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + /// + public UInt32 time_boot_ms; + + /// + /// Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in WGS84 frame in 1e7 * meters + /// + public Int32 lat_int; + + /// + /// Y Position in WGS84 frame in 1e7 * meters + /// + public Int32 lon_int; + + /// + /// Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + /// + public float alt; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_POSITION_TARGET_GLOBAL_INT(this, bytes, ref offset); + } + } + + + /// + /// The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + /// + public class Msg_local_position_ned_system_global_offset : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X Position + /// + public float x; + + /// + /// Y Position + /// + public float y; + + /// + /// Z Position + /// + public float z; + public float roll; + public float pitch; + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(this, bytes, ref offset); + } + } + + + /// + /// DEPRECATED PACKET! Suffers from missing airspeed fields and singularities due to Euler angles. Please use HIL_STATE_QUATERNION instead. Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations. + /// + public class Msg_hil_state : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Roll angle (rad) + /// + public float roll; + + /// + /// Pitch angle (rad) + /// + public float pitch; + + /// + /// Yaw angle (rad) + /// + public float yaw; + + /// + /// Body frame roll / phi angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Body frame pitch / theta angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Body frame yaw / psi angular speed (rad/s) + /// + public float yawspeed; + + /// + /// Latitude, expressed as * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters) + /// + public Int32 alt; + + /// + /// Ground X Speed (Latitude), expressed as m/s * 100 + /// + public Int16 vx; + + /// + /// Ground Y Speed (Longitude), expressed as m/s * 100 + /// + public Int16 vy; + + /// + /// Ground Z Speed (Altitude), expressed as m/s * 100 + /// + public Int16 vz; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_STATE(this, bytes, ref offset); + } + } + + + /// + /// Sent from autopilot to simulation. Hardware in the loop control outputs + /// + public class Msg_hil_controls : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Control output -1 .. 1 + /// + public float roll_ailerons; + + /// + /// Control output -1 .. 1 + /// + public float pitch_elevator; + + /// + /// Control output -1 .. 1 + /// + public float yaw_rudder; + + /// + /// Throttle 0 .. 1 + /// + public float throttle; + + /// + /// Aux 1, -1 .. 1 + /// + public float aux1; + + /// + /// Aux 2, -1 .. 1 + /// + public float aux2; + + /// + /// Aux 3, -1 .. 1 + /// + public float aux3; + + /// + /// Aux 4, -1 .. 1 + /// + public float aux4; + + /// + /// System mode (MAV_MODE) + /// + public byte mode; + + /// + /// Navigation mode (MAV_NAV_MODE) + /// + public byte nav_mode; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_CONTROLS(this, bytes, ref offset); + } + } + + + /// + /// Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_hil_rc_inputs_raw : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// RC channel 1 value, in microseconds + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds + /// + public UInt16 chan8_raw; + + /// + /// RC channel 9 value, in microseconds + /// + public UInt16 chan9_raw; + + /// + /// RC channel 10 value, in microseconds + /// + public UInt16 chan10_raw; + + /// + /// RC channel 11 value, in microseconds + /// + public UInt16 chan11_raw; + + /// + /// RC channel 12 value, in microseconds + /// + public UInt16 chan12_raw; + + /// + /// Receive signal strength indicator, 0: 0%, 255: 100% + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_RC_INPUTS_RAW(this, bytes, ref offset); + } + } + + + /// + /// Optical flow from a flow sensor (e.g. optical mouse sensor) + /// + public class Msg_optical_flow : MavlinkMessage + { + + /// + /// Timestamp (UNIX) + /// + public UInt64 time_usec; + + /// + /// Sensor ID + /// + public byte sensor_id; + + /// + /// Flow in pixels * 10 in x-sensor direction (dezi-pixels) + /// + public Int16 flow_x; + + /// + /// Flow in pixels * 10 in y-sensor direction (dezi-pixels) + /// + public Int16 flow_y; + + /// + /// Flow in meters in x-sensor direction, angular-speed compensated + /// + public float flow_comp_m_x; + + /// + /// Flow in meters in y-sensor direction, angular-speed compensated + /// + public float flow_comp_m_y; + + /// + /// Optical flow quality / confidence. 0: bad, 255: maximum quality + /// + public byte quality; + + /// + /// Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + /// + public float ground_distance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_OPTICAL_FLOW(this, bytes, ref offset); + } + } + + public class Msg_global_vision_position_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X position + /// + public float x; + + /// + /// Global Y position + /// + public float y; + + /// + /// Global Z position + /// + public float z; + + /// + /// Roll angle in rad + /// + public float roll; + + /// + /// Pitch angle in rad + /// + public float pitch; + + /// + /// Yaw angle in rad + /// + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GLOBAL_VISION_POSITION_ESTIMATE(this, bytes, ref offset); + } + } + + public class Msg_vision_position_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X position + /// + public float x; + + /// + /// Global Y position + /// + public float y; + + /// + /// Global Z position + /// + public float z; + + /// + /// Roll angle in rad + /// + public float roll; + + /// + /// Pitch angle in rad + /// + public float pitch; + + /// + /// Yaw angle in rad + /// + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VISION_POSITION_ESTIMATE(this, bytes, ref offset); + } + } + + public class Msg_vision_speed_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X speed + /// + public float x; + + /// + /// Global Y speed + /// + public float y; + + /// + /// Global Z speed + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VISION_SPEED_ESTIMATE(this, bytes, ref offset); + } + } + + public class Msg_vicon_position_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X position + /// + public float x; + + /// + /// Global Y position + /// + public float y; + + /// + /// Global Z position + /// + public float z; + + /// + /// Roll angle in rad + /// + public float roll; + + /// + /// Pitch angle in rad + /// + public float pitch; + + /// + /// Yaw angle in rad + /// + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VICON_POSITION_ESTIMATE(this, bytes, ref offset); + } + } + + + /// + /// The IMU readings in SI units in NED body frame + /// + public class Msg_highres_imu : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// X acceleration (m/s^2) + /// + public float xacc; + + /// + /// Y acceleration (m/s^2) + /// + public float yacc; + + /// + /// Z acceleration (m/s^2) + /// + public float zacc; + + /// + /// Angular speed around X axis (rad / sec) + /// + public float xgyro; + + /// + /// Angular speed around Y axis (rad / sec) + /// + public float ygyro; + + /// + /// Angular speed around Z axis (rad / sec) + /// + public float zgyro; + + /// + /// X Magnetic field (Gauss) + /// + public float xmag; + + /// + /// Y Magnetic field (Gauss) + /// + public float ymag; + + /// + /// Z Magnetic field (Gauss) + /// + public float zmag; + + /// + /// Absolute pressure in millibar + /// + public float abs_pressure; + + /// + /// Differential pressure in millibar + /// + public float diff_pressure; + + /// + /// Altitude calculated from pressure + /// + public float pressure_alt; + + /// + /// Temperature in degrees celsius + /// + public float temperature; + + /// + /// Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + /// + public UInt16 fields_updated; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIGHRES_IMU(this, bytes, ref offset); + } + } + + + /// + /// Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor) + /// + public class Msg_optical_flow_rad : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// Sensor ID + /// + public byte sensor_id; + + /// + /// Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + /// + public UInt32 integration_time_us; + + /// + /// Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + /// + public float integrated_x; + + /// + /// Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + /// + public float integrated_y; + + /// + /// RH rotation around X axis (rad) + /// + public float integrated_xgyro; + + /// + /// RH rotation around Y axis (rad) + /// + public float integrated_ygyro; + + /// + /// RH rotation around Z axis (rad) + /// + public float integrated_zgyro; + + /// + /// Temperature * 100 in centi-degrees Celsius + /// + public Int16 temperature; + + /// + /// Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + /// + public byte quality; + + /// + /// Time in microseconds since the distance was sampled. + /// + public UInt32 time_delta_distance_us; + + /// + /// Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + /// + public float distance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_OPTICAL_FLOW_RAD(this, bytes, ref offset); + } + } + + + /// + /// The IMU readings in SI units in NED body frame + /// + public class Msg_hil_sensor : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// X acceleration (m/s^2) + /// + public float xacc; + + /// + /// Y acceleration (m/s^2) + /// + public float yacc; + + /// + /// Z acceleration (m/s^2) + /// + public float zacc; + + /// + /// Angular speed around X axis in body frame (rad / sec) + /// + public float xgyro; + + /// + /// Angular speed around Y axis in body frame (rad / sec) + /// + public float ygyro; + + /// + /// Angular speed around Z axis in body frame (rad / sec) + /// + public float zgyro; + + /// + /// X Magnetic field (Gauss) + /// + public float xmag; + + /// + /// Y Magnetic field (Gauss) + /// + public float ymag; + + /// + /// Z Magnetic field (Gauss) + /// + public float zmag; + + /// + /// Absolute pressure in millibar + /// + public float abs_pressure; + + /// + /// Differential pressure (airspeed) in millibar + /// + public float diff_pressure; + + /// + /// Altitude calculated from pressure + /// + public float pressure_alt; + + /// + /// Temperature in degrees celsius + /// + public float temperature; + + /// + /// Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. + /// + public UInt32 fields_updated; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_SENSOR(this, bytes, ref offset); + } + } + + + /// + /// Status of simulation environment, if used + /// + public class Msg_sim_state : MavlinkMessage + { + + /// + /// True attitude quaternion component 1, w (1 in null-rotation) + /// + public float q1; + + /// + /// True attitude quaternion component 2, x (0 in null-rotation) + /// + public float q2; + + /// + /// True attitude quaternion component 3, y (0 in null-rotation) + /// + public float q3; + + /// + /// True attitude quaternion component 4, z (0 in null-rotation) + /// + public float q4; + + /// + /// Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + /// + public float roll; + + /// + /// Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + /// + public float pitch; + + /// + /// Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + /// + public float yaw; + + /// + /// X acceleration m/s/s + /// + public float xacc; + + /// + /// Y acceleration m/s/s + /// + public float yacc; + + /// + /// Z acceleration m/s/s + /// + public float zacc; + + /// + /// Angular speed around X axis rad/s + /// + public float xgyro; + + /// + /// Angular speed around Y axis rad/s + /// + public float ygyro; + + /// + /// Angular speed around Z axis rad/s + /// + public float zgyro; + + /// + /// Latitude in degrees + /// + public float lat; + + /// + /// Longitude in degrees + /// + public float lon; + + /// + /// Altitude in meters + /// + public float alt; + + /// + /// Horizontal position standard deviation + /// + public float std_dev_horz; + + /// + /// Vertical position standard deviation + /// + public float std_dev_vert; + + /// + /// True velocity in m/s in NORTH direction in earth-fixed NED frame + /// + public float vn; + + /// + /// True velocity in m/s in EAST direction in earth-fixed NED frame + /// + public float ve; + + /// + /// True velocity in m/s in DOWN direction in earth-fixed NED frame + /// + public float vd; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SIM_STATE(this, bytes, ref offset); + } + } + + + /// + /// Status generated by radio and injected into MAVLink stream. + /// + public class Msg_radio_status : MavlinkMessage + { + + /// + /// Local signal strength + /// + public byte rssi; + + /// + /// Remote signal strength + /// + public byte remrssi; + + /// + /// Remaining free buffer space in percent. + /// + public byte txbuf; + + /// + /// Background noise level + /// + public byte noise; + + /// + /// Remote background noise level + /// + public byte remnoise; + + /// + /// Receive errors + /// + public UInt16 rxerrors; + + /// + /// Count of error corrected packets + /// + public UInt16 @fixed; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RADIO_STATUS(this, bytes, ref offset); + } + } + + + /// + /// File transfer message + /// + public class Msg_file_transfer_protocol : MavlinkMessage + { + + /// + /// Network ID (0 for broadcast) + /// + public byte target_network; + + /// + /// System ID (0 for broadcast) + /// + public byte target_system; + + /// + /// Component ID (0 for broadcast) + /// + public byte target_component; + + /// + /// Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + /// + public byte[] payload; // Array size 251 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_FILE_TRANSFER_PROTOCOL(this, bytes, ref offset); + } + } + + + /// + /// Time synchronization message. + /// + public class Msg_timesync : MavlinkMessage + { + + /// + /// Time sync timestamp 1 + /// + public Int64 tc1; + + /// + /// Time sync timestamp 2 + /// + public Int64 ts1; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TIMESYNC(this, bytes, ref offset); + } + } + + + /// + /// Camera-IMU triggering and synchronisation message. + /// + public class Msg_camera_trigger : MavlinkMessage + { + + /// + /// Timestamp for the image frame in microseconds + /// + public UInt64 time_usec; + + /// + /// Image frame sequence + /// + public UInt32 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CAMERA_TRIGGER(this, bytes, ref offset); + } + } + + + /// + /// The global position, as returned by the Global Positioning System (GPS). This is + /// NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). + /// + public class Msg_hil_gps : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + /// + public byte fix_type; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + /// + public Int32 alt; + + /// + /// GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 + /// + public UInt16 eph; + + /// + /// GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 + /// + public UInt16 epv; + + /// + /// GPS ground speed (m/s * 100). If unknown, set to: 65535 + /// + public UInt16 vel; + + /// + /// GPS velocity in cm/s in NORTH direction in earth-fixed NED frame + /// + public Int16 vn; + + /// + /// GPS velocity in cm/s in EAST direction in earth-fixed NED frame + /// + public Int16 ve; + + /// + /// GPS velocity in cm/s in DOWN direction in earth-fixed NED frame + /// + public Int16 vd; + + /// + /// Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 + /// + public UInt16 cog; + + /// + /// Number of satellites visible. If unknown, set to 255 + /// + public byte satellites_visible; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_GPS(this, bytes, ref offset); + } + } + + + /// + /// Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor) + /// + public class Msg_hil_optical_flow : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// Sensor ID + /// + public byte sensor_id; + + /// + /// Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + /// + public UInt32 integration_time_us; + + /// + /// Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + /// + public float integrated_x; + + /// + /// Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + /// + public float integrated_y; + + /// + /// RH rotation around X axis (rad) + /// + public float integrated_xgyro; + + /// + /// RH rotation around Y axis (rad) + /// + public float integrated_ygyro; + + /// + /// RH rotation around Z axis (rad) + /// + public float integrated_zgyro; + + /// + /// Temperature * 100 in centi-degrees Celsius + /// + public Int16 temperature; + + /// + /// Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + /// + public byte quality; + + /// + /// Time in microseconds since the distance was sampled. + /// + public UInt32 time_delta_distance_us; + + /// + /// Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + /// + public float distance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_OPTICAL_FLOW(this, bytes, ref offset); + } + } + + + /// + /// Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations. + /// + public class Msg_hil_state_quaternion : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + /// + public float[] attitude_quaternion; // Array size 4 + + /// + /// Body frame roll / phi angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Body frame pitch / theta angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Body frame yaw / psi angular speed (rad/s) + /// + public float yawspeed; + + /// + /// Latitude, expressed as * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters) + /// + public Int32 alt; + + /// + /// Ground X Speed (Latitude), expressed as m/s * 100 + /// + public Int16 vx; + + /// + /// Ground Y Speed (Longitude), expressed as m/s * 100 + /// + public Int16 vy; + + /// + /// Ground Z Speed (Altitude), expressed as m/s * 100 + /// + public Int16 vz; + + /// + /// Indicated airspeed, expressed as m/s * 100 + /// + public UInt16 ind_airspeed; + + /// + /// True airspeed, expressed as m/s * 100 + /// + public UInt16 true_airspeed; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_STATE_QUATERNION(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units + /// + public class Msg_scaled_imu2 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (millirad /sec) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (millirad /sec) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (millirad /sec) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (milli tesla) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (milli tesla) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (milli tesla) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_IMU2(this, bytes, ref offset); + } + } + + + /// + /// Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. + /// + public class Msg_log_request_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// First log id (0 for first available) + /// + public UInt16 start; + + /// + /// Last log id (0xffff for last available) + /// + public UInt16 end; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_REQUEST_LIST(this, bytes, ref offset); + } + } + + + /// + /// Reply to LOG_REQUEST_LIST + /// + public class Msg_log_entry : MavlinkMessage + { + + /// + /// Log id + /// + public UInt16 id; + + /// + /// Total number of logs + /// + public UInt16 num_logs; + + /// + /// High log number + /// + public UInt16 last_log_num; + + /// + /// UTC timestamp of log in seconds since 1970, or 0 if not available + /// + public UInt32 time_utc; + + /// + /// Size of the log (may be approximate) in bytes + /// + public UInt32 size; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_ENTRY(this, bytes, ref offset); + } + } + + + /// + /// Request a chunk of a log + /// + public class Msg_log_request_data : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Log id (from LOG_ENTRY reply) + /// + public UInt16 id; + + /// + /// Offset into the log + /// + public UInt32 ofs; + + /// + /// Number of bytes + /// + public UInt32 count; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_REQUEST_DATA(this, bytes, ref offset); + } + } + + + /// + /// Reply to LOG_REQUEST_DATA + /// + public class Msg_log_data : MavlinkMessage + { + + /// + /// Log id (from LOG_ENTRY reply) + /// + public UInt16 id; + + /// + /// Offset into the log + /// + public UInt32 ofs; + + /// + /// Number of bytes (zero for end of log) + /// + public byte count; + + /// + /// log data + /// + public byte[] data; // Array size 90 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_DATA(this, bytes, ref offset); + } + } + + + /// + /// Erase all logs + /// + public class Msg_log_erase : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_ERASE(this, bytes, ref offset); + } + } + + + /// + /// Stop log transfer and resume normal logging + /// + public class Msg_log_request_end : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_REQUEST_END(this, bytes, ref offset); + } + } + + + /// + /// data for injecting into the onboard GPS (used for DGPS) + /// + public class Msg_gps_inject_data : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// data length + /// + public byte len; + + /// + /// raw data (110 is enough for 12 satellites of RTCMv2) + /// + public byte[] data; // Array size 110 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_INJECT_DATA(this, bytes, ref offset); + } + } + + + /// + /// Second GPS data. Coordinate frame is right-handed, Z-axis up (GPS frame). + /// + public class Msg_gps2_raw : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + /// + public byte fix_type; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + /// + public Int32 alt; + + /// + /// GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + /// + public UInt16 eph; + + /// + /// GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + /// + public UInt16 epv; + + /// + /// GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + /// + public UInt16 vel; + + /// + /// Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + /// + public UInt16 cog; + + /// + /// Number of satellites visible. If unknown, set to 255 + /// + public byte satellites_visible; + + /// + /// Number of DGPS satellites + /// + public byte dgps_numch; + + /// + /// Age of DGPS info + /// + public UInt32 dgps_age; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS2_RAW(this, bytes, ref offset); + } + } + + + /// + /// Power supply status + /// + public class Msg_power_status : MavlinkMessage + { + + /// + /// 5V rail voltage in millivolts + /// + public UInt16 Vcc; + + /// + /// servo rail voltage in millivolts + /// + public UInt16 Vservo; + + /// + /// power supply status flags (see MAV_POWER_STATUS enum) + /// + public UInt16 flags; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_POWER_STATUS(this, bytes, ref offset); + } + } + + + /// + /// Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate. + /// + public class Msg_serial_control : MavlinkMessage + { + + /// + /// See SERIAL_CONTROL_DEV enum + /// + public byte device; + + /// + /// See SERIAL_CONTROL_FLAG enum + /// + public byte flags; + + /// + /// Timeout for reply data in milliseconds + /// + public UInt16 timeout; + + /// + /// Baudrate of transfer. Zero means no change. + /// + public UInt32 baudrate; + + /// + /// how many bytes in this transfer + /// + public byte count; + + /// + /// serial data + /// + public byte[] data; // Array size 70 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SERIAL_CONTROL(this, bytes, ref offset); + } + } + + + /// + /// RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + /// + public class Msg_gps_rtk : MavlinkMessage + { + + /// + /// Time since boot of last baseline message received in ms. + /// + public UInt32 time_last_baseline_ms; + + /// + /// Identification of connected RTK receiver. + /// + public byte rtk_receiver_id; + + /// + /// GPS Week Number of last baseline + /// + public UInt16 wn; + + /// + /// GPS Time of Week of last baseline + /// + public UInt32 tow; + + /// + /// GPS-specific health report for RTK data. + /// + public byte rtk_health; + + /// + /// Rate of baseline messages being received by GPS, in HZ + /// + public byte rtk_rate; + + /// + /// Current number of sats used for RTK calculation. + /// + public byte nsats; + + /// + /// Coordinate system of baseline. 0 == ECEF, 1 == NED + /// + public byte baseline_coords_type; + + /// + /// Current baseline in ECEF x or NED north component in mm. + /// + public Int32 baseline_a_mm; + + /// + /// Current baseline in ECEF y or NED east component in mm. + /// + public Int32 baseline_b_mm; + + /// + /// Current baseline in ECEF z or NED down component in mm. + /// + public Int32 baseline_c_mm; + + /// + /// Current estimate of baseline accuracy. + /// + public UInt32 accuracy; + + /// + /// Current number of integer ambiguity hypotheses. + /// + public Int32 iar_num_hypotheses; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_RTK(this, bytes, ref offset); + } + } + + + /// + /// RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + /// + public class Msg_gps2_rtk : MavlinkMessage + { + + /// + /// Time since boot of last baseline message received in ms. + /// + public UInt32 time_last_baseline_ms; + + /// + /// Identification of connected RTK receiver. + /// + public byte rtk_receiver_id; + + /// + /// GPS Week Number of last baseline + /// + public UInt16 wn; + + /// + /// GPS Time of Week of last baseline + /// + public UInt32 tow; + + /// + /// GPS-specific health report for RTK data. + /// + public byte rtk_health; + + /// + /// Rate of baseline messages being received by GPS, in HZ + /// + public byte rtk_rate; + + /// + /// Current number of sats used for RTK calculation. + /// + public byte nsats; + + /// + /// Coordinate system of baseline. 0 == ECEF, 1 == NED + /// + public byte baseline_coords_type; + + /// + /// Current baseline in ECEF x or NED north component in mm. + /// + public Int32 baseline_a_mm; + + /// + /// Current baseline in ECEF y or NED east component in mm. + /// + public Int32 baseline_b_mm; + + /// + /// Current baseline in ECEF z or NED down component in mm. + /// + public Int32 baseline_c_mm; + + /// + /// Current estimate of baseline accuracy. + /// + public UInt32 accuracy; + + /// + /// Current number of integer ambiguity hypotheses. + /// + public Int32 iar_num_hypotheses; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS2_RTK(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units + /// + public class Msg_scaled_imu3 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (millirad /sec) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (millirad /sec) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (millirad /sec) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (milli tesla) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (milli tesla) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (milli tesla) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_IMU3(this, bytes, ref offset); + } + } + + public class Msg_data_transmission_handshake : MavlinkMessage + { + + /// + /// type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) + /// + public byte type; + + /// + /// total data size in bytes (set on ACK only) + /// + public UInt32 size; + + /// + /// Width of a matrix or image + /// + public UInt16 width; + + /// + /// Height of a matrix or image + /// + public UInt16 height; + + /// + /// number of packets beeing sent (set on ACK only) + /// + public UInt16 packets; + + /// + /// payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) + /// + public byte payload; + + /// + /// JPEG quality out of [1,100] + /// + public byte jpg_quality; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DATA_TRANSMISSION_HANDSHAKE(this, bytes, ref offset); + } + } + + public class Msg_encapsulated_data : MavlinkMessage + { + + /// + /// sequence number (starting with 0 on every transmission) + /// + public UInt16 seqnr; + + /// + /// image data bytes + /// + public byte[] data; // Array size 253 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ENCAPSULATED_DATA(this, bytes, ref offset); + } + } + + public class Msg_distance_sensor : MavlinkMessage + { + + /// + /// Time since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Minimum distance the sensor can measure in centimeters + /// + public UInt16 min_distance; + + /// + /// Maximum distance the sensor can measure in centimeters + /// + public UInt16 max_distance; + + /// + /// Current distance reading + /// + public UInt16 current_distance; + + /// + /// Type from MAV_DISTANCE_SENSOR enum. + /// + public byte type; + + /// + /// Onboard ID of the sensor + /// + public byte id; + + /// + /// Direction the sensor faces from MAV_SENSOR_ORIENTATION enum. + /// + public byte orientation; + + /// + /// Measurement covariance in centimeters, 0 for unknown / invalid readings + /// + public byte covariance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DISTANCE_SENSOR(this, bytes, ref offset); + } + } + + + /// + /// Request for terrain data and terrain status + /// + public class Msg_terrain_request : MavlinkMessage + { + + /// + /// Latitude of SW corner of first grid (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude of SW corner of first grid (in degrees *10^7) + /// + public Int32 lon; + + /// + /// Grid spacing in meters + /// + public UInt16 grid_spacing; + + /// + /// Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + /// + public UInt64 mask; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_REQUEST(this, bytes, ref offset); + } + } + + + /// + /// Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST + /// + public class Msg_terrain_data : MavlinkMessage + { + + /// + /// Latitude of SW corner of first grid (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude of SW corner of first grid (in degrees *10^7) + /// + public Int32 lon; + + /// + /// Grid spacing in meters + /// + public UInt16 grid_spacing; + + /// + /// bit within the terrain request mask + /// + public byte gridbit; + + /// + /// Terrain data in meters AMSL + /// + public Int16[] data; // Array size 16 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_DATA(this, bytes, ref offset); + } + } + + + /// + /// Request that the vehicle report terrain height at the given location. Used by GCS to check if vehicle has all terrain data needed for a mission. + /// + public class Msg_terrain_check : MavlinkMessage + { + + /// + /// Latitude (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude (degrees *10^7) + /// + public Int32 lon; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_CHECK(this, bytes, ref offset); + } + } + + + /// + /// Response from a TERRAIN_CHECK request + /// + public class Msg_terrain_report : MavlinkMessage + { + + /// + /// Latitude (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude (degrees *10^7) + /// + public Int32 lon; + + /// + /// grid spacing (zero if terrain at this location unavailable) + /// + public UInt16 spacing; + + /// + /// Terrain height in meters AMSL + /// + public float terrain_height; + + /// + /// Current vehicle height above lat/lon terrain height (meters) + /// + public float current_height; + + /// + /// Number of 4x4 terrain blocks waiting to be received or read from disk + /// + public UInt16 pending; + + /// + /// Number of 4x4 terrain blocks in memory + /// + public UInt16 loaded; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_REPORT(this, bytes, ref offset); + } + } + + + /// + /// Barometer readings for 2nd barometer + /// + public class Msg_scaled_pressure2 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Absolute pressure (hectopascal) + /// + public float press_abs; + + /// + /// Differential pressure 1 (hectopascal) + /// + public float press_diff; + + /// + /// Temperature measurement (0.01 degrees celsius) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_PRESSURE2(this, bytes, ref offset); + } + } + + + /// + /// Motion capture attitude and position + /// + public class Msg_att_pos_mocap : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + /// + public float[] q; // Array size 4 + + /// + /// X position in meters (NED) + /// + public float x; + + /// + /// Y position in meters (NED) + /// + public float y; + + /// + /// Z position in meters (NED) + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATT_POS_MOCAP(this, bytes, ref offset); + } + } + + + /// + /// Set the vehicle attitude and body angular rates. + /// + public class Msg_set_actuator_control_target : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + /// + public byte group_mlx; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + /// + public float[] controls; // Array size 8 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_ACTUATOR_CONTROL_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Set the vehicle attitude and body angular rates. + /// + public class Msg_actuator_control_target : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + /// + public byte group_mlx; + + /// + /// Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + /// + public float[] controls; // Array size 8 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ACTUATOR_CONTROL_TARGET(this, bytes, ref offset); + } + } + + + /// + /// The current system altitude. + /// + public class Msg_altitude : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + /// + public float altitude_monotonic; + + /// + /// This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. + /// + public float altitude_amsl; + + /// + /// This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + /// + public float altitude_local; + + /// + /// This is the altitude above the home position. It resets on each change of the current home position. + /// + public float altitude_relative; + + /// + /// This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + /// + public float altitude_terrain; + + /// + /// This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + /// + public float bottom_clearance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ALTITUDE(this, bytes, ref offset); + } + } + + + /// + /// The autopilot is requesting a resource (file, binary, other type of data) + /// + public class Msg_resource_request : MavlinkMessage + { + + /// + /// Request ID. This ID should be re-used when sending back URI contents + /// + public byte request_id; + + /// + /// The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + /// + public byte uri_type; + + /// + /// The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + /// + public byte[] uri; // Array size 120 + + /// + /// The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + /// + public byte transfer_type; + + /// + /// The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + /// + public byte[] storage; // Array size 120 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RESOURCE_REQUEST(this, bytes, ref offset); + } + } + + + /// + /// Barometer readings for 3rd barometer + /// + public class Msg_scaled_pressure3 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Absolute pressure (hectopascal) + /// + public float press_abs; + + /// + /// Differential pressure 1 (hectopascal) + /// + public float press_diff; + + /// + /// Temperature measurement (0.01 degrees celsius) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_PRESSURE3(this, bytes, ref offset); + } + } + + + /// + /// current motion information from a designated system + /// + public class Msg_follow_target : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt64 timestamp; + + /// + /// bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + /// + public byte est_capabilities; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// AMSL, in meters + /// + public float alt; + + /// + /// target velocity (0,0,0) for unknown + /// + public float[] vel; // Array size 3 + + /// + /// linear target acceleration (0,0,0) for unknown + /// + public float[] acc; // Array size 3 + + /// + /// (1 0 0 0 for unknown) + /// + public float[] attitude_q; // Array size 4 + + /// + /// (0 0 0 for unknown) + /// + public float[] rates; // Array size 3 + + /// + /// eph epv + /// + public float[] position_cov; // Array size 3 + + /// + /// button states or switches of a tracker device + /// + public UInt64 custom_state; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_FOLLOW_TARGET(this, bytes, ref offset); + } + } + + + /// + /// The smoothed, monotonic system state used to feed the control loops of the system. + /// + public class Msg_control_system_state : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// X acceleration in body frame + /// + public float x_acc; + + /// + /// Y acceleration in body frame + /// + public float y_acc; + + /// + /// Z acceleration in body frame + /// + public float z_acc; + + /// + /// X velocity in body frame + /// + public float x_vel; + + /// + /// Y velocity in body frame + /// + public float y_vel; + + /// + /// Z velocity in body frame + /// + public float z_vel; + + /// + /// X position in local frame + /// + public float x_pos; + + /// + /// Y position in local frame + /// + public float y_pos; + + /// + /// Z position in local frame + /// + public float z_pos; + + /// + /// Airspeed, set to -1 if unknown + /// + public float airspeed; + + /// + /// Variance of body velocity estimate + /// + public float[] vel_variance; // Array size 3 + + /// + /// Variance in local position + /// + public float[] pos_variance; // Array size 3 + + /// + /// The attitude, represented as Quaternion + /// + public float[] q; // Array size 4 + + /// + /// Angular rate in roll axis + /// + public float roll_rate; + + /// + /// Angular rate in pitch axis + /// + public float pitch_rate; + + /// + /// Angular rate in yaw axis + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CONTROL_SYSTEM_STATE(this, bytes, ref offset); + } + } + + + /// + /// Battery information + /// + public class Msg_battery_status : MavlinkMessage + { + + /// + /// Battery ID + /// + public byte id; + + /// + /// Function of the battery + /// + public byte battery_function; + + /// + /// Type (chemistry) of the battery + /// + public byte type; + + /// + /// Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. + /// + public Int16 temperature; + + /// + /// Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. + /// + public UInt16[] voltages; // Array size 10 + + /// + /// Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + /// + public Int16 current_battery; + + /// + /// Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate + /// + public Int32 current_consumed; + + /// + /// Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate + /// + public Int32 energy_consumed; + + /// + /// Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + /// + public sbyte battery_remaining; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_BATTERY_STATUS(this, bytes, ref offset); + } + } + + + /// + /// Version and capability of autopilot software + /// + public class Msg_autopilot_version : MavlinkMessage + { + + /// + /// bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) + /// + public UInt64 capabilities; + + /// + /// Firmware version number + /// + public UInt32 flight_sw_version; + + /// + /// Middleware version number + /// + public UInt32 middleware_sw_version; + + /// + /// Operating system version number + /// + public UInt32 os_sw_version; + + /// + /// HW / board version (last 8 bytes should be silicon ID, if any) + /// + public UInt32 board_version; + + /// + /// Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + /// + public byte[] flight_custom_version; // Array size 8 + + /// + /// Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + /// + public byte[] middleware_custom_version; // Array size 8 + + /// + /// Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + /// + public byte[] os_custom_version; // Array size 8 + + /// + /// ID of the board vendor + /// + public UInt16 vendor_id; + + /// + /// ID of the product + /// + public UInt16 product_id; + + /// + /// UID if provided by hardware + /// + public UInt64 uid; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_AUTOPILOT_VERSION(this, bytes, ref offset); + } + } + + + /// + /// The location of a landing area captured from a downward facing camera + /// + public class Msg_landing_target : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// The ID of the target if multiple targets are present + /// + public byte target_num; + + /// + /// MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. + /// + public byte frame; + + /// + /// X-axis angular offset (in radians) of the target from the center of the image + /// + public float angle_x; + + /// + /// Y-axis angular offset (in radians) of the target from the center of the image + /// + public float angle_y; + + /// + /// Distance to the target from the vehicle in meters + /// + public float distance; + + /// + /// Size in radians of target along x-axis + /// + public float size_x; + + /// + /// Size in radians of target along y-axis + /// + public float size_y; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LANDING_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovaton test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovaton test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user. + /// + public class Msg_estimator_status : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. + /// + public UInt16 flags; + + /// + /// Velocity innovation test ratio + /// + public float vel_ratio; + + /// + /// Horizontal position innovation test ratio + /// + public float pos_horiz_ratio; + + /// + /// Vertical position innovation test ratio + /// + public float pos_vert_ratio; + + /// + /// Magnetometer innovation test ratio + /// + public float mag_ratio; + + /// + /// Height above terrain innovation test ratio + /// + public float hagl_ratio; + + /// + /// True airspeed innovation test ratio + /// + public float tas_ratio; + + /// + /// Horizontal position 1-STD accuracy relative to the EKF local origin (m) + /// + public float pos_horiz_accuracy; + + /// + /// Vertical position 1-STD accuracy relative to the EKF local origin (m) + /// + public float pos_vert_accuracy; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ESTIMATOR_STATUS(this, bytes, ref offset); + } + } + + public class Msg_wind_cov : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Wind in X (NED) direction in m/s + /// + public float wind_x; + + /// + /// Wind in Y (NED) direction in m/s + /// + public float wind_y; + + /// + /// Wind in Z (NED) direction in m/s + /// + public float wind_z; + + /// + /// Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. + /// + public float var_horiz; + + /// + /// Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. + /// + public float var_vert; + + /// + /// AMSL altitude (m) this measurement was taken at + /// + public float wind_alt; + + /// + /// Horizontal speed 1-STD accuracy + /// + public float horiz_accuracy; + + /// + /// Vertical speed 1-STD accuracy + /// + public float vert_accuracy; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_WIND_COV(this, bytes, ref offset); + } + } + + + /// + /// Vibration levels and accelerometer clipping + /// + public class Msg_vibration : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Vibration levels on X-axis + /// + public float vibration_x; + + /// + /// Vibration levels on Y-axis + /// + public float vibration_y; + + /// + /// Vibration levels on Z-axis + /// + public float vibration_z; + + /// + /// first accelerometer clipping count + /// + public UInt32 clipping_0; + + /// + /// second accelerometer clipping count + /// + public UInt32 clipping_1; + + /// + /// third accelerometer clipping count + /// + public UInt32 clipping_2; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VIBRATION(this, bytes, ref offset); + } + } + + + /// + /// This message can be requested by sending the MAV_CMD_GET_HOME_POSITION command. The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The position the system will return to and land on. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + /// + public class Msg_home_position : MavlinkMessage + { + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84, in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + /// + /// Local X position of this position in the local coordinate frame + /// + public float x; + + /// + /// Local Y position of this position in the local coordinate frame + /// + public float y; + + /// + /// Local Z position of this position in the local coordinate frame + /// + public float z; + + /// + /// World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + /// + public float[] q; // Array size 4 + + /// + /// Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_x; + + /// + /// Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_y; + + /// + /// Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HOME_POSITION(this, bytes, ref offset); + } + } + + + /// + /// The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + /// + public class Msg_set_home_position : MavlinkMessage + { + + /// + /// System ID. + /// + public byte target_system; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84, in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + /// + /// Local X position of this position in the local coordinate frame + /// + public float x; + + /// + /// Local Y position of this position in the local coordinate frame + /// + public float y; + + /// + /// Local Z position of this position in the local coordinate frame + /// + public float z; + + /// + /// World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + /// + public float[] q; // Array size 4 + + /// + /// Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_x; + + /// + /// Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_y; + + /// + /// Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_HOME_POSITION(this, bytes, ref offset); + } + } + + + /// + /// This interface replaces DATA_STREAM + /// + public class Msg_message_interval : MavlinkMessage + { + + /// + /// The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + /// + public UInt16 message_id; + + /// + /// The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + /// + public Int32 interval_us; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MESSAGE_INTERVAL(this, bytes, ref offset); + } + } + + + /// + /// Provides state for additional features + /// + public class Msg_extended_sys_state : MavlinkMessage + { + + /// + /// The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + /// + public byte vtol_state; + + /// + /// The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + /// + public byte landed_state; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_EXTENDED_SYS_STATE(this, bytes, ref offset); + } + } + + + /// + /// The location and information of an ADSB vehicle + /// + public class Msg_adsb_vehicle : MavlinkMessage + { + + /// + /// ICAO address + /// + public UInt32 ICAO_address; + + /// + /// Latitude, expressed as degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as degrees * 1E7 + /// + public Int32 lon; + + /// + /// Type from ADSB_ALTITUDE_TYPE enum + /// + public byte altitude_type; + + /// + /// Altitude(ASL) in millimeters + /// + public Int32 altitude; + + /// + /// Course over ground in centidegrees + /// + public UInt16 heading; + + /// + /// The horizontal velocity in centimeters/second + /// + public UInt16 hor_velocity; + + /// + /// The vertical velocity in centimeters/second, positive is up + /// + public Int16 ver_velocity; + + /// + /// The callsign, 8+null + /// + public byte[] callsign; // Array size 9 + + /// + /// Type from ADSB_EMITTER_TYPE enum + /// + public byte emitter_type; + + /// + /// Time since last communication in seconds + /// + public byte tslc; + + /// + /// Flags to indicate various statuses including valid data fields + /// + public UInt16 flags; + + /// + /// Squawk code + /// + public UInt16 squawk; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ADSB_VEHICLE(this, bytes, ref offset); + } + } + + + /// + /// Message implementing parts of the V2 payload specs in V1 frames for transitional support. + /// + public class Msg_v2_extension : MavlinkMessage + { + + /// + /// Network ID (0 for broadcast) + /// + public byte target_network; + + /// + /// System ID (0 for broadcast) + /// + public byte target_system; + + /// + /// Component ID (0 for broadcast) + /// + public byte target_component; + + /// + /// A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + /// + public UInt16 message_type; + + /// + /// Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + /// + public byte[] payload; // Array size 249 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_V2_EXTENSION(this, bytes, ref offset); + } + } + + + /// + /// Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + /// + public class Msg_memory_vect : MavlinkMessage + { + + /// + /// Starting address of the debug variables + /// + public UInt16 address; + + /// + /// Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + /// + public byte ver; + + /// + /// Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + /// + public byte type; + + /// + /// Memory contents at specified address + /// + public sbyte[] value; // Array size 32 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MEMORY_VECT(this, bytes, ref offset); + } + } + + public class Msg_debug_vect : MavlinkMessage + { + public byte[] name; // Array size 10 + + /// + /// Timestamp + /// + public UInt64 time_usec; + public float x; + public float y; + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DEBUG_VECT(this, bytes, ref offset); + } + } + + + /// + /// Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + /// + public class Msg_named_value_float : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Name of the debug variable + /// + public byte[] name; // Array size 10 + + /// + /// Floating point value + /// + public float value; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_NAMED_VALUE_FLOAT(this, bytes, ref offset); + } + } + + + /// + /// Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + /// + public class Msg_named_value_int : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Name of the debug variable + /// + public byte[] name; // Array size 10 + + /// + /// Signed integer value + /// + public Int32 value; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_NAMED_VALUE_INT(this, bytes, ref offset); + } + } + + + /// + /// Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). + /// + public class Msg_statustext : MavlinkMessage + { + + /// + /// Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. + /// + public byte severity; + + /// + /// Status text message, without null termination character + /// + public byte[] text; // Array size 50 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_STATUSTEXT(this, bytes, ref offset); + } + } + + + /// + /// Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. + /// + public class Msg_debug : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// index of debug variable + /// + public byte ind; + + /// + /// DEBUG value + /// + public float value; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DEBUG(this, bytes, ref offset); + } + } + +} + diff --git a/oroca_bldc_gui/Serial/Serial/oroca_codec.generated.cs b/oroca_bldc_gui/Serial/Serial/oroca_codec.generated.cs new file mode 100644 index 0000000..ce2e705 --- /dev/null +++ b/oroca_bldc_gui/Serial/Serial/oroca_codec.generated.cs @@ -0,0 +1,3812 @@ + + +/* +MAVLink protocol implementation (auto-generated by mavgen.py) + +Note: this file has been auto-generated. DO NOT EDIT +*/ + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace MavLink +{ + public static class MavlinkSettings + { + public const string WireProtocolVersion = "1.0"; + public const byte ProtocolMarker = 0xfe; + public const bool CrcExtra = true; + public const bool IsLittleEndian = true; + } + + public delegate MavlinkMessage MavlinkPacketDeserializeFunc(byte[] bytes, int offset); + + //returns the message ID, offset is advanced by the number of bytes used to serialize + public delegate int MavlinkPacketSerializeFunc(byte[] bytes, ref int offset, object mavlinkPacket); + + public class MavPacketInfo + { + public MavlinkPacketDeserializeFunc Deserializer; + public int [] OrderMap; + public byte CrcExtra; + + public MavPacketInfo(MavlinkPacketDeserializeFunc deserializer, byte crcExtra) + { + this.Deserializer = deserializer; + this.CrcExtra = crcExtra; + } + } + + public static class MavLinkSerializer + { + public static void SetDataIsLittleEndian(bool isLittle) + { + bitconverter.SetDataIsLittleEndian(isLittle); + } + + private static readonly FrameworkBitConverter bitconverter = new FrameworkBitConverter(); + + public static Dictionary Lookup = new Dictionary + { + {220, new MavPacketInfo(Deserialize_SET_VELOCITY, 100)}, + {0, new MavPacketInfo(Deserialize_HEARTBEAT, 50)}, + {1, new MavPacketInfo(Deserialize_SYS_STATUS, 124)}, + {2, new MavPacketInfo(Deserialize_SYSTEM_TIME, 137)}, + {4, new MavPacketInfo(Deserialize_PING, 237)}, + {5, new MavPacketInfo(Deserialize_CHANGE_OPERATOR_CONTROL, 217)}, + {6, new MavPacketInfo(Deserialize_CHANGE_OPERATOR_CONTROL_ACK, 104)}, + {7, new MavPacketInfo(Deserialize_AUTH_KEY, 119)}, + {11, new MavPacketInfo(Deserialize_SET_MODE, 89)}, + {20, new MavPacketInfo(Deserialize_PARAM_REQUEST_READ, 214)}, + {21, new MavPacketInfo(Deserialize_PARAM_REQUEST_LIST, 159)}, + {22, new MavPacketInfo(Deserialize_PARAM_VALUE, 220)}, + {23, new MavPacketInfo(Deserialize_PARAM_SET, 168)}, + {24, new MavPacketInfo(Deserialize_GPS_RAW_INT, 24)}, + {25, new MavPacketInfo(Deserialize_GPS_STATUS, 23)}, + {26, new MavPacketInfo(Deserialize_SCALED_IMU, 170)}, + {27, new MavPacketInfo(Deserialize_RAW_IMU, 144)}, + {28, new MavPacketInfo(Deserialize_RAW_PRESSURE, 67)}, + {29, new MavPacketInfo(Deserialize_SCALED_PRESSURE, 115)}, + {30, new MavPacketInfo(Deserialize_ATTITUDE, 39)}, + {31, new MavPacketInfo(Deserialize_ATTITUDE_QUATERNION, 246)}, + {32, new MavPacketInfo(Deserialize_LOCAL_POSITION_NED, 185)}, + {33, new MavPacketInfo(Deserialize_GLOBAL_POSITION_INT, 104)}, + {34, new MavPacketInfo(Deserialize_RC_CHANNELS_SCALED, 237)}, + {35, new MavPacketInfo(Deserialize_RC_CHANNELS_RAW, 244)}, + {36, new MavPacketInfo(Deserialize_SERVO_OUTPUT_RAW, 222)}, + {37, new MavPacketInfo(Deserialize_MISSION_REQUEST_PARTIAL_LIST, 212)}, + {38, new MavPacketInfo(Deserialize_MISSION_WRITE_PARTIAL_LIST, 9)}, + {39, new MavPacketInfo(Deserialize_MISSION_ITEM, 254)}, + {40, new MavPacketInfo(Deserialize_MISSION_REQUEST, 230)}, + {41, new MavPacketInfo(Deserialize_MISSION_SET_CURRENT, 28)}, + {42, new MavPacketInfo(Deserialize_MISSION_CURRENT, 28)}, + {43, new MavPacketInfo(Deserialize_MISSION_REQUEST_LIST, 132)}, + {44, new MavPacketInfo(Deserialize_MISSION_COUNT, 221)}, + {45, new MavPacketInfo(Deserialize_MISSION_CLEAR_ALL, 232)}, + {46, new MavPacketInfo(Deserialize_MISSION_ITEM_REACHED, 11)}, + {47, new MavPacketInfo(Deserialize_MISSION_ACK, 153)}, + {48, new MavPacketInfo(Deserialize_SET_GPS_GLOBAL_ORIGIN, 41)}, + {49, new MavPacketInfo(Deserialize_GPS_GLOBAL_ORIGIN, 39)}, + {50, new MavPacketInfo(Deserialize_PARAM_MAP_RC, 78)}, + {51, new MavPacketInfo(Deserialize_MISSION_REQUEST_INT, 196)}, + {54, new MavPacketInfo(Deserialize_SAFETY_SET_ALLOWED_AREA, 15)}, + {55, new MavPacketInfo(Deserialize_SAFETY_ALLOWED_AREA, 3)}, + {61, new MavPacketInfo(Deserialize_ATTITUDE_QUATERNION_COV, 153)}, + {62, new MavPacketInfo(Deserialize_NAV_CONTROLLER_OUTPUT, 183)}, + {63, new MavPacketInfo(Deserialize_GLOBAL_POSITION_INT_COV, 51)}, + {64, new MavPacketInfo(Deserialize_LOCAL_POSITION_NED_COV, 59)}, + {65, new MavPacketInfo(Deserialize_RC_CHANNELS, 118)}, + {66, new MavPacketInfo(Deserialize_REQUEST_DATA_STREAM, 148)}, + {67, new MavPacketInfo(Deserialize_DATA_STREAM, 21)}, + {69, new MavPacketInfo(Deserialize_MANUAL_CONTROL, 243)}, + {70, new MavPacketInfo(Deserialize_RC_CHANNELS_OVERRIDE, 124)}, + {73, new MavPacketInfo(Deserialize_MISSION_ITEM_INT, 38)}, + {74, new MavPacketInfo(Deserialize_VFR_HUD, 20)}, + {75, new MavPacketInfo(Deserialize_COMMAND_INT, 158)}, + {76, new MavPacketInfo(Deserialize_COMMAND_LONG, 152)}, + {77, new MavPacketInfo(Deserialize_COMMAND_ACK, 143)}, + {81, new MavPacketInfo(Deserialize_MANUAL_SETPOINT, 106)}, + {82, new MavPacketInfo(Deserialize_SET_ATTITUDE_TARGET, 49)}, + {83, new MavPacketInfo(Deserialize_ATTITUDE_TARGET, 22)}, + {84, new MavPacketInfo(Deserialize_SET_POSITION_TARGET_LOCAL_NED, 143)}, + {85, new MavPacketInfo(Deserialize_POSITION_TARGET_LOCAL_NED, 140)}, + {86, new MavPacketInfo(Deserialize_SET_POSITION_TARGET_GLOBAL_INT, 5)}, + {87, new MavPacketInfo(Deserialize_POSITION_TARGET_GLOBAL_INT, 150)}, + {89, new MavPacketInfo(Deserialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, 231)}, + {90, new MavPacketInfo(Deserialize_HIL_STATE, 183)}, + {91, new MavPacketInfo(Deserialize_HIL_CONTROLS, 63)}, + {92, new MavPacketInfo(Deserialize_HIL_RC_INPUTS_RAW, 54)}, + {100, new MavPacketInfo(Deserialize_OPTICAL_FLOW, 175)}, + {101, new MavPacketInfo(Deserialize_GLOBAL_VISION_POSITION_ESTIMATE, 102)}, + {102, new MavPacketInfo(Deserialize_VISION_POSITION_ESTIMATE, 158)}, + {103, new MavPacketInfo(Deserialize_VISION_SPEED_ESTIMATE, 208)}, + {104, new MavPacketInfo(Deserialize_VICON_POSITION_ESTIMATE, 56)}, + {105, new MavPacketInfo(Deserialize_HIGHRES_IMU, 93)}, + {106, new MavPacketInfo(Deserialize_OPTICAL_FLOW_RAD, 138)}, + {107, new MavPacketInfo(Deserialize_HIL_SENSOR, 108)}, + {108, new MavPacketInfo(Deserialize_SIM_STATE, 32)}, + {109, new MavPacketInfo(Deserialize_RADIO_STATUS, 185)}, + {110, new MavPacketInfo(Deserialize_FILE_TRANSFER_PROTOCOL, 84)}, + {111, new MavPacketInfo(Deserialize_TIMESYNC, 34)}, + {112, new MavPacketInfo(Deserialize_CAMERA_TRIGGER, 174)}, + {113, new MavPacketInfo(Deserialize_HIL_GPS, 124)}, + {114, new MavPacketInfo(Deserialize_HIL_OPTICAL_FLOW, 237)}, + {115, new MavPacketInfo(Deserialize_HIL_STATE_QUATERNION, 4)}, + {116, new MavPacketInfo(Deserialize_SCALED_IMU2, 76)}, + {117, new MavPacketInfo(Deserialize_LOG_REQUEST_LIST, 128)}, + {118, new MavPacketInfo(Deserialize_LOG_ENTRY, 56)}, + {119, new MavPacketInfo(Deserialize_LOG_REQUEST_DATA, 116)}, + {120, new MavPacketInfo(Deserialize_LOG_DATA, 134)}, + {121, new MavPacketInfo(Deserialize_LOG_ERASE, 237)}, + {122, new MavPacketInfo(Deserialize_LOG_REQUEST_END, 203)}, + {123, new MavPacketInfo(Deserialize_GPS_INJECT_DATA, 250)}, + {124, new MavPacketInfo(Deserialize_GPS2_RAW, 87)}, + {125, new MavPacketInfo(Deserialize_POWER_STATUS, 203)}, + {126, new MavPacketInfo(Deserialize_SERIAL_CONTROL, 220)}, + {127, new MavPacketInfo(Deserialize_GPS_RTK, 25)}, + {128, new MavPacketInfo(Deserialize_GPS2_RTK, 226)}, + {129, new MavPacketInfo(Deserialize_SCALED_IMU3, 46)}, + {130, new MavPacketInfo(Deserialize_DATA_TRANSMISSION_HANDSHAKE, 29)}, + {131, new MavPacketInfo(Deserialize_ENCAPSULATED_DATA, 223)}, + {132, new MavPacketInfo(Deserialize_DISTANCE_SENSOR, 85)}, + {133, new MavPacketInfo(Deserialize_TERRAIN_REQUEST, 6)}, + {134, new MavPacketInfo(Deserialize_TERRAIN_DATA, 229)}, + {135, new MavPacketInfo(Deserialize_TERRAIN_CHECK, 203)}, + {136, new MavPacketInfo(Deserialize_TERRAIN_REPORT, 1)}, + {137, new MavPacketInfo(Deserialize_SCALED_PRESSURE2, 195)}, + {138, new MavPacketInfo(Deserialize_ATT_POS_MOCAP, 109)}, + {139, new MavPacketInfo(Deserialize_SET_ACTUATOR_CONTROL_TARGET, 168)}, + {140, new MavPacketInfo(Deserialize_ACTUATOR_CONTROL_TARGET, 181)}, + {141, new MavPacketInfo(Deserialize_ALTITUDE, 47)}, + {142, new MavPacketInfo(Deserialize_RESOURCE_REQUEST, 72)}, + {143, new MavPacketInfo(Deserialize_SCALED_PRESSURE3, 131)}, + {144, new MavPacketInfo(Deserialize_FOLLOW_TARGET, 127)}, + {146, new MavPacketInfo(Deserialize_CONTROL_SYSTEM_STATE, 103)}, + {147, new MavPacketInfo(Deserialize_BATTERY_STATUS, 154)}, + {148, new MavPacketInfo(Deserialize_AUTOPILOT_VERSION, 178)}, + {149, new MavPacketInfo(Deserialize_LANDING_TARGET, 200)}, + {230, new MavPacketInfo(Deserialize_ESTIMATOR_STATUS, 163)}, + {231, new MavPacketInfo(Deserialize_WIND_COV, 105)}, + {241, new MavPacketInfo(Deserialize_VIBRATION, 90)}, + {242, new MavPacketInfo(Deserialize_HOME_POSITION, 104)}, + {243, new MavPacketInfo(Deserialize_SET_HOME_POSITION, 85)}, + {244, new MavPacketInfo(Deserialize_MESSAGE_INTERVAL, 95)}, + {245, new MavPacketInfo(Deserialize_EXTENDED_SYS_STATE, 130)}, + {246, new MavPacketInfo(Deserialize_ADSB_VEHICLE, 184)}, + {248, new MavPacketInfo(Deserialize_V2_EXTENSION, 8)}, + {249, new MavPacketInfo(Deserialize_MEMORY_VECT, 204)}, + {250, new MavPacketInfo(Deserialize_DEBUG_VECT, 49)}, + {251, new MavPacketInfo(Deserialize_NAMED_VALUE_FLOAT, 170)}, + {252, new MavPacketInfo(Deserialize_NAMED_VALUE_INT, 44)}, + {253, new MavPacketInfo(Deserialize_STATUSTEXT, 83)}, + {254, new MavPacketInfo(Deserialize_DEBUG, 46)}, + }; + + internal static MavlinkMessage Deserialize_SET_VELOCITY(byte[] bytes, int offset) + { + return new Msg_set_velocity + { + ref_angular_velocity = bitconverter.ToUInt16(bytes, offset + 0), + }; + } + + internal static MavlinkMessage Deserialize_HEARTBEAT(byte[] bytes, int offset) + { + return new Msg_heartbeat + { + custom_mode = bitconverter.ToUInt32(bytes, offset + 0), + type = bytes[offset + 4], + autopilot = bytes[offset + 5], + base_mode = bytes[offset + 6], + system_status = bytes[offset + 7], + mavlink_version = bytes[offset + 8], + }; + } + + internal static MavlinkMessage Deserialize_SYS_STATUS(byte[] bytes, int offset) + { + return new Msg_sys_status + { + onboard_control_sensors_present = bitconverter.ToUInt32(bytes, offset + 0), + onboard_control_sensors_enabled = bitconverter.ToUInt32(bytes, offset + 4), + onboard_control_sensors_health = bitconverter.ToUInt32(bytes, offset + 8), + load = bitconverter.ToUInt16(bytes, offset + 12), + voltage_battery = bitconverter.ToUInt16(bytes, offset + 14), + current_battery = bitconverter.ToInt16(bytes, offset + 16), + drop_rate_comm = bitconverter.ToUInt16(bytes, offset + 18), + errors_comm = bitconverter.ToUInt16(bytes, offset + 20), + errors_count1 = bitconverter.ToUInt16(bytes, offset + 22), + errors_count2 = bitconverter.ToUInt16(bytes, offset + 24), + errors_count3 = bitconverter.ToUInt16(bytes, offset + 26), + errors_count4 = bitconverter.ToUInt16(bytes, offset + 28), + battery_remaining = bitconverter.ToInt8(bytes, offset + 30), + }; + } + + internal static MavlinkMessage Deserialize_SYSTEM_TIME(byte[] bytes, int offset) + { + return new Msg_system_time + { + time_unix_usec = bitconverter.ToUInt64(bytes, offset + 0), + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_PING(byte[] bytes, int offset) + { + return new Msg_ping + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + seq = bitconverter.ToUInt32(bytes, offset + 8), + target_system = bytes[offset + 12], + target_component = bytes[offset + 13], + }; + } + + internal static MavlinkMessage Deserialize_CHANGE_OPERATOR_CONTROL(byte[] bytes, int offset) + { + return new Msg_change_operator_control + { + target_system = bytes[offset + 0], + control_request = bytes[offset + 1], + version = bytes[offset + 2], + passkey = ByteArrayUtil.ToChar(bytes, offset + 3, 25), + }; + } + + internal static MavlinkMessage Deserialize_CHANGE_OPERATOR_CONTROL_ACK(byte[] bytes, int offset) + { + return new Msg_change_operator_control_ack + { + gcs_system_id = bytes[offset + 0], + control_request = bytes[offset + 1], + ack = bytes[offset + 2], + }; + } + + internal static MavlinkMessage Deserialize_AUTH_KEY(byte[] bytes, int offset) + { + return new Msg_auth_key + { + key = ByteArrayUtil.ToChar(bytes, offset + 0, 32), + }; + } + + internal static MavlinkMessage Deserialize_SET_MODE(byte[] bytes, int offset) + { + return new Msg_set_mode + { + custom_mode = bitconverter.ToUInt32(bytes, offset + 0), + target_system = bytes[offset + 4], + base_mode = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_PARAM_REQUEST_READ(byte[] bytes, int offset) + { + return new Msg_param_request_read + { + param_index = bitconverter.ToInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + param_id = ByteArrayUtil.ToChar(bytes, offset + 4, 16), + }; + } + + internal static MavlinkMessage Deserialize_PARAM_REQUEST_LIST(byte[] bytes, int offset) + { + return new Msg_param_request_list + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_PARAM_VALUE(byte[] bytes, int offset) + { + return new Msg_param_value + { + param_value = bitconverter.ToSingle(bytes, offset + 0), + param_count = bitconverter.ToUInt16(bytes, offset + 4), + param_index = bitconverter.ToUInt16(bytes, offset + 6), + param_id = ByteArrayUtil.ToChar(bytes, offset + 8, 16), + param_type = bytes[offset + 24], + }; + } + + internal static MavlinkMessage Deserialize_PARAM_SET(byte[] bytes, int offset) + { + return new Msg_param_set + { + param_value = bitconverter.ToSingle(bytes, offset + 0), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + param_id = ByteArrayUtil.ToChar(bytes, offset + 6, 16), + param_type = bytes[offset + 22], + }; + } + + internal static MavlinkMessage Deserialize_GPS_RAW_INT(byte[] bytes, int offset) + { + return new Msg_gps_raw_int + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + alt = bitconverter.ToInt32(bytes, offset + 16), + eph = bitconverter.ToUInt16(bytes, offset + 20), + epv = bitconverter.ToUInt16(bytes, offset + 22), + vel = bitconverter.ToUInt16(bytes, offset + 24), + cog = bitconverter.ToUInt16(bytes, offset + 26), + fix_type = bytes[offset + 28], + satellites_visible = bytes[offset + 29], + }; + } + + internal static MavlinkMessage Deserialize_GPS_STATUS(byte[] bytes, int offset) + { + return new Msg_gps_status + { + satellites_visible = bytes[offset + 0], + satellite_prn = ByteArrayUtil.ToUInt8(bytes, offset + 1, 20), + satellite_used = ByteArrayUtil.ToUInt8(bytes, offset + 21, 20), + satellite_elevation = ByteArrayUtil.ToUInt8(bytes, offset + 41, 20), + satellite_azimuth = ByteArrayUtil.ToUInt8(bytes, offset + 61, 20), + satellite_snr = ByteArrayUtil.ToUInt8(bytes, offset + 81, 20), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_IMU(byte[] bytes, int offset) + { + return new Msg_scaled_imu + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 4), + yacc = bitconverter.ToInt16(bytes, offset + 6), + zacc = bitconverter.ToInt16(bytes, offset + 8), + xgyro = bitconverter.ToInt16(bytes, offset + 10), + ygyro = bitconverter.ToInt16(bytes, offset + 12), + zgyro = bitconverter.ToInt16(bytes, offset + 14), + xmag = bitconverter.ToInt16(bytes, offset + 16), + ymag = bitconverter.ToInt16(bytes, offset + 18), + zmag = bitconverter.ToInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_RAW_IMU(byte[] bytes, int offset) + { + return new Msg_raw_imu + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 8), + yacc = bitconverter.ToInt16(bytes, offset + 10), + zacc = bitconverter.ToInt16(bytes, offset + 12), + xgyro = bitconverter.ToInt16(bytes, offset + 14), + ygyro = bitconverter.ToInt16(bytes, offset + 16), + zgyro = bitconverter.ToInt16(bytes, offset + 18), + xmag = bitconverter.ToInt16(bytes, offset + 20), + ymag = bitconverter.ToInt16(bytes, offset + 22), + zmag = bitconverter.ToInt16(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_RAW_PRESSURE(byte[] bytes, int offset) + { + return new Msg_raw_pressure + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + press_abs = bitconverter.ToInt16(bytes, offset + 8), + press_diff1 = bitconverter.ToInt16(bytes, offset + 10), + press_diff2 = bitconverter.ToInt16(bytes, offset + 12), + temperature = bitconverter.ToInt16(bytes, offset + 14), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_PRESSURE(byte[] bytes, int offset) + { + return new Msg_scaled_pressure + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + press_abs = bitconverter.ToSingle(bytes, offset + 4), + press_diff = bitconverter.ToSingle(bytes, offset + 8), + temperature = bitconverter.ToInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE(byte[] bytes, int offset) + { + return new Msg_attitude + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + roll = bitconverter.ToSingle(bytes, offset + 4), + pitch = bitconverter.ToSingle(bytes, offset + 8), + yaw = bitconverter.ToSingle(bytes, offset + 12), + rollspeed = bitconverter.ToSingle(bytes, offset + 16), + pitchspeed = bitconverter.ToSingle(bytes, offset + 20), + yawspeed = bitconverter.ToSingle(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE_QUATERNION(byte[] bytes, int offset) + { + return new Msg_attitude_quaternion + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q1 = bitconverter.ToSingle(bytes, offset + 4), + q2 = bitconverter.ToSingle(bytes, offset + 8), + q3 = bitconverter.ToSingle(bytes, offset + 12), + q4 = bitconverter.ToSingle(bytes, offset + 16), + rollspeed = bitconverter.ToSingle(bytes, offset + 20), + pitchspeed = bitconverter.ToSingle(bytes, offset + 24), + yawspeed = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_LOCAL_POSITION_NED(byte[] bytes, int offset) + { + return new Msg_local_position_ned + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_GLOBAL_POSITION_INT(byte[] bytes, int offset) + { + return new Msg_global_position_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 4), + lon = bitconverter.ToInt32(bytes, offset + 8), + alt = bitconverter.ToInt32(bytes, offset + 12), + relative_alt = bitconverter.ToInt32(bytes, offset + 16), + vx = bitconverter.ToInt16(bytes, offset + 20), + vy = bitconverter.ToInt16(bytes, offset + 22), + vz = bitconverter.ToInt16(bytes, offset + 24), + hdg = bitconverter.ToUInt16(bytes, offset + 26), + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS_SCALED(byte[] bytes, int offset) + { + return new Msg_rc_channels_scaled + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + chan1_scaled = bitconverter.ToInt16(bytes, offset + 4), + chan2_scaled = bitconverter.ToInt16(bytes, offset + 6), + chan3_scaled = bitconverter.ToInt16(bytes, offset + 8), + chan4_scaled = bitconverter.ToInt16(bytes, offset + 10), + chan5_scaled = bitconverter.ToInt16(bytes, offset + 12), + chan6_scaled = bitconverter.ToInt16(bytes, offset + 14), + chan7_scaled = bitconverter.ToInt16(bytes, offset + 16), + chan8_scaled = bitconverter.ToInt16(bytes, offset + 18), + port = bytes[offset + 20], + rssi = bytes[offset + 21], + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS_RAW(byte[] bytes, int offset) + { + return new Msg_rc_channels_raw + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + chan1_raw = bitconverter.ToUInt16(bytes, offset + 4), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 6), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 14), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 16), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 18), + port = bytes[offset + 20], + rssi = bytes[offset + 21], + }; + } + + internal static MavlinkMessage Deserialize_SERVO_OUTPUT_RAW(byte[] bytes, int offset) + { + return new Msg_servo_output_raw + { + time_usec = bitconverter.ToUInt32(bytes, offset + 0), + servo1_raw = bitconverter.ToUInt16(bytes, offset + 4), + servo2_raw = bitconverter.ToUInt16(bytes, offset + 6), + servo3_raw = bitconverter.ToUInt16(bytes, offset + 8), + servo4_raw = bitconverter.ToUInt16(bytes, offset + 10), + servo5_raw = bitconverter.ToUInt16(bytes, offset + 12), + servo6_raw = bitconverter.ToUInt16(bytes, offset + 14), + servo7_raw = bitconverter.ToUInt16(bytes, offset + 16), + servo8_raw = bitconverter.ToUInt16(bytes, offset + 18), + port = bytes[offset + 20], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST_PARTIAL_LIST(byte[] bytes, int offset) + { + return new Msg_mission_request_partial_list + { + start_index = bitconverter.ToInt16(bytes, offset + 0), + end_index = bitconverter.ToInt16(bytes, offset + 2), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_WRITE_PARTIAL_LIST(byte[] bytes, int offset) + { + return new Msg_mission_write_partial_list + { + start_index = bitconverter.ToInt16(bytes, offset + 0), + end_index = bitconverter.ToInt16(bytes, offset + 2), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ITEM(byte[] bytes, int offset) + { + return new Msg_mission_item + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + x = bitconverter.ToSingle(bytes, offset + 16), + y = bitconverter.ToSingle(bytes, offset + 20), + z = bitconverter.ToSingle(bytes, offset + 24), + seq = bitconverter.ToUInt16(bytes, offset + 28), + command = bitconverter.ToUInt16(bytes, offset + 30), + target_system = bytes[offset + 32], + target_component = bytes[offset + 33], + frame = bytes[offset + 34], + current = bytes[offset + 35], + autocontinue = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST(byte[] bytes, int offset) + { + return new Msg_mission_request + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_SET_CURRENT(byte[] bytes, int offset) + { + return new Msg_mission_set_current + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_CURRENT(byte[] bytes, int offset) + { + return new Msg_mission_current + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST_LIST(byte[] bytes, int offset) + { + return new Msg_mission_request_list + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_COUNT(byte[] bytes, int offset) + { + return new Msg_mission_count + { + count = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_CLEAR_ALL(byte[] bytes, int offset) + { + return new Msg_mission_clear_all + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ITEM_REACHED(byte[] bytes, int offset) + { + return new Msg_mission_item_reached + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ACK(byte[] bytes, int offset) + { + return new Msg_mission_ack + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + type = bytes[offset + 2], + }; + } + + internal static MavlinkMessage Deserialize_SET_GPS_GLOBAL_ORIGIN(byte[] bytes, int offset) + { + return new Msg_set_gps_global_origin + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + target_system = bytes[offset + 12], + }; + } + + internal static MavlinkMessage Deserialize_GPS_GLOBAL_ORIGIN(byte[] bytes, int offset) + { + return new Msg_gps_global_origin + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_PARAM_MAP_RC(byte[] bytes, int offset) + { + return new Msg_param_map_rc + { + param_value0 = bitconverter.ToSingle(bytes, offset + 0), + scale = bitconverter.ToSingle(bytes, offset + 4), + param_value_min = bitconverter.ToSingle(bytes, offset + 8), + param_value_max = bitconverter.ToSingle(bytes, offset + 12), + param_index = bitconverter.ToInt16(bytes, offset + 16), + target_system = bytes[offset + 18], + target_component = bytes[offset + 19], + param_id = ByteArrayUtil.ToChar(bytes, offset + 20, 16), + parameter_rc_channel_index = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST_INT(byte[] bytes, int offset) + { + return new Msg_mission_request_int + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_SAFETY_SET_ALLOWED_AREA(byte[] bytes, int offset) + { + return new Msg_safety_set_allowed_area + { + p1x = bitconverter.ToSingle(bytes, offset + 0), + p1y = bitconverter.ToSingle(bytes, offset + 4), + p1z = bitconverter.ToSingle(bytes, offset + 8), + p2x = bitconverter.ToSingle(bytes, offset + 12), + p2y = bitconverter.ToSingle(bytes, offset + 16), + p2z = bitconverter.ToSingle(bytes, offset + 20), + target_system = bytes[offset + 24], + target_component = bytes[offset + 25], + frame = bytes[offset + 26], + }; + } + + internal static MavlinkMessage Deserialize_SAFETY_ALLOWED_AREA(byte[] bytes, int offset) + { + return new Msg_safety_allowed_area + { + p1x = bitconverter.ToSingle(bytes, offset + 0), + p1y = bitconverter.ToSingle(bytes, offset + 4), + p1z = bitconverter.ToSingle(bytes, offset + 8), + p2x = bitconverter.ToSingle(bytes, offset + 12), + p2y = bitconverter.ToSingle(bytes, offset + 16), + p2z = bitconverter.ToSingle(bytes, offset + 20), + frame = bytes[offset + 24], + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE_QUATERNION_COV(byte[] bytes, int offset) + { + return new Msg_attitude_quaternion_cov + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 4, 4), + rollspeed = bitconverter.ToSingle(bytes, offset + 20), + pitchspeed = bitconverter.ToSingle(bytes, offset + 24), + yawspeed = bitconverter.ToSingle(bytes, offset + 28), + covariance = ByteArrayUtil.ToSingle(bytes, offset + 32, 9), + }; + } + + internal static MavlinkMessage Deserialize_NAV_CONTROLLER_OUTPUT(byte[] bytes, int offset) + { + return new Msg_nav_controller_output + { + nav_roll = bitconverter.ToSingle(bytes, offset + 0), + nav_pitch = bitconverter.ToSingle(bytes, offset + 4), + alt_error = bitconverter.ToSingle(bytes, offset + 8), + aspd_error = bitconverter.ToSingle(bytes, offset + 12), + xtrack_error = bitconverter.ToSingle(bytes, offset + 16), + nav_bearing = bitconverter.ToInt16(bytes, offset + 20), + target_bearing = bitconverter.ToInt16(bytes, offset + 22), + wp_dist = bitconverter.ToUInt16(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_GLOBAL_POSITION_INT_COV(byte[] bytes, int offset) + { + return new Msg_global_position_int_cov + { + time_utc = bitconverter.ToUInt64(bytes, offset + 0), + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 8), + lat = bitconverter.ToInt32(bytes, offset + 12), + lon = bitconverter.ToInt32(bytes, offset + 16), + alt = bitconverter.ToInt32(bytes, offset + 20), + relative_alt = bitconverter.ToInt32(bytes, offset + 24), + vx = bitconverter.ToSingle(bytes, offset + 28), + vy = bitconverter.ToSingle(bytes, offset + 32), + vz = bitconverter.ToSingle(bytes, offset + 36), + covariance = ByteArrayUtil.ToSingle(bytes, offset + 40, 36), + estimator_type = bytes[offset + 184], + }; + } + + internal static MavlinkMessage Deserialize_LOCAL_POSITION_NED_COV(byte[] bytes, int offset) + { + return new Msg_local_position_ned_cov + { + time_utc = bitconverter.ToUInt64(bytes, offset + 0), + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 8), + x = bitconverter.ToSingle(bytes, offset + 12), + y = bitconverter.ToSingle(bytes, offset + 16), + z = bitconverter.ToSingle(bytes, offset + 20), + vx = bitconverter.ToSingle(bytes, offset + 24), + vy = bitconverter.ToSingle(bytes, offset + 28), + vz = bitconverter.ToSingle(bytes, offset + 32), + ax = bitconverter.ToSingle(bytes, offset + 36), + ay = bitconverter.ToSingle(bytes, offset + 40), + az = bitconverter.ToSingle(bytes, offset + 44), + covariance = ByteArrayUtil.ToSingle(bytes, offset + 48, 45), + estimator_type = bytes[offset + 228], + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS(byte[] bytes, int offset) + { + return new Msg_rc_channels + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + chan1_raw = bitconverter.ToUInt16(bytes, offset + 4), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 6), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 14), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 16), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 18), + chan9_raw = bitconverter.ToUInt16(bytes, offset + 20), + chan10_raw = bitconverter.ToUInt16(bytes, offset + 22), + chan11_raw = bitconverter.ToUInt16(bytes, offset + 24), + chan12_raw = bitconverter.ToUInt16(bytes, offset + 26), + chan13_raw = bitconverter.ToUInt16(bytes, offset + 28), + chan14_raw = bitconverter.ToUInt16(bytes, offset + 30), + chan15_raw = bitconverter.ToUInt16(bytes, offset + 32), + chan16_raw = bitconverter.ToUInt16(bytes, offset + 34), + chan17_raw = bitconverter.ToUInt16(bytes, offset + 36), + chan18_raw = bitconverter.ToUInt16(bytes, offset + 38), + chancount = bytes[offset + 40], + rssi = bytes[offset + 41], + }; + } + + internal static MavlinkMessage Deserialize_REQUEST_DATA_STREAM(byte[] bytes, int offset) + { + return new Msg_request_data_stream + { + req_message_rate = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + req_stream_id = bytes[offset + 4], + start_stop = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_DATA_STREAM(byte[] bytes, int offset) + { + return new Msg_data_stream + { + message_rate = bitconverter.ToUInt16(bytes, offset + 0), + stream_id = bytes[offset + 2], + on_off = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MANUAL_CONTROL(byte[] bytes, int offset) + { + return new Msg_manual_control + { + x = bitconverter.ToInt16(bytes, offset + 0), + y = bitconverter.ToInt16(bytes, offset + 2), + z = bitconverter.ToInt16(bytes, offset + 4), + r = bitconverter.ToInt16(bytes, offset + 6), + buttons = bitconverter.ToUInt16(bytes, offset + 8), + target = bytes[offset + 10], + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS_OVERRIDE(byte[] bytes, int offset) + { + return new Msg_rc_channels_override + { + chan1_raw = bitconverter.ToUInt16(bytes, offset + 0), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 2), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 4), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 6), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 14), + target_system = bytes[offset + 16], + target_component = bytes[offset + 17], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ITEM_INT(byte[] bytes, int offset) + { + return new Msg_mission_item_int + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + x = bitconverter.ToInt32(bytes, offset + 16), + y = bitconverter.ToInt32(bytes, offset + 20), + z = bitconverter.ToSingle(bytes, offset + 24), + seq = bitconverter.ToUInt16(bytes, offset + 28), + command = bitconverter.ToUInt16(bytes, offset + 30), + target_system = bytes[offset + 32], + target_component = bytes[offset + 33], + frame = bytes[offset + 34], + current = bytes[offset + 35], + autocontinue = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_VFR_HUD(byte[] bytes, int offset) + { + return new Msg_vfr_hud + { + airspeed = bitconverter.ToSingle(bytes, offset + 0), + groundspeed = bitconverter.ToSingle(bytes, offset + 4), + alt = bitconverter.ToSingle(bytes, offset + 8), + climb = bitconverter.ToSingle(bytes, offset + 12), + heading = bitconverter.ToInt16(bytes, offset + 16), + throttle = bitconverter.ToUInt16(bytes, offset + 18), + }; + } + + internal static MavlinkMessage Deserialize_COMMAND_INT(byte[] bytes, int offset) + { + return new Msg_command_int + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + x = bitconverter.ToInt32(bytes, offset + 16), + y = bitconverter.ToInt32(bytes, offset + 20), + z = bitconverter.ToSingle(bytes, offset + 24), + command = bitconverter.ToUInt16(bytes, offset + 28), + target_system = bytes[offset + 30], + target_component = bytes[offset + 31], + frame = bytes[offset + 32], + current = bytes[offset + 33], + autocontinue = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_COMMAND_LONG(byte[] bytes, int offset) + { + return new Msg_command_long + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + param5 = bitconverter.ToSingle(bytes, offset + 16), + param6 = bitconverter.ToSingle(bytes, offset + 20), + param7 = bitconverter.ToSingle(bytes, offset + 24), + command = bitconverter.ToUInt16(bytes, offset + 28), + target_system = bytes[offset + 30], + target_component = bytes[offset + 31], + confirmation = bytes[offset + 32], + }; + } + + internal static MavlinkMessage Deserialize_COMMAND_ACK(byte[] bytes, int offset) + { + return new Msg_command_ack + { + command = bitconverter.ToUInt16(bytes, offset + 0), + result = bytes[offset + 2], + }; + } + + internal static MavlinkMessage Deserialize_MANUAL_SETPOINT(byte[] bytes, int offset) + { + return new Msg_manual_setpoint + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + roll = bitconverter.ToSingle(bytes, offset + 4), + pitch = bitconverter.ToSingle(bytes, offset + 8), + yaw = bitconverter.ToSingle(bytes, offset + 12), + thrust = bitconverter.ToSingle(bytes, offset + 16), + mode_switch = bytes[offset + 20], + manual_override_switch = bytes[offset + 21], + }; + } + + internal static MavlinkMessage Deserialize_SET_ATTITUDE_TARGET(byte[] bytes, int offset) + { + return new Msg_set_attitude_target + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 4, 4), + body_roll_rate = bitconverter.ToSingle(bytes, offset + 20), + body_pitch_rate = bitconverter.ToSingle(bytes, offset + 24), + body_yaw_rate = bitconverter.ToSingle(bytes, offset + 28), + thrust = bitconverter.ToSingle(bytes, offset + 32), + target_system = bytes[offset + 36], + target_component = bytes[offset + 37], + type_mask = bytes[offset + 38], + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE_TARGET(byte[] bytes, int offset) + { + return new Msg_attitude_target + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 4, 4), + body_roll_rate = bitconverter.ToSingle(bytes, offset + 20), + body_pitch_rate = bitconverter.ToSingle(bytes, offset + 24), + body_yaw_rate = bitconverter.ToSingle(bytes, offset + 28), + thrust = bitconverter.ToSingle(bytes, offset + 32), + type_mask = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_SET_POSITION_TARGET_LOCAL_NED(byte[] bytes, int offset) + { + return new Msg_set_position_target_local_ned + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + target_system = bytes[offset + 50], + target_component = bytes[offset + 51], + coordinate_frame = bytes[offset + 52], + }; + } + + internal static MavlinkMessage Deserialize_POSITION_TARGET_LOCAL_NED(byte[] bytes, int offset) + { + return new Msg_position_target_local_ned + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + coordinate_frame = bytes[offset + 50], + }; + } + + internal static MavlinkMessage Deserialize_SET_POSITION_TARGET_GLOBAL_INT(byte[] bytes, int offset) + { + return new Msg_set_position_target_global_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + lat_int = bitconverter.ToInt32(bytes, offset + 4), + lon_int = bitconverter.ToInt32(bytes, offset + 8), + alt = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + target_system = bytes[offset + 50], + target_component = bytes[offset + 51], + coordinate_frame = bytes[offset + 52], + }; + } + + internal static MavlinkMessage Deserialize_POSITION_TARGET_GLOBAL_INT(byte[] bytes, int offset) + { + return new Msg_position_target_global_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + lat_int = bitconverter.ToInt32(bytes, offset + 4), + lon_int = bitconverter.ToInt32(bytes, offset + 8), + alt = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + coordinate_frame = bytes[offset + 50], + }; + } + + internal static MavlinkMessage Deserialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(byte[] bytes, int offset) + { + return new Msg_local_position_ned_system_global_offset + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + roll = bitconverter.ToSingle(bytes, offset + 16), + pitch = bitconverter.ToSingle(bytes, offset + 20), + yaw = bitconverter.ToSingle(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_HIL_STATE(byte[] bytes, int offset) + { + return new Msg_hil_state + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + roll = bitconverter.ToSingle(bytes, offset + 8), + pitch = bitconverter.ToSingle(bytes, offset + 12), + yaw = bitconverter.ToSingle(bytes, offset + 16), + rollspeed = bitconverter.ToSingle(bytes, offset + 20), + pitchspeed = bitconverter.ToSingle(bytes, offset + 24), + yawspeed = bitconverter.ToSingle(bytes, offset + 28), + lat = bitconverter.ToInt32(bytes, offset + 32), + lon = bitconverter.ToInt32(bytes, offset + 36), + alt = bitconverter.ToInt32(bytes, offset + 40), + vx = bitconverter.ToInt16(bytes, offset + 44), + vy = bitconverter.ToInt16(bytes, offset + 46), + vz = bitconverter.ToInt16(bytes, offset + 48), + xacc = bitconverter.ToInt16(bytes, offset + 50), + yacc = bitconverter.ToInt16(bytes, offset + 52), + zacc = bitconverter.ToInt16(bytes, offset + 54), + }; + } + + internal static MavlinkMessage Deserialize_HIL_CONTROLS(byte[] bytes, int offset) + { + return new Msg_hil_controls + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + roll_ailerons = bitconverter.ToSingle(bytes, offset + 8), + pitch_elevator = bitconverter.ToSingle(bytes, offset + 12), + yaw_rudder = bitconverter.ToSingle(bytes, offset + 16), + throttle = bitconverter.ToSingle(bytes, offset + 20), + aux1 = bitconverter.ToSingle(bytes, offset + 24), + aux2 = bitconverter.ToSingle(bytes, offset + 28), + aux3 = bitconverter.ToSingle(bytes, offset + 32), + aux4 = bitconverter.ToSingle(bytes, offset + 36), + mode = bytes[offset + 40], + nav_mode = bytes[offset + 41], + }; + } + + internal static MavlinkMessage Deserialize_HIL_RC_INPUTS_RAW(byte[] bytes, int offset) + { + return new Msg_hil_rc_inputs_raw + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + chan1_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 14), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 16), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 18), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 20), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 22), + chan9_raw = bitconverter.ToUInt16(bytes, offset + 24), + chan10_raw = bitconverter.ToUInt16(bytes, offset + 26), + chan11_raw = bitconverter.ToUInt16(bytes, offset + 28), + chan12_raw = bitconverter.ToUInt16(bytes, offset + 30), + rssi = bytes[offset + 32], + }; + } + + internal static MavlinkMessage Deserialize_OPTICAL_FLOW(byte[] bytes, int offset) + { + return new Msg_optical_flow + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + flow_comp_m_x = bitconverter.ToSingle(bytes, offset + 8), + flow_comp_m_y = bitconverter.ToSingle(bytes, offset + 12), + ground_distance = bitconverter.ToSingle(bytes, offset + 16), + flow_x = bitconverter.ToInt16(bytes, offset + 20), + flow_y = bitconverter.ToInt16(bytes, offset + 22), + sensor_id = bytes[offset + 24], + quality = bytes[offset + 25], + }; + } + + internal static MavlinkMessage Deserialize_GLOBAL_VISION_POSITION_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_global_vision_position_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + roll = bitconverter.ToSingle(bytes, offset + 20), + pitch = bitconverter.ToSingle(bytes, offset + 24), + yaw = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_VISION_POSITION_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_vision_position_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + roll = bitconverter.ToSingle(bytes, offset + 20), + pitch = bitconverter.ToSingle(bytes, offset + 24), + yaw = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_VISION_SPEED_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_vision_speed_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + }; + } + + internal static MavlinkMessage Deserialize_VICON_POSITION_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_vicon_position_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + roll = bitconverter.ToSingle(bytes, offset + 20), + pitch = bitconverter.ToSingle(bytes, offset + 24), + yaw = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_HIGHRES_IMU(byte[] bytes, int offset) + { + return new Msg_highres_imu + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + xacc = bitconverter.ToSingle(bytes, offset + 8), + yacc = bitconverter.ToSingle(bytes, offset + 12), + zacc = bitconverter.ToSingle(bytes, offset + 16), + xgyro = bitconverter.ToSingle(bytes, offset + 20), + ygyro = bitconverter.ToSingle(bytes, offset + 24), + zgyro = bitconverter.ToSingle(bytes, offset + 28), + xmag = bitconverter.ToSingle(bytes, offset + 32), + ymag = bitconverter.ToSingle(bytes, offset + 36), + zmag = bitconverter.ToSingle(bytes, offset + 40), + abs_pressure = bitconverter.ToSingle(bytes, offset + 44), + diff_pressure = bitconverter.ToSingle(bytes, offset + 48), + pressure_alt = bitconverter.ToSingle(bytes, offset + 52), + temperature = bitconverter.ToSingle(bytes, offset + 56), + fields_updated = bitconverter.ToUInt16(bytes, offset + 60), + }; + } + + internal static MavlinkMessage Deserialize_OPTICAL_FLOW_RAD(byte[] bytes, int offset) + { + return new Msg_optical_flow_rad + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + integration_time_us = bitconverter.ToUInt32(bytes, offset + 8), + integrated_x = bitconverter.ToSingle(bytes, offset + 12), + integrated_y = bitconverter.ToSingle(bytes, offset + 16), + integrated_xgyro = bitconverter.ToSingle(bytes, offset + 20), + integrated_ygyro = bitconverter.ToSingle(bytes, offset + 24), + integrated_zgyro = bitconverter.ToSingle(bytes, offset + 28), + time_delta_distance_us = bitconverter.ToUInt32(bytes, offset + 32), + distance = bitconverter.ToSingle(bytes, offset + 36), + temperature = bitconverter.ToInt16(bytes, offset + 40), + sensor_id = bytes[offset + 42], + quality = bytes[offset + 43], + }; + } + + internal static MavlinkMessage Deserialize_HIL_SENSOR(byte[] bytes, int offset) + { + return new Msg_hil_sensor + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + xacc = bitconverter.ToSingle(bytes, offset + 8), + yacc = bitconverter.ToSingle(bytes, offset + 12), + zacc = bitconverter.ToSingle(bytes, offset + 16), + xgyro = bitconverter.ToSingle(bytes, offset + 20), + ygyro = bitconverter.ToSingle(bytes, offset + 24), + zgyro = bitconverter.ToSingle(bytes, offset + 28), + xmag = bitconverter.ToSingle(bytes, offset + 32), + ymag = bitconverter.ToSingle(bytes, offset + 36), + zmag = bitconverter.ToSingle(bytes, offset + 40), + abs_pressure = bitconverter.ToSingle(bytes, offset + 44), + diff_pressure = bitconverter.ToSingle(bytes, offset + 48), + pressure_alt = bitconverter.ToSingle(bytes, offset + 52), + temperature = bitconverter.ToSingle(bytes, offset + 56), + fields_updated = bitconverter.ToUInt32(bytes, offset + 60), + }; + } + + internal static MavlinkMessage Deserialize_SIM_STATE(byte[] bytes, int offset) + { + return new Msg_sim_state + { + q1 = bitconverter.ToSingle(bytes, offset + 0), + q2 = bitconverter.ToSingle(bytes, offset + 4), + q3 = bitconverter.ToSingle(bytes, offset + 8), + q4 = bitconverter.ToSingle(bytes, offset + 12), + roll = bitconverter.ToSingle(bytes, offset + 16), + pitch = bitconverter.ToSingle(bytes, offset + 20), + yaw = bitconverter.ToSingle(bytes, offset + 24), + xacc = bitconverter.ToSingle(bytes, offset + 28), + yacc = bitconverter.ToSingle(bytes, offset + 32), + zacc = bitconverter.ToSingle(bytes, offset + 36), + xgyro = bitconverter.ToSingle(bytes, offset + 40), + ygyro = bitconverter.ToSingle(bytes, offset + 44), + zgyro = bitconverter.ToSingle(bytes, offset + 48), + lat = bitconverter.ToSingle(bytes, offset + 52), + lon = bitconverter.ToSingle(bytes, offset + 56), + alt = bitconverter.ToSingle(bytes, offset + 60), + std_dev_horz = bitconverter.ToSingle(bytes, offset + 64), + std_dev_vert = bitconverter.ToSingle(bytes, offset + 68), + vn = bitconverter.ToSingle(bytes, offset + 72), + ve = bitconverter.ToSingle(bytes, offset + 76), + vd = bitconverter.ToSingle(bytes, offset + 80), + }; + } + + internal static MavlinkMessage Deserialize_RADIO_STATUS(byte[] bytes, int offset) + { + return new Msg_radio_status + { + rxerrors = bitconverter.ToUInt16(bytes, offset + 0), + @fixed = bitconverter.ToUInt16(bytes, offset + 2), + rssi = bytes[offset + 4], + remrssi = bytes[offset + 5], + txbuf = bytes[offset + 6], + noise = bytes[offset + 7], + remnoise = bytes[offset + 8], + }; + } + + internal static MavlinkMessage Deserialize_FILE_TRANSFER_PROTOCOL(byte[] bytes, int offset) + { + return new Msg_file_transfer_protocol + { + target_network = bytes[offset + 0], + target_system = bytes[offset + 1], + target_component = bytes[offset + 2], + payload = ByteArrayUtil.ToUInt8(bytes, offset + 3, 251), + }; + } + + internal static MavlinkMessage Deserialize_TIMESYNC(byte[] bytes, int offset) + { + return new Msg_timesync + { + tc1 = bitconverter.ToInt64(bytes, offset + 0), + ts1 = bitconverter.ToInt64(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_CAMERA_TRIGGER(byte[] bytes, int offset) + { + return new Msg_camera_trigger + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + seq = bitconverter.ToUInt32(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_HIL_GPS(byte[] bytes, int offset) + { + return new Msg_hil_gps + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + alt = bitconverter.ToInt32(bytes, offset + 16), + eph = bitconverter.ToUInt16(bytes, offset + 20), + epv = bitconverter.ToUInt16(bytes, offset + 22), + vel = bitconverter.ToUInt16(bytes, offset + 24), + vn = bitconverter.ToInt16(bytes, offset + 26), + ve = bitconverter.ToInt16(bytes, offset + 28), + vd = bitconverter.ToInt16(bytes, offset + 30), + cog = bitconverter.ToUInt16(bytes, offset + 32), + fix_type = bytes[offset + 34], + satellites_visible = bytes[offset + 35], + }; + } + + internal static MavlinkMessage Deserialize_HIL_OPTICAL_FLOW(byte[] bytes, int offset) + { + return new Msg_hil_optical_flow + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + integration_time_us = bitconverter.ToUInt32(bytes, offset + 8), + integrated_x = bitconverter.ToSingle(bytes, offset + 12), + integrated_y = bitconverter.ToSingle(bytes, offset + 16), + integrated_xgyro = bitconverter.ToSingle(bytes, offset + 20), + integrated_ygyro = bitconverter.ToSingle(bytes, offset + 24), + integrated_zgyro = bitconverter.ToSingle(bytes, offset + 28), + time_delta_distance_us = bitconverter.ToUInt32(bytes, offset + 32), + distance = bitconverter.ToSingle(bytes, offset + 36), + temperature = bitconverter.ToInt16(bytes, offset + 40), + sensor_id = bytes[offset + 42], + quality = bytes[offset + 43], + }; + } + + internal static MavlinkMessage Deserialize_HIL_STATE_QUATERNION(byte[] bytes, int offset) + { + return new Msg_hil_state_quaternion + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + attitude_quaternion = ByteArrayUtil.ToSingle(bytes, offset + 8, 4), + rollspeed = bitconverter.ToSingle(bytes, offset + 24), + pitchspeed = bitconverter.ToSingle(bytes, offset + 28), + yawspeed = bitconverter.ToSingle(bytes, offset + 32), + lat = bitconverter.ToInt32(bytes, offset + 36), + lon = bitconverter.ToInt32(bytes, offset + 40), + alt = bitconverter.ToInt32(bytes, offset + 44), + vx = bitconverter.ToInt16(bytes, offset + 48), + vy = bitconverter.ToInt16(bytes, offset + 50), + vz = bitconverter.ToInt16(bytes, offset + 52), + ind_airspeed = bitconverter.ToUInt16(bytes, offset + 54), + true_airspeed = bitconverter.ToUInt16(bytes, offset + 56), + xacc = bitconverter.ToInt16(bytes, offset + 58), + yacc = bitconverter.ToInt16(bytes, offset + 60), + zacc = bitconverter.ToInt16(bytes, offset + 62), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_IMU2(byte[] bytes, int offset) + { + return new Msg_scaled_imu2 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 4), + yacc = bitconverter.ToInt16(bytes, offset + 6), + zacc = bitconverter.ToInt16(bytes, offset + 8), + xgyro = bitconverter.ToInt16(bytes, offset + 10), + ygyro = bitconverter.ToInt16(bytes, offset + 12), + zgyro = bitconverter.ToInt16(bytes, offset + 14), + xmag = bitconverter.ToInt16(bytes, offset + 16), + ymag = bitconverter.ToInt16(bytes, offset + 18), + zmag = bitconverter.ToInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_LOG_REQUEST_LIST(byte[] bytes, int offset) + { + return new Msg_log_request_list + { + start = bitconverter.ToUInt16(bytes, offset + 0), + end = bitconverter.ToUInt16(bytes, offset + 2), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_LOG_ENTRY(byte[] bytes, int offset) + { + return new Msg_log_entry + { + time_utc = bitconverter.ToUInt32(bytes, offset + 0), + size = bitconverter.ToUInt32(bytes, offset + 4), + id = bitconverter.ToUInt16(bytes, offset + 8), + num_logs = bitconverter.ToUInt16(bytes, offset + 10), + last_log_num = bitconverter.ToUInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_LOG_REQUEST_DATA(byte[] bytes, int offset) + { + return new Msg_log_request_data + { + ofs = bitconverter.ToUInt32(bytes, offset + 0), + count = bitconverter.ToUInt32(bytes, offset + 4), + id = bitconverter.ToUInt16(bytes, offset + 8), + target_system = bytes[offset + 10], + target_component = bytes[offset + 11], + }; + } + + internal static MavlinkMessage Deserialize_LOG_DATA(byte[] bytes, int offset) + { + return new Msg_log_data + { + ofs = bitconverter.ToUInt32(bytes, offset + 0), + id = bitconverter.ToUInt16(bytes, offset + 4), + count = bytes[offset + 6], + data = ByteArrayUtil.ToUInt8(bytes, offset + 7, 90), + }; + } + + internal static MavlinkMessage Deserialize_LOG_ERASE(byte[] bytes, int offset) + { + return new Msg_log_erase + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_LOG_REQUEST_END(byte[] bytes, int offset) + { + return new Msg_log_request_end + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_GPS_INJECT_DATA(byte[] bytes, int offset) + { + return new Msg_gps_inject_data + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + len = bytes[offset + 2], + data = ByteArrayUtil.ToUInt8(bytes, offset + 3, 110), + }; + } + + internal static MavlinkMessage Deserialize_GPS2_RAW(byte[] bytes, int offset) + { + return new Msg_gps2_raw + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + alt = bitconverter.ToInt32(bytes, offset + 16), + dgps_age = bitconverter.ToUInt32(bytes, offset + 20), + eph = bitconverter.ToUInt16(bytes, offset + 24), + epv = bitconverter.ToUInt16(bytes, offset + 26), + vel = bitconverter.ToUInt16(bytes, offset + 28), + cog = bitconverter.ToUInt16(bytes, offset + 30), + fix_type = bytes[offset + 32], + satellites_visible = bytes[offset + 33], + dgps_numch = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_POWER_STATUS(byte[] bytes, int offset) + { + return new Msg_power_status + { + Vcc = bitconverter.ToUInt16(bytes, offset + 0), + Vservo = bitconverter.ToUInt16(bytes, offset + 2), + flags = bitconverter.ToUInt16(bytes, offset + 4), + }; + } + + internal static MavlinkMessage Deserialize_SERIAL_CONTROL(byte[] bytes, int offset) + { + return new Msg_serial_control + { + baudrate = bitconverter.ToUInt32(bytes, offset + 0), + timeout = bitconverter.ToUInt16(bytes, offset + 4), + device = bytes[offset + 6], + flags = bytes[offset + 7], + count = bytes[offset + 8], + data = ByteArrayUtil.ToUInt8(bytes, offset + 9, 70), + }; + } + + internal static MavlinkMessage Deserialize_GPS_RTK(byte[] bytes, int offset) + { + return new Msg_gps_rtk + { + time_last_baseline_ms = bitconverter.ToUInt32(bytes, offset + 0), + tow = bitconverter.ToUInt32(bytes, offset + 4), + baseline_a_mm = bitconverter.ToInt32(bytes, offset + 8), + baseline_b_mm = bitconverter.ToInt32(bytes, offset + 12), + baseline_c_mm = bitconverter.ToInt32(bytes, offset + 16), + accuracy = bitconverter.ToUInt32(bytes, offset + 20), + iar_num_hypotheses = bitconverter.ToInt32(bytes, offset + 24), + wn = bitconverter.ToUInt16(bytes, offset + 28), + rtk_receiver_id = bytes[offset + 30], + rtk_health = bytes[offset + 31], + rtk_rate = bytes[offset + 32], + nsats = bytes[offset + 33], + baseline_coords_type = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_GPS2_RTK(byte[] bytes, int offset) + { + return new Msg_gps2_rtk + { + time_last_baseline_ms = bitconverter.ToUInt32(bytes, offset + 0), + tow = bitconverter.ToUInt32(bytes, offset + 4), + baseline_a_mm = bitconverter.ToInt32(bytes, offset + 8), + baseline_b_mm = bitconverter.ToInt32(bytes, offset + 12), + baseline_c_mm = bitconverter.ToInt32(bytes, offset + 16), + accuracy = bitconverter.ToUInt32(bytes, offset + 20), + iar_num_hypotheses = bitconverter.ToInt32(bytes, offset + 24), + wn = bitconverter.ToUInt16(bytes, offset + 28), + rtk_receiver_id = bytes[offset + 30], + rtk_health = bytes[offset + 31], + rtk_rate = bytes[offset + 32], + nsats = bytes[offset + 33], + baseline_coords_type = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_SCALED_IMU3(byte[] bytes, int offset) + { + return new Msg_scaled_imu3 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 4), + yacc = bitconverter.ToInt16(bytes, offset + 6), + zacc = bitconverter.ToInt16(bytes, offset + 8), + xgyro = bitconverter.ToInt16(bytes, offset + 10), + ygyro = bitconverter.ToInt16(bytes, offset + 12), + zgyro = bitconverter.ToInt16(bytes, offset + 14), + xmag = bitconverter.ToInt16(bytes, offset + 16), + ymag = bitconverter.ToInt16(bytes, offset + 18), + zmag = bitconverter.ToInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_DATA_TRANSMISSION_HANDSHAKE(byte[] bytes, int offset) + { + return new Msg_data_transmission_handshake + { + size = bitconverter.ToUInt32(bytes, offset + 0), + width = bitconverter.ToUInt16(bytes, offset + 4), + height = bitconverter.ToUInt16(bytes, offset + 6), + packets = bitconverter.ToUInt16(bytes, offset + 8), + type = bytes[offset + 10], + payload = bytes[offset + 11], + jpg_quality = bytes[offset + 12], + }; + } + + internal static MavlinkMessage Deserialize_ENCAPSULATED_DATA(byte[] bytes, int offset) + { + return new Msg_encapsulated_data + { + seqnr = bitconverter.ToUInt16(bytes, offset + 0), + data = ByteArrayUtil.ToUInt8(bytes, offset + 2, 253), + }; + } + + internal static MavlinkMessage Deserialize_DISTANCE_SENSOR(byte[] bytes, int offset) + { + return new Msg_distance_sensor + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + min_distance = bitconverter.ToUInt16(bytes, offset + 4), + max_distance = bitconverter.ToUInt16(bytes, offset + 6), + current_distance = bitconverter.ToUInt16(bytes, offset + 8), + type = bytes[offset + 10], + id = bytes[offset + 11], + orientation = bytes[offset + 12], + covariance = bytes[offset + 13], + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_REQUEST(byte[] bytes, int offset) + { + return new Msg_terrain_request + { + mask = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + grid_spacing = bitconverter.ToUInt16(bytes, offset + 16), + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_DATA(byte[] bytes, int offset) + { + return new Msg_terrain_data + { + lat = bitconverter.ToInt32(bytes, offset + 0), + lon = bitconverter.ToInt32(bytes, offset + 4), + grid_spacing = bitconverter.ToUInt16(bytes, offset + 8), + data = ByteArrayUtil.ToInt16(bytes, offset + 10, 16), + gridbit = bytes[offset + 42], + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_CHECK(byte[] bytes, int offset) + { + return new Msg_terrain_check + { + lat = bitconverter.ToInt32(bytes, offset + 0), + lon = bitconverter.ToInt32(bytes, offset + 4), + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_REPORT(byte[] bytes, int offset) + { + return new Msg_terrain_report + { + lat = bitconverter.ToInt32(bytes, offset + 0), + lon = bitconverter.ToInt32(bytes, offset + 4), + terrain_height = bitconverter.ToSingle(bytes, offset + 8), + current_height = bitconverter.ToSingle(bytes, offset + 12), + spacing = bitconverter.ToUInt16(bytes, offset + 16), + pending = bitconverter.ToUInt16(bytes, offset + 18), + loaded = bitconverter.ToUInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_PRESSURE2(byte[] bytes, int offset) + { + return new Msg_scaled_pressure2 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + press_abs = bitconverter.ToSingle(bytes, offset + 4), + press_diff = bitconverter.ToSingle(bytes, offset + 8), + temperature = bitconverter.ToInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_ATT_POS_MOCAP(byte[] bytes, int offset) + { + return new Msg_att_pos_mocap + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 8, 4), + x = bitconverter.ToSingle(bytes, offset + 24), + y = bitconverter.ToSingle(bytes, offset + 28), + z = bitconverter.ToSingle(bytes, offset + 32), + }; + } + + internal static MavlinkMessage Deserialize_SET_ACTUATOR_CONTROL_TARGET(byte[] bytes, int offset) + { + return new Msg_set_actuator_control_target + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + controls = ByteArrayUtil.ToSingle(bytes, offset + 8, 8), + group_mlx = bytes[offset + 40], + target_system = bytes[offset + 41], + target_component = bytes[offset + 42], + }; + } + + internal static MavlinkMessage Deserialize_ACTUATOR_CONTROL_TARGET(byte[] bytes, int offset) + { + return new Msg_actuator_control_target + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + controls = ByteArrayUtil.ToSingle(bytes, offset + 8, 8), + group_mlx = bytes[offset + 40], + }; + } + + internal static MavlinkMessage Deserialize_ALTITUDE(byte[] bytes, int offset) + { + return new Msg_altitude + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + altitude_monotonic = bitconverter.ToSingle(bytes, offset + 8), + altitude_amsl = bitconverter.ToSingle(bytes, offset + 12), + altitude_local = bitconverter.ToSingle(bytes, offset + 16), + altitude_relative = bitconverter.ToSingle(bytes, offset + 20), + altitude_terrain = bitconverter.ToSingle(bytes, offset + 24), + bottom_clearance = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_RESOURCE_REQUEST(byte[] bytes, int offset) + { + return new Msg_resource_request + { + request_id = bytes[offset + 0], + uri_type = bytes[offset + 1], + uri = ByteArrayUtil.ToUInt8(bytes, offset + 2, 120), + transfer_type = bytes[offset + 122], + storage = ByteArrayUtil.ToUInt8(bytes, offset + 123, 120), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_PRESSURE3(byte[] bytes, int offset) + { + return new Msg_scaled_pressure3 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + press_abs = bitconverter.ToSingle(bytes, offset + 4), + press_diff = bitconverter.ToSingle(bytes, offset + 8), + temperature = bitconverter.ToInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_FOLLOW_TARGET(byte[] bytes, int offset) + { + return new Msg_follow_target + { + timestamp = bitconverter.ToUInt64(bytes, offset + 0), + custom_state = bitconverter.ToUInt64(bytes, offset + 8), + lat = bitconverter.ToInt32(bytes, offset + 16), + lon = bitconverter.ToInt32(bytes, offset + 20), + alt = bitconverter.ToSingle(bytes, offset + 24), + vel = ByteArrayUtil.ToSingle(bytes, offset + 28, 3), + acc = ByteArrayUtil.ToSingle(bytes, offset + 40, 3), + attitude_q = ByteArrayUtil.ToSingle(bytes, offset + 52, 4), + rates = ByteArrayUtil.ToSingle(bytes, offset + 68, 3), + position_cov = ByteArrayUtil.ToSingle(bytes, offset + 80, 3), + est_capabilities = bytes[offset + 92], + }; + } + + internal static MavlinkMessage Deserialize_CONTROL_SYSTEM_STATE(byte[] bytes, int offset) + { + return new Msg_control_system_state + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + x_acc = bitconverter.ToSingle(bytes, offset + 8), + y_acc = bitconverter.ToSingle(bytes, offset + 12), + z_acc = bitconverter.ToSingle(bytes, offset + 16), + x_vel = bitconverter.ToSingle(bytes, offset + 20), + y_vel = bitconverter.ToSingle(bytes, offset + 24), + z_vel = bitconverter.ToSingle(bytes, offset + 28), + x_pos = bitconverter.ToSingle(bytes, offset + 32), + y_pos = bitconverter.ToSingle(bytes, offset + 36), + z_pos = bitconverter.ToSingle(bytes, offset + 40), + airspeed = bitconverter.ToSingle(bytes, offset + 44), + vel_variance = ByteArrayUtil.ToSingle(bytes, offset + 48, 3), + pos_variance = ByteArrayUtil.ToSingle(bytes, offset + 60, 3), + q = ByteArrayUtil.ToSingle(bytes, offset + 72, 4), + roll_rate = bitconverter.ToSingle(bytes, offset + 88), + pitch_rate = bitconverter.ToSingle(bytes, offset + 92), + yaw_rate = bitconverter.ToSingle(bytes, offset + 96), + }; + } + + internal static MavlinkMessage Deserialize_BATTERY_STATUS(byte[] bytes, int offset) + { + return new Msg_battery_status + { + current_consumed = bitconverter.ToInt32(bytes, offset + 0), + energy_consumed = bitconverter.ToInt32(bytes, offset + 4), + temperature = bitconverter.ToInt16(bytes, offset + 8), + voltages = ByteArrayUtil.ToUInt16(bytes, offset + 10, 10), + current_battery = bitconverter.ToInt16(bytes, offset + 30), + id = bytes[offset + 32], + battery_function = bytes[offset + 33], + type = bytes[offset + 34], + battery_remaining = bitconverter.ToInt8(bytes, offset + 35), + }; + } + + internal static MavlinkMessage Deserialize_AUTOPILOT_VERSION(byte[] bytes, int offset) + { + return new Msg_autopilot_version + { + capabilities = bitconverter.ToUInt64(bytes, offset + 0), + uid = bitconverter.ToUInt64(bytes, offset + 8), + flight_sw_version = bitconverter.ToUInt32(bytes, offset + 16), + middleware_sw_version = bitconverter.ToUInt32(bytes, offset + 20), + os_sw_version = bitconverter.ToUInt32(bytes, offset + 24), + board_version = bitconverter.ToUInt32(bytes, offset + 28), + vendor_id = bitconverter.ToUInt16(bytes, offset + 32), + product_id = bitconverter.ToUInt16(bytes, offset + 34), + flight_custom_version = ByteArrayUtil.ToUInt8(bytes, offset + 36, 8), + middleware_custom_version = ByteArrayUtil.ToUInt8(bytes, offset + 44, 8), + os_custom_version = ByteArrayUtil.ToUInt8(bytes, offset + 52, 8), + }; + } + + internal static MavlinkMessage Deserialize_LANDING_TARGET(byte[] bytes, int offset) + { + return new Msg_landing_target + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + angle_x = bitconverter.ToSingle(bytes, offset + 8), + angle_y = bitconverter.ToSingle(bytes, offset + 12), + distance = bitconverter.ToSingle(bytes, offset + 16), + size_x = bitconverter.ToSingle(bytes, offset + 20), + size_y = bitconverter.ToSingle(bytes, offset + 24), + target_num = bytes[offset + 28], + frame = bytes[offset + 29], + }; + } + + internal static MavlinkMessage Deserialize_ESTIMATOR_STATUS(byte[] bytes, int offset) + { + return new Msg_estimator_status + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + vel_ratio = bitconverter.ToSingle(bytes, offset + 8), + pos_horiz_ratio = bitconverter.ToSingle(bytes, offset + 12), + pos_vert_ratio = bitconverter.ToSingle(bytes, offset + 16), + mag_ratio = bitconverter.ToSingle(bytes, offset + 20), + hagl_ratio = bitconverter.ToSingle(bytes, offset + 24), + tas_ratio = bitconverter.ToSingle(bytes, offset + 28), + pos_horiz_accuracy = bitconverter.ToSingle(bytes, offset + 32), + pos_vert_accuracy = bitconverter.ToSingle(bytes, offset + 36), + flags = bitconverter.ToUInt16(bytes, offset + 40), + }; + } + + internal static MavlinkMessage Deserialize_WIND_COV(byte[] bytes, int offset) + { + return new Msg_wind_cov + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + wind_x = bitconverter.ToSingle(bytes, offset + 8), + wind_y = bitconverter.ToSingle(bytes, offset + 12), + wind_z = bitconverter.ToSingle(bytes, offset + 16), + var_horiz = bitconverter.ToSingle(bytes, offset + 20), + var_vert = bitconverter.ToSingle(bytes, offset + 24), + wind_alt = bitconverter.ToSingle(bytes, offset + 28), + horiz_accuracy = bitconverter.ToSingle(bytes, offset + 32), + vert_accuracy = bitconverter.ToSingle(bytes, offset + 36), + }; + } + + internal static MavlinkMessage Deserialize_VIBRATION(byte[] bytes, int offset) + { + return new Msg_vibration + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + vibration_x = bitconverter.ToSingle(bytes, offset + 8), + vibration_y = bitconverter.ToSingle(bytes, offset + 12), + vibration_z = bitconverter.ToSingle(bytes, offset + 16), + clipping_0 = bitconverter.ToUInt32(bytes, offset + 20), + clipping_1 = bitconverter.ToUInt32(bytes, offset + 24), + clipping_2 = bitconverter.ToUInt32(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_HOME_POSITION(byte[] bytes, int offset) + { + return new Msg_home_position + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + x = bitconverter.ToSingle(bytes, offset + 12), + y = bitconverter.ToSingle(bytes, offset + 16), + z = bitconverter.ToSingle(bytes, offset + 20), + q = ByteArrayUtil.ToSingle(bytes, offset + 24, 4), + approach_x = bitconverter.ToSingle(bytes, offset + 40), + approach_y = bitconverter.ToSingle(bytes, offset + 44), + approach_z = bitconverter.ToSingle(bytes, offset + 48), + }; + } + + internal static MavlinkMessage Deserialize_SET_HOME_POSITION(byte[] bytes, int offset) + { + return new Msg_set_home_position + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + x = bitconverter.ToSingle(bytes, offset + 12), + y = bitconverter.ToSingle(bytes, offset + 16), + z = bitconverter.ToSingle(bytes, offset + 20), + q = ByteArrayUtil.ToSingle(bytes, offset + 24, 4), + approach_x = bitconverter.ToSingle(bytes, offset + 40), + approach_y = bitconverter.ToSingle(bytes, offset + 44), + approach_z = bitconverter.ToSingle(bytes, offset + 48), + target_system = bytes[offset + 52], + }; + } + + internal static MavlinkMessage Deserialize_MESSAGE_INTERVAL(byte[] bytes, int offset) + { + return new Msg_message_interval + { + interval_us = bitconverter.ToInt32(bytes, offset + 0), + message_id = bitconverter.ToUInt16(bytes, offset + 4), + }; + } + + internal static MavlinkMessage Deserialize_EXTENDED_SYS_STATE(byte[] bytes, int offset) + { + return new Msg_extended_sys_state + { + vtol_state = bytes[offset + 0], + landed_state = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_ADSB_VEHICLE(byte[] bytes, int offset) + { + return new Msg_adsb_vehicle + { + ICAO_address = bitconverter.ToUInt32(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 4), + lon = bitconverter.ToInt32(bytes, offset + 8), + altitude = bitconverter.ToInt32(bytes, offset + 12), + heading = bitconverter.ToUInt16(bytes, offset + 16), + hor_velocity = bitconverter.ToUInt16(bytes, offset + 18), + ver_velocity = bitconverter.ToInt16(bytes, offset + 20), + flags = bitconverter.ToUInt16(bytes, offset + 22), + squawk = bitconverter.ToUInt16(bytes, offset + 24), + altitude_type = bytes[offset + 26], + callsign = ByteArrayUtil.ToChar(bytes, offset + 27, 9), + emitter_type = bytes[offset + 36], + tslc = bytes[offset + 37], + }; + } + + internal static MavlinkMessage Deserialize_V2_EXTENSION(byte[] bytes, int offset) + { + return new Msg_v2_extension + { + message_type = bitconverter.ToUInt16(bytes, offset + 0), + target_network = bytes[offset + 2], + target_system = bytes[offset + 3], + target_component = bytes[offset + 4], + payload = ByteArrayUtil.ToUInt8(bytes, offset + 5, 249), + }; + } + + internal static MavlinkMessage Deserialize_MEMORY_VECT(byte[] bytes, int offset) + { + return new Msg_memory_vect + { + address = bitconverter.ToUInt16(bytes, offset + 0), + ver = bytes[offset + 2], + type = bytes[offset + 3], + value = ByteArrayUtil.ToInt8(bytes, offset + 4, 32), + }; + } + + internal static MavlinkMessage Deserialize_DEBUG_VECT(byte[] bytes, int offset) + { + return new Msg_debug_vect + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + name = ByteArrayUtil.ToChar(bytes, offset + 20, 10), + }; + } + + internal static MavlinkMessage Deserialize_NAMED_VALUE_FLOAT(byte[] bytes, int offset) + { + return new Msg_named_value_float + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + value = bitconverter.ToSingle(bytes, offset + 4), + name = ByteArrayUtil.ToChar(bytes, offset + 8, 10), + }; + } + + internal static MavlinkMessage Deserialize_NAMED_VALUE_INT(byte[] bytes, int offset) + { + return new Msg_named_value_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + value = bitconverter.ToInt32(bytes, offset + 4), + name = ByteArrayUtil.ToChar(bytes, offset + 8, 10), + }; + } + + internal static MavlinkMessage Deserialize_STATUSTEXT(byte[] bytes, int offset) + { + return new Msg_statustext + { + severity = bytes[offset + 0], + text = ByteArrayUtil.ToChar(bytes, offset + 1, 50), + }; + } + + internal static MavlinkMessage Deserialize_DEBUG(byte[] bytes, int offset) + { + return new Msg_debug + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + value = bitconverter.ToSingle(bytes, offset + 4), + ind = bytes[offset + 8], + }; + } + + internal static int Serialize_SET_VELOCITY(this Msg_set_velocity msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ref_angular_velocity, bytes, offset + 0); + offset += 2; + return 220; + } + + internal static int Serialize_HEARTBEAT(this Msg_heartbeat msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.custom_mode, bytes, offset + 0); + bytes[offset + 4] = msg.type; + bytes[offset + 5] = msg.autopilot; + bytes[offset + 6] = msg.base_mode; + bytes[offset + 7] = msg.system_status; + bytes[offset + 8] = msg.mavlink_version; + offset += 9; + return 0; + } + + internal static int Serialize_SYS_STATUS(this Msg_sys_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.onboard_control_sensors_present, bytes, offset + 0); + bitconverter.GetBytes(msg.onboard_control_sensors_enabled, bytes, offset + 4); + bitconverter.GetBytes(msg.onboard_control_sensors_health, bytes, offset + 8); + bitconverter.GetBytes(msg.load, bytes, offset + 12); + bitconverter.GetBytes(msg.voltage_battery, bytes, offset + 14); + bitconverter.GetBytes(msg.current_battery, bytes, offset + 16); + bitconverter.GetBytes(msg.drop_rate_comm, bytes, offset + 18); + bitconverter.GetBytes(msg.errors_comm, bytes, offset + 20); + bitconverter.GetBytes(msg.errors_count1, bytes, offset + 22); + bitconverter.GetBytes(msg.errors_count2, bytes, offset + 24); + bitconverter.GetBytes(msg.errors_count3, bytes, offset + 26); + bitconverter.GetBytes(msg.errors_count4, bytes, offset + 28); + bytes[offset + 30] = unchecked((byte)msg.battery_remaining); + offset += 31; + return 1; + } + + internal static int Serialize_SYSTEM_TIME(this Msg_system_time msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_unix_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 8); + offset += 12; + return 2; + } + + internal static int Serialize_PING(this Msg_ping msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.seq, bytes, offset + 8); + bytes[offset + 12] = msg.target_system; + bytes[offset + 13] = msg.target_component; + offset += 14; + return 4; + } + + internal static int Serialize_CHANGE_OPERATOR_CONTROL(this Msg_change_operator_control msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.control_request; + bytes[offset + 2] = msg.version; + ByteArrayUtil.ToByteArray(msg.passkey, bytes, offset + 3, 25); + offset += 28; + return 5; + } + + internal static int Serialize_CHANGE_OPERATOR_CONTROL_ACK(this Msg_change_operator_control_ack msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.gcs_system_id; + bytes[offset + 1] = msg.control_request; + bytes[offset + 2] = msg.ack; + offset += 3; + return 6; + } + + internal static int Serialize_AUTH_KEY(this Msg_auth_key msg, byte[] bytes, ref int offset) + { + ByteArrayUtil.ToByteArray(msg.key, bytes, offset + 0, 32); + offset += 32; + return 7; + } + + internal static int Serialize_SET_MODE(this Msg_set_mode msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.custom_mode, bytes, offset + 0); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.base_mode; + offset += 6; + return 11; + } + + internal static int Serialize_PARAM_REQUEST_READ(this Msg_param_request_read msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_index, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 4, 16); + offset += 20; + return 20; + } + + internal static int Serialize_PARAM_REQUEST_LIST(this Msg_param_request_list msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 21; + } + + internal static int Serialize_PARAM_VALUE(this Msg_param_value msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_value, bytes, offset + 0); + bitconverter.GetBytes(msg.param_count, bytes, offset + 4); + bitconverter.GetBytes(msg.param_index, bytes, offset + 6); + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 8, 16); + bytes[offset + 24] = msg.param_type; + offset += 25; + return 22; + } + + internal static int Serialize_PARAM_SET(this Msg_param_set msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_value, bytes, offset + 0); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 6, 16); + bytes[offset + 22] = msg.param_type; + offset += 23; + return 23; + } + + internal static int Serialize_GPS_RAW_INT(this Msg_gps_raw_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.alt, bytes, offset + 16); + bitconverter.GetBytes(msg.eph, bytes, offset + 20); + bitconverter.GetBytes(msg.epv, bytes, offset + 22); + bitconverter.GetBytes(msg.vel, bytes, offset + 24); + bitconverter.GetBytes(msg.cog, bytes, offset + 26); + bytes[offset + 28] = msg.fix_type; + bytes[offset + 29] = msg.satellites_visible; + offset += 30; + return 24; + } + + internal static int Serialize_GPS_STATUS(this Msg_gps_status msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.satellites_visible; + ByteArrayUtil.ToByteArray(msg.satellite_prn, bytes, offset + 1, 20); + ByteArrayUtil.ToByteArray(msg.satellite_used, bytes, offset + 21, 20); + ByteArrayUtil.ToByteArray(msg.satellite_elevation, bytes, offset + 41, 20); + ByteArrayUtil.ToByteArray(msg.satellite_azimuth, bytes, offset + 61, 20); + ByteArrayUtil.ToByteArray(msg.satellite_snr, bytes, offset + 81, 20); + offset += 101; + return 25; + } + + internal static int Serialize_SCALED_IMU(this Msg_scaled_imu msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 4); + bitconverter.GetBytes(msg.yacc, bytes, offset + 6); + bitconverter.GetBytes(msg.zacc, bytes, offset + 8); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 10); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 12); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.xmag, bytes, offset + 16); + bitconverter.GetBytes(msg.ymag, bytes, offset + 18); + bitconverter.GetBytes(msg.zmag, bytes, offset + 20); + offset += 22; + return 26; + } + + internal static int Serialize_RAW_IMU(this Msg_raw_imu msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 8); + bitconverter.GetBytes(msg.yacc, bytes, offset + 10); + bitconverter.GetBytes(msg.zacc, bytes, offset + 12); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 16); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 18); + bitconverter.GetBytes(msg.xmag, bytes, offset + 20); + bitconverter.GetBytes(msg.ymag, bytes, offset + 22); + bitconverter.GetBytes(msg.zmag, bytes, offset + 24); + offset += 26; + return 27; + } + + internal static int Serialize_RAW_PRESSURE(this Msg_raw_pressure msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 8); + bitconverter.GetBytes(msg.press_diff1, bytes, offset + 10); + bitconverter.GetBytes(msg.press_diff2, bytes, offset + 12); + bitconverter.GetBytes(msg.temperature, bytes, offset + 14); + offset += 16; + return 28; + } + + internal static int Serialize_SCALED_PRESSURE(this Msg_scaled_pressure msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 4); + bitconverter.GetBytes(msg.press_diff, bytes, offset + 8); + bitconverter.GetBytes(msg.temperature, bytes, offset + 12); + offset += 14; + return 29; + } + + internal static int Serialize_ATTITUDE(this Msg_attitude msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.roll, bytes, offset + 4); + bitconverter.GetBytes(msg.pitch, bytes, offset + 8); + bitconverter.GetBytes(msg.yaw, bytes, offset + 12); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 16); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 24); + offset += 28; + return 30; + } + + internal static int Serialize_ATTITUDE_QUATERNION(this Msg_attitude_quaternion msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.q1, bytes, offset + 4); + bitconverter.GetBytes(msg.q2, bytes, offset + 8); + bitconverter.GetBytes(msg.q3, bytes, offset + 12); + bitconverter.GetBytes(msg.q4, bytes, offset + 16); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 28); + offset += 32; + return 31; + } + + internal static int Serialize_LOCAL_POSITION_NED(this Msg_local_position_ned msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + offset += 28; + return 32; + } + + internal static int Serialize_GLOBAL_POSITION_INT(this Msg_global_position_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 4); + bitconverter.GetBytes(msg.lon, bytes, offset + 8); + bitconverter.GetBytes(msg.alt, bytes, offset + 12); + bitconverter.GetBytes(msg.relative_alt, bytes, offset + 16); + bitconverter.GetBytes(msg.vx, bytes, offset + 20); + bitconverter.GetBytes(msg.vy, bytes, offset + 22); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.hdg, bytes, offset + 26); + offset += 28; + return 33; + } + + internal static int Serialize_RC_CHANNELS_SCALED(this Msg_rc_channels_scaled msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_scaled, bytes, offset + 4); + bitconverter.GetBytes(msg.chan2_scaled, bytes, offset + 6); + bitconverter.GetBytes(msg.chan3_scaled, bytes, offset + 8); + bitconverter.GetBytes(msg.chan4_scaled, bytes, offset + 10); + bitconverter.GetBytes(msg.chan5_scaled, bytes, offset + 12); + bitconverter.GetBytes(msg.chan6_scaled, bytes, offset + 14); + bitconverter.GetBytes(msg.chan7_scaled, bytes, offset + 16); + bitconverter.GetBytes(msg.chan8_scaled, bytes, offset + 18); + bytes[offset + 20] = msg.port; + bytes[offset + 21] = msg.rssi; + offset += 22; + return 34; + } + + internal static int Serialize_RC_CHANNELS_RAW(this Msg_rc_channels_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 18); + bytes[offset + 20] = msg.port; + bytes[offset + 21] = msg.rssi; + offset += 22; + return 35; + } + + internal static int Serialize_SERVO_OUTPUT_RAW(this Msg_servo_output_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.servo1_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.servo2_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.servo3_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.servo4_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.servo5_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.servo6_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.servo7_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.servo8_raw, bytes, offset + 18); + bytes[offset + 20] = msg.port; + offset += 21; + return 36; + } + + internal static int Serialize_MISSION_REQUEST_PARTIAL_LIST(this Msg_mission_request_partial_list msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.start_index, bytes, offset + 0); + bitconverter.GetBytes(msg.end_index, bytes, offset + 2); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + offset += 6; + return 37; + } + + internal static int Serialize_MISSION_WRITE_PARTIAL_LIST(this Msg_mission_write_partial_list msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.start_index, bytes, offset + 0); + bitconverter.GetBytes(msg.end_index, bytes, offset + 2); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + offset += 6; + return 38; + } + + internal static int Serialize_MISSION_ITEM(this Msg_mission_item msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.x, bytes, offset + 16); + bitconverter.GetBytes(msg.y, bytes, offset + 20); + bitconverter.GetBytes(msg.z, bytes, offset + 24); + bitconverter.GetBytes(msg.seq, bytes, offset + 28); + bitconverter.GetBytes(msg.command, bytes, offset + 30); + bytes[offset + 32] = msg.target_system; + bytes[offset + 33] = msg.target_component; + bytes[offset + 34] = msg.frame; + bytes[offset + 35] = msg.current; + bytes[offset + 36] = msg.autocontinue; + offset += 37; + return 39; + } + + internal static int Serialize_MISSION_REQUEST(this Msg_mission_request msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 40; + } + + internal static int Serialize_MISSION_SET_CURRENT(this Msg_mission_set_current msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 41; + } + + internal static int Serialize_MISSION_CURRENT(this Msg_mission_current msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + offset += 2; + return 42; + } + + internal static int Serialize_MISSION_REQUEST_LIST(this Msg_mission_request_list msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 43; + } + + internal static int Serialize_MISSION_COUNT(this Msg_mission_count msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.count, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 44; + } + + internal static int Serialize_MISSION_CLEAR_ALL(this Msg_mission_clear_all msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 45; + } + + internal static int Serialize_MISSION_ITEM_REACHED(this Msg_mission_item_reached msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + offset += 2; + return 46; + } + + internal static int Serialize_MISSION_ACK(this Msg_mission_ack msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + bytes[offset + 2] = msg.type; + offset += 3; + return 47; + } + + internal static int Serialize_SET_GPS_GLOBAL_ORIGIN(this Msg_set_gps_global_origin msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + bytes[offset + 12] = msg.target_system; + offset += 13; + return 48; + } + + internal static int Serialize_GPS_GLOBAL_ORIGIN(this Msg_gps_global_origin msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + offset += 12; + return 49; + } + + internal static int Serialize_PARAM_MAP_RC(this Msg_param_map_rc msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_value0, bytes, offset + 0); + bitconverter.GetBytes(msg.scale, bytes, offset + 4); + bitconverter.GetBytes(msg.param_value_min, bytes, offset + 8); + bitconverter.GetBytes(msg.param_value_max, bytes, offset + 12); + bitconverter.GetBytes(msg.param_index, bytes, offset + 16); + bytes[offset + 18] = msg.target_system; + bytes[offset + 19] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 20, 16); + bytes[offset + 36] = msg.parameter_rc_channel_index; + offset += 37; + return 50; + } + + internal static int Serialize_MISSION_REQUEST_INT(this Msg_mission_request_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 51; + } + + internal static int Serialize_SAFETY_SET_ALLOWED_AREA(this Msg_safety_set_allowed_area msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.p1x, bytes, offset + 0); + bitconverter.GetBytes(msg.p1y, bytes, offset + 4); + bitconverter.GetBytes(msg.p1z, bytes, offset + 8); + bitconverter.GetBytes(msg.p2x, bytes, offset + 12); + bitconverter.GetBytes(msg.p2y, bytes, offset + 16); + bitconverter.GetBytes(msg.p2z, bytes, offset + 20); + bytes[offset + 24] = msg.target_system; + bytes[offset + 25] = msg.target_component; + bytes[offset + 26] = msg.frame; + offset += 27; + return 54; + } + + internal static int Serialize_SAFETY_ALLOWED_AREA(this Msg_safety_allowed_area msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.p1x, bytes, offset + 0); + bitconverter.GetBytes(msg.p1y, bytes, offset + 4); + bitconverter.GetBytes(msg.p1z, bytes, offset + 8); + bitconverter.GetBytes(msg.p2x, bytes, offset + 12); + bitconverter.GetBytes(msg.p2y, bytes, offset + 16); + bitconverter.GetBytes(msg.p2z, bytes, offset + 20); + bytes[offset + 24] = msg.frame; + offset += 25; + return 55; + } + + internal static int Serialize_ATTITUDE_QUATERNION_COV(this Msg_attitude_quaternion_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 4, 4); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 28); + ByteArrayUtil.ToByteArray(msg.covariance, bytes, offset + 32, 9); + offset += 68; + return 61; + } + + internal static int Serialize_NAV_CONTROLLER_OUTPUT(this Msg_nav_controller_output msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.nav_roll, bytes, offset + 0); + bitconverter.GetBytes(msg.nav_pitch, bytes, offset + 4); + bitconverter.GetBytes(msg.alt_error, bytes, offset + 8); + bitconverter.GetBytes(msg.aspd_error, bytes, offset + 12); + bitconverter.GetBytes(msg.xtrack_error, bytes, offset + 16); + bitconverter.GetBytes(msg.nav_bearing, bytes, offset + 20); + bitconverter.GetBytes(msg.target_bearing, bytes, offset + 22); + bitconverter.GetBytes(msg.wp_dist, bytes, offset + 24); + offset += 26; + return 62; + } + + internal static int Serialize_GLOBAL_POSITION_INT_COV(this Msg_global_position_int_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_utc, bytes, offset + 0); + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 8); + bitconverter.GetBytes(msg.lat, bytes, offset + 12); + bitconverter.GetBytes(msg.lon, bytes, offset + 16); + bitconverter.GetBytes(msg.alt, bytes, offset + 20); + bitconverter.GetBytes(msg.relative_alt, bytes, offset + 24); + bitconverter.GetBytes(msg.vx, bytes, offset + 28); + bitconverter.GetBytes(msg.vy, bytes, offset + 32); + bitconverter.GetBytes(msg.vz, bytes, offset + 36); + ByteArrayUtil.ToByteArray(msg.covariance, bytes, offset + 40, 36); + bytes[offset + 184] = msg.estimator_type; + offset += 185; + return 63; + } + + internal static int Serialize_LOCAL_POSITION_NED_COV(this Msg_local_position_ned_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_utc, bytes, offset + 0); + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 8); + bitconverter.GetBytes(msg.x, bytes, offset + 12); + bitconverter.GetBytes(msg.y, bytes, offset + 16); + bitconverter.GetBytes(msg.z, bytes, offset + 20); + bitconverter.GetBytes(msg.vx, bytes, offset + 24); + bitconverter.GetBytes(msg.vy, bytes, offset + 28); + bitconverter.GetBytes(msg.vz, bytes, offset + 32); + bitconverter.GetBytes(msg.ax, bytes, offset + 36); + bitconverter.GetBytes(msg.ay, bytes, offset + 40); + bitconverter.GetBytes(msg.az, bytes, offset + 44); + ByteArrayUtil.ToByteArray(msg.covariance, bytes, offset + 48, 45); + bytes[offset + 228] = msg.estimator_type; + offset += 229; + return 64; + } + + internal static int Serialize_RC_CHANNELS(this Msg_rc_channels msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 18); + bitconverter.GetBytes(msg.chan9_raw, bytes, offset + 20); + bitconverter.GetBytes(msg.chan10_raw, bytes, offset + 22); + bitconverter.GetBytes(msg.chan11_raw, bytes, offset + 24); + bitconverter.GetBytes(msg.chan12_raw, bytes, offset + 26); + bitconverter.GetBytes(msg.chan13_raw, bytes, offset + 28); + bitconverter.GetBytes(msg.chan14_raw, bytes, offset + 30); + bitconverter.GetBytes(msg.chan15_raw, bytes, offset + 32); + bitconverter.GetBytes(msg.chan16_raw, bytes, offset + 34); + bitconverter.GetBytes(msg.chan17_raw, bytes, offset + 36); + bitconverter.GetBytes(msg.chan18_raw, bytes, offset + 38); + bytes[offset + 40] = msg.chancount; + bytes[offset + 41] = msg.rssi; + offset += 42; + return 65; + } + + internal static int Serialize_REQUEST_DATA_STREAM(this Msg_request_data_stream msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.req_message_rate, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + bytes[offset + 4] = msg.req_stream_id; + bytes[offset + 5] = msg.start_stop; + offset += 6; + return 66; + } + + internal static int Serialize_DATA_STREAM(this Msg_data_stream msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.message_rate, bytes, offset + 0); + bytes[offset + 2] = msg.stream_id; + bytes[offset + 3] = msg.on_off; + offset += 4; + return 67; + } + + internal static int Serialize_MANUAL_CONTROL(this Msg_manual_control msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.x, bytes, offset + 0); + bitconverter.GetBytes(msg.y, bytes, offset + 2); + bitconverter.GetBytes(msg.z, bytes, offset + 4); + bitconverter.GetBytes(msg.r, bytes, offset + 6); + bitconverter.GetBytes(msg.buttons, bytes, offset + 8); + bytes[offset + 10] = msg.target; + offset += 11; + return 69; + } + + internal static int Serialize_RC_CHANNELS_OVERRIDE(this Msg_rc_channels_override msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 0); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 2); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 14); + bytes[offset + 16] = msg.target_system; + bytes[offset + 17] = msg.target_component; + offset += 18; + return 70; + } + + internal static int Serialize_MISSION_ITEM_INT(this Msg_mission_item_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.x, bytes, offset + 16); + bitconverter.GetBytes(msg.y, bytes, offset + 20); + bitconverter.GetBytes(msg.z, bytes, offset + 24); + bitconverter.GetBytes(msg.seq, bytes, offset + 28); + bitconverter.GetBytes(msg.command, bytes, offset + 30); + bytes[offset + 32] = msg.target_system; + bytes[offset + 33] = msg.target_component; + bytes[offset + 34] = msg.frame; + bytes[offset + 35] = msg.current; + bytes[offset + 36] = msg.autocontinue; + offset += 37; + return 73; + } + + internal static int Serialize_VFR_HUD(this Msg_vfr_hud msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.airspeed, bytes, offset + 0); + bitconverter.GetBytes(msg.groundspeed, bytes, offset + 4); + bitconverter.GetBytes(msg.alt, bytes, offset + 8); + bitconverter.GetBytes(msg.climb, bytes, offset + 12); + bitconverter.GetBytes(msg.heading, bytes, offset + 16); + bitconverter.GetBytes(msg.throttle, bytes, offset + 18); + offset += 20; + return 74; + } + + internal static int Serialize_COMMAND_INT(this Msg_command_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.x, bytes, offset + 16); + bitconverter.GetBytes(msg.y, bytes, offset + 20); + bitconverter.GetBytes(msg.z, bytes, offset + 24); + bitconverter.GetBytes(msg.command, bytes, offset + 28); + bytes[offset + 30] = msg.target_system; + bytes[offset + 31] = msg.target_component; + bytes[offset + 32] = msg.frame; + bytes[offset + 33] = msg.current; + bytes[offset + 34] = msg.autocontinue; + offset += 35; + return 75; + } + + internal static int Serialize_COMMAND_LONG(this Msg_command_long msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.param5, bytes, offset + 16); + bitconverter.GetBytes(msg.param6, bytes, offset + 20); + bitconverter.GetBytes(msg.param7, bytes, offset + 24); + bitconverter.GetBytes(msg.command, bytes, offset + 28); + bytes[offset + 30] = msg.target_system; + bytes[offset + 31] = msg.target_component; + bytes[offset + 32] = msg.confirmation; + offset += 33; + return 76; + } + + internal static int Serialize_COMMAND_ACK(this Msg_command_ack msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.command, bytes, offset + 0); + bytes[offset + 2] = msg.result; + offset += 3; + return 77; + } + + internal static int Serialize_MANUAL_SETPOINT(this Msg_manual_setpoint msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.roll, bytes, offset + 4); + bitconverter.GetBytes(msg.pitch, bytes, offset + 8); + bitconverter.GetBytes(msg.yaw, bytes, offset + 12); + bitconverter.GetBytes(msg.thrust, bytes, offset + 16); + bytes[offset + 20] = msg.mode_switch; + bytes[offset + 21] = msg.manual_override_switch; + offset += 22; + return 81; + } + + internal static int Serialize_SET_ATTITUDE_TARGET(this Msg_set_attitude_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 4, 4); + bitconverter.GetBytes(msg.body_roll_rate, bytes, offset + 20); + bitconverter.GetBytes(msg.body_pitch_rate, bytes, offset + 24); + bitconverter.GetBytes(msg.body_yaw_rate, bytes, offset + 28); + bitconverter.GetBytes(msg.thrust, bytes, offset + 32); + bytes[offset + 36] = msg.target_system; + bytes[offset + 37] = msg.target_component; + bytes[offset + 38] = msg.type_mask; + offset += 39; + return 82; + } + + internal static int Serialize_ATTITUDE_TARGET(this Msg_attitude_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 4, 4); + bitconverter.GetBytes(msg.body_roll_rate, bytes, offset + 20); + bitconverter.GetBytes(msg.body_pitch_rate, bytes, offset + 24); + bitconverter.GetBytes(msg.body_yaw_rate, bytes, offset + 28); + bitconverter.GetBytes(msg.thrust, bytes, offset + 32); + bytes[offset + 36] = msg.type_mask; + offset += 37; + return 83; + } + + internal static int Serialize_SET_POSITION_TARGET_LOCAL_NED(this Msg_set_position_target_local_ned msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.target_system; + bytes[offset + 51] = msg.target_component; + bytes[offset + 52] = msg.coordinate_frame; + offset += 53; + return 84; + } + + internal static int Serialize_POSITION_TARGET_LOCAL_NED(this Msg_position_target_local_ned msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.coordinate_frame; + offset += 51; + return 85; + } + + internal static int Serialize_SET_POSITION_TARGET_GLOBAL_INT(this Msg_set_position_target_global_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.lat_int, bytes, offset + 4); + bitconverter.GetBytes(msg.lon_int, bytes, offset + 8); + bitconverter.GetBytes(msg.alt, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.target_system; + bytes[offset + 51] = msg.target_component; + bytes[offset + 52] = msg.coordinate_frame; + offset += 53; + return 86; + } + + internal static int Serialize_POSITION_TARGET_GLOBAL_INT(this Msg_position_target_global_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.lat_int, bytes, offset + 4); + bitconverter.GetBytes(msg.lon_int, bytes, offset + 8); + bitconverter.GetBytes(msg.alt, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.coordinate_frame; + offset += 51; + return 87; + } + + internal static int Serialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(this Msg_local_position_ned_system_global_offset msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.roll, bytes, offset + 16); + bitconverter.GetBytes(msg.pitch, bytes, offset + 20); + bitconverter.GetBytes(msg.yaw, bytes, offset + 24); + offset += 28; + return 89; + } + + internal static int Serialize_HIL_STATE(this Msg_hil_state msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.roll, bytes, offset + 8); + bitconverter.GetBytes(msg.pitch, bytes, offset + 12); + bitconverter.GetBytes(msg.yaw, bytes, offset + 16); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 28); + bitconverter.GetBytes(msg.lat, bytes, offset + 32); + bitconverter.GetBytes(msg.lon, bytes, offset + 36); + bitconverter.GetBytes(msg.alt, bytes, offset + 40); + bitconverter.GetBytes(msg.vx, bytes, offset + 44); + bitconverter.GetBytes(msg.vy, bytes, offset + 46); + bitconverter.GetBytes(msg.vz, bytes, offset + 48); + bitconverter.GetBytes(msg.xacc, bytes, offset + 50); + bitconverter.GetBytes(msg.yacc, bytes, offset + 52); + bitconverter.GetBytes(msg.zacc, bytes, offset + 54); + offset += 56; + return 90; + } + + internal static int Serialize_HIL_CONTROLS(this Msg_hil_controls msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.roll_ailerons, bytes, offset + 8); + bitconverter.GetBytes(msg.pitch_elevator, bytes, offset + 12); + bitconverter.GetBytes(msg.yaw_rudder, bytes, offset + 16); + bitconverter.GetBytes(msg.throttle, bytes, offset + 20); + bitconverter.GetBytes(msg.aux1, bytes, offset + 24); + bitconverter.GetBytes(msg.aux2, bytes, offset + 28); + bitconverter.GetBytes(msg.aux3, bytes, offset + 32); + bitconverter.GetBytes(msg.aux4, bytes, offset + 36); + bytes[offset + 40] = msg.mode; + bytes[offset + 41] = msg.nav_mode; + offset += 42; + return 91; + } + + internal static int Serialize_HIL_RC_INPUTS_RAW(this Msg_hil_rc_inputs_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 18); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 20); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 22); + bitconverter.GetBytes(msg.chan9_raw, bytes, offset + 24); + bitconverter.GetBytes(msg.chan10_raw, bytes, offset + 26); + bitconverter.GetBytes(msg.chan11_raw, bytes, offset + 28); + bitconverter.GetBytes(msg.chan12_raw, bytes, offset + 30); + bytes[offset + 32] = msg.rssi; + offset += 33; + return 92; + } + + internal static int Serialize_OPTICAL_FLOW(this Msg_optical_flow msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.flow_comp_m_x, bytes, offset + 8); + bitconverter.GetBytes(msg.flow_comp_m_y, bytes, offset + 12); + bitconverter.GetBytes(msg.ground_distance, bytes, offset + 16); + bitconverter.GetBytes(msg.flow_x, bytes, offset + 20); + bitconverter.GetBytes(msg.flow_y, bytes, offset + 22); + bytes[offset + 24] = msg.sensor_id; + bytes[offset + 25] = msg.quality; + offset += 26; + return 100; + } + + internal static int Serialize_GLOBAL_VISION_POSITION_ESTIMATE(this Msg_global_vision_position_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + bitconverter.GetBytes(msg.roll, bytes, offset + 20); + bitconverter.GetBytes(msg.pitch, bytes, offset + 24); + bitconverter.GetBytes(msg.yaw, bytes, offset + 28); + offset += 32; + return 101; + } + + internal static int Serialize_VISION_POSITION_ESTIMATE(this Msg_vision_position_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + bitconverter.GetBytes(msg.roll, bytes, offset + 20); + bitconverter.GetBytes(msg.pitch, bytes, offset + 24); + bitconverter.GetBytes(msg.yaw, bytes, offset + 28); + offset += 32; + return 102; + } + + internal static int Serialize_VISION_SPEED_ESTIMATE(this Msg_vision_speed_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + offset += 20; + return 103; + } + + internal static int Serialize_VICON_POSITION_ESTIMATE(this Msg_vicon_position_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + bitconverter.GetBytes(msg.roll, bytes, offset + 20); + bitconverter.GetBytes(msg.pitch, bytes, offset + 24); + bitconverter.GetBytes(msg.yaw, bytes, offset + 28); + offset += 32; + return 104; + } + + internal static int Serialize_HIGHRES_IMU(this Msg_highres_imu msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 8); + bitconverter.GetBytes(msg.yacc, bytes, offset + 12); + bitconverter.GetBytes(msg.zacc, bytes, offset + 16); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.xmag, bytes, offset + 32); + bitconverter.GetBytes(msg.ymag, bytes, offset + 36); + bitconverter.GetBytes(msg.zmag, bytes, offset + 40); + bitconverter.GetBytes(msg.abs_pressure, bytes, offset + 44); + bitconverter.GetBytes(msg.diff_pressure, bytes, offset + 48); + bitconverter.GetBytes(msg.pressure_alt, bytes, offset + 52); + bitconverter.GetBytes(msg.temperature, bytes, offset + 56); + bitconverter.GetBytes(msg.fields_updated, bytes, offset + 60); + offset += 62; + return 105; + } + + internal static int Serialize_OPTICAL_FLOW_RAD(this Msg_optical_flow_rad msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.integration_time_us, bytes, offset + 8); + bitconverter.GetBytes(msg.integrated_x, bytes, offset + 12); + bitconverter.GetBytes(msg.integrated_y, bytes, offset + 16); + bitconverter.GetBytes(msg.integrated_xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.integrated_ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.integrated_zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.time_delta_distance_us, bytes, offset + 32); + bitconverter.GetBytes(msg.distance, bytes, offset + 36); + bitconverter.GetBytes(msg.temperature, bytes, offset + 40); + bytes[offset + 42] = msg.sensor_id; + bytes[offset + 43] = msg.quality; + offset += 44; + return 106; + } + + internal static int Serialize_HIL_SENSOR(this Msg_hil_sensor msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 8); + bitconverter.GetBytes(msg.yacc, bytes, offset + 12); + bitconverter.GetBytes(msg.zacc, bytes, offset + 16); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.xmag, bytes, offset + 32); + bitconverter.GetBytes(msg.ymag, bytes, offset + 36); + bitconverter.GetBytes(msg.zmag, bytes, offset + 40); + bitconverter.GetBytes(msg.abs_pressure, bytes, offset + 44); + bitconverter.GetBytes(msg.diff_pressure, bytes, offset + 48); + bitconverter.GetBytes(msg.pressure_alt, bytes, offset + 52); + bitconverter.GetBytes(msg.temperature, bytes, offset + 56); + bitconverter.GetBytes(msg.fields_updated, bytes, offset + 60); + offset += 64; + return 107; + } + + internal static int Serialize_SIM_STATE(this Msg_sim_state msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.q1, bytes, offset + 0); + bitconverter.GetBytes(msg.q2, bytes, offset + 4); + bitconverter.GetBytes(msg.q3, bytes, offset + 8); + bitconverter.GetBytes(msg.q4, bytes, offset + 12); + bitconverter.GetBytes(msg.roll, bytes, offset + 16); + bitconverter.GetBytes(msg.pitch, bytes, offset + 20); + bitconverter.GetBytes(msg.yaw, bytes, offset + 24); + bitconverter.GetBytes(msg.xacc, bytes, offset + 28); + bitconverter.GetBytes(msg.yacc, bytes, offset + 32); + bitconverter.GetBytes(msg.zacc, bytes, offset + 36); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 40); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 44); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 48); + bitconverter.GetBytes(msg.lat, bytes, offset + 52); + bitconverter.GetBytes(msg.lon, bytes, offset + 56); + bitconverter.GetBytes(msg.alt, bytes, offset + 60); + bitconverter.GetBytes(msg.std_dev_horz, bytes, offset + 64); + bitconverter.GetBytes(msg.std_dev_vert, bytes, offset + 68); + bitconverter.GetBytes(msg.vn, bytes, offset + 72); + bitconverter.GetBytes(msg.ve, bytes, offset + 76); + bitconverter.GetBytes(msg.vd, bytes, offset + 80); + offset += 84; + return 108; + } + + internal static int Serialize_RADIO_STATUS(this Msg_radio_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.rxerrors, bytes, offset + 0); + bitconverter.GetBytes(msg.@fixed, bytes, offset + 2); + bytes[offset + 4] = msg.rssi; + bytes[offset + 5] = msg.remrssi; + bytes[offset + 6] = msg.txbuf; + bytes[offset + 7] = msg.noise; + bytes[offset + 8] = msg.remnoise; + offset += 9; + return 109; + } + + internal static int Serialize_FILE_TRANSFER_PROTOCOL(this Msg_file_transfer_protocol msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_network; + bytes[offset + 1] = msg.target_system; + bytes[offset + 2] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.payload, bytes, offset + 3, 251); + offset += 254; + return 110; + } + + internal static int Serialize_TIMESYNC(this Msg_timesync msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.tc1, bytes, offset + 0); + bitconverter.GetBytes(msg.ts1, bytes, offset + 8); + offset += 16; + return 111; + } + + internal static int Serialize_CAMERA_TRIGGER(this Msg_camera_trigger msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.seq, bytes, offset + 8); + offset += 12; + return 112; + } + + internal static int Serialize_HIL_GPS(this Msg_hil_gps msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.alt, bytes, offset + 16); + bitconverter.GetBytes(msg.eph, bytes, offset + 20); + bitconverter.GetBytes(msg.epv, bytes, offset + 22); + bitconverter.GetBytes(msg.vel, bytes, offset + 24); + bitconverter.GetBytes(msg.vn, bytes, offset + 26); + bitconverter.GetBytes(msg.ve, bytes, offset + 28); + bitconverter.GetBytes(msg.vd, bytes, offset + 30); + bitconverter.GetBytes(msg.cog, bytes, offset + 32); + bytes[offset + 34] = msg.fix_type; + bytes[offset + 35] = msg.satellites_visible; + offset += 36; + return 113; + } + + internal static int Serialize_HIL_OPTICAL_FLOW(this Msg_hil_optical_flow msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.integration_time_us, bytes, offset + 8); + bitconverter.GetBytes(msg.integrated_x, bytes, offset + 12); + bitconverter.GetBytes(msg.integrated_y, bytes, offset + 16); + bitconverter.GetBytes(msg.integrated_xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.integrated_ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.integrated_zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.time_delta_distance_us, bytes, offset + 32); + bitconverter.GetBytes(msg.distance, bytes, offset + 36); + bitconverter.GetBytes(msg.temperature, bytes, offset + 40); + bytes[offset + 42] = msg.sensor_id; + bytes[offset + 43] = msg.quality; + offset += 44; + return 114; + } + + internal static int Serialize_HIL_STATE_QUATERNION(this Msg_hil_state_quaternion msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.attitude_quaternion, bytes, offset + 8, 4); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 28); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 32); + bitconverter.GetBytes(msg.lat, bytes, offset + 36); + bitconverter.GetBytes(msg.lon, bytes, offset + 40); + bitconverter.GetBytes(msg.alt, bytes, offset + 44); + bitconverter.GetBytes(msg.vx, bytes, offset + 48); + bitconverter.GetBytes(msg.vy, bytes, offset + 50); + bitconverter.GetBytes(msg.vz, bytes, offset + 52); + bitconverter.GetBytes(msg.ind_airspeed, bytes, offset + 54); + bitconverter.GetBytes(msg.true_airspeed, bytes, offset + 56); + bitconverter.GetBytes(msg.xacc, bytes, offset + 58); + bitconverter.GetBytes(msg.yacc, bytes, offset + 60); + bitconverter.GetBytes(msg.zacc, bytes, offset + 62); + offset += 64; + return 115; + } + + internal static int Serialize_SCALED_IMU2(this Msg_scaled_imu2 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 4); + bitconverter.GetBytes(msg.yacc, bytes, offset + 6); + bitconverter.GetBytes(msg.zacc, bytes, offset + 8); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 10); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 12); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.xmag, bytes, offset + 16); + bitconverter.GetBytes(msg.ymag, bytes, offset + 18); + bitconverter.GetBytes(msg.zmag, bytes, offset + 20); + offset += 22; + return 116; + } + + internal static int Serialize_LOG_REQUEST_LIST(this Msg_log_request_list msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.start, bytes, offset + 0); + bitconverter.GetBytes(msg.end, bytes, offset + 2); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + offset += 6; + return 117; + } + + internal static int Serialize_LOG_ENTRY(this Msg_log_entry msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_utc, bytes, offset + 0); + bitconverter.GetBytes(msg.size, bytes, offset + 4); + bitconverter.GetBytes(msg.id, bytes, offset + 8); + bitconverter.GetBytes(msg.num_logs, bytes, offset + 10); + bitconverter.GetBytes(msg.last_log_num, bytes, offset + 12); + offset += 14; + return 118; + } + + internal static int Serialize_LOG_REQUEST_DATA(this Msg_log_request_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ofs, bytes, offset + 0); + bitconverter.GetBytes(msg.count, bytes, offset + 4); + bitconverter.GetBytes(msg.id, bytes, offset + 8); + bytes[offset + 10] = msg.target_system; + bytes[offset + 11] = msg.target_component; + offset += 12; + return 119; + } + + internal static int Serialize_LOG_DATA(this Msg_log_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ofs, bytes, offset + 0); + bitconverter.GetBytes(msg.id, bytes, offset + 4); + bytes[offset + 6] = msg.count; + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 7, 90); + offset += 97; + return 120; + } + + internal static int Serialize_LOG_ERASE(this Msg_log_erase msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 121; + } + + internal static int Serialize_LOG_REQUEST_END(this Msg_log_request_end msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 122; + } + + internal static int Serialize_GPS_INJECT_DATA(this Msg_gps_inject_data msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + bytes[offset + 2] = msg.len; + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 3, 110); + offset += 113; + return 123; + } + + internal static int Serialize_GPS2_RAW(this Msg_gps2_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.alt, bytes, offset + 16); + bitconverter.GetBytes(msg.dgps_age, bytes, offset + 20); + bitconverter.GetBytes(msg.eph, bytes, offset + 24); + bitconverter.GetBytes(msg.epv, bytes, offset + 26); + bitconverter.GetBytes(msg.vel, bytes, offset + 28); + bitconverter.GetBytes(msg.cog, bytes, offset + 30); + bytes[offset + 32] = msg.fix_type; + bytes[offset + 33] = msg.satellites_visible; + bytes[offset + 34] = msg.dgps_numch; + offset += 35; + return 124; + } + + internal static int Serialize_POWER_STATUS(this Msg_power_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.Vcc, bytes, offset + 0); + bitconverter.GetBytes(msg.Vservo, bytes, offset + 2); + bitconverter.GetBytes(msg.flags, bytes, offset + 4); + offset += 6; + return 125; + } + + internal static int Serialize_SERIAL_CONTROL(this Msg_serial_control msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.baudrate, bytes, offset + 0); + bitconverter.GetBytes(msg.timeout, bytes, offset + 4); + bytes[offset + 6] = msg.device; + bytes[offset + 7] = msg.flags; + bytes[offset + 8] = msg.count; + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 9, 70); + offset += 79; + return 126; + } + + internal static int Serialize_GPS_RTK(this Msg_gps_rtk msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_last_baseline_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.tow, bytes, offset + 4); + bitconverter.GetBytes(msg.baseline_a_mm, bytes, offset + 8); + bitconverter.GetBytes(msg.baseline_b_mm, bytes, offset + 12); + bitconverter.GetBytes(msg.baseline_c_mm, bytes, offset + 16); + bitconverter.GetBytes(msg.accuracy, bytes, offset + 20); + bitconverter.GetBytes(msg.iar_num_hypotheses, bytes, offset + 24); + bitconverter.GetBytes(msg.wn, bytes, offset + 28); + bytes[offset + 30] = msg.rtk_receiver_id; + bytes[offset + 31] = msg.rtk_health; + bytes[offset + 32] = msg.rtk_rate; + bytes[offset + 33] = msg.nsats; + bytes[offset + 34] = msg.baseline_coords_type; + offset += 35; + return 127; + } + + internal static int Serialize_GPS2_RTK(this Msg_gps2_rtk msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_last_baseline_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.tow, bytes, offset + 4); + bitconverter.GetBytes(msg.baseline_a_mm, bytes, offset + 8); + bitconverter.GetBytes(msg.baseline_b_mm, bytes, offset + 12); + bitconverter.GetBytes(msg.baseline_c_mm, bytes, offset + 16); + bitconverter.GetBytes(msg.accuracy, bytes, offset + 20); + bitconverter.GetBytes(msg.iar_num_hypotheses, bytes, offset + 24); + bitconverter.GetBytes(msg.wn, bytes, offset + 28); + bytes[offset + 30] = msg.rtk_receiver_id; + bytes[offset + 31] = msg.rtk_health; + bytes[offset + 32] = msg.rtk_rate; + bytes[offset + 33] = msg.nsats; + bytes[offset + 34] = msg.baseline_coords_type; + offset += 35; + return 128; + } + + internal static int Serialize_SCALED_IMU3(this Msg_scaled_imu3 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 4); + bitconverter.GetBytes(msg.yacc, bytes, offset + 6); + bitconverter.GetBytes(msg.zacc, bytes, offset + 8); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 10); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 12); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.xmag, bytes, offset + 16); + bitconverter.GetBytes(msg.ymag, bytes, offset + 18); + bitconverter.GetBytes(msg.zmag, bytes, offset + 20); + offset += 22; + return 129; + } + + internal static int Serialize_DATA_TRANSMISSION_HANDSHAKE(this Msg_data_transmission_handshake msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.size, bytes, offset + 0); + bitconverter.GetBytes(msg.width, bytes, offset + 4); + bitconverter.GetBytes(msg.height, bytes, offset + 6); + bitconverter.GetBytes(msg.packets, bytes, offset + 8); + bytes[offset + 10] = msg.type; + bytes[offset + 11] = msg.payload; + bytes[offset + 12] = msg.jpg_quality; + offset += 13; + return 130; + } + + internal static int Serialize_ENCAPSULATED_DATA(this Msg_encapsulated_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seqnr, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 2, 253); + offset += 255; + return 131; + } + + internal static int Serialize_DISTANCE_SENSOR(this Msg_distance_sensor msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.min_distance, bytes, offset + 4); + bitconverter.GetBytes(msg.max_distance, bytes, offset + 6); + bitconverter.GetBytes(msg.current_distance, bytes, offset + 8); + bytes[offset + 10] = msg.type; + bytes[offset + 11] = msg.id; + bytes[offset + 12] = msg.orientation; + bytes[offset + 13] = msg.covariance; + offset += 14; + return 132; + } + + internal static int Serialize_TERRAIN_REQUEST(this Msg_terrain_request msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.mask, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.grid_spacing, bytes, offset + 16); + offset += 18; + return 133; + } + + internal static int Serialize_TERRAIN_DATA(this Msg_terrain_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.lat, bytes, offset + 0); + bitconverter.GetBytes(msg.lon, bytes, offset + 4); + bitconverter.GetBytes(msg.grid_spacing, bytes, offset + 8); + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 10, 16); + bytes[offset + 42] = msg.gridbit; + offset += 43; + return 134; + } + + internal static int Serialize_TERRAIN_CHECK(this Msg_terrain_check msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.lat, bytes, offset + 0); + bitconverter.GetBytes(msg.lon, bytes, offset + 4); + offset += 8; + return 135; + } + + internal static int Serialize_TERRAIN_REPORT(this Msg_terrain_report msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.lat, bytes, offset + 0); + bitconverter.GetBytes(msg.lon, bytes, offset + 4); + bitconverter.GetBytes(msg.terrain_height, bytes, offset + 8); + bitconverter.GetBytes(msg.current_height, bytes, offset + 12); + bitconverter.GetBytes(msg.spacing, bytes, offset + 16); + bitconverter.GetBytes(msg.pending, bytes, offset + 18); + bitconverter.GetBytes(msg.loaded, bytes, offset + 20); + offset += 22; + return 136; + } + + internal static int Serialize_SCALED_PRESSURE2(this Msg_scaled_pressure2 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 4); + bitconverter.GetBytes(msg.press_diff, bytes, offset + 8); + bitconverter.GetBytes(msg.temperature, bytes, offset + 12); + offset += 14; + return 137; + } + + internal static int Serialize_ATT_POS_MOCAP(this Msg_att_pos_mocap msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 8, 4); + bitconverter.GetBytes(msg.x, bytes, offset + 24); + bitconverter.GetBytes(msg.y, bytes, offset + 28); + bitconverter.GetBytes(msg.z, bytes, offset + 32); + offset += 36; + return 138; + } + + internal static int Serialize_SET_ACTUATOR_CONTROL_TARGET(this Msg_set_actuator_control_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.controls, bytes, offset + 8, 8); + bytes[offset + 40] = msg.group_mlx; + bytes[offset + 41] = msg.target_system; + bytes[offset + 42] = msg.target_component; + offset += 43; + return 139; + } + + internal static int Serialize_ACTUATOR_CONTROL_TARGET(this Msg_actuator_control_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.controls, bytes, offset + 8, 8); + bytes[offset + 40] = msg.group_mlx; + offset += 41; + return 140; + } + + internal static int Serialize_ALTITUDE(this Msg_altitude msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.altitude_monotonic, bytes, offset + 8); + bitconverter.GetBytes(msg.altitude_amsl, bytes, offset + 12); + bitconverter.GetBytes(msg.altitude_local, bytes, offset + 16); + bitconverter.GetBytes(msg.altitude_relative, bytes, offset + 20); + bitconverter.GetBytes(msg.altitude_terrain, bytes, offset + 24); + bitconverter.GetBytes(msg.bottom_clearance, bytes, offset + 28); + offset += 32; + return 141; + } + + internal static int Serialize_RESOURCE_REQUEST(this Msg_resource_request msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.request_id; + bytes[offset + 1] = msg.uri_type; + ByteArrayUtil.ToByteArray(msg.uri, bytes, offset + 2, 120); + bytes[offset + 122] = msg.transfer_type; + ByteArrayUtil.ToByteArray(msg.storage, bytes, offset + 123, 120); + offset += 243; + return 142; + } + + internal static int Serialize_SCALED_PRESSURE3(this Msg_scaled_pressure3 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 4); + bitconverter.GetBytes(msg.press_diff, bytes, offset + 8); + bitconverter.GetBytes(msg.temperature, bytes, offset + 12); + offset += 14; + return 143; + } + + internal static int Serialize_FOLLOW_TARGET(this Msg_follow_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.timestamp, bytes, offset + 0); + bitconverter.GetBytes(msg.custom_state, bytes, offset + 8); + bitconverter.GetBytes(msg.lat, bytes, offset + 16); + bitconverter.GetBytes(msg.lon, bytes, offset + 20); + bitconverter.GetBytes(msg.alt, bytes, offset + 24); + ByteArrayUtil.ToByteArray(msg.vel, bytes, offset + 28, 3); + ByteArrayUtil.ToByteArray(msg.acc, bytes, offset + 40, 3); + ByteArrayUtil.ToByteArray(msg.attitude_q, bytes, offset + 52, 4); + ByteArrayUtil.ToByteArray(msg.rates, bytes, offset + 68, 3); + ByteArrayUtil.ToByteArray(msg.position_cov, bytes, offset + 80, 3); + bytes[offset + 92] = msg.est_capabilities; + offset += 93; + return 144; + } + + internal static int Serialize_CONTROL_SYSTEM_STATE(this Msg_control_system_state msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x_acc, bytes, offset + 8); + bitconverter.GetBytes(msg.y_acc, bytes, offset + 12); + bitconverter.GetBytes(msg.z_acc, bytes, offset + 16); + bitconverter.GetBytes(msg.x_vel, bytes, offset + 20); + bitconverter.GetBytes(msg.y_vel, bytes, offset + 24); + bitconverter.GetBytes(msg.z_vel, bytes, offset + 28); + bitconverter.GetBytes(msg.x_pos, bytes, offset + 32); + bitconverter.GetBytes(msg.y_pos, bytes, offset + 36); + bitconverter.GetBytes(msg.z_pos, bytes, offset + 40); + bitconverter.GetBytes(msg.airspeed, bytes, offset + 44); + ByteArrayUtil.ToByteArray(msg.vel_variance, bytes, offset + 48, 3); + ByteArrayUtil.ToByteArray(msg.pos_variance, bytes, offset + 60, 3); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 72, 4); + bitconverter.GetBytes(msg.roll_rate, bytes, offset + 88); + bitconverter.GetBytes(msg.pitch_rate, bytes, offset + 92); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 96); + offset += 100; + return 146; + } + + internal static int Serialize_BATTERY_STATUS(this Msg_battery_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.current_consumed, bytes, offset + 0); + bitconverter.GetBytes(msg.energy_consumed, bytes, offset + 4); + bitconverter.GetBytes(msg.temperature, bytes, offset + 8); + ByteArrayUtil.ToByteArray(msg.voltages, bytes, offset + 10, 10); + bitconverter.GetBytes(msg.current_battery, bytes, offset + 30); + bytes[offset + 32] = msg.id; + bytes[offset + 33] = msg.battery_function; + bytes[offset + 34] = msg.type; + bytes[offset + 35] = unchecked((byte)msg.battery_remaining); + offset += 36; + return 147; + } + + internal static int Serialize_AUTOPILOT_VERSION(this Msg_autopilot_version msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.capabilities, bytes, offset + 0); + bitconverter.GetBytes(msg.uid, bytes, offset + 8); + bitconverter.GetBytes(msg.flight_sw_version, bytes, offset + 16); + bitconverter.GetBytes(msg.middleware_sw_version, bytes, offset + 20); + bitconverter.GetBytes(msg.os_sw_version, bytes, offset + 24); + bitconverter.GetBytes(msg.board_version, bytes, offset + 28); + bitconverter.GetBytes(msg.vendor_id, bytes, offset + 32); + bitconverter.GetBytes(msg.product_id, bytes, offset + 34); + ByteArrayUtil.ToByteArray(msg.flight_custom_version, bytes, offset + 36, 8); + ByteArrayUtil.ToByteArray(msg.middleware_custom_version, bytes, offset + 44, 8); + ByteArrayUtil.ToByteArray(msg.os_custom_version, bytes, offset + 52, 8); + offset += 60; + return 148; + } + + internal static int Serialize_LANDING_TARGET(this Msg_landing_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.angle_x, bytes, offset + 8); + bitconverter.GetBytes(msg.angle_y, bytes, offset + 12); + bitconverter.GetBytes(msg.distance, bytes, offset + 16); + bitconverter.GetBytes(msg.size_x, bytes, offset + 20); + bitconverter.GetBytes(msg.size_y, bytes, offset + 24); + bytes[offset + 28] = msg.target_num; + bytes[offset + 29] = msg.frame; + offset += 30; + return 149; + } + + internal static int Serialize_ESTIMATOR_STATUS(this Msg_estimator_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.vel_ratio, bytes, offset + 8); + bitconverter.GetBytes(msg.pos_horiz_ratio, bytes, offset + 12); + bitconverter.GetBytes(msg.pos_vert_ratio, bytes, offset + 16); + bitconverter.GetBytes(msg.mag_ratio, bytes, offset + 20); + bitconverter.GetBytes(msg.hagl_ratio, bytes, offset + 24); + bitconverter.GetBytes(msg.tas_ratio, bytes, offset + 28); + bitconverter.GetBytes(msg.pos_horiz_accuracy, bytes, offset + 32); + bitconverter.GetBytes(msg.pos_vert_accuracy, bytes, offset + 36); + bitconverter.GetBytes(msg.flags, bytes, offset + 40); + offset += 42; + return 230; + } + + internal static int Serialize_WIND_COV(this Msg_wind_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.wind_x, bytes, offset + 8); + bitconverter.GetBytes(msg.wind_y, bytes, offset + 12); + bitconverter.GetBytes(msg.wind_z, bytes, offset + 16); + bitconverter.GetBytes(msg.var_horiz, bytes, offset + 20); + bitconverter.GetBytes(msg.var_vert, bytes, offset + 24); + bitconverter.GetBytes(msg.wind_alt, bytes, offset + 28); + bitconverter.GetBytes(msg.horiz_accuracy, bytes, offset + 32); + bitconverter.GetBytes(msg.vert_accuracy, bytes, offset + 36); + offset += 40; + return 231; + } + + internal static int Serialize_VIBRATION(this Msg_vibration msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.vibration_x, bytes, offset + 8); + bitconverter.GetBytes(msg.vibration_y, bytes, offset + 12); + bitconverter.GetBytes(msg.vibration_z, bytes, offset + 16); + bitconverter.GetBytes(msg.clipping_0, bytes, offset + 20); + bitconverter.GetBytes(msg.clipping_1, bytes, offset + 24); + bitconverter.GetBytes(msg.clipping_2, bytes, offset + 28); + offset += 32; + return 241; + } + + internal static int Serialize_HOME_POSITION(this Msg_home_position msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + bitconverter.GetBytes(msg.x, bytes, offset + 12); + bitconverter.GetBytes(msg.y, bytes, offset + 16); + bitconverter.GetBytes(msg.z, bytes, offset + 20); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 24, 4); + bitconverter.GetBytes(msg.approach_x, bytes, offset + 40); + bitconverter.GetBytes(msg.approach_y, bytes, offset + 44); + bitconverter.GetBytes(msg.approach_z, bytes, offset + 48); + offset += 52; + return 242; + } + + internal static int Serialize_SET_HOME_POSITION(this Msg_set_home_position msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + bitconverter.GetBytes(msg.x, bytes, offset + 12); + bitconverter.GetBytes(msg.y, bytes, offset + 16); + bitconverter.GetBytes(msg.z, bytes, offset + 20); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 24, 4); + bitconverter.GetBytes(msg.approach_x, bytes, offset + 40); + bitconverter.GetBytes(msg.approach_y, bytes, offset + 44); + bitconverter.GetBytes(msg.approach_z, bytes, offset + 48); + bytes[offset + 52] = msg.target_system; + offset += 53; + return 243; + } + + internal static int Serialize_MESSAGE_INTERVAL(this Msg_message_interval msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.interval_us, bytes, offset + 0); + bitconverter.GetBytes(msg.message_id, bytes, offset + 4); + offset += 6; + return 244; + } + + internal static int Serialize_EXTENDED_SYS_STATE(this Msg_extended_sys_state msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.vtol_state; + bytes[offset + 1] = msg.landed_state; + offset += 2; + return 245; + } + + internal static int Serialize_ADSB_VEHICLE(this Msg_adsb_vehicle msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ICAO_address, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 4); + bitconverter.GetBytes(msg.lon, bytes, offset + 8); + bitconverter.GetBytes(msg.altitude, bytes, offset + 12); + bitconverter.GetBytes(msg.heading, bytes, offset + 16); + bitconverter.GetBytes(msg.hor_velocity, bytes, offset + 18); + bitconverter.GetBytes(msg.ver_velocity, bytes, offset + 20); + bitconverter.GetBytes(msg.flags, bytes, offset + 22); + bitconverter.GetBytes(msg.squawk, bytes, offset + 24); + bytes[offset + 26] = msg.altitude_type; + ByteArrayUtil.ToByteArray(msg.callsign, bytes, offset + 27, 9); + bytes[offset + 36] = msg.emitter_type; + bytes[offset + 37] = msg.tslc; + offset += 38; + return 246; + } + + internal static int Serialize_V2_EXTENSION(this Msg_v2_extension msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.message_type, bytes, offset + 0); + bytes[offset + 2] = msg.target_network; + bytes[offset + 3] = msg.target_system; + bytes[offset + 4] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.payload, bytes, offset + 5, 249); + offset += 254; + return 248; + } + + internal static int Serialize_MEMORY_VECT(this Msg_memory_vect msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.address, bytes, offset + 0); + bytes[offset + 2] = msg.ver; + bytes[offset + 3] = msg.type; + ByteArrayUtil.ToByteArray(msg.value, bytes, offset + 4, 32); + offset += 36; + return 249; + } + + internal static int Serialize_DEBUG_VECT(this Msg_debug_vect msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + ByteArrayUtil.ToByteArray(msg.name, bytes, offset + 20, 10); + offset += 30; + return 250; + } + + internal static int Serialize_NAMED_VALUE_FLOAT(this Msg_named_value_float msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.value, bytes, offset + 4); + ByteArrayUtil.ToByteArray(msg.name, bytes, offset + 8, 10); + offset += 18; + return 251; + } + + internal static int Serialize_NAMED_VALUE_INT(this Msg_named_value_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.value, bytes, offset + 4); + ByteArrayUtil.ToByteArray(msg.name, bytes, offset + 8, 10); + offset += 18; + return 252; + } + + internal static int Serialize_STATUSTEXT(this Msg_statustext msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.severity; + ByteArrayUtil.ToByteArray(msg.text, bytes, offset + 1, 50); + offset += 51; + return 253; + } + + internal static int Serialize_DEBUG(this Msg_debug msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.value, bytes, offset + 4); + bytes[offset + 8] = msg.ind; + offset += 9; + return 254; + } + } + +} + diff --git a/oroca_bldc_gui/Serial/UpgradeLog.XML b/oroca_bldc_gui/Serial/UpgradeLog.XML new file mode 100644 index 0000000..ee5dae6 --- /dev/null +++ b/oroca_bldc_gui/Serial/UpgradeLog.XML @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport.css b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport.css new file mode 100644 index 0000000..fae98af --- /dev/null +++ b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport.css @@ -0,0 +1,207 @@ +BODY +{ + BACKGROUND-COLOR: white; + FONT-FAMILY: "Verdana", sans-serif; + FONT-SIZE: 100%; + MARGIN-LEFT: 0px; + MARGIN-TOP: 0px +} +P +{ + FONT-FAMILY: "Verdana", sans-serif; + FONT-SIZE: 70%; + LINE-HEIGHT: 12pt; + MARGIN-BOTTOM: 0px; + MARGIN-LEFT: 10px; + MARGIN-TOP: 10px +} +.note +{ + BACKGROUND-COLOR: #ffffff; + COLOR: #336699; + FONT-FAMILY: "Verdana", sans-serif; + FONT-SIZE: 100%; + MARGIN-BOTTOM: 0px; + MARGIN-LEFT: 0px; + MARGIN-TOP: 0px; + PADDING-RIGHT: 10px +} +.infotable +{ + BACKGROUND-COLOR: #f0f0e0; + BORDER-BOTTOM: #ffffff 0px solid; + BORDER-COLLAPSE: collapse; + BORDER-LEFT: #ffffff 0px solid; + BORDER-RIGHT: #ffffff 0px solid; + BORDER-TOP: #ffffff 0px solid; + FONT-SIZE: 70%; + MARGIN-LEFT: 10px +} +.issuetable +{ + BACKGROUND-COLOR: #ffffe8; + BORDER-COLLAPSE: collapse; + COLOR: #000000; + FONT-SIZE: 100%; + MARGIN-BOTTOM: 10px; + MARGIN-LEFT: 13px; + MARGIN-TOP: 0px +} +.issuetitle +{ + BACKGROUND-COLOR: #ffffff; + BORDER-BOTTOM: #dcdcdc 1px solid; + BORDER-TOP: #dcdcdc 1px; + COLOR: #003366; + FONT-WEIGHT: normal +} +.header +{ + BACKGROUND-COLOR: #cecf9c; + BORDER-BOTTOM: #ffffff 1px solid; + BORDER-LEFT: #ffffff 1px solid; + BORDER-RIGHT: #ffffff 1px solid; + BORDER-TOP: #ffffff 1px solid; + COLOR: #000000; + FONT-WEIGHT: bold +} +.issuehdr +{ + BACKGROUND-COLOR: #E0EBF5; + BORDER-BOTTOM: #dcdcdc 1px solid; + BORDER-TOP: #dcdcdc 1px solid; + COLOR: #000000; + FONT-WEIGHT: normal +} +.issuenone +{ + BACKGROUND-COLOR: #ffffff; + BORDER-BOTTOM: 0px; + BORDER-LEFT: 0px; + BORDER-RIGHT: 0px; + BORDER-TOP: 0px; + COLOR: #000000; + FONT-WEIGHT: normal +} +.content +{ + BACKGROUND-COLOR: #e7e7ce; + BORDER-BOTTOM: #ffffff 1px solid; + BORDER-LEFT: #ffffff 1px solid; + BORDER-RIGHT: #ffffff 1px solid; + BORDER-TOP: #ffffff 1px solid; + PADDING-LEFT: 3px +} +.issuecontent +{ + BACKGROUND-COLOR: #ffffff; + BORDER-BOTTOM: #dcdcdc 1px solid; + BORDER-TOP: #dcdcdc 1px solid; + PADDING-LEFT: 3px +} +A:link +{ + COLOR: #cc6633; + TEXT-DECORATION: underline +} +A:visited +{ + COLOR: #cc6633; +} +A:active +{ + COLOR: #cc6633; +} +A:hover +{ + COLOR: #cc3300; + TEXT-DECORATION: underline +} +H1 +{ + BACKGROUND-COLOR: #003366; + BORDER-BOTTOM: #336699 6px solid; + COLOR: #ffffff; + FONT-SIZE: 130%; + FONT-WEIGHT: normal; + MARGIN: 0em 0em 0em -20px; + PADDING-BOTTOM: 8px; + PADDING-LEFT: 30px; + PADDING-TOP: 16px +} +H2 +{ + COLOR: #000000; + FONT-SIZE: 80%; + FONT-WEIGHT: bold; + MARGIN-BOTTOM: 3px; + MARGIN-LEFT: 10px; + MARGIN-TOP: 20px; + PADDING-LEFT: 0px +} +H3 +{ + COLOR: #000000; + FONT-SIZE: 80%; + FONT-WEIGHT: bold; + MARGIN-BOTTOM: -5px; + MARGIN-LEFT: 10px; + MARGIN-TOP: 20px +} +H4 +{ + COLOR: #000000; + FONT-SIZE: 70%; + FONT-WEIGHT: bold; + MARGIN-BOTTOM: 0px; + MARGIN-TOP: 15px; + PADDING-BOTTOM: 0px +} +UL +{ + COLOR: #000000; + FONT-SIZE: 70%; + LIST-STYLE: square; + MARGIN-BOTTOM: 0pt; + MARGIN-TOP: 0pt +} +OL +{ + COLOR: #000000; + FONT-SIZE: 70%; + LIST-STYLE: square; + MARGIN-BOTTOM: 0pt; + MARGIN-TOP: 0pt +} +LI +{ + LIST-STYLE: square; + MARGIN-LEFT: 0px +} +.expandable +{ + CURSOR: hand +} +.expanded +{ + color: black +} +.collapsed +{ + DISPLAY: none +} +.foot +{ +BACKGROUND-COLOR: #ffffff; +BORDER-BOTTOM: #cecf9c 1px solid; +BORDER-TOP: #cecf9c 2px solid +} +.settings +{ +MARGIN-LEFT: 25PX; +} +.help +{ +TEXT-ALIGN: right; +margin-right: 10px; +} diff --git a/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport.xslt b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport.xslt new file mode 100644 index 0000000..a55eab9 --- /dev/null +++ b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport.xslt @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ 솔루션: + 프로ì íЏ: + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + src + + + + + + + + + + + + +
íŒŒì¼ ì´ë¦„ìƒíƒœì˜¤ë¥˜ê²½ê³ 
+ javascript:document.images[''].click()src + + + + ë³€í™˜ë¨ + + + + ë³€í™˜ë¨ + +
+ + íŒŒì¼ + + + 1 íŒŒì¼ + + + 변환ë¨:
+ 변환ë˜ì§€ 않ìŒ: +
+
+
+ + + + : + + + + + + + + + 변환 보고서 + <xsl:if test="Properties/Property[@Name='LogNumber']"> + <xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/> + </xsl:if> + + + + +

변환 보고서 -

+ +

+ 변환 시간:
+

+ + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + +
+ 변환 설정 +

+ + +
+
diff --git a/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport_Minus.gif b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport_Minus.gif new file mode 100644 index 0000000..17751cb Binary files /dev/null and b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport_Minus.gif differ diff --git a/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport_Plus.gif b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport_Plus.gif new file mode 100644 index 0000000..f6009ca Binary files /dev/null and b/oroca_bldc_gui/Serial/_UpgradeReport_Files/UpgradeReport_Plus.gif differ diff --git a/oroca_bldc_gui/Serial/mavlink/ByteArrayUtil.cs b/oroca_bldc_gui/Serial/mavlink/ByteArrayUtil.cs new file mode 100644 index 0000000..0c2844e --- /dev/null +++ b/oroca_bldc_gui/Serial/mavlink/ByteArrayUtil.cs @@ -0,0 +1,198 @@ +using System; +using System.Text; + +namespace MavLink +{ + internal static class ByteArrayUtil + { +#if MF_FRAMEWORK_VERSION_V4_1 + private static readonly MavBitConverter bitConverter = new MavBitConverter(); +#else + private static readonly FrameworkBitConverter bitConverter = new FrameworkBitConverter(); +#endif + + public static byte[] ToChar(byte[] source, int sourceOffset, int size) + { + var bytes = new byte[size]; + + for (int i = 0; i < size; i++) + bytes[i] = source[i + sourceOffset]; + + return bytes; + } + + public static byte[] ToUInt8(byte[] source, int sourceOffset, int size) + { + var bytes = new byte[size]; + Array.Copy(source, sourceOffset, bytes, 0, size); + return bytes; + } + + public static sbyte[] ToInt8(byte[] source, int sourceOffset, int size) + { + var bytes = new sbyte[size]; + + for (int i = 0; i < size; i++) + bytes[i] = unchecked((sbyte)source[i + sourceOffset]); + + return bytes; + } + + public static UInt16[] ToUInt16(byte[] source, int sourceOffset, int size) + { + var arr = new UInt16[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToUInt16(source, sourceOffset + (i * sizeof (UInt16))); + return arr; + } + + public static Int16[] ToInt16(byte[] source, int sourceOffset, int size) + { + var arr = new Int16[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToInt16(source, sourceOffset + (i * sizeof(Int16))); + return arr; + } + + public static UInt32[] ToUInt32(byte[] source, int sourceOffset, int size) + { + var arr = new UInt32[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToUInt32(source, sourceOffset + (i * sizeof(UInt32))); + return arr; + } + + public static Int32[] ToInt32(byte[] source, int sourceOffset, int size) + { + var arr = new Int32[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToInt32(source, sourceOffset + (i * sizeof(Int32))); + return arr; + } + + public static UInt64[] ToUInt64(byte[] source, int sourceOffset, int size) + { + var arr = new UInt64[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToUInt64(source, sourceOffset + (i * sizeof(UInt64))); + return arr; + } + + public static Int64[] ToInt64(byte[] source, int sourceOffset, int size) + { + var arr = new Int64[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToInt64(source, sourceOffset + (i * sizeof(Int64))); + return arr; + } + + public static Single[] ToSingle(byte[] source, int sourceOffset, int size) + { + var arr = new Single[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToSingle(source, sourceOffset + (i * sizeof(Single))); + return arr; + } + + public static Double[] ToDouble(byte[] source, int sourceOffset, int size) + { + var arr = new Double[size]; + for (int i = 0; i < size; i++) + arr[i] = bitConverter.ToDouble(source, sourceOffset + (i * sizeof(Double))); + return arr; + } + + public static void ToByteArray(byte[] src, byte[] dst, int offset, int size) + { + int i; + for (i = 0; i < src.Length; i++) + dst[offset + i] = src[i]; + while (i++ < size) + dst[offset + i] = 0; + } + + public static void ToByteArray(sbyte[] src, byte[] dst, int offset, int size) + { + int i; + for (i = 0; i < size && i + /// converter from byte[] => primitive CLR types + /// delegates to the .Net framework bitconverter for speed, and to avoid using unsafe pointer + /// casting for Silverlight. + /// + internal class FrameworkBitConverter + { + private bool _shouldReverse = false; + + public void SetDataIsLittleEndian(bool islittle) + { + _shouldReverse = islittle == !BitConverter.IsLittleEndian; + } + + public UInt16 ToUInt16(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new[] {value[startIndex + 1], value[startIndex]}; + return BitConverter.ToUInt16(bytes,0); + } + return BitConverter.ToUInt16(value, startIndex); + } + + public Int16 ToInt16(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new[] { value[startIndex + 1], value[startIndex] }; + return BitConverter.ToInt16(bytes, 0); + } + return BitConverter.ToInt16(value, startIndex); + } + + public sbyte ToInt8(byte[] value, int startIndex) + { + return unchecked((sbyte)value[startIndex]); + } + + public Int32 ToInt32(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[4]; + Array.Copy(value,startIndex,bytes,0,4); + Array.Reverse(bytes); + return BitConverter.ToInt32(bytes, 0); + } + return BitConverter.ToInt32(value, startIndex); + } + + public UInt32 ToUInt32(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[4]; + Array.Copy(value, startIndex, bytes, 0, 4); + Array.Reverse(bytes); + return BitConverter.ToUInt32(bytes, 0); + } + return BitConverter.ToUInt32(value, startIndex); + } + + public UInt64 ToUInt64(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[8]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToUInt64(bytes, 0); + } + return BitConverter.ToUInt64(value, startIndex); + } + + public Int64 ToInt64(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[8]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToInt64(bytes, 0); + } + return BitConverter.ToInt64(value, startIndex); + } + + public Single ToSingle(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[4]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToSingle(bytes, 0); + } + return BitConverter.ToSingle(value, startIndex); + } + + public Double ToDouble(byte[] value, int startIndex) + { + if (_shouldReverse) + { + var bytes = new byte[8]; + Array.Copy(value, startIndex, bytes, 0, bytes.Length); + Array.Reverse(bytes); + return BitConverter.ToDouble(bytes, 0); + } + return BitConverter.ToDouble(value, startIndex); + } + + public void GetBytes(Double value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + Array.Copy(bytes, 0, dst, offset, bytes.Length); + + } + + public void GetBytes(Single value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(UInt64 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(Int64 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(UInt32 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(Int16 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(Int32 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public void GetBytes(UInt16 value, byte[] dst, int offset) + { + var bytes = BitConverter.GetBytes(value); + if (_shouldReverse) Array.Reverse(bytes); + + Array.Copy(bytes, 0, dst, offset, bytes.Length); + } + + public byte[] GetBytes(sbyte value) + { + return new byte[1] + { + (byte)value, + }; + } + } +} \ No newline at end of file diff --git a/oroca_bldc_gui/Serial/mavlink/Mavlink.cs b/oroca_bldc_gui/Serial/mavlink/Mavlink.cs new file mode 100644 index 0000000..299728d --- /dev/null +++ b/oroca_bldc_gui/Serial/mavlink/Mavlink.cs @@ -0,0 +1,437 @@ +using System; +using MavLink; + +namespace MavLink +{ + /// + /// Mavlink communication class. + /// + /// + /// Keeps track of state across send and receive of packets. + /// User of this class can just send Mavlink Messsages, and + /// receive them by feeding this class bytes off the wire as + /// they arrive + /// + public class Mavlink + { + private byte[] leftovers; + + /// + /// Event raised when a message is decoded successfully + /// + public event PacketReceivedEventHandler PacketReceived; + + /// + /// Total number of packets successfully received so far + /// + public UInt32 PacketsReceived { get; private set; } + + /// + /// Total number of packets which have been rejected due to a failed crc + /// + public UInt32 BadCrcPacketsReceived { get; private set; } + + /// + /// Raised when a packet does not pass CRC + /// + public event PacketCRCFailEventHandler PacketFailedCRC; + + /// + /// Raised when a number of bytes are passed over and cannot + /// be used to decode a packet + /// + public event PacketCRCFailEventHandler BytesUnused; + + // The current packet sequence number for transmission + // public so it can be manipulated for testing + // Normal usage would only read this + public byte txPacketSequence; + + /// + /// Create a new MavlinkLink Object + /// + public Mavlink() + { + MavLinkSerializer.SetDataIsLittleEndian(MavlinkSettings.IsLittleEndian); + leftovers = new byte[] {}; + } + + + /// + /// Process latest bytes from the stream. Received packets will be raised in the event + /// + public void ParseBytes(byte[] newlyReceived) + { + uint i = 0; + + // copy the old and new into a contiguous array + // This is pretty inefficient... + var bytesToProcess = new byte[newlyReceived.Length + leftovers.Length]; + int j = 0; + + for (i = 0; i < leftovers.Length; i++) + bytesToProcess[j++] = leftovers[i]; + + for (i = 0; i < newlyReceived.Length; i++) + bytesToProcess[j++] = newlyReceived[i]; + + i = 0; + + // we are going to loop and decode packets until we use up the data + // at which point we will return. Hence one call to this method could + // result in multiple packet decode events + while (true) + { + // Hunt for the start char + int huntStartPos = (int)i; + + while (i < bytesToProcess.Length && bytesToProcess[i] != MavlinkSettings.ProtocolMarker) + i++; + + if (i == bytesToProcess.Length) + { + // No start byte found in all our bytes. Dump them, Exit. + leftovers = new byte[] { }; + return; + } + + if (i > huntStartPos) + { + // if we get here then are some bytes which this code thinks are + // not interesting and would be dumped. For diagnostics purposes, + // lets pop these bytes up in an event. + if (BytesUnused != null) + { + var badBytes = new byte[i - huntStartPos]; + Array.Copy(bytesToProcess, huntStartPos, badBytes, 0, (int)(i - huntStartPos)); + BytesUnused(this, new PacketCRCFailEventArgs(badBytes, bytesToProcess.Length - huntStartPos)); + } + } + + // We need at least the minimum length of a packet to process it. + // The minimum packet length is 8 bytes for acknowledgement packets without payload + // if we don't have the minimum now, go round again + if (bytesToProcess.Length - i < 8) + { + leftovers = new byte[bytesToProcess.Length - i]; + j = 0; + while (i < bytesToProcess.Length) + leftovers[j++] = bytesToProcess[i++]; + return; + } + + /* + * Byte order: + * + * 0 Packet start sign + * 1 Payload length 0 - 255 + * 2 Packet sequence 0 - 255 + * 3 System ID 1 - 255 + * 4 Component ID 0 - 255 + * 5 Message ID 0 - 255 + * 6 to (n+6) Data (0 - 255) bytes + * (n+7) to (n+8) Checksum (high byte, low byte) for v0.9, lowbyte, highbyte for 1.0 + * + */ + UInt16 payLoadLength = bytesToProcess[i + 1]; + + // Now we know the packet length, + // If we don't have enough bytes in this packet to satisfy that packet lenghth, + // then dump the whole lot in the leftovers and do nothing else - go round again + if (payLoadLength > (bytesToProcess.Length - i - 8)) // payload + 'overhead' bytes (crc, system etc) + { + // back up to the start char for next cycle + j = 0; + + leftovers = new byte[bytesToProcess.Length - i]; + + for (; i < bytesToProcess.Length; i++) + { + leftovers[j++] = bytesToProcess[i]; + } + return; + } + + i++; + + // Check the CRC. Does not include the starting 'U' byte but does include the length + var crc1 = Mavlink_Crc.Calculate(bytesToProcess, (UInt16)(i), (UInt16)(payLoadLength + 5)); + + if (MavlinkSettings.CrcExtra) + { + var possibleMsgId = bytesToProcess[i + 4]; + + if (!MavLinkSerializer.Lookup.ContainsKey(possibleMsgId)) + { + // we have received an unknown message. In this case we don't know the special + // CRC extra, so we have no choice but to fail. + + // The way we do this is to just let the procedure continue + // There will be a natural failure of the main packet CRC + } + else + { + var extra = MavLinkSerializer.Lookup[possibleMsgId]; + crc1 = Mavlink_Crc.CrcAccumulate(extra.CrcExtra, crc1); + } + } + + byte crcHigh = (byte)(crc1 & 0xFF); + byte crcLow = (byte)(crc1 >> 8); + + byte messageCrcHigh = bytesToProcess[i + 5 + payLoadLength]; + byte messageCrcLow = bytesToProcess[i + 6 + payLoadLength]; + + if (messageCrcHigh == crcHigh && messageCrcLow == crcLow) + { + // This is used for data drop outs metrics, not packet windows + // so we should consider this here. + // We pass up to subscribers only as an advisory thing + var rxPacketSequence = bytesToProcess[++i]; + i++; + var packet = new byte[payLoadLength + 3]; // +3 because we are going to send up the sys and comp id and msg type with the data + + for (j = 0; j < packet.Length; j++) + packet[j] = bytesToProcess[i + j]; + + var debugArray = new byte[payLoadLength + 7]; + Array.Copy(bytesToProcess, (int)(i - 3), debugArray, 0, debugArray.Length); + + //OnPacketDecoded(packet, rxPacketSequence, debugArray); + + ProcessPacketBytes(packet, rxPacketSequence); + + PacketsReceived++; + + // clear leftovers, just incase this is the last packet + leftovers = new byte[] { }; + + // advance i here by j to avoid unecessary hunting + // todo: could advance by j + 2 I think? + i = i + (uint)(j + 2); + } + else + { + var badBytes = new byte[i + 7 + payLoadLength]; + Array.Copy(bytesToProcess, (int)(i - 1), badBytes, 0, payLoadLength + 7); + + if (PacketFailedCRC != null) + { + PacketFailedCRC(this, new PacketCRCFailEventArgs(badBytes, (int)(bytesToProcess.Length - i - 1))); + } + + BadCrcPacketsReceived++; + } + } + } + + public byte[] Send(MavlinkPacket mavlinkPacket) + { + var bytes = this.Serialize(mavlinkPacket.Message, mavlinkPacket.SystemId, mavlinkPacket.ComponentId); + return SendPacketLinkLayer(bytes); + } + + // Send a raw message over the link - + // this will add start byte, lenghth, crc and other link layer stuff + private byte[] SendPacketLinkLayer(byte[] packetData) + { + /* + * Byte order: + * + * 0 Packet start sign + * 1 Payload length 0 - 255 + * 2 Packet sequence 0 - 255 + * 3 System ID 1 - 255 + * 4 Component ID 0 - 255 + * 5 Message ID 0 - 255 + * 6 to (n+6) Data (0 - 255) bytes + * (n+7) to (n+8) Checksum (high byte, low byte) + * + */ + var outBytes = new byte[packetData.Length + 5]; + + outBytes[0] = MavlinkSettings.ProtocolMarker; + outBytes[1] = (byte)(packetData.Length-3); // 3 bytes for sequence, id, msg type which this + // layer does not concern itself with + outBytes[2] = unchecked(txPacketSequence++); + + int i; + + for ( i = 0; i < packetData.Length; i++) + { + outBytes[i + 3] = packetData[i]; + } + + // Check the CRC. Does not include the starting byte but does include the length + var crc1 = Mavlink_Crc.Calculate(outBytes, 1, (UInt16)(packetData.Length + 2)); + + if (MavlinkSettings.CrcExtra) + { + var possibleMsgId = outBytes[5]; + var extra = MavLinkSerializer.Lookup[possibleMsgId]; + crc1 = Mavlink_Crc.CrcAccumulate(extra.CrcExtra, crc1); + } + + byte crc_high = (byte)(crc1 & 0xFF); + byte crc_low = (byte)(crc1 >> 8); + + outBytes[i + 3] = crc_high; + outBytes[i + 4] = crc_low; + + return outBytes; + } + + + // Process a raw packet in it's entirety in the given byte array + // if deserialization is successful, then the packetdecoded event will be raised + private void ProcessPacketBytes(byte[] packetBytes, byte rxPacketSequence) + { + // System ID 1 - 255 + // Component ID 0 - 255 + // Message ID 0 - 255 + // 6 to (n+6) Data (0 - 255) bytes + var packet = new MavlinkPacket + { + SystemId = packetBytes[0], + ComponentId = packetBytes[1], + SequenceNumber = rxPacketSequence, + Message = this.Deserialize(packetBytes, 2) + }; + + if (PacketReceived != null) + { + PacketReceived(this, packet); + } + + // else do what? + } + + + public MavlinkMessage Deserialize(byte[] bytes, int offset) + { + // first byte is the mavlink + var packetNum = (int)bytes[offset + 0]; + var packetGen = MavLinkSerializer.Lookup[packetNum].Deserializer; + return packetGen.Invoke(bytes, offset + 1); + } + + public byte[] Serialize(MavlinkMessage message, int systemId, int componentId) + { + var buff = new byte[256]; + + buff[0] = (byte)systemId; + buff[1] = (byte)componentId; + + var endPos = 3; + + var msgId = message.Serialize(buff, ref endPos); + + buff[2] = (byte)msgId; + + var resultBytes = new byte[endPos]; + Array.Copy(buff, resultBytes, endPos); + + return resultBytes; + } + } + + + /// + /// Describes an occurance when a packet fails CRC + /// + public class PacketCRCFailEventArgs : EventArgs + { + /// + /// + public PacketCRCFailEventArgs(byte[] badPacket, int offset) + { + BadPacket = badPacket; + Offset = offset; + } + + /// + /// The bytes that filed the CRC, including the starting character + /// + public byte[] BadPacket; + + /// + /// The offset in bytes where the start of the block begins, e.g + /// 50 would mean the block of badbytes would start 50 bytes ago + /// in the stread. No negative sign is necessary + /// + public int Offset; + } + + /// + /// Handler for an PacketFailedCRC Event + /// + public delegate void PacketCRCFailEventHandler(object sender, PacketCRCFailEventArgs e); + + + public delegate void PacketReceivedEventHandler(object sender, MavlinkPacket e); + + + /// + /// Represents a Mavlink message - both the message object itself + /// and the identified sending party + /// + public class MavlinkPacket + { + /// + /// The sender's system ID + /// + public int SystemId; + + /// + /// The sender's component ID + /// + public int ComponentId; + + /// + /// The sequence number received for this packet + /// + public byte SequenceNumber; + + + /// + /// Time of receipt + /// + public DateTime TimeStamp; + + /// + /// Object which is the mavlink message + /// + public MavlinkMessage Message; + } + + /// + /// Crc code copied/adapted from ardumega planner code + /// + internal static class Mavlink_Crc + { + const UInt16 X25_INIT_CRC = 0xffff; + + public static UInt16 CrcAccumulate(byte b, UInt16 crc) + { + unchecked + { + byte ch = (byte)(b ^ (byte)(crc & 0x00ff)); + ch = (byte)(ch ^ (ch << 4)); + return (UInt16)((crc >> 8) ^ (ch << 8) ^ (ch << 3) ^ (ch >> 4)); + } + } + + + // For a "message" of length bytes contained in the byte array + // pointed to by buffer, calculate the CRC + public static UInt16 Calculate(byte[] buffer, UInt16 start, UInt16 length) + { + UInt16 crcTmp = X25_INIT_CRC; + + for (int i = start; i < start + length; i++) + crcTmp = CrcAccumulate(buffer[i], crcTmp); + + return crcTmp; + } + } +} diff --git a/oroca_bldc_gui/Serial/mavlink/oroca.generated.cs b/oroca_bldc_gui/Serial/mavlink/oroca.generated.cs new file mode 100644 index 0000000..f4a2c8d --- /dev/null +++ b/oroca_bldc_gui/Serial/mavlink/oroca.generated.cs @@ -0,0 +1,8930 @@ +/* +MAVLink protocol implementation (auto-generated by mavgen.py) + +Generated from: oroca_bldc.xml,common.xml + +Note: this file has been auto-generated. DO NOT EDIT +*/ + +using System; + + +using System.Reflection; + +[assembly: AssemblyTitle("Mavlink Classes")] +[assembly: AssemblyDescription("Generated Message Classes for Mavlink. See http://qgroundcontrol.org/mavlink/start")] +[assembly: AssemblyProduct("Mavlink")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + + namespace MavLink +{ + + /// + /// Micro air vehicle / autopilot classes. This identifies the individual model. + /// + public enum MAV_AUTOPILOT : uint + { + + /// + /// Generic autopilot, full support for everything + /// + MAV_AUTOPILOT_GENERIC = 0, + + /// + /// Reserved for future use. + /// + MAV_AUTOPILOT_RESERVED = 1, + + /// + /// SLUGS autopilot, http://slugsuav.soe.ucsc.edu + /// + MAV_AUTOPILOT_SLUGS = 2, + + /// + /// ArduPilotMega / ArduCopter, http://diydrones.com + /// + MAV_AUTOPILOT_ARDUPILOTMEGA = 3, + + /// + /// OpenPilot, http://openpilot.org + /// + MAV_AUTOPILOT_OPENPILOT = 4, + + /// + /// Generic autopilot only supporting simple waypoints + /// + MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5, + + /// + /// Generic autopilot supporting waypoints and other simple navigation commands + /// + MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6, + + /// + /// Generic autopilot supporting the full mission command set + /// + MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7, + + /// + /// No valid autopilot, e.g. a GCS or other MAVLink component + /// + MAV_AUTOPILOT_INVALID = 8, + + /// + /// PPZ UAV - http://nongnu.org/paparazzi + /// + MAV_AUTOPILOT_PPZ = 9, + + /// + /// UAV Dev Board + /// + MAV_AUTOPILOT_UDB = 10, + + /// + /// FlexiPilot + /// + MAV_AUTOPILOT_FP = 11, + + /// + /// PX4 Autopilot - http://pixhawk.ethz.ch/px4/ + /// + MAV_AUTOPILOT_PX4 = 12, + + /// + /// SMACCMPilot - http://smaccmpilot.org + /// + MAV_AUTOPILOT_SMACCMPILOT = 13, + + /// + /// AutoQuad -- http://autoquad.org + /// + MAV_AUTOPILOT_AUTOQUAD = 14, + + /// + /// Armazila -- http://armazila.com + /// + MAV_AUTOPILOT_ARMAZILA = 15, + + /// + /// Aerob -- http://aerob.ru + /// + MAV_AUTOPILOT_AEROB = 16, + + /// + /// ASLUAV autopilot -- http://www.asl.ethz.ch + /// + MAV_AUTOPILOT_ASLUAV = 17, + MAV_AUTOPILOT_ENUM_END = 18, + + } + + + /// + /// + /// + public enum MAV_TYPE : uint + { + + /// + /// Generic micro air vehicle. + /// + MAV_TYPE_GENERIC = 0, + + /// + /// Fixed wing aircraft. + /// + MAV_TYPE_FIXED_WING = 1, + + /// + /// Quadrotor + /// + MAV_TYPE_QUADROTOR = 2, + + /// + /// Coaxial helicopter + /// + MAV_TYPE_COAXIAL = 3, + + /// + /// Normal helicopter with tail rotor. + /// + MAV_TYPE_HELICOPTER = 4, + + /// + /// Ground installation + /// + MAV_TYPE_ANTENNA_TRACKER = 5, + + /// + /// Operator control unit / ground control station + /// + MAV_TYPE_GCS = 6, + + /// + /// Airship, controlled + /// + MAV_TYPE_AIRSHIP = 7, + + /// + /// Free balloon, uncontrolled + /// + MAV_TYPE_FREE_BALLOON = 8, + + /// + /// Rocket + /// + MAV_TYPE_ROCKET = 9, + + /// + /// Ground rover + /// + MAV_TYPE_GROUND_ROVER = 10, + + /// + /// Surface vessel, boat, ship + /// + MAV_TYPE_SURFACE_BOAT = 11, + + /// + /// Submarine + /// + MAV_TYPE_SUBMARINE = 12, + + /// + /// Hexarotor + /// + MAV_TYPE_HEXAROTOR = 13, + + /// + /// Octorotor + /// + MAV_TYPE_OCTOROTOR = 14, + + /// + /// Octorotor + /// + MAV_TYPE_TRICOPTER = 15, + + /// + /// Flapping wing + /// + MAV_TYPE_FLAPPING_WING = 16, + + /// + /// Flapping wing + /// + MAV_TYPE_KITE = 17, + + /// + /// Onboard companion controller + /// + MAV_TYPE_ONBOARD_CONTROLLER = 18, + + /// + /// Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. + /// + MAV_TYPE_VTOL_DUOROTOR = 19, + + /// + /// Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. + /// + MAV_TYPE_VTOL_QUADROTOR = 20, + + /// + /// Tiltrotor VTOL + /// + MAV_TYPE_VTOL_TILTROTOR = 21, + + /// + /// VTOL reserved 2 + /// + MAV_TYPE_VTOL_RESERVED2 = 22, + + /// + /// VTOL reserved 3 + /// + MAV_TYPE_VTOL_RESERVED3 = 23, + + /// + /// VTOL reserved 4 + /// + MAV_TYPE_VTOL_RESERVED4 = 24, + + /// + /// VTOL reserved 5 + /// + MAV_TYPE_VTOL_RESERVED5 = 25, + + /// + /// Onboard gimbal + /// + MAV_TYPE_GIMBAL = 26, + + /// + /// Onboard ADSB peripheral + /// + MAV_TYPE_ADSB = 27, + MAV_TYPE_ENUM_END = 28, + + } + + + /// + /// These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65. + /// + public enum FIRMWARE_VERSION_TYPE : uint + { + + /// + /// development release + /// + FIRMWARE_VERSION_TYPE_DEV = 0, + + /// + /// alpha release + /// + FIRMWARE_VERSION_TYPE_ALPHA = 64, + + /// + /// beta release + /// + FIRMWARE_VERSION_TYPE_BETA = 128, + + /// + /// release candidate + /// + FIRMWARE_VERSION_TYPE_RC = 192, + + /// + /// official stable release + /// + FIRMWARE_VERSION_TYPE_OFFICIAL = 255, + FIRMWARE_VERSION_TYPE_ENUM_END = 256, + + } + + + /// + /// These flags encode the MAV mode. + /// + public enum MAV_MODE_FLAG : uint + { + + /// + /// 0b00000001 Reserved for future use. + /// + MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1, + + /// + /// 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. + /// + MAV_MODE_FLAG_TEST_ENABLED = 2, + + /// + /// 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. + /// + MAV_MODE_FLAG_AUTO_ENABLED = 4, + + /// + /// 0b00001000 guided mode enabled, system flies MISSIONs / mission items. + /// + MAV_MODE_FLAG_GUIDED_ENABLED = 8, + + /// + /// 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. + /// + MAV_MODE_FLAG_STABILIZE_ENABLED = 16, + + /// + /// 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. + /// + MAV_MODE_FLAG_HIL_ENABLED = 32, + + /// + /// 0b01000000 remote control input is enabled. + /// + MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64, + + /// + /// 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. + /// + MAV_MODE_FLAG_SAFETY_ARMED = 128, + MAV_MODE_FLAG_ENUM_END = 129, + + } + + + /// + /// These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. + /// + public enum MAV_MODE_FLAG_DECODE_POSITION : uint + { + + /// + /// Eighth bit: 00000001 + /// + MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1, + + /// + /// Seventh bit: 00000010 + /// + MAV_MODE_FLAG_DECODE_POSITION_TEST = 2, + + /// + /// Sixt bit: 00000100 + /// + MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4, + + /// + /// Fifth bit: 00001000 + /// + MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8, + + /// + /// Fourth bit: 00010000 + /// + MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16, + + /// + /// Third bit: 00100000 + /// + MAV_MODE_FLAG_DECODE_POSITION_HIL = 32, + + /// + /// Second bit: 01000000 + /// + MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64, + + /// + /// First bit: 10000000 + /// + MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128, + MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129, + + } + + + /// + /// Override command, pauses current mission execution and moves immediately to a position + /// + public enum MAV_GOTO : uint + { + + /// + /// Hold at the current position. + /// + MAV_GOTO_DO_HOLD = 0, + + /// + /// Continue with the next item in mission execution. + /// + MAV_GOTO_DO_CONTINUE = 1, + + /// + /// Hold at the current position of the system + /// + MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2, + + /// + /// Hold at the position specified in the parameters of the DO_HOLD action + /// + MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3, + MAV_GOTO_ENUM_END = 4, + + } + + + /// + /// These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it + /// simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. + /// + public enum MAV_MODE : uint + { + + /// + /// System is not ready to fly, booting, calibrating, etc. No flag is set. + /// + MAV_MODE_PREFLIGHT = 0, + + /// + /// System is allowed to be active, under manual (RC) control, no stabilization + /// + MAV_MODE_MANUAL_DISARMED = 64, + + /// + /// UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. + /// + MAV_MODE_TEST_DISARMED = 66, + + /// + /// System is allowed to be active, under assisted RC control. + /// + MAV_MODE_STABILIZE_DISARMED = 80, + + /// + /// System is allowed to be active, under autonomous control, manual setpoint + /// + MAV_MODE_GUIDED_DISARMED = 88, + + /// + /// System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) + /// + MAV_MODE_AUTO_DISARMED = 92, + + /// + /// System is allowed to be active, under manual (RC) control, no stabilization + /// + MAV_MODE_MANUAL_ARMED = 192, + + /// + /// UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. + /// + MAV_MODE_TEST_ARMED = 194, + + /// + /// System is allowed to be active, under assisted RC control. + /// + MAV_MODE_STABILIZE_ARMED = 208, + + /// + /// System is allowed to be active, under autonomous control, manual setpoint + /// + MAV_MODE_GUIDED_ARMED = 216, + + /// + /// System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) + /// + MAV_MODE_AUTO_ARMED = 220, + MAV_MODE_ENUM_END = 221, + + } + + + /// + /// + /// + public enum MAV_STATE : uint + { + + /// + /// Uninitialized system, state is unknown. + /// + MAV_STATE_UNINIT = 0, + + /// + /// System is booting up. + /// + MAV_STATE_BOOT = 1, + + /// + /// System is calibrating and not flight-ready. + /// + MAV_STATE_CALIBRATING = 2, + + /// + /// System is grounded and on standby. It can be launched any time. + /// + MAV_STATE_STANDBY = 3, + + /// + /// System is active and might be already airborne. Motors are engaged. + /// + MAV_STATE_ACTIVE = 4, + + /// + /// System is in a non-normal flight mode. It can however still navigate. + /// + MAV_STATE_CRITICAL = 5, + + /// + /// System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. + /// + MAV_STATE_EMERGENCY = 6, + + /// + /// System just initialized its power-down sequence, will shut down now. + /// + MAV_STATE_POWEROFF = 7, + MAV_STATE_ENUM_END = 8, + + } + + + /// + /// + /// + public enum MAV_COMPONENT : uint + { + MAV_COMP_ID_ALL = 0, + MAV_COMP_ID_CAMERA = 100, + MAV_COMP_ID_SERVO1 = 140, + MAV_COMP_ID_SERVO2 = 141, + MAV_COMP_ID_SERVO3 = 142, + MAV_COMP_ID_SERVO4 = 143, + MAV_COMP_ID_SERVO5 = 144, + MAV_COMP_ID_SERVO6 = 145, + MAV_COMP_ID_SERVO7 = 146, + MAV_COMP_ID_SERVO8 = 147, + MAV_COMP_ID_SERVO9 = 148, + MAV_COMP_ID_SERVO10 = 149, + MAV_COMP_ID_SERVO11 = 150, + MAV_COMP_ID_SERVO12 = 151, + MAV_COMP_ID_SERVO13 = 152, + MAV_COMP_ID_SERVO14 = 153, + MAV_COMP_ID_GIMBAL = 154, + MAV_COMP_ID_LOG = 155, + MAV_COMP_ID_ADSB = 156, + + /// + /// On Screen Display (OSD) devices for video links + /// + MAV_COMP_ID_OSD = 157, + + /// + /// Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol + /// + MAV_COMP_ID_PERIPHERAL = 158, + MAV_COMP_ID_MAPPER = 180, + MAV_COMP_ID_MISSIONPLANNER = 190, + MAV_COMP_ID_PATHPLANNER = 195, + MAV_COMP_ID_IMU = 200, + MAV_COMP_ID_IMU_2 = 201, + MAV_COMP_ID_IMU_3 = 202, + MAV_COMP_ID_GPS = 220, + MAV_COMP_ID_UDP_BRIDGE = 240, + MAV_COMP_ID_UART_BRIDGE = 241, + MAV_COMP_ID_SYSTEM_CONTROL = 250, + MAV_COMPONENT_ENUM_END = 251, + + } + + + /// + /// These encode the sensors whose status is sent as part of the SYS_STATUS message. + /// + public enum MAV_SYS_STATUS_SENSOR : uint + { + + /// + /// 0x01 3D gyro + /// + MAV_SYS_STATUS_SENSOR_3D_GYRO = 1, + + /// + /// 0x02 3D accelerometer + /// + MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2, + + /// + /// 0x04 3D magnetometer + /// + MAV_SYS_STATUS_SENSOR_3D_MAG = 4, + + /// + /// 0x08 absolute pressure + /// + MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8, + + /// + /// 0x10 differential pressure + /// + MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16, + + /// + /// 0x20 GPS + /// + MAV_SYS_STATUS_SENSOR_GPS = 32, + + /// + /// 0x40 optical flow + /// + MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64, + + /// + /// 0x80 computer vision position + /// + MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128, + + /// + /// 0x100 laser based position + /// + MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256, + + /// + /// 0x200 external ground truth (Vicon or Leica) + /// + MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512, + + /// + /// 0x400 3D angular rate control + /// + MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024, + + /// + /// 0x800 attitude stabilization + /// + MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048, + + /// + /// 0x1000 yaw position + /// + MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096, + + /// + /// 0x2000 z/altitude control + /// + MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192, + + /// + /// 0x4000 x/y position control + /// + MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384, + + /// + /// 0x8000 motor outputs / control + /// + MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768, + + /// + /// 0x10000 rc receiver + /// + MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536, + + /// + /// 0x20000 2nd 3D gyro + /// + MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072, + + /// + /// 0x40000 2nd 3D accelerometer + /// + MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144, + + /// + /// 0x80000 2nd 3D magnetometer + /// + MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288, + + /// + /// 0x100000 geofence + /// + MAV_SYS_STATUS_GEOFENCE = 1048576, + + /// + /// 0x200000 AHRS subsystem health + /// + MAV_SYS_STATUS_AHRS = 2097152, + + /// + /// 0x400000 Terrain subsystem health + /// + MAV_SYS_STATUS_TERRAIN = 4194304, + + /// + /// 0x800000 Motors are reversed + /// + MAV_SYS_STATUS_REVERSE_MOTOR = 8388608, + MAV_SYS_STATUS_SENSOR_ENUM_END = 8388609, + + } + + + /// + /// + /// + public enum MAV_FRAME : uint + { + + /// + /// Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) + /// + MAV_FRAME_GLOBAL = 0, + + /// + /// Local coordinate frame, Z-up (x: north, y: east, z: down). + /// + MAV_FRAME_LOCAL_NED = 1, + + /// + /// NOT a coordinate frame, indicates a mission command. + /// + MAV_FRAME_MISSION = 2, + + /// + /// Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. + /// + MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, + + /// + /// Local coordinate frame, Z-down (x: east, y: north, z: up) + /// + MAV_FRAME_LOCAL_ENU = 4, + + /// + /// Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) + /// + MAV_FRAME_GLOBAL_INT = 5, + + /// + /// Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. + /// + MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, + + /// + /// Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. + /// + MAV_FRAME_LOCAL_OFFSET_NED = 7, + + /// + /// Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. + /// + MAV_FRAME_BODY_NED = 8, + + /// + /// Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. + /// + MAV_FRAME_BODY_OFFSET_NED = 9, + + /// + /// Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. + /// + MAV_FRAME_GLOBAL_TERRAIN_ALT = 10, + + /// + /// Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. + /// + MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11, + MAV_FRAME_ENUM_END = 12, + + } + + + /// + /// + /// + public enum MAVLINK_DATA_STREAM_TYPE : uint + { + MAVLINK_DATA_STREAM_IMG_JPEG = 1, + MAVLINK_DATA_STREAM_IMG_BMP = 2, + MAVLINK_DATA_STREAM_IMG_RAW8U = 3, + MAVLINK_DATA_STREAM_IMG_RAW32U = 4, + MAVLINK_DATA_STREAM_IMG_PGM = 5, + MAVLINK_DATA_STREAM_IMG_PNG = 6, + MAVLINK_DATA_STREAM_TYPE_ENUM_END = 7, + + } + + + /// + /// + /// + public enum FENCE_ACTION : uint + { + + /// + /// Disable fenced mode + /// + FENCE_ACTION_NONE = 0, + + /// + /// Switched to guided mode to return point (fence point 0) + /// + FENCE_ACTION_GUIDED = 1, + + /// + /// Report fence breach, but don't take action + /// + FENCE_ACTION_REPORT = 2, + + /// + /// Switched to guided mode to return point (fence point 0) with manual throttle control + /// + FENCE_ACTION_GUIDED_THR_PASS = 3, + FENCE_ACTION_ENUM_END = 4, + + } + + + /// + /// + /// + public enum FENCE_BREACH : uint + { + + /// + /// No last fence breach + /// + FENCE_BREACH_NONE = 0, + + /// + /// Breached minimum altitude + /// + FENCE_BREACH_MINALT = 1, + + /// + /// Breached maximum altitude + /// + FENCE_BREACH_MAXALT = 2, + + /// + /// Breached fence boundary + /// + FENCE_BREACH_BOUNDARY = 3, + FENCE_BREACH_ENUM_END = 4, + + } + + + /// + /// Enumeration of possible mount operation modes + /// + public enum MAV_MOUNT_MODE : uint + { + + /// + /// Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization + /// + MAV_MOUNT_MODE_RETRACT = 0, + + /// + /// Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. + /// + MAV_MOUNT_MODE_NEUTRAL = 1, + + /// + /// Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization + /// + MAV_MOUNT_MODE_MAVLINK_TARGETING = 2, + + /// + /// Load neutral position and start RC Roll,Pitch,Yaw control with stabilization + /// + MAV_MOUNT_MODE_RC_TARGETING = 3, + + /// + /// Load neutral position and start to point to Lat,Lon,Alt + /// + MAV_MOUNT_MODE_GPS_POINT = 4, + MAV_MOUNT_MODE_ENUM_END = 5, + + } + + + /// + /// Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. + /// + public enum MAV_CMD : uint + { + + /// + /// Navigate to MISSION. + /// + MAV_CMD_NAV_WAYPOINT = 16, + + /// + /// Loiter around this MISSION an unlimited amount of time + /// + MAV_CMD_NAV_LOITER_UNLIM = 17, + + /// + /// Loiter around this MISSION for X turns + /// + MAV_CMD_NAV_LOITER_TURNS = 18, + + /// + /// Loiter around this MISSION for X seconds + /// + MAV_CMD_NAV_LOITER_TIME = 19, + + /// + /// Return to launch location + /// + MAV_CMD_NAV_RETURN_TO_LAUNCH = 20, + + /// + /// Land at location + /// + MAV_CMD_NAV_LAND = 21, + + /// + /// Takeoff from ground / hand + /// + MAV_CMD_NAV_TAKEOFF = 22, + + /// + /// Land at local position (local frame only) + /// + MAV_CMD_NAV_LAND_LOCAL = 23, + + /// + /// Takeoff from local position (local frame only) + /// + MAV_CMD_NAV_TAKEOFF_LOCAL = 24, + + /// + /// Vehicle following, i.e. this waypoint represents the position of a moving vehicle + /// + MAV_CMD_NAV_FOLLOW = 25, + + /// + /// Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. + /// + MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30, + + /// + /// Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. + /// + MAV_CMD_NAV_LOITER_TO_ALT = 31, + + /// + /// Being following a target + /// + MAV_CMD_DO_FOLLOW = 32, + + /// + /// Reposition the MAV after a follow target command has been sent + /// + MAV_CMD_DO_FOLLOW_REPOSITION = 33, + + /// + /// Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. + /// + MAV_CMD_NAV_ROI = 80, + + /// + /// Control autonomous path planning on the MAV. + /// + MAV_CMD_NAV_PATHPLANNING = 81, + + /// + /// Navigate to MISSION using a spline path. + /// + MAV_CMD_NAV_SPLINE_WAYPOINT = 82, + + /// + /// Takeoff from ground using VTOL mode + /// + MAV_CMD_NAV_VTOL_TAKEOFF = 84, + + /// + /// Land using VTOL mode + /// + MAV_CMD_NAV_VTOL_LAND = 85, + + /// + /// hand control over to an external controller + /// + MAV_CMD_NAV_GUIDED_ENABLE = 92, + + /// + /// Delay the next navigation command a number of seconds or until a specified time + /// + MAV_CMD_NAV_DELAY = 93, + + /// + /// NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration + /// + MAV_CMD_NAV_LAST = 95, + + /// + /// Delay mission state machine. + /// + MAV_CMD_CONDITION_DELAY = 112, + + /// + /// Ascend/descend at rate. Delay mission state machine until desired altitude reached. + /// + MAV_CMD_CONDITION_CHANGE_ALT = 113, + + /// + /// Delay mission state machine until within desired distance of next NAV point. + /// + MAV_CMD_CONDITION_DISTANCE = 114, + + /// + /// Reach a certain target angle. + /// + MAV_CMD_CONDITION_YAW = 115, + + /// + /// NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration + /// + MAV_CMD_CONDITION_LAST = 159, + + /// + /// Set system mode. + /// + MAV_CMD_DO_SET_MODE = 176, + + /// + /// Jump to the desired command in the mission list. Repeat this action only the specified number of times + /// + MAV_CMD_DO_JUMP = 177, + + /// + /// Change speed and/or throttle set points. + /// + MAV_CMD_DO_CHANGE_SPEED = 178, + + /// + /// Changes the home location either to the current location or a specified location. + /// + MAV_CMD_DO_SET_HOME = 179, + + /// + /// Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. + /// + MAV_CMD_DO_SET_PARAMETER = 180, + + /// + /// Set a relay to a condition. + /// + MAV_CMD_DO_SET_RELAY = 181, + + /// + /// Cycle a relay on and off for a desired number of cyles with a desired period. + /// + MAV_CMD_DO_REPEAT_RELAY = 182, + + /// + /// Set a servo to a desired PWM value. + /// + MAV_CMD_DO_SET_SERVO = 183, + + /// + /// Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. + /// + MAV_CMD_DO_REPEAT_SERVO = 184, + + /// + /// Terminate flight immediately + /// + MAV_CMD_DO_FLIGHTTERMINATION = 185, + + /// + /// Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. + /// + MAV_CMD_DO_LAND_START = 189, + + /// + /// Mission command to perform a landing from a rally point. + /// + MAV_CMD_DO_RALLY_LAND = 190, + + /// + /// Mission command to safely abort an autonmous landing. + /// + MAV_CMD_DO_GO_AROUND = 191, + + /// + /// Reposition the vehicle to a specific WGS84 global position. + /// + MAV_CMD_DO_REPOSITION = 192, + + /// + /// If in a GPS controlled position mode, hold the current position or continue. + /// + MAV_CMD_DO_PAUSE_CONTINUE = 193, + + /// + /// Control onboard camera system. + /// + MAV_CMD_DO_CONTROL_VIDEO = 200, + + /// + /// Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. + /// + MAV_CMD_DO_SET_ROI = 201, + + /// + /// Mission command to configure an on-board camera controller system. + /// + MAV_CMD_DO_DIGICAM_CONFIGURE = 202, + + /// + /// Mission command to control an on-board camera controller system. + /// + MAV_CMD_DO_DIGICAM_CONTROL = 203, + + /// + /// Mission command to configure a camera or antenna mount + /// + MAV_CMD_DO_MOUNT_CONFIGURE = 204, + + /// + /// Mission command to control a camera or antenna mount + /// + MAV_CMD_DO_MOUNT_CONTROL = 205, + + /// + /// Mission command to set CAM_TRIGG_DIST for this flight + /// + MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206, + + /// + /// Mission command to enable the geofence + /// + MAV_CMD_DO_FENCE_ENABLE = 207, + + /// + /// Mission command to trigger a parachute + /// + MAV_CMD_DO_PARACHUTE = 208, + + /// + /// Change to/from inverted flight + /// + MAV_CMD_DO_INVERTED_FLIGHT = 210, + + /// + /// Mission command to control a camera or antenna mount, using a quaternion as reference. + /// + MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220, + + /// + /// set id of master controller + /// + MAV_CMD_DO_GUIDED_MASTER = 221, + + /// + /// set limits for external control + /// + MAV_CMD_DO_GUIDED_LIMITS = 222, + + /// + /// NOP - This command is only used to mark the upper limit of the DO commands in the enumeration + /// + MAV_CMD_DO_LAST = 240, + + /// + /// Trigger calibration. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_CALIBRATION = 241, + + /// + /// Set sensor offsets. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242, + + /// + /// Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_UAVCAN = 243, + + /// + /// Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. + /// + MAV_CMD_PREFLIGHT_STORAGE = 245, + + /// + /// Request the reboot or shutdown of system components. + /// + MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246, + + /// + /// Hold / continue the current action + /// + MAV_CMD_OVERRIDE_GOTO = 252, + + /// + /// start running a mission + /// + MAV_CMD_MISSION_START = 300, + + /// + /// Arms / Disarms a component + /// + MAV_CMD_COMPONENT_ARM_DISARM = 400, + + /// + /// Request the home position from the vehicle. + /// + MAV_CMD_GET_HOME_POSITION = 410, + + /// + /// Starts receiver pairing + /// + MAV_CMD_START_RX_PAIR = 500, + + /// + /// Request the interval between messages for a particular MAVLink message ID + /// + MAV_CMD_GET_MESSAGE_INTERVAL = 510, + + /// + /// Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM + /// + MAV_CMD_SET_MESSAGE_INTERVAL = 511, + + /// + /// Request autopilot capabilities + /// + MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520, + + /// + /// Start image capture sequence + /// + MAV_CMD_IMAGE_START_CAPTURE = 2000, + + /// + /// Stop image capture sequence + /// + MAV_CMD_IMAGE_STOP_CAPTURE = 2001, + + /// + /// Enable or disable on-board camera triggering system. + /// + MAV_CMD_DO_TRIGGER_CONTROL = 2003, + + /// + /// Starts video capture + /// + MAV_CMD_VIDEO_START_CAPTURE = 2500, + + /// + /// Stop the current video capture + /// + MAV_CMD_VIDEO_STOP_CAPTURE = 2501, + + /// + /// Create a panorama at the current position + /// + MAV_CMD_PANORAMA_CREATE = 2800, + + /// + /// Request VTOL transition + /// + MAV_CMD_DO_VTOL_TRANSITION = 3000, + + /// + /// Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. + /// + MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001, + + /// + /// Control the payload deployment. + /// + MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_1 = 31000, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_2 = 31001, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_3 = 31002, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_4 = 31003, + + /// + /// User defined waypoint item. Ground Station will show the Vehicle as flying through this item. + /// + MAV_CMD_WAYPOINT_USER_5 = 31004, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_1 = 31005, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_2 = 31006, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_3 = 31007, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_4 = 31008, + + /// + /// User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. + /// + MAV_CMD_SPATIAL_USER_5 = 31009, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_1 = 31010, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_2 = 31011, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_3 = 31012, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_4 = 31013, + + /// + /// User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. + /// + MAV_CMD_USER_5 = 31014, + MAV_CMD_ENUM_END = 31015, + + } + + + /// + /// THIS INTERFACE IS DEPRECATED AS OF JULY 2015. Please use MESSAGE_INTERVAL instead. A data stream is not a fixed set of messages, but rather a + /// recommendation to the autopilot software. Individual autopilots may or may not obey + /// the recommended messages. + /// + public enum MAV_DATA_STREAM : uint + { + + /// + /// Enable all data streams + /// + MAV_DATA_STREAM_ALL = 0, + + /// + /// Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. + /// + MAV_DATA_STREAM_RAW_SENSORS = 1, + + /// + /// Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS + /// + MAV_DATA_STREAM_EXTENDED_STATUS = 2, + + /// + /// Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW + /// + MAV_DATA_STREAM_RC_CHANNELS = 3, + + /// + /// Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. + /// + MAV_DATA_STREAM_RAW_CONTROLLER = 4, + + /// + /// Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. + /// + MAV_DATA_STREAM_POSITION = 6, + + /// + /// Dependent on the autopilot + /// + MAV_DATA_STREAM_EXTRA1 = 10, + + /// + /// Dependent on the autopilot + /// + MAV_DATA_STREAM_EXTRA2 = 11, + + /// + /// Dependent on the autopilot + /// + MAV_DATA_STREAM_EXTRA3 = 12, + MAV_DATA_STREAM_ENUM_END = 13, + + } + + + /// + /// The ROI (region of interest) for the vehicle. This can be + /// be used by the vehicle for camera/vehicle attitude alignment (see + /// MAV_CMD_NAV_ROI). + /// + public enum MAV_ROI : uint + { + + /// + /// No region of interest. + /// + MAV_ROI_NONE = 0, + + /// + /// Point toward next MISSION. + /// + MAV_ROI_WPNEXT = 1, + + /// + /// Point toward given MISSION. + /// + MAV_ROI_WPINDEX = 2, + + /// + /// Point toward fixed location. + /// + MAV_ROI_LOCATION = 3, + + /// + /// Point toward of given id. + /// + MAV_ROI_TARGET = 4, + MAV_ROI_ENUM_END = 5, + + } + + + /// + /// ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. + /// + public enum MAV_CMD_ACK : uint + { + + /// + /// Command / mission item is ok. + /// + MAV_CMD_ACK_OK = 1, + + /// + /// Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. + /// + MAV_CMD_ACK_ERR_FAIL = 2, + + /// + /// The system is refusing to accept this command from this source / communication partner. + /// + MAV_CMD_ACK_ERR_ACCESS_DENIED = 3, + + /// + /// Command or mission item is not supported, other commands would be accepted. + /// + MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4, + + /// + /// The coordinate frame of this command / mission item is not supported. + /// + MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5, + + /// + /// The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. + /// + MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6, + + /// + /// The X or latitude value is out of range. + /// + MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7, + + /// + /// The Y or longitude value is out of range. + /// + MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8, + + /// + /// The Z or altitude value is out of range. + /// + MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9, + MAV_CMD_ACK_ENUM_END = 10, + + } + + + /// + /// Specifies the datatype of a MAVLink parameter. + /// + public enum MAV_PARAM_TYPE : uint + { + + /// + /// 8-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT8 = 1, + + /// + /// 8-bit signed integer + /// + MAV_PARAM_TYPE_INT8 = 2, + + /// + /// 16-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT16 = 3, + + /// + /// 16-bit signed integer + /// + MAV_PARAM_TYPE_INT16 = 4, + + /// + /// 32-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT32 = 5, + + /// + /// 32-bit signed integer + /// + MAV_PARAM_TYPE_INT32 = 6, + + /// + /// 64-bit unsigned integer + /// + MAV_PARAM_TYPE_UINT64 = 7, + + /// + /// 64-bit signed integer + /// + MAV_PARAM_TYPE_INT64 = 8, + + /// + /// 32-bit floating-point + /// + MAV_PARAM_TYPE_REAL32 = 9, + + /// + /// 64-bit floating-point + /// + MAV_PARAM_TYPE_REAL64 = 10, + MAV_PARAM_TYPE_ENUM_END = 11, + + } + + + /// + /// result from a mavlink command + /// + public enum MAV_RESULT : uint + { + + /// + /// Command ACCEPTED and EXECUTED + /// + MAV_RESULT_ACCEPTED = 0, + + /// + /// Command TEMPORARY REJECTED/DENIED + /// + MAV_RESULT_TEMPORARILY_REJECTED = 1, + + /// + /// Command PERMANENTLY DENIED + /// + MAV_RESULT_DENIED = 2, + + /// + /// Command UNKNOWN/UNSUPPORTED + /// + MAV_RESULT_UNSUPPORTED = 3, + + /// + /// Command executed, but failed + /// + MAV_RESULT_FAILED = 4, + MAV_RESULT_ENUM_END = 5, + + } + + + /// + /// result in a mavlink mission ack + /// + public enum MAV_MISSION_RESULT : uint + { + + /// + /// mission accepted OK + /// + MAV_MISSION_ACCEPTED = 0, + + /// + /// generic error / not accepting mission commands at all right now + /// + MAV_MISSION_ERROR = 1, + + /// + /// coordinate frame is not supported + /// + MAV_MISSION_UNSUPPORTED_FRAME = 2, + + /// + /// command is not supported + /// + MAV_MISSION_UNSUPPORTED = 3, + + /// + /// mission item exceeds storage space + /// + MAV_MISSION_NO_SPACE = 4, + + /// + /// one of the parameters has an invalid value + /// + MAV_MISSION_INVALID = 5, + + /// + /// param1 has an invalid value + /// + MAV_MISSION_INVALID_PARAM1 = 6, + + /// + /// param2 has an invalid value + /// + MAV_MISSION_INVALID_PARAM2 = 7, + + /// + /// param3 has an invalid value + /// + MAV_MISSION_INVALID_PARAM3 = 8, + + /// + /// param4 has an invalid value + /// + MAV_MISSION_INVALID_PARAM4 = 9, + + /// + /// x/param5 has an invalid value + /// + MAV_MISSION_INVALID_PARAM5_X = 10, + + /// + /// y/param6 has an invalid value + /// + MAV_MISSION_INVALID_PARAM6_Y = 11, + + /// + /// param7 has an invalid value + /// + MAV_MISSION_INVALID_PARAM7 = 12, + + /// + /// received waypoint out of sequence + /// + MAV_MISSION_INVALID_SEQUENCE = 13, + + /// + /// not accepting any mission commands from this communication partner + /// + MAV_MISSION_DENIED = 14, + MAV_MISSION_RESULT_ENUM_END = 15, + + } + + + /// + /// Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. + /// + public enum MAV_SEVERITY : uint + { + + /// + /// System is unusable. This is a "panic" condition. + /// + MAV_SEVERITY_EMERGENCY = 0, + + /// + /// Action should be taken immediately. Indicates error in non-critical systems. + /// + MAV_SEVERITY_ALERT = 1, + + /// + /// Action must be taken immediately. Indicates failure in a primary system. + /// + MAV_SEVERITY_CRITICAL = 2, + + /// + /// Indicates an error in secondary/redundant systems. + /// + MAV_SEVERITY_ERROR = 3, + + /// + /// Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. + /// + MAV_SEVERITY_WARNING = 4, + + /// + /// An unusual event has occured, though not an error condition. This should be investigated for the root cause. + /// + MAV_SEVERITY_NOTICE = 5, + + /// + /// Normal operational messages. Useful for logging. No action is required for these messages. + /// + MAV_SEVERITY_INFO = 6, + + /// + /// Useful non-operational messages that can assist in debugging. These should not occur during normal operation. + /// + MAV_SEVERITY_DEBUG = 7, + MAV_SEVERITY_ENUM_END = 8, + + } + + + /// + /// Power supply status flags (bitmask) + /// + public enum MAV_POWER_STATUS : uint + { + + /// + /// main brick power supply valid + /// + MAV_POWER_STATUS_BRICK_VALID = 1, + + /// + /// main servo power supply valid for FMU + /// + MAV_POWER_STATUS_SERVO_VALID = 2, + + /// + /// USB power is connected + /// + MAV_POWER_STATUS_USB_CONNECTED = 4, + + /// + /// peripheral supply is in over-current state + /// + MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8, + + /// + /// hi-power peripheral supply is in over-current state + /// + MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16, + + /// + /// Power status has changed since boot + /// + MAV_POWER_STATUS_CHANGED = 32, + MAV_POWER_STATUS_ENUM_END = 33, + + } + + + /// + /// SERIAL_CONTROL device types + /// + public enum SERIAL_CONTROL_DEV : uint + { + + /// + /// First telemetry port + /// + SERIAL_CONTROL_DEV_TELEM1 = 0, + + /// + /// Second telemetry port + /// + SERIAL_CONTROL_DEV_TELEM2 = 1, + + /// + /// First GPS port + /// + SERIAL_CONTROL_DEV_GPS1 = 2, + + /// + /// Second GPS port + /// + SERIAL_CONTROL_DEV_GPS2 = 3, + + /// + /// system shell + /// + SERIAL_CONTROL_DEV_SHELL = 10, + SERIAL_CONTROL_DEV_ENUM_END = 11, + + } + + + /// + /// SERIAL_CONTROL flags (bitmask) + /// + public enum SERIAL_CONTROL_FLAG : uint + { + + /// + /// Set if this is a reply + /// + SERIAL_CONTROL_FLAG_REPLY = 1, + + /// + /// Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message + /// + SERIAL_CONTROL_FLAG_RESPOND = 2, + + /// + /// Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set + /// + SERIAL_CONTROL_FLAG_EXCLUSIVE = 4, + + /// + /// Block on writes to the serial port + /// + SERIAL_CONTROL_FLAG_BLOCKING = 8, + + /// + /// Send multiple replies until port is drained + /// + SERIAL_CONTROL_FLAG_MULTI = 16, + SERIAL_CONTROL_FLAG_ENUM_END = 17, + + } + + + /// + /// Enumeration of distance sensor types + /// + public enum MAV_DISTANCE_SENSOR : uint + { + + /// + /// Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units + /// + MAV_DISTANCE_SENSOR_LASER = 0, + + /// + /// Ultrasound rangefinder, e.g. MaxBotix units + /// + MAV_DISTANCE_SENSOR_ULTRASOUND = 1, + + /// + /// Infrared rangefinder, e.g. Sharp units + /// + MAV_DISTANCE_SENSOR_INFRARED = 2, + MAV_DISTANCE_SENSOR_ENUM_END = 3, + + } + + + /// + /// Enumeration of sensor orientation, according to its rotations + /// + public enum MAV_SENSOR_ORIENTATION : uint + { + + /// + /// Roll: 0, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_NONE = 0, + + /// + /// Roll: 0, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_YAW_45 = 1, + + /// + /// Roll: 0, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_YAW_90 = 2, + + /// + /// Roll: 0, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_YAW_135 = 3, + + /// + /// Roll: 0, Pitch: 0, Yaw: 180 + /// + MAV_SENSOR_ROTATION_YAW_180 = 4, + + /// + /// Roll: 0, Pitch: 0, Yaw: 225 + /// + MAV_SENSOR_ROTATION_YAW_225 = 5, + + /// + /// Roll: 0, Pitch: 0, Yaw: 270 + /// + MAV_SENSOR_ROTATION_YAW_270 = 6, + + /// + /// Roll: 0, Pitch: 0, Yaw: 315 + /// + MAV_SENSOR_ROTATION_YAW_315 = 7, + + /// + /// Roll: 180, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_180 = 8, + + /// + /// Roll: 180, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9, + + /// + /// Roll: 180, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10, + + /// + /// Roll: 180, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11, + + /// + /// Roll: 0, Pitch: 180, Yaw: 0 + /// + MAV_SENSOR_ROTATION_PITCH_180 = 12, + + /// + /// Roll: 180, Pitch: 0, Yaw: 225 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13, + + /// + /// Roll: 180, Pitch: 0, Yaw: 270 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14, + + /// + /// Roll: 180, Pitch: 0, Yaw: 315 + /// + MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15, + + /// + /// Roll: 90, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90 = 16, + + /// + /// Roll: 90, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17, + + /// + /// Roll: 90, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18, + + /// + /// Roll: 90, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19, + + /// + /// Roll: 270, Pitch: 0, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270 = 20, + + /// + /// Roll: 270, Pitch: 0, Yaw: 45 + /// + MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21, + + /// + /// Roll: 270, Pitch: 0, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22, + + /// + /// Roll: 270, Pitch: 0, Yaw: 135 + /// + MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23, + + /// + /// Roll: 0, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_PITCH_90 = 24, + + /// + /// Roll: 0, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_PITCH_270 = 25, + + /// + /// Roll: 0, Pitch: 180, Yaw: 90 + /// + MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26, + + /// + /// Roll: 0, Pitch: 180, Yaw: 270 + /// + MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27, + + /// + /// Roll: 90, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28, + + /// + /// Roll: 180, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29, + + /// + /// Roll: 270, Pitch: 90, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30, + + /// + /// Roll: 90, Pitch: 180, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31, + + /// + /// Roll: 270, Pitch: 180, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32, + + /// + /// Roll: 90, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33, + + /// + /// Roll: 180, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34, + + /// + /// Roll: 270, Pitch: 270, Yaw: 0 + /// + MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35, + + /// + /// Roll: 90, Pitch: 180, Yaw: 90 + /// + MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36, + + /// + /// Roll: 90, Pitch: 0, Yaw: 270 + /// + MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37, + + /// + /// Roll: 315, Pitch: 315, Yaw: 315 + /// + MAV_SENSOR_ROTATION_ROLL_315_PITCH_315_YAW_315 = 38, + MAV_SENSOR_ORIENTATION_ENUM_END = 39, + + } + + + /// + /// Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. + /// + public enum MAV_PROTOCOL_CAPABILITY : uint + { + + /// + /// Autopilot supports MISSION float message type. + /// + MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1, + + /// + /// Autopilot supports the new param float message type. + /// + MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2, + + /// + /// Autopilot supports MISSION_INT scaled integer message type. + /// + MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4, + + /// + /// Autopilot supports COMMAND_INT scaled integer message type. + /// + MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8, + + /// + /// Autopilot supports the new param union message type. + /// + MAV_PROTOCOL_CAPABILITY_PARAM_UNION = 16, + + /// + /// Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. + /// + MAV_PROTOCOL_CAPABILITY_FTP = 32, + + /// + /// Autopilot supports commanding attitude offboard. + /// + MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64, + + /// + /// Autopilot supports commanding position and velocity targets in local NED frame. + /// + MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128, + + /// + /// Autopilot supports commanding position and velocity targets in global scaled integers. + /// + MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256, + + /// + /// Autopilot supports terrain protocol / data handling. + /// + MAV_PROTOCOL_CAPABILITY_TERRAIN = 512, + + /// + /// Autopilot supports direct actuator control. + /// + MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET = 1024, + + /// + /// Autopilot supports the flight termination command. + /// + MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048, + + /// + /// Autopilot supports onboard compass calibration. + /// + MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096, + MAV_PROTOCOL_CAPABILITY_ENUM_END = 4097, + + } + + + /// + /// Enumeration of estimator types + /// + public enum MAV_ESTIMATOR_TYPE : uint + { + + /// + /// This is a naive estimator without any real covariance feedback. + /// + MAV_ESTIMATOR_TYPE_NAIVE = 1, + + /// + /// Computer vision based estimate. Might be up to scale. + /// + MAV_ESTIMATOR_TYPE_VISION = 2, + + /// + /// Visual-inertial estimate. + /// + MAV_ESTIMATOR_TYPE_VIO = 3, + + /// + /// Plain GPS estimate. + /// + MAV_ESTIMATOR_TYPE_GPS = 4, + + /// + /// Estimator integrating GPS and inertial sensing. + /// + MAV_ESTIMATOR_TYPE_GPS_INS = 5, + MAV_ESTIMATOR_TYPE_ENUM_END = 6, + + } + + + /// + /// Enumeration of battery types + /// + public enum MAV_BATTERY_TYPE : uint + { + + /// + /// Not specified. + /// + MAV_BATTERY_TYPE_UNKNOWN = 0, + + /// + /// Lithium polymer battery + /// + MAV_BATTERY_TYPE_LIPO = 1, + + /// + /// Lithium-iron-phosphate battery + /// + MAV_BATTERY_TYPE_LIFE = 2, + + /// + /// Lithium-ION battery + /// + MAV_BATTERY_TYPE_LION = 3, + + /// + /// Nickel metal hydride battery + /// + MAV_BATTERY_TYPE_NIMH = 4, + MAV_BATTERY_TYPE_ENUM_END = 5, + + } + + + /// + /// Enumeration of battery functions + /// + public enum MAV_BATTERY_FUNCTION : uint + { + + /// + /// Battery function is unknown + /// + MAV_BATTERY_FUNCTION_UNKNOWN = 0, + + /// + /// Battery supports all flight systems + /// + MAV_BATTERY_FUNCTION_ALL = 1, + + /// + /// Battery for the propulsion system + /// + MAV_BATTERY_FUNCTION_PROPULSION = 2, + + /// + /// Avionics battery + /// + MAV_BATTERY_FUNCTION_AVIONICS = 3, + + /// + /// Payload battery + /// + MAV_BATTERY_TYPE_PAYLOAD = 4, + MAV_BATTERY_FUNCTION_ENUM_END = 5, + + } + + + /// + /// Enumeration of VTOL states + /// + public enum MAV_VTOL_STATE : uint + { + + /// + /// MAV is not configured as VTOL + /// + MAV_VTOL_STATE_UNDEFINED = 0, + + /// + /// VTOL is in transition from multicopter to fixed-wing + /// + MAV_VTOL_STATE_TRANSITION_TO_FW = 1, + + /// + /// VTOL is in transition from fixed-wing to multicopter + /// + MAV_VTOL_STATE_TRANSITION_TO_MC = 2, + + /// + /// VTOL is in multicopter state + /// + MAV_VTOL_STATE_MC = 3, + + /// + /// VTOL is in fixed-wing state + /// + MAV_VTOL_STATE_FW = 4, + MAV_VTOL_STATE_ENUM_END = 5, + + } + + + /// + /// Enumeration of landed detector states + /// + public enum MAV_LANDED_STATE : uint + { + + /// + /// MAV landed state is unknown + /// + MAV_LANDED_STATE_UNDEFINED = 0, + + /// + /// MAV is landed (on ground) + /// + MAV_LANDED_STATE_ON_GROUND = 1, + + /// + /// MAV is in air + /// + MAV_LANDED_STATE_IN_AIR = 2, + MAV_LANDED_STATE_ENUM_END = 3, + + } + + + /// + /// Enumeration of the ADSB altimeter types + /// + public enum ADSB_ALTITUDE_TYPE : uint + { + + /// + /// Altitude reported from a Baro source using QNH reference + /// + ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0, + + /// + /// Altitude reported from a GNSS source + /// + ADSB_ALTITUDE_TYPE_GEOMETRIC = 1, + ADSB_ALTITUDE_TYPE_ENUM_END = 2, + + } + + + /// + /// ADSB classification for the type of vehicle emitting the transponder signal + /// + public enum ADSB_EMITTER_TYPE : uint + { + ADSB_EMITTER_TYPE_NO_INFO = 0, + ADSB_EMITTER_TYPE_LIGHT = 1, + ADSB_EMITTER_TYPE_SMALL = 2, + ADSB_EMITTER_TYPE_LARGE = 3, + ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4, + ADSB_EMITTER_TYPE_HEAVY = 5, + ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6, + ADSB_EMITTER_TYPE_ROTOCRAFT = 7, + ADSB_EMITTER_TYPE_UNASSIGNED = 8, + ADSB_EMITTER_TYPE_GLIDER = 9, + ADSB_EMITTER_TYPE_LIGHTER_AIR = 10, + ADSB_EMITTER_TYPE_PARACHUTE = 11, + ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12, + ADSB_EMITTER_TYPE_UNASSIGNED2 = 13, + ADSB_EMITTER_TYPE_UAV = 14, + ADSB_EMITTER_TYPE_SPACE = 15, + ADSB_EMITTER_TYPE_UNASSGINED3 = 16, + ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17, + ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18, + ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19, + ADSB_EMITTER_TYPE_ENUM_END = 20, + + } + + + /// + /// These flags indicate status such as data validity of each data source. Set = data valid + /// + public enum ADSB_FLAGS : uint + { + ADSB_FLAGS_VALID_COORDS = 1, + ADSB_FLAGS_VALID_ALTITUDE = 2, + ADSB_FLAGS_VALID_HEADING = 4, + ADSB_FLAGS_VALID_VELOCITY = 8, + ADSB_FLAGS_VALID_CALLSIGN = 16, + ADSB_FLAGS_VALID_SQUAWK = 32, + ADSB_FLAGS_SIMULATED = 64, + ADSB_FLAGS_ENUM_END = 65, + + } + + + /// + /// Bitmask of options for the MAV_CMD_DO_REPOSITION + /// + public enum MAV_DO_REPOSITION_FLAGS : uint + { + + /// + /// The aircraft should immediately transition into guided. This should not be set for follow me applications + /// + MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1, + MAV_DO_REPOSITION_FLAGS_ENUM_END = 2, + + } + + + /// + /// Flags in EKF_STATUS message + /// + public enum ESTIMATOR_STATUS_FLAGS : uint + { + + /// + /// True if the attitude estimate is good + /// + ESTIMATOR_ATTITUDE = 1, + + /// + /// True if the horizontal velocity estimate is good + /// + ESTIMATOR_VELOCITY_HORIZ = 2, + + /// + /// True if the vertical velocity estimate is good + /// + ESTIMATOR_VELOCITY_VERT = 4, + + /// + /// True if the horizontal position (relative) estimate is good + /// + ESTIMATOR_POS_HORIZ_REL = 8, + + /// + /// True if the horizontal position (absolute) estimate is good + /// + ESTIMATOR_POS_HORIZ_ABS = 16, + + /// + /// True if the vertical position (absolute) estimate is good + /// + ESTIMATOR_POS_VERT_ABS = 32, + + /// + /// True if the vertical position (above ground) estimate is good + /// + ESTIMATOR_POS_VERT_AGL = 64, + + /// + /// True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow) + /// + ESTIMATOR_CONST_POS_MODE = 128, + + /// + /// True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate + /// + ESTIMATOR_PRED_POS_HORIZ_REL = 256, + + /// + /// True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate + /// + ESTIMATOR_PRED_POS_HORIZ_ABS = 512, + + /// + /// True if the EKF has detected a GPS glitch + /// + ESTIMATOR_GPS_GLITCH = 1024, + ESTIMATOR_STATUS_FLAGS_ENUM_END = 1025, + + } + + +} + + + +namespace MavLink +{ + + public abstract class MavlinkMessage + { + public abstract int Serialize(byte[] bytes, ref int offset); + } + + /// + /// Message For set angular velocity + /// + public class Msg_set_velocity : MavlinkMessage + { + + /// + /// velocity value + /// + public UInt16 ref_angular_velocity; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_VELOCITY(this, bytes, ref offset); + } + } + + + /// + /// The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). + /// + public class Msg_heartbeat : MavlinkMessage + { + + /// + /// Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) + /// + public byte type; + + /// + /// Autopilot type / class. defined in MAV_AUTOPILOT ENUM + /// + public byte autopilot; + + /// + /// System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h + /// + public byte base_mode; + + /// + /// A bitfield for use for autopilot-specific flags. + /// + public UInt32 custom_mode; + + /// + /// System status flag, see MAV_STATE ENUM + /// + public byte system_status; + + /// + /// MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version + /// + public byte mavlink_version; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HEARTBEAT(this, bytes, ref offset); + } + } + + + /// + /// The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows wether the system is currently active or not and if an emergency occured. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occured it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout. + /// + public class Msg_sys_status : MavlinkMessage + { + + /// + /// Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + /// + public UInt32 onboard_control_sensors_present; + + /// + /// Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + /// + public UInt32 onboard_control_sensors_enabled; + + /// + /// Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR + /// + public UInt32 onboard_control_sensors_health; + + /// + /// Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 + /// + public UInt16 load; + + /// + /// Battery voltage, in millivolts (1 = 1 millivolt) + /// + public UInt16 voltage_battery; + + /// + /// Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + /// + public Int16 current_battery; + + /// + /// Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery + /// + public sbyte battery_remaining; + + /// + /// Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + /// + public UInt16 drop_rate_comm; + + /// + /// Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV) + /// + public UInt16 errors_comm; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count1; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count2; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count3; + + /// + /// Autopilot-specific errors + /// + public UInt16 errors_count4; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SYS_STATUS(this, bytes, ref offset); + } + } + + + /// + /// The system time is the time of the master clock, typically the computer clock of the main onboard computer. + /// + public class Msg_system_time : MavlinkMessage + { + + /// + /// Timestamp of the master clock in microseconds since UNIX epoch. + /// + public UInt64 time_unix_usec; + + /// + /// Timestamp of the component clock since boot time in milliseconds. + /// + public UInt32 time_boot_ms; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SYSTEM_TIME(this, bytes, ref offset); + } + } + + + /// + /// A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. + /// + public class Msg_ping : MavlinkMessage + { + + /// + /// Unix timestamp in microseconds or since system boot if smaller than MAVLink epoch (1.1.2009) + /// + public UInt64 time_usec; + + /// + /// PING sequence + /// + public UInt32 seq; + + /// + /// 0: request ping from all receiving systems, if greater than 0: message is a ping response and number is the system id of the requesting system + /// + public byte target_system; + + /// + /// 0: request ping from all receiving components, if greater than 0: message is a ping response and number is the system id of the requesting system + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PING(this, bytes, ref offset); + } + } + + + /// + /// Request to control this MAV + /// + public class Msg_change_operator_control : MavlinkMessage + { + + /// + /// System the GCS requests control for + /// + public byte target_system; + + /// + /// 0: request control of this MAV, 1: Release control of this MAV + /// + public byte control_request; + + /// + /// 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch. + /// + public byte version; + + /// + /// Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-" + /// + public byte[] passkey; // Array size 25 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CHANGE_OPERATOR_CONTROL(this, bytes, ref offset); + } + } + + + /// + /// Accept / deny control of this MAV + /// + public class Msg_change_operator_control_ack : MavlinkMessage + { + + /// + /// ID of the GCS this message + /// + public byte gcs_system_id; + + /// + /// 0: request control of this MAV, 1: Release control of this MAV + /// + public byte control_request; + + /// + /// 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control + /// + public byte ack; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CHANGE_OPERATOR_CONTROL_ACK(this, bytes, ref offset); + } + } + + + /// + /// Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. + /// + public class Msg_auth_key : MavlinkMessage + { + public byte[] key; // Array size 32 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_AUTH_KEY(this, bytes, ref offset); + } + } + + + /// + /// THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with MAV_CMD_DO_SET_MODE INSTEAD. Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. + /// + public class Msg_set_mode : MavlinkMessage + { + + /// + /// The system setting the mode + /// + public byte target_system; + + /// + /// The new base mode + /// + public byte base_mode; + + /// + /// The new autopilot-specific mode. This field can be ignored by an autopilot. + /// + public UInt32 custom_mode; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_MODE(this, bytes, ref offset); + } + } + + + /// + /// Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. + /// + public class Msg_param_request_read : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + /// + public Int16 param_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_REQUEST_READ(this, bytes, ref offset); + } + } + + + /// + /// Request all parameters of this component. After his request, all parameters are emitted. + /// + public class Msg_param_request_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_REQUEST_LIST(this, bytes, ref offset); + } + } + + + /// + /// Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. + /// + public class Msg_param_value : MavlinkMessage + { + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Onboard parameter value + /// + public float param_value; + + /// + /// Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + /// + public byte param_type; + + /// + /// Total number of onboard parameters + /// + public UInt16 param_count; + + /// + /// Index of this onboard parameter + /// + public UInt16 param_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_VALUE(this, bytes, ref offset); + } + } + + + /// + /// Set a parameter value TEMPORARILY to RAM. It will be reset to default on system reboot. Send the ACTION MAV_ACTION_STORAGE_WRITE to PERMANENTLY write the RAM contents to EEPROM. IMPORTANT: The receiving component should acknowledge the new parameter value by sending a param_value message to all communication partners. This will also ensure that multiple GCS all have an up-to-date list of all parameters. If the sending GCS did not receive a PARAM_VALUE message within its timeout time, it should re-send the PARAM_SET message. + /// + public class Msg_param_set : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Onboard parameter value + /// + public float param_value; + + /// + /// Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types. + /// + public byte param_type; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_SET(this, bytes, ref offset); + } + } + + + /// + /// The global position, as returned by the Global Positioning System (GPS). This is + /// NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). + /// + public class Msg_gps_raw_int : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + /// + public byte fix_type; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude. + /// + public Int32 alt; + + /// + /// GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX + /// + public UInt16 eph; + + /// + /// GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX + /// + public UInt16 epv; + + /// + /// GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + /// + public UInt16 vel; + + /// + /// Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + /// + public UInt16 cog; + + /// + /// Number of satellites visible. If unknown, set to 255 + /// + public byte satellites_visible; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_RAW_INT(this, bytes, ref offset); + } + } + + + /// + /// The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION for the global position estimate. This message can contain information for up to 20 satellites. + /// + public class Msg_gps_status : MavlinkMessage + { + + /// + /// Number of satellites visible + /// + public byte satellites_visible; + + /// + /// Global satellite ID + /// + public byte[] satellite_prn; // Array size 20 + + /// + /// 0: Satellite not used, 1: used for localization + /// + public byte[] satellite_used; // Array size 20 + + /// + /// Elevation (0: right on top of receiver, 90: on the horizon) of satellite + /// + public byte[] satellite_elevation; // Array size 20 + + /// + /// Direction of satellite, 0: 0 deg, 255: 360 deg. + /// + public byte[] satellite_azimuth; // Array size 20 + + /// + /// Signal to noise ratio of satellite + /// + public byte[] satellite_snr; // Array size 20 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_STATUS(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units + /// + public class Msg_scaled_imu : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (millirad /sec) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (millirad /sec) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (millirad /sec) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (milli tesla) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (milli tesla) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (milli tesla) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_IMU(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. + /// + public class Msg_raw_imu : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// X acceleration (raw) + /// + public Int16 xacc; + + /// + /// Y acceleration (raw) + /// + public Int16 yacc; + + /// + /// Z acceleration (raw) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (raw) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (raw) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (raw) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (raw) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (raw) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (raw) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RAW_IMU(this, bytes, ref offset); + } + } + + + /// + /// The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. + /// + public class Msg_raw_pressure : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Absolute pressure (raw) + /// + public Int16 press_abs; + + /// + /// Differential pressure 1 (raw, 0 if nonexistant) + /// + public Int16 press_diff1; + + /// + /// Differential pressure 2 (raw, 0 if nonexistant) + /// + public Int16 press_diff2; + + /// + /// Raw Temperature measurement (raw) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RAW_PRESSURE(this, bytes, ref offset); + } + } + + + /// + /// The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. + /// + public class Msg_scaled_pressure : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Absolute pressure (hectopascal) + /// + public float press_abs; + + /// + /// Differential pressure 1 (hectopascal) + /// + public float press_diff; + + /// + /// Temperature measurement (0.01 degrees celsius) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_PRESSURE(this, bytes, ref offset); + } + } + + + /// + /// The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). + /// + public class Msg_attitude : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Roll angle (rad, -pi..+pi) + /// + public float roll; + + /// + /// Pitch angle (rad, -pi..+pi) + /// + public float pitch; + + /// + /// Yaw angle (rad, -pi..+pi) + /// + public float yaw; + + /// + /// Roll angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Pitch angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Yaw angular speed (rad/s) + /// + public float yawspeed; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE(this, bytes, ref offset); + } + } + + + /// + /// The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + /// + public class Msg_attitude_quaternion : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Quaternion component 1, w (1 in null-rotation) + /// + public float q1; + + /// + /// Quaternion component 2, x (0 in null-rotation) + /// + public float q2; + + /// + /// Quaternion component 3, y (0 in null-rotation) + /// + public float q3; + + /// + /// Quaternion component 4, z (0 in null-rotation) + /// + public float q4; + + /// + /// Roll angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Pitch angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Yaw angular speed (rad/s) + /// + public float yawspeed; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE_QUATERNION(this, bytes, ref offset); + } + } + + + /// + /// The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + /// + public class Msg_local_position_ned : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X Position + /// + public float x; + + /// + /// Y Position + /// + public float y; + + /// + /// Z Position + /// + public float z; + + /// + /// X Speed + /// + public float vx; + + /// + /// Y Speed + /// + public float vy; + + /// + /// Z Speed + /// + public float vz; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOCAL_POSITION_NED(this, bytes, ref offset); + } + } + + + /// + /// The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It + /// is designed as scaled integer message since the resolution of float is not sufficient. + /// + public class Msg_global_position_int : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Latitude, expressed as degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) + /// + public Int32 alt; + + /// + /// Altitude above ground in meters, expressed as * 1000 (millimeters) + /// + public Int32 relative_alt; + + /// + /// Ground X Speed (Latitude, positive north), expressed as m/s * 100 + /// + public Int16 vx; + + /// + /// Ground Y Speed (Longitude, positive east), expressed as m/s * 100 + /// + public Int16 vy; + + /// + /// Ground Z Speed (Altitude, positive down), expressed as m/s * 100 + /// + public Int16 vz; + + /// + /// Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + /// + public UInt16 hdg; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GLOBAL_POSITION_INT(this, bytes, ref offset); + } + } + + + /// + /// The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to UINT16_MAX. + /// + public class Msg_rc_channels_scaled : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + /// + public byte port; + + /// + /// RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan1_scaled; + + /// + /// RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan2_scaled; + + /// + /// RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan3_scaled; + + /// + /// RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan4_scaled; + + /// + /// RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan5_scaled; + + /// + /// RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan6_scaled; + + /// + /// RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan7_scaled; + + /// + /// RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. + /// + public Int16 chan8_scaled; + + /// + /// Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS_SCALED(this, bytes, ref offset); + } + } + + + /// + /// The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_rc_channels_raw : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. + /// + public byte port; + + /// + /// RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan8_raw; + + /// + /// Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS_RAW(this, bytes, ref offset); + } + } + + + /// + /// The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. + /// + public class Msg_servo_output_raw : MavlinkMessage + { + + /// + /// Timestamp (microseconds since system boot) + /// + public UInt32 time_usec; + + /// + /// Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. + /// + public byte port; + + /// + /// Servo output 1 value, in microseconds + /// + public UInt16 servo1_raw; + + /// + /// Servo output 2 value, in microseconds + /// + public UInt16 servo2_raw; + + /// + /// Servo output 3 value, in microseconds + /// + public UInt16 servo3_raw; + + /// + /// Servo output 4 value, in microseconds + /// + public UInt16 servo4_raw; + + /// + /// Servo output 5 value, in microseconds + /// + public UInt16 servo5_raw; + + /// + /// Servo output 6 value, in microseconds + /// + public UInt16 servo6_raw; + + /// + /// Servo output 7 value, in microseconds + /// + public UInt16 servo7_raw; + + /// + /// Servo output 8 value, in microseconds + /// + public UInt16 servo8_raw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SERVO_OUTPUT_RAW(this, bytes, ref offset); + } + } + + + /// + /// Request a partial list of mission items from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol. If start and end index are the same, just send one waypoint. + /// + public class Msg_mission_request_partial_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Start index, 0 by default + /// + public Int16 start_index; + + /// + /// End index, -1 by default (-1: send list to end). Else a valid index of the list + /// + public Int16 end_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST_PARTIAL_LIST(this, bytes, ref offset); + } + } + + + /// + /// This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! + /// + public class Msg_mission_write_partial_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Start index, 0 by default and smaller / equal to the largest index of the current onboard list. + /// + public Int16 start_index; + + /// + /// End index, equal or greater than start index. + /// + public Int16 end_index; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_WRITE_PARTIAL_LIST(this, bytes, ref offset); + } + } + + + /// + /// Message encoding a mission item. This message is emitted to announce + /// the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also http://qgroundcontrol.org/mavlink/waypoint_protocol. + /// + public class Msg_mission_item : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + /// + /// The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + /// + public byte frame; + + /// + /// The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + /// + public UInt16 command; + + /// + /// false:0, true:1 + /// + public byte current; + + /// + /// autocontinue to next wp + /// + public byte autocontinue; + + /// + /// PARAM1, see MAV_CMD enum + /// + public float param1; + + /// + /// PARAM2, see MAV_CMD enum + /// + public float param2; + + /// + /// PARAM3, see MAV_CMD enum + /// + public float param3; + + /// + /// PARAM4, see MAV_CMD enum + /// + public float param4; + + /// + /// PARAM5 / local: x position, global: latitude + /// + public float x; + + /// + /// PARAM6 / y position: global: longitude + /// + public float y; + + /// + /// PARAM7 / z position: global: altitude (relative or absolute, depending on frame. + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ITEM(this, bytes, ref offset); + } + } + + + /// + /// Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol + /// + public class Msg_mission_request : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST(this, bytes, ref offset); + } + } + + + /// + /// Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). + /// + public class Msg_mission_set_current : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_SET_CURRENT(this, bytes, ref offset); + } + } + + + /// + /// Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. + /// + public class Msg_mission_current : MavlinkMessage + { + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_CURRENT(this, bytes, ref offset); + } + } + + + /// + /// Request the overall list of mission items from the system/component. + /// + public class Msg_mission_request_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST_LIST(this, bytes, ref offset); + } + } + + + /// + /// This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. + /// + public class Msg_mission_count : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Number of mission items in the sequence + /// + public UInt16 count; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_COUNT(this, bytes, ref offset); + } + } + + + /// + /// Delete all mission items at once. + /// + public class Msg_mission_clear_all : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_CLEAR_ALL(this, bytes, ref offset); + } + } + + + /// + /// A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. + /// + public class Msg_mission_item_reached : MavlinkMessage + { + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ITEM_REACHED(this, bytes, ref offset); + } + } + + + /// + /// Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). + /// + public class Msg_mission_ack : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// See MAV_MISSION_RESULT enum + /// + public byte type; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ACK(this, bytes, ref offset); + } + } + + + /// + /// As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. + /// + public class Msg_set_gps_global_origin : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84, in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_GPS_GLOBAL_ORIGIN(this, bytes, ref offset); + } + } + + + /// + /// Once the MAV sets a new GPS-Local correspondence, this message announces the origin (0,0,0) position + /// + public class Msg_gps_global_origin : MavlinkMessage + { + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_GLOBAL_ORIGIN(this, bytes, ref offset); + } + } + + + /// + /// Bind a RC channel to a parameter. The parameter should change accoding to the RC channel value. + /// + public class Msg_param_map_rc : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + /// + public byte[] param_id; // Array size 16 + + /// + /// Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index. + /// + public Int16 param_index; + + /// + /// Index of parameter RC channel. Not equal to the RC channel id. Typically correpsonds to a potentiometer-knob on the RC. + /// + public byte parameter_rc_channel_index; + + /// + /// Initial parameter value + /// + public float param_value0; + + /// + /// Scale, maps the RC range [-1, 1] to a parameter value + /// + public float scale; + + /// + /// Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation) + /// + public float param_value_min; + + /// + /// Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation) + /// + public float param_value_max; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_PARAM_MAP_RC(this, bytes, ref offset); + } + } + + + /// + /// Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. http://qgroundcontrol.org/mavlink/waypoint_protocol + /// + public class Msg_mission_request_int : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Sequence + /// + public UInt16 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_REQUEST_INT(this, bytes, ref offset); + } + } + + + /// + /// Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. + /// + public class Msg_safety_set_allowed_area : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + /// + public byte frame; + + /// + /// x position 1 / Latitude 1 + /// + public float p1x; + + /// + /// y position 1 / Longitude 1 + /// + public float p1y; + + /// + /// z position 1 / Altitude 1 + /// + public float p1z; + + /// + /// x position 2 / Latitude 2 + /// + public float p2x; + + /// + /// y position 2 / Longitude 2 + /// + public float p2y; + + /// + /// z position 2 / Altitude 2 + /// + public float p2z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SAFETY_SET_ALLOWED_AREA(this, bytes, ref offset); + } + } + + + /// + /// Read out the safety zone the MAV currently assumes. + /// + public class Msg_safety_allowed_area : MavlinkMessage + { + + /// + /// Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. + /// + public byte frame; + + /// + /// x position 1 / Latitude 1 + /// + public float p1x; + + /// + /// y position 1 / Longitude 1 + /// + public float p1y; + + /// + /// z position 1 / Altitude 1 + /// + public float p1z; + + /// + /// x position 2 / Latitude 2 + /// + public float p2x; + + /// + /// y position 2 / Longitude 2 + /// + public float p2y; + + /// + /// z position 2 / Altitude 2 + /// + public float p2z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SAFETY_ALLOWED_AREA(this, bytes, ref offset); + } + } + + + /// + /// The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + /// + public class Msg_attitude_quaternion_cov : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + /// + public float[] q; // Array size 4 + + /// + /// Roll angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Pitch angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Yaw angular speed (rad/s) + /// + public float yawspeed; + + /// + /// Attitude covariance + /// + public float[] covariance; // Array size 9 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE_QUATERNION_COV(this, bytes, ref offset); + } + } + + + /// + /// The state of the fixed wing navigation and position controller. + /// + public class Msg_nav_controller_output : MavlinkMessage + { + + /// + /// Current desired roll in degrees + /// + public float nav_roll; + + /// + /// Current desired pitch in degrees + /// + public float nav_pitch; + + /// + /// Current desired heading in degrees + /// + public Int16 nav_bearing; + + /// + /// Bearing to current MISSION/target in degrees + /// + public Int16 target_bearing; + + /// + /// Distance to active MISSION in meters + /// + public UInt16 wp_dist; + + /// + /// Current altitude error in meters + /// + public float alt_error; + + /// + /// Current airspeed error in meters/second + /// + public float aspd_error; + + /// + /// Current crosstrack error on x-y plane in meters + /// + public float xtrack_error; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_NAV_CONTROLLER_OUTPUT(this, bytes, ref offset); + } + } + + + /// + /// The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset. + /// + public class Msg_global_position_int_cov : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver. + /// + public UInt64 time_utc; + + /// + /// Class id of the estimator this estimate originated from. + /// + public byte estimator_type; + + /// + /// Latitude, expressed as degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters), above MSL + /// + public Int32 alt; + + /// + /// Altitude above ground in meters, expressed as * 1000 (millimeters) + /// + public Int32 relative_alt; + + /// + /// Ground X Speed (Latitude), expressed as m/s + /// + public float vx; + + /// + /// Ground Y Speed (Longitude), expressed as m/s + /// + public float vy; + + /// + /// Ground Z Speed (Altitude), expressed as m/s + /// + public float vz; + + /// + /// Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.) + /// + public float[] covariance; // Array size 36 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GLOBAL_POSITION_INT_COV(this, bytes, ref offset); + } + } + + + /// + /// The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + /// + public class Msg_local_position_ned_cov : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot). 0 for system without monotonic timestamp + /// + public UInt32 time_boot_ms; + + /// + /// Timestamp (microseconds since UNIX epoch) in UTC. 0 for unknown. Commonly filled by the precision time source of a GPS receiver. + /// + public UInt64 time_utc; + + /// + /// Class id of the estimator this estimate originated from. + /// + public byte estimator_type; + + /// + /// X Position + /// + public float x; + + /// + /// Y Position + /// + public float y; + + /// + /// Z Position + /// + public float z; + + /// + /// X Speed (m/s) + /// + public float vx; + + /// + /// Y Speed (m/s) + /// + public float vy; + + /// + /// Z Speed (m/s) + /// + public float vz; + + /// + /// X Acceleration (m/s^2) + /// + public float ax; + + /// + /// Y Acceleration (m/s^2) + /// + public float ay; + + /// + /// Z Acceleration (m/s^2) + /// + public float az; + + /// + /// Covariance matrix upper right triangular (first nine entries are the first ROW, next eight entries are the second row, etc.) + /// + public float[] covariance; // Array size 45 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOCAL_POSITION_NED_COV(this, bytes, ref offset); + } + } + + + /// + /// The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_rc_channels : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. + /// + public byte chancount; + + /// + /// RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan8_raw; + + /// + /// RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan9_raw; + + /// + /// RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan10_raw; + + /// + /// RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan11_raw; + + /// + /// RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan12_raw; + + /// + /// RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan13_raw; + + /// + /// RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan14_raw; + + /// + /// RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan15_raw; + + /// + /// RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan16_raw; + + /// + /// RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan17_raw; + + /// + /// RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. + /// + public UInt16 chan18_raw; + + /// + /// Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS(this, bytes, ref offset); + } + } + + + /// + /// THIS INTERFACE IS DEPRECATED. USE SET_MESSAGE_INTERVAL INSTEAD. + /// + public class Msg_request_data_stream : MavlinkMessage + { + + /// + /// The target requested to send the message stream. + /// + public byte target_system; + + /// + /// The target requested to send the message stream. + /// + public byte target_component; + + /// + /// The ID of the requested data stream + /// + public byte req_stream_id; + + /// + /// The requested message rate + /// + public UInt16 req_message_rate; + + /// + /// 1 to start sending, 0 to stop sending. + /// + public byte start_stop; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_REQUEST_DATA_STREAM(this, bytes, ref offset); + } + } + + + /// + /// THIS INTERFACE IS DEPRECATED. USE MESSAGE_INTERVAL INSTEAD. + /// + public class Msg_data_stream : MavlinkMessage + { + + /// + /// The ID of the requested data stream + /// + public byte stream_id; + + /// + /// The message rate + /// + public UInt16 message_rate; + + /// + /// 1 stream is enabled, 0 stream is stopped. + /// + public byte on_off; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DATA_STREAM(this, bytes, ref offset); + } + } + + + /// + /// This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled an buttons are also transmit as boolean values of their + /// + public class Msg_manual_control : MavlinkMessage + { + + /// + /// The system to be controlled. + /// + public byte target; + + /// + /// X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle. + /// + public Int16 x; + + /// + /// Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle. + /// + public Int16 y; + + /// + /// Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust. + /// + public Int16 z; + + /// + /// R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle. + /// + public Int16 r; + + /// + /// A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1. + /// + public UInt16 buttons; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MANUAL_CONTROL(this, bytes, ref offset); + } + } + + + /// + /// The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of UINT16_MAX means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_rc_channels_override : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. + /// + public UInt16 chan8_raw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RC_CHANNELS_OVERRIDE(this, bytes, ref offset); + } + } + + + /// + /// Message encoding a mission item. This message is emitted to announce + /// the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See alsohttp://qgroundcontrol.org/mavlink/waypoint_protocol. + /// + public class Msg_mission_item_int : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + /// + public UInt16 seq; + + /// + /// The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h + /// + public byte frame; + + /// + /// The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs + /// + public UInt16 command; + + /// + /// false:0, true:1 + /// + public byte current; + + /// + /// autocontinue to next wp + /// + public byte autocontinue; + + /// + /// PARAM1, see MAV_CMD enum + /// + public float param1; + + /// + /// PARAM2, see MAV_CMD enum + /// + public float param2; + + /// + /// PARAM3, see MAV_CMD enum + /// + public float param3; + + /// + /// PARAM4, see MAV_CMD enum + /// + public float param4; + + /// + /// PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + /// + public Int32 x; + + /// + /// PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + /// + public Int32 y; + + /// + /// PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MISSION_ITEM_INT(this, bytes, ref offset); + } + } + + + /// + /// Metrics typically displayed on a HUD for fixed wing aircraft + /// + public class Msg_vfr_hud : MavlinkMessage + { + + /// + /// Current airspeed in m/s + /// + public float airspeed; + + /// + /// Current ground speed in m/s + /// + public float groundspeed; + + /// + /// Current heading in degrees, in compass units (0..360, 0=north) + /// + public Int16 heading; + + /// + /// Current throttle setting in integer percent, 0 to 100 + /// + public UInt16 throttle; + + /// + /// Current altitude (MSL), in meters + /// + public float alt; + + /// + /// Current climb rate in meters/second + /// + public float climb; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VFR_HUD(this, bytes, ref offset); + } + } + + + /// + /// Message encoding a command with parameters as scaled integers. Scaling depends on the actual command value. + /// + public class Msg_command_int : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h + /// + public byte frame; + + /// + /// The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs + /// + public UInt16 command; + + /// + /// false:0, true:1 + /// + public byte current; + + /// + /// autocontinue to next wp + /// + public byte autocontinue; + + /// + /// PARAM1, see MAV_CMD enum + /// + public float param1; + + /// + /// PARAM2, see MAV_CMD enum + /// + public float param2; + + /// + /// PARAM3, see MAV_CMD enum + /// + public float param3; + + /// + /// PARAM4, see MAV_CMD enum + /// + public float param4; + + /// + /// PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + /// + public Int32 x; + + /// + /// PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 + /// + public Int32 y; + + /// + /// PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_COMMAND_INT(this, bytes, ref offset); + } + } + + + /// + /// Send a command with up to seven parameters to the MAV + /// + public class Msg_command_long : MavlinkMessage + { + + /// + /// System which should execute the command + /// + public byte target_system; + + /// + /// Component which should execute the command, 0 for all components + /// + public byte target_component; + + /// + /// Command ID, as defined by MAV_CMD enum. + /// + public UInt16 command; + + /// + /// 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command) + /// + public byte confirmation; + + /// + /// Parameter 1, as defined by MAV_CMD enum. + /// + public float param1; + + /// + /// Parameter 2, as defined by MAV_CMD enum. + /// + public float param2; + + /// + /// Parameter 3, as defined by MAV_CMD enum. + /// + public float param3; + + /// + /// Parameter 4, as defined by MAV_CMD enum. + /// + public float param4; + + /// + /// Parameter 5, as defined by MAV_CMD enum. + /// + public float param5; + + /// + /// Parameter 6, as defined by MAV_CMD enum. + /// + public float param6; + + /// + /// Parameter 7, as defined by MAV_CMD enum. + /// + public float param7; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_COMMAND_LONG(this, bytes, ref offset); + } + } + + + /// + /// Report status of a command. Includes feedback wether the command was executed. + /// + public class Msg_command_ack : MavlinkMessage + { + + /// + /// Command ID, as defined by MAV_CMD enum. + /// + public UInt16 command; + + /// + /// See MAV_RESULT enum + /// + public byte result; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_COMMAND_ACK(this, bytes, ref offset); + } + } + + + /// + /// Setpoint in roll, pitch, yaw and thrust from the operator + /// + public class Msg_manual_setpoint : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Desired roll rate in radians per second + /// + public float roll; + + /// + /// Desired pitch rate in radians per second + /// + public float pitch; + + /// + /// Desired yaw rate in radians per second + /// + public float yaw; + + /// + /// Collective thrust, normalized to 0 .. 1 + /// + public float thrust; + + /// + /// Flight mode switch position, 0.. 255 + /// + public byte mode_switch; + + /// + /// Override mode switch position, 0.. 255 + /// + public byte manual_override_switch; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MANUAL_SETPOINT(this, bytes, ref offset); + } + } + + + /// + /// Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system). + /// + public class Msg_set_attitude_target : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude + /// + public byte type_mask; + + /// + /// Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + /// + public float[] q; // Array size 4 + + /// + /// Body roll rate in radians per second + /// + public float body_roll_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_pitch_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_yaw_rate; + + /// + /// Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + /// + public float thrust; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_ATTITUDE_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way. + /// + public class Msg_attitude_target : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + /// + public byte type_mask; + + /// + /// Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + /// + public float[] q; // Array size 4 + + /// + /// Body roll rate in radians per second + /// + public float body_roll_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_pitch_rate; + + /// + /// Body roll rate in radians per second + /// + public float body_yaw_rate; + + /// + /// Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + /// + public float thrust; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATTITUDE_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system). + /// + public class Msg_set_position_target_local_ned : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in NED frame in meters + /// + public float x; + + /// + /// Y Position in NED frame in meters + /// + public float y; + + /// + /// Z Position in NED frame in meters (note, altitude is negative in NED) + /// + public float z; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_POSITION_TARGET_LOCAL_NED(this, bytes, ref offset); + } + } + + + /// + /// Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way. + /// + public class Msg_position_target_local_ned : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in NED frame in meters + /// + public float x; + + /// + /// Y Position in NED frame in meters + /// + public float y; + + /// + /// Z Position in NED frame in meters (note, altitude is negative in NED) + /// + public float z; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_POSITION_TARGET_LOCAL_NED(this, bytes, ref offset); + } + } + + + /// + /// Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system). + /// + public class Msg_set_position_target_global_int : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + /// + public UInt32 time_boot_ms; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in WGS84 frame in 1e7 * meters + /// + public Int32 lat_int; + + /// + /// Y Position in WGS84 frame in 1e7 * meters + /// + public Int32 lon_int; + + /// + /// Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + /// + public float alt; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_POSITION_TARGET_GLOBAL_INT(this, bytes, ref offset); + } + } + + + /// + /// Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way. + /// + public class Msg_position_target_global_int : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. + /// + public UInt32 time_boot_ms; + + /// + /// Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 + /// + public byte coordinate_frame; + + /// + /// Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate + /// + public UInt16 type_mask; + + /// + /// X Position in WGS84 frame in 1e7 * meters + /// + public Int32 lat_int; + + /// + /// Y Position in WGS84 frame in 1e7 * meters + /// + public Int32 lon_int; + + /// + /// Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT + /// + public float alt; + + /// + /// X velocity in NED frame in meter / s + /// + public float vx; + + /// + /// Y velocity in NED frame in meter / s + /// + public float vy; + + /// + /// Z velocity in NED frame in meter / s + /// + public float vz; + + /// + /// X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afx; + + /// + /// Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afy; + + /// + /// Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N + /// + public float afz; + + /// + /// yaw setpoint in rad + /// + public float yaw; + + /// + /// yaw rate setpoint in rad/s + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_POSITION_TARGET_GLOBAL_INT(this, bytes, ref offset); + } + } + + + /// + /// The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention) + /// + public class Msg_local_position_ned_system_global_offset : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X Position + /// + public float x; + + /// + /// Y Position + /// + public float y; + + /// + /// Z Position + /// + public float z; + public float roll; + public float pitch; + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(this, bytes, ref offset); + } + } + + + /// + /// DEPRECATED PACKET! Suffers from missing airspeed fields and singularities due to Euler angles. Please use HIL_STATE_QUATERNION instead. Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations. + /// + public class Msg_hil_state : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Roll angle (rad) + /// + public float roll; + + /// + /// Pitch angle (rad) + /// + public float pitch; + + /// + /// Yaw angle (rad) + /// + public float yaw; + + /// + /// Body frame roll / phi angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Body frame pitch / theta angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Body frame yaw / psi angular speed (rad/s) + /// + public float yawspeed; + + /// + /// Latitude, expressed as * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters) + /// + public Int32 alt; + + /// + /// Ground X Speed (Latitude), expressed as m/s * 100 + /// + public Int16 vx; + + /// + /// Ground Y Speed (Longitude), expressed as m/s * 100 + /// + public Int16 vy; + + /// + /// Ground Z Speed (Altitude), expressed as m/s * 100 + /// + public Int16 vz; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_STATE(this, bytes, ref offset); + } + } + + + /// + /// Sent from autopilot to simulation. Hardware in the loop control outputs + /// + public class Msg_hil_controls : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Control output -1 .. 1 + /// + public float roll_ailerons; + + /// + /// Control output -1 .. 1 + /// + public float pitch_elevator; + + /// + /// Control output -1 .. 1 + /// + public float yaw_rudder; + + /// + /// Throttle 0 .. 1 + /// + public float throttle; + + /// + /// Aux 1, -1 .. 1 + /// + public float aux1; + + /// + /// Aux 2, -1 .. 1 + /// + public float aux2; + + /// + /// Aux 3, -1 .. 1 + /// + public float aux3; + + /// + /// Aux 4, -1 .. 1 + /// + public float aux4; + + /// + /// System mode (MAV_MODE) + /// + public byte mode; + + /// + /// Navigation mode (MAV_NAV_MODE) + /// + public byte nav_mode; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_CONTROLS(this, bytes, ref offset); + } + } + + + /// + /// Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. + /// + public class Msg_hil_rc_inputs_raw : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// RC channel 1 value, in microseconds + /// + public UInt16 chan1_raw; + + /// + /// RC channel 2 value, in microseconds + /// + public UInt16 chan2_raw; + + /// + /// RC channel 3 value, in microseconds + /// + public UInt16 chan3_raw; + + /// + /// RC channel 4 value, in microseconds + /// + public UInt16 chan4_raw; + + /// + /// RC channel 5 value, in microseconds + /// + public UInt16 chan5_raw; + + /// + /// RC channel 6 value, in microseconds + /// + public UInt16 chan6_raw; + + /// + /// RC channel 7 value, in microseconds + /// + public UInt16 chan7_raw; + + /// + /// RC channel 8 value, in microseconds + /// + public UInt16 chan8_raw; + + /// + /// RC channel 9 value, in microseconds + /// + public UInt16 chan9_raw; + + /// + /// RC channel 10 value, in microseconds + /// + public UInt16 chan10_raw; + + /// + /// RC channel 11 value, in microseconds + /// + public UInt16 chan11_raw; + + /// + /// RC channel 12 value, in microseconds + /// + public UInt16 chan12_raw; + + /// + /// Receive signal strength indicator, 0: 0%, 255: 100% + /// + public byte rssi; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_RC_INPUTS_RAW(this, bytes, ref offset); + } + } + + + /// + /// Optical flow from a flow sensor (e.g. optical mouse sensor) + /// + public class Msg_optical_flow : MavlinkMessage + { + + /// + /// Timestamp (UNIX) + /// + public UInt64 time_usec; + + /// + /// Sensor ID + /// + public byte sensor_id; + + /// + /// Flow in pixels * 10 in x-sensor direction (dezi-pixels) + /// + public Int16 flow_x; + + /// + /// Flow in pixels * 10 in y-sensor direction (dezi-pixels) + /// + public Int16 flow_y; + + /// + /// Flow in meters in x-sensor direction, angular-speed compensated + /// + public float flow_comp_m_x; + + /// + /// Flow in meters in y-sensor direction, angular-speed compensated + /// + public float flow_comp_m_y; + + /// + /// Optical flow quality / confidence. 0: bad, 255: maximum quality + /// + public byte quality; + + /// + /// Ground distance in meters. Positive value: distance known. Negative value: Unknown distance + /// + public float ground_distance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_OPTICAL_FLOW(this, bytes, ref offset); + } + } + + public class Msg_global_vision_position_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X position + /// + public float x; + + /// + /// Global Y position + /// + public float y; + + /// + /// Global Z position + /// + public float z; + + /// + /// Roll angle in rad + /// + public float roll; + + /// + /// Pitch angle in rad + /// + public float pitch; + + /// + /// Yaw angle in rad + /// + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GLOBAL_VISION_POSITION_ESTIMATE(this, bytes, ref offset); + } + } + + public class Msg_vision_position_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X position + /// + public float x; + + /// + /// Global Y position + /// + public float y; + + /// + /// Global Z position + /// + public float z; + + /// + /// Roll angle in rad + /// + public float roll; + + /// + /// Pitch angle in rad + /// + public float pitch; + + /// + /// Yaw angle in rad + /// + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VISION_POSITION_ESTIMATE(this, bytes, ref offset); + } + } + + public class Msg_vision_speed_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X speed + /// + public float x; + + /// + /// Global Y speed + /// + public float y; + + /// + /// Global Z speed + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VISION_SPEED_ESTIMATE(this, bytes, ref offset); + } + } + + public class Msg_vicon_position_estimate : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 usec; + + /// + /// Global X position + /// + public float x; + + /// + /// Global Y position + /// + public float y; + + /// + /// Global Z position + /// + public float z; + + /// + /// Roll angle in rad + /// + public float roll; + + /// + /// Pitch angle in rad + /// + public float pitch; + + /// + /// Yaw angle in rad + /// + public float yaw; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VICON_POSITION_ESTIMATE(this, bytes, ref offset); + } + } + + + /// + /// The IMU readings in SI units in NED body frame + /// + public class Msg_highres_imu : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// X acceleration (m/s^2) + /// + public float xacc; + + /// + /// Y acceleration (m/s^2) + /// + public float yacc; + + /// + /// Z acceleration (m/s^2) + /// + public float zacc; + + /// + /// Angular speed around X axis (rad / sec) + /// + public float xgyro; + + /// + /// Angular speed around Y axis (rad / sec) + /// + public float ygyro; + + /// + /// Angular speed around Z axis (rad / sec) + /// + public float zgyro; + + /// + /// X Magnetic field (Gauss) + /// + public float xmag; + + /// + /// Y Magnetic field (Gauss) + /// + public float ymag; + + /// + /// Z Magnetic field (Gauss) + /// + public float zmag; + + /// + /// Absolute pressure in millibar + /// + public float abs_pressure; + + /// + /// Differential pressure in millibar + /// + public float diff_pressure; + + /// + /// Altitude calculated from pressure + /// + public float pressure_alt; + + /// + /// Temperature in degrees celsius + /// + public float temperature; + + /// + /// Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature + /// + public UInt16 fields_updated; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIGHRES_IMU(this, bytes, ref offset); + } + } + + + /// + /// Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor) + /// + public class Msg_optical_flow_rad : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// Sensor ID + /// + public byte sensor_id; + + /// + /// Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + /// + public UInt32 integration_time_us; + + /// + /// Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + /// + public float integrated_x; + + /// + /// Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + /// + public float integrated_y; + + /// + /// RH rotation around X axis (rad) + /// + public float integrated_xgyro; + + /// + /// RH rotation around Y axis (rad) + /// + public float integrated_ygyro; + + /// + /// RH rotation around Z axis (rad) + /// + public float integrated_zgyro; + + /// + /// Temperature * 100 in centi-degrees Celsius + /// + public Int16 temperature; + + /// + /// Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + /// + public byte quality; + + /// + /// Time in microseconds since the distance was sampled. + /// + public UInt32 time_delta_distance_us; + + /// + /// Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + /// + public float distance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_OPTICAL_FLOW_RAD(this, bytes, ref offset); + } + } + + + /// + /// The IMU readings in SI units in NED body frame + /// + public class Msg_hil_sensor : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// X acceleration (m/s^2) + /// + public float xacc; + + /// + /// Y acceleration (m/s^2) + /// + public float yacc; + + /// + /// Z acceleration (m/s^2) + /// + public float zacc; + + /// + /// Angular speed around X axis in body frame (rad / sec) + /// + public float xgyro; + + /// + /// Angular speed around Y axis in body frame (rad / sec) + /// + public float ygyro; + + /// + /// Angular speed around Z axis in body frame (rad / sec) + /// + public float zgyro; + + /// + /// X Magnetic field (Gauss) + /// + public float xmag; + + /// + /// Y Magnetic field (Gauss) + /// + public float ymag; + + /// + /// Z Magnetic field (Gauss) + /// + public float zmag; + + /// + /// Absolute pressure in millibar + /// + public float abs_pressure; + + /// + /// Differential pressure (airspeed) in millibar + /// + public float diff_pressure; + + /// + /// Altitude calculated from pressure + /// + public float pressure_alt; + + /// + /// Temperature in degrees celsius + /// + public float temperature; + + /// + /// Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature, bit 31: full reset of attitude/position/velocities/etc was performed in sim. + /// + public UInt32 fields_updated; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_SENSOR(this, bytes, ref offset); + } + } + + + /// + /// Status of simulation environment, if used + /// + public class Msg_sim_state : MavlinkMessage + { + + /// + /// True attitude quaternion component 1, w (1 in null-rotation) + /// + public float q1; + + /// + /// True attitude quaternion component 2, x (0 in null-rotation) + /// + public float q2; + + /// + /// True attitude quaternion component 3, y (0 in null-rotation) + /// + public float q3; + + /// + /// True attitude quaternion component 4, z (0 in null-rotation) + /// + public float q4; + + /// + /// Attitude roll expressed as Euler angles, not recommended except for human-readable outputs + /// + public float roll; + + /// + /// Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs + /// + public float pitch; + + /// + /// Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs + /// + public float yaw; + + /// + /// X acceleration m/s/s + /// + public float xacc; + + /// + /// Y acceleration m/s/s + /// + public float yacc; + + /// + /// Z acceleration m/s/s + /// + public float zacc; + + /// + /// Angular speed around X axis rad/s + /// + public float xgyro; + + /// + /// Angular speed around Y axis rad/s + /// + public float ygyro; + + /// + /// Angular speed around Z axis rad/s + /// + public float zgyro; + + /// + /// Latitude in degrees + /// + public float lat; + + /// + /// Longitude in degrees + /// + public float lon; + + /// + /// Altitude in meters + /// + public float alt; + + /// + /// Horizontal position standard deviation + /// + public float std_dev_horz; + + /// + /// Vertical position standard deviation + /// + public float std_dev_vert; + + /// + /// True velocity in m/s in NORTH direction in earth-fixed NED frame + /// + public float vn; + + /// + /// True velocity in m/s in EAST direction in earth-fixed NED frame + /// + public float ve; + + /// + /// True velocity in m/s in DOWN direction in earth-fixed NED frame + /// + public float vd; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SIM_STATE(this, bytes, ref offset); + } + } + + + /// + /// Status generated by radio and injected into MAVLink stream. + /// + public class Msg_radio_status : MavlinkMessage + { + + /// + /// Local signal strength + /// + public byte rssi; + + /// + /// Remote signal strength + /// + public byte remrssi; + + /// + /// Remaining free buffer space in percent. + /// + public byte txbuf; + + /// + /// Background noise level + /// + public byte noise; + + /// + /// Remote background noise level + /// + public byte remnoise; + + /// + /// Receive errors + /// + public UInt16 rxerrors; + + /// + /// Count of error corrected packets + /// + public UInt16 @fixed; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RADIO_STATUS(this, bytes, ref offset); + } + } + + + /// + /// File transfer message + /// + public class Msg_file_transfer_protocol : MavlinkMessage + { + + /// + /// Network ID (0 for broadcast) + /// + public byte target_network; + + /// + /// System ID (0 for broadcast) + /// + public byte target_system; + + /// + /// Component ID (0 for broadcast) + /// + public byte target_component; + + /// + /// Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + /// + public byte[] payload; // Array size 251 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_FILE_TRANSFER_PROTOCOL(this, bytes, ref offset); + } + } + + + /// + /// Time synchronization message. + /// + public class Msg_timesync : MavlinkMessage + { + + /// + /// Time sync timestamp 1 + /// + public Int64 tc1; + + /// + /// Time sync timestamp 2 + /// + public Int64 ts1; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TIMESYNC(this, bytes, ref offset); + } + } + + + /// + /// Camera-IMU triggering and synchronisation message. + /// + public class Msg_camera_trigger : MavlinkMessage + { + + /// + /// Timestamp for the image frame in microseconds + /// + public UInt64 time_usec; + + /// + /// Image frame sequence + /// + public UInt32 seq; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CAMERA_TRIGGER(this, bytes, ref offset); + } + } + + + /// + /// The global position, as returned by the Global Positioning System (GPS). This is + /// NOT the global position estimate of the sytem, but rather a RAW sensor value. See message GLOBAL_POSITION for the global position estimate. Coordinate frame is right-handed, Z-axis up (GPS frame). + /// + public class Msg_hil_gps : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// 0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + /// + public byte fix_type; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + /// + public Int32 alt; + + /// + /// GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: 65535 + /// + public UInt16 eph; + + /// + /// GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: 65535 + /// + public UInt16 epv; + + /// + /// GPS ground speed (m/s * 100). If unknown, set to: 65535 + /// + public UInt16 vel; + + /// + /// GPS velocity in cm/s in NORTH direction in earth-fixed NED frame + /// + public Int16 vn; + + /// + /// GPS velocity in cm/s in EAST direction in earth-fixed NED frame + /// + public Int16 ve; + + /// + /// GPS velocity in cm/s in DOWN direction in earth-fixed NED frame + /// + public Int16 vd; + + /// + /// Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535 + /// + public UInt16 cog; + + /// + /// Number of satellites visible. If unknown, set to 255 + /// + public byte satellites_visible; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_GPS(this, bytes, ref offset); + } + } + + + /// + /// Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor) + /// + public class Msg_hil_optical_flow : MavlinkMessage + { + + /// + /// Timestamp (microseconds, synced to UNIX time or since system boot) + /// + public UInt64 time_usec; + + /// + /// Sensor ID + /// + public byte sensor_id; + + /// + /// Integration time in microseconds. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the. + /// + public UInt32 integration_time_us; + + /// + /// Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.) + /// + public float integrated_x; + + /// + /// Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.) + /// + public float integrated_y; + + /// + /// RH rotation around X axis (rad) + /// + public float integrated_xgyro; + + /// + /// RH rotation around Y axis (rad) + /// + public float integrated_ygyro; + + /// + /// RH rotation around Z axis (rad) + /// + public float integrated_zgyro; + + /// + /// Temperature * 100 in centi-degrees Celsius + /// + public Int16 temperature; + + /// + /// Optical flow quality / confidence. 0: no valid flow, 255: maximum quality + /// + public byte quality; + + /// + /// Time in microseconds since the distance was sampled. + /// + public UInt32 time_delta_distance_us; + + /// + /// Distance to the center of the flow field in meters. Positive value (including zero): distance known. Negative value: Unknown distance. + /// + public float distance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_OPTICAL_FLOW(this, bytes, ref offset); + } + } + + + /// + /// Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations. + /// + public class Msg_hil_state_quaternion : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation) + /// + public float[] attitude_quaternion; // Array size 4 + + /// + /// Body frame roll / phi angular speed (rad/s) + /// + public float rollspeed; + + /// + /// Body frame pitch / theta angular speed (rad/s) + /// + public float pitchspeed; + + /// + /// Body frame yaw / psi angular speed (rad/s) + /// + public float yawspeed; + + /// + /// Latitude, expressed as * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as * 1E7 + /// + public Int32 lon; + + /// + /// Altitude in meters, expressed as * 1000 (millimeters) + /// + public Int32 alt; + + /// + /// Ground X Speed (Latitude), expressed as m/s * 100 + /// + public Int16 vx; + + /// + /// Ground Y Speed (Longitude), expressed as m/s * 100 + /// + public Int16 vy; + + /// + /// Ground Z Speed (Altitude), expressed as m/s * 100 + /// + public Int16 vz; + + /// + /// Indicated airspeed, expressed as m/s * 100 + /// + public UInt16 ind_airspeed; + + /// + /// True airspeed, expressed as m/s * 100 + /// + public UInt16 true_airspeed; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HIL_STATE_QUATERNION(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units + /// + public class Msg_scaled_imu2 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (millirad /sec) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (millirad /sec) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (millirad /sec) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (milli tesla) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (milli tesla) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (milli tesla) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_IMU2(this, bytes, ref offset); + } + } + + + /// + /// Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. + /// + public class Msg_log_request_list : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// First log id (0 for first available) + /// + public UInt16 start; + + /// + /// Last log id (0xffff for last available) + /// + public UInt16 end; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_REQUEST_LIST(this, bytes, ref offset); + } + } + + + /// + /// Reply to LOG_REQUEST_LIST + /// + public class Msg_log_entry : MavlinkMessage + { + + /// + /// Log id + /// + public UInt16 id; + + /// + /// Total number of logs + /// + public UInt16 num_logs; + + /// + /// High log number + /// + public UInt16 last_log_num; + + /// + /// UTC timestamp of log in seconds since 1970, or 0 if not available + /// + public UInt32 time_utc; + + /// + /// Size of the log (may be approximate) in bytes + /// + public UInt32 size; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_ENTRY(this, bytes, ref offset); + } + } + + + /// + /// Request a chunk of a log + /// + public class Msg_log_request_data : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Log id (from LOG_ENTRY reply) + /// + public UInt16 id; + + /// + /// Offset into the log + /// + public UInt32 ofs; + + /// + /// Number of bytes + /// + public UInt32 count; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_REQUEST_DATA(this, bytes, ref offset); + } + } + + + /// + /// Reply to LOG_REQUEST_DATA + /// + public class Msg_log_data : MavlinkMessage + { + + /// + /// Log id (from LOG_ENTRY reply) + /// + public UInt16 id; + + /// + /// Offset into the log + /// + public UInt32 ofs; + + /// + /// Number of bytes (zero for end of log) + /// + public byte count; + + /// + /// log data + /// + public byte[] data; // Array size 90 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_DATA(this, bytes, ref offset); + } + } + + + /// + /// Erase all logs + /// + public class Msg_log_erase : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_ERASE(this, bytes, ref offset); + } + } + + + /// + /// Stop log transfer and resume normal logging + /// + public class Msg_log_request_end : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LOG_REQUEST_END(this, bytes, ref offset); + } + } + + + /// + /// data for injecting into the onboard GPS (used for DGPS) + /// + public class Msg_gps_inject_data : MavlinkMessage + { + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// data length + /// + public byte len; + + /// + /// raw data (110 is enough for 12 satellites of RTCMv2) + /// + public byte[] data; // Array size 110 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_INJECT_DATA(this, bytes, ref offset); + } + } + + + /// + /// Second GPS data. Coordinate frame is right-handed, Z-axis up (GPS frame). + /// + public class Msg_gps2_raw : MavlinkMessage + { + + /// + /// Timestamp (microseconds since UNIX epoch or microseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. + /// + public byte fix_type; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// Altitude (AMSL, not WGS84), in meters * 1000 (positive for up) + /// + public Int32 alt; + + /// + /// GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + /// + public UInt16 eph; + + /// + /// GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX + /// + public UInt16 epv; + + /// + /// GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX + /// + public UInt16 vel; + + /// + /// Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX + /// + public UInt16 cog; + + /// + /// Number of satellites visible. If unknown, set to 255 + /// + public byte satellites_visible; + + /// + /// Number of DGPS satellites + /// + public byte dgps_numch; + + /// + /// Age of DGPS info + /// + public UInt32 dgps_age; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS2_RAW(this, bytes, ref offset); + } + } + + + /// + /// Power supply status + /// + public class Msg_power_status : MavlinkMessage + { + + /// + /// 5V rail voltage in millivolts + /// + public UInt16 Vcc; + + /// + /// servo rail voltage in millivolts + /// + public UInt16 Vservo; + + /// + /// power supply status flags (see MAV_POWER_STATUS enum) + /// + public UInt16 flags; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_POWER_STATUS(this, bytes, ref offset); + } + } + + + /// + /// Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate. + /// + public class Msg_serial_control : MavlinkMessage + { + + /// + /// See SERIAL_CONTROL_DEV enum + /// + public byte device; + + /// + /// See SERIAL_CONTROL_FLAG enum + /// + public byte flags; + + /// + /// Timeout for reply data in milliseconds + /// + public UInt16 timeout; + + /// + /// Baudrate of transfer. Zero means no change. + /// + public UInt32 baudrate; + + /// + /// how many bytes in this transfer + /// + public byte count; + + /// + /// serial data + /// + public byte[] data; // Array size 70 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SERIAL_CONTROL(this, bytes, ref offset); + } + } + + + /// + /// RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + /// + public class Msg_gps_rtk : MavlinkMessage + { + + /// + /// Time since boot of last baseline message received in ms. + /// + public UInt32 time_last_baseline_ms; + + /// + /// Identification of connected RTK receiver. + /// + public byte rtk_receiver_id; + + /// + /// GPS Week Number of last baseline + /// + public UInt16 wn; + + /// + /// GPS Time of Week of last baseline + /// + public UInt32 tow; + + /// + /// GPS-specific health report for RTK data. + /// + public byte rtk_health; + + /// + /// Rate of baseline messages being received by GPS, in HZ + /// + public byte rtk_rate; + + /// + /// Current number of sats used for RTK calculation. + /// + public byte nsats; + + /// + /// Coordinate system of baseline. 0 == ECEF, 1 == NED + /// + public byte baseline_coords_type; + + /// + /// Current baseline in ECEF x or NED north component in mm. + /// + public Int32 baseline_a_mm; + + /// + /// Current baseline in ECEF y or NED east component in mm. + /// + public Int32 baseline_b_mm; + + /// + /// Current baseline in ECEF z or NED down component in mm. + /// + public Int32 baseline_c_mm; + + /// + /// Current estimate of baseline accuracy. + /// + public UInt32 accuracy; + + /// + /// Current number of integer ambiguity hypotheses. + /// + public Int32 iar_num_hypotheses; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS_RTK(this, bytes, ref offset); + } + } + + + /// + /// RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting + /// + public class Msg_gps2_rtk : MavlinkMessage + { + + /// + /// Time since boot of last baseline message received in ms. + /// + public UInt32 time_last_baseline_ms; + + /// + /// Identification of connected RTK receiver. + /// + public byte rtk_receiver_id; + + /// + /// GPS Week Number of last baseline + /// + public UInt16 wn; + + /// + /// GPS Time of Week of last baseline + /// + public UInt32 tow; + + /// + /// GPS-specific health report for RTK data. + /// + public byte rtk_health; + + /// + /// Rate of baseline messages being received by GPS, in HZ + /// + public byte rtk_rate; + + /// + /// Current number of sats used for RTK calculation. + /// + public byte nsats; + + /// + /// Coordinate system of baseline. 0 == ECEF, 1 == NED + /// + public byte baseline_coords_type; + + /// + /// Current baseline in ECEF x or NED north component in mm. + /// + public Int32 baseline_a_mm; + + /// + /// Current baseline in ECEF y or NED east component in mm. + /// + public Int32 baseline_b_mm; + + /// + /// Current baseline in ECEF z or NED down component in mm. + /// + public Int32 baseline_c_mm; + + /// + /// Current estimate of baseline accuracy. + /// + public UInt32 accuracy; + + /// + /// Current number of integer ambiguity hypotheses. + /// + public Int32 iar_num_hypotheses; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_GPS2_RTK(this, bytes, ref offset); + } + } + + + /// + /// The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units + /// + public class Msg_scaled_imu3 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// X acceleration (mg) + /// + public Int16 xacc; + + /// + /// Y acceleration (mg) + /// + public Int16 yacc; + + /// + /// Z acceleration (mg) + /// + public Int16 zacc; + + /// + /// Angular speed around X axis (millirad /sec) + /// + public Int16 xgyro; + + /// + /// Angular speed around Y axis (millirad /sec) + /// + public Int16 ygyro; + + /// + /// Angular speed around Z axis (millirad /sec) + /// + public Int16 zgyro; + + /// + /// X Magnetic field (milli tesla) + /// + public Int16 xmag; + + /// + /// Y Magnetic field (milli tesla) + /// + public Int16 ymag; + + /// + /// Z Magnetic field (milli tesla) + /// + public Int16 zmag; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_IMU3(this, bytes, ref offset); + } + } + + public class Msg_data_transmission_handshake : MavlinkMessage + { + + /// + /// type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h) + /// + public byte type; + + /// + /// total data size in bytes (set on ACK only) + /// + public UInt32 size; + + /// + /// Width of a matrix or image + /// + public UInt16 width; + + /// + /// Height of a matrix or image + /// + public UInt16 height; + + /// + /// number of packets beeing sent (set on ACK only) + /// + public UInt16 packets; + + /// + /// payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only) + /// + public byte payload; + + /// + /// JPEG quality out of [1,100] + /// + public byte jpg_quality; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DATA_TRANSMISSION_HANDSHAKE(this, bytes, ref offset); + } + } + + public class Msg_encapsulated_data : MavlinkMessage + { + + /// + /// sequence number (starting with 0 on every transmission) + /// + public UInt16 seqnr; + + /// + /// image data bytes + /// + public byte[] data; // Array size 253 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ENCAPSULATED_DATA(this, bytes, ref offset); + } + } + + public class Msg_distance_sensor : MavlinkMessage + { + + /// + /// Time since system boot + /// + public UInt32 time_boot_ms; + + /// + /// Minimum distance the sensor can measure in centimeters + /// + public UInt16 min_distance; + + /// + /// Maximum distance the sensor can measure in centimeters + /// + public UInt16 max_distance; + + /// + /// Current distance reading + /// + public UInt16 current_distance; + + /// + /// Type from MAV_DISTANCE_SENSOR enum. + /// + public byte type; + + /// + /// Onboard ID of the sensor + /// + public byte id; + + /// + /// Direction the sensor faces from MAV_SENSOR_ORIENTATION enum. + /// + public byte orientation; + + /// + /// Measurement covariance in centimeters, 0 for unknown / invalid readings + /// + public byte covariance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DISTANCE_SENSOR(this, bytes, ref offset); + } + } + + + /// + /// Request for terrain data and terrain status + /// + public class Msg_terrain_request : MavlinkMessage + { + + /// + /// Latitude of SW corner of first grid (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude of SW corner of first grid (in degrees *10^7) + /// + public Int32 lon; + + /// + /// Grid spacing in meters + /// + public UInt16 grid_spacing; + + /// + /// Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits) + /// + public UInt64 mask; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_REQUEST(this, bytes, ref offset); + } + } + + + /// + /// Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST + /// + public class Msg_terrain_data : MavlinkMessage + { + + /// + /// Latitude of SW corner of first grid (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude of SW corner of first grid (in degrees *10^7) + /// + public Int32 lon; + + /// + /// Grid spacing in meters + /// + public UInt16 grid_spacing; + + /// + /// bit within the terrain request mask + /// + public byte gridbit; + + /// + /// Terrain data in meters AMSL + /// + public Int16[] data; // Array size 16 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_DATA(this, bytes, ref offset); + } + } + + + /// + /// Request that the vehicle report terrain height at the given location. Used by GCS to check if vehicle has all terrain data needed for a mission. + /// + public class Msg_terrain_check : MavlinkMessage + { + + /// + /// Latitude (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude (degrees *10^7) + /// + public Int32 lon; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_CHECK(this, bytes, ref offset); + } + } + + + /// + /// Response from a TERRAIN_CHECK request + /// + public class Msg_terrain_report : MavlinkMessage + { + + /// + /// Latitude (degrees *10^7) + /// + public Int32 lat; + + /// + /// Longitude (degrees *10^7) + /// + public Int32 lon; + + /// + /// grid spacing (zero if terrain at this location unavailable) + /// + public UInt16 spacing; + + /// + /// Terrain height in meters AMSL + /// + public float terrain_height; + + /// + /// Current vehicle height above lat/lon terrain height (meters) + /// + public float current_height; + + /// + /// Number of 4x4 terrain blocks waiting to be received or read from disk + /// + public UInt16 pending; + + /// + /// Number of 4x4 terrain blocks in memory + /// + public UInt16 loaded; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_TERRAIN_REPORT(this, bytes, ref offset); + } + } + + + /// + /// Barometer readings for 2nd barometer + /// + public class Msg_scaled_pressure2 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Absolute pressure (hectopascal) + /// + public float press_abs; + + /// + /// Differential pressure 1 (hectopascal) + /// + public float press_diff; + + /// + /// Temperature measurement (0.01 degrees celsius) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_PRESSURE2(this, bytes, ref offset); + } + } + + + /// + /// Motion capture attitude and position + /// + public class Msg_att_pos_mocap : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + /// + public float[] q; // Array size 4 + + /// + /// X position in meters (NED) + /// + public float x; + + /// + /// Y position in meters (NED) + /// + public float y; + + /// + /// Z position in meters (NED) + /// + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ATT_POS_MOCAP(this, bytes, ref offset); + } + } + + + /// + /// Set the vehicle attitude and body angular rates. + /// + public class Msg_set_actuator_control_target : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + /// + public byte group_mlx; + + /// + /// System ID + /// + public byte target_system; + + /// + /// Component ID + /// + public byte target_component; + + /// + /// Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + /// + public float[] controls; // Array size 8 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_ACTUATOR_CONTROL_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Set the vehicle attitude and body angular rates. + /// + public class Msg_actuator_control_target : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + /// + public byte group_mlx; + + /// + /// Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. + /// + public float[] controls; // Array size 8 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ACTUATOR_CONTROL_TARGET(this, bytes, ref offset); + } + } + + + /// + /// The current system altitude. + /// + public class Msg_altitude : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt64 time_usec; + + /// + /// This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights. + /// + public float altitude_monotonic; + + /// + /// This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude. + /// + public float altitude_amsl; + + /// + /// This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive. + /// + public float altitude_local; + + /// + /// This is the altitude above the home position. It resets on each change of the current home position. + /// + public float altitude_relative; + + /// + /// This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown. + /// + public float altitude_terrain; + + /// + /// This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available. + /// + public float bottom_clearance; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ALTITUDE(this, bytes, ref offset); + } + } + + + /// + /// The autopilot is requesting a resource (file, binary, other type of data) + /// + public class Msg_resource_request : MavlinkMessage + { + + /// + /// Request ID. This ID should be re-used when sending back URI contents + /// + public byte request_id; + + /// + /// The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary + /// + public byte uri_type; + + /// + /// The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum) + /// + public byte[] uri; // Array size 120 + + /// + /// The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream. + /// + public byte transfer_type; + + /// + /// The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP). + /// + public byte[] storage; // Array size 120 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_RESOURCE_REQUEST(this, bytes, ref offset); + } + } + + + /// + /// Barometer readings for 3rd barometer + /// + public class Msg_scaled_pressure3 : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Absolute pressure (hectopascal) + /// + public float press_abs; + + /// + /// Differential pressure 1 (hectopascal) + /// + public float press_diff; + + /// + /// Temperature measurement (0.01 degrees celsius) + /// + public Int16 temperature; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SCALED_PRESSURE3(this, bytes, ref offset); + } + } + + + /// + /// current motion information from a designated system + /// + public class Msg_follow_target : MavlinkMessage + { + + /// + /// Timestamp in milliseconds since system boot + /// + public UInt64 timestamp; + + /// + /// bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3) + /// + public byte est_capabilities; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude (WGS84), in degrees * 1E7 + /// + public Int32 lon; + + /// + /// AMSL, in meters + /// + public float alt; + + /// + /// target velocity (0,0,0) for unknown + /// + public float[] vel; // Array size 3 + + /// + /// linear target acceleration (0,0,0) for unknown + /// + public float[] acc; // Array size 3 + + /// + /// (1 0 0 0 for unknown) + /// + public float[] attitude_q; // Array size 4 + + /// + /// (0 0 0 for unknown) + /// + public float[] rates; // Array size 3 + + /// + /// eph epv + /// + public float[] position_cov; // Array size 3 + + /// + /// button states or switches of a tracker device + /// + public UInt64 custom_state; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_FOLLOW_TARGET(this, bytes, ref offset); + } + } + + + /// + /// The smoothed, monotonic system state used to feed the control loops of the system. + /// + public class Msg_control_system_state : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// X acceleration in body frame + /// + public float x_acc; + + /// + /// Y acceleration in body frame + /// + public float y_acc; + + /// + /// Z acceleration in body frame + /// + public float z_acc; + + /// + /// X velocity in body frame + /// + public float x_vel; + + /// + /// Y velocity in body frame + /// + public float y_vel; + + /// + /// Z velocity in body frame + /// + public float z_vel; + + /// + /// X position in local frame + /// + public float x_pos; + + /// + /// Y position in local frame + /// + public float y_pos; + + /// + /// Z position in local frame + /// + public float z_pos; + + /// + /// Airspeed, set to -1 if unknown + /// + public float airspeed; + + /// + /// Variance of body velocity estimate + /// + public float[] vel_variance; // Array size 3 + + /// + /// Variance in local position + /// + public float[] pos_variance; // Array size 3 + + /// + /// The attitude, represented as Quaternion + /// + public float[] q; // Array size 4 + + /// + /// Angular rate in roll axis + /// + public float roll_rate; + + /// + /// Angular rate in pitch axis + /// + public float pitch_rate; + + /// + /// Angular rate in yaw axis + /// + public float yaw_rate; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_CONTROL_SYSTEM_STATE(this, bytes, ref offset); + } + } + + + /// + /// Battery information + /// + public class Msg_battery_status : MavlinkMessage + { + + /// + /// Battery ID + /// + public byte id; + + /// + /// Function of the battery + /// + public byte battery_function; + + /// + /// Type (chemistry) of the battery + /// + public byte type; + + /// + /// Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature. + /// + public Int16 temperature; + + /// + /// Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value. + /// + public UInt16[] voltages; // Array size 10 + + /// + /// Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + /// + public Int16 current_battery; + + /// + /// Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate + /// + public Int32 current_consumed; + + /// + /// Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate + /// + public Int32 energy_consumed; + + /// + /// Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery + /// + public sbyte battery_remaining; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_BATTERY_STATUS(this, bytes, ref offset); + } + } + + + /// + /// Version and capability of autopilot software + /// + public class Msg_autopilot_version : MavlinkMessage + { + + /// + /// bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum) + /// + public UInt64 capabilities; + + /// + /// Firmware version number + /// + public UInt32 flight_sw_version; + + /// + /// Middleware version number + /// + public UInt32 middleware_sw_version; + + /// + /// Operating system version number + /// + public UInt32 os_sw_version; + + /// + /// HW / board version (last 8 bytes should be silicon ID, if any) + /// + public UInt32 board_version; + + /// + /// Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + /// + public byte[] flight_custom_version; // Array size 8 + + /// + /// Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + /// + public byte[] middleware_custom_version; // Array size 8 + + /// + /// Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases. + /// + public byte[] os_custom_version; // Array size 8 + + /// + /// ID of the board vendor + /// + public UInt16 vendor_id; + + /// + /// ID of the product + /// + public UInt16 product_id; + + /// + /// UID if provided by hardware + /// + public UInt64 uid; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_AUTOPILOT_VERSION(this, bytes, ref offset); + } + } + + + /// + /// The location of a landing area captured from a downward facing camera + /// + public class Msg_landing_target : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// The ID of the target if multiple targets are present + /// + public byte target_num; + + /// + /// MAV_FRAME enum specifying the whether the following feilds are earth-frame, body-frame, etc. + /// + public byte frame; + + /// + /// X-axis angular offset (in radians) of the target from the center of the image + /// + public float angle_x; + + /// + /// Y-axis angular offset (in radians) of the target from the center of the image + /// + public float angle_y; + + /// + /// Distance to the target from the vehicle in meters + /// + public float distance; + + /// + /// Size in radians of target along x-axis + /// + public float size_x; + + /// + /// Size in radians of target along y-axis + /// + public float size_y; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_LANDING_TARGET(this, bytes, ref offset); + } + } + + + /// + /// Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovaton test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovaton test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user. + /// + public class Msg_estimator_status : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS. + /// + public UInt16 flags; + + /// + /// Velocity innovation test ratio + /// + public float vel_ratio; + + /// + /// Horizontal position innovation test ratio + /// + public float pos_horiz_ratio; + + /// + /// Vertical position innovation test ratio + /// + public float pos_vert_ratio; + + /// + /// Magnetometer innovation test ratio + /// + public float mag_ratio; + + /// + /// Height above terrain innovation test ratio + /// + public float hagl_ratio; + + /// + /// True airspeed innovation test ratio + /// + public float tas_ratio; + + /// + /// Horizontal position 1-STD accuracy relative to the EKF local origin (m) + /// + public float pos_horiz_accuracy; + + /// + /// Vertical position 1-STD accuracy relative to the EKF local origin (m) + /// + public float pos_vert_accuracy; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ESTIMATOR_STATUS(this, bytes, ref offset); + } + } + + public class Msg_wind_cov : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Wind in X (NED) direction in m/s + /// + public float wind_x; + + /// + /// Wind in Y (NED) direction in m/s + /// + public float wind_y; + + /// + /// Wind in Z (NED) direction in m/s + /// + public float wind_z; + + /// + /// Variability of the wind in XY. RMS of a 1 Hz lowpassed wind estimate. + /// + public float var_horiz; + + /// + /// Variability of the wind in Z. RMS of a 1 Hz lowpassed wind estimate. + /// + public float var_vert; + + /// + /// AMSL altitude (m) this measurement was taken at + /// + public float wind_alt; + + /// + /// Horizontal speed 1-STD accuracy + /// + public float horiz_accuracy; + + /// + /// Vertical speed 1-STD accuracy + /// + public float vert_accuracy; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_WIND_COV(this, bytes, ref offset); + } + } + + + /// + /// Vibration levels and accelerometer clipping + /// + public class Msg_vibration : MavlinkMessage + { + + /// + /// Timestamp (micros since boot or Unix epoch) + /// + public UInt64 time_usec; + + /// + /// Vibration levels on X-axis + /// + public float vibration_x; + + /// + /// Vibration levels on Y-axis + /// + public float vibration_y; + + /// + /// Vibration levels on Z-axis + /// + public float vibration_z; + + /// + /// first accelerometer clipping count + /// + public UInt32 clipping_0; + + /// + /// second accelerometer clipping count + /// + public UInt32 clipping_1; + + /// + /// third accelerometer clipping count + /// + public UInt32 clipping_2; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_VIBRATION(this, bytes, ref offset); + } + } + + + /// + /// This message can be requested by sending the MAV_CMD_GET_HOME_POSITION command. The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The position the system will return to and land on. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + /// + public class Msg_home_position : MavlinkMessage + { + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84, in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + /// + /// Local X position of this position in the local coordinate frame + /// + public float x; + + /// + /// Local Y position of this position in the local coordinate frame + /// + public float y; + + /// + /// Local Z position of this position in the local coordinate frame + /// + public float z; + + /// + /// World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + /// + public float[] q; // Array size 4 + + /// + /// Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_x; + + /// + /// Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_y; + + /// + /// Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_HOME_POSITION(this, bytes, ref offset); + } + } + + + /// + /// The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. + /// + public class Msg_set_home_position : MavlinkMessage + { + + /// + /// System ID. + /// + public byte target_system; + + /// + /// Latitude (WGS84), in degrees * 1E7 + /// + public Int32 latitude; + + /// + /// Longitude (WGS84, in degrees * 1E7 + /// + public Int32 longitude; + + /// + /// Altitude (AMSL), in meters * 1000 (positive for up) + /// + public Int32 altitude; + + /// + /// Local X position of this position in the local coordinate frame + /// + public float x; + + /// + /// Local Y position of this position in the local coordinate frame + /// + public float y; + + /// + /// Local Z position of this position in the local coordinate frame + /// + public float z; + + /// + /// World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground + /// + public float[] q; // Array size 4 + + /// + /// Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_x; + + /// + /// Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_y; + + /// + /// Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone. + /// + public float approach_z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_SET_HOME_POSITION(this, bytes, ref offset); + } + } + + + /// + /// This interface replaces DATA_STREAM + /// + public class Msg_message_interval : MavlinkMessage + { + + /// + /// The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + /// + public UInt16 message_id; + + /// + /// The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + /// + public Int32 interval_us; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MESSAGE_INTERVAL(this, bytes, ref offset); + } + } + + + /// + /// Provides state for additional features + /// + public class Msg_extended_sys_state : MavlinkMessage + { + + /// + /// The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration. + /// + public byte vtol_state; + + /// + /// The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown. + /// + public byte landed_state; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_EXTENDED_SYS_STATE(this, bytes, ref offset); + } + } + + + /// + /// The location and information of an ADSB vehicle + /// + public class Msg_adsb_vehicle : MavlinkMessage + { + + /// + /// ICAO address + /// + public UInt32 ICAO_address; + + /// + /// Latitude, expressed as degrees * 1E7 + /// + public Int32 lat; + + /// + /// Longitude, expressed as degrees * 1E7 + /// + public Int32 lon; + + /// + /// Type from ADSB_ALTITUDE_TYPE enum + /// + public byte altitude_type; + + /// + /// Altitude(ASL) in millimeters + /// + public Int32 altitude; + + /// + /// Course over ground in centidegrees + /// + public UInt16 heading; + + /// + /// The horizontal velocity in centimeters/second + /// + public UInt16 hor_velocity; + + /// + /// The vertical velocity in centimeters/second, positive is up + /// + public Int16 ver_velocity; + + /// + /// The callsign, 8+null + /// + public byte[] callsign; // Array size 9 + + /// + /// Type from ADSB_EMITTER_TYPE enum + /// + public byte emitter_type; + + /// + /// Time since last communication in seconds + /// + public byte tslc; + + /// + /// Flags to indicate various statuses including valid data fields + /// + public UInt16 flags; + + /// + /// Squawk code + /// + public UInt16 squawk; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_ADSB_VEHICLE(this, bytes, ref offset); + } + } + + + /// + /// Message implementing parts of the V2 payload specs in V1 frames for transitional support. + /// + public class Msg_v2_extension : MavlinkMessage + { + + /// + /// Network ID (0 for broadcast) + /// + public byte target_network; + + /// + /// System ID (0 for broadcast) + /// + public byte target_system; + + /// + /// Component ID (0 for broadcast) + /// + public byte target_component; + + /// + /// A code that identifies the software component that understands this message (analogous to usb device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/extension-message-ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase. + /// + public UInt16 message_type; + + /// + /// Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification. + /// + public byte[] payload; // Array size 249 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_V2_EXTENSION(this, bytes, ref offset); + } + } + + + /// + /// Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + /// + public class Msg_memory_vect : MavlinkMessage + { + + /// + /// Starting address of the debug variables + /// + public UInt16 address; + + /// + /// Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below + /// + public byte ver; + + /// + /// Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14 + /// + public byte type; + + /// + /// Memory contents at specified address + /// + public sbyte[] value; // Array size 32 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_MEMORY_VECT(this, bytes, ref offset); + } + } + + public class Msg_debug_vect : MavlinkMessage + { + public byte[] name; // Array size 10 + + /// + /// Timestamp + /// + public UInt64 time_usec; + public float x; + public float y; + public float z; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DEBUG_VECT(this, bytes, ref offset); + } + } + + + /// + /// Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + /// + public class Msg_named_value_float : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Name of the debug variable + /// + public byte[] name; // Array size 10 + + /// + /// Floating point value + /// + public float value; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_NAMED_VALUE_FLOAT(this, bytes, ref offset); + } + } + + + /// + /// Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. + /// + public class Msg_named_value_int : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// Name of the debug variable + /// + public byte[] name; // Array size 10 + + /// + /// Signed integer value + /// + public Int32 value; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_NAMED_VALUE_INT(this, bytes, ref offset); + } + } + + + /// + /// Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). + /// + public class Msg_statustext : MavlinkMessage + { + + /// + /// Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. + /// + public byte severity; + + /// + /// Status text message, without null termination character + /// + public byte[] text; // Array size 50 + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_STATUSTEXT(this, bytes, ref offset); + } + } + + + /// + /// Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N. + /// + public class Msg_debug : MavlinkMessage + { + + /// + /// Timestamp (milliseconds since system boot) + /// + public UInt32 time_boot_ms; + + /// + /// index of debug variable + /// + public byte ind; + + /// + /// DEBUG value + /// + public float value; + + public override int Serialize(byte[] bytes, ref int offset) + { + return MavLinkSerializer.Serialize_DEBUG(this, bytes, ref offset); + } + } + +} + diff --git a/oroca_bldc_gui/Serial/mavlink/oroca_codec.generated.cs b/oroca_bldc_gui/Serial/mavlink/oroca_codec.generated.cs new file mode 100644 index 0000000..ce2e705 --- /dev/null +++ b/oroca_bldc_gui/Serial/mavlink/oroca_codec.generated.cs @@ -0,0 +1,3812 @@ + + +/* +MAVLink protocol implementation (auto-generated by mavgen.py) + +Note: this file has been auto-generated. DO NOT EDIT +*/ + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace MavLink +{ + public static class MavlinkSettings + { + public const string WireProtocolVersion = "1.0"; + public const byte ProtocolMarker = 0xfe; + public const bool CrcExtra = true; + public const bool IsLittleEndian = true; + } + + public delegate MavlinkMessage MavlinkPacketDeserializeFunc(byte[] bytes, int offset); + + //returns the message ID, offset is advanced by the number of bytes used to serialize + public delegate int MavlinkPacketSerializeFunc(byte[] bytes, ref int offset, object mavlinkPacket); + + public class MavPacketInfo + { + public MavlinkPacketDeserializeFunc Deserializer; + public int [] OrderMap; + public byte CrcExtra; + + public MavPacketInfo(MavlinkPacketDeserializeFunc deserializer, byte crcExtra) + { + this.Deserializer = deserializer; + this.CrcExtra = crcExtra; + } + } + + public static class MavLinkSerializer + { + public static void SetDataIsLittleEndian(bool isLittle) + { + bitconverter.SetDataIsLittleEndian(isLittle); + } + + private static readonly FrameworkBitConverter bitconverter = new FrameworkBitConverter(); + + public static Dictionary Lookup = new Dictionary + { + {220, new MavPacketInfo(Deserialize_SET_VELOCITY, 100)}, + {0, new MavPacketInfo(Deserialize_HEARTBEAT, 50)}, + {1, new MavPacketInfo(Deserialize_SYS_STATUS, 124)}, + {2, new MavPacketInfo(Deserialize_SYSTEM_TIME, 137)}, + {4, new MavPacketInfo(Deserialize_PING, 237)}, + {5, new MavPacketInfo(Deserialize_CHANGE_OPERATOR_CONTROL, 217)}, + {6, new MavPacketInfo(Deserialize_CHANGE_OPERATOR_CONTROL_ACK, 104)}, + {7, new MavPacketInfo(Deserialize_AUTH_KEY, 119)}, + {11, new MavPacketInfo(Deserialize_SET_MODE, 89)}, + {20, new MavPacketInfo(Deserialize_PARAM_REQUEST_READ, 214)}, + {21, new MavPacketInfo(Deserialize_PARAM_REQUEST_LIST, 159)}, + {22, new MavPacketInfo(Deserialize_PARAM_VALUE, 220)}, + {23, new MavPacketInfo(Deserialize_PARAM_SET, 168)}, + {24, new MavPacketInfo(Deserialize_GPS_RAW_INT, 24)}, + {25, new MavPacketInfo(Deserialize_GPS_STATUS, 23)}, + {26, new MavPacketInfo(Deserialize_SCALED_IMU, 170)}, + {27, new MavPacketInfo(Deserialize_RAW_IMU, 144)}, + {28, new MavPacketInfo(Deserialize_RAW_PRESSURE, 67)}, + {29, new MavPacketInfo(Deserialize_SCALED_PRESSURE, 115)}, + {30, new MavPacketInfo(Deserialize_ATTITUDE, 39)}, + {31, new MavPacketInfo(Deserialize_ATTITUDE_QUATERNION, 246)}, + {32, new MavPacketInfo(Deserialize_LOCAL_POSITION_NED, 185)}, + {33, new MavPacketInfo(Deserialize_GLOBAL_POSITION_INT, 104)}, + {34, new MavPacketInfo(Deserialize_RC_CHANNELS_SCALED, 237)}, + {35, new MavPacketInfo(Deserialize_RC_CHANNELS_RAW, 244)}, + {36, new MavPacketInfo(Deserialize_SERVO_OUTPUT_RAW, 222)}, + {37, new MavPacketInfo(Deserialize_MISSION_REQUEST_PARTIAL_LIST, 212)}, + {38, new MavPacketInfo(Deserialize_MISSION_WRITE_PARTIAL_LIST, 9)}, + {39, new MavPacketInfo(Deserialize_MISSION_ITEM, 254)}, + {40, new MavPacketInfo(Deserialize_MISSION_REQUEST, 230)}, + {41, new MavPacketInfo(Deserialize_MISSION_SET_CURRENT, 28)}, + {42, new MavPacketInfo(Deserialize_MISSION_CURRENT, 28)}, + {43, new MavPacketInfo(Deserialize_MISSION_REQUEST_LIST, 132)}, + {44, new MavPacketInfo(Deserialize_MISSION_COUNT, 221)}, + {45, new MavPacketInfo(Deserialize_MISSION_CLEAR_ALL, 232)}, + {46, new MavPacketInfo(Deserialize_MISSION_ITEM_REACHED, 11)}, + {47, new MavPacketInfo(Deserialize_MISSION_ACK, 153)}, + {48, new MavPacketInfo(Deserialize_SET_GPS_GLOBAL_ORIGIN, 41)}, + {49, new MavPacketInfo(Deserialize_GPS_GLOBAL_ORIGIN, 39)}, + {50, new MavPacketInfo(Deserialize_PARAM_MAP_RC, 78)}, + {51, new MavPacketInfo(Deserialize_MISSION_REQUEST_INT, 196)}, + {54, new MavPacketInfo(Deserialize_SAFETY_SET_ALLOWED_AREA, 15)}, + {55, new MavPacketInfo(Deserialize_SAFETY_ALLOWED_AREA, 3)}, + {61, new MavPacketInfo(Deserialize_ATTITUDE_QUATERNION_COV, 153)}, + {62, new MavPacketInfo(Deserialize_NAV_CONTROLLER_OUTPUT, 183)}, + {63, new MavPacketInfo(Deserialize_GLOBAL_POSITION_INT_COV, 51)}, + {64, new MavPacketInfo(Deserialize_LOCAL_POSITION_NED_COV, 59)}, + {65, new MavPacketInfo(Deserialize_RC_CHANNELS, 118)}, + {66, new MavPacketInfo(Deserialize_REQUEST_DATA_STREAM, 148)}, + {67, new MavPacketInfo(Deserialize_DATA_STREAM, 21)}, + {69, new MavPacketInfo(Deserialize_MANUAL_CONTROL, 243)}, + {70, new MavPacketInfo(Deserialize_RC_CHANNELS_OVERRIDE, 124)}, + {73, new MavPacketInfo(Deserialize_MISSION_ITEM_INT, 38)}, + {74, new MavPacketInfo(Deserialize_VFR_HUD, 20)}, + {75, new MavPacketInfo(Deserialize_COMMAND_INT, 158)}, + {76, new MavPacketInfo(Deserialize_COMMAND_LONG, 152)}, + {77, new MavPacketInfo(Deserialize_COMMAND_ACK, 143)}, + {81, new MavPacketInfo(Deserialize_MANUAL_SETPOINT, 106)}, + {82, new MavPacketInfo(Deserialize_SET_ATTITUDE_TARGET, 49)}, + {83, new MavPacketInfo(Deserialize_ATTITUDE_TARGET, 22)}, + {84, new MavPacketInfo(Deserialize_SET_POSITION_TARGET_LOCAL_NED, 143)}, + {85, new MavPacketInfo(Deserialize_POSITION_TARGET_LOCAL_NED, 140)}, + {86, new MavPacketInfo(Deserialize_SET_POSITION_TARGET_GLOBAL_INT, 5)}, + {87, new MavPacketInfo(Deserialize_POSITION_TARGET_GLOBAL_INT, 150)}, + {89, new MavPacketInfo(Deserialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, 231)}, + {90, new MavPacketInfo(Deserialize_HIL_STATE, 183)}, + {91, new MavPacketInfo(Deserialize_HIL_CONTROLS, 63)}, + {92, new MavPacketInfo(Deserialize_HIL_RC_INPUTS_RAW, 54)}, + {100, new MavPacketInfo(Deserialize_OPTICAL_FLOW, 175)}, + {101, new MavPacketInfo(Deserialize_GLOBAL_VISION_POSITION_ESTIMATE, 102)}, + {102, new MavPacketInfo(Deserialize_VISION_POSITION_ESTIMATE, 158)}, + {103, new MavPacketInfo(Deserialize_VISION_SPEED_ESTIMATE, 208)}, + {104, new MavPacketInfo(Deserialize_VICON_POSITION_ESTIMATE, 56)}, + {105, new MavPacketInfo(Deserialize_HIGHRES_IMU, 93)}, + {106, new MavPacketInfo(Deserialize_OPTICAL_FLOW_RAD, 138)}, + {107, new MavPacketInfo(Deserialize_HIL_SENSOR, 108)}, + {108, new MavPacketInfo(Deserialize_SIM_STATE, 32)}, + {109, new MavPacketInfo(Deserialize_RADIO_STATUS, 185)}, + {110, new MavPacketInfo(Deserialize_FILE_TRANSFER_PROTOCOL, 84)}, + {111, new MavPacketInfo(Deserialize_TIMESYNC, 34)}, + {112, new MavPacketInfo(Deserialize_CAMERA_TRIGGER, 174)}, + {113, new MavPacketInfo(Deserialize_HIL_GPS, 124)}, + {114, new MavPacketInfo(Deserialize_HIL_OPTICAL_FLOW, 237)}, + {115, new MavPacketInfo(Deserialize_HIL_STATE_QUATERNION, 4)}, + {116, new MavPacketInfo(Deserialize_SCALED_IMU2, 76)}, + {117, new MavPacketInfo(Deserialize_LOG_REQUEST_LIST, 128)}, + {118, new MavPacketInfo(Deserialize_LOG_ENTRY, 56)}, + {119, new MavPacketInfo(Deserialize_LOG_REQUEST_DATA, 116)}, + {120, new MavPacketInfo(Deserialize_LOG_DATA, 134)}, + {121, new MavPacketInfo(Deserialize_LOG_ERASE, 237)}, + {122, new MavPacketInfo(Deserialize_LOG_REQUEST_END, 203)}, + {123, new MavPacketInfo(Deserialize_GPS_INJECT_DATA, 250)}, + {124, new MavPacketInfo(Deserialize_GPS2_RAW, 87)}, + {125, new MavPacketInfo(Deserialize_POWER_STATUS, 203)}, + {126, new MavPacketInfo(Deserialize_SERIAL_CONTROL, 220)}, + {127, new MavPacketInfo(Deserialize_GPS_RTK, 25)}, + {128, new MavPacketInfo(Deserialize_GPS2_RTK, 226)}, + {129, new MavPacketInfo(Deserialize_SCALED_IMU3, 46)}, + {130, new MavPacketInfo(Deserialize_DATA_TRANSMISSION_HANDSHAKE, 29)}, + {131, new MavPacketInfo(Deserialize_ENCAPSULATED_DATA, 223)}, + {132, new MavPacketInfo(Deserialize_DISTANCE_SENSOR, 85)}, + {133, new MavPacketInfo(Deserialize_TERRAIN_REQUEST, 6)}, + {134, new MavPacketInfo(Deserialize_TERRAIN_DATA, 229)}, + {135, new MavPacketInfo(Deserialize_TERRAIN_CHECK, 203)}, + {136, new MavPacketInfo(Deserialize_TERRAIN_REPORT, 1)}, + {137, new MavPacketInfo(Deserialize_SCALED_PRESSURE2, 195)}, + {138, new MavPacketInfo(Deserialize_ATT_POS_MOCAP, 109)}, + {139, new MavPacketInfo(Deserialize_SET_ACTUATOR_CONTROL_TARGET, 168)}, + {140, new MavPacketInfo(Deserialize_ACTUATOR_CONTROL_TARGET, 181)}, + {141, new MavPacketInfo(Deserialize_ALTITUDE, 47)}, + {142, new MavPacketInfo(Deserialize_RESOURCE_REQUEST, 72)}, + {143, new MavPacketInfo(Deserialize_SCALED_PRESSURE3, 131)}, + {144, new MavPacketInfo(Deserialize_FOLLOW_TARGET, 127)}, + {146, new MavPacketInfo(Deserialize_CONTROL_SYSTEM_STATE, 103)}, + {147, new MavPacketInfo(Deserialize_BATTERY_STATUS, 154)}, + {148, new MavPacketInfo(Deserialize_AUTOPILOT_VERSION, 178)}, + {149, new MavPacketInfo(Deserialize_LANDING_TARGET, 200)}, + {230, new MavPacketInfo(Deserialize_ESTIMATOR_STATUS, 163)}, + {231, new MavPacketInfo(Deserialize_WIND_COV, 105)}, + {241, new MavPacketInfo(Deserialize_VIBRATION, 90)}, + {242, new MavPacketInfo(Deserialize_HOME_POSITION, 104)}, + {243, new MavPacketInfo(Deserialize_SET_HOME_POSITION, 85)}, + {244, new MavPacketInfo(Deserialize_MESSAGE_INTERVAL, 95)}, + {245, new MavPacketInfo(Deserialize_EXTENDED_SYS_STATE, 130)}, + {246, new MavPacketInfo(Deserialize_ADSB_VEHICLE, 184)}, + {248, new MavPacketInfo(Deserialize_V2_EXTENSION, 8)}, + {249, new MavPacketInfo(Deserialize_MEMORY_VECT, 204)}, + {250, new MavPacketInfo(Deserialize_DEBUG_VECT, 49)}, + {251, new MavPacketInfo(Deserialize_NAMED_VALUE_FLOAT, 170)}, + {252, new MavPacketInfo(Deserialize_NAMED_VALUE_INT, 44)}, + {253, new MavPacketInfo(Deserialize_STATUSTEXT, 83)}, + {254, new MavPacketInfo(Deserialize_DEBUG, 46)}, + }; + + internal static MavlinkMessage Deserialize_SET_VELOCITY(byte[] bytes, int offset) + { + return new Msg_set_velocity + { + ref_angular_velocity = bitconverter.ToUInt16(bytes, offset + 0), + }; + } + + internal static MavlinkMessage Deserialize_HEARTBEAT(byte[] bytes, int offset) + { + return new Msg_heartbeat + { + custom_mode = bitconverter.ToUInt32(bytes, offset + 0), + type = bytes[offset + 4], + autopilot = bytes[offset + 5], + base_mode = bytes[offset + 6], + system_status = bytes[offset + 7], + mavlink_version = bytes[offset + 8], + }; + } + + internal static MavlinkMessage Deserialize_SYS_STATUS(byte[] bytes, int offset) + { + return new Msg_sys_status + { + onboard_control_sensors_present = bitconverter.ToUInt32(bytes, offset + 0), + onboard_control_sensors_enabled = bitconverter.ToUInt32(bytes, offset + 4), + onboard_control_sensors_health = bitconverter.ToUInt32(bytes, offset + 8), + load = bitconverter.ToUInt16(bytes, offset + 12), + voltage_battery = bitconverter.ToUInt16(bytes, offset + 14), + current_battery = bitconverter.ToInt16(bytes, offset + 16), + drop_rate_comm = bitconverter.ToUInt16(bytes, offset + 18), + errors_comm = bitconverter.ToUInt16(bytes, offset + 20), + errors_count1 = bitconverter.ToUInt16(bytes, offset + 22), + errors_count2 = bitconverter.ToUInt16(bytes, offset + 24), + errors_count3 = bitconverter.ToUInt16(bytes, offset + 26), + errors_count4 = bitconverter.ToUInt16(bytes, offset + 28), + battery_remaining = bitconverter.ToInt8(bytes, offset + 30), + }; + } + + internal static MavlinkMessage Deserialize_SYSTEM_TIME(byte[] bytes, int offset) + { + return new Msg_system_time + { + time_unix_usec = bitconverter.ToUInt64(bytes, offset + 0), + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_PING(byte[] bytes, int offset) + { + return new Msg_ping + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + seq = bitconverter.ToUInt32(bytes, offset + 8), + target_system = bytes[offset + 12], + target_component = bytes[offset + 13], + }; + } + + internal static MavlinkMessage Deserialize_CHANGE_OPERATOR_CONTROL(byte[] bytes, int offset) + { + return new Msg_change_operator_control + { + target_system = bytes[offset + 0], + control_request = bytes[offset + 1], + version = bytes[offset + 2], + passkey = ByteArrayUtil.ToChar(bytes, offset + 3, 25), + }; + } + + internal static MavlinkMessage Deserialize_CHANGE_OPERATOR_CONTROL_ACK(byte[] bytes, int offset) + { + return new Msg_change_operator_control_ack + { + gcs_system_id = bytes[offset + 0], + control_request = bytes[offset + 1], + ack = bytes[offset + 2], + }; + } + + internal static MavlinkMessage Deserialize_AUTH_KEY(byte[] bytes, int offset) + { + return new Msg_auth_key + { + key = ByteArrayUtil.ToChar(bytes, offset + 0, 32), + }; + } + + internal static MavlinkMessage Deserialize_SET_MODE(byte[] bytes, int offset) + { + return new Msg_set_mode + { + custom_mode = bitconverter.ToUInt32(bytes, offset + 0), + target_system = bytes[offset + 4], + base_mode = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_PARAM_REQUEST_READ(byte[] bytes, int offset) + { + return new Msg_param_request_read + { + param_index = bitconverter.ToInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + param_id = ByteArrayUtil.ToChar(bytes, offset + 4, 16), + }; + } + + internal static MavlinkMessage Deserialize_PARAM_REQUEST_LIST(byte[] bytes, int offset) + { + return new Msg_param_request_list + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_PARAM_VALUE(byte[] bytes, int offset) + { + return new Msg_param_value + { + param_value = bitconverter.ToSingle(bytes, offset + 0), + param_count = bitconverter.ToUInt16(bytes, offset + 4), + param_index = bitconverter.ToUInt16(bytes, offset + 6), + param_id = ByteArrayUtil.ToChar(bytes, offset + 8, 16), + param_type = bytes[offset + 24], + }; + } + + internal static MavlinkMessage Deserialize_PARAM_SET(byte[] bytes, int offset) + { + return new Msg_param_set + { + param_value = bitconverter.ToSingle(bytes, offset + 0), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + param_id = ByteArrayUtil.ToChar(bytes, offset + 6, 16), + param_type = bytes[offset + 22], + }; + } + + internal static MavlinkMessage Deserialize_GPS_RAW_INT(byte[] bytes, int offset) + { + return new Msg_gps_raw_int + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + alt = bitconverter.ToInt32(bytes, offset + 16), + eph = bitconverter.ToUInt16(bytes, offset + 20), + epv = bitconverter.ToUInt16(bytes, offset + 22), + vel = bitconverter.ToUInt16(bytes, offset + 24), + cog = bitconverter.ToUInt16(bytes, offset + 26), + fix_type = bytes[offset + 28], + satellites_visible = bytes[offset + 29], + }; + } + + internal static MavlinkMessage Deserialize_GPS_STATUS(byte[] bytes, int offset) + { + return new Msg_gps_status + { + satellites_visible = bytes[offset + 0], + satellite_prn = ByteArrayUtil.ToUInt8(bytes, offset + 1, 20), + satellite_used = ByteArrayUtil.ToUInt8(bytes, offset + 21, 20), + satellite_elevation = ByteArrayUtil.ToUInt8(bytes, offset + 41, 20), + satellite_azimuth = ByteArrayUtil.ToUInt8(bytes, offset + 61, 20), + satellite_snr = ByteArrayUtil.ToUInt8(bytes, offset + 81, 20), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_IMU(byte[] bytes, int offset) + { + return new Msg_scaled_imu + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 4), + yacc = bitconverter.ToInt16(bytes, offset + 6), + zacc = bitconverter.ToInt16(bytes, offset + 8), + xgyro = bitconverter.ToInt16(bytes, offset + 10), + ygyro = bitconverter.ToInt16(bytes, offset + 12), + zgyro = bitconverter.ToInt16(bytes, offset + 14), + xmag = bitconverter.ToInt16(bytes, offset + 16), + ymag = bitconverter.ToInt16(bytes, offset + 18), + zmag = bitconverter.ToInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_RAW_IMU(byte[] bytes, int offset) + { + return new Msg_raw_imu + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 8), + yacc = bitconverter.ToInt16(bytes, offset + 10), + zacc = bitconverter.ToInt16(bytes, offset + 12), + xgyro = bitconverter.ToInt16(bytes, offset + 14), + ygyro = bitconverter.ToInt16(bytes, offset + 16), + zgyro = bitconverter.ToInt16(bytes, offset + 18), + xmag = bitconverter.ToInt16(bytes, offset + 20), + ymag = bitconverter.ToInt16(bytes, offset + 22), + zmag = bitconverter.ToInt16(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_RAW_PRESSURE(byte[] bytes, int offset) + { + return new Msg_raw_pressure + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + press_abs = bitconverter.ToInt16(bytes, offset + 8), + press_diff1 = bitconverter.ToInt16(bytes, offset + 10), + press_diff2 = bitconverter.ToInt16(bytes, offset + 12), + temperature = bitconverter.ToInt16(bytes, offset + 14), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_PRESSURE(byte[] bytes, int offset) + { + return new Msg_scaled_pressure + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + press_abs = bitconverter.ToSingle(bytes, offset + 4), + press_diff = bitconverter.ToSingle(bytes, offset + 8), + temperature = bitconverter.ToInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE(byte[] bytes, int offset) + { + return new Msg_attitude + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + roll = bitconverter.ToSingle(bytes, offset + 4), + pitch = bitconverter.ToSingle(bytes, offset + 8), + yaw = bitconverter.ToSingle(bytes, offset + 12), + rollspeed = bitconverter.ToSingle(bytes, offset + 16), + pitchspeed = bitconverter.ToSingle(bytes, offset + 20), + yawspeed = bitconverter.ToSingle(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE_QUATERNION(byte[] bytes, int offset) + { + return new Msg_attitude_quaternion + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q1 = bitconverter.ToSingle(bytes, offset + 4), + q2 = bitconverter.ToSingle(bytes, offset + 8), + q3 = bitconverter.ToSingle(bytes, offset + 12), + q4 = bitconverter.ToSingle(bytes, offset + 16), + rollspeed = bitconverter.ToSingle(bytes, offset + 20), + pitchspeed = bitconverter.ToSingle(bytes, offset + 24), + yawspeed = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_LOCAL_POSITION_NED(byte[] bytes, int offset) + { + return new Msg_local_position_ned + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_GLOBAL_POSITION_INT(byte[] bytes, int offset) + { + return new Msg_global_position_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 4), + lon = bitconverter.ToInt32(bytes, offset + 8), + alt = bitconverter.ToInt32(bytes, offset + 12), + relative_alt = bitconverter.ToInt32(bytes, offset + 16), + vx = bitconverter.ToInt16(bytes, offset + 20), + vy = bitconverter.ToInt16(bytes, offset + 22), + vz = bitconverter.ToInt16(bytes, offset + 24), + hdg = bitconverter.ToUInt16(bytes, offset + 26), + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS_SCALED(byte[] bytes, int offset) + { + return new Msg_rc_channels_scaled + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + chan1_scaled = bitconverter.ToInt16(bytes, offset + 4), + chan2_scaled = bitconverter.ToInt16(bytes, offset + 6), + chan3_scaled = bitconverter.ToInt16(bytes, offset + 8), + chan4_scaled = bitconverter.ToInt16(bytes, offset + 10), + chan5_scaled = bitconverter.ToInt16(bytes, offset + 12), + chan6_scaled = bitconverter.ToInt16(bytes, offset + 14), + chan7_scaled = bitconverter.ToInt16(bytes, offset + 16), + chan8_scaled = bitconverter.ToInt16(bytes, offset + 18), + port = bytes[offset + 20], + rssi = bytes[offset + 21], + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS_RAW(byte[] bytes, int offset) + { + return new Msg_rc_channels_raw + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + chan1_raw = bitconverter.ToUInt16(bytes, offset + 4), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 6), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 14), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 16), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 18), + port = bytes[offset + 20], + rssi = bytes[offset + 21], + }; + } + + internal static MavlinkMessage Deserialize_SERVO_OUTPUT_RAW(byte[] bytes, int offset) + { + return new Msg_servo_output_raw + { + time_usec = bitconverter.ToUInt32(bytes, offset + 0), + servo1_raw = bitconverter.ToUInt16(bytes, offset + 4), + servo2_raw = bitconverter.ToUInt16(bytes, offset + 6), + servo3_raw = bitconverter.ToUInt16(bytes, offset + 8), + servo4_raw = bitconverter.ToUInt16(bytes, offset + 10), + servo5_raw = bitconverter.ToUInt16(bytes, offset + 12), + servo6_raw = bitconverter.ToUInt16(bytes, offset + 14), + servo7_raw = bitconverter.ToUInt16(bytes, offset + 16), + servo8_raw = bitconverter.ToUInt16(bytes, offset + 18), + port = bytes[offset + 20], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST_PARTIAL_LIST(byte[] bytes, int offset) + { + return new Msg_mission_request_partial_list + { + start_index = bitconverter.ToInt16(bytes, offset + 0), + end_index = bitconverter.ToInt16(bytes, offset + 2), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_WRITE_PARTIAL_LIST(byte[] bytes, int offset) + { + return new Msg_mission_write_partial_list + { + start_index = bitconverter.ToInt16(bytes, offset + 0), + end_index = bitconverter.ToInt16(bytes, offset + 2), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ITEM(byte[] bytes, int offset) + { + return new Msg_mission_item + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + x = bitconverter.ToSingle(bytes, offset + 16), + y = bitconverter.ToSingle(bytes, offset + 20), + z = bitconverter.ToSingle(bytes, offset + 24), + seq = bitconverter.ToUInt16(bytes, offset + 28), + command = bitconverter.ToUInt16(bytes, offset + 30), + target_system = bytes[offset + 32], + target_component = bytes[offset + 33], + frame = bytes[offset + 34], + current = bytes[offset + 35], + autocontinue = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST(byte[] bytes, int offset) + { + return new Msg_mission_request + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_SET_CURRENT(byte[] bytes, int offset) + { + return new Msg_mission_set_current + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_CURRENT(byte[] bytes, int offset) + { + return new Msg_mission_current + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST_LIST(byte[] bytes, int offset) + { + return new Msg_mission_request_list + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_COUNT(byte[] bytes, int offset) + { + return new Msg_mission_count + { + count = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_CLEAR_ALL(byte[] bytes, int offset) + { + return new Msg_mission_clear_all + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ITEM_REACHED(byte[] bytes, int offset) + { + return new Msg_mission_item_reached + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ACK(byte[] bytes, int offset) + { + return new Msg_mission_ack + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + type = bytes[offset + 2], + }; + } + + internal static MavlinkMessage Deserialize_SET_GPS_GLOBAL_ORIGIN(byte[] bytes, int offset) + { + return new Msg_set_gps_global_origin + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + target_system = bytes[offset + 12], + }; + } + + internal static MavlinkMessage Deserialize_GPS_GLOBAL_ORIGIN(byte[] bytes, int offset) + { + return new Msg_gps_global_origin + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_PARAM_MAP_RC(byte[] bytes, int offset) + { + return new Msg_param_map_rc + { + param_value0 = bitconverter.ToSingle(bytes, offset + 0), + scale = bitconverter.ToSingle(bytes, offset + 4), + param_value_min = bitconverter.ToSingle(bytes, offset + 8), + param_value_max = bitconverter.ToSingle(bytes, offset + 12), + param_index = bitconverter.ToInt16(bytes, offset + 16), + target_system = bytes[offset + 18], + target_component = bytes[offset + 19], + param_id = ByteArrayUtil.ToChar(bytes, offset + 20, 16), + parameter_rc_channel_index = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_REQUEST_INT(byte[] bytes, int offset) + { + return new Msg_mission_request_int + { + seq = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_SAFETY_SET_ALLOWED_AREA(byte[] bytes, int offset) + { + return new Msg_safety_set_allowed_area + { + p1x = bitconverter.ToSingle(bytes, offset + 0), + p1y = bitconverter.ToSingle(bytes, offset + 4), + p1z = bitconverter.ToSingle(bytes, offset + 8), + p2x = bitconverter.ToSingle(bytes, offset + 12), + p2y = bitconverter.ToSingle(bytes, offset + 16), + p2z = bitconverter.ToSingle(bytes, offset + 20), + target_system = bytes[offset + 24], + target_component = bytes[offset + 25], + frame = bytes[offset + 26], + }; + } + + internal static MavlinkMessage Deserialize_SAFETY_ALLOWED_AREA(byte[] bytes, int offset) + { + return new Msg_safety_allowed_area + { + p1x = bitconverter.ToSingle(bytes, offset + 0), + p1y = bitconverter.ToSingle(bytes, offset + 4), + p1z = bitconverter.ToSingle(bytes, offset + 8), + p2x = bitconverter.ToSingle(bytes, offset + 12), + p2y = bitconverter.ToSingle(bytes, offset + 16), + p2z = bitconverter.ToSingle(bytes, offset + 20), + frame = bytes[offset + 24], + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE_QUATERNION_COV(byte[] bytes, int offset) + { + return new Msg_attitude_quaternion_cov + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 4, 4), + rollspeed = bitconverter.ToSingle(bytes, offset + 20), + pitchspeed = bitconverter.ToSingle(bytes, offset + 24), + yawspeed = bitconverter.ToSingle(bytes, offset + 28), + covariance = ByteArrayUtil.ToSingle(bytes, offset + 32, 9), + }; + } + + internal static MavlinkMessage Deserialize_NAV_CONTROLLER_OUTPUT(byte[] bytes, int offset) + { + return new Msg_nav_controller_output + { + nav_roll = bitconverter.ToSingle(bytes, offset + 0), + nav_pitch = bitconverter.ToSingle(bytes, offset + 4), + alt_error = bitconverter.ToSingle(bytes, offset + 8), + aspd_error = bitconverter.ToSingle(bytes, offset + 12), + xtrack_error = bitconverter.ToSingle(bytes, offset + 16), + nav_bearing = bitconverter.ToInt16(bytes, offset + 20), + target_bearing = bitconverter.ToInt16(bytes, offset + 22), + wp_dist = bitconverter.ToUInt16(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_GLOBAL_POSITION_INT_COV(byte[] bytes, int offset) + { + return new Msg_global_position_int_cov + { + time_utc = bitconverter.ToUInt64(bytes, offset + 0), + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 8), + lat = bitconverter.ToInt32(bytes, offset + 12), + lon = bitconverter.ToInt32(bytes, offset + 16), + alt = bitconverter.ToInt32(bytes, offset + 20), + relative_alt = bitconverter.ToInt32(bytes, offset + 24), + vx = bitconverter.ToSingle(bytes, offset + 28), + vy = bitconverter.ToSingle(bytes, offset + 32), + vz = bitconverter.ToSingle(bytes, offset + 36), + covariance = ByteArrayUtil.ToSingle(bytes, offset + 40, 36), + estimator_type = bytes[offset + 184], + }; + } + + internal static MavlinkMessage Deserialize_LOCAL_POSITION_NED_COV(byte[] bytes, int offset) + { + return new Msg_local_position_ned_cov + { + time_utc = bitconverter.ToUInt64(bytes, offset + 0), + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 8), + x = bitconverter.ToSingle(bytes, offset + 12), + y = bitconverter.ToSingle(bytes, offset + 16), + z = bitconverter.ToSingle(bytes, offset + 20), + vx = bitconverter.ToSingle(bytes, offset + 24), + vy = bitconverter.ToSingle(bytes, offset + 28), + vz = bitconverter.ToSingle(bytes, offset + 32), + ax = bitconverter.ToSingle(bytes, offset + 36), + ay = bitconverter.ToSingle(bytes, offset + 40), + az = bitconverter.ToSingle(bytes, offset + 44), + covariance = ByteArrayUtil.ToSingle(bytes, offset + 48, 45), + estimator_type = bytes[offset + 228], + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS(byte[] bytes, int offset) + { + return new Msg_rc_channels + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + chan1_raw = bitconverter.ToUInt16(bytes, offset + 4), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 6), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 14), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 16), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 18), + chan9_raw = bitconverter.ToUInt16(bytes, offset + 20), + chan10_raw = bitconverter.ToUInt16(bytes, offset + 22), + chan11_raw = bitconverter.ToUInt16(bytes, offset + 24), + chan12_raw = bitconverter.ToUInt16(bytes, offset + 26), + chan13_raw = bitconverter.ToUInt16(bytes, offset + 28), + chan14_raw = bitconverter.ToUInt16(bytes, offset + 30), + chan15_raw = bitconverter.ToUInt16(bytes, offset + 32), + chan16_raw = bitconverter.ToUInt16(bytes, offset + 34), + chan17_raw = bitconverter.ToUInt16(bytes, offset + 36), + chan18_raw = bitconverter.ToUInt16(bytes, offset + 38), + chancount = bytes[offset + 40], + rssi = bytes[offset + 41], + }; + } + + internal static MavlinkMessage Deserialize_REQUEST_DATA_STREAM(byte[] bytes, int offset) + { + return new Msg_request_data_stream + { + req_message_rate = bitconverter.ToUInt16(bytes, offset + 0), + target_system = bytes[offset + 2], + target_component = bytes[offset + 3], + req_stream_id = bytes[offset + 4], + start_stop = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_DATA_STREAM(byte[] bytes, int offset) + { + return new Msg_data_stream + { + message_rate = bitconverter.ToUInt16(bytes, offset + 0), + stream_id = bytes[offset + 2], + on_off = bytes[offset + 3], + }; + } + + internal static MavlinkMessage Deserialize_MANUAL_CONTROL(byte[] bytes, int offset) + { + return new Msg_manual_control + { + x = bitconverter.ToInt16(bytes, offset + 0), + y = bitconverter.ToInt16(bytes, offset + 2), + z = bitconverter.ToInt16(bytes, offset + 4), + r = bitconverter.ToInt16(bytes, offset + 6), + buttons = bitconverter.ToUInt16(bytes, offset + 8), + target = bytes[offset + 10], + }; + } + + internal static MavlinkMessage Deserialize_RC_CHANNELS_OVERRIDE(byte[] bytes, int offset) + { + return new Msg_rc_channels_override + { + chan1_raw = bitconverter.ToUInt16(bytes, offset + 0), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 2), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 4), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 6), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 14), + target_system = bytes[offset + 16], + target_component = bytes[offset + 17], + }; + } + + internal static MavlinkMessage Deserialize_MISSION_ITEM_INT(byte[] bytes, int offset) + { + return new Msg_mission_item_int + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + x = bitconverter.ToInt32(bytes, offset + 16), + y = bitconverter.ToInt32(bytes, offset + 20), + z = bitconverter.ToSingle(bytes, offset + 24), + seq = bitconverter.ToUInt16(bytes, offset + 28), + command = bitconverter.ToUInt16(bytes, offset + 30), + target_system = bytes[offset + 32], + target_component = bytes[offset + 33], + frame = bytes[offset + 34], + current = bytes[offset + 35], + autocontinue = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_VFR_HUD(byte[] bytes, int offset) + { + return new Msg_vfr_hud + { + airspeed = bitconverter.ToSingle(bytes, offset + 0), + groundspeed = bitconverter.ToSingle(bytes, offset + 4), + alt = bitconverter.ToSingle(bytes, offset + 8), + climb = bitconverter.ToSingle(bytes, offset + 12), + heading = bitconverter.ToInt16(bytes, offset + 16), + throttle = bitconverter.ToUInt16(bytes, offset + 18), + }; + } + + internal static MavlinkMessage Deserialize_COMMAND_INT(byte[] bytes, int offset) + { + return new Msg_command_int + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + x = bitconverter.ToInt32(bytes, offset + 16), + y = bitconverter.ToInt32(bytes, offset + 20), + z = bitconverter.ToSingle(bytes, offset + 24), + command = bitconverter.ToUInt16(bytes, offset + 28), + target_system = bytes[offset + 30], + target_component = bytes[offset + 31], + frame = bytes[offset + 32], + current = bytes[offset + 33], + autocontinue = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_COMMAND_LONG(byte[] bytes, int offset) + { + return new Msg_command_long + { + param1 = bitconverter.ToSingle(bytes, offset + 0), + param2 = bitconverter.ToSingle(bytes, offset + 4), + param3 = bitconverter.ToSingle(bytes, offset + 8), + param4 = bitconverter.ToSingle(bytes, offset + 12), + param5 = bitconverter.ToSingle(bytes, offset + 16), + param6 = bitconverter.ToSingle(bytes, offset + 20), + param7 = bitconverter.ToSingle(bytes, offset + 24), + command = bitconverter.ToUInt16(bytes, offset + 28), + target_system = bytes[offset + 30], + target_component = bytes[offset + 31], + confirmation = bytes[offset + 32], + }; + } + + internal static MavlinkMessage Deserialize_COMMAND_ACK(byte[] bytes, int offset) + { + return new Msg_command_ack + { + command = bitconverter.ToUInt16(bytes, offset + 0), + result = bytes[offset + 2], + }; + } + + internal static MavlinkMessage Deserialize_MANUAL_SETPOINT(byte[] bytes, int offset) + { + return new Msg_manual_setpoint + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + roll = bitconverter.ToSingle(bytes, offset + 4), + pitch = bitconverter.ToSingle(bytes, offset + 8), + yaw = bitconverter.ToSingle(bytes, offset + 12), + thrust = bitconverter.ToSingle(bytes, offset + 16), + mode_switch = bytes[offset + 20], + manual_override_switch = bytes[offset + 21], + }; + } + + internal static MavlinkMessage Deserialize_SET_ATTITUDE_TARGET(byte[] bytes, int offset) + { + return new Msg_set_attitude_target + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 4, 4), + body_roll_rate = bitconverter.ToSingle(bytes, offset + 20), + body_pitch_rate = bitconverter.ToSingle(bytes, offset + 24), + body_yaw_rate = bitconverter.ToSingle(bytes, offset + 28), + thrust = bitconverter.ToSingle(bytes, offset + 32), + target_system = bytes[offset + 36], + target_component = bytes[offset + 37], + type_mask = bytes[offset + 38], + }; + } + + internal static MavlinkMessage Deserialize_ATTITUDE_TARGET(byte[] bytes, int offset) + { + return new Msg_attitude_target + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 4, 4), + body_roll_rate = bitconverter.ToSingle(bytes, offset + 20), + body_pitch_rate = bitconverter.ToSingle(bytes, offset + 24), + body_yaw_rate = bitconverter.ToSingle(bytes, offset + 28), + thrust = bitconverter.ToSingle(bytes, offset + 32), + type_mask = bytes[offset + 36], + }; + } + + internal static MavlinkMessage Deserialize_SET_POSITION_TARGET_LOCAL_NED(byte[] bytes, int offset) + { + return new Msg_set_position_target_local_ned + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + target_system = bytes[offset + 50], + target_component = bytes[offset + 51], + coordinate_frame = bytes[offset + 52], + }; + } + + internal static MavlinkMessage Deserialize_POSITION_TARGET_LOCAL_NED(byte[] bytes, int offset) + { + return new Msg_position_target_local_ned + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + coordinate_frame = bytes[offset + 50], + }; + } + + internal static MavlinkMessage Deserialize_SET_POSITION_TARGET_GLOBAL_INT(byte[] bytes, int offset) + { + return new Msg_set_position_target_global_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + lat_int = bitconverter.ToInt32(bytes, offset + 4), + lon_int = bitconverter.ToInt32(bytes, offset + 8), + alt = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + target_system = bytes[offset + 50], + target_component = bytes[offset + 51], + coordinate_frame = bytes[offset + 52], + }; + } + + internal static MavlinkMessage Deserialize_POSITION_TARGET_GLOBAL_INT(byte[] bytes, int offset) + { + return new Msg_position_target_global_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + lat_int = bitconverter.ToInt32(bytes, offset + 4), + lon_int = bitconverter.ToInt32(bytes, offset + 8), + alt = bitconverter.ToSingle(bytes, offset + 12), + vx = bitconverter.ToSingle(bytes, offset + 16), + vy = bitconverter.ToSingle(bytes, offset + 20), + vz = bitconverter.ToSingle(bytes, offset + 24), + afx = bitconverter.ToSingle(bytes, offset + 28), + afy = bitconverter.ToSingle(bytes, offset + 32), + afz = bitconverter.ToSingle(bytes, offset + 36), + yaw = bitconverter.ToSingle(bytes, offset + 40), + yaw_rate = bitconverter.ToSingle(bytes, offset + 44), + type_mask = bitconverter.ToUInt16(bytes, offset + 48), + coordinate_frame = bytes[offset + 50], + }; + } + + internal static MavlinkMessage Deserialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(byte[] bytes, int offset) + { + return new Msg_local_position_ned_system_global_offset + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 4), + y = bitconverter.ToSingle(bytes, offset + 8), + z = bitconverter.ToSingle(bytes, offset + 12), + roll = bitconverter.ToSingle(bytes, offset + 16), + pitch = bitconverter.ToSingle(bytes, offset + 20), + yaw = bitconverter.ToSingle(bytes, offset + 24), + }; + } + + internal static MavlinkMessage Deserialize_HIL_STATE(byte[] bytes, int offset) + { + return new Msg_hil_state + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + roll = bitconverter.ToSingle(bytes, offset + 8), + pitch = bitconverter.ToSingle(bytes, offset + 12), + yaw = bitconverter.ToSingle(bytes, offset + 16), + rollspeed = bitconverter.ToSingle(bytes, offset + 20), + pitchspeed = bitconverter.ToSingle(bytes, offset + 24), + yawspeed = bitconverter.ToSingle(bytes, offset + 28), + lat = bitconverter.ToInt32(bytes, offset + 32), + lon = bitconverter.ToInt32(bytes, offset + 36), + alt = bitconverter.ToInt32(bytes, offset + 40), + vx = bitconverter.ToInt16(bytes, offset + 44), + vy = bitconverter.ToInt16(bytes, offset + 46), + vz = bitconverter.ToInt16(bytes, offset + 48), + xacc = bitconverter.ToInt16(bytes, offset + 50), + yacc = bitconverter.ToInt16(bytes, offset + 52), + zacc = bitconverter.ToInt16(bytes, offset + 54), + }; + } + + internal static MavlinkMessage Deserialize_HIL_CONTROLS(byte[] bytes, int offset) + { + return new Msg_hil_controls + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + roll_ailerons = bitconverter.ToSingle(bytes, offset + 8), + pitch_elevator = bitconverter.ToSingle(bytes, offset + 12), + yaw_rudder = bitconverter.ToSingle(bytes, offset + 16), + throttle = bitconverter.ToSingle(bytes, offset + 20), + aux1 = bitconverter.ToSingle(bytes, offset + 24), + aux2 = bitconverter.ToSingle(bytes, offset + 28), + aux3 = bitconverter.ToSingle(bytes, offset + 32), + aux4 = bitconverter.ToSingle(bytes, offset + 36), + mode = bytes[offset + 40], + nav_mode = bytes[offset + 41], + }; + } + + internal static MavlinkMessage Deserialize_HIL_RC_INPUTS_RAW(byte[] bytes, int offset) + { + return new Msg_hil_rc_inputs_raw + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + chan1_raw = bitconverter.ToUInt16(bytes, offset + 8), + chan2_raw = bitconverter.ToUInt16(bytes, offset + 10), + chan3_raw = bitconverter.ToUInt16(bytes, offset + 12), + chan4_raw = bitconverter.ToUInt16(bytes, offset + 14), + chan5_raw = bitconverter.ToUInt16(bytes, offset + 16), + chan6_raw = bitconverter.ToUInt16(bytes, offset + 18), + chan7_raw = bitconverter.ToUInt16(bytes, offset + 20), + chan8_raw = bitconverter.ToUInt16(bytes, offset + 22), + chan9_raw = bitconverter.ToUInt16(bytes, offset + 24), + chan10_raw = bitconverter.ToUInt16(bytes, offset + 26), + chan11_raw = bitconverter.ToUInt16(bytes, offset + 28), + chan12_raw = bitconverter.ToUInt16(bytes, offset + 30), + rssi = bytes[offset + 32], + }; + } + + internal static MavlinkMessage Deserialize_OPTICAL_FLOW(byte[] bytes, int offset) + { + return new Msg_optical_flow + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + flow_comp_m_x = bitconverter.ToSingle(bytes, offset + 8), + flow_comp_m_y = bitconverter.ToSingle(bytes, offset + 12), + ground_distance = bitconverter.ToSingle(bytes, offset + 16), + flow_x = bitconverter.ToInt16(bytes, offset + 20), + flow_y = bitconverter.ToInt16(bytes, offset + 22), + sensor_id = bytes[offset + 24], + quality = bytes[offset + 25], + }; + } + + internal static MavlinkMessage Deserialize_GLOBAL_VISION_POSITION_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_global_vision_position_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + roll = bitconverter.ToSingle(bytes, offset + 20), + pitch = bitconverter.ToSingle(bytes, offset + 24), + yaw = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_VISION_POSITION_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_vision_position_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + roll = bitconverter.ToSingle(bytes, offset + 20), + pitch = bitconverter.ToSingle(bytes, offset + 24), + yaw = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_VISION_SPEED_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_vision_speed_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + }; + } + + internal static MavlinkMessage Deserialize_VICON_POSITION_ESTIMATE(byte[] bytes, int offset) + { + return new Msg_vicon_position_estimate + { + usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + roll = bitconverter.ToSingle(bytes, offset + 20), + pitch = bitconverter.ToSingle(bytes, offset + 24), + yaw = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_HIGHRES_IMU(byte[] bytes, int offset) + { + return new Msg_highres_imu + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + xacc = bitconverter.ToSingle(bytes, offset + 8), + yacc = bitconverter.ToSingle(bytes, offset + 12), + zacc = bitconverter.ToSingle(bytes, offset + 16), + xgyro = bitconverter.ToSingle(bytes, offset + 20), + ygyro = bitconverter.ToSingle(bytes, offset + 24), + zgyro = bitconverter.ToSingle(bytes, offset + 28), + xmag = bitconverter.ToSingle(bytes, offset + 32), + ymag = bitconverter.ToSingle(bytes, offset + 36), + zmag = bitconverter.ToSingle(bytes, offset + 40), + abs_pressure = bitconverter.ToSingle(bytes, offset + 44), + diff_pressure = bitconverter.ToSingle(bytes, offset + 48), + pressure_alt = bitconverter.ToSingle(bytes, offset + 52), + temperature = bitconverter.ToSingle(bytes, offset + 56), + fields_updated = bitconverter.ToUInt16(bytes, offset + 60), + }; + } + + internal static MavlinkMessage Deserialize_OPTICAL_FLOW_RAD(byte[] bytes, int offset) + { + return new Msg_optical_flow_rad + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + integration_time_us = bitconverter.ToUInt32(bytes, offset + 8), + integrated_x = bitconverter.ToSingle(bytes, offset + 12), + integrated_y = bitconverter.ToSingle(bytes, offset + 16), + integrated_xgyro = bitconverter.ToSingle(bytes, offset + 20), + integrated_ygyro = bitconverter.ToSingle(bytes, offset + 24), + integrated_zgyro = bitconverter.ToSingle(bytes, offset + 28), + time_delta_distance_us = bitconverter.ToUInt32(bytes, offset + 32), + distance = bitconverter.ToSingle(bytes, offset + 36), + temperature = bitconverter.ToInt16(bytes, offset + 40), + sensor_id = bytes[offset + 42], + quality = bytes[offset + 43], + }; + } + + internal static MavlinkMessage Deserialize_HIL_SENSOR(byte[] bytes, int offset) + { + return new Msg_hil_sensor + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + xacc = bitconverter.ToSingle(bytes, offset + 8), + yacc = bitconverter.ToSingle(bytes, offset + 12), + zacc = bitconverter.ToSingle(bytes, offset + 16), + xgyro = bitconverter.ToSingle(bytes, offset + 20), + ygyro = bitconverter.ToSingle(bytes, offset + 24), + zgyro = bitconverter.ToSingle(bytes, offset + 28), + xmag = bitconverter.ToSingle(bytes, offset + 32), + ymag = bitconverter.ToSingle(bytes, offset + 36), + zmag = bitconverter.ToSingle(bytes, offset + 40), + abs_pressure = bitconverter.ToSingle(bytes, offset + 44), + diff_pressure = bitconverter.ToSingle(bytes, offset + 48), + pressure_alt = bitconverter.ToSingle(bytes, offset + 52), + temperature = bitconverter.ToSingle(bytes, offset + 56), + fields_updated = bitconverter.ToUInt32(bytes, offset + 60), + }; + } + + internal static MavlinkMessage Deserialize_SIM_STATE(byte[] bytes, int offset) + { + return new Msg_sim_state + { + q1 = bitconverter.ToSingle(bytes, offset + 0), + q2 = bitconverter.ToSingle(bytes, offset + 4), + q3 = bitconverter.ToSingle(bytes, offset + 8), + q4 = bitconverter.ToSingle(bytes, offset + 12), + roll = bitconverter.ToSingle(bytes, offset + 16), + pitch = bitconverter.ToSingle(bytes, offset + 20), + yaw = bitconverter.ToSingle(bytes, offset + 24), + xacc = bitconverter.ToSingle(bytes, offset + 28), + yacc = bitconverter.ToSingle(bytes, offset + 32), + zacc = bitconverter.ToSingle(bytes, offset + 36), + xgyro = bitconverter.ToSingle(bytes, offset + 40), + ygyro = bitconverter.ToSingle(bytes, offset + 44), + zgyro = bitconverter.ToSingle(bytes, offset + 48), + lat = bitconverter.ToSingle(bytes, offset + 52), + lon = bitconverter.ToSingle(bytes, offset + 56), + alt = bitconverter.ToSingle(bytes, offset + 60), + std_dev_horz = bitconverter.ToSingle(bytes, offset + 64), + std_dev_vert = bitconverter.ToSingle(bytes, offset + 68), + vn = bitconverter.ToSingle(bytes, offset + 72), + ve = bitconverter.ToSingle(bytes, offset + 76), + vd = bitconverter.ToSingle(bytes, offset + 80), + }; + } + + internal static MavlinkMessage Deserialize_RADIO_STATUS(byte[] bytes, int offset) + { + return new Msg_radio_status + { + rxerrors = bitconverter.ToUInt16(bytes, offset + 0), + @fixed = bitconverter.ToUInt16(bytes, offset + 2), + rssi = bytes[offset + 4], + remrssi = bytes[offset + 5], + txbuf = bytes[offset + 6], + noise = bytes[offset + 7], + remnoise = bytes[offset + 8], + }; + } + + internal static MavlinkMessage Deserialize_FILE_TRANSFER_PROTOCOL(byte[] bytes, int offset) + { + return new Msg_file_transfer_protocol + { + target_network = bytes[offset + 0], + target_system = bytes[offset + 1], + target_component = bytes[offset + 2], + payload = ByteArrayUtil.ToUInt8(bytes, offset + 3, 251), + }; + } + + internal static MavlinkMessage Deserialize_TIMESYNC(byte[] bytes, int offset) + { + return new Msg_timesync + { + tc1 = bitconverter.ToInt64(bytes, offset + 0), + ts1 = bitconverter.ToInt64(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_CAMERA_TRIGGER(byte[] bytes, int offset) + { + return new Msg_camera_trigger + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + seq = bitconverter.ToUInt32(bytes, offset + 8), + }; + } + + internal static MavlinkMessage Deserialize_HIL_GPS(byte[] bytes, int offset) + { + return new Msg_hil_gps + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + alt = bitconverter.ToInt32(bytes, offset + 16), + eph = bitconverter.ToUInt16(bytes, offset + 20), + epv = bitconverter.ToUInt16(bytes, offset + 22), + vel = bitconverter.ToUInt16(bytes, offset + 24), + vn = bitconverter.ToInt16(bytes, offset + 26), + ve = bitconverter.ToInt16(bytes, offset + 28), + vd = bitconverter.ToInt16(bytes, offset + 30), + cog = bitconverter.ToUInt16(bytes, offset + 32), + fix_type = bytes[offset + 34], + satellites_visible = bytes[offset + 35], + }; + } + + internal static MavlinkMessage Deserialize_HIL_OPTICAL_FLOW(byte[] bytes, int offset) + { + return new Msg_hil_optical_flow + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + integration_time_us = bitconverter.ToUInt32(bytes, offset + 8), + integrated_x = bitconverter.ToSingle(bytes, offset + 12), + integrated_y = bitconverter.ToSingle(bytes, offset + 16), + integrated_xgyro = bitconverter.ToSingle(bytes, offset + 20), + integrated_ygyro = bitconverter.ToSingle(bytes, offset + 24), + integrated_zgyro = bitconverter.ToSingle(bytes, offset + 28), + time_delta_distance_us = bitconverter.ToUInt32(bytes, offset + 32), + distance = bitconverter.ToSingle(bytes, offset + 36), + temperature = bitconverter.ToInt16(bytes, offset + 40), + sensor_id = bytes[offset + 42], + quality = bytes[offset + 43], + }; + } + + internal static MavlinkMessage Deserialize_HIL_STATE_QUATERNION(byte[] bytes, int offset) + { + return new Msg_hil_state_quaternion + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + attitude_quaternion = ByteArrayUtil.ToSingle(bytes, offset + 8, 4), + rollspeed = bitconverter.ToSingle(bytes, offset + 24), + pitchspeed = bitconverter.ToSingle(bytes, offset + 28), + yawspeed = bitconverter.ToSingle(bytes, offset + 32), + lat = bitconverter.ToInt32(bytes, offset + 36), + lon = bitconverter.ToInt32(bytes, offset + 40), + alt = bitconverter.ToInt32(bytes, offset + 44), + vx = bitconverter.ToInt16(bytes, offset + 48), + vy = bitconverter.ToInt16(bytes, offset + 50), + vz = bitconverter.ToInt16(bytes, offset + 52), + ind_airspeed = bitconverter.ToUInt16(bytes, offset + 54), + true_airspeed = bitconverter.ToUInt16(bytes, offset + 56), + xacc = bitconverter.ToInt16(bytes, offset + 58), + yacc = bitconverter.ToInt16(bytes, offset + 60), + zacc = bitconverter.ToInt16(bytes, offset + 62), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_IMU2(byte[] bytes, int offset) + { + return new Msg_scaled_imu2 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 4), + yacc = bitconverter.ToInt16(bytes, offset + 6), + zacc = bitconverter.ToInt16(bytes, offset + 8), + xgyro = bitconverter.ToInt16(bytes, offset + 10), + ygyro = bitconverter.ToInt16(bytes, offset + 12), + zgyro = bitconverter.ToInt16(bytes, offset + 14), + xmag = bitconverter.ToInt16(bytes, offset + 16), + ymag = bitconverter.ToInt16(bytes, offset + 18), + zmag = bitconverter.ToInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_LOG_REQUEST_LIST(byte[] bytes, int offset) + { + return new Msg_log_request_list + { + start = bitconverter.ToUInt16(bytes, offset + 0), + end = bitconverter.ToUInt16(bytes, offset + 2), + target_system = bytes[offset + 4], + target_component = bytes[offset + 5], + }; + } + + internal static MavlinkMessage Deserialize_LOG_ENTRY(byte[] bytes, int offset) + { + return new Msg_log_entry + { + time_utc = bitconverter.ToUInt32(bytes, offset + 0), + size = bitconverter.ToUInt32(bytes, offset + 4), + id = bitconverter.ToUInt16(bytes, offset + 8), + num_logs = bitconverter.ToUInt16(bytes, offset + 10), + last_log_num = bitconverter.ToUInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_LOG_REQUEST_DATA(byte[] bytes, int offset) + { + return new Msg_log_request_data + { + ofs = bitconverter.ToUInt32(bytes, offset + 0), + count = bitconverter.ToUInt32(bytes, offset + 4), + id = bitconverter.ToUInt16(bytes, offset + 8), + target_system = bytes[offset + 10], + target_component = bytes[offset + 11], + }; + } + + internal static MavlinkMessage Deserialize_LOG_DATA(byte[] bytes, int offset) + { + return new Msg_log_data + { + ofs = bitconverter.ToUInt32(bytes, offset + 0), + id = bitconverter.ToUInt16(bytes, offset + 4), + count = bytes[offset + 6], + data = ByteArrayUtil.ToUInt8(bytes, offset + 7, 90), + }; + } + + internal static MavlinkMessage Deserialize_LOG_ERASE(byte[] bytes, int offset) + { + return new Msg_log_erase + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_LOG_REQUEST_END(byte[] bytes, int offset) + { + return new Msg_log_request_end + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_GPS_INJECT_DATA(byte[] bytes, int offset) + { + return new Msg_gps_inject_data + { + target_system = bytes[offset + 0], + target_component = bytes[offset + 1], + len = bytes[offset + 2], + data = ByteArrayUtil.ToUInt8(bytes, offset + 3, 110), + }; + } + + internal static MavlinkMessage Deserialize_GPS2_RAW(byte[] bytes, int offset) + { + return new Msg_gps2_raw + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + alt = bitconverter.ToInt32(bytes, offset + 16), + dgps_age = bitconverter.ToUInt32(bytes, offset + 20), + eph = bitconverter.ToUInt16(bytes, offset + 24), + epv = bitconverter.ToUInt16(bytes, offset + 26), + vel = bitconverter.ToUInt16(bytes, offset + 28), + cog = bitconverter.ToUInt16(bytes, offset + 30), + fix_type = bytes[offset + 32], + satellites_visible = bytes[offset + 33], + dgps_numch = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_POWER_STATUS(byte[] bytes, int offset) + { + return new Msg_power_status + { + Vcc = bitconverter.ToUInt16(bytes, offset + 0), + Vservo = bitconverter.ToUInt16(bytes, offset + 2), + flags = bitconverter.ToUInt16(bytes, offset + 4), + }; + } + + internal static MavlinkMessage Deserialize_SERIAL_CONTROL(byte[] bytes, int offset) + { + return new Msg_serial_control + { + baudrate = bitconverter.ToUInt32(bytes, offset + 0), + timeout = bitconverter.ToUInt16(bytes, offset + 4), + device = bytes[offset + 6], + flags = bytes[offset + 7], + count = bytes[offset + 8], + data = ByteArrayUtil.ToUInt8(bytes, offset + 9, 70), + }; + } + + internal static MavlinkMessage Deserialize_GPS_RTK(byte[] bytes, int offset) + { + return new Msg_gps_rtk + { + time_last_baseline_ms = bitconverter.ToUInt32(bytes, offset + 0), + tow = bitconverter.ToUInt32(bytes, offset + 4), + baseline_a_mm = bitconverter.ToInt32(bytes, offset + 8), + baseline_b_mm = bitconverter.ToInt32(bytes, offset + 12), + baseline_c_mm = bitconverter.ToInt32(bytes, offset + 16), + accuracy = bitconverter.ToUInt32(bytes, offset + 20), + iar_num_hypotheses = bitconverter.ToInt32(bytes, offset + 24), + wn = bitconverter.ToUInt16(bytes, offset + 28), + rtk_receiver_id = bytes[offset + 30], + rtk_health = bytes[offset + 31], + rtk_rate = bytes[offset + 32], + nsats = bytes[offset + 33], + baseline_coords_type = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_GPS2_RTK(byte[] bytes, int offset) + { + return new Msg_gps2_rtk + { + time_last_baseline_ms = bitconverter.ToUInt32(bytes, offset + 0), + tow = bitconverter.ToUInt32(bytes, offset + 4), + baseline_a_mm = bitconverter.ToInt32(bytes, offset + 8), + baseline_b_mm = bitconverter.ToInt32(bytes, offset + 12), + baseline_c_mm = bitconverter.ToInt32(bytes, offset + 16), + accuracy = bitconverter.ToUInt32(bytes, offset + 20), + iar_num_hypotheses = bitconverter.ToInt32(bytes, offset + 24), + wn = bitconverter.ToUInt16(bytes, offset + 28), + rtk_receiver_id = bytes[offset + 30], + rtk_health = bytes[offset + 31], + rtk_rate = bytes[offset + 32], + nsats = bytes[offset + 33], + baseline_coords_type = bytes[offset + 34], + }; + } + + internal static MavlinkMessage Deserialize_SCALED_IMU3(byte[] bytes, int offset) + { + return new Msg_scaled_imu3 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + xacc = bitconverter.ToInt16(bytes, offset + 4), + yacc = bitconverter.ToInt16(bytes, offset + 6), + zacc = bitconverter.ToInt16(bytes, offset + 8), + xgyro = bitconverter.ToInt16(bytes, offset + 10), + ygyro = bitconverter.ToInt16(bytes, offset + 12), + zgyro = bitconverter.ToInt16(bytes, offset + 14), + xmag = bitconverter.ToInt16(bytes, offset + 16), + ymag = bitconverter.ToInt16(bytes, offset + 18), + zmag = bitconverter.ToInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_DATA_TRANSMISSION_HANDSHAKE(byte[] bytes, int offset) + { + return new Msg_data_transmission_handshake + { + size = bitconverter.ToUInt32(bytes, offset + 0), + width = bitconverter.ToUInt16(bytes, offset + 4), + height = bitconverter.ToUInt16(bytes, offset + 6), + packets = bitconverter.ToUInt16(bytes, offset + 8), + type = bytes[offset + 10], + payload = bytes[offset + 11], + jpg_quality = bytes[offset + 12], + }; + } + + internal static MavlinkMessage Deserialize_ENCAPSULATED_DATA(byte[] bytes, int offset) + { + return new Msg_encapsulated_data + { + seqnr = bitconverter.ToUInt16(bytes, offset + 0), + data = ByteArrayUtil.ToUInt8(bytes, offset + 2, 253), + }; + } + + internal static MavlinkMessage Deserialize_DISTANCE_SENSOR(byte[] bytes, int offset) + { + return new Msg_distance_sensor + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + min_distance = bitconverter.ToUInt16(bytes, offset + 4), + max_distance = bitconverter.ToUInt16(bytes, offset + 6), + current_distance = bitconverter.ToUInt16(bytes, offset + 8), + type = bytes[offset + 10], + id = bytes[offset + 11], + orientation = bytes[offset + 12], + covariance = bytes[offset + 13], + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_REQUEST(byte[] bytes, int offset) + { + return new Msg_terrain_request + { + mask = bitconverter.ToUInt64(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 8), + lon = bitconverter.ToInt32(bytes, offset + 12), + grid_spacing = bitconverter.ToUInt16(bytes, offset + 16), + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_DATA(byte[] bytes, int offset) + { + return new Msg_terrain_data + { + lat = bitconverter.ToInt32(bytes, offset + 0), + lon = bitconverter.ToInt32(bytes, offset + 4), + grid_spacing = bitconverter.ToUInt16(bytes, offset + 8), + data = ByteArrayUtil.ToInt16(bytes, offset + 10, 16), + gridbit = bytes[offset + 42], + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_CHECK(byte[] bytes, int offset) + { + return new Msg_terrain_check + { + lat = bitconverter.ToInt32(bytes, offset + 0), + lon = bitconverter.ToInt32(bytes, offset + 4), + }; + } + + internal static MavlinkMessage Deserialize_TERRAIN_REPORT(byte[] bytes, int offset) + { + return new Msg_terrain_report + { + lat = bitconverter.ToInt32(bytes, offset + 0), + lon = bitconverter.ToInt32(bytes, offset + 4), + terrain_height = bitconverter.ToSingle(bytes, offset + 8), + current_height = bitconverter.ToSingle(bytes, offset + 12), + spacing = bitconverter.ToUInt16(bytes, offset + 16), + pending = bitconverter.ToUInt16(bytes, offset + 18), + loaded = bitconverter.ToUInt16(bytes, offset + 20), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_PRESSURE2(byte[] bytes, int offset) + { + return new Msg_scaled_pressure2 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + press_abs = bitconverter.ToSingle(bytes, offset + 4), + press_diff = bitconverter.ToSingle(bytes, offset + 8), + temperature = bitconverter.ToInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_ATT_POS_MOCAP(byte[] bytes, int offset) + { + return new Msg_att_pos_mocap + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + q = ByteArrayUtil.ToSingle(bytes, offset + 8, 4), + x = bitconverter.ToSingle(bytes, offset + 24), + y = bitconverter.ToSingle(bytes, offset + 28), + z = bitconverter.ToSingle(bytes, offset + 32), + }; + } + + internal static MavlinkMessage Deserialize_SET_ACTUATOR_CONTROL_TARGET(byte[] bytes, int offset) + { + return new Msg_set_actuator_control_target + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + controls = ByteArrayUtil.ToSingle(bytes, offset + 8, 8), + group_mlx = bytes[offset + 40], + target_system = bytes[offset + 41], + target_component = bytes[offset + 42], + }; + } + + internal static MavlinkMessage Deserialize_ACTUATOR_CONTROL_TARGET(byte[] bytes, int offset) + { + return new Msg_actuator_control_target + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + controls = ByteArrayUtil.ToSingle(bytes, offset + 8, 8), + group_mlx = bytes[offset + 40], + }; + } + + internal static MavlinkMessage Deserialize_ALTITUDE(byte[] bytes, int offset) + { + return new Msg_altitude + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + altitude_monotonic = bitconverter.ToSingle(bytes, offset + 8), + altitude_amsl = bitconverter.ToSingle(bytes, offset + 12), + altitude_local = bitconverter.ToSingle(bytes, offset + 16), + altitude_relative = bitconverter.ToSingle(bytes, offset + 20), + altitude_terrain = bitconverter.ToSingle(bytes, offset + 24), + bottom_clearance = bitconverter.ToSingle(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_RESOURCE_REQUEST(byte[] bytes, int offset) + { + return new Msg_resource_request + { + request_id = bytes[offset + 0], + uri_type = bytes[offset + 1], + uri = ByteArrayUtil.ToUInt8(bytes, offset + 2, 120), + transfer_type = bytes[offset + 122], + storage = ByteArrayUtil.ToUInt8(bytes, offset + 123, 120), + }; + } + + internal static MavlinkMessage Deserialize_SCALED_PRESSURE3(byte[] bytes, int offset) + { + return new Msg_scaled_pressure3 + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + press_abs = bitconverter.ToSingle(bytes, offset + 4), + press_diff = bitconverter.ToSingle(bytes, offset + 8), + temperature = bitconverter.ToInt16(bytes, offset + 12), + }; + } + + internal static MavlinkMessage Deserialize_FOLLOW_TARGET(byte[] bytes, int offset) + { + return new Msg_follow_target + { + timestamp = bitconverter.ToUInt64(bytes, offset + 0), + custom_state = bitconverter.ToUInt64(bytes, offset + 8), + lat = bitconverter.ToInt32(bytes, offset + 16), + lon = bitconverter.ToInt32(bytes, offset + 20), + alt = bitconverter.ToSingle(bytes, offset + 24), + vel = ByteArrayUtil.ToSingle(bytes, offset + 28, 3), + acc = ByteArrayUtil.ToSingle(bytes, offset + 40, 3), + attitude_q = ByteArrayUtil.ToSingle(bytes, offset + 52, 4), + rates = ByteArrayUtil.ToSingle(bytes, offset + 68, 3), + position_cov = ByteArrayUtil.ToSingle(bytes, offset + 80, 3), + est_capabilities = bytes[offset + 92], + }; + } + + internal static MavlinkMessage Deserialize_CONTROL_SYSTEM_STATE(byte[] bytes, int offset) + { + return new Msg_control_system_state + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + x_acc = bitconverter.ToSingle(bytes, offset + 8), + y_acc = bitconverter.ToSingle(bytes, offset + 12), + z_acc = bitconverter.ToSingle(bytes, offset + 16), + x_vel = bitconverter.ToSingle(bytes, offset + 20), + y_vel = bitconverter.ToSingle(bytes, offset + 24), + z_vel = bitconverter.ToSingle(bytes, offset + 28), + x_pos = bitconverter.ToSingle(bytes, offset + 32), + y_pos = bitconverter.ToSingle(bytes, offset + 36), + z_pos = bitconverter.ToSingle(bytes, offset + 40), + airspeed = bitconverter.ToSingle(bytes, offset + 44), + vel_variance = ByteArrayUtil.ToSingle(bytes, offset + 48, 3), + pos_variance = ByteArrayUtil.ToSingle(bytes, offset + 60, 3), + q = ByteArrayUtil.ToSingle(bytes, offset + 72, 4), + roll_rate = bitconverter.ToSingle(bytes, offset + 88), + pitch_rate = bitconverter.ToSingle(bytes, offset + 92), + yaw_rate = bitconverter.ToSingle(bytes, offset + 96), + }; + } + + internal static MavlinkMessage Deserialize_BATTERY_STATUS(byte[] bytes, int offset) + { + return new Msg_battery_status + { + current_consumed = bitconverter.ToInt32(bytes, offset + 0), + energy_consumed = bitconverter.ToInt32(bytes, offset + 4), + temperature = bitconverter.ToInt16(bytes, offset + 8), + voltages = ByteArrayUtil.ToUInt16(bytes, offset + 10, 10), + current_battery = bitconverter.ToInt16(bytes, offset + 30), + id = bytes[offset + 32], + battery_function = bytes[offset + 33], + type = bytes[offset + 34], + battery_remaining = bitconverter.ToInt8(bytes, offset + 35), + }; + } + + internal static MavlinkMessage Deserialize_AUTOPILOT_VERSION(byte[] bytes, int offset) + { + return new Msg_autopilot_version + { + capabilities = bitconverter.ToUInt64(bytes, offset + 0), + uid = bitconverter.ToUInt64(bytes, offset + 8), + flight_sw_version = bitconverter.ToUInt32(bytes, offset + 16), + middleware_sw_version = bitconverter.ToUInt32(bytes, offset + 20), + os_sw_version = bitconverter.ToUInt32(bytes, offset + 24), + board_version = bitconverter.ToUInt32(bytes, offset + 28), + vendor_id = bitconverter.ToUInt16(bytes, offset + 32), + product_id = bitconverter.ToUInt16(bytes, offset + 34), + flight_custom_version = ByteArrayUtil.ToUInt8(bytes, offset + 36, 8), + middleware_custom_version = ByteArrayUtil.ToUInt8(bytes, offset + 44, 8), + os_custom_version = ByteArrayUtil.ToUInt8(bytes, offset + 52, 8), + }; + } + + internal static MavlinkMessage Deserialize_LANDING_TARGET(byte[] bytes, int offset) + { + return new Msg_landing_target + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + angle_x = bitconverter.ToSingle(bytes, offset + 8), + angle_y = bitconverter.ToSingle(bytes, offset + 12), + distance = bitconverter.ToSingle(bytes, offset + 16), + size_x = bitconverter.ToSingle(bytes, offset + 20), + size_y = bitconverter.ToSingle(bytes, offset + 24), + target_num = bytes[offset + 28], + frame = bytes[offset + 29], + }; + } + + internal static MavlinkMessage Deserialize_ESTIMATOR_STATUS(byte[] bytes, int offset) + { + return new Msg_estimator_status + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + vel_ratio = bitconverter.ToSingle(bytes, offset + 8), + pos_horiz_ratio = bitconverter.ToSingle(bytes, offset + 12), + pos_vert_ratio = bitconverter.ToSingle(bytes, offset + 16), + mag_ratio = bitconverter.ToSingle(bytes, offset + 20), + hagl_ratio = bitconverter.ToSingle(bytes, offset + 24), + tas_ratio = bitconverter.ToSingle(bytes, offset + 28), + pos_horiz_accuracy = bitconverter.ToSingle(bytes, offset + 32), + pos_vert_accuracy = bitconverter.ToSingle(bytes, offset + 36), + flags = bitconverter.ToUInt16(bytes, offset + 40), + }; + } + + internal static MavlinkMessage Deserialize_WIND_COV(byte[] bytes, int offset) + { + return new Msg_wind_cov + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + wind_x = bitconverter.ToSingle(bytes, offset + 8), + wind_y = bitconverter.ToSingle(bytes, offset + 12), + wind_z = bitconverter.ToSingle(bytes, offset + 16), + var_horiz = bitconverter.ToSingle(bytes, offset + 20), + var_vert = bitconverter.ToSingle(bytes, offset + 24), + wind_alt = bitconverter.ToSingle(bytes, offset + 28), + horiz_accuracy = bitconverter.ToSingle(bytes, offset + 32), + vert_accuracy = bitconverter.ToSingle(bytes, offset + 36), + }; + } + + internal static MavlinkMessage Deserialize_VIBRATION(byte[] bytes, int offset) + { + return new Msg_vibration + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + vibration_x = bitconverter.ToSingle(bytes, offset + 8), + vibration_y = bitconverter.ToSingle(bytes, offset + 12), + vibration_z = bitconverter.ToSingle(bytes, offset + 16), + clipping_0 = bitconverter.ToUInt32(bytes, offset + 20), + clipping_1 = bitconverter.ToUInt32(bytes, offset + 24), + clipping_2 = bitconverter.ToUInt32(bytes, offset + 28), + }; + } + + internal static MavlinkMessage Deserialize_HOME_POSITION(byte[] bytes, int offset) + { + return new Msg_home_position + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + x = bitconverter.ToSingle(bytes, offset + 12), + y = bitconverter.ToSingle(bytes, offset + 16), + z = bitconverter.ToSingle(bytes, offset + 20), + q = ByteArrayUtil.ToSingle(bytes, offset + 24, 4), + approach_x = bitconverter.ToSingle(bytes, offset + 40), + approach_y = bitconverter.ToSingle(bytes, offset + 44), + approach_z = bitconverter.ToSingle(bytes, offset + 48), + }; + } + + internal static MavlinkMessage Deserialize_SET_HOME_POSITION(byte[] bytes, int offset) + { + return new Msg_set_home_position + { + latitude = bitconverter.ToInt32(bytes, offset + 0), + longitude = bitconverter.ToInt32(bytes, offset + 4), + altitude = bitconverter.ToInt32(bytes, offset + 8), + x = bitconverter.ToSingle(bytes, offset + 12), + y = bitconverter.ToSingle(bytes, offset + 16), + z = bitconverter.ToSingle(bytes, offset + 20), + q = ByteArrayUtil.ToSingle(bytes, offset + 24, 4), + approach_x = bitconverter.ToSingle(bytes, offset + 40), + approach_y = bitconverter.ToSingle(bytes, offset + 44), + approach_z = bitconverter.ToSingle(bytes, offset + 48), + target_system = bytes[offset + 52], + }; + } + + internal static MavlinkMessage Deserialize_MESSAGE_INTERVAL(byte[] bytes, int offset) + { + return new Msg_message_interval + { + interval_us = bitconverter.ToInt32(bytes, offset + 0), + message_id = bitconverter.ToUInt16(bytes, offset + 4), + }; + } + + internal static MavlinkMessage Deserialize_EXTENDED_SYS_STATE(byte[] bytes, int offset) + { + return new Msg_extended_sys_state + { + vtol_state = bytes[offset + 0], + landed_state = bytes[offset + 1], + }; + } + + internal static MavlinkMessage Deserialize_ADSB_VEHICLE(byte[] bytes, int offset) + { + return new Msg_adsb_vehicle + { + ICAO_address = bitconverter.ToUInt32(bytes, offset + 0), + lat = bitconverter.ToInt32(bytes, offset + 4), + lon = bitconverter.ToInt32(bytes, offset + 8), + altitude = bitconverter.ToInt32(bytes, offset + 12), + heading = bitconverter.ToUInt16(bytes, offset + 16), + hor_velocity = bitconverter.ToUInt16(bytes, offset + 18), + ver_velocity = bitconverter.ToInt16(bytes, offset + 20), + flags = bitconverter.ToUInt16(bytes, offset + 22), + squawk = bitconverter.ToUInt16(bytes, offset + 24), + altitude_type = bytes[offset + 26], + callsign = ByteArrayUtil.ToChar(bytes, offset + 27, 9), + emitter_type = bytes[offset + 36], + tslc = bytes[offset + 37], + }; + } + + internal static MavlinkMessage Deserialize_V2_EXTENSION(byte[] bytes, int offset) + { + return new Msg_v2_extension + { + message_type = bitconverter.ToUInt16(bytes, offset + 0), + target_network = bytes[offset + 2], + target_system = bytes[offset + 3], + target_component = bytes[offset + 4], + payload = ByteArrayUtil.ToUInt8(bytes, offset + 5, 249), + }; + } + + internal static MavlinkMessage Deserialize_MEMORY_VECT(byte[] bytes, int offset) + { + return new Msg_memory_vect + { + address = bitconverter.ToUInt16(bytes, offset + 0), + ver = bytes[offset + 2], + type = bytes[offset + 3], + value = ByteArrayUtil.ToInt8(bytes, offset + 4, 32), + }; + } + + internal static MavlinkMessage Deserialize_DEBUG_VECT(byte[] bytes, int offset) + { + return new Msg_debug_vect + { + time_usec = bitconverter.ToUInt64(bytes, offset + 0), + x = bitconverter.ToSingle(bytes, offset + 8), + y = bitconverter.ToSingle(bytes, offset + 12), + z = bitconverter.ToSingle(bytes, offset + 16), + name = ByteArrayUtil.ToChar(bytes, offset + 20, 10), + }; + } + + internal static MavlinkMessage Deserialize_NAMED_VALUE_FLOAT(byte[] bytes, int offset) + { + return new Msg_named_value_float + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + value = bitconverter.ToSingle(bytes, offset + 4), + name = ByteArrayUtil.ToChar(bytes, offset + 8, 10), + }; + } + + internal static MavlinkMessage Deserialize_NAMED_VALUE_INT(byte[] bytes, int offset) + { + return new Msg_named_value_int + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + value = bitconverter.ToInt32(bytes, offset + 4), + name = ByteArrayUtil.ToChar(bytes, offset + 8, 10), + }; + } + + internal static MavlinkMessage Deserialize_STATUSTEXT(byte[] bytes, int offset) + { + return new Msg_statustext + { + severity = bytes[offset + 0], + text = ByteArrayUtil.ToChar(bytes, offset + 1, 50), + }; + } + + internal static MavlinkMessage Deserialize_DEBUG(byte[] bytes, int offset) + { + return new Msg_debug + { + time_boot_ms = bitconverter.ToUInt32(bytes, offset + 0), + value = bitconverter.ToSingle(bytes, offset + 4), + ind = bytes[offset + 8], + }; + } + + internal static int Serialize_SET_VELOCITY(this Msg_set_velocity msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ref_angular_velocity, bytes, offset + 0); + offset += 2; + return 220; + } + + internal static int Serialize_HEARTBEAT(this Msg_heartbeat msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.custom_mode, bytes, offset + 0); + bytes[offset + 4] = msg.type; + bytes[offset + 5] = msg.autopilot; + bytes[offset + 6] = msg.base_mode; + bytes[offset + 7] = msg.system_status; + bytes[offset + 8] = msg.mavlink_version; + offset += 9; + return 0; + } + + internal static int Serialize_SYS_STATUS(this Msg_sys_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.onboard_control_sensors_present, bytes, offset + 0); + bitconverter.GetBytes(msg.onboard_control_sensors_enabled, bytes, offset + 4); + bitconverter.GetBytes(msg.onboard_control_sensors_health, bytes, offset + 8); + bitconverter.GetBytes(msg.load, bytes, offset + 12); + bitconverter.GetBytes(msg.voltage_battery, bytes, offset + 14); + bitconverter.GetBytes(msg.current_battery, bytes, offset + 16); + bitconverter.GetBytes(msg.drop_rate_comm, bytes, offset + 18); + bitconverter.GetBytes(msg.errors_comm, bytes, offset + 20); + bitconverter.GetBytes(msg.errors_count1, bytes, offset + 22); + bitconverter.GetBytes(msg.errors_count2, bytes, offset + 24); + bitconverter.GetBytes(msg.errors_count3, bytes, offset + 26); + bitconverter.GetBytes(msg.errors_count4, bytes, offset + 28); + bytes[offset + 30] = unchecked((byte)msg.battery_remaining); + offset += 31; + return 1; + } + + internal static int Serialize_SYSTEM_TIME(this Msg_system_time msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_unix_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 8); + offset += 12; + return 2; + } + + internal static int Serialize_PING(this Msg_ping msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.seq, bytes, offset + 8); + bytes[offset + 12] = msg.target_system; + bytes[offset + 13] = msg.target_component; + offset += 14; + return 4; + } + + internal static int Serialize_CHANGE_OPERATOR_CONTROL(this Msg_change_operator_control msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.control_request; + bytes[offset + 2] = msg.version; + ByteArrayUtil.ToByteArray(msg.passkey, bytes, offset + 3, 25); + offset += 28; + return 5; + } + + internal static int Serialize_CHANGE_OPERATOR_CONTROL_ACK(this Msg_change_operator_control_ack msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.gcs_system_id; + bytes[offset + 1] = msg.control_request; + bytes[offset + 2] = msg.ack; + offset += 3; + return 6; + } + + internal static int Serialize_AUTH_KEY(this Msg_auth_key msg, byte[] bytes, ref int offset) + { + ByteArrayUtil.ToByteArray(msg.key, bytes, offset + 0, 32); + offset += 32; + return 7; + } + + internal static int Serialize_SET_MODE(this Msg_set_mode msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.custom_mode, bytes, offset + 0); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.base_mode; + offset += 6; + return 11; + } + + internal static int Serialize_PARAM_REQUEST_READ(this Msg_param_request_read msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_index, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 4, 16); + offset += 20; + return 20; + } + + internal static int Serialize_PARAM_REQUEST_LIST(this Msg_param_request_list msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 21; + } + + internal static int Serialize_PARAM_VALUE(this Msg_param_value msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_value, bytes, offset + 0); + bitconverter.GetBytes(msg.param_count, bytes, offset + 4); + bitconverter.GetBytes(msg.param_index, bytes, offset + 6); + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 8, 16); + bytes[offset + 24] = msg.param_type; + offset += 25; + return 22; + } + + internal static int Serialize_PARAM_SET(this Msg_param_set msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_value, bytes, offset + 0); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 6, 16); + bytes[offset + 22] = msg.param_type; + offset += 23; + return 23; + } + + internal static int Serialize_GPS_RAW_INT(this Msg_gps_raw_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.alt, bytes, offset + 16); + bitconverter.GetBytes(msg.eph, bytes, offset + 20); + bitconverter.GetBytes(msg.epv, bytes, offset + 22); + bitconverter.GetBytes(msg.vel, bytes, offset + 24); + bitconverter.GetBytes(msg.cog, bytes, offset + 26); + bytes[offset + 28] = msg.fix_type; + bytes[offset + 29] = msg.satellites_visible; + offset += 30; + return 24; + } + + internal static int Serialize_GPS_STATUS(this Msg_gps_status msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.satellites_visible; + ByteArrayUtil.ToByteArray(msg.satellite_prn, bytes, offset + 1, 20); + ByteArrayUtil.ToByteArray(msg.satellite_used, bytes, offset + 21, 20); + ByteArrayUtil.ToByteArray(msg.satellite_elevation, bytes, offset + 41, 20); + ByteArrayUtil.ToByteArray(msg.satellite_azimuth, bytes, offset + 61, 20); + ByteArrayUtil.ToByteArray(msg.satellite_snr, bytes, offset + 81, 20); + offset += 101; + return 25; + } + + internal static int Serialize_SCALED_IMU(this Msg_scaled_imu msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 4); + bitconverter.GetBytes(msg.yacc, bytes, offset + 6); + bitconverter.GetBytes(msg.zacc, bytes, offset + 8); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 10); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 12); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.xmag, bytes, offset + 16); + bitconverter.GetBytes(msg.ymag, bytes, offset + 18); + bitconverter.GetBytes(msg.zmag, bytes, offset + 20); + offset += 22; + return 26; + } + + internal static int Serialize_RAW_IMU(this Msg_raw_imu msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 8); + bitconverter.GetBytes(msg.yacc, bytes, offset + 10); + bitconverter.GetBytes(msg.zacc, bytes, offset + 12); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 16); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 18); + bitconverter.GetBytes(msg.xmag, bytes, offset + 20); + bitconverter.GetBytes(msg.ymag, bytes, offset + 22); + bitconverter.GetBytes(msg.zmag, bytes, offset + 24); + offset += 26; + return 27; + } + + internal static int Serialize_RAW_PRESSURE(this Msg_raw_pressure msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 8); + bitconverter.GetBytes(msg.press_diff1, bytes, offset + 10); + bitconverter.GetBytes(msg.press_diff2, bytes, offset + 12); + bitconverter.GetBytes(msg.temperature, bytes, offset + 14); + offset += 16; + return 28; + } + + internal static int Serialize_SCALED_PRESSURE(this Msg_scaled_pressure msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 4); + bitconverter.GetBytes(msg.press_diff, bytes, offset + 8); + bitconverter.GetBytes(msg.temperature, bytes, offset + 12); + offset += 14; + return 29; + } + + internal static int Serialize_ATTITUDE(this Msg_attitude msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.roll, bytes, offset + 4); + bitconverter.GetBytes(msg.pitch, bytes, offset + 8); + bitconverter.GetBytes(msg.yaw, bytes, offset + 12); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 16); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 24); + offset += 28; + return 30; + } + + internal static int Serialize_ATTITUDE_QUATERNION(this Msg_attitude_quaternion msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.q1, bytes, offset + 4); + bitconverter.GetBytes(msg.q2, bytes, offset + 8); + bitconverter.GetBytes(msg.q3, bytes, offset + 12); + bitconverter.GetBytes(msg.q4, bytes, offset + 16); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 28); + offset += 32; + return 31; + } + + internal static int Serialize_LOCAL_POSITION_NED(this Msg_local_position_ned msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + offset += 28; + return 32; + } + + internal static int Serialize_GLOBAL_POSITION_INT(this Msg_global_position_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 4); + bitconverter.GetBytes(msg.lon, bytes, offset + 8); + bitconverter.GetBytes(msg.alt, bytes, offset + 12); + bitconverter.GetBytes(msg.relative_alt, bytes, offset + 16); + bitconverter.GetBytes(msg.vx, bytes, offset + 20); + bitconverter.GetBytes(msg.vy, bytes, offset + 22); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.hdg, bytes, offset + 26); + offset += 28; + return 33; + } + + internal static int Serialize_RC_CHANNELS_SCALED(this Msg_rc_channels_scaled msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_scaled, bytes, offset + 4); + bitconverter.GetBytes(msg.chan2_scaled, bytes, offset + 6); + bitconverter.GetBytes(msg.chan3_scaled, bytes, offset + 8); + bitconverter.GetBytes(msg.chan4_scaled, bytes, offset + 10); + bitconverter.GetBytes(msg.chan5_scaled, bytes, offset + 12); + bitconverter.GetBytes(msg.chan6_scaled, bytes, offset + 14); + bitconverter.GetBytes(msg.chan7_scaled, bytes, offset + 16); + bitconverter.GetBytes(msg.chan8_scaled, bytes, offset + 18); + bytes[offset + 20] = msg.port; + bytes[offset + 21] = msg.rssi; + offset += 22; + return 34; + } + + internal static int Serialize_RC_CHANNELS_RAW(this Msg_rc_channels_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 18); + bytes[offset + 20] = msg.port; + bytes[offset + 21] = msg.rssi; + offset += 22; + return 35; + } + + internal static int Serialize_SERVO_OUTPUT_RAW(this Msg_servo_output_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.servo1_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.servo2_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.servo3_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.servo4_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.servo5_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.servo6_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.servo7_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.servo8_raw, bytes, offset + 18); + bytes[offset + 20] = msg.port; + offset += 21; + return 36; + } + + internal static int Serialize_MISSION_REQUEST_PARTIAL_LIST(this Msg_mission_request_partial_list msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.start_index, bytes, offset + 0); + bitconverter.GetBytes(msg.end_index, bytes, offset + 2); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + offset += 6; + return 37; + } + + internal static int Serialize_MISSION_WRITE_PARTIAL_LIST(this Msg_mission_write_partial_list msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.start_index, bytes, offset + 0); + bitconverter.GetBytes(msg.end_index, bytes, offset + 2); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + offset += 6; + return 38; + } + + internal static int Serialize_MISSION_ITEM(this Msg_mission_item msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.x, bytes, offset + 16); + bitconverter.GetBytes(msg.y, bytes, offset + 20); + bitconverter.GetBytes(msg.z, bytes, offset + 24); + bitconverter.GetBytes(msg.seq, bytes, offset + 28); + bitconverter.GetBytes(msg.command, bytes, offset + 30); + bytes[offset + 32] = msg.target_system; + bytes[offset + 33] = msg.target_component; + bytes[offset + 34] = msg.frame; + bytes[offset + 35] = msg.current; + bytes[offset + 36] = msg.autocontinue; + offset += 37; + return 39; + } + + internal static int Serialize_MISSION_REQUEST(this Msg_mission_request msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 40; + } + + internal static int Serialize_MISSION_SET_CURRENT(this Msg_mission_set_current msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 41; + } + + internal static int Serialize_MISSION_CURRENT(this Msg_mission_current msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + offset += 2; + return 42; + } + + internal static int Serialize_MISSION_REQUEST_LIST(this Msg_mission_request_list msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 43; + } + + internal static int Serialize_MISSION_COUNT(this Msg_mission_count msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.count, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 44; + } + + internal static int Serialize_MISSION_CLEAR_ALL(this Msg_mission_clear_all msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 45; + } + + internal static int Serialize_MISSION_ITEM_REACHED(this Msg_mission_item_reached msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + offset += 2; + return 46; + } + + internal static int Serialize_MISSION_ACK(this Msg_mission_ack msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + bytes[offset + 2] = msg.type; + offset += 3; + return 47; + } + + internal static int Serialize_SET_GPS_GLOBAL_ORIGIN(this Msg_set_gps_global_origin msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + bytes[offset + 12] = msg.target_system; + offset += 13; + return 48; + } + + internal static int Serialize_GPS_GLOBAL_ORIGIN(this Msg_gps_global_origin msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + offset += 12; + return 49; + } + + internal static int Serialize_PARAM_MAP_RC(this Msg_param_map_rc msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param_value0, bytes, offset + 0); + bitconverter.GetBytes(msg.scale, bytes, offset + 4); + bitconverter.GetBytes(msg.param_value_min, bytes, offset + 8); + bitconverter.GetBytes(msg.param_value_max, bytes, offset + 12); + bitconverter.GetBytes(msg.param_index, bytes, offset + 16); + bytes[offset + 18] = msg.target_system; + bytes[offset + 19] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.param_id, bytes, offset + 20, 16); + bytes[offset + 36] = msg.parameter_rc_channel_index; + offset += 37; + return 50; + } + + internal static int Serialize_MISSION_REQUEST_INT(this Msg_mission_request_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seq, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + offset += 4; + return 51; + } + + internal static int Serialize_SAFETY_SET_ALLOWED_AREA(this Msg_safety_set_allowed_area msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.p1x, bytes, offset + 0); + bitconverter.GetBytes(msg.p1y, bytes, offset + 4); + bitconverter.GetBytes(msg.p1z, bytes, offset + 8); + bitconverter.GetBytes(msg.p2x, bytes, offset + 12); + bitconverter.GetBytes(msg.p2y, bytes, offset + 16); + bitconverter.GetBytes(msg.p2z, bytes, offset + 20); + bytes[offset + 24] = msg.target_system; + bytes[offset + 25] = msg.target_component; + bytes[offset + 26] = msg.frame; + offset += 27; + return 54; + } + + internal static int Serialize_SAFETY_ALLOWED_AREA(this Msg_safety_allowed_area msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.p1x, bytes, offset + 0); + bitconverter.GetBytes(msg.p1y, bytes, offset + 4); + bitconverter.GetBytes(msg.p1z, bytes, offset + 8); + bitconverter.GetBytes(msg.p2x, bytes, offset + 12); + bitconverter.GetBytes(msg.p2y, bytes, offset + 16); + bitconverter.GetBytes(msg.p2z, bytes, offset + 20); + bytes[offset + 24] = msg.frame; + offset += 25; + return 55; + } + + internal static int Serialize_ATTITUDE_QUATERNION_COV(this Msg_attitude_quaternion_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 4, 4); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 28); + ByteArrayUtil.ToByteArray(msg.covariance, bytes, offset + 32, 9); + offset += 68; + return 61; + } + + internal static int Serialize_NAV_CONTROLLER_OUTPUT(this Msg_nav_controller_output msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.nav_roll, bytes, offset + 0); + bitconverter.GetBytes(msg.nav_pitch, bytes, offset + 4); + bitconverter.GetBytes(msg.alt_error, bytes, offset + 8); + bitconverter.GetBytes(msg.aspd_error, bytes, offset + 12); + bitconverter.GetBytes(msg.xtrack_error, bytes, offset + 16); + bitconverter.GetBytes(msg.nav_bearing, bytes, offset + 20); + bitconverter.GetBytes(msg.target_bearing, bytes, offset + 22); + bitconverter.GetBytes(msg.wp_dist, bytes, offset + 24); + offset += 26; + return 62; + } + + internal static int Serialize_GLOBAL_POSITION_INT_COV(this Msg_global_position_int_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_utc, bytes, offset + 0); + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 8); + bitconverter.GetBytes(msg.lat, bytes, offset + 12); + bitconverter.GetBytes(msg.lon, bytes, offset + 16); + bitconverter.GetBytes(msg.alt, bytes, offset + 20); + bitconverter.GetBytes(msg.relative_alt, bytes, offset + 24); + bitconverter.GetBytes(msg.vx, bytes, offset + 28); + bitconverter.GetBytes(msg.vy, bytes, offset + 32); + bitconverter.GetBytes(msg.vz, bytes, offset + 36); + ByteArrayUtil.ToByteArray(msg.covariance, bytes, offset + 40, 36); + bytes[offset + 184] = msg.estimator_type; + offset += 185; + return 63; + } + + internal static int Serialize_LOCAL_POSITION_NED_COV(this Msg_local_position_ned_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_utc, bytes, offset + 0); + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 8); + bitconverter.GetBytes(msg.x, bytes, offset + 12); + bitconverter.GetBytes(msg.y, bytes, offset + 16); + bitconverter.GetBytes(msg.z, bytes, offset + 20); + bitconverter.GetBytes(msg.vx, bytes, offset + 24); + bitconverter.GetBytes(msg.vy, bytes, offset + 28); + bitconverter.GetBytes(msg.vz, bytes, offset + 32); + bitconverter.GetBytes(msg.ax, bytes, offset + 36); + bitconverter.GetBytes(msg.ay, bytes, offset + 40); + bitconverter.GetBytes(msg.az, bytes, offset + 44); + ByteArrayUtil.ToByteArray(msg.covariance, bytes, offset + 48, 45); + bytes[offset + 228] = msg.estimator_type; + offset += 229; + return 64; + } + + internal static int Serialize_RC_CHANNELS(this Msg_rc_channels msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 18); + bitconverter.GetBytes(msg.chan9_raw, bytes, offset + 20); + bitconverter.GetBytes(msg.chan10_raw, bytes, offset + 22); + bitconverter.GetBytes(msg.chan11_raw, bytes, offset + 24); + bitconverter.GetBytes(msg.chan12_raw, bytes, offset + 26); + bitconverter.GetBytes(msg.chan13_raw, bytes, offset + 28); + bitconverter.GetBytes(msg.chan14_raw, bytes, offset + 30); + bitconverter.GetBytes(msg.chan15_raw, bytes, offset + 32); + bitconverter.GetBytes(msg.chan16_raw, bytes, offset + 34); + bitconverter.GetBytes(msg.chan17_raw, bytes, offset + 36); + bitconverter.GetBytes(msg.chan18_raw, bytes, offset + 38); + bytes[offset + 40] = msg.chancount; + bytes[offset + 41] = msg.rssi; + offset += 42; + return 65; + } + + internal static int Serialize_REQUEST_DATA_STREAM(this Msg_request_data_stream msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.req_message_rate, bytes, offset + 0); + bytes[offset + 2] = msg.target_system; + bytes[offset + 3] = msg.target_component; + bytes[offset + 4] = msg.req_stream_id; + bytes[offset + 5] = msg.start_stop; + offset += 6; + return 66; + } + + internal static int Serialize_DATA_STREAM(this Msg_data_stream msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.message_rate, bytes, offset + 0); + bytes[offset + 2] = msg.stream_id; + bytes[offset + 3] = msg.on_off; + offset += 4; + return 67; + } + + internal static int Serialize_MANUAL_CONTROL(this Msg_manual_control msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.x, bytes, offset + 0); + bitconverter.GetBytes(msg.y, bytes, offset + 2); + bitconverter.GetBytes(msg.z, bytes, offset + 4); + bitconverter.GetBytes(msg.r, bytes, offset + 6); + bitconverter.GetBytes(msg.buttons, bytes, offset + 8); + bytes[offset + 10] = msg.target; + offset += 11; + return 69; + } + + internal static int Serialize_RC_CHANNELS_OVERRIDE(this Msg_rc_channels_override msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 0); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 2); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 4); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 6); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 14); + bytes[offset + 16] = msg.target_system; + bytes[offset + 17] = msg.target_component; + offset += 18; + return 70; + } + + internal static int Serialize_MISSION_ITEM_INT(this Msg_mission_item_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.x, bytes, offset + 16); + bitconverter.GetBytes(msg.y, bytes, offset + 20); + bitconverter.GetBytes(msg.z, bytes, offset + 24); + bitconverter.GetBytes(msg.seq, bytes, offset + 28); + bitconverter.GetBytes(msg.command, bytes, offset + 30); + bytes[offset + 32] = msg.target_system; + bytes[offset + 33] = msg.target_component; + bytes[offset + 34] = msg.frame; + bytes[offset + 35] = msg.current; + bytes[offset + 36] = msg.autocontinue; + offset += 37; + return 73; + } + + internal static int Serialize_VFR_HUD(this Msg_vfr_hud msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.airspeed, bytes, offset + 0); + bitconverter.GetBytes(msg.groundspeed, bytes, offset + 4); + bitconverter.GetBytes(msg.alt, bytes, offset + 8); + bitconverter.GetBytes(msg.climb, bytes, offset + 12); + bitconverter.GetBytes(msg.heading, bytes, offset + 16); + bitconverter.GetBytes(msg.throttle, bytes, offset + 18); + offset += 20; + return 74; + } + + internal static int Serialize_COMMAND_INT(this Msg_command_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.x, bytes, offset + 16); + bitconverter.GetBytes(msg.y, bytes, offset + 20); + bitconverter.GetBytes(msg.z, bytes, offset + 24); + bitconverter.GetBytes(msg.command, bytes, offset + 28); + bytes[offset + 30] = msg.target_system; + bytes[offset + 31] = msg.target_component; + bytes[offset + 32] = msg.frame; + bytes[offset + 33] = msg.current; + bytes[offset + 34] = msg.autocontinue; + offset += 35; + return 75; + } + + internal static int Serialize_COMMAND_LONG(this Msg_command_long msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.param1, bytes, offset + 0); + bitconverter.GetBytes(msg.param2, bytes, offset + 4); + bitconverter.GetBytes(msg.param3, bytes, offset + 8); + bitconverter.GetBytes(msg.param4, bytes, offset + 12); + bitconverter.GetBytes(msg.param5, bytes, offset + 16); + bitconverter.GetBytes(msg.param6, bytes, offset + 20); + bitconverter.GetBytes(msg.param7, bytes, offset + 24); + bitconverter.GetBytes(msg.command, bytes, offset + 28); + bytes[offset + 30] = msg.target_system; + bytes[offset + 31] = msg.target_component; + bytes[offset + 32] = msg.confirmation; + offset += 33; + return 76; + } + + internal static int Serialize_COMMAND_ACK(this Msg_command_ack msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.command, bytes, offset + 0); + bytes[offset + 2] = msg.result; + offset += 3; + return 77; + } + + internal static int Serialize_MANUAL_SETPOINT(this Msg_manual_setpoint msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.roll, bytes, offset + 4); + bitconverter.GetBytes(msg.pitch, bytes, offset + 8); + bitconverter.GetBytes(msg.yaw, bytes, offset + 12); + bitconverter.GetBytes(msg.thrust, bytes, offset + 16); + bytes[offset + 20] = msg.mode_switch; + bytes[offset + 21] = msg.manual_override_switch; + offset += 22; + return 81; + } + + internal static int Serialize_SET_ATTITUDE_TARGET(this Msg_set_attitude_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 4, 4); + bitconverter.GetBytes(msg.body_roll_rate, bytes, offset + 20); + bitconverter.GetBytes(msg.body_pitch_rate, bytes, offset + 24); + bitconverter.GetBytes(msg.body_yaw_rate, bytes, offset + 28); + bitconverter.GetBytes(msg.thrust, bytes, offset + 32); + bytes[offset + 36] = msg.target_system; + bytes[offset + 37] = msg.target_component; + bytes[offset + 38] = msg.type_mask; + offset += 39; + return 82; + } + + internal static int Serialize_ATTITUDE_TARGET(this Msg_attitude_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 4, 4); + bitconverter.GetBytes(msg.body_roll_rate, bytes, offset + 20); + bitconverter.GetBytes(msg.body_pitch_rate, bytes, offset + 24); + bitconverter.GetBytes(msg.body_yaw_rate, bytes, offset + 28); + bitconverter.GetBytes(msg.thrust, bytes, offset + 32); + bytes[offset + 36] = msg.type_mask; + offset += 37; + return 83; + } + + internal static int Serialize_SET_POSITION_TARGET_LOCAL_NED(this Msg_set_position_target_local_ned msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.target_system; + bytes[offset + 51] = msg.target_component; + bytes[offset + 52] = msg.coordinate_frame; + offset += 53; + return 84; + } + + internal static int Serialize_POSITION_TARGET_LOCAL_NED(this Msg_position_target_local_ned msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.coordinate_frame; + offset += 51; + return 85; + } + + internal static int Serialize_SET_POSITION_TARGET_GLOBAL_INT(this Msg_set_position_target_global_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.lat_int, bytes, offset + 4); + bitconverter.GetBytes(msg.lon_int, bytes, offset + 8); + bitconverter.GetBytes(msg.alt, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.target_system; + bytes[offset + 51] = msg.target_component; + bytes[offset + 52] = msg.coordinate_frame; + offset += 53; + return 86; + } + + internal static int Serialize_POSITION_TARGET_GLOBAL_INT(this Msg_position_target_global_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.lat_int, bytes, offset + 4); + bitconverter.GetBytes(msg.lon_int, bytes, offset + 8); + bitconverter.GetBytes(msg.alt, bytes, offset + 12); + bitconverter.GetBytes(msg.vx, bytes, offset + 16); + bitconverter.GetBytes(msg.vy, bytes, offset + 20); + bitconverter.GetBytes(msg.vz, bytes, offset + 24); + bitconverter.GetBytes(msg.afx, bytes, offset + 28); + bitconverter.GetBytes(msg.afy, bytes, offset + 32); + bitconverter.GetBytes(msg.afz, bytes, offset + 36); + bitconverter.GetBytes(msg.yaw, bytes, offset + 40); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 44); + bitconverter.GetBytes(msg.type_mask, bytes, offset + 48); + bytes[offset + 50] = msg.coordinate_frame; + offset += 51; + return 87; + } + + internal static int Serialize_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(this Msg_local_position_ned_system_global_offset msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 4); + bitconverter.GetBytes(msg.y, bytes, offset + 8); + bitconverter.GetBytes(msg.z, bytes, offset + 12); + bitconverter.GetBytes(msg.roll, bytes, offset + 16); + bitconverter.GetBytes(msg.pitch, bytes, offset + 20); + bitconverter.GetBytes(msg.yaw, bytes, offset + 24); + offset += 28; + return 89; + } + + internal static int Serialize_HIL_STATE(this Msg_hil_state msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.roll, bytes, offset + 8); + bitconverter.GetBytes(msg.pitch, bytes, offset + 12); + bitconverter.GetBytes(msg.yaw, bytes, offset + 16); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 20); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 28); + bitconverter.GetBytes(msg.lat, bytes, offset + 32); + bitconverter.GetBytes(msg.lon, bytes, offset + 36); + bitconverter.GetBytes(msg.alt, bytes, offset + 40); + bitconverter.GetBytes(msg.vx, bytes, offset + 44); + bitconverter.GetBytes(msg.vy, bytes, offset + 46); + bitconverter.GetBytes(msg.vz, bytes, offset + 48); + bitconverter.GetBytes(msg.xacc, bytes, offset + 50); + bitconverter.GetBytes(msg.yacc, bytes, offset + 52); + bitconverter.GetBytes(msg.zacc, bytes, offset + 54); + offset += 56; + return 90; + } + + internal static int Serialize_HIL_CONTROLS(this Msg_hil_controls msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.roll_ailerons, bytes, offset + 8); + bitconverter.GetBytes(msg.pitch_elevator, bytes, offset + 12); + bitconverter.GetBytes(msg.yaw_rudder, bytes, offset + 16); + bitconverter.GetBytes(msg.throttle, bytes, offset + 20); + bitconverter.GetBytes(msg.aux1, bytes, offset + 24); + bitconverter.GetBytes(msg.aux2, bytes, offset + 28); + bitconverter.GetBytes(msg.aux3, bytes, offset + 32); + bitconverter.GetBytes(msg.aux4, bytes, offset + 36); + bytes[offset + 40] = msg.mode; + bytes[offset + 41] = msg.nav_mode; + offset += 42; + return 91; + } + + internal static int Serialize_HIL_RC_INPUTS_RAW(this Msg_hil_rc_inputs_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.chan1_raw, bytes, offset + 8); + bitconverter.GetBytes(msg.chan2_raw, bytes, offset + 10); + bitconverter.GetBytes(msg.chan3_raw, bytes, offset + 12); + bitconverter.GetBytes(msg.chan4_raw, bytes, offset + 14); + bitconverter.GetBytes(msg.chan5_raw, bytes, offset + 16); + bitconverter.GetBytes(msg.chan6_raw, bytes, offset + 18); + bitconverter.GetBytes(msg.chan7_raw, bytes, offset + 20); + bitconverter.GetBytes(msg.chan8_raw, bytes, offset + 22); + bitconverter.GetBytes(msg.chan9_raw, bytes, offset + 24); + bitconverter.GetBytes(msg.chan10_raw, bytes, offset + 26); + bitconverter.GetBytes(msg.chan11_raw, bytes, offset + 28); + bitconverter.GetBytes(msg.chan12_raw, bytes, offset + 30); + bytes[offset + 32] = msg.rssi; + offset += 33; + return 92; + } + + internal static int Serialize_OPTICAL_FLOW(this Msg_optical_flow msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.flow_comp_m_x, bytes, offset + 8); + bitconverter.GetBytes(msg.flow_comp_m_y, bytes, offset + 12); + bitconverter.GetBytes(msg.ground_distance, bytes, offset + 16); + bitconverter.GetBytes(msg.flow_x, bytes, offset + 20); + bitconverter.GetBytes(msg.flow_y, bytes, offset + 22); + bytes[offset + 24] = msg.sensor_id; + bytes[offset + 25] = msg.quality; + offset += 26; + return 100; + } + + internal static int Serialize_GLOBAL_VISION_POSITION_ESTIMATE(this Msg_global_vision_position_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + bitconverter.GetBytes(msg.roll, bytes, offset + 20); + bitconverter.GetBytes(msg.pitch, bytes, offset + 24); + bitconverter.GetBytes(msg.yaw, bytes, offset + 28); + offset += 32; + return 101; + } + + internal static int Serialize_VISION_POSITION_ESTIMATE(this Msg_vision_position_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + bitconverter.GetBytes(msg.roll, bytes, offset + 20); + bitconverter.GetBytes(msg.pitch, bytes, offset + 24); + bitconverter.GetBytes(msg.yaw, bytes, offset + 28); + offset += 32; + return 102; + } + + internal static int Serialize_VISION_SPEED_ESTIMATE(this Msg_vision_speed_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + offset += 20; + return 103; + } + + internal static int Serialize_VICON_POSITION_ESTIMATE(this Msg_vicon_position_estimate msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + bitconverter.GetBytes(msg.roll, bytes, offset + 20); + bitconverter.GetBytes(msg.pitch, bytes, offset + 24); + bitconverter.GetBytes(msg.yaw, bytes, offset + 28); + offset += 32; + return 104; + } + + internal static int Serialize_HIGHRES_IMU(this Msg_highres_imu msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 8); + bitconverter.GetBytes(msg.yacc, bytes, offset + 12); + bitconverter.GetBytes(msg.zacc, bytes, offset + 16); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.xmag, bytes, offset + 32); + bitconverter.GetBytes(msg.ymag, bytes, offset + 36); + bitconverter.GetBytes(msg.zmag, bytes, offset + 40); + bitconverter.GetBytes(msg.abs_pressure, bytes, offset + 44); + bitconverter.GetBytes(msg.diff_pressure, bytes, offset + 48); + bitconverter.GetBytes(msg.pressure_alt, bytes, offset + 52); + bitconverter.GetBytes(msg.temperature, bytes, offset + 56); + bitconverter.GetBytes(msg.fields_updated, bytes, offset + 60); + offset += 62; + return 105; + } + + internal static int Serialize_OPTICAL_FLOW_RAD(this Msg_optical_flow_rad msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.integration_time_us, bytes, offset + 8); + bitconverter.GetBytes(msg.integrated_x, bytes, offset + 12); + bitconverter.GetBytes(msg.integrated_y, bytes, offset + 16); + bitconverter.GetBytes(msg.integrated_xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.integrated_ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.integrated_zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.time_delta_distance_us, bytes, offset + 32); + bitconverter.GetBytes(msg.distance, bytes, offset + 36); + bitconverter.GetBytes(msg.temperature, bytes, offset + 40); + bytes[offset + 42] = msg.sensor_id; + bytes[offset + 43] = msg.quality; + offset += 44; + return 106; + } + + internal static int Serialize_HIL_SENSOR(this Msg_hil_sensor msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 8); + bitconverter.GetBytes(msg.yacc, bytes, offset + 12); + bitconverter.GetBytes(msg.zacc, bytes, offset + 16); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.xmag, bytes, offset + 32); + bitconverter.GetBytes(msg.ymag, bytes, offset + 36); + bitconverter.GetBytes(msg.zmag, bytes, offset + 40); + bitconverter.GetBytes(msg.abs_pressure, bytes, offset + 44); + bitconverter.GetBytes(msg.diff_pressure, bytes, offset + 48); + bitconverter.GetBytes(msg.pressure_alt, bytes, offset + 52); + bitconverter.GetBytes(msg.temperature, bytes, offset + 56); + bitconverter.GetBytes(msg.fields_updated, bytes, offset + 60); + offset += 64; + return 107; + } + + internal static int Serialize_SIM_STATE(this Msg_sim_state msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.q1, bytes, offset + 0); + bitconverter.GetBytes(msg.q2, bytes, offset + 4); + bitconverter.GetBytes(msg.q3, bytes, offset + 8); + bitconverter.GetBytes(msg.q4, bytes, offset + 12); + bitconverter.GetBytes(msg.roll, bytes, offset + 16); + bitconverter.GetBytes(msg.pitch, bytes, offset + 20); + bitconverter.GetBytes(msg.yaw, bytes, offset + 24); + bitconverter.GetBytes(msg.xacc, bytes, offset + 28); + bitconverter.GetBytes(msg.yacc, bytes, offset + 32); + bitconverter.GetBytes(msg.zacc, bytes, offset + 36); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 40); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 44); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 48); + bitconverter.GetBytes(msg.lat, bytes, offset + 52); + bitconverter.GetBytes(msg.lon, bytes, offset + 56); + bitconverter.GetBytes(msg.alt, bytes, offset + 60); + bitconverter.GetBytes(msg.std_dev_horz, bytes, offset + 64); + bitconverter.GetBytes(msg.std_dev_vert, bytes, offset + 68); + bitconverter.GetBytes(msg.vn, bytes, offset + 72); + bitconverter.GetBytes(msg.ve, bytes, offset + 76); + bitconverter.GetBytes(msg.vd, bytes, offset + 80); + offset += 84; + return 108; + } + + internal static int Serialize_RADIO_STATUS(this Msg_radio_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.rxerrors, bytes, offset + 0); + bitconverter.GetBytes(msg.@fixed, bytes, offset + 2); + bytes[offset + 4] = msg.rssi; + bytes[offset + 5] = msg.remrssi; + bytes[offset + 6] = msg.txbuf; + bytes[offset + 7] = msg.noise; + bytes[offset + 8] = msg.remnoise; + offset += 9; + return 109; + } + + internal static int Serialize_FILE_TRANSFER_PROTOCOL(this Msg_file_transfer_protocol msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_network; + bytes[offset + 1] = msg.target_system; + bytes[offset + 2] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.payload, bytes, offset + 3, 251); + offset += 254; + return 110; + } + + internal static int Serialize_TIMESYNC(this Msg_timesync msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.tc1, bytes, offset + 0); + bitconverter.GetBytes(msg.ts1, bytes, offset + 8); + offset += 16; + return 111; + } + + internal static int Serialize_CAMERA_TRIGGER(this Msg_camera_trigger msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.seq, bytes, offset + 8); + offset += 12; + return 112; + } + + internal static int Serialize_HIL_GPS(this Msg_hil_gps msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.alt, bytes, offset + 16); + bitconverter.GetBytes(msg.eph, bytes, offset + 20); + bitconverter.GetBytes(msg.epv, bytes, offset + 22); + bitconverter.GetBytes(msg.vel, bytes, offset + 24); + bitconverter.GetBytes(msg.vn, bytes, offset + 26); + bitconverter.GetBytes(msg.ve, bytes, offset + 28); + bitconverter.GetBytes(msg.vd, bytes, offset + 30); + bitconverter.GetBytes(msg.cog, bytes, offset + 32); + bytes[offset + 34] = msg.fix_type; + bytes[offset + 35] = msg.satellites_visible; + offset += 36; + return 113; + } + + internal static int Serialize_HIL_OPTICAL_FLOW(this Msg_hil_optical_flow msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.integration_time_us, bytes, offset + 8); + bitconverter.GetBytes(msg.integrated_x, bytes, offset + 12); + bitconverter.GetBytes(msg.integrated_y, bytes, offset + 16); + bitconverter.GetBytes(msg.integrated_xgyro, bytes, offset + 20); + bitconverter.GetBytes(msg.integrated_ygyro, bytes, offset + 24); + bitconverter.GetBytes(msg.integrated_zgyro, bytes, offset + 28); + bitconverter.GetBytes(msg.time_delta_distance_us, bytes, offset + 32); + bitconverter.GetBytes(msg.distance, bytes, offset + 36); + bitconverter.GetBytes(msg.temperature, bytes, offset + 40); + bytes[offset + 42] = msg.sensor_id; + bytes[offset + 43] = msg.quality; + offset += 44; + return 114; + } + + internal static int Serialize_HIL_STATE_QUATERNION(this Msg_hil_state_quaternion msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.attitude_quaternion, bytes, offset + 8, 4); + bitconverter.GetBytes(msg.rollspeed, bytes, offset + 24); + bitconverter.GetBytes(msg.pitchspeed, bytes, offset + 28); + bitconverter.GetBytes(msg.yawspeed, bytes, offset + 32); + bitconverter.GetBytes(msg.lat, bytes, offset + 36); + bitconverter.GetBytes(msg.lon, bytes, offset + 40); + bitconverter.GetBytes(msg.alt, bytes, offset + 44); + bitconverter.GetBytes(msg.vx, bytes, offset + 48); + bitconverter.GetBytes(msg.vy, bytes, offset + 50); + bitconverter.GetBytes(msg.vz, bytes, offset + 52); + bitconverter.GetBytes(msg.ind_airspeed, bytes, offset + 54); + bitconverter.GetBytes(msg.true_airspeed, bytes, offset + 56); + bitconverter.GetBytes(msg.xacc, bytes, offset + 58); + bitconverter.GetBytes(msg.yacc, bytes, offset + 60); + bitconverter.GetBytes(msg.zacc, bytes, offset + 62); + offset += 64; + return 115; + } + + internal static int Serialize_SCALED_IMU2(this Msg_scaled_imu2 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 4); + bitconverter.GetBytes(msg.yacc, bytes, offset + 6); + bitconverter.GetBytes(msg.zacc, bytes, offset + 8); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 10); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 12); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.xmag, bytes, offset + 16); + bitconverter.GetBytes(msg.ymag, bytes, offset + 18); + bitconverter.GetBytes(msg.zmag, bytes, offset + 20); + offset += 22; + return 116; + } + + internal static int Serialize_LOG_REQUEST_LIST(this Msg_log_request_list msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.start, bytes, offset + 0); + bitconverter.GetBytes(msg.end, bytes, offset + 2); + bytes[offset + 4] = msg.target_system; + bytes[offset + 5] = msg.target_component; + offset += 6; + return 117; + } + + internal static int Serialize_LOG_ENTRY(this Msg_log_entry msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_utc, bytes, offset + 0); + bitconverter.GetBytes(msg.size, bytes, offset + 4); + bitconverter.GetBytes(msg.id, bytes, offset + 8); + bitconverter.GetBytes(msg.num_logs, bytes, offset + 10); + bitconverter.GetBytes(msg.last_log_num, bytes, offset + 12); + offset += 14; + return 118; + } + + internal static int Serialize_LOG_REQUEST_DATA(this Msg_log_request_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ofs, bytes, offset + 0); + bitconverter.GetBytes(msg.count, bytes, offset + 4); + bitconverter.GetBytes(msg.id, bytes, offset + 8); + bytes[offset + 10] = msg.target_system; + bytes[offset + 11] = msg.target_component; + offset += 12; + return 119; + } + + internal static int Serialize_LOG_DATA(this Msg_log_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ofs, bytes, offset + 0); + bitconverter.GetBytes(msg.id, bytes, offset + 4); + bytes[offset + 6] = msg.count; + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 7, 90); + offset += 97; + return 120; + } + + internal static int Serialize_LOG_ERASE(this Msg_log_erase msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 121; + } + + internal static int Serialize_LOG_REQUEST_END(this Msg_log_request_end msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + offset += 2; + return 122; + } + + internal static int Serialize_GPS_INJECT_DATA(this Msg_gps_inject_data msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.target_system; + bytes[offset + 1] = msg.target_component; + bytes[offset + 2] = msg.len; + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 3, 110); + offset += 113; + return 123; + } + + internal static int Serialize_GPS2_RAW(this Msg_gps2_raw msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.alt, bytes, offset + 16); + bitconverter.GetBytes(msg.dgps_age, bytes, offset + 20); + bitconverter.GetBytes(msg.eph, bytes, offset + 24); + bitconverter.GetBytes(msg.epv, bytes, offset + 26); + bitconverter.GetBytes(msg.vel, bytes, offset + 28); + bitconverter.GetBytes(msg.cog, bytes, offset + 30); + bytes[offset + 32] = msg.fix_type; + bytes[offset + 33] = msg.satellites_visible; + bytes[offset + 34] = msg.dgps_numch; + offset += 35; + return 124; + } + + internal static int Serialize_POWER_STATUS(this Msg_power_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.Vcc, bytes, offset + 0); + bitconverter.GetBytes(msg.Vservo, bytes, offset + 2); + bitconverter.GetBytes(msg.flags, bytes, offset + 4); + offset += 6; + return 125; + } + + internal static int Serialize_SERIAL_CONTROL(this Msg_serial_control msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.baudrate, bytes, offset + 0); + bitconverter.GetBytes(msg.timeout, bytes, offset + 4); + bytes[offset + 6] = msg.device; + bytes[offset + 7] = msg.flags; + bytes[offset + 8] = msg.count; + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 9, 70); + offset += 79; + return 126; + } + + internal static int Serialize_GPS_RTK(this Msg_gps_rtk msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_last_baseline_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.tow, bytes, offset + 4); + bitconverter.GetBytes(msg.baseline_a_mm, bytes, offset + 8); + bitconverter.GetBytes(msg.baseline_b_mm, bytes, offset + 12); + bitconverter.GetBytes(msg.baseline_c_mm, bytes, offset + 16); + bitconverter.GetBytes(msg.accuracy, bytes, offset + 20); + bitconverter.GetBytes(msg.iar_num_hypotheses, bytes, offset + 24); + bitconverter.GetBytes(msg.wn, bytes, offset + 28); + bytes[offset + 30] = msg.rtk_receiver_id; + bytes[offset + 31] = msg.rtk_health; + bytes[offset + 32] = msg.rtk_rate; + bytes[offset + 33] = msg.nsats; + bytes[offset + 34] = msg.baseline_coords_type; + offset += 35; + return 127; + } + + internal static int Serialize_GPS2_RTK(this Msg_gps2_rtk msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_last_baseline_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.tow, bytes, offset + 4); + bitconverter.GetBytes(msg.baseline_a_mm, bytes, offset + 8); + bitconverter.GetBytes(msg.baseline_b_mm, bytes, offset + 12); + bitconverter.GetBytes(msg.baseline_c_mm, bytes, offset + 16); + bitconverter.GetBytes(msg.accuracy, bytes, offset + 20); + bitconverter.GetBytes(msg.iar_num_hypotheses, bytes, offset + 24); + bitconverter.GetBytes(msg.wn, bytes, offset + 28); + bytes[offset + 30] = msg.rtk_receiver_id; + bytes[offset + 31] = msg.rtk_health; + bytes[offset + 32] = msg.rtk_rate; + bytes[offset + 33] = msg.nsats; + bytes[offset + 34] = msg.baseline_coords_type; + offset += 35; + return 128; + } + + internal static int Serialize_SCALED_IMU3(this Msg_scaled_imu3 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.xacc, bytes, offset + 4); + bitconverter.GetBytes(msg.yacc, bytes, offset + 6); + bitconverter.GetBytes(msg.zacc, bytes, offset + 8); + bitconverter.GetBytes(msg.xgyro, bytes, offset + 10); + bitconverter.GetBytes(msg.ygyro, bytes, offset + 12); + bitconverter.GetBytes(msg.zgyro, bytes, offset + 14); + bitconverter.GetBytes(msg.xmag, bytes, offset + 16); + bitconverter.GetBytes(msg.ymag, bytes, offset + 18); + bitconverter.GetBytes(msg.zmag, bytes, offset + 20); + offset += 22; + return 129; + } + + internal static int Serialize_DATA_TRANSMISSION_HANDSHAKE(this Msg_data_transmission_handshake msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.size, bytes, offset + 0); + bitconverter.GetBytes(msg.width, bytes, offset + 4); + bitconverter.GetBytes(msg.height, bytes, offset + 6); + bitconverter.GetBytes(msg.packets, bytes, offset + 8); + bytes[offset + 10] = msg.type; + bytes[offset + 11] = msg.payload; + bytes[offset + 12] = msg.jpg_quality; + offset += 13; + return 130; + } + + internal static int Serialize_ENCAPSULATED_DATA(this Msg_encapsulated_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.seqnr, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 2, 253); + offset += 255; + return 131; + } + + internal static int Serialize_DISTANCE_SENSOR(this Msg_distance_sensor msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.min_distance, bytes, offset + 4); + bitconverter.GetBytes(msg.max_distance, bytes, offset + 6); + bitconverter.GetBytes(msg.current_distance, bytes, offset + 8); + bytes[offset + 10] = msg.type; + bytes[offset + 11] = msg.id; + bytes[offset + 12] = msg.orientation; + bytes[offset + 13] = msg.covariance; + offset += 14; + return 132; + } + + internal static int Serialize_TERRAIN_REQUEST(this Msg_terrain_request msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.mask, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 8); + bitconverter.GetBytes(msg.lon, bytes, offset + 12); + bitconverter.GetBytes(msg.grid_spacing, bytes, offset + 16); + offset += 18; + return 133; + } + + internal static int Serialize_TERRAIN_DATA(this Msg_terrain_data msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.lat, bytes, offset + 0); + bitconverter.GetBytes(msg.lon, bytes, offset + 4); + bitconverter.GetBytes(msg.grid_spacing, bytes, offset + 8); + ByteArrayUtil.ToByteArray(msg.data, bytes, offset + 10, 16); + bytes[offset + 42] = msg.gridbit; + offset += 43; + return 134; + } + + internal static int Serialize_TERRAIN_CHECK(this Msg_terrain_check msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.lat, bytes, offset + 0); + bitconverter.GetBytes(msg.lon, bytes, offset + 4); + offset += 8; + return 135; + } + + internal static int Serialize_TERRAIN_REPORT(this Msg_terrain_report msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.lat, bytes, offset + 0); + bitconverter.GetBytes(msg.lon, bytes, offset + 4); + bitconverter.GetBytes(msg.terrain_height, bytes, offset + 8); + bitconverter.GetBytes(msg.current_height, bytes, offset + 12); + bitconverter.GetBytes(msg.spacing, bytes, offset + 16); + bitconverter.GetBytes(msg.pending, bytes, offset + 18); + bitconverter.GetBytes(msg.loaded, bytes, offset + 20); + offset += 22; + return 136; + } + + internal static int Serialize_SCALED_PRESSURE2(this Msg_scaled_pressure2 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 4); + bitconverter.GetBytes(msg.press_diff, bytes, offset + 8); + bitconverter.GetBytes(msg.temperature, bytes, offset + 12); + offset += 14; + return 137; + } + + internal static int Serialize_ATT_POS_MOCAP(this Msg_att_pos_mocap msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 8, 4); + bitconverter.GetBytes(msg.x, bytes, offset + 24); + bitconverter.GetBytes(msg.y, bytes, offset + 28); + bitconverter.GetBytes(msg.z, bytes, offset + 32); + offset += 36; + return 138; + } + + internal static int Serialize_SET_ACTUATOR_CONTROL_TARGET(this Msg_set_actuator_control_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.controls, bytes, offset + 8, 8); + bytes[offset + 40] = msg.group_mlx; + bytes[offset + 41] = msg.target_system; + bytes[offset + 42] = msg.target_component; + offset += 43; + return 139; + } + + internal static int Serialize_ACTUATOR_CONTROL_TARGET(this Msg_actuator_control_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + ByteArrayUtil.ToByteArray(msg.controls, bytes, offset + 8, 8); + bytes[offset + 40] = msg.group_mlx; + offset += 41; + return 140; + } + + internal static int Serialize_ALTITUDE(this Msg_altitude msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.altitude_monotonic, bytes, offset + 8); + bitconverter.GetBytes(msg.altitude_amsl, bytes, offset + 12); + bitconverter.GetBytes(msg.altitude_local, bytes, offset + 16); + bitconverter.GetBytes(msg.altitude_relative, bytes, offset + 20); + bitconverter.GetBytes(msg.altitude_terrain, bytes, offset + 24); + bitconverter.GetBytes(msg.bottom_clearance, bytes, offset + 28); + offset += 32; + return 141; + } + + internal static int Serialize_RESOURCE_REQUEST(this Msg_resource_request msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.request_id; + bytes[offset + 1] = msg.uri_type; + ByteArrayUtil.ToByteArray(msg.uri, bytes, offset + 2, 120); + bytes[offset + 122] = msg.transfer_type; + ByteArrayUtil.ToByteArray(msg.storage, bytes, offset + 123, 120); + offset += 243; + return 142; + } + + internal static int Serialize_SCALED_PRESSURE3(this Msg_scaled_pressure3 msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.press_abs, bytes, offset + 4); + bitconverter.GetBytes(msg.press_diff, bytes, offset + 8); + bitconverter.GetBytes(msg.temperature, bytes, offset + 12); + offset += 14; + return 143; + } + + internal static int Serialize_FOLLOW_TARGET(this Msg_follow_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.timestamp, bytes, offset + 0); + bitconverter.GetBytes(msg.custom_state, bytes, offset + 8); + bitconverter.GetBytes(msg.lat, bytes, offset + 16); + bitconverter.GetBytes(msg.lon, bytes, offset + 20); + bitconverter.GetBytes(msg.alt, bytes, offset + 24); + ByteArrayUtil.ToByteArray(msg.vel, bytes, offset + 28, 3); + ByteArrayUtil.ToByteArray(msg.acc, bytes, offset + 40, 3); + ByteArrayUtil.ToByteArray(msg.attitude_q, bytes, offset + 52, 4); + ByteArrayUtil.ToByteArray(msg.rates, bytes, offset + 68, 3); + ByteArrayUtil.ToByteArray(msg.position_cov, bytes, offset + 80, 3); + bytes[offset + 92] = msg.est_capabilities; + offset += 93; + return 144; + } + + internal static int Serialize_CONTROL_SYSTEM_STATE(this Msg_control_system_state msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x_acc, bytes, offset + 8); + bitconverter.GetBytes(msg.y_acc, bytes, offset + 12); + bitconverter.GetBytes(msg.z_acc, bytes, offset + 16); + bitconverter.GetBytes(msg.x_vel, bytes, offset + 20); + bitconverter.GetBytes(msg.y_vel, bytes, offset + 24); + bitconverter.GetBytes(msg.z_vel, bytes, offset + 28); + bitconverter.GetBytes(msg.x_pos, bytes, offset + 32); + bitconverter.GetBytes(msg.y_pos, bytes, offset + 36); + bitconverter.GetBytes(msg.z_pos, bytes, offset + 40); + bitconverter.GetBytes(msg.airspeed, bytes, offset + 44); + ByteArrayUtil.ToByteArray(msg.vel_variance, bytes, offset + 48, 3); + ByteArrayUtil.ToByteArray(msg.pos_variance, bytes, offset + 60, 3); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 72, 4); + bitconverter.GetBytes(msg.roll_rate, bytes, offset + 88); + bitconverter.GetBytes(msg.pitch_rate, bytes, offset + 92); + bitconverter.GetBytes(msg.yaw_rate, bytes, offset + 96); + offset += 100; + return 146; + } + + internal static int Serialize_BATTERY_STATUS(this Msg_battery_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.current_consumed, bytes, offset + 0); + bitconverter.GetBytes(msg.energy_consumed, bytes, offset + 4); + bitconverter.GetBytes(msg.temperature, bytes, offset + 8); + ByteArrayUtil.ToByteArray(msg.voltages, bytes, offset + 10, 10); + bitconverter.GetBytes(msg.current_battery, bytes, offset + 30); + bytes[offset + 32] = msg.id; + bytes[offset + 33] = msg.battery_function; + bytes[offset + 34] = msg.type; + bytes[offset + 35] = unchecked((byte)msg.battery_remaining); + offset += 36; + return 147; + } + + internal static int Serialize_AUTOPILOT_VERSION(this Msg_autopilot_version msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.capabilities, bytes, offset + 0); + bitconverter.GetBytes(msg.uid, bytes, offset + 8); + bitconverter.GetBytes(msg.flight_sw_version, bytes, offset + 16); + bitconverter.GetBytes(msg.middleware_sw_version, bytes, offset + 20); + bitconverter.GetBytes(msg.os_sw_version, bytes, offset + 24); + bitconverter.GetBytes(msg.board_version, bytes, offset + 28); + bitconverter.GetBytes(msg.vendor_id, bytes, offset + 32); + bitconverter.GetBytes(msg.product_id, bytes, offset + 34); + ByteArrayUtil.ToByteArray(msg.flight_custom_version, bytes, offset + 36, 8); + ByteArrayUtil.ToByteArray(msg.middleware_custom_version, bytes, offset + 44, 8); + ByteArrayUtil.ToByteArray(msg.os_custom_version, bytes, offset + 52, 8); + offset += 60; + return 148; + } + + internal static int Serialize_LANDING_TARGET(this Msg_landing_target msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.angle_x, bytes, offset + 8); + bitconverter.GetBytes(msg.angle_y, bytes, offset + 12); + bitconverter.GetBytes(msg.distance, bytes, offset + 16); + bitconverter.GetBytes(msg.size_x, bytes, offset + 20); + bitconverter.GetBytes(msg.size_y, bytes, offset + 24); + bytes[offset + 28] = msg.target_num; + bytes[offset + 29] = msg.frame; + offset += 30; + return 149; + } + + internal static int Serialize_ESTIMATOR_STATUS(this Msg_estimator_status msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.vel_ratio, bytes, offset + 8); + bitconverter.GetBytes(msg.pos_horiz_ratio, bytes, offset + 12); + bitconverter.GetBytes(msg.pos_vert_ratio, bytes, offset + 16); + bitconverter.GetBytes(msg.mag_ratio, bytes, offset + 20); + bitconverter.GetBytes(msg.hagl_ratio, bytes, offset + 24); + bitconverter.GetBytes(msg.tas_ratio, bytes, offset + 28); + bitconverter.GetBytes(msg.pos_horiz_accuracy, bytes, offset + 32); + bitconverter.GetBytes(msg.pos_vert_accuracy, bytes, offset + 36); + bitconverter.GetBytes(msg.flags, bytes, offset + 40); + offset += 42; + return 230; + } + + internal static int Serialize_WIND_COV(this Msg_wind_cov msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.wind_x, bytes, offset + 8); + bitconverter.GetBytes(msg.wind_y, bytes, offset + 12); + bitconverter.GetBytes(msg.wind_z, bytes, offset + 16); + bitconverter.GetBytes(msg.var_horiz, bytes, offset + 20); + bitconverter.GetBytes(msg.var_vert, bytes, offset + 24); + bitconverter.GetBytes(msg.wind_alt, bytes, offset + 28); + bitconverter.GetBytes(msg.horiz_accuracy, bytes, offset + 32); + bitconverter.GetBytes(msg.vert_accuracy, bytes, offset + 36); + offset += 40; + return 231; + } + + internal static int Serialize_VIBRATION(this Msg_vibration msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.vibration_x, bytes, offset + 8); + bitconverter.GetBytes(msg.vibration_y, bytes, offset + 12); + bitconverter.GetBytes(msg.vibration_z, bytes, offset + 16); + bitconverter.GetBytes(msg.clipping_0, bytes, offset + 20); + bitconverter.GetBytes(msg.clipping_1, bytes, offset + 24); + bitconverter.GetBytes(msg.clipping_2, bytes, offset + 28); + offset += 32; + return 241; + } + + internal static int Serialize_HOME_POSITION(this Msg_home_position msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + bitconverter.GetBytes(msg.x, bytes, offset + 12); + bitconverter.GetBytes(msg.y, bytes, offset + 16); + bitconverter.GetBytes(msg.z, bytes, offset + 20); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 24, 4); + bitconverter.GetBytes(msg.approach_x, bytes, offset + 40); + bitconverter.GetBytes(msg.approach_y, bytes, offset + 44); + bitconverter.GetBytes(msg.approach_z, bytes, offset + 48); + offset += 52; + return 242; + } + + internal static int Serialize_SET_HOME_POSITION(this Msg_set_home_position msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.latitude, bytes, offset + 0); + bitconverter.GetBytes(msg.longitude, bytes, offset + 4); + bitconverter.GetBytes(msg.altitude, bytes, offset + 8); + bitconverter.GetBytes(msg.x, bytes, offset + 12); + bitconverter.GetBytes(msg.y, bytes, offset + 16); + bitconverter.GetBytes(msg.z, bytes, offset + 20); + ByteArrayUtil.ToByteArray(msg.q, bytes, offset + 24, 4); + bitconverter.GetBytes(msg.approach_x, bytes, offset + 40); + bitconverter.GetBytes(msg.approach_y, bytes, offset + 44); + bitconverter.GetBytes(msg.approach_z, bytes, offset + 48); + bytes[offset + 52] = msg.target_system; + offset += 53; + return 243; + } + + internal static int Serialize_MESSAGE_INTERVAL(this Msg_message_interval msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.interval_us, bytes, offset + 0); + bitconverter.GetBytes(msg.message_id, bytes, offset + 4); + offset += 6; + return 244; + } + + internal static int Serialize_EXTENDED_SYS_STATE(this Msg_extended_sys_state msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.vtol_state; + bytes[offset + 1] = msg.landed_state; + offset += 2; + return 245; + } + + internal static int Serialize_ADSB_VEHICLE(this Msg_adsb_vehicle msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.ICAO_address, bytes, offset + 0); + bitconverter.GetBytes(msg.lat, bytes, offset + 4); + bitconverter.GetBytes(msg.lon, bytes, offset + 8); + bitconverter.GetBytes(msg.altitude, bytes, offset + 12); + bitconverter.GetBytes(msg.heading, bytes, offset + 16); + bitconverter.GetBytes(msg.hor_velocity, bytes, offset + 18); + bitconverter.GetBytes(msg.ver_velocity, bytes, offset + 20); + bitconverter.GetBytes(msg.flags, bytes, offset + 22); + bitconverter.GetBytes(msg.squawk, bytes, offset + 24); + bytes[offset + 26] = msg.altitude_type; + ByteArrayUtil.ToByteArray(msg.callsign, bytes, offset + 27, 9); + bytes[offset + 36] = msg.emitter_type; + bytes[offset + 37] = msg.tslc; + offset += 38; + return 246; + } + + internal static int Serialize_V2_EXTENSION(this Msg_v2_extension msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.message_type, bytes, offset + 0); + bytes[offset + 2] = msg.target_network; + bytes[offset + 3] = msg.target_system; + bytes[offset + 4] = msg.target_component; + ByteArrayUtil.ToByteArray(msg.payload, bytes, offset + 5, 249); + offset += 254; + return 248; + } + + internal static int Serialize_MEMORY_VECT(this Msg_memory_vect msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.address, bytes, offset + 0); + bytes[offset + 2] = msg.ver; + bytes[offset + 3] = msg.type; + ByteArrayUtil.ToByteArray(msg.value, bytes, offset + 4, 32); + offset += 36; + return 249; + } + + internal static int Serialize_DEBUG_VECT(this Msg_debug_vect msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_usec, bytes, offset + 0); + bitconverter.GetBytes(msg.x, bytes, offset + 8); + bitconverter.GetBytes(msg.y, bytes, offset + 12); + bitconverter.GetBytes(msg.z, bytes, offset + 16); + ByteArrayUtil.ToByteArray(msg.name, bytes, offset + 20, 10); + offset += 30; + return 250; + } + + internal static int Serialize_NAMED_VALUE_FLOAT(this Msg_named_value_float msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.value, bytes, offset + 4); + ByteArrayUtil.ToByteArray(msg.name, bytes, offset + 8, 10); + offset += 18; + return 251; + } + + internal static int Serialize_NAMED_VALUE_INT(this Msg_named_value_int msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.value, bytes, offset + 4); + ByteArrayUtil.ToByteArray(msg.name, bytes, offset + 8, 10); + offset += 18; + return 252; + } + + internal static int Serialize_STATUSTEXT(this Msg_statustext msg, byte[] bytes, ref int offset) + { + bytes[offset + 0] = msg.severity; + ByteArrayUtil.ToByteArray(msg.text, bytes, offset + 1, 50); + offset += 51; + return 253; + } + + internal static int Serialize_DEBUG(this Msg_debug msg, byte[] bytes, ref int offset) + { + bitconverter.GetBytes(msg.time_boot_ms, bytes, offset + 0); + bitconverter.GetBytes(msg.value, bytes, offset + 4); + bytes[offset + 8] = msg.ind; + offset += 9; + return 254; + } + } + +} + diff --git a/oroca_bldc_gui/qt_gui/dialog.cpp b/oroca_bldc_gui/qt_gui/dialog.cpp new file mode 100644 index 0000000..d3e8f78 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/dialog.cpp @@ -0,0 +1,368 @@ +#include "dialog.h" +#include "ui_dialog.h" +#include "qextserialport.h" +#include "qextserialenumerator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +Dialog::Dialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::Dialog) +{ + ui->setupUi(this); + + //! [0] + foreach (QextPortInfo info, QextSerialEnumerator::getPorts()) + ui->portBox->addItem(info.portName); + //make sure user can input their own port name! + ui->portBox->setEditable(true); + + ui->baudRateBox->addItem("1200", BAUD1200); + ui->baudRateBox->addItem("2400", BAUD2400); + ui->baudRateBox->addItem("4800", BAUD4800); + ui->baudRateBox->addItem("9600", BAUD9600); + ui->baudRateBox->addItem("19200", BAUD19200); + ui->baudRateBox->addItem("115200", BAUD115200); + ui->baudRateBox->setCurrentIndex(5); + + ui->parityBox->addItem("NONE", PAR_NONE); + ui->parityBox->addItem("ODD", PAR_ODD); + ui->parityBox->addItem("EVEN", PAR_EVEN); + + ui->dataBitsBox->addItem("5", DATA_5); + ui->dataBitsBox->addItem("6", DATA_6); + ui->dataBitsBox->addItem("7", DATA_7); + ui->dataBitsBox->addItem("8", DATA_8); + ui->dataBitsBox->setCurrentIndex(3); + + ui->stopBitsBox->addItem("1", STOP_1); + ui->stopBitsBox->addItem("2", STOP_2); + + ui->queryModeBox->addItem("Polling", QextSerialPort::Polling); + ui->queryModeBox->addItem("EventDriven", QextSerialPort::EventDriven); + //! [0] + + timer = new QTimer(this); + timer->setInterval(40); + + timer_colck = new QTimer(this); + connect(timer_colck, SIGNAL(timeout()), this, SLOT(onClockLabelUpdate())); + timer_colck->start(1000); + + //! [1] + PortSettings settings = {BAUD9600, DATA_8, PAR_NONE, STOP_1, FLOW_OFF, 10}; + port = new QextSerialPort(ui->portBox->currentText(), settings, QextSerialPort::Polling); + //! [1] + + enumerator = new QextSerialEnumerator(this); + enumerator->setUpNotifications(); + + connect(ui->baudRateBox, SIGNAL(currentIndexChanged(int)), SLOT(onBaudRateChanged(int))); + connect(ui->parityBox, SIGNAL(currentIndexChanged(int)), SLOT(onParityChanged(int))); + connect(ui->dataBitsBox, SIGNAL(currentIndexChanged(int)), SLOT(onDataBitsChanged(int))); + connect(ui->stopBitsBox, SIGNAL(currentIndexChanged(int)), SLOT(onStopBitsChanged(int))); + connect(ui->queryModeBox, SIGNAL(currentIndexChanged(int)), SLOT(onQueryModeChanged(int))); + connect(ui->timeoutBox, SIGNAL(valueChanged(int)), SLOT(onTimeoutChanged(int))); + connect(ui->portBox, SIGNAL(editTextChanged(QString)), SLOT(onPortNameChanged(QString))); + connect(ui->openCloseButton, SIGNAL(clicked()), SLOT(onOpenCloseButtonClicked())); + + connect(timer, SIGNAL(timeout()), SLOT(onReadyRead())); + connect(port, SIGNAL(readyRead()), SLOT(onReadyRead())); + + connect(enumerator, SIGNAL(deviceDiscovered(QextPortInfo)), SLOT(onPortAddedOrRemoved())); + connect(enumerator, SIGNAL(deviceRemoved(QextPortInfo)), SLOT(onPortAddedOrRemoved())); + + QDateTime local(QDateTime::currentDateTime()); + ui->label_13->setText(local.toString()); + + setWindowTitle("OROCA BLCD GUI v1.0"); +} + +Dialog::~Dialog() +{ + delete ui; +} +void Dialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void Dialog::onPortNameChanged(const QString & /*name*/) +{ + if (port->isOpen()) { + port->close(); + } +} +//! [2] +void Dialog::onBaudRateChanged(int idx) +{ + port->setBaudRate((BaudRateType)ui->baudRateBox->itemData(idx).toInt()); +} + +void Dialog::onParityChanged(int idx) +{ + port->setParity((ParityType)ui->parityBox->itemData(idx).toInt()); +} + +void Dialog::onDataBitsChanged(int idx) +{ + port->setDataBits((DataBitsType)ui->dataBitsBox->itemData(idx).toInt()); +} + +void Dialog::onStopBitsChanged(int idx) +{ + port->setStopBits((StopBitsType)ui->stopBitsBox->itemData(idx).toInt()); +} + +void Dialog::onQueryModeChanged(int idx) +{ + port->setQueryMode((QextSerialPort::QueryMode)ui->queryModeBox->itemData(idx).toInt()); +} + +void Dialog::onTimeoutChanged(int val) +{ + port->setTimeout(val); +} +//! [2] +//! [3] +void Dialog::onOpenCloseButtonClicked() +{ + if (!port->isOpen()) + { + if(ui->portBox->currentText() != NULL ) + { + port->setPortName(ui->portBox->currentText()); + port->open(QIODevice::ReadWrite); + } + else + { + } + } + else + { + port->close(); + } + + //If using polling mode, we need a QTimer + if (port->isOpen() && port->queryMode() == QextSerialPort::Polling) + timer->start(); + else + timer->stop(); +} +//! [3] +//! [4] + +void Dialog::onReadyRead() +{ + /*if (port->bytesAvailable()) { + QByteArray ba = port->readAll(); + ui->textEdit_Log->moveCursor(QTextCursor::End); + ui->textEdit_Log->insertPlainText(QString::fromLatin1(ba)); + }*/ + + receiveFlag = true; +} + +void Dialog::onClockLabelUpdate() +{ + QDateTime local(QDateTime::currentDateTime()); + ui->label_13->setText(local.toString("hh:mm:ss A")); + //onTextBoxLogPrint("test\r\n"); +} + +void Dialog::onPortAddedOrRemoved() +{ + QString current = ui->portBox->currentText(); + + ui->portBox->blockSignals(true); + ui->portBox->clear(); + foreach (QextPortInfo info, QextSerialEnumerator::getPorts()) + ui->portBox->addItem(info.portName); + + ui->portBox->setCurrentIndex(ui->portBox->findText(current)); + + ui->portBox->blockSignals(false); +} + + +void Dialog::msg_send(uint8_t chan, mavlink_message_t *p_msg) +{ + uint8_t buf[1024]; + uint16_t len; + uint16_t write_len; +QString textPrint; + + len = mavlink_msg_to_send_buffer(buf, p_msg); + + switch(chan) + { + case 0: + write_len = write_bytes((char *)buf, (uint32_t)len); + break; + + case 1: + break; + } + + //ui->led_Tx->turnOff(); +} + + +BOOL Dialog::msg_recv( uint8_t chan, uint8_t data , mavlink_message_t *p_msg, mavlink_status_t *p_status ) +{ + BOOL ret = FALSE; + if(chan == 0) + { + if (mavlink_parse_char(MAVLINK_COMM_0, data, p_msg, p_status) == MAVLINK_FRAMING_OK) + { + ret = TRUE; + } + } + else + { + if (mavlink_parse_char(MAVLINK_COMM_1, data, p_msg, p_status) == MAVLINK_FRAMING_OK) + { + ret = TRUE; + } + } + + return ret; +} + + +BOOL Dialog::msg_get_resp( uint8_t chan, mavlink_message_t *p_msg, uint32_t timeout) +{ + BOOL ret = FALSE; + int ch_ret; + uint8_t ch; + static mavlink_message_t msg[MSG_CH_MAX]; + static mavlink_status_t status[MSG_CH_MAX]; + uint32_t retry = timeout; + int data_cnt; + int time_out_cnt; + + port->waitForReadyRead(timeout); + + if(receiveFlag == true && port->bytesAvailable()) + { + QByteArray ch_ret = port->readAll(); + for(data_cnt=0;data_cnt< ch_ret.length();data_cnt++) + { + ch = (int)ch_ret.at(data_cnt) ; + + ret = msg_recv( chan, ch, &msg[chan], &status[chan] ); + + if( ret == TRUE ) + { + *p_msg = msg[chan]; + break; + } + } + } + + for(time_out_cnt=0;time_out_cnt<10;time_out_cnt++) + { + if( ret != TRUE) + { + // port->waitForReadyRead(10000); + QThread::sleep(1); + if(port->bytesAvailable()) + { + QByteArray ch_ret = port->readAll(); + for(data_cnt=0;data_cnt< ch_ret.length();data_cnt++) + { + ch = (int)ch_ret.at(data_cnt) ; + + ret = msg_recv( chan, ch, &msg[chan], &status[chan] ); + + if( ret == TRUE ) + { + *p_msg = msg[chan]; + break; + } + } + } + } + else + { + break; + } + } + receiveFlag =false; + + // ui->led_Rx->g->turnOff(); + return ret; +} + + +/*--------------------------------------------------------------------------- + TITLE : read_byte + WORK : +---------------------------------------------------------------------------*/ +void Dialog::ser_set_timeout_ms(long val ) +{ + port->setTimeout(val); + + return; +} + +/*--------------------------------------------------------------------------- + TITLE : read_byte + WORK : +---------------------------------------------------------------------------*/ +int Dialog::read_byte( void ) +{ + //return ser_read_byte( stm32_ser_id ); + char byte; + + port->read(&byte,1); + + return (int)byte; +} + + +/*--------------------------------------------------------------------------- + TITLE : write_bytes + WORK : +---------------------------------------------------------------------------*/ +int Dialog::write_bytes( char *p_data, int len ) +{ + int written_len; + + //written_len = ser_write( stm32_ser_id, (const u8 *)p_data, len ); + written_len = port->write(p_data,len); + + return written_len; +} + +long Dialog::iclock() +{ + // struct timeval tv; + // gettimeofday (&tv, NULL); + // return (tv.tv_sec * 1000 + tv.tv_usec / 1000); + + QDateTime local(QDateTime::currentDateTime()); + return local.toMSecsSinceEpoch(); + +} diff --git a/oroca_bldc_gui/qt_gui/dialog.h b/oroca_bldc_gui/qt_gui/dialog.h new file mode 100644 index 0000000..9be3039 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/dialog.h @@ -0,0 +1,82 @@ +#ifndef DIALOG_H +#define DIALOG_H + +#include +#include "./msg/def.h" + +#define GET_CALC_TIME(x) ( (int)(x / 1000) + ((float)(x % 1000))/1000 ) + +#define FLASH_TX_BLOCK_LENGTH (8*1024) +#define FLASH_RX_BLOCK_LENGTH (128) +#define FLASH_PACKET_LENGTH 128 + +#define MSG_CH_MAX 1 + +typedef struct +{ + uint8_t ch; + mavlink_message_t *p_msg; +} msg_t; + +namespace Ui { +class Dialog; +} +class QTimer; +class QextSerialPort; +class QextSerialEnumerator; + +class Dialog : public QDialog +{ + Q_OBJECT + +public: + explicit Dialog(QWidget *parent = 0); + ~Dialog(); +protected: + void changeEvent(QEvent *e); + +private slots: + + void onPortNameChanged(const QString &name); + void onBaudRateChanged(int idx); + void onParityChanged(int idx); + void onDataBitsChanged(int idx); + void onStopBitsChanged(int idx); + void onQueryModeChanged(int idx); + void onTimeoutChanged(int val); + void onOpenCloseButtonClicked(); + + void onReadyRead(); + void onClockLabelUpdate(); + void onPortAddedOrRemoved(); + +private: + Ui::Dialog *ui; + QTimer *timer; + QTimer *timer_colck; + QextSerialPort *port; + QextSerialEnumerator *enumerator; + +public: + QStringList fileNames; + FILE *opencr_fp; + uint32_t opencr_fpsize; + + bool receiveFlag; + + void msg_send(uint8_t chan, mavlink_message_t *p_msg); + BOOL msg_recv( uint8_t chan, uint8_t data , mavlink_message_t *p_msg, mavlink_status_t *p_status ); + BOOL msg_get_resp( uint8_t chan, mavlink_message_t *p_msg, uint32_t timeout); + + void ser_set_timeout_ms(long val ); + int read_byte( void ); + int write_bytes( char *p_data, int len ); + + long iclock(); +}; + + + + + +#endif // DIALOG_H diff --git a/oroca_bldc_gui/qt_gui/dialog.ui b/oroca_bldc_gui/qt_gui/dialog.ui new file mode 100644 index 0000000..0f9ae81 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/dialog.ui @@ -0,0 +1,214 @@ + + + Dialog + + + + 0 + 0 + 1182 + 692 + + + + Dialog + + + + + 10 + 10 + 891 + 651 + + + + 0 + + + + Tab 1 + + + + + 30 + 20 + 191 + 171 + + + + + + + 150 + 190 + 56 + 12 + + + + TextLabel + + + + + + 20 + 230 + 91 + 23 + + + + Run + + + + + + 124 + 230 + 91 + 23 + + + + Stop + + + + + + Tab 2 + + + + + + + 910 + 30 + 258 + 651 + + + + + + + + + + + + BaudRate: + + + + + + + + + + DataBits: + + + + + + + + + + Parity: + + + + + + + + + + StopBits: + + + + + + + + + + Timeout: + + + + + + + ms + + + -1 + + + 10000 + + + 10 + + + 10 + + + + + + + QueryMode: + + + + + + + + + + Port: + + + + + + + + + Open/Close + + + + + + + + + + localTime + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + diff --git a/oroca_bldc_gui/qt_gui/hled.cpp b/oroca_bldc_gui/qt_gui/hled.cpp new file mode 100644 index 0000000..e9350cd --- /dev/null +++ b/oroca_bldc_gui/qt_gui/hled.cpp @@ -0,0 +1,138 @@ +#include +#include "hled.h" + +struct HLed::Private +{ +public: + Private() + : darkerFactor(300), color(Qt::green), isOn(true) + { } + + int darkerFactor; + QColor color; + bool isOn; +}; + +HLed::HLed(QWidget *parent) + :QWidget(parent), m_d(new Private) +{ +} + +HLed::~HLed() +{ + delete m_d; +} + +QColor HLed::color() const +{ + return m_d->color; +} + +void HLed::setColor(const QColor &color) +{ + if (m_d->color == color) + return; + update(); +} + +QSize HLed::sizeHint() const +{ + return QSize(20, 20); +} + +QSize HLed::minimumSizeHint() const +{ + return QSize(16, 16); +} + +void HLed::toggle() +{ + m_d->isOn = !m_d->isOn; + update(); +} + +void HLed::turnOn(bool on) +{ + m_d->isOn = on; + update(); +} + +bool HLed::ledStatus() +{ + return m_d->isOn; +} + +void HLed::turnOff(bool off) +{ + turnOn(!off); +} + +void HLed::paintEvent(QPaintEvent * /*event*/) +{ + int width = ledWidth(); + + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + + QColor color = m_d->isOn ? m_d->color + : m_d->color.darker(m_d->darkerFactor); + + QBrush brush; + brush.setStyle(Qt::SolidPattern); + brush.setColor(color); + painter.setBrush(brush); + // draw plain + painter.drawEllipse(1, 1, width-1, width-1); + + QPen pen; + pen.setWidth(2); + + int pos = width / 5 + 1; + int lightWidth = width * 2 / 3; + int lightQuote = 130 * 2 / (lightWidth ? lightWidth : 1) + 100; + + // draw bright spot + while (lightWidth) { + color = color.lighter(lightQuote); + pen.setColor(color); + painter.setPen(pen); + painter.drawEllipse(pos, pos, lightWidth, lightWidth); + lightWidth--; + + if (!lightWidth) + break; + + painter.drawEllipse(pos, pos, lightWidth, lightWidth); + lightWidth--; + + if (!lightWidth) + break; + + painter.drawEllipse(pos, pos, lightWidth, lightWidth); + pos++; + lightWidth--; + } + + //draw border + painter.setBrush(Qt::NoBrush); + + int angle = -720; + color = palette().color(QPalette::Light); + + for (int arc=120; arc<2880; arc+=240) { + pen.setColor(color); + painter.setPen(pen); + int w = width - pen.width()/2; + painter.drawArc(pen.width()/2, pen.width()/2, w, w, angle+arc, 240); + painter.drawArc(pen.width()/2, pen.width()/2, w, w, angle-arc, 240); + color = color.darker(110); + } +} + +int HLed::ledWidth() const +{ + int width = qMin(this->width(), this->height()); + width -= 2; + return width > 0 ? width : 0; +} + diff --git a/oroca_bldc_gui/qt_gui/hled.h b/oroca_bldc_gui/qt_gui/hled.h new file mode 100644 index 0000000..b04f505 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/hled.h @@ -0,0 +1,34 @@ +#ifndef HLED_H +#define HLED_H + +#include + +class QColor; + +class HLed : public QWidget +{ + Q_OBJECT +public: + HLed(QWidget *parent = 0); + ~HLed(); + + QColor color() const; + QSize sizeHint() const; + QSize minimumSizeHint() const; + +public slots: + void setColor(const QColor &color); + void toggle(); + void turnOn(bool on=true); + void turnOff(bool off=true); + bool ledStatus(); +protected: + void paintEvent(QPaintEvent *); + int ledWidth() const; + +private: + struct Private; + Private * const m_d; +}; + +#endif // HLED_H diff --git a/oroca_bldc_gui/qt_gui/main.cpp b/oroca_bldc_gui/qt_gui/main.cpp new file mode 100644 index 0000000..c6efa74 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/main.cpp @@ -0,0 +1,11 @@ +#include "dialog.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + Dialog w; + w.show(); + + return a.exec(); +} diff --git a/oroca_bldc_gui/qt_gui/msg/def.h b/oroca_bldc_gui/qt_gui/msg/def.h new file mode 100644 index 0000000..479d975 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/def.h @@ -0,0 +1,48 @@ +/* + * def.h + * + * Created on: 2016. 5. 14. + * Author: Baram, PBPH + */ + +#ifndef DEF_H +#define DEF_H + +#include +#include "def_err.h" + +#ifndef BOOL +#define BOOL uint8_t +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef bool +#define bool uint8_t +#endif + +#ifndef true +#define true 1 +#endif + +#ifndef false +#define false 0 +#endif + + +#include "./mavlink/opencr_msg/mavlink.h" + + + + + + + +#endif + diff --git a/oroca_bldc_gui/qt_gui/msg/def_err.h b/oroca_bldc_gui/qt_gui/msg/def_err.h new file mode 100644 index 0000000..8ec6421 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/def_err.h @@ -0,0 +1,36 @@ +/* + * def_err.h + * + * Created on: 2016. 5. 14. + * Author: Baram, PBPH + */ + +#ifndef DEF_ERR_H +#define DEF_ERR_H + +#include + + + +typedef uint16_t err_code_t; + + + + +#define OK 0x0000 +#define ERR_FLASH_ERROR 0xF010 +#define ERR_FLASH_BUSY 0xF011 +#define ERR_FLASH_ERR_TIMEOUT 0xF012 +#define ERR_FLASH_NOT_EMPTY 0xF013 +#define ERR_FLASH_WRITE 0xF014 +#define ERR_FLASH_READ 0xF015 +#define ERR_FLASH_ERASE 0xF016 + +#define ERR_TIMEOUT 0xF020 +#define ERR_MISMATCH_ID 0xF021 +#define ERR_SIZE_OVER 0xF022 + + + +#endif + diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/checksum.h b/oroca_bldc_gui/qt_gui/msg/mavlink/checksum.h new file mode 100644 index 0000000..0f30b65 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/checksum.h @@ -0,0 +1,96 @@ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _CHECKSUM_H_ +#define _CHECKSUM_H_ + +// Visual Studio versions before 2010 don't have stdint.h, so we just error out. +#if (defined _MSC_VER) && (_MSC_VER < 1600) +#error "The C-MAVLink implementation requires Visual Studio 2010 or greater" +#endif + +#include + +/** + * + * CALCULATE THE CHECKSUM + * + */ + +#define X25_INIT_CRC 0xffff +#define X25_VALIDATE_CRC 0xf0b8 + +#ifndef HAVE_CRC_ACCUMULATE +/** + * @brief Accumulate the X.25 CRC by adding one char at a time. + * + * The checksum function adds the hash of one char at a time to the + * 16 bit checksum (uint16_t). + * + * @param data new char to hash + * @param crcAccum the already accumulated checksum + **/ +static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) +{ + /*Accumulate one byte of data into the CRC*/ + uint8_t tmp; + + tmp = data ^ (uint8_t)(*crcAccum &0xff); + tmp ^= (tmp<<4); + *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); +} +#endif + + +/** + * @brief Initiliaze the buffer for the X.25 CRC + * + * @param crcAccum the 16 bit X.25 CRC + */ +static inline void crc_init(uint16_t* crcAccum) +{ + *crcAccum = X25_INIT_CRC; +} + + +/** + * @brief Calculates the X.25 checksum on a byte buffer + * + * @param pBuffer buffer containing the byte array to hash + * @param length length of the byte array + * @return the checksum over the buffer bytes + **/ +static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length) +{ + uint16_t crcTmp; + crc_init(&crcTmp); + while (length--) { + crc_accumulate(*pBuffer++, &crcTmp); + } + return crcTmp; +} + + +/** + * @brief Accumulate the X.25 CRC by adding an array of bytes + * + * The checksum function adds the hash of one char at a time to the + * 16 bit checksum (uint16_t). + * + * @param data new bytes to hash + * @param crcAccum the already accumulated checksum + **/ +static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length) +{ + const uint8_t *p = (const uint8_t *)pBuffer; + while (length--) { + crc_accumulate(*p++, crcAccum); + } +} + +#endif /* _CHECKSUM_H_ */ + +#ifdef __cplusplus +} +#endif diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_conversions.h b/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_conversions.h new file mode 100644 index 0000000..63bcfa3 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_conversions.h @@ -0,0 +1,211 @@ +#ifndef _MAVLINK_CONVERSIONS_H_ +#define _MAVLINK_CONVERSIONS_H_ + +/* enable math defines on Windows */ +#ifdef _MSC_VER +#ifndef _USE_MATH_DEFINES +#define _USE_MATH_DEFINES +#endif +#endif +#include + +#ifndef M_PI_2 + #define M_PI_2 ((float)asin(1)) +#endif + +/** + * @file mavlink_conversions.h + * + * These conversion functions follow the NASA rotation standards definition file + * available online. + * + * Their intent is to lower the barrier for MAVLink adopters to use gimbal-lock free + * (both rotation matrices, sometimes called DCM, and quaternions are gimbal-lock free) + * rotation representations. Euler angles (roll, pitch, yaw) will be phased out of the + * protocol as widely as possible. + * + * @author James Goppert + * @author Thomas Gubler + */ + + +/** + * Converts a quaternion to a rotation matrix + * + * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0) + * @param dcm a 3x3 rotation matrix + */ +MAVLINK_HELPER void mavlink_quaternion_to_dcm(const float quaternion[4], float dcm[3][3]) +{ + double a = quaternion[0]; + double b = quaternion[1]; + double c = quaternion[2]; + double d = quaternion[3]; + double aSq = a * a; + double bSq = b * b; + double cSq = c * c; + double dSq = d * d; + dcm[0][0] = aSq + bSq - cSq - dSq; + dcm[0][1] = 2 * (b * c - a * d); + dcm[0][2] = 2 * (a * c + b * d); + dcm[1][0] = 2 * (b * c + a * d); + dcm[1][1] = aSq - bSq + cSq - dSq; + dcm[1][2] = 2 * (c * d - a * b); + dcm[2][0] = 2 * (b * d - a * c); + dcm[2][1] = 2 * (a * b + c * d); + dcm[2][2] = aSq - bSq - cSq + dSq; +} + + +/** + * Converts a rotation matrix to euler angles + * + * @param dcm a 3x3 rotation matrix + * @param roll the roll angle in radians + * @param pitch the pitch angle in radians + * @param yaw the yaw angle in radians + */ +MAVLINK_HELPER void mavlink_dcm_to_euler(const float dcm[3][3], float* roll, float* pitch, float* yaw) +{ + float phi, theta, psi; + theta = asin(-dcm[2][0]); + + if (fabsf(theta - (float)M_PI_2) < 1.0e-3f) { + phi = 0.0f; + psi = (atan2f(dcm[1][2] - dcm[0][1], + dcm[0][2] + dcm[1][1]) + phi); + + } else if (fabsf(theta + (float)M_PI_2) < 1.0e-3f) { + phi = 0.0f; + psi = atan2f(dcm[1][2] - dcm[0][1], + dcm[0][2] + dcm[1][1] - phi); + + } else { + phi = atan2f(dcm[2][1], dcm[2][2]); + psi = atan2f(dcm[1][0], dcm[0][0]); + } + + *roll = phi; + *pitch = theta; + *yaw = psi; +} + + +/** + * Converts a quaternion to euler angles + * + * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0) + * @param roll the roll angle in radians + * @param pitch the pitch angle in radians + * @param yaw the yaw angle in radians + */ +MAVLINK_HELPER void mavlink_quaternion_to_euler(const float quaternion[4], float* roll, float* pitch, float* yaw) +{ + float dcm[3][3]; + mavlink_quaternion_to_dcm(quaternion, dcm); + mavlink_dcm_to_euler((const float(*)[3])dcm, roll, pitch, yaw); +} + + +/** + * Converts euler angles to a quaternion + * + * @param roll the roll angle in radians + * @param pitch the pitch angle in radians + * @param yaw the yaw angle in radians + * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0) + */ +MAVLINK_HELPER void mavlink_euler_to_quaternion(float roll, float pitch, float yaw, float quaternion[4]) +{ + float cosPhi_2 = cosf(roll / 2); + float sinPhi_2 = sinf(roll / 2); + float cosTheta_2 = cosf(pitch / 2); + float sinTheta_2 = sinf(pitch / 2); + float cosPsi_2 = cosf(yaw / 2); + float sinPsi_2 = sinf(yaw / 2); + quaternion[0] = (cosPhi_2 * cosTheta_2 * cosPsi_2 + + sinPhi_2 * sinTheta_2 * sinPsi_2); + quaternion[1] = (sinPhi_2 * cosTheta_2 * cosPsi_2 - + cosPhi_2 * sinTheta_2 * sinPsi_2); + quaternion[2] = (cosPhi_2 * sinTheta_2 * cosPsi_2 + + sinPhi_2 * cosTheta_2 * sinPsi_2); + quaternion[3] = (cosPhi_2 * cosTheta_2 * sinPsi_2 - + sinPhi_2 * sinTheta_2 * cosPsi_2); +} + + +/** + * Converts a rotation matrix to a quaternion + * Reference: + * - Shoemake, Quaternions, + * http://www.cs.ucr.edu/~vbz/resources/quatut.pdf + * + * @param dcm a 3x3 rotation matrix + * @param quaternion a [w, x, y, z] ordered quaternion (null-rotation being 1 0 0 0) + */ +MAVLINK_HELPER void mavlink_dcm_to_quaternion(const float dcm[3][3], float quaternion[4]) +{ + float tr = dcm[0][0] + dcm[1][1] + dcm[2][2]; + if (tr > 0.0f) { + float s = sqrtf(tr + 1.0f); + quaternion[0] = s * 0.5f; + s = 0.5f / s; + quaternion[1] = (dcm[2][1] - dcm[1][2]) * s; + quaternion[2] = (dcm[0][2] - dcm[2][0]) * s; + quaternion[3] = (dcm[1][0] - dcm[0][1]) * s; + } else { + /* Find maximum diagonal element in dcm + * store index in dcm_i */ + int dcm_i = 0; + int i; + for (i = 1; i < 3; i++) { + if (dcm[i][i] > dcm[dcm_i][dcm_i]) { + dcm_i = i; + } + } + + int dcm_j = (dcm_i + 1) % 3; + int dcm_k = (dcm_i + 2) % 3; + + float s = sqrtf((dcm[dcm_i][dcm_i] - dcm[dcm_j][dcm_j] - + dcm[dcm_k][dcm_k]) + 1.0f); + quaternion[dcm_i + 1] = s * 0.5f; + s = 0.5f / s; + quaternion[dcm_j + 1] = (dcm[dcm_i][dcm_j] + dcm[dcm_j][dcm_i]) * s; + quaternion[dcm_k + 1] = (dcm[dcm_k][dcm_i] + dcm[dcm_i][dcm_k]) * s; + quaternion[0] = (dcm[dcm_k][dcm_j] - dcm[dcm_j][dcm_k]) * s; + } +} + + +/** + * Converts euler angles to a rotation matrix + * + * @param roll the roll angle in radians + * @param pitch the pitch angle in radians + * @param yaw the yaw angle in radians + * @param dcm a 3x3 rotation matrix + */ +MAVLINK_HELPER void mavlink_euler_to_dcm(float roll, float pitch, float yaw, float dcm[3][3]) +{ + float cosPhi = cosf(roll); + float sinPhi = sinf(roll); + float cosThe = cosf(pitch); + float sinThe = sinf(pitch); + float cosPsi = cosf(yaw); + float sinPsi = sinf(yaw); + + dcm[0][0] = cosThe * cosPsi; + dcm[0][1] = -cosPhi * sinPsi + sinPhi * sinThe * cosPsi; + dcm[0][2] = sinPhi * sinPsi + cosPhi * sinThe * cosPsi; + + dcm[1][0] = cosThe * sinPsi; + dcm[1][1] = cosPhi * cosPsi + sinPhi * sinThe * sinPsi; + dcm[1][2] = -sinPhi * cosPsi + cosPhi * sinThe * sinPsi; + + dcm[2][0] = -sinThe; + dcm[2][1] = sinPhi * cosThe; + dcm[2][2] = cosPhi * cosThe; +} + +#endif diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_helpers.h b/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_helpers.h new file mode 100644 index 0000000..ac1cf6c --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_helpers.h @@ -0,0 +1,676 @@ +#ifndef _MAVLINK_HELPERS_H_ +#define _MAVLINK_HELPERS_H_ + +#include "string.h" +#include "checksum.h" +#include "mavlink_types.h" +#include "mavlink_conversions.h" + +#ifndef MAVLINK_HELPER +#define MAVLINK_HELPER +#endif + +/* + * Internal function to give access to the channel status for each channel + */ +#ifndef MAVLINK_GET_CHANNEL_STATUS +MAVLINK_HELPER mavlink_status_t* mavlink_get_channel_status(uint8_t chan) +{ +#ifdef MAVLINK_EXTERNAL_RX_STATUS + // No m_mavlink_status array defined in function, + // has to be defined externally +#else + static mavlink_status_t m_mavlink_status[MAVLINK_COMM_NUM_BUFFERS]; +#endif + return &m_mavlink_status[chan]; +} +#endif + +/* + * Internal function to give access to the channel buffer for each channel + */ +#ifndef MAVLINK_GET_CHANNEL_BUFFER +MAVLINK_HELPER mavlink_message_t* mavlink_get_channel_buffer(uint8_t chan) +{ + +#ifdef MAVLINK_EXTERNAL_RX_BUFFER + // No m_mavlink_buffer array defined in function, + // has to be defined externally +#else + static mavlink_message_t m_mavlink_buffer[MAVLINK_COMM_NUM_BUFFERS]; +#endif + return &m_mavlink_buffer[chan]; +} +#endif + +/** + * @brief Reset the status of a channel. + */ +MAVLINK_HELPER void mavlink_reset_channel_status(uint8_t chan) +{ + mavlink_status_t *status = mavlink_get_channel_status(chan); + status->parse_state = MAVLINK_PARSE_STATE_IDLE; +} + +/** + * @brief Finalize a MAVLink message with channel assignment + * + * This function calculates the checksum and sets length and aircraft id correctly. + * It assumes that the message id and the payload are already correctly set. This function + * can also be used if the message header has already been written before (as in mavlink_msg_xxx_pack + * instead of mavlink_msg_xxx_pack_headerless), it just introduces little extra overhead. + * + * @param msg Message to finalize + * @param system_id Id of the sending (this) system, 1-127 + * @param length Message length + */ +#if MAVLINK_CRC_EXTRA +MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, + uint8_t chan, uint8_t min_length, uint8_t length, uint8_t crc_extra) +#else +MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, + uint8_t chan, uint8_t length) +#endif +{ + // This code part is the same for all messages; + msg->magic = MAVLINK_STX; + msg->len = length; + msg->sysid = system_id; + msg->compid = component_id; + // One sequence number per channel + msg->seq = mavlink_get_channel_status(chan)->current_tx_seq; + mavlink_get_channel_status(chan)->current_tx_seq = mavlink_get_channel_status(chan)->current_tx_seq+1; + msg->checksum = crc_calculate(((const uint8_t*)(msg)) + 3, MAVLINK_CORE_HEADER_LEN); + crc_accumulate_buffer(&msg->checksum, _MAV_PAYLOAD(msg), msg->len); +#if MAVLINK_CRC_EXTRA + crc_accumulate(crc_extra, &msg->checksum); +#endif + mavlink_ck_a(msg) = (uint8_t)(msg->checksum & 0xFF); + mavlink_ck_b(msg) = (uint8_t)(msg->checksum >> 8); + + return length + MAVLINK_NUM_NON_PAYLOAD_BYTES; +} + + +/** + * @brief Finalize a MAVLink message with MAVLINK_COMM_0 as default channel + */ +#if MAVLINK_CRC_EXTRA +MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, + uint8_t min_length, uint8_t length, uint8_t crc_extra) +{ + return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, min_length, length, crc_extra); +} +#else +MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t* msg, uint8_t system_id, uint8_t component_id, + uint8_t length) +{ + return mavlink_finalize_message_chan(msg, system_id, component_id, MAVLINK_COMM_0, length); +} +#endif + +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS +MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len); + +/** + * @brief Finalize a MAVLink message with channel assignment and send + */ +#if MAVLINK_CRC_EXTRA +MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, + uint8_t min_length, uint8_t length, uint8_t crc_extra) +#else +MAVLINK_HELPER void _mav_finalize_message_chan_send(mavlink_channel_t chan, uint8_t msgid, const char *packet, uint8_t length) +#endif +{ + uint16_t checksum; + uint8_t buf[MAVLINK_NUM_HEADER_BYTES]; + uint8_t ck[2]; + mavlink_status_t *status = mavlink_get_channel_status(chan); + buf[0] = MAVLINK_STX; + buf[1] = length; + buf[2] = status->current_tx_seq; + buf[3] = mavlink_system.sysid; + buf[4] = mavlink_system.compid; + buf[5] = msgid; + status->current_tx_seq++; + checksum = crc_calculate((const uint8_t*)&buf[1], MAVLINK_CORE_HEADER_LEN); + crc_accumulate_buffer(&checksum, packet, length); +#if MAVLINK_CRC_EXTRA + crc_accumulate(crc_extra, &checksum); +#endif + ck[0] = (uint8_t)(checksum & 0xFF); + ck[1] = (uint8_t)(checksum >> 8); + + MAVLINK_START_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)length); + _mavlink_send_uart(chan, (const char *)buf, MAVLINK_NUM_HEADER_BYTES); + _mavlink_send_uart(chan, packet, length); + _mavlink_send_uart(chan, (const char *)ck, 2); + MAVLINK_END_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)length); +} + +/** + * @brief re-send a message over a uart channel + * this is more stack efficient than re-marshalling the message + */ +MAVLINK_HELPER void _mavlink_resend_uart(mavlink_channel_t chan, const mavlink_message_t *msg) +{ + uint8_t ck[2]; + + ck[0] = (uint8_t)(msg->checksum & 0xFF); + ck[1] = (uint8_t)(msg->checksum >> 8); + // XXX use the right sequence here + + MAVLINK_START_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + msg->len); + _mavlink_send_uart(chan, (const char *)&msg->magic, MAVLINK_NUM_HEADER_BYTES); + _mavlink_send_uart(chan, _MAV_PAYLOAD(msg), msg->len); + _mavlink_send_uart(chan, (const char *)ck, 2); + MAVLINK_END_UART_SEND(chan, MAVLINK_NUM_NON_PAYLOAD_BYTES + msg->len); +} +#endif // MAVLINK_USE_CONVENIENCE_FUNCTIONS + +/** + * @brief Pack a message to send it over a serial byte stream + */ +MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg) +{ + memcpy(buffer, (const uint8_t *)&msg->magic, MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len); + + uint8_t *ck = buffer + (MAVLINK_NUM_HEADER_BYTES + (uint16_t)msg->len); + + ck[0] = (uint8_t)(msg->checksum & 0xFF); + ck[1] = (uint8_t)(msg->checksum >> 8); + + return MAVLINK_NUM_NON_PAYLOAD_BYTES + (uint16_t)msg->len; +} + +union __mavlink_bitfield { + uint8_t uint8; + int8_t int8; + uint16_t uint16; + int16_t int16; + uint32_t uint32; + int32_t int32; +}; + + +MAVLINK_HELPER void mavlink_start_checksum(mavlink_message_t* msg) +{ + crc_init(&msg->checksum); +} + +MAVLINK_HELPER void mavlink_update_checksum(mavlink_message_t* msg, uint8_t c) +{ + crc_accumulate(c, &msg->checksum); +} + +/** + * This is a varient of mavlink_frame_char() but with caller supplied + * parsing buffers. It is useful when you want to create a MAVLink + * parser in a library that doesn't use any global variables + * + * @param rxmsg parsing message buffer + * @param status parsing starus buffer + * @param c The char to parse + * + * @param returnMsg NULL if no message could be decoded, the message data else + * @param returnStats if a message was decoded, this is filled with the channel's stats + * @return 0 if no message could be decoded, 1 on good message and CRC, 2 on bad CRC + * + * A typical use scenario of this function call is: + * + * @code + * #include + * + * mavlink_message_t msg; + * int chan = 0; + * + * + * while(serial.bytesAvailable > 0) + * { + * uint8_t byte = serial.getNextByte(); + * if (mavlink_frame_char(chan, byte, &msg) != MAVLINK_FRAMING_INCOMPLETE) + * { + * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); + * } + * } + * + * + * @endcode + */ +MAVLINK_HELPER uint8_t mavlink_frame_char_buffer(mavlink_message_t* rxmsg, + mavlink_status_t* status, + uint8_t c, + mavlink_message_t* r_message, + mavlink_status_t* r_mavlink_status) +{ + /* + default message crc function. You can override this per-system to + put this data in a different memory segment + */ +#if MAVLINK_CRC_EXTRA +#ifndef MAVLINK_MESSAGE_CRC + static const uint8_t mavlink_message_crcs[256] = MAVLINK_MESSAGE_CRCS; +#define MAVLINK_MESSAGE_CRC(msgid) mavlink_message_crcs[msgid] +#endif +#endif + + /* Enable this option to check the length of each message. + This allows invalid messages to be caught much sooner. Use if the transmission + medium is prone to missing (or extra) characters (e.g. a radio that fades in + and out). Only use if the channel will only contain messages types listed in + the headers. + */ +#ifdef MAVLINK_CHECK_MESSAGE_LENGTH +#ifndef MAVLINK_MESSAGE_LENGTH + static const uint8_t mavlink_message_lengths[256] = MAVLINK_MESSAGE_LENGTHS; +#define MAVLINK_MESSAGE_LENGTH(msgid) mavlink_message_lengths[msgid] +#endif +#endif + + int bufferIndex = 0; + + status->msg_received = MAVLINK_FRAMING_INCOMPLETE; + + switch (status->parse_state) + { + case MAVLINK_PARSE_STATE_UNINIT: + case MAVLINK_PARSE_STATE_IDLE: + if (c == MAVLINK_STX) + { + status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; + rxmsg->len = 0; + rxmsg->magic = c; + mavlink_start_checksum(rxmsg); + } + break; + + case MAVLINK_PARSE_STATE_GOT_STX: + if (status->msg_received +/* Support shorter buffers than the + default maximum packet size */ +#if (MAVLINK_MAX_PAYLOAD_LEN < 255) + || c > MAVLINK_MAX_PAYLOAD_LEN +#endif + ) + { + status->buffer_overrun++; + status->parse_error++; + status->msg_received = 0; + status->parse_state = MAVLINK_PARSE_STATE_IDLE; + } + else + { + // NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 + rxmsg->len = c; + status->packet_idx = 0; + mavlink_update_checksum(rxmsg, c); + status->parse_state = MAVLINK_PARSE_STATE_GOT_LENGTH; + } + break; + + case MAVLINK_PARSE_STATE_GOT_LENGTH: + rxmsg->seq = c; + mavlink_update_checksum(rxmsg, c); + status->parse_state = MAVLINK_PARSE_STATE_GOT_SEQ; + break; + + case MAVLINK_PARSE_STATE_GOT_SEQ: + rxmsg->sysid = c; + mavlink_update_checksum(rxmsg, c); + status->parse_state = MAVLINK_PARSE_STATE_GOT_SYSID; + break; + + case MAVLINK_PARSE_STATE_GOT_SYSID: + rxmsg->compid = c; + mavlink_update_checksum(rxmsg, c); + status->parse_state = MAVLINK_PARSE_STATE_GOT_COMPID; + break; + + case MAVLINK_PARSE_STATE_GOT_COMPID: +#ifdef MAVLINK_CHECK_MESSAGE_LENGTH + if (rxmsg->len != MAVLINK_MESSAGE_LENGTH(c)) + { + status->parse_error++; + status->parse_state = MAVLINK_PARSE_STATE_IDLE; + break; + } +#endif + rxmsg->msgid = c; + mavlink_update_checksum(rxmsg, c); + if (rxmsg->len == 0) + { + status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD; + } + else + { + status->parse_state = MAVLINK_PARSE_STATE_GOT_MSGID; + } + break; + + case MAVLINK_PARSE_STATE_GOT_MSGID: + _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx++] = (char)c; + mavlink_update_checksum(rxmsg, c); + if (status->packet_idx == rxmsg->len) + { + status->parse_state = MAVLINK_PARSE_STATE_GOT_PAYLOAD; + } + break; + + case MAVLINK_PARSE_STATE_GOT_PAYLOAD: +#if MAVLINK_CRC_EXTRA + mavlink_update_checksum(rxmsg, MAVLINK_MESSAGE_CRC(rxmsg->msgid)); +#endif + if (c != (rxmsg->checksum & 0xFF)) { + status->parse_state = MAVLINK_PARSE_STATE_GOT_BAD_CRC1; + } else { + status->parse_state = MAVLINK_PARSE_STATE_GOT_CRC1; + } + _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx] = (char)c; + break; + + case MAVLINK_PARSE_STATE_GOT_CRC1: + case MAVLINK_PARSE_STATE_GOT_BAD_CRC1: + if (status->parse_state == MAVLINK_PARSE_STATE_GOT_BAD_CRC1 || c != (rxmsg->checksum >> 8)) { + // got a bad CRC message + status->msg_received = MAVLINK_FRAMING_BAD_CRC; + } else { + // Successfully got message + status->msg_received = MAVLINK_FRAMING_OK; + } + status->parse_state = MAVLINK_PARSE_STATE_IDLE; + _MAV_PAYLOAD_NON_CONST(rxmsg)[status->packet_idx+1] = (char)c; + memcpy(r_message, rxmsg, sizeof(mavlink_message_t)); + break; + } + + bufferIndex++; + // If a message has been sucessfully decoded, check index + if (status->msg_received == MAVLINK_FRAMING_OK) + { + //while(status->current_seq != rxmsg->seq) + //{ + // status->packet_rx_drop_count++; + // status->current_seq++; + //} + status->current_rx_seq = rxmsg->seq; + // Initial condition: If no packet has been received so far, drop count is undefined + if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0; + // Count this packet as received + status->packet_rx_success_count++; + } + + r_message->len = rxmsg->len; // Provide visibility on how far we are into current msg + r_mavlink_status->parse_state = status->parse_state; + r_mavlink_status->packet_idx = status->packet_idx; + r_mavlink_status->current_rx_seq = status->current_rx_seq+1; + r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count; + r_mavlink_status->packet_rx_drop_count = status->parse_error; + status->parse_error = 0; + + if (status->msg_received == MAVLINK_FRAMING_BAD_CRC) { + /* + the CRC came out wrong. We now need to overwrite the + msg CRC with the one on the wire so that if the + caller decides to forward the message anyway that + mavlink_msg_to_send_buffer() won't overwrite the + checksum + */ + r_message->checksum = _MAV_PAYLOAD(rxmsg)[status->packet_idx] | (_MAV_PAYLOAD(rxmsg)[status->packet_idx+1]<<8); + } + + return status->msg_received; +} + +/** + * This is a convenience function which handles the complete MAVLink parsing. + * the function will parse one byte at a time and return the complete packet once + * it could be successfully decoded. This function will return 0, 1 or + * 2 (MAVLINK_FRAMING_INCOMPLETE, MAVLINK_FRAMING_OK or MAVLINK_FRAMING_BAD_CRC) + * + * Messages are parsed into an internal buffer (one for each channel). When a complete + * message is received it is copies into *returnMsg and the channel's status is + * copied into *returnStats. + * + * @param chan ID of the current channel. This allows to parse different channels with this function. + * a channel is not a physical message channel like a serial port, but a logic partition of + * the communication streams in this case. COMM_NB is the limit for the number of channels + * on MCU (e.g. ARM7), while COMM_NB_HIGH is the limit for the number of channels in Linux/Windows + * @param c The char to parse + * + * @param returnMsg NULL if no message could be decoded, the message data else + * @param returnStats if a message was decoded, this is filled with the channel's stats + * @return 0 if no message could be decoded, 1 on good message and CRC, 2 on bad CRC + * + * A typical use scenario of this function call is: + * + * @code + * #include + * + * mavlink_message_t msg; + * int chan = 0; + * + * + * while(serial.bytesAvailable > 0) + * { + * uint8_t byte = serial.getNextByte(); + * if (mavlink_frame_char(chan, byte, &msg) != MAVLINK_FRAMING_INCOMPLETE) + * { + * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); + * } + * } + * + * + * @endcode + */ +MAVLINK_HELPER uint8_t mavlink_frame_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status) +{ + return mavlink_frame_char_buffer(mavlink_get_channel_buffer(chan), + mavlink_get_channel_status(chan), + c, + r_message, + r_mavlink_status); +} + + +/** + * This is a convenience function which handles the complete MAVLink parsing. + * the function will parse one byte at a time and return the complete packet once + * it could be successfully decoded. This function will return 0 or 1. + * + * Messages are parsed into an internal buffer (one for each channel). When a complete + * message is received it is copies into *returnMsg and the channel's status is + * copied into *returnStats. + * + * @param chan ID of the current channel. This allows to parse different channels with this function. + * a channel is not a physical message channel like a serial port, but a logic partition of + * the communication streams in this case. COMM_NB is the limit for the number of channels + * on MCU (e.g. ARM7), while COMM_NB_HIGH is the limit for the number of channels in Linux/Windows + * @param c The char to parse + * + * @param returnMsg NULL if no message could be decoded, the message data else + * @param returnStats if a message was decoded, this is filled with the channel's stats + * @return 0 if no message could be decoded or bad CRC, 1 on good message and CRC + * + * A typical use scenario of this function call is: + * + * @code + * #include + * + * mavlink_message_t msg; + * int chan = 0; + * + * + * while(serial.bytesAvailable > 0) + * { + * uint8_t byte = serial.getNextByte(); + * if (mavlink_parse_char(chan, byte, &msg)) + * { + * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); + * } + * } + * + * + * @endcode + */ +MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_message_t* r_message, mavlink_status_t* r_mavlink_status) +{ + uint8_t msg_received = mavlink_frame_char(chan, c, r_message, r_mavlink_status); + if (msg_received == MAVLINK_FRAMING_BAD_CRC) { + // we got a bad CRC. Treat as a parse failure + mavlink_message_t* rxmsg = mavlink_get_channel_buffer(chan); + mavlink_status_t* status = mavlink_get_channel_status(chan); + status->parse_error++; + status->msg_received = MAVLINK_FRAMING_INCOMPLETE; + status->parse_state = MAVLINK_PARSE_STATE_IDLE; + if (c == MAVLINK_STX) + { + status->parse_state = MAVLINK_PARSE_STATE_GOT_STX; + rxmsg->len = 0; + mavlink_start_checksum(rxmsg); + } + return 0; + } + return msg_received; +} + +/** + * @brief Put a bitfield of length 1-32 bit into the buffer + * + * @param b the value to add, will be encoded in the bitfield + * @param bits number of bits to use to encode b, e.g. 1 for boolean, 2, 3, etc. + * @param packet_index the position in the packet (the index of the first byte to use) + * @param bit_index the position in the byte (the index of the first bit to use) + * @param buffer packet buffer to write into + * @return new position of the last used byte in the buffer + */ +MAVLINK_HELPER uint8_t put_bitfield_n_by_index(int32_t b, uint8_t bits, uint8_t packet_index, uint8_t bit_index, uint8_t* r_bit_index, uint8_t* buffer) +{ + uint16_t bits_remain = bits; + // Transform number into network order + int32_t v; + uint8_t i_bit_index, i_byte_index, curr_bits_n; +#if MAVLINK_NEED_BYTE_SWAP + union { + int32_t i; + uint8_t b[4]; + } bin, bout; + bin.i = b; + bout.b[0] = bin.b[3]; + bout.b[1] = bin.b[2]; + bout.b[2] = bin.b[1]; + bout.b[3] = bin.b[0]; + v = bout.i; +#else + v = b; +#endif + + // buffer in + // 01100000 01000000 00000000 11110001 + // buffer out + // 11110001 00000000 01000000 01100000 + + // Existing partly filled byte (four free slots) + // 0111xxxx + + // Mask n free bits + // 00001111 = 2^0 + 2^1 + 2^2 + 2^3 = 2^n - 1 + // = ((uint32_t)(1 << n)) - 1; // = 2^n - 1 + + // Shift n bits into the right position + // out = in >> n; + + // Mask and shift bytes + i_bit_index = bit_index; + i_byte_index = packet_index; + if (bit_index > 0) + { + // If bits were available at start, they were available + // in the byte before the current index + i_byte_index--; + } + + // While bits have not been packed yet + while (bits_remain > 0) + { + // Bits still have to be packed + // there can be more than 8 bits, so + // we might have to pack them into more than one byte + + // First pack everything we can into the current 'open' byte + //curr_bits_n = bits_remain << 3; // Equals bits_remain mod 8 + //FIXME + if (bits_remain <= (uint8_t)(8 - i_bit_index)) + { + // Enough space + curr_bits_n = (uint8_t)bits_remain; + } + else + { + curr_bits_n = (8 - i_bit_index); + } + + // Pack these n bits into the current byte + // Mask out whatever was at that position with ones (xxx11111) + buffer[i_byte_index] &= (0xFF >> (8 - curr_bits_n)); + // Put content to this position, by masking out the non-used part + buffer[i_byte_index] |= ((0x00 << curr_bits_n) & v); + + // Increment the bit index + i_bit_index += curr_bits_n; + + // Now proceed to the next byte, if necessary + bits_remain -= curr_bits_n; + if (bits_remain > 0) + { + // Offer another 8 bits / one byte + i_byte_index++; + i_bit_index = 0; + } + } + + *r_bit_index = i_bit_index; + // If a partly filled byte is present, mark this as consumed + if (i_bit_index != 7) i_byte_index++; + return i_byte_index - packet_index; +} + +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +// To make MAVLink work on your MCU, define comm_send_ch() if you wish +// to send 1 byte at a time, or MAVLINK_SEND_UART_BYTES() to send a +// whole packet at a time + +/* + +#include "mavlink_types.h" + +void comm_send_ch(mavlink_channel_t chan, uint8_t ch) +{ + if (chan == MAVLINK_COMM_0) + { + uart0_transmit(ch); + } + if (chan == MAVLINK_COMM_1) + { + uart1_transmit(ch); + } +} + */ + +MAVLINK_HELPER void _mavlink_send_uart(mavlink_channel_t chan, const char *buf, uint16_t len) +{ +#ifdef MAVLINK_SEND_UART_BYTES + /* this is the more efficient approach, if the platform + defines it */ + MAVLINK_SEND_UART_BYTES(chan, (const uint8_t *)buf, len); +#else + /* fallback to one byte at a time */ + uint16_t i; + for (i = 0; i < len; i++) { + comm_send_ch(chan, (uint8_t)buf[i]); + } +#endif +} +#endif // MAVLINK_USE_CONVENIENCE_FUNCTIONS + +#endif /* _MAVLINK_HELPERS_H_ */ diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_types.h b/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_types.h new file mode 100644 index 0000000..0a98ccc --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/mavlink_types.h @@ -0,0 +1,228 @@ +#ifndef MAVLINK_TYPES_H_ +#define MAVLINK_TYPES_H_ + +// Visual Studio versions before 2010 don't have stdint.h, so we just error out. +#if (defined _MSC_VER) && (_MSC_VER < 1600) +#error "The C-MAVLink implementation requires Visual Studio 2010 or greater" +#endif + +#include + +// Macro to define packed structures +#ifdef __GNUC__ + #define MAVPACKED( __Declaration__ ) __Declaration__ __attribute__((packed)) +#else + #define MAVPACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) ) +#endif + +#ifndef MAVLINK_MAX_PAYLOAD_LEN +// it is possible to override this, but be careful! +#define MAVLINK_MAX_PAYLOAD_LEN 255 ///< Maximum payload length +#endif + +#define MAVLINK_CORE_HEADER_LEN 5 ///< Length of core header (of the comm. layer): message length (1 byte) + message sequence (1 byte) + message system id (1 byte) + message component id (1 byte) + message type id (1 byte) +#define MAVLINK_NUM_HEADER_BYTES (MAVLINK_CORE_HEADER_LEN + 1) ///< Length of all header bytes, including core and checksum +#define MAVLINK_NUM_CHECKSUM_BYTES 2 +#define MAVLINK_NUM_NON_PAYLOAD_BYTES (MAVLINK_NUM_HEADER_BYTES + MAVLINK_NUM_CHECKSUM_BYTES) + +#define MAVLINK_MAX_PACKET_LEN (MAVLINK_MAX_PAYLOAD_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES) ///< Maximum packet length + +#define MAVLINK_MSG_ID_EXTENDED_MESSAGE 255 +#define MAVLINK_EXTENDED_HEADER_LEN 14 + +#if (defined _MSC_VER) || ((defined __APPLE__) && (defined __MACH__)) || (defined __linux__) + /* full fledged 32bit++ OS */ + #define MAVLINK_MAX_EXTENDED_PACKET_LEN 65507 +#else + /* small microcontrollers */ + #define MAVLINK_MAX_EXTENDED_PACKET_LEN 2048 +#endif + +#define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES) + + +/** + * Old-style 4 byte param union + * + * This struct is the data format to be used when sending + * parameters. The parameter should be copied to the native + * type (without type conversion) + * and re-instanted on the receiving side using the + * native type as well. + */ +MAVPACKED( +typedef struct param_union { + union { + float param_float; + int32_t param_int32; + uint32_t param_uint32; + int16_t param_int16; + uint16_t param_uint16; + int8_t param_int8; + uint8_t param_uint8; + uint8_t bytes[4]; + }; + uint8_t type; +}) mavlink_param_union_t; + + +/** + * New-style 8 byte param union + * mavlink_param_union_double_t will be 8 bytes long, and treated as needing 8 byte alignment for the purposes of MAVLink 1.0 field ordering. + * The mavlink_param_union_double_t will be treated as a little-endian structure. + * + * If is_double is 1 then the type is a double, and the remaining 63 bits are the double, with the lowest bit of the mantissa zero. + * The intention is that by replacing the is_double bit with 0 the type can be directly used as a double (as the is_double bit corresponds to the + * lowest mantissa bit of a double). If is_double is 0 then mavlink_type gives the type in the union. + * The mavlink_types.h header will also need to have shifts/masks to define the bit boundaries in the above, + * as bitfield ordering isn’t consistent between platforms. The above is intended to be for gcc on x86, + * which should be the same as gcc on little-endian arm. When using shifts/masks the value will be treated as a 64 bit unsigned number, + * and the bits pulled out using the shifts/masks. +*/ +MAVPACKED( +typedef struct param_union_extended { + union { + struct { + uint8_t is_double:1; + uint8_t mavlink_type:7; + union { + char c; + uint8_t uint8; + int8_t int8; + uint16_t uint16; + int16_t int16; + uint32_t uint32; + int32_t int32; + float f; + uint8_t align[7]; + }; + }; + uint8_t data[8]; + }; +}) mavlink_param_union_double_t; + +/** + * This structure is required to make the mavlink_send_xxx convenience functions + * work, as it tells the library what the current system and component ID are. + */ +MAVPACKED( +typedef struct __mavlink_system { + uint8_t sysid; ///< Used by the MAVLink message_xx_send() convenience function + uint8_t compid; ///< Used by the MAVLink message_xx_send() convenience function +}) mavlink_system_t; + +MAVPACKED( +typedef struct __mavlink_message { + uint16_t checksum; ///< sent at end of packet + uint8_t magic; ///< protocol magic marker + uint8_t len; ///< Length of payload + uint8_t seq; ///< Sequence of packet + uint8_t sysid; ///< ID of message sender system/aircraft + uint8_t compid; ///< ID of the message sender component + uint8_t msgid; ///< ID of message in payload + uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8]; +}) mavlink_message_t; + +MAVPACKED( +typedef struct __mavlink_extended_message { + mavlink_message_t base_msg; + int32_t extended_payload_len; ///< Length of extended payload if any + uint8_t extended_payload[MAVLINK_MAX_EXTENDED_PAYLOAD_LEN]; +}) mavlink_extended_message_t; + +typedef enum { + MAVLINK_TYPE_CHAR = 0, + MAVLINK_TYPE_UINT8_T = 1, + MAVLINK_TYPE_INT8_T = 2, + MAVLINK_TYPE_UINT16_T = 3, + MAVLINK_TYPE_INT16_T = 4, + MAVLINK_TYPE_UINT32_T = 5, + MAVLINK_TYPE_INT32_T = 6, + MAVLINK_TYPE_UINT64_T = 7, + MAVLINK_TYPE_INT64_T = 8, + MAVLINK_TYPE_FLOAT = 9, + MAVLINK_TYPE_DOUBLE = 10 +} mavlink_message_type_t; + +#define MAVLINK_MAX_FIELDS 64 + +typedef struct __mavlink_field_info { + const char *name; // name of this field + const char *print_format; // printing format hint, or NULL + mavlink_message_type_t type; // type of this field + unsigned int array_length; // if non-zero, field is an array + unsigned int wire_offset; // offset of each field in the payload + unsigned int structure_offset; // offset in a C structure +} mavlink_field_info_t; + +// note that in this structure the order of fields is the order +// in the XML file, not necessary the wire order +typedef struct __mavlink_message_info { + const char *name; // name of the message + unsigned num_fields; // how many fields in this message + mavlink_field_info_t fields[MAVLINK_MAX_FIELDS]; // field information +} mavlink_message_info_t; + +#define _MAV_PAYLOAD(msg) ((const char *)(&((msg)->payload64[0]))) +#define _MAV_PAYLOAD_NON_CONST(msg) ((char *)(&((msg)->payload64[0]))) + +// checksum is immediately after the payload bytes +#define mavlink_ck_a(msg) *((msg)->len + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg)) +#define mavlink_ck_b(msg) *(((msg)->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg)) + +typedef enum { + MAVLINK_COMM_0, + MAVLINK_COMM_1, + MAVLINK_COMM_2, + MAVLINK_COMM_3 +} mavlink_channel_t; + +/* + * applications can set MAVLINK_COMM_NUM_BUFFERS to the maximum number + * of buffers they will use. If more are used, then the result will be + * a stack overrun + */ +#ifndef MAVLINK_COMM_NUM_BUFFERS +#if (defined linux) | (defined __linux) | (defined __MACH__) | (defined _WIN32) +# define MAVLINK_COMM_NUM_BUFFERS 16 +#else +# define MAVLINK_COMM_NUM_BUFFERS 4 +#endif +#endif + +typedef enum { + MAVLINK_PARSE_STATE_UNINIT=0, + MAVLINK_PARSE_STATE_IDLE, + MAVLINK_PARSE_STATE_GOT_STX, + MAVLINK_PARSE_STATE_GOT_SEQ, + MAVLINK_PARSE_STATE_GOT_LENGTH, + MAVLINK_PARSE_STATE_GOT_SYSID, + MAVLINK_PARSE_STATE_GOT_COMPID, + MAVLINK_PARSE_STATE_GOT_MSGID, + MAVLINK_PARSE_STATE_GOT_PAYLOAD, + MAVLINK_PARSE_STATE_GOT_CRC1, + MAVLINK_PARSE_STATE_GOT_BAD_CRC1 +} mavlink_parse_state_t; ///< The state machine for the comm parser + +typedef enum { + MAVLINK_FRAMING_INCOMPLETE=0, + MAVLINK_FRAMING_OK=1, + MAVLINK_FRAMING_BAD_CRC=2 +} mavlink_framing_t; + +typedef struct __mavlink_status { + uint8_t msg_received; ///< Number of received messages + uint8_t buffer_overrun; ///< Number of buffer overruns + uint8_t parse_error; ///< Number of parse errors + mavlink_parse_state_t parse_state; ///< Parsing state machine + uint8_t packet_idx; ///< Index in current packet + uint8_t current_rx_seq; ///< Sequence number of last packet received + uint8_t current_tx_seq; ///< Sequence number of last packet sent + uint16_t packet_rx_success_count; ///< Received packets + uint16_t packet_rx_drop_count; ///< Number of packet drops +} mavlink_status_t; + +#define MAVLINK_BIG_ENDIAN 0 +#define MAVLINK_LITTLE_ENDIAN 1 + +#endif /* MAVLINK_TYPES_H_ */ diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink.h new file mode 100644 index 0000000..b4f9883 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink.h @@ -0,0 +1,35 @@ +/** @file + * @brief MAVLink comm protocol built from opencr_msg.xml + * @see http://mavlink.org + */ +#ifndef MAVLINK_H +#define MAVLINK_H + +#ifndef MAVLINK_STX +#define MAVLINK_STX 254 +#endif + +#ifndef MAVLINK_ENDIAN +#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN +#endif + +#ifndef MAVLINK_ALIGNED_FIELDS +#define MAVLINK_ALIGNED_FIELDS 1 +#endif + +#ifndef MAVLINK_CRC_EXTRA +#define MAVLINK_CRC_EXTRA 1 +#endif + +#ifndef MAVLINK_COMMAND_24BIT +#define MAVLINK_COMMAND_24BIT 0 +#endif + +#ifndef MAVLINK_PACKED +#define MAVLINK_PACKED __attribute__((__packed__)) +#endif + +#include "version.h" +#include "opencr_msg.h" + +#endif // MAVLINK_H diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_ack.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_ack.h new file mode 100644 index 0000000..cf53a05 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_ack.h @@ -0,0 +1,279 @@ +// MESSAGE ACK PACKING + +#define MAVLINK_MSG_ID_ACK 150 + +typedef struct MAVLINK_PACKED __mavlink_ack_t +{ + uint16_t err_code; /*< */ + uint8_t msg_id; /*< */ + uint8_t length; /*< */ + uint8_t data[16]; /*< */ +} mavlink_ack_t; + +#define MAVLINK_MSG_ID_ACK_LEN 20 +#define MAVLINK_MSG_ID_ACK_MIN_LEN 20 +#define MAVLINK_MSG_ID_150_LEN 20 +#define MAVLINK_MSG_ID_150_MIN_LEN 20 + +#define MAVLINK_MSG_ID_ACK_CRC 192 +#define MAVLINK_MSG_ID_150_CRC 192 + +#define MAVLINK_MSG_ACK_FIELD_DATA_LEN 16 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_ACK { \ + 150, \ + "ACK", \ + 4, \ + { { "err_code", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ack_t, err_code) }, \ + { "msg_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_ack_t, msg_id) }, \ + { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_ack_t, length) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 16, 4, offsetof(mavlink_ack_t, data) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_ACK { \ + "ACK", \ + 4, \ + { { "err_code", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ack_t, err_code) }, \ + { "msg_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_ack_t, msg_id) }, \ + { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_ack_t, length) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 16, 4, offsetof(mavlink_ack_t, data) }, \ + } \ +} +#endif + +/** + * @brief Pack a ack message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param msg_id + * @param err_code + * @param length + * @param data + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t msg_id, uint16_t err_code, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_ACK_LEN]; + _mav_put_uint16_t(buf, 0, err_code); + _mav_put_uint8_t(buf, 2, msg_id); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACK_LEN); +#else + mavlink_ack_t packet; + packet.err_code = err_code; + packet.msg_id = msg_id; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACK_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_ACK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACK_MIN_LEN, MAVLINK_MSG_ID_ACK_LEN, MAVLINK_MSG_ID_ACK_CRC); +} + +/** + * @brief Pack a ack message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param msg_id + * @param err_code + * @param length + * @param data + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t msg_id,uint16_t err_code,uint8_t length,const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_ACK_LEN]; + _mav_put_uint16_t(buf, 0, err_code); + _mav_put_uint8_t(buf, 2, msg_id); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACK_LEN); +#else + mavlink_ack_t packet; + packet.err_code = err_code; + packet.msg_id = msg_id; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACK_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_ACK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACK_MIN_LEN, MAVLINK_MSG_ID_ACK_LEN, MAVLINK_MSG_ID_ACK_CRC); +} + +/** + * @brief Encode a ack struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param ack C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ack_t* ack) +{ + return mavlink_msg_ack_pack(system_id, component_id, msg, ack->msg_id, ack->err_code, ack->length, ack->data); +} + +/** + * @brief Encode a ack struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param ack C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ack_t* ack) +{ + return mavlink_msg_ack_pack_chan(system_id, component_id, chan, msg, ack->msg_id, ack->err_code, ack->length, ack->data); +} + +/** + * @brief Send a ack message + * @param chan MAVLink channel to send the message + * + * @param msg_id + * @param err_code + * @param length + * @param data + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_ack_send(mavlink_channel_t chan, uint8_t msg_id, uint16_t err_code, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_ACK_LEN]; + _mav_put_uint16_t(buf, 0, err_code); + _mav_put_uint8_t(buf, 2, msg_id); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACK, buf, MAVLINK_MSG_ID_ACK_MIN_LEN, MAVLINK_MSG_ID_ACK_LEN, MAVLINK_MSG_ID_ACK_CRC); +#else + mavlink_ack_t packet; + packet.err_code = err_code; + packet.msg_id = msg_id; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACK, (const char *)&packet, MAVLINK_MSG_ID_ACK_MIN_LEN, MAVLINK_MSG_ID_ACK_LEN, MAVLINK_MSG_ID_ACK_CRC); +#endif +} + +/** + * @brief Send a ack message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_ack_send_struct(mavlink_channel_t chan, const mavlink_ack_t* ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_ack_send(chan, ack->msg_id, ack->err_code, ack->length, ack->data); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACK, (const char *)ack, MAVLINK_MSG_ID_ACK_MIN_LEN, MAVLINK_MSG_ID_ACK_LEN, MAVLINK_MSG_ID_ACK_CRC); +#endif +} + +#if MAVLINK_MSG_ID_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t msg_id, uint16_t err_code, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, err_code); + _mav_put_uint8_t(buf, 2, msg_id); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACK, buf, MAVLINK_MSG_ID_ACK_MIN_LEN, MAVLINK_MSG_ID_ACK_LEN, MAVLINK_MSG_ID_ACK_CRC); +#else + mavlink_ack_t *packet = (mavlink_ack_t *)msgbuf; + packet->err_code = err_code; + packet->msg_id = msg_id; + packet->length = length; + mav_array_memcpy(packet->data, data, sizeof(uint8_t)*16); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACK, (const char *)packet, MAVLINK_MSG_ID_ACK_MIN_LEN, MAVLINK_MSG_ID_ACK_LEN, MAVLINK_MSG_ID_ACK_CRC); +#endif +} +#endif + +#endif + +// MESSAGE ACK UNPACKING + + +/** + * @brief Get field msg_id from ack message + * + * @return + */ +static inline uint8_t mavlink_msg_ack_get_msg_id(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 2); +} + +/** + * @brief Get field err_code from ack message + * + * @return + */ +static inline uint16_t mavlink_msg_ack_get_err_code(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 0); +} + +/** + * @brief Get field length from ack message + * + * @return + */ +static inline uint8_t mavlink_msg_ack_get_length(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 3); +} + +/** + * @brief Get field data from ack message + * + * @return + */ +static inline uint16_t mavlink_msg_ack_get_data(const mavlink_message_t* msg, uint8_t *data) +{ + return _MAV_RETURN_uint8_t_array(msg, data, 16, 4); +} + +/** + * @brief Decode a ack message into a struct + * + * @param msg The message to decode + * @param ack C-struct to decode the message contents into + */ +static inline void mavlink_msg_ack_decode(const mavlink_message_t* msg, mavlink_ack_t* ack) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + ack->err_code = mavlink_msg_ack_get_err_code(msg); + ack->msg_id = mavlink_msg_ack_get_msg_id(msg); + ack->length = mavlink_msg_ack_get_length(msg); + mavlink_msg_ack_get_data(msg, ack->data); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_ACK_LEN? msg->len : MAVLINK_MSG_ID_ACK_LEN; + memset(ack, 0, MAVLINK_MSG_ID_ACK_LEN); + memcpy(ack, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_erase.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_erase.h new file mode 100644 index 0000000..abfddf3 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_erase.h @@ -0,0 +1,254 @@ +// MESSAGE FLASH_FW_ERASE PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_ERASE 158 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_erase_t +{ + uint32_t length; /*< */ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t param[8]; /*< */ +} mavlink_flash_fw_erase_t; + +#define MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN 13 +#define MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN 13 +#define MAVLINK_MSG_ID_158_LEN 13 +#define MAVLINK_MSG_ID_158_MIN_LEN 13 + +#define MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC 13 +#define MAVLINK_MSG_ID_158_CRC 13 + +#define MAVLINK_MSG_FLASH_FW_ERASE_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_ERASE { \ + 158, \ + "FLASH_FW_ERASE", \ + 3, \ + { { "length", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_erase_t, length) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_flash_fw_erase_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 5, offsetof(mavlink_flash_fw_erase_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_ERASE { \ + "FLASH_FW_ERASE", \ + 3, \ + { { "length", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_erase_t, length) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_flash_fw_erase_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 5, offsetof(mavlink_flash_fw_erase_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_erase message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param length + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_erase_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, uint32_t length, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN]; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t_array(buf, 5, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN); +#else + mavlink_flash_fw_erase_t packet; + packet.length = length; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_ERASE; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC); +} + +/** + * @brief Pack a flash_fw_erase message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param length + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_erase_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,uint32_t length,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN]; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t_array(buf, 5, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN); +#else + mavlink_flash_fw_erase_t packet; + packet.length = length; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_ERASE; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC); +} + +/** + * @brief Encode a flash_fw_erase struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_erase C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_erase_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_erase_t* flash_fw_erase) +{ + return mavlink_msg_flash_fw_erase_pack(system_id, component_id, msg, flash_fw_erase->resp, flash_fw_erase->length, flash_fw_erase->param); +} + +/** + * @brief Encode a flash_fw_erase struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_erase C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_erase_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_erase_t* flash_fw_erase) +{ + return mavlink_msg_flash_fw_erase_pack_chan(system_id, component_id, chan, msg, flash_fw_erase->resp, flash_fw_erase->length, flash_fw_erase->param); +} + +/** + * @brief Send a flash_fw_erase message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param length + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_erase_send(mavlink_channel_t chan, uint8_t resp, uint32_t length, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN]; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t_array(buf, 5, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_ERASE, buf, MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC); +#else + mavlink_flash_fw_erase_t packet; + packet.length = length; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_ERASE, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC); +#endif +} + +/** + * @brief Send a flash_fw_erase message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_erase_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_erase_t* flash_fw_erase) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_erase_send(chan, flash_fw_erase->resp, flash_fw_erase->length, flash_fw_erase->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_ERASE, (const char *)flash_fw_erase, MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_erase_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, uint32_t length, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t_array(buf, 5, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_ERASE, buf, MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC); +#else + mavlink_flash_fw_erase_t *packet = (mavlink_flash_fw_erase_t *)msgbuf; + packet->length = length; + packet->resp = resp; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_ERASE, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_ERASE_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN, MAVLINK_MSG_ID_FLASH_FW_ERASE_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_ERASE UNPACKING + + +/** + * @brief Get field resp from flash_fw_erase message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_erase_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 4); +} + +/** + * @brief Get field length from flash_fw_erase message + * + * @return + */ +static inline uint32_t mavlink_msg_flash_fw_erase_get_length(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 0); +} + +/** + * @brief Get field param from flash_fw_erase message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_erase_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 5); +} + +/** + * @brief Decode a flash_fw_erase message into a struct + * + * @param msg The message to decode + * @param flash_fw_erase C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_erase_decode(const mavlink_message_t* msg, mavlink_flash_fw_erase_t* flash_fw_erase) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_erase->length = mavlink_msg_flash_fw_erase_get_length(msg); + flash_fw_erase->resp = mavlink_msg_flash_fw_erase_get_resp(msg); + mavlink_msg_flash_fw_erase_get_param(msg, flash_fw_erase->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN; + memset(flash_fw_erase, 0, MAVLINK_MSG_ID_FLASH_FW_ERASE_LEN); + memcpy(flash_fw_erase, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_block.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_block.h new file mode 100644 index 0000000..a553f11 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_block.h @@ -0,0 +1,262 @@ +// MESSAGE FLASH_FW_READ_BLOCK PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK 161 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_read_block_t +{ + uint32_t addr; /*< */ + uint16_t length; /*< */ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ +} mavlink_flash_fw_read_block_t; + +#define MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN 7 +#define MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN 7 +#define MAVLINK_MSG_ID_161_LEN 7 +#define MAVLINK_MSG_ID_161_MIN_LEN 7 + +#define MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC 131 +#define MAVLINK_MSG_ID_161_CRC 131 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_READ_BLOCK { \ + 161, \ + "FLASH_FW_READ_BLOCK", \ + 3, \ + { { "addr", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_read_block_t, addr) }, \ + { "length", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_flash_fw_read_block_t, length) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_flash_fw_read_block_t, resp) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_READ_BLOCK { \ + "FLASH_FW_READ_BLOCK", \ + 3, \ + { { "addr", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_read_block_t, addr) }, \ + { "length", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_flash_fw_read_block_t, length) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_flash_fw_read_block_t, resp) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_read_block message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_read_block_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, uint32_t addr, uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN); +#else + mavlink_flash_fw_read_block_t packet; + packet.addr = addr; + packet.length = length; + packet.resp = resp; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC); +} + +/** + * @brief Pack a flash_fw_read_block message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_read_block_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,uint32_t addr,uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN); +#else + mavlink_flash_fw_read_block_t packet; + packet.addr = addr; + packet.length = length; + packet.resp = resp; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC); +} + +/** + * @brief Encode a flash_fw_read_block struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_read_block C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_read_block_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_read_block_t* flash_fw_read_block) +{ + return mavlink_msg_flash_fw_read_block_pack(system_id, component_id, msg, flash_fw_read_block->resp, flash_fw_read_block->addr, flash_fw_read_block->length); +} + +/** + * @brief Encode a flash_fw_read_block struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_read_block C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_read_block_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_read_block_t* flash_fw_read_block) +{ + return mavlink_msg_flash_fw_read_block_pack_chan(system_id, component_id, chan, msg, flash_fw_read_block->resp, flash_fw_read_block->addr, flash_fw_read_block->length); +} + +/** + * @brief Send a flash_fw_read_block message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_read_block_send(mavlink_channel_t chan, uint8_t resp, uint32_t addr, uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK, buf, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC); +#else + mavlink_flash_fw_read_block_t packet; + packet.addr = addr; + packet.length = length; + packet.resp = resp; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC); +#endif +} + +/** + * @brief Send a flash_fw_read_block message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_read_block_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_read_block_t* flash_fw_read_block) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_read_block_send(chan, flash_fw_read_block->resp, flash_fw_read_block->addr, flash_fw_read_block->length); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK, (const char *)flash_fw_read_block, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_read_block_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, uint32_t addr, uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK, buf, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC); +#else + mavlink_flash_fw_read_block_t *packet = (mavlink_flash_fw_read_block_t *)msgbuf; + packet->addr = addr; + packet->length = length; + packet->resp = resp; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_READ_BLOCK UNPACKING + + +/** + * @brief Get field resp from flash_fw_read_block message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_read_block_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 6); +} + +/** + * @brief Get field addr from flash_fw_read_block message + * + * @return + */ +static inline uint32_t mavlink_msg_flash_fw_read_block_get_addr(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 0); +} + +/** + * @brief Get field length from flash_fw_read_block message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_read_block_get_length(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 4); +} + +/** + * @brief Decode a flash_fw_read_block message into a struct + * + * @param msg The message to decode + * @param flash_fw_read_block C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_read_block_decode(const mavlink_message_t* msg, mavlink_flash_fw_read_block_t* flash_fw_read_block) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_read_block->addr = mavlink_msg_flash_fw_read_block_get_addr(msg); + flash_fw_read_block->length = mavlink_msg_flash_fw_read_block_get_length(msg); + flash_fw_read_block->resp = mavlink_msg_flash_fw_read_block_get_resp(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN; + memset(flash_fw_read_block, 0, MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK_LEN); + memcpy(flash_fw_read_block, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_packet.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_packet.h new file mode 100644 index 0000000..f3e2dec --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_packet.h @@ -0,0 +1,279 @@ +// MESSAGE FLASH_FW_READ_PACKET PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_READ_PACKET 160 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_read_packet_t +{ + uint32_t addr; /*< */ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t length; /*< */ + uint8_t data[128]; /*< */ +} mavlink_flash_fw_read_packet_t; + +#define MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN 134 +#define MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN 134 +#define MAVLINK_MSG_ID_160_LEN 134 +#define MAVLINK_MSG_ID_160_MIN_LEN 134 + +#define MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC 9 +#define MAVLINK_MSG_ID_160_CRC 9 + +#define MAVLINK_MSG_FLASH_FW_READ_PACKET_FIELD_DATA_LEN 128 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_READ_PACKET { \ + 160, \ + "FLASH_FW_READ_PACKET", \ + 4, \ + { { "addr", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_read_packet_t, addr) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_flash_fw_read_packet_t, resp) }, \ + { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_flash_fw_read_packet_t, length) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 128, 6, offsetof(mavlink_flash_fw_read_packet_t, data) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_READ_PACKET { \ + "FLASH_FW_READ_PACKET", \ + 4, \ + { { "addr", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_read_packet_t, addr) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_flash_fw_read_packet_t, resp) }, \ + { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_flash_fw_read_packet_t, length) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 128, 6, offsetof(mavlink_flash_fw_read_packet_t, data) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_read_packet message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @param data + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_read_packet_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, uint32_t addr, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t(buf, 5, length); + _mav_put_uint8_t_array(buf, 6, data, 128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN); +#else + mavlink_flash_fw_read_packet_t packet; + packet.addr = addr; + packet.resp = resp; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_READ_PACKET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC); +} + +/** + * @brief Pack a flash_fw_read_packet message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @param data + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_read_packet_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,uint32_t addr,uint8_t length,const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t(buf, 5, length); + _mav_put_uint8_t_array(buf, 6, data, 128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN); +#else + mavlink_flash_fw_read_packet_t packet; + packet.addr = addr; + packet.resp = resp; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_READ_PACKET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC); +} + +/** + * @brief Encode a flash_fw_read_packet struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_read_packet C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_read_packet_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_read_packet_t* flash_fw_read_packet) +{ + return mavlink_msg_flash_fw_read_packet_pack(system_id, component_id, msg, flash_fw_read_packet->resp, flash_fw_read_packet->addr, flash_fw_read_packet->length, flash_fw_read_packet->data); +} + +/** + * @brief Encode a flash_fw_read_packet struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_read_packet C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_read_packet_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_read_packet_t* flash_fw_read_packet) +{ + return mavlink_msg_flash_fw_read_packet_pack_chan(system_id, component_id, chan, msg, flash_fw_read_packet->resp, flash_fw_read_packet->addr, flash_fw_read_packet->length, flash_fw_read_packet->data); +} + +/** + * @brief Send a flash_fw_read_packet message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @param data + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_read_packet_send(mavlink_channel_t chan, uint8_t resp, uint32_t addr, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t(buf, 5, length); + _mav_put_uint8_t_array(buf, 6, data, 128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET, buf, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC); +#else + mavlink_flash_fw_read_packet_t packet; + packet.addr = addr; + packet.resp = resp; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC); +#endif +} + +/** + * @brief Send a flash_fw_read_packet message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_read_packet_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_read_packet_t* flash_fw_read_packet) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_read_packet_send(chan, flash_fw_read_packet->resp, flash_fw_read_packet->addr, flash_fw_read_packet->length, flash_fw_read_packet->data); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET, (const char *)flash_fw_read_packet, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_read_packet_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, uint32_t addr, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint8_t(buf, 4, resp); + _mav_put_uint8_t(buf, 5, length); + _mav_put_uint8_t_array(buf, 6, data, 128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET, buf, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC); +#else + mavlink_flash_fw_read_packet_t *packet = (mavlink_flash_fw_read_packet_t *)msgbuf; + packet->addr = addr; + packet->resp = resp; + packet->length = length; + mav_array_memcpy(packet->data, data, sizeof(uint8_t)*128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_READ_PACKET UNPACKING + + +/** + * @brief Get field resp from flash_fw_read_packet message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_read_packet_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 4); +} + +/** + * @brief Get field addr from flash_fw_read_packet message + * + * @return + */ +static inline uint32_t mavlink_msg_flash_fw_read_packet_get_addr(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 0); +} + +/** + * @brief Get field length from flash_fw_read_packet message + * + * @return + */ +static inline uint8_t mavlink_msg_flash_fw_read_packet_get_length(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 5); +} + +/** + * @brief Get field data from flash_fw_read_packet message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_read_packet_get_data(const mavlink_message_t* msg, uint8_t *data) +{ + return _MAV_RETURN_uint8_t_array(msg, data, 128, 6); +} + +/** + * @brief Decode a flash_fw_read_packet message into a struct + * + * @param msg The message to decode + * @param flash_fw_read_packet C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_read_packet_decode(const mavlink_message_t* msg, mavlink_flash_fw_read_packet_t* flash_fw_read_packet) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_read_packet->addr = mavlink_msg_flash_fw_read_packet_get_addr(msg); + flash_fw_read_packet->resp = mavlink_msg_flash_fw_read_packet_get_resp(msg); + flash_fw_read_packet->length = mavlink_msg_flash_fw_read_packet_get_length(msg); + mavlink_msg_flash_fw_read_packet_get_data(msg, flash_fw_read_packet->data); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN; + memset(flash_fw_read_packet, 0, MAVLINK_MSG_ID_FLASH_FW_READ_PACKET_LEN); + memcpy(flash_fw_read_packet, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_verify.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_verify.h new file mode 100644 index 0000000..e9f395d --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_verify.h @@ -0,0 +1,279 @@ +// MESSAGE FLASH_FW_VERIFY PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_VERIFY 159 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_verify_t +{ + uint32_t length; /*< */ + uint32_t crc; /*< */ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t param[8]; /*< */ +} mavlink_flash_fw_verify_t; + +#define MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN 17 +#define MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN 17 +#define MAVLINK_MSG_ID_159_LEN 17 +#define MAVLINK_MSG_ID_159_MIN_LEN 17 + +#define MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC 31 +#define MAVLINK_MSG_ID_159_CRC 31 + +#define MAVLINK_MSG_FLASH_FW_VERIFY_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_VERIFY { \ + 159, \ + "FLASH_FW_VERIFY", \ + 4, \ + { { "length", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_verify_t, length) }, \ + { "crc", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_flash_fw_verify_t, crc) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_flash_fw_verify_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 9, offsetof(mavlink_flash_fw_verify_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_VERIFY { \ + "FLASH_FW_VERIFY", \ + 4, \ + { { "length", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_verify_t, length) }, \ + { "crc", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_flash_fw_verify_t, crc) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_flash_fw_verify_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 9, offsetof(mavlink_flash_fw_verify_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_verify message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param length + * @param crc + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_verify_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, uint32_t length, uint32_t crc, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN]; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint32_t(buf, 4, crc); + _mav_put_uint8_t(buf, 8, resp); + _mav_put_uint8_t_array(buf, 9, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN); +#else + mavlink_flash_fw_verify_t packet; + packet.length = length; + packet.crc = crc; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_VERIFY; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC); +} + +/** + * @brief Pack a flash_fw_verify message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param length + * @param crc + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_verify_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,uint32_t length,uint32_t crc,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN]; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint32_t(buf, 4, crc); + _mav_put_uint8_t(buf, 8, resp); + _mav_put_uint8_t_array(buf, 9, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN); +#else + mavlink_flash_fw_verify_t packet; + packet.length = length; + packet.crc = crc; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_VERIFY; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC); +} + +/** + * @brief Encode a flash_fw_verify struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_verify C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_verify_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_verify_t* flash_fw_verify) +{ + return mavlink_msg_flash_fw_verify_pack(system_id, component_id, msg, flash_fw_verify->resp, flash_fw_verify->length, flash_fw_verify->crc, flash_fw_verify->param); +} + +/** + * @brief Encode a flash_fw_verify struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_verify C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_verify_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_verify_t* flash_fw_verify) +{ + return mavlink_msg_flash_fw_verify_pack_chan(system_id, component_id, chan, msg, flash_fw_verify->resp, flash_fw_verify->length, flash_fw_verify->crc, flash_fw_verify->param); +} + +/** + * @brief Send a flash_fw_verify message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param length + * @param crc + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_verify_send(mavlink_channel_t chan, uint8_t resp, uint32_t length, uint32_t crc, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN]; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint32_t(buf, 4, crc); + _mav_put_uint8_t(buf, 8, resp); + _mav_put_uint8_t_array(buf, 9, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_VERIFY, buf, MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC); +#else + mavlink_flash_fw_verify_t packet; + packet.length = length; + packet.crc = crc; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_VERIFY, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC); +#endif +} + +/** + * @brief Send a flash_fw_verify message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_verify_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_verify_t* flash_fw_verify) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_verify_send(chan, flash_fw_verify->resp, flash_fw_verify->length, flash_fw_verify->crc, flash_fw_verify->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_VERIFY, (const char *)flash_fw_verify, MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_verify_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, uint32_t length, uint32_t crc, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, length); + _mav_put_uint32_t(buf, 4, crc); + _mav_put_uint8_t(buf, 8, resp); + _mav_put_uint8_t_array(buf, 9, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_VERIFY, buf, MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC); +#else + mavlink_flash_fw_verify_t *packet = (mavlink_flash_fw_verify_t *)msgbuf; + packet->length = length; + packet->crc = crc; + packet->resp = resp; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_VERIFY, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_VERIFY_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN, MAVLINK_MSG_ID_FLASH_FW_VERIFY_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_VERIFY UNPACKING + + +/** + * @brief Get field resp from flash_fw_verify message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_verify_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 8); +} + +/** + * @brief Get field length from flash_fw_verify message + * + * @return + */ +static inline uint32_t mavlink_msg_flash_fw_verify_get_length(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 0); +} + +/** + * @brief Get field crc from flash_fw_verify message + * + * @return + */ +static inline uint32_t mavlink_msg_flash_fw_verify_get_crc(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 4); +} + +/** + * @brief Get field param from flash_fw_verify message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_verify_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 9); +} + +/** + * @brief Decode a flash_fw_verify message into a struct + * + * @param msg The message to decode + * @param flash_fw_verify C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_verify_decode(const mavlink_message_t* msg, mavlink_flash_fw_verify_t* flash_fw_verify) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_verify->length = mavlink_msg_flash_fw_verify_get_length(msg); + flash_fw_verify->crc = mavlink_msg_flash_fw_verify_get_crc(msg); + flash_fw_verify->resp = mavlink_msg_flash_fw_verify_get_resp(msg); + mavlink_msg_flash_fw_verify_get_param(msg, flash_fw_verify->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN; + memset(flash_fw_verify, 0, MAVLINK_MSG_ID_FLASH_FW_VERIFY_LEN); + memcpy(flash_fw_verify, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_begin.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_begin.h new file mode 100644 index 0000000..f21f4bd --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_begin.h @@ -0,0 +1,229 @@ +// MESSAGE FLASH_FW_WRITE_BEGIN PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN 154 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_write_begin_t +{ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t param[8]; /*< */ +} mavlink_flash_fw_write_begin_t; + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN 9 +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN 9 +#define MAVLINK_MSG_ID_154_LEN 9 +#define MAVLINK_MSG_ID_154_MIN_LEN 9 + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC 8 +#define MAVLINK_MSG_ID_154_CRC 8 + +#define MAVLINK_MSG_FLASH_FW_WRITE_BEGIN_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_BEGIN { \ + 154, \ + "FLASH_FW_WRITE_BEGIN", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_flash_fw_write_begin_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_flash_fw_write_begin_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_BEGIN { \ + "FLASH_FW_WRITE_BEGIN", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_flash_fw_write_begin_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_flash_fw_write_begin_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_write_begin message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_begin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN); +#else + mavlink_flash_fw_write_begin_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC); +} + +/** + * @brief Pack a flash_fw_write_begin message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_begin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN); +#else + mavlink_flash_fw_write_begin_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC); +} + +/** + * @brief Encode a flash_fw_write_begin struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_begin C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_begin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_write_begin_t* flash_fw_write_begin) +{ + return mavlink_msg_flash_fw_write_begin_pack(system_id, component_id, msg, flash_fw_write_begin->resp, flash_fw_write_begin->param); +} + +/** + * @brief Encode a flash_fw_write_begin struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_begin C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_begin_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_write_begin_t* flash_fw_write_begin) +{ + return mavlink_msg_flash_fw_write_begin_pack_chan(system_id, component_id, chan, msg, flash_fw_write_begin->resp, flash_fw_write_begin->param); +} + +/** + * @brief Send a flash_fw_write_begin message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_write_begin_send(mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC); +#else + mavlink_flash_fw_write_begin_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC); +#endif +} + +/** + * @brief Send a flash_fw_write_begin message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_write_begin_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_write_begin_t* flash_fw_write_begin) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_write_begin_send(chan, flash_fw_write_begin->resp, flash_fw_write_begin->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN, (const char *)flash_fw_write_begin, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_write_begin_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC); +#else + mavlink_flash_fw_write_begin_t *packet = (mavlink_flash_fw_write_begin_t *)msgbuf; + packet->resp = resp; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_WRITE_BEGIN UNPACKING + + +/** + * @brief Get field resp from flash_fw_write_begin message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_write_begin_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 0); +} + +/** + * @brief Get field param from flash_fw_write_begin message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_write_begin_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 1); +} + +/** + * @brief Decode a flash_fw_write_begin message into a struct + * + * @param msg The message to decode + * @param flash_fw_write_begin C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_write_begin_decode(const mavlink_message_t* msg, mavlink_flash_fw_write_begin_t* flash_fw_write_begin) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_write_begin->resp = mavlink_msg_flash_fw_write_begin_get_resp(msg); + mavlink_msg_flash_fw_write_begin_get_param(msg, flash_fw_write_begin->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN; + memset(flash_fw_write_begin, 0, MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN_LEN); + memcpy(flash_fw_write_begin, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_block.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_block.h new file mode 100644 index 0000000..6ce37e5 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_block.h @@ -0,0 +1,262 @@ +// MESSAGE FLASH_FW_WRITE_BLOCK PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK 157 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_write_block_t +{ + uint32_t addr; /*< */ + uint16_t length; /*< */ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ +} mavlink_flash_fw_write_block_t; + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN 7 +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN 7 +#define MAVLINK_MSG_ID_157_LEN 7 +#define MAVLINK_MSG_ID_157_MIN_LEN 7 + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC 226 +#define MAVLINK_MSG_ID_157_CRC 226 + + + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_BLOCK { \ + 157, \ + "FLASH_FW_WRITE_BLOCK", \ + 3, \ + { { "addr", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_write_block_t, addr) }, \ + { "length", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_flash_fw_write_block_t, length) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_flash_fw_write_block_t, resp) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_BLOCK { \ + "FLASH_FW_WRITE_BLOCK", \ + 3, \ + { { "addr", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_flash_fw_write_block_t, addr) }, \ + { "length", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_flash_fw_write_block_t, length) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_flash_fw_write_block_t, resp) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_write_block message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_block_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, uint32_t addr, uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN); +#else + mavlink_flash_fw_write_block_t packet; + packet.addr = addr; + packet.length = length; + packet.resp = resp; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC); +} + +/** + * @brief Pack a flash_fw_write_block message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_block_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,uint32_t addr,uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN); +#else + mavlink_flash_fw_write_block_t packet; + packet.addr = addr; + packet.length = length; + packet.resp = resp; + + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC); +} + +/** + * @brief Encode a flash_fw_write_block struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_block C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_block_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_write_block_t* flash_fw_write_block) +{ + return mavlink_msg_flash_fw_write_block_pack(system_id, component_id, msg, flash_fw_write_block->resp, flash_fw_write_block->addr, flash_fw_write_block->length); +} + +/** + * @brief Encode a flash_fw_write_block struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_block C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_block_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_write_block_t* flash_fw_write_block) +{ + return mavlink_msg_flash_fw_write_block_pack_chan(system_id, component_id, chan, msg, flash_fw_write_block->resp, flash_fw_write_block->addr, flash_fw_write_block->length); +} + +/** + * @brief Send a flash_fw_write_block message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_write_block_send(mavlink_channel_t chan, uint8_t resp, uint32_t addr, uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN]; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC); +#else + mavlink_flash_fw_write_block_t packet; + packet.addr = addr; + packet.length = length; + packet.resp = resp; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC); +#endif +} + +/** + * @brief Send a flash_fw_write_block message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_write_block_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_write_block_t* flash_fw_write_block) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_write_block_send(chan, flash_fw_write_block->resp, flash_fw_write_block->addr, flash_fw_write_block->length); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK, (const char *)flash_fw_write_block, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_write_block_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, uint32_t addr, uint16_t length) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint32_t(buf, 0, addr); + _mav_put_uint16_t(buf, 4, length); + _mav_put_uint8_t(buf, 6, resp); + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC); +#else + mavlink_flash_fw_write_block_t *packet = (mavlink_flash_fw_write_block_t *)msgbuf; + packet->addr = addr; + packet->length = length; + packet->resp = resp; + + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_WRITE_BLOCK UNPACKING + + +/** + * @brief Get field resp from flash_fw_write_block message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_write_block_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 6); +} + +/** + * @brief Get field addr from flash_fw_write_block message + * + * @return + */ +static inline uint32_t mavlink_msg_flash_fw_write_block_get_addr(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint32_t(msg, 0); +} + +/** + * @brief Get field length from flash_fw_write_block message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_write_block_get_length(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 4); +} + +/** + * @brief Decode a flash_fw_write_block message into a struct + * + * @param msg The message to decode + * @param flash_fw_write_block C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_write_block_decode(const mavlink_message_t* msg, mavlink_flash_fw_write_block_t* flash_fw_write_block) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_write_block->addr = mavlink_msg_flash_fw_write_block_get_addr(msg); + flash_fw_write_block->length = mavlink_msg_flash_fw_write_block_get_length(msg); + flash_fw_write_block->resp = mavlink_msg_flash_fw_write_block_get_resp(msg); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN; + memset(flash_fw_write_block, 0, MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK_LEN); + memcpy(flash_fw_write_block, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_end.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_end.h new file mode 100644 index 0000000..fd1af83 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_end.h @@ -0,0 +1,229 @@ +// MESSAGE FLASH_FW_WRITE_END PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_END 155 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_write_end_t +{ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t param[8]; /*< */ +} mavlink_flash_fw_write_end_t; + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN 9 +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN 9 +#define MAVLINK_MSG_ID_155_LEN 9 +#define MAVLINK_MSG_ID_155_MIN_LEN 9 + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC 48 +#define MAVLINK_MSG_ID_155_CRC 48 + +#define MAVLINK_MSG_FLASH_FW_WRITE_END_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_END { \ + 155, \ + "FLASH_FW_WRITE_END", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_flash_fw_write_end_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_flash_fw_write_end_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_END { \ + "FLASH_FW_WRITE_END", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_flash_fw_write_end_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_flash_fw_write_end_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_write_end message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_end_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN); +#else + mavlink_flash_fw_write_end_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_END; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC); +} + +/** + * @brief Pack a flash_fw_write_end message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_end_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN); +#else + mavlink_flash_fw_write_end_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_END; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC); +} + +/** + * @brief Encode a flash_fw_write_end struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_end C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_end_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_write_end_t* flash_fw_write_end) +{ + return mavlink_msg_flash_fw_write_end_pack(system_id, component_id, msg, flash_fw_write_end->resp, flash_fw_write_end->param); +} + +/** + * @brief Encode a flash_fw_write_end struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_end C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_end_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_write_end_t* flash_fw_write_end) +{ + return mavlink_msg_flash_fw_write_end_pack_chan(system_id, component_id, chan, msg, flash_fw_write_end->resp, flash_fw_write_end->param); +} + +/** + * @brief Send a flash_fw_write_end message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_write_end_send(mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_END, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC); +#else + mavlink_flash_fw_write_end_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_END, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC); +#endif +} + +/** + * @brief Send a flash_fw_write_end message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_write_end_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_write_end_t* flash_fw_write_end) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_write_end_send(chan, flash_fw_write_end->resp, flash_fw_write_end->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_END, (const char *)flash_fw_write_end, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_write_end_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_END, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC); +#else + mavlink_flash_fw_write_end_t *packet = (mavlink_flash_fw_write_end_t *)msgbuf; + packet->resp = resp; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_END, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_WRITE_END UNPACKING + + +/** + * @brief Get field resp from flash_fw_write_end message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_write_end_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 0); +} + +/** + * @brief Get field param from flash_fw_write_end message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_write_end_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 1); +} + +/** + * @brief Decode a flash_fw_write_end message into a struct + * + * @param msg The message to decode + * @param flash_fw_write_end C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_write_end_decode(const mavlink_message_t* msg, mavlink_flash_fw_write_end_t* flash_fw_write_end) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_write_end->resp = mavlink_msg_flash_fw_write_end_get_resp(msg); + mavlink_msg_flash_fw_write_end_get_param(msg, flash_fw_write_end->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN; + memset(flash_fw_write_end, 0, MAVLINK_MSG_ID_FLASH_FW_WRITE_END_LEN); + memcpy(flash_fw_write_end, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_packet.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_packet.h new file mode 100644 index 0000000..556f51d --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_packet.h @@ -0,0 +1,279 @@ +// MESSAGE FLASH_FW_WRITE_PACKET PACKING + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET 156 + +typedef struct MAVLINK_PACKED __mavlink_flash_fw_write_packet_t +{ + uint16_t addr; /*< */ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t length; /*< */ + uint8_t data[128]; /*< */ +} mavlink_flash_fw_write_packet_t; + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN 132 +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN 132 +#define MAVLINK_MSG_ID_156_LEN 132 +#define MAVLINK_MSG_ID_156_MIN_LEN 132 + +#define MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC 233 +#define MAVLINK_MSG_ID_156_CRC 233 + +#define MAVLINK_MSG_FLASH_FW_WRITE_PACKET_FIELD_DATA_LEN 128 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_PACKET { \ + 156, \ + "FLASH_FW_WRITE_PACKET", \ + 4, \ + { { "addr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_flash_fw_write_packet_t, addr) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_flash_fw_write_packet_t, resp) }, \ + { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_flash_fw_write_packet_t, length) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 128, 4, offsetof(mavlink_flash_fw_write_packet_t, data) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_PACKET { \ + "FLASH_FW_WRITE_PACKET", \ + 4, \ + { { "addr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_flash_fw_write_packet_t, addr) }, \ + { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_flash_fw_write_packet_t, resp) }, \ + { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_flash_fw_write_packet_t, length) }, \ + { "data", NULL, MAVLINK_TYPE_UINT8_T, 128, 4, offsetof(mavlink_flash_fw_write_packet_t, data) }, \ + } \ +} +#endif + +/** + * @brief Pack a flash_fw_write_packet message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @param data + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_packet_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, uint16_t addr, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN]; + _mav_put_uint16_t(buf, 0, addr); + _mav_put_uint8_t(buf, 2, resp); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN); +#else + mavlink_flash_fw_write_packet_t packet; + packet.addr = addr; + packet.resp = resp; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC); +} + +/** + * @brief Pack a flash_fw_write_packet message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @param data + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_flash_fw_write_packet_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,uint16_t addr,uint8_t length,const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN]; + _mav_put_uint16_t(buf, 0, addr); + _mav_put_uint8_t(buf, 2, resp); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN); +#else + mavlink_flash_fw_write_packet_t packet; + packet.addr = addr; + packet.resp = resp; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*128); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC); +} + +/** + * @brief Encode a flash_fw_write_packet struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_packet C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_packet_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flash_fw_write_packet_t* flash_fw_write_packet) +{ + return mavlink_msg_flash_fw_write_packet_pack(system_id, component_id, msg, flash_fw_write_packet->resp, flash_fw_write_packet->addr, flash_fw_write_packet->length, flash_fw_write_packet->data); +} + +/** + * @brief Encode a flash_fw_write_packet struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param flash_fw_write_packet C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_flash_fw_write_packet_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flash_fw_write_packet_t* flash_fw_write_packet) +{ + return mavlink_msg_flash_fw_write_packet_pack_chan(system_id, component_id, chan, msg, flash_fw_write_packet->resp, flash_fw_write_packet->addr, flash_fw_write_packet->length, flash_fw_write_packet->data); +} + +/** + * @brief Send a flash_fw_write_packet message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param addr + * @param length + * @param data + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_flash_fw_write_packet_send(mavlink_channel_t chan, uint8_t resp, uint16_t addr, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN]; + _mav_put_uint16_t(buf, 0, addr); + _mav_put_uint8_t(buf, 2, resp); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC); +#else + mavlink_flash_fw_write_packet_t packet; + packet.addr = addr; + packet.resp = resp; + packet.length = length; + mav_array_memcpy(packet.data, data, sizeof(uint8_t)*128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET, (const char *)&packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC); +#endif +} + +/** + * @brief Send a flash_fw_write_packet message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_flash_fw_write_packet_send_struct(mavlink_channel_t chan, const mavlink_flash_fw_write_packet_t* flash_fw_write_packet) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_flash_fw_write_packet_send(chan, flash_fw_write_packet->resp, flash_fw_write_packet->addr, flash_fw_write_packet->length, flash_fw_write_packet->data); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET, (const char *)flash_fw_write_packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC); +#endif +} + +#if MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_flash_fw_write_packet_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, uint16_t addr, uint8_t length, const uint8_t *data) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint16_t(buf, 0, addr); + _mav_put_uint8_t(buf, 2, resp); + _mav_put_uint8_t(buf, 3, length); + _mav_put_uint8_t_array(buf, 4, data, 128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET, buf, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC); +#else + mavlink_flash_fw_write_packet_t *packet = (mavlink_flash_fw_write_packet_t *)msgbuf; + packet->addr = addr; + packet->resp = resp; + packet->length = length; + mav_array_memcpy(packet->data, data, sizeof(uint8_t)*128); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET, (const char *)packet, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_MIN_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_CRC); +#endif +} +#endif + +#endif + +// MESSAGE FLASH_FW_WRITE_PACKET UNPACKING + + +/** + * @brief Get field resp from flash_fw_write_packet message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_flash_fw_write_packet_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 2); +} + +/** + * @brief Get field addr from flash_fw_write_packet message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_write_packet_get_addr(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 0); +} + +/** + * @brief Get field length from flash_fw_write_packet message + * + * @return + */ +static inline uint8_t mavlink_msg_flash_fw_write_packet_get_length(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 3); +} + +/** + * @brief Get field data from flash_fw_write_packet message + * + * @return + */ +static inline uint16_t mavlink_msg_flash_fw_write_packet_get_data(const mavlink_message_t* msg, uint8_t *data) +{ + return _MAV_RETURN_uint8_t_array(msg, data, 128, 4); +} + +/** + * @brief Decode a flash_fw_write_packet message into a struct + * + * @param msg The message to decode + * @param flash_fw_write_packet C-struct to decode the message contents into + */ +static inline void mavlink_msg_flash_fw_write_packet_decode(const mavlink_message_t* msg, mavlink_flash_fw_write_packet_t* flash_fw_write_packet) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + flash_fw_write_packet->addr = mavlink_msg_flash_fw_write_packet_get_addr(msg); + flash_fw_write_packet->resp = mavlink_msg_flash_fw_write_packet_get_resp(msg); + flash_fw_write_packet->length = mavlink_msg_flash_fw_write_packet_get_length(msg); + mavlink_msg_flash_fw_write_packet_get_data(msg, flash_fw_write_packet->data); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN? msg->len : MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN; + memset(flash_fw_write_packet, 0, MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET_LEN); + memcpy(flash_fw_write_packet, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_jump_to_fw.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_jump_to_fw.h new file mode 100644 index 0000000..091416d --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_jump_to_fw.h @@ -0,0 +1,229 @@ +// MESSAGE JUMP_TO_FW PACKING + +#define MAVLINK_MSG_ID_JUMP_TO_FW 162 + +typedef struct MAVLINK_PACKED __mavlink_jump_to_fw_t +{ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t param[8]; /*< */ +} mavlink_jump_to_fw_t; + +#define MAVLINK_MSG_ID_JUMP_TO_FW_LEN 9 +#define MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN 9 +#define MAVLINK_MSG_ID_162_LEN 9 +#define MAVLINK_MSG_ID_162_MIN_LEN 9 + +#define MAVLINK_MSG_ID_JUMP_TO_FW_CRC 37 +#define MAVLINK_MSG_ID_162_CRC 37 + +#define MAVLINK_MSG_JUMP_TO_FW_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_JUMP_TO_FW { \ + 162, \ + "JUMP_TO_FW", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_jump_to_fw_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_jump_to_fw_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_JUMP_TO_FW { \ + "JUMP_TO_FW", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_jump_to_fw_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_jump_to_fw_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a jump_to_fw message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_jump_to_fw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_JUMP_TO_FW_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_JUMP_TO_FW_LEN); +#else + mavlink_jump_to_fw_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_JUMP_TO_FW_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_JUMP_TO_FW; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_CRC); +} + +/** + * @brief Pack a jump_to_fw message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_jump_to_fw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_JUMP_TO_FW_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_JUMP_TO_FW_LEN); +#else + mavlink_jump_to_fw_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_JUMP_TO_FW_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_JUMP_TO_FW; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_CRC); +} + +/** + * @brief Encode a jump_to_fw struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param jump_to_fw C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_jump_to_fw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_jump_to_fw_t* jump_to_fw) +{ + return mavlink_msg_jump_to_fw_pack(system_id, component_id, msg, jump_to_fw->resp, jump_to_fw->param); +} + +/** + * @brief Encode a jump_to_fw struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param jump_to_fw C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_jump_to_fw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_jump_to_fw_t* jump_to_fw) +{ + return mavlink_msg_jump_to_fw_pack_chan(system_id, component_id, chan, msg, jump_to_fw->resp, jump_to_fw->param); +} + +/** + * @brief Send a jump_to_fw message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_jump_to_fw_send(mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_JUMP_TO_FW_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_JUMP_TO_FW, buf, MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_CRC); +#else + mavlink_jump_to_fw_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_JUMP_TO_FW, (const char *)&packet, MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_CRC); +#endif +} + +/** + * @brief Send a jump_to_fw message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_jump_to_fw_send_struct(mavlink_channel_t chan, const mavlink_jump_to_fw_t* jump_to_fw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_jump_to_fw_send(chan, jump_to_fw->resp, jump_to_fw->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_JUMP_TO_FW, (const char *)jump_to_fw, MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_CRC); +#endif +} + +#if MAVLINK_MSG_ID_JUMP_TO_FW_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_jump_to_fw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_JUMP_TO_FW, buf, MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_CRC); +#else + mavlink_jump_to_fw_t *packet = (mavlink_jump_to_fw_t *)msgbuf; + packet->resp = resp; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_JUMP_TO_FW, (const char *)packet, MAVLINK_MSG_ID_JUMP_TO_FW_MIN_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_LEN, MAVLINK_MSG_ID_JUMP_TO_FW_CRC); +#endif +} +#endif + +#endif + +// MESSAGE JUMP_TO_FW UNPACKING + + +/** + * @brief Get field resp from jump_to_fw message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_jump_to_fw_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 0); +} + +/** + * @brief Get field param from jump_to_fw message + * + * @return + */ +static inline uint16_t mavlink_msg_jump_to_fw_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 1); +} + +/** + * @brief Decode a jump_to_fw message into a struct + * + * @param msg The message to decode + * @param jump_to_fw C-struct to decode the message contents into + */ +static inline void mavlink_msg_jump_to_fw_decode(const mavlink_message_t* msg, mavlink_jump_to_fw_t* jump_to_fw) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + jump_to_fw->resp = mavlink_msg_jump_to_fw_get_resp(msg); + mavlink_msg_jump_to_fw_get_param(msg, jump_to_fw->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_JUMP_TO_FW_LEN? msg->len : MAVLINK_MSG_ID_JUMP_TO_FW_LEN; + memset(jump_to_fw, 0, MAVLINK_MSG_ID_JUMP_TO_FW_LEN); + memcpy(jump_to_fw, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_board_name.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_board_name.h new file mode 100644 index 0000000..9760091 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_board_name.h @@ -0,0 +1,229 @@ +// MESSAGE READ_BOARD_NAME PACKING + +#define MAVLINK_MSG_ID_READ_BOARD_NAME 152 + +typedef struct MAVLINK_PACKED __mavlink_read_board_name_t +{ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t param[8]; /*< */ +} mavlink_read_board_name_t; + +#define MAVLINK_MSG_ID_READ_BOARD_NAME_LEN 9 +#define MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN 9 +#define MAVLINK_MSG_ID_152_LEN 9 +#define MAVLINK_MSG_ID_152_MIN_LEN 9 + +#define MAVLINK_MSG_ID_READ_BOARD_NAME_CRC 140 +#define MAVLINK_MSG_ID_152_CRC 140 + +#define MAVLINK_MSG_READ_BOARD_NAME_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_READ_BOARD_NAME { \ + 152, \ + "READ_BOARD_NAME", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_read_board_name_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_read_board_name_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_READ_BOARD_NAME { \ + "READ_BOARD_NAME", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_read_board_name_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_read_board_name_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a read_board_name message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_read_board_name_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_BOARD_NAME_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN); +#else + mavlink_read_board_name_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_READ_BOARD_NAME; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_CRC); +} + +/** + * @brief Pack a read_board_name message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_read_board_name_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_BOARD_NAME_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN); +#else + mavlink_read_board_name_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_READ_BOARD_NAME; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_CRC); +} + +/** + * @brief Encode a read_board_name struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param read_board_name C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_read_board_name_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_read_board_name_t* read_board_name) +{ + return mavlink_msg_read_board_name_pack(system_id, component_id, msg, read_board_name->resp, read_board_name->param); +} + +/** + * @brief Encode a read_board_name struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param read_board_name C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_read_board_name_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_read_board_name_t* read_board_name) +{ + return mavlink_msg_read_board_name_pack_chan(system_id, component_id, chan, msg, read_board_name->resp, read_board_name->param); +} + +/** + * @brief Send a read_board_name message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_read_board_name_send(mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_BOARD_NAME_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_BOARD_NAME, buf, MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_CRC); +#else + mavlink_read_board_name_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_BOARD_NAME, (const char *)&packet, MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_CRC); +#endif +} + +/** + * @brief Send a read_board_name message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_read_board_name_send_struct(mavlink_channel_t chan, const mavlink_read_board_name_t* read_board_name) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_read_board_name_send(chan, read_board_name->resp, read_board_name->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_BOARD_NAME, (const char *)read_board_name, MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_CRC); +#endif +} + +#if MAVLINK_MSG_ID_READ_BOARD_NAME_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_read_board_name_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_BOARD_NAME, buf, MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_CRC); +#else + mavlink_read_board_name_t *packet = (mavlink_read_board_name_t *)msgbuf; + packet->resp = resp; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_BOARD_NAME, (const char *)packet, MAVLINK_MSG_ID_READ_BOARD_NAME_MIN_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN, MAVLINK_MSG_ID_READ_BOARD_NAME_CRC); +#endif +} +#endif + +#endif + +// MESSAGE READ_BOARD_NAME UNPACKING + + +/** + * @brief Get field resp from read_board_name message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_read_board_name_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 0); +} + +/** + * @brief Get field param from read_board_name message + * + * @return + */ +static inline uint16_t mavlink_msg_read_board_name_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 1); +} + +/** + * @brief Decode a read_board_name message into a struct + * + * @param msg The message to decode + * @param read_board_name C-struct to decode the message contents into + */ +static inline void mavlink_msg_read_board_name_decode(const mavlink_message_t* msg, mavlink_read_board_name_t* read_board_name) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + read_board_name->resp = mavlink_msg_read_board_name_get_resp(msg); + mavlink_msg_read_board_name_get_param(msg, read_board_name->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_READ_BOARD_NAME_LEN? msg->len : MAVLINK_MSG_ID_READ_BOARD_NAME_LEN; + memset(read_board_name, 0, MAVLINK_MSG_ID_READ_BOARD_NAME_LEN); + memcpy(read_board_name, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_tag.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_tag.h new file mode 100644 index 0000000..105e3c9 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_tag.h @@ -0,0 +1,254 @@ +// MESSAGE READ_TAG PACKING + +#define MAVLINK_MSG_ID_READ_TAG 153 + +typedef struct MAVLINK_PACKED __mavlink_read_tag_t +{ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t type; /*< */ + uint8_t param[8]; /*< */ +} mavlink_read_tag_t; + +#define MAVLINK_MSG_ID_READ_TAG_LEN 10 +#define MAVLINK_MSG_ID_READ_TAG_MIN_LEN 10 +#define MAVLINK_MSG_ID_153_LEN 10 +#define MAVLINK_MSG_ID_153_MIN_LEN 10 + +#define MAVLINK_MSG_ID_READ_TAG_CRC 126 +#define MAVLINK_MSG_ID_153_CRC 126 + +#define MAVLINK_MSG_READ_TAG_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_READ_TAG { \ + 153, \ + "READ_TAG", \ + 3, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_read_tag_t, resp) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_read_tag_t, type) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 2, offsetof(mavlink_read_tag_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_READ_TAG { \ + "READ_TAG", \ + 3, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_read_tag_t, resp) }, \ + { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_read_tag_t, type) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 2, offsetof(mavlink_read_tag_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a read_tag message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param type + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_read_tag_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, uint8_t type, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_TAG_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t(buf, 1, type); + _mav_put_uint8_t_array(buf, 2, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_READ_TAG_LEN); +#else + mavlink_read_tag_t packet; + packet.resp = resp; + packet.type = type; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_READ_TAG_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_READ_TAG; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_READ_TAG_MIN_LEN, MAVLINK_MSG_ID_READ_TAG_LEN, MAVLINK_MSG_ID_READ_TAG_CRC); +} + +/** + * @brief Pack a read_tag message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param type + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_read_tag_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,uint8_t type,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_TAG_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t(buf, 1, type); + _mav_put_uint8_t_array(buf, 2, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_READ_TAG_LEN); +#else + mavlink_read_tag_t packet; + packet.resp = resp; + packet.type = type; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_READ_TAG_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_READ_TAG; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_READ_TAG_MIN_LEN, MAVLINK_MSG_ID_READ_TAG_LEN, MAVLINK_MSG_ID_READ_TAG_CRC); +} + +/** + * @brief Encode a read_tag struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param read_tag C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_read_tag_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_read_tag_t* read_tag) +{ + return mavlink_msg_read_tag_pack(system_id, component_id, msg, read_tag->resp, read_tag->type, read_tag->param); +} + +/** + * @brief Encode a read_tag struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param read_tag C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_read_tag_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_read_tag_t* read_tag) +{ + return mavlink_msg_read_tag_pack_chan(system_id, component_id, chan, msg, read_tag->resp, read_tag->type, read_tag->param); +} + +/** + * @brief Send a read_tag message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param type + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_read_tag_send(mavlink_channel_t chan, uint8_t resp, uint8_t type, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_TAG_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t(buf, 1, type); + _mav_put_uint8_t_array(buf, 2, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_TAG, buf, MAVLINK_MSG_ID_READ_TAG_MIN_LEN, MAVLINK_MSG_ID_READ_TAG_LEN, MAVLINK_MSG_ID_READ_TAG_CRC); +#else + mavlink_read_tag_t packet; + packet.resp = resp; + packet.type = type; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_TAG, (const char *)&packet, MAVLINK_MSG_ID_READ_TAG_MIN_LEN, MAVLINK_MSG_ID_READ_TAG_LEN, MAVLINK_MSG_ID_READ_TAG_CRC); +#endif +} + +/** + * @brief Send a read_tag message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_read_tag_send_struct(mavlink_channel_t chan, const mavlink_read_tag_t* read_tag) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_read_tag_send(chan, read_tag->resp, read_tag->type, read_tag->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_TAG, (const char *)read_tag, MAVLINK_MSG_ID_READ_TAG_MIN_LEN, MAVLINK_MSG_ID_READ_TAG_LEN, MAVLINK_MSG_ID_READ_TAG_CRC); +#endif +} + +#if MAVLINK_MSG_ID_READ_TAG_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_read_tag_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, uint8_t type, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t(buf, 1, type); + _mav_put_uint8_t_array(buf, 2, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_TAG, buf, MAVLINK_MSG_ID_READ_TAG_MIN_LEN, MAVLINK_MSG_ID_READ_TAG_LEN, MAVLINK_MSG_ID_READ_TAG_CRC); +#else + mavlink_read_tag_t *packet = (mavlink_read_tag_t *)msgbuf; + packet->resp = resp; + packet->type = type; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_TAG, (const char *)packet, MAVLINK_MSG_ID_READ_TAG_MIN_LEN, MAVLINK_MSG_ID_READ_TAG_LEN, MAVLINK_MSG_ID_READ_TAG_CRC); +#endif +} +#endif + +#endif + +// MESSAGE READ_TAG UNPACKING + + +/** + * @brief Get field resp from read_tag message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_read_tag_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 0); +} + +/** + * @brief Get field type from read_tag message + * + * @return + */ +static inline uint8_t mavlink_msg_read_tag_get_type(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 1); +} + +/** + * @brief Get field param from read_tag message + * + * @return + */ +static inline uint16_t mavlink_msg_read_tag_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 2); +} + +/** + * @brief Decode a read_tag message into a struct + * + * @param msg The message to decode + * @param read_tag C-struct to decode the message contents into + */ +static inline void mavlink_msg_read_tag_decode(const mavlink_message_t* msg, mavlink_read_tag_t* read_tag) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + read_tag->resp = mavlink_msg_read_tag_get_resp(msg); + read_tag->type = mavlink_msg_read_tag_get_type(msg); + mavlink_msg_read_tag_get_param(msg, read_tag->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_READ_TAG_LEN? msg->len : MAVLINK_MSG_ID_READ_TAG_LEN; + memset(read_tag, 0, MAVLINK_MSG_ID_READ_TAG_LEN); + memcpy(read_tag, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_version.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_version.h new file mode 100644 index 0000000..add3885 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/mavlink_msg_read_version.h @@ -0,0 +1,229 @@ +// MESSAGE READ_VERSION PACKING + +#define MAVLINK_MSG_ID_READ_VERSION 151 + +typedef struct MAVLINK_PACKED __mavlink_read_version_t +{ + uint8_t resp; /*< 0:No Resp, 1:Resp*/ + uint8_t param[8]; /*< */ +} mavlink_read_version_t; + +#define MAVLINK_MSG_ID_READ_VERSION_LEN 9 +#define MAVLINK_MSG_ID_READ_VERSION_MIN_LEN 9 +#define MAVLINK_MSG_ID_151_LEN 9 +#define MAVLINK_MSG_ID_151_MIN_LEN 9 + +#define MAVLINK_MSG_ID_READ_VERSION_CRC 166 +#define MAVLINK_MSG_ID_151_CRC 166 + +#define MAVLINK_MSG_READ_VERSION_FIELD_PARAM_LEN 8 + +#if MAVLINK_COMMAND_24BIT +#define MAVLINK_MESSAGE_INFO_READ_VERSION { \ + 151, \ + "READ_VERSION", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_read_version_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_read_version_t, param) }, \ + } \ +} +#else +#define MAVLINK_MESSAGE_INFO_READ_VERSION { \ + "READ_VERSION", \ + 2, \ + { { "resp", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_read_version_t, resp) }, \ + { "param", NULL, MAVLINK_TYPE_UINT8_T, 8, 1, offsetof(mavlink_read_version_t, param) }, \ + } \ +} +#endif + +/** + * @brief Pack a read_version message + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_read_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, + uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_VERSION_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_READ_VERSION_LEN); +#else + mavlink_read_version_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_READ_VERSION_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_READ_VERSION; + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_READ_VERSION_MIN_LEN, MAVLINK_MSG_ID_READ_VERSION_LEN, MAVLINK_MSG_ID_READ_VERSION_CRC); +} + +/** + * @brief Pack a read_version message on a channel + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param resp 0:No Resp, 1:Resp + * @param param + * @return length of the message in bytes (excluding serial stream start sign) + */ +static inline uint16_t mavlink_msg_read_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, + mavlink_message_t* msg, + uint8_t resp,const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_VERSION_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_READ_VERSION_LEN); +#else + mavlink_read_version_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_READ_VERSION_LEN); +#endif + + msg->msgid = MAVLINK_MSG_ID_READ_VERSION; + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_READ_VERSION_MIN_LEN, MAVLINK_MSG_ID_READ_VERSION_LEN, MAVLINK_MSG_ID_READ_VERSION_CRC); +} + +/** + * @brief Encode a read_version struct + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param msg The MAVLink message to compress the data into + * @param read_version C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_read_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_read_version_t* read_version) +{ + return mavlink_msg_read_version_pack(system_id, component_id, msg, read_version->resp, read_version->param); +} + +/** + * @brief Encode a read_version struct on a channel + * + * @param system_id ID of this system + * @param component_id ID of this component (e.g. 200 for IMU) + * @param chan The MAVLink channel this message will be sent over + * @param msg The MAVLink message to compress the data into + * @param read_version C-struct to read the message contents from + */ +static inline uint16_t mavlink_msg_read_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_read_version_t* read_version) +{ + return mavlink_msg_read_version_pack_chan(system_id, component_id, chan, msg, read_version->resp, read_version->param); +} + +/** + * @brief Send a read_version message + * @param chan MAVLink channel to send the message + * + * @param resp 0:No Resp, 1:Resp + * @param param + */ +#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS + +static inline void mavlink_msg_read_version_send(mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char buf[MAVLINK_MSG_ID_READ_VERSION_LEN]; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_VERSION, buf, MAVLINK_MSG_ID_READ_VERSION_MIN_LEN, MAVLINK_MSG_ID_READ_VERSION_LEN, MAVLINK_MSG_ID_READ_VERSION_CRC); +#else + mavlink_read_version_t packet; + packet.resp = resp; + mav_array_memcpy(packet.param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_VERSION, (const char *)&packet, MAVLINK_MSG_ID_READ_VERSION_MIN_LEN, MAVLINK_MSG_ID_READ_VERSION_LEN, MAVLINK_MSG_ID_READ_VERSION_CRC); +#endif +} + +/** + * @brief Send a read_version message + * @param chan MAVLink channel to send the message + * @param struct The MAVLink struct to serialize + */ +static inline void mavlink_msg_read_version_send_struct(mavlink_channel_t chan, const mavlink_read_version_t* read_version) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + mavlink_msg_read_version_send(chan, read_version->resp, read_version->param); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_VERSION, (const char *)read_version, MAVLINK_MSG_ID_READ_VERSION_MIN_LEN, MAVLINK_MSG_ID_READ_VERSION_LEN, MAVLINK_MSG_ID_READ_VERSION_CRC); +#endif +} + +#if MAVLINK_MSG_ID_READ_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN +/* + This varient of _send() can be used to save stack space by re-using + memory from the receive buffer. The caller provides a + mavlink_message_t which is the size of a full mavlink message. This + is usually the receive buffer for the channel, and allows a reply to an + incoming message with minimum stack space usage. + */ +static inline void mavlink_msg_read_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t resp, const uint8_t *param) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + char *buf = (char *)msgbuf; + _mav_put_uint8_t(buf, 0, resp); + _mav_put_uint8_t_array(buf, 1, param, 8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_VERSION, buf, MAVLINK_MSG_ID_READ_VERSION_MIN_LEN, MAVLINK_MSG_ID_READ_VERSION_LEN, MAVLINK_MSG_ID_READ_VERSION_CRC); +#else + mavlink_read_version_t *packet = (mavlink_read_version_t *)msgbuf; + packet->resp = resp; + mav_array_memcpy(packet->param, param, sizeof(uint8_t)*8); + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_READ_VERSION, (const char *)packet, MAVLINK_MSG_ID_READ_VERSION_MIN_LEN, MAVLINK_MSG_ID_READ_VERSION_LEN, MAVLINK_MSG_ID_READ_VERSION_CRC); +#endif +} +#endif + +#endif + +// MESSAGE READ_VERSION UNPACKING + + +/** + * @brief Get field resp from read_version message + * + * @return 0:No Resp, 1:Resp + */ +static inline uint8_t mavlink_msg_read_version_get_resp(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint8_t(msg, 0); +} + +/** + * @brief Get field param from read_version message + * + * @return + */ +static inline uint16_t mavlink_msg_read_version_get_param(const mavlink_message_t* msg, uint8_t *param) +{ + return _MAV_RETURN_uint8_t_array(msg, param, 8, 1); +} + +/** + * @brief Decode a read_version message into a struct + * + * @param msg The message to decode + * @param read_version C-struct to decode the message contents into + */ +static inline void mavlink_msg_read_version_decode(const mavlink_message_t* msg, mavlink_read_version_t* read_version) +{ +#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS + read_version->resp = mavlink_msg_read_version_get_resp(msg); + mavlink_msg_read_version_get_param(msg, read_version->param); +#else + uint8_t len = msg->len < MAVLINK_MSG_ID_READ_VERSION_LEN? msg->len : MAVLINK_MSG_ID_READ_VERSION_LEN; + memset(read_version, 0, MAVLINK_MSG_ID_READ_VERSION_LEN); + memcpy(read_version, _MAV_PAYLOAD(msg), len); +#endif +} diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/opencr_msg.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/opencr_msg.h new file mode 100644 index 0000000..1400da5 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/opencr_msg.h @@ -0,0 +1,74 @@ +/** @file + * @brief MAVLink comm protocol generated from opencr_msg.xml + * @see http://mavlink.org + */ +#ifndef MAVLINK_OPENCR_MSG_H +#define MAVLINK_OPENCR_MSG_H + +#ifndef MAVLINK_H + #error Wrong include order: MAVLINK_OPENCR_MSG.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call. +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// MESSAGE LENGTHS AND CRCS + +#ifndef MAVLINK_MESSAGE_LENGTHS +#define MAVLINK_MESSAGE_LENGTHS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 9, 9, 10, 9, 9, 132, 7, 13, 17, 134, 7, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#endif + +#ifndef MAVLINK_MESSAGE_CRCS +#define MAVLINK_MESSAGE_CRCS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 166, 140, 126, 8, 48, 233, 226, 13, 31, 9, 131, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#endif + +#ifndef MAVLINK_MESSAGE_INFO +#define MAVLINK_MESSAGE_INFO {{"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ACK, MAVLINK_MESSAGE_INFO_READ_VERSION, MAVLINK_MESSAGE_INFO_READ_BOARD_NAME, MAVLINK_MESSAGE_INFO_READ_TAG, MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_BEGIN, MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_END, MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_PACKET, MAVLINK_MESSAGE_INFO_FLASH_FW_WRITE_BLOCK, MAVLINK_MESSAGE_INFO_FLASH_FW_ERASE, MAVLINK_MESSAGE_INFO_FLASH_FW_VERIFY, MAVLINK_MESSAGE_INFO_FLASH_FW_READ_PACKET, MAVLINK_MESSAGE_INFO_FLASH_FW_READ_BLOCK, MAVLINK_MESSAGE_INFO_JUMP_TO_FW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} +#endif + +#include "../protocol.h" + +#define MAVLINK_ENABLED_OPENCR_MSG + +// ENUM DEFINITIONS + + + +// MAVLINK VERSION + +#ifndef MAVLINK_VERSION +#define MAVLINK_VERSION 2 +#endif + +#if (MAVLINK_VERSION == 0) +#undef MAVLINK_VERSION +#define MAVLINK_VERSION 2 +#endif + +// MESSAGE DEFINITIONS +#include "./mavlink_msg_ack.h" +#include "./mavlink_msg_read_version.h" +#include "./mavlink_msg_read_board_name.h" +#include "./mavlink_msg_read_tag.h" +#include "./mavlink_msg_flash_fw_write_begin.h" +#include "./mavlink_msg_flash_fw_write_end.h" +#include "./mavlink_msg_flash_fw_write_packet.h" +#include "./mavlink_msg_flash_fw_write_block.h" +#include "./mavlink_msg_flash_fw_erase.h" +#include "./mavlink_msg_flash_fw_verify.h" +#include "./mavlink_msg_flash_fw_read_packet.h" +#include "./mavlink_msg_flash_fw_read_block.h" +#include "./mavlink_msg_jump_to_fw.h" + +// base include + + +#if MAVLINK_COMMAND_24BIT +#include "../mavlink_get_info.h" +#endif + +#ifdef __cplusplus +} +#endif // __cplusplus +#endif // MAVLINK_OPENCR_MSG_H diff --git a/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/testsuite.h b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/testsuite.h new file mode 100644 index 0000000..d963bc6 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/mavlink/opencr_msg/testsuite.h @@ -0,0 +1,709 @@ +/** @file + * @brief MAVLink comm protocol testsuite generated from opencr_msg.xml + * @see http://qgroundcontrol.org/mavlink/ + */ +#ifndef OPENCR_MSG_TESTSUITE_H +#define OPENCR_MSG_TESTSUITE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef MAVLINK_TEST_ALL +#define MAVLINK_TEST_ALL + +static void mavlink_test_opencr_msg(uint8_t, uint8_t, mavlink_message_t *last_msg); + +static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) +{ + + mavlink_test_opencr_msg(system_id, component_id, last_msg); +} +#endif + + + + +static void mavlink_test_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) +{ +#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 + mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0); + if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACK >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_ack_t packet_in = { + 17235,139,206,{ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 } + }; + mavlink_ack_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.err_code = packet_in.err_code; + packet1.msg_id = packet_in.msg_id; + packet1.length = packet_in.length; + + mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*16); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_ack_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_ack_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_ack_pack(system_id, component_id, &msg , packet1.msg_id , packet1.err_code , packet1.length , packet1.data ); + mavlink_msg_ack_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.msg_id , packet1.err_code , packet1.length , packet1.data ); + mavlink_msg_ack_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_READ_VERSION >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_read_version_t packet_in = { + 5,{ 72, 73, 74, 75, 76, 77, 78, 79 } + }; + mavlink_read_version_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.resp = packet_in.resp; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_version_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_read_version_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_version_pack(system_id, component_id, &msg , packet1.resp , packet1.param ); + mavlink_msg_read_version_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.param ); + mavlink_msg_read_version_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_READ_BOARD_NAME >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_read_board_name_t packet_in = { + 5,{ 72, 73, 74, 75, 76, 77, 78, 79 } + }; + mavlink_read_board_name_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.resp = packet_in.resp; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_board_name_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_read_board_name_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_board_name_pack(system_id, component_id, &msg , packet1.resp , packet1.param ); + mavlink_msg_read_board_name_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_board_name_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.param ); + mavlink_msg_read_board_name_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_READ_TAG >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_read_tag_t packet_in = { + 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146 } + }; + mavlink_read_tag_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.resp = packet_in.resp; + packet1.type = packet_in.type; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_tag_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_read_tag_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_tag_pack(system_id, component_id, &msg , packet1.resp , packet1.type , packet1.param ); + mavlink_msg_read_tag_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_read_tag_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.type , packet1.param ); + mavlink_msg_read_tag_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_WRITE_BEGIN >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_write_begin_t packet_in = { + 5,{ 72, 73, 74, 75, 76, 77, 78, 79 } + }; + mavlink_flash_fw_write_begin_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.resp = packet_in.resp; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_begin_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_write_begin_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_begin_pack(system_id, component_id, &msg , packet1.resp , packet1.param ); + mavlink_msg_flash_fw_write_begin_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_begin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.param ); + mavlink_msg_flash_fw_write_begin_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_WRITE_END >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_write_end_t packet_in = { + 5,{ 72, 73, 74, 75, 76, 77, 78, 79 } + }; + mavlink_flash_fw_write_end_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.resp = packet_in.resp; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_end_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_write_end_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_end_pack(system_id, component_id, &msg , packet1.resp , packet1.param ); + mavlink_msg_flash_fw_write_end_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.param ); + mavlink_msg_flash_fw_write_end_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_WRITE_PACKET >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_write_packet_t packet_in = { + 17235,139,206,{ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 } + }; + mavlink_flash_fw_write_packet_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.addr = packet_in.addr; + packet1.resp = packet_in.resp; + packet1.length = packet_in.length; + + mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_packet_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_write_packet_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_packet_pack(system_id, component_id, &msg , packet1.resp , packet1.addr , packet1.length , packet1.data ); + mavlink_msg_flash_fw_write_packet_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_packet_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.addr , packet1.length , packet1.data ); + mavlink_msg_flash_fw_write_packet_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_WRITE_BLOCK >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_write_block_t packet_in = { + 963497464,17443,151 + }; + mavlink_flash_fw_write_block_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.addr = packet_in.addr; + packet1.length = packet_in.length; + packet1.resp = packet_in.resp; + + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_block_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_write_block_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_block_pack(system_id, component_id, &msg , packet1.resp , packet1.addr , packet1.length ); + mavlink_msg_flash_fw_write_block_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_write_block_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.addr , packet1.length ); + mavlink_msg_flash_fw_write_block_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_ERASE >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_erase_t packet_in = { + 963497464,17,{ 84, 85, 86, 87, 88, 89, 90, 91 } + }; + mavlink_flash_fw_erase_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.length = packet_in.length; + packet1.resp = packet_in.resp; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_erase_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_erase_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_erase_pack(system_id, component_id, &msg , packet1.resp , packet1.length , packet1.param ); + mavlink_msg_flash_fw_erase_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.length , packet1.param ); + mavlink_msg_flash_fw_erase_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_VERIFY >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_verify_t packet_in = { + 963497464,963497672,29,{ 96, 97, 98, 99, 100, 101, 102, 103 } + }; + mavlink_flash_fw_verify_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.length = packet_in.length; + packet1.crc = packet_in.crc; + packet1.resp = packet_in.resp; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_verify_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_verify_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_verify_pack(system_id, component_id, &msg , packet1.resp , packet1.length , packet1.crc , packet1.param ); + mavlink_msg_flash_fw_verify_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_verify_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.length , packet1.crc , packet1.param ); + mavlink_msg_flash_fw_verify_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_READ_PACKET >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_read_packet_t packet_in = { + 963497464,17,84,{ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 } + }; + mavlink_flash_fw_read_packet_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.addr = packet_in.addr; + packet1.resp = packet_in.resp; + packet1.length = packet_in.length; + + mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_read_packet_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_read_packet_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_read_packet_pack(system_id, component_id, &msg , packet1.resp , packet1.addr , packet1.length , packet1.data ); + mavlink_msg_flash_fw_read_packet_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_read_packet_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.addr , packet1.length , packet1.data ); + mavlink_msg_flash_fw_read_packet_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLASH_FW_READ_BLOCK >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_flash_fw_read_block_t packet_in = { + 963497464,17443,151 + }; + mavlink_flash_fw_read_block_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.addr = packet_in.addr; + packet1.length = packet_in.length; + packet1.resp = packet_in.resp; + + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_read_block_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_flash_fw_read_block_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_read_block_pack(system_id, component_id, &msg , packet1.resp , packet1.addr , packet1.length ); + mavlink_msg_flash_fw_read_block_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_flash_fw_read_block_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.addr , packet1.length ); + mavlink_msg_flash_fw_read_block_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_JUMP_TO_FW >= 256) { + return; + } +#endif + mavlink_message_t msg; + uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; + uint16_t i; + mavlink_jump_to_fw_t packet_in = { + 5,{ 72, 73, 74, 75, 76, 77, 78, 79 } + }; + mavlink_jump_to_fw_t packet1, packet2; + memset(&packet1, 0, sizeof(packet1)); + packet1.resp = packet_in.resp; + + mav_array_memcpy(packet1.param, packet_in.param, sizeof(uint8_t)*8); + + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_jump_to_fw_encode(system_id, component_id, &msg, &packet1); + mavlink_msg_jump_to_fw_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_jump_to_fw_pack(system_id, component_id, &msg , packet1.resp , packet1.param ); + mavlink_msg_jump_to_fw_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_jump_to_fw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.resp , packet1.param ); + mavlink_msg_jump_to_fw_decode(&msg, &packet2); + MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); + + memset(&packet2, 0, sizeof(packet2)); + mavlink_msg_to_send_buffer(buffer, &msg); + for (i=0; ilen + MAVLINK_NUM_NON_PAYLOAD_BYTES; +} + +#if MAVLINK_NEED_BYTE_SWAP +static inline void byte_swap_2(char *dst, const char *src) +{ + dst[0] = src[1]; + dst[1] = src[0]; +} +static inline void byte_swap_4(char *dst, const char *src) +{ + dst[0] = src[3]; + dst[1] = src[2]; + dst[2] = src[1]; + dst[3] = src[0]; +} +static inline void byte_swap_8(char *dst, const char *src) +{ + dst[0] = src[7]; + dst[1] = src[6]; + dst[2] = src[5]; + dst[3] = src[4]; + dst[4] = src[3]; + dst[5] = src[2]; + dst[6] = src[1]; + dst[7] = src[0]; +} +#elif !MAVLINK_ALIGNED_FIELDS +static inline void byte_copy_2(char *dst, const char *src) +{ + dst[0] = src[0]; + dst[1] = src[1]; +} +static inline void byte_copy_4(char *dst, const char *src) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; +} +static inline void byte_copy_8(char *dst, const char *src) +{ + memcpy(dst, src, 8); +} +#endif + +#define _mav_put_uint8_t(buf, wire_offset, b) buf[wire_offset] = (uint8_t)b +#define _mav_put_int8_t(buf, wire_offset, b) buf[wire_offset] = (int8_t)b +#define _mav_put_char(buf, wire_offset, b) buf[wire_offset] = b + +#if MAVLINK_NEED_BYTE_SWAP +#define _mav_put_uint16_t(buf, wire_offset, b) byte_swap_2(&buf[wire_offset], (const char *)&b) +#define _mav_put_int16_t(buf, wire_offset, b) byte_swap_2(&buf[wire_offset], (const char *)&b) +#define _mav_put_uint32_t(buf, wire_offset, b) byte_swap_4(&buf[wire_offset], (const char *)&b) +#define _mav_put_int32_t(buf, wire_offset, b) byte_swap_4(&buf[wire_offset], (const char *)&b) +#define _mav_put_uint64_t(buf, wire_offset, b) byte_swap_8(&buf[wire_offset], (const char *)&b) +#define _mav_put_int64_t(buf, wire_offset, b) byte_swap_8(&buf[wire_offset], (const char *)&b) +#define _mav_put_float(buf, wire_offset, b) byte_swap_4(&buf[wire_offset], (const char *)&b) +#define _mav_put_double(buf, wire_offset, b) byte_swap_8(&buf[wire_offset], (const char *)&b) +#elif !MAVLINK_ALIGNED_FIELDS +#define _mav_put_uint16_t(buf, wire_offset, b) byte_copy_2(&buf[wire_offset], (const char *)&b) +#define _mav_put_int16_t(buf, wire_offset, b) byte_copy_2(&buf[wire_offset], (const char *)&b) +#define _mav_put_uint32_t(buf, wire_offset, b) byte_copy_4(&buf[wire_offset], (const char *)&b) +#define _mav_put_int32_t(buf, wire_offset, b) byte_copy_4(&buf[wire_offset], (const char *)&b) +#define _mav_put_uint64_t(buf, wire_offset, b) byte_copy_8(&buf[wire_offset], (const char *)&b) +#define _mav_put_int64_t(buf, wire_offset, b) byte_copy_8(&buf[wire_offset], (const char *)&b) +#define _mav_put_float(buf, wire_offset, b) byte_copy_4(&buf[wire_offset], (const char *)&b) +#define _mav_put_double(buf, wire_offset, b) byte_copy_8(&buf[wire_offset], (const char *)&b) +#else +#define _mav_put_uint16_t(buf, wire_offset, b) *(uint16_t *)&buf[wire_offset] = b +#define _mav_put_int16_t(buf, wire_offset, b) *(int16_t *)&buf[wire_offset] = b +#define _mav_put_uint32_t(buf, wire_offset, b) *(uint32_t *)&buf[wire_offset] = b +#define _mav_put_int32_t(buf, wire_offset, b) *(int32_t *)&buf[wire_offset] = b +#define _mav_put_uint64_t(buf, wire_offset, b) *(uint64_t *)&buf[wire_offset] = b +#define _mav_put_int64_t(buf, wire_offset, b) *(int64_t *)&buf[wire_offset] = b +#define _mav_put_float(buf, wire_offset, b) *(float *)&buf[wire_offset] = b +#define _mav_put_double(buf, wire_offset, b) *(double *)&buf[wire_offset] = b +#endif + +/* + like memcpy(), but if src is NULL, do a memset to zero +*/ +static inline void mav_array_memcpy(void *dest, const void *src, size_t n) +{ + if (src == NULL) { + memset(dest, 0, n); + } else { + memcpy(dest, src, n); + } +} + +/* + * Place a char array into a buffer + */ +static inline void _mav_put_char_array(char *buf, uint8_t wire_offset, const char *b, uint8_t array_length) +{ + mav_array_memcpy(&buf[wire_offset], b, array_length); + +} + +/* + * Place a uint8_t array into a buffer + */ +static inline void _mav_put_uint8_t_array(char *buf, uint8_t wire_offset, const uint8_t *b, uint8_t array_length) +{ + mav_array_memcpy(&buf[wire_offset], b, array_length); + +} + +/* + * Place a int8_t array into a buffer + */ +static inline void _mav_put_int8_t_array(char *buf, uint8_t wire_offset, const int8_t *b, uint8_t array_length) +{ + mav_array_memcpy(&buf[wire_offset], b, array_length); + +} + +#if MAVLINK_NEED_BYTE_SWAP +#define _MAV_PUT_ARRAY(TYPE, V) \ +static inline void _mav_put_ ## TYPE ##_array(char *buf, uint8_t wire_offset, const TYPE *b, uint8_t array_length) \ +{ \ + if (b == NULL) { \ + memset(&buf[wire_offset], 0, array_length*sizeof(TYPE)); \ + } else { \ + uint16_t i; \ + for (i=0; i +#include +#include +#include +//#include "../serial.h" + + +extern ser_handler stm32_ser_id; +extern int read_byte( void ); +extern int write_bytes( char *p_data, int len ); + +void msg_init(void) +{ + +} + + +void msg_send(uint8_t chan, mavlink_message_t *p_msg) +{ + uint8_t buf[1024]; + uint16_t len; + uint16_t write_len; + + len = mavlink_msg_to_send_buffer(buf, p_msg); + + switch(chan) + { + case 0: + write_len = write_bytes((char *)buf, (uint32_t)len); + if( write_len != len ) printf("wlen %d : len %d\r\n", write_len, len); + break; + + case 1: + break; + } +} + + +BOOL msg_recv( uint8_t chan, uint8_t data , mavlink_message_t *p_msg, mavlink_status_t *p_status ) +{ + BOOL ret = FALSE; + +if (mavlink_parse_char(MAVLINK_COMM_0, data, p_msg, p_status) == MAVLINK_FRAMING_OK) +{ + ret = TRUE; +} + + return ret; +} + + +BOOL msg_get_resp( uint8_t chan, mavlink_message_t *p_msg, uint32_t timeout) +{ + BOOL ret = FALSE; + int ch_ret; + uint8_t ch; + static mavlink_message_t msg[MSG_CH_MAX]; + static mavlink_status_t status[MSG_CH_MAX]; + uint32_t retry = timeout; + + + + ser_set_timeout_ms( stm32_ser_id, 1 ); + + while(1) + { + ch_ret = read_byte(); + + if( ch_ret < 0 ) + { + if( retry-- <= 0 ) + { + ret = FALSE; + break; + } + else + { + continue; + } + } + else + { + ch = (uint8_t)(ch_ret); + retry = timeout; + } + + ret = msg_recv( chan, ch, &msg[chan], &status[chan] ); + + if( ret == TRUE ) + { + *p_msg = msg[chan]; + break; + } + } + + return ret; +} + diff --git a/oroca_bldc_gui/qt_gui/msg/msg.h b/oroca_bldc_gui/qt_gui/msg/msg.h new file mode 100644 index 0000000..428759a --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/msg.h @@ -0,0 +1,46 @@ +/* + * msg.h + * + * message process + * + * Created on: 2016. 5. 14. + * Author: Baram, PBPH + */ + +#ifndef MSG_H +#define MSG_H + + +#ifdef __cplusplus + extern "C" { +#endif + + +#include "def.h" + + + +#define MSG_CH_MAX 1 + + +typedef struct +{ + uint8_t ch; + mavlink_message_t *p_msg; +} msg_t; + + + +void msg_init(void); +void msg_send(uint8_t chan, mavlink_message_t *p_msg); +BOOL msg_recv( uint8_t chan, uint8_t data , mavlink_message_t *p_msg, mavlink_status_t *p_status ); +BOOL msg_get_resp( uint8_t chan, mavlink_message_t *p_msg, uint32_t timeout); + + +#ifdef __cplusplus +} +#endif + + +#endif + diff --git a/oroca_bldc_gui/qt_gui/msg/xml/opencr_msg b/oroca_bldc_gui/qt_gui/msg/xml/opencr_msg new file mode 100644 index 0000000..3a6cc63 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/msg/xml/opencr_msg @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + + + 0:No Resp, 1:Resp + + + + + + + + + 0:No Resp, 1:Resp + + + + + \ No newline at end of file diff --git a/oroca_bldc_gui/qt_gui/opencr_ld.c b/oroca_bldc_gui/qt_gui/opencr_ld.c new file mode 100644 index 0000000..83ccbb0 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/opencr_ld.c @@ -0,0 +1,953 @@ +#include "opencr_ld.h" +#include +#include +#include +#include +#include +#include +//#include "serial.h" +#include "type.h" +#include "./msg/msg.h" +#include +#include + + + +static FILE *opencr_fp; +static uint32_t opencr_fpsize; + + +ser_handler stm32_ser_id = ( ser_handler )-1; + + +uint32_t tx_buf[768*1024/4]; +uint32_t rx_buf[768*1024/4]; + + + + + +/*--------------------------------------------------------------------------- + TITLE : opencr_ld_main + WORK : +---------------------------------------------------------------------------*/ +int opencr_ld_main( int argc, const char **argv ) +{ + long baud; + baud = strtol( argv[ 2 ], NULL, 10 ); + + printf("opencr_ld_main \r\n"); + + opencr_ld_down( argc, argv ); + + return 0; +} + + +/*--------------------------------------------------------------------------- + TITLE : opencr_ld_down + WORK : +---------------------------------------------------------------------------*/ +int opencr_ld_down( int argc, const char **argv ) +{ + int i; + int j; + int ret = 0; + err_code_t err_code = OK; + long t, dt; + float calc_time; + uint32_t fw_size = 256*1024*3; + uint8_t board_str[16]; + uint8_t board_str_len; + uint32_t board_version; + uint32_t board_revision; + uint32_t crc; + uint32_t crc_ret = 0; + uint8_t *p_buf_crc; + char *portname; + uint32_t baud; + uint8_t block_buf[FLASH_TX_BLOCK_LENGTH]; + uint32_t addr; + uint32_t len; + + baud = strtol( argv[ 2 ], NULL, 10 ); + portname = (char *)argv[ 1 ]; + + + if( ( opencr_fp = fopen( argv[ 3 ], "rb" ) ) == NULL ) + { + fprintf( stderr, "Unable to open %s\n", argv[ 3 ] ); + exit( 1 ); + } + else + { + fseek( opencr_fp, 0, SEEK_END ); + opencr_fpsize = ftell( opencr_fp ); + fseek( opencr_fp, 0, SEEK_SET ); + printf(">>\r\n"); + printf("file name : %s \r\n", argv[3]); + printf("file size : %d KB\r\n", opencr_fpsize/1024); + } + + fw_size = opencr_fpsize; + + + + // Open port + if( ( stm32_ser_id = ser_open( portname ) ) == ( ser_handler )-1 ) + { + printf("Fail to open port 1\n"); + return -1; + } + + // Setup port + //ser_setupEx( stm32_ser_id, baud, SER_DATABITS_8, SER_PARITY_NONE, SER_STOPBITS_1, 1 ); + + //ser_set_timeout_ms( stm32_ser_id, SER_NO_TIMEOUT ); + while( read_byte() != -1 ); + ser_set_timeout_ms( stm32_ser_id, 2000000 ); + + + + printf(">>\r\n"); + err_code = cmd_read_board_name( board_str, &board_str_len ); + if( err_code == OK ) + { + printf("Board Name : %s\r\n", board_str); + } + err_code = cmd_read_version( &board_version, &board_revision ); + if( err_code == OK ) + { + printf("Board Ver : 0x%08X\r\n", board_version); + printf("Board Rev : 0x%08X\r\n", board_revision); + } + printf(">>\r\n"); + + t = iclock(); + ret = opencr_ld_flash_erase(fw_size); + dt = iclock() - t; + printf("flash_erase : %d : %f sec\r\n", ret, GET_CALC_TIME(dt)); + if( ret < 0 ) + { + ser_close( stm32_ser_id ); + fclose( opencr_fp ); + exit(1); + } + +#if 1 + t = iclock(); + crc = 0; + addr = 0; + while(1) + { + len = opencr_ld_file_read_data( block_buf, FLASH_TX_BLOCK_LENGTH); + if( len == 0 ) break; + + for( i=0; i FLASH_TX_BLOCK_LENGTH ) + { + block_length = FLASH_TX_BLOCK_LENGTH; + } + + block_cnt = block_length/FLASH_PACKET_LENGTH; + if( block_length%FLASH_PACKET_LENGTH > 0 ) + { + block_cnt += 1; + } + + + written_packet_length = 0; + for( i=0; i FLASH_PACKET_LENGTH ) + { + packet_length = FLASH_PACKET_LENGTH; + } + + err_code = cmd_flash_fw_write_packet(written_packet_length, &p_data[written_total_length+written_packet_length], packet_length); + if( err_code != OK ) + { + printf("cmd_flash_fw_send_block ERR : 0x%04X\r\n", err_code); + return -2; + } + + written_packet_length += packet_length; + } + + //printf("%d : %d, %d, %d \r\n", written_packet_length, block_length, block_cnt, packet_length); + + if( written_packet_length == block_length ) + { + err_code = cmd_flash_fw_write_block(addr+written_total_length, block_length); + if( err_code != OK ) + { + printf("cmd_flash_fw_write_block ERR : 0x%04X\r\n", err_code); + return -3; + } + } + else + { + printf("written_packet_length : %d, %d 0x%04X\r\n", written_packet_length, block_length, err_code); + return -4; + } + + written_total_length += block_length; + + if( written_total_length == length ) + { + break; + } + else if( written_total_length > length ) + { + printf("written_total_length over \r\n"); + return -5; + } + } + + + cmd_flash_fw_write_end(); + + return ret; +} + + +/*--------------------------------------------------------------------------- + TITLE : opencr_ld_flash_read + WORK : +---------------------------------------------------------------------------*/ +int opencr_ld_flash_read( uint32_t addr, uint8_t *p_data, uint32_t length ) +{ + int ret = 0; + err_code_t err_code = OK; + uint32_t block_length; + uint32_t read_packet_length; + uint32_t read_total_length; + int i; + int err_count = 0; + + read_total_length = 0; + + while(1) + { + block_length = length - read_total_length; + + if( block_length > FLASH_PACKET_LENGTH ) + { + block_length = FLASH_PACKET_LENGTH; + } + + + for( i=0; i<3; i++ ) + { + err_code = cmd_flash_fw_read_block( addr+read_total_length, &p_data[read_total_length], block_length ); + if( err_code == OK ) break; + err_count++; + } + + + if( err_code != OK ) + { + printf("cmd_flash_fw_read_block : addr:%X, 0x%04X \r\n", addr+read_total_length, err_code); + return -1; + } + + read_total_length += block_length; + + if( read_total_length == length ) + { + break; + } + else if( read_total_length > length ) + { + printf("read_total_length over \r\n"); + return -2; + } + } + + return ret; +} + + +/*--------------------------------------------------------------------------- + TITLE : opencr_ld_flash_erase + WORK : +---------------------------------------------------------------------------*/ +int opencr_ld_flash_erase( uint32_t length ) +{ + int ret = 0; + err_code_t err_code = OK; + + err_code = cmd_flash_fw_erase( length ); + + if( err_code != OK ) + { + printf("cmd_flash_fw_erase_block : 0x%04X %d\r\n", err_code, length ); + return -1; + } + + return ret; +} + + + +static long iclock() +{ + struct timeval tv; + gettimeofday (&tv, NULL); + return (tv.tv_sec * 1000 + tv.tv_usec / 1000); +} + + +/*--------------------------------------------------------------------------- + TITLE : delay_ms + WORK : +---------------------------------------------------------------------------*/ +void delay_ms( int WaitTime ) +{ + int i; + + #ifdef WIN32_BUILD + Sleep(WaitTime); + #else + for( i=0; i length ) + { + err_code = ERR_SIZE_OVER; + break; + } + } + else + { + err_code = ERR_TIMEOUT; + break; + } + } + } + + return err_code; +} +#else +err_code_t cmd_flash_fw_read_block( uint32_t addr, uint8_t *p_data, uint16_t length ) +{ + err_code_t err_code = OK; + mavlink_message_t tx_msg; + mavlink_message_t rx_msg; + mavlink_flash_fw_read_packet_t resp_msg; + uint8_t resp = 1; + + + mavlink_msg_flash_fw_read_block_pack(0, 0, &tx_msg, resp, addr, length); + msg_send(0, &tx_msg); + + + + if( resp == 1 ) + { + if( msg_get_resp(0, &rx_msg, 100) == TRUE ) + { + mavlink_msg_flash_fw_read_packet_decode( &rx_msg, &resp_msg); + + memcpy(p_data, resp_msg.data, resp_msg.length); + + if( resp_msg.length > length ) + { + err_code = ERR_SIZE_OVER; + } + } + else + { + err_code = ERR_TIMEOUT; + } + } + + return err_code; +} +#endif + + +/*--------------------------------------------------------------------------- + TITLE : cmd_flash_fw_verify + WORK : +---------------------------------------------------------------------------*/ +err_code_t cmd_flash_fw_verify( uint32_t length, uint32_t crc, uint32_t *p_crc_ret ) +{ + err_code_t err_code = OK; + mavlink_message_t tx_msg; + mavlink_message_t rx_msg; + mavlink_ack_t ack_msg; + uint8_t param[8]; + uint8_t resp = 1; + + + mavlink_msg_flash_fw_verify_pack(0, 0, &tx_msg, resp, length, crc, param); + msg_send(0, &tx_msg); + + + if( resp == 1 ) + { + if( msg_get_resp(0, &rx_msg, 500) == TRUE ) + { + mavlink_msg_ack_decode( &rx_msg, &ack_msg); + + *p_crc_ret = ack_msg.data[3]<<24|ack_msg.data[2]<<16|ack_msg.data[1]<<8|ack_msg.data[0]; + + if( tx_msg.msgid == ack_msg.msg_id ) err_code = ack_msg.err_code; + else err_code = ERR_MISMATCH_ID; + } + else + { + err_code = ERR_TIMEOUT; + } + } + return err_code; +} + + +/*--------------------------------------------------------------------------- + TITLE : cmd_jump_to_fw + WORK : +---------------------------------------------------------------------------*/ +err_code_t cmd_jump_to_fw(void) +{ + err_code_t err_code = OK; + mavlink_message_t tx_msg; + mavlink_message_t rx_msg; + mavlink_ack_t ack_msg; + uint8_t param[8]; + uint8_t resp = 0; + + + mavlink_msg_jump_to_fw_pack(0, 0, &tx_msg, resp, param); + msg_send(0, &tx_msg); + + + if( resp == 1 ) + { + if( msg_get_resp(0, &rx_msg, 500) == TRUE ) + { + mavlink_msg_ack_decode( &rx_msg, &ack_msg); + + if( tx_msg.msgid == ack_msg.msg_id ) err_code = ack_msg.err_code; + else err_code = ERR_MISMATCH_ID; + } + else + { + err_code = ERR_TIMEOUT; + } + } + return err_code; +} + + +/*--------------------------------------------------------------------------- + TITLE : crc_calc + WORK : +---------------------------------------------------------------------------*/ +uint32_t crc_calc( uint32_t crc_in, uint8_t data_in ) +{ + + crc_in ^= data_in; + crc_in += data_in; + + return crc_in; +} diff --git a/oroca_bldc_gui/qt_gui/opencr_ld.h b/oroca_bldc_gui/qt_gui/opencr_ld.h new file mode 100644 index 0000000..39c8305 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/opencr_ld.h @@ -0,0 +1,55 @@ +/* + * main.h + * + * Created on: 2016. 5. 14. + * Author: Baram, PBPH + */ + +#ifndef __OPENCR_LD_MAIN_H_ +#define __OPENCR_LD_MAIN_H_ + +#include +#include +#include "type.h" +#include "./msg/msg.h" +//#include "serial.h" + + +#define GET_CALC_TIME(x) ( (int)(x / 1000) + ((float)(x % 1000))/1000 ) + +#define FLASH_TX_BLOCK_LENGTH (8*1024) +#define FLASH_RX_BLOCK_LENGTH (128) +#define FLASH_PACKET_LENGTH 128 + + +int opencr_ld_main( int argc, const char **argv ); + +int opencr_ld_down( int argc, const char **argv ); +int opencr_ld_flash_write( uint32_t addr, uint8_t *p_data, uint32_t length ); +int opencr_ld_flash_read( uint32_t addr, uint8_t *p_data, uint32_t length ); +int opencr_ld_flash_erase( uint32_t length ); + +uint32_t opencr_ld_file_read_data( uint8_t *dst, uint32_t len ); + + +static long iclock(); +int read_byte( void ); +void delay_ms( int WaitTime ); +uint32_t crc_calc( uint32_t crc_in, uint8_t data_in ); + + +err_code_t cmd_read_version( uint32_t *p_version, uint32_t *p_revision ); +err_code_t cmd_read_board_name( uint8_t *p_str, uint8_t *p_len ); +err_code_t cmd_flash_fw_erase( uint32_t length ); +err_code_t cmd_flash_fw_write_begin( void ); +err_code_t cmd_flash_fw_write_end( void ); +err_code_t cmd_flash_fw_write_packet( uint16_t addr, uint8_t *p_data, uint8_t length ); +err_code_t cmd_flash_fw_write_block( uint32_t addr, uint32_t length ); +err_code_t cmd_flash_fw_send_block_multi( uint8_t block_count ); +err_code_t cmd_flash_fw_read_block( uint32_t addr, uint8_t *p_data, uint16_t length ); +err_code_t cmd_flash_fw_verify( uint32_t length, uint32_t crc, uint32_t *p_crc_ret ); +err_code_t cmd_jump_to_fw(void); + + +#endif + diff --git a/oroca_bldc_gui/qt_gui/oroca_bldc_gui.pro b/oroca_bldc_gui/qt_gui/oroca_bldc_gui.pro new file mode 100644 index 0000000..7d12903 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/oroca_bldc_gui.pro @@ -0,0 +1,51 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2016-06-04T08:42:06 +# +#------------------------------------------------- + +QT += core gui +QT += concurrent + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = opencr_ld_gui +TEMPLATE = app + +include(./qextserialport/qextserialport.pri) + +SOURCES += main.cpp\ + dialog.cpp \ + hled.cpp + +HEADERS += dialog.h \ + hled.h \ + msg/mavlink/opencr_msg/mavlink.h \ + msg/mavlink/opencr_msg/mavlink_msg_ack.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_erase.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_block.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_read_packet.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_verify.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_begin.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_block.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_end.h \ + msg/mavlink/opencr_msg/mavlink_msg_flash_fw_write_packet.h \ + msg/mavlink/opencr_msg/mavlink_msg_jump_to_fw.h \ + msg/mavlink/opencr_msg/mavlink_msg_read_board_name.h \ + msg/mavlink/opencr_msg/mavlink_msg_read_tag.h \ + msg/mavlink/opencr_msg/mavlink_msg_read_version.h \ + msg/mavlink/opencr_msg/opencr_msg.h \ + msg/mavlink/opencr_msg/testsuite.h \ + msg/mavlink/opencr_msg/version.h \ + msg/mavlink/checksum.h \ + msg/mavlink/mavlink_conversions.h \ + msg/mavlink/mavlink_helpers.h \ + msg/mavlink/mavlink_types.h \ + msg/mavlink/protocol.h \ + msg/def.h \ + msg/def_err.h \ + type.h + + +FORMS += dialog.ui + diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator.cpp new file mode 100644 index 0000000..9ffd098 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator.cpp @@ -0,0 +1,163 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialenumerator.h" +#include "qextserialenumerator_p.h" + +#include +#include +#include + +QextSerialEnumeratorPrivate::QextSerialEnumeratorPrivate(QextSerialEnumerator *enumrator) + :q_ptr(enumrator) +{ + init_sys(); +} + +QextSerialEnumeratorPrivate::~QextSerialEnumeratorPrivate() +{ + destroy_sys(); +} + +/*! + \class QextPortInfo + + \brief The QextPortInfo class containing port information. + + Structure containing port information. + + \code + QString portName; ///< Port name. + QString physName; ///< Physical name. + QString friendName; ///< Friendly name. + QString enumName; ///< Enumerator name. + int vendorID; ///< Vendor ID. + int productID; ///< Product ID + \endcode + */ + +/*! \class QextSerialEnumerator + + \brief The QextSerialEnumerator class provides list of ports available in the system. + + \section1 Usage + To poll the system for a list of connected devices, simply use getPorts(). Each + QextPortInfo structure will populated with information about the corresponding device. + + \bold Example + \code + QList ports = QextSerialEnumerator::getPorts(); + foreach (QextPortInfo port, ports) { + // inspect port... + } + \endcode + + To enable event-driven notification of device connection events, first call + setUpNotifications() and then connect to the deviceDiscovered() and deviceRemoved() + signals. Event-driven behavior is currently available only on Windows and OS X. + + \bold Example + \code + QextSerialEnumerator *enumerator = new QextSerialEnumerator(); + connect(enumerator, SIGNAL(deviceDiscovered(const QextPortInfo &)), + myClass, SLOT(onDeviceDiscovered(const QextPortInfo &))); + connect(enumerator, SIGNAL(deviceRemoved(const QextPortInfo &)), + myClass, SLOT(onDeviceRemoved(const QextPortInfo &))); + \endcode + + \section1 Credits + Windows implementation is based on Zach Gorman's work from + \l {http://www.codeproject.com}{The Code Project} (\l http://www.codeproject.com/system/setupdi.asp). + + OS X implementation, see \l http://developer.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_Finding_Devices/chapter_4_section_2.html + + \bold author Michal Policht, Liam Staskawicz +*/ + +/*! + \fn void QextSerialEnumerator::deviceDiscovered(const QextPortInfo &info) + A new device has been connected to the system. + + setUpNotifications() must be called first to enable event-driven device notifications. + Currently only implemented on Windows and OS X. + + \a info The device that has been discovered. +*/ + +/*! + \fn void QextSerialEnumerator::deviceRemoved(const QextPortInfo &info); + A device has been disconnected from the system. + + setUpNotifications() must be called first to enable event-driven device notifications. + Currently only implemented on Windows and OS X. + + \a info The device that was disconnected. +*/ + +/*! + Constructs a QextSerialEnumerator object with the given \a parent. +*/ +QextSerialEnumerator::QextSerialEnumerator(QObject *parent) + :QObject(parent), d_ptr(new QextSerialEnumeratorPrivate(this)) +{ + if (!QMetaType::isRegistered(QMetaType::type("QextPortInfo"))) + qRegisterMetaType("QextPortInfo"); +} + +/*! + Destructs the QextSerialEnumerator object. +*/ +QextSerialEnumerator::~QextSerialEnumerator() +{ + delete d_ptr; +} + +/*! + Get list of ports. + + return list of ports currently available in the system. +*/ +QList QextSerialEnumerator::getPorts() +{ + return QextSerialEnumeratorPrivate::getPorts_sys(); +} + +/*! + Enable event-driven notifications of board discovery/removal. +*/ +void QextSerialEnumerator::setUpNotifications() +{ + Q_D(QextSerialEnumerator); + if (!d->setUpNotifications_sys(true)) + QESP_WARNING("Setup Notification Failed..."); +} + +#include "moc_qextserialenumerator.cpp" diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator.h b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator.h new file mode 100644 index 0000000..f207d0d --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#ifndef _QEXTSERIALENUMERATOR_H_ +#define _QEXTSERIALENUMERATOR_H_ + +#include +#include +#include "qextserialport_global.h" + +struct QextPortInfo { + QString portName; ///< Port name. + QString physName; ///< Physical name. + QString friendName; ///< Friendly name. + QString enumName; ///< Enumerator name. + int vendorID; ///< Vendor ID. + int productID; ///< Product ID +}; + +class QextSerialEnumeratorPrivate; +class QEXTSERIALPORT_EXPORT QextSerialEnumerator : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QextSerialEnumerator) +public: + QextSerialEnumerator(QObject *parent=0); + ~QextSerialEnumerator(); + + static QList getPorts(); + void setUpNotifications(); + +Q_SIGNALS: + void deviceDiscovered(const QextPortInfo &info); + void deviceRemoved(const QextPortInfo &info); + +private: + Q_DISABLE_COPY(QextSerialEnumerator) +#if defined(Q_OS_LINUX) && !defined(QESP_NO_UDEV) + Q_PRIVATE_SLOT(d_func(), void _q_deviceEvent()) +#endif + QextSerialEnumeratorPrivate *d_ptr; +}; + +#endif /*_QEXTSERIALENUMERATOR_H_*/ diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_linux.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_linux.cpp new file mode 100644 index 0000000..450d883 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_linux.cpp @@ -0,0 +1,210 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** Copyright (c) 2012 Doug Brown +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialenumerator.h" +#include "qextserialenumerator_p.h" +#include +#include +#include + +void QextSerialEnumeratorPrivate::init_sys() +{ +#ifndef QESP_NO_UDEV + monitor = NULL; + notifierFd = -1; + notifier = NULL; + + udev = udev_new(); + if (!udev) + qCritical() << "Unable to initialize udev notifications"; +#endif +} + +void QextSerialEnumeratorPrivate::destroy_sys() +{ +#ifndef QESP_NO_UDEV + if (notifier) { + notifier->setEnabled(false); + delete notifier; + } + + if (monitor) + udev_monitor_unref(monitor); + + if (udev) + udev_unref(udev); +#endif +} + +#ifndef QESP_NO_UDEV +static QextPortInfo portInfoFromDevice(struct udev_device *dev) +{ + QString vendor = QString::fromLatin1(udev_device_get_property_value(dev, "ID_VENDOR_ID")); + QString product = QString::fromLatin1(udev_device_get_property_value(dev, "ID_MODEL_ID")); + + QextPortInfo pi; + pi.vendorID = vendor.toInt(0, 16); + pi.productID = product.toInt(0, 16); + pi.portName = QString::fromLatin1(udev_device_get_devnode(dev)); + pi.physName = pi.portName; + + return pi; +} +#endif + +QList QextSerialEnumeratorPrivate::getPorts_sys() +{ + QList infoList; +#ifndef QESP_NO_UDEV + struct udev *ud = udev_new(); + if (!ud) { + qCritical() << "Unable to enumerate ports because udev is not initialized."; + return infoList; + } + + struct udev_enumerate *enumerate = udev_enumerate_new(ud); + udev_enumerate_add_match_subsystem(enumerate, "tty"); + udev_enumerate_scan_devices(enumerate); + struct udev_list_entry *list = udev_enumerate_get_list_entry(enumerate); + struct udev_list_entry *entry; + udev_list_entry_foreach(entry, list) { + const char *path; + struct udev_device *dev; + + // Have to grab the actual udev device here... + path = udev_list_entry_get_name(entry); + dev = udev_device_new_from_syspath(ud, path); + + infoList.append(portInfoFromDevice(dev)); + + // Done with this device + udev_device_unref(dev); + } + // Done with the list and this udev + udev_enumerate_unref(enumerate); + udev_unref(ud); +#else + QStringList portNamePrefixes, portNameList; + portNamePrefixes << QLatin1String("ttyS*"); // list normal serial ports first + + QDir dir(QLatin1String("/dev")); + portNameList = dir.entryList(portNamePrefixes, (QDir::System | QDir::Files), QDir::Name); + + // remove the values which are not serial ports for e.g. /dev/ttysa + for (int i = 0; i < portNameList.size(); i++) { + bool ok; + QString current = portNameList.at(i); + // remove the ttyS part, and check, if the other part is a number + current.remove(0,4).toInt(&ok, 10); + if (!ok) { + portNameList.removeAt(i); + i--; + } + } + + // get the non standard serial ports names + // (USB-serial, bluetooth-serial, 18F PICs, and so on) + // if you know an other name prefix for serial ports please let us know + portNamePrefixes.clear(); + portNamePrefixes << QLatin1String("ttyACM*") << QLatin1String("ttyUSB*") << QLatin1String("rfcomm*"); + portNameList += dir.entryList(portNamePrefixes, (QDir::System | QDir::Files), QDir::Name); + + foreach (QString str , portNameList) { + QextPortInfo inf; + inf.physName = QLatin1String("/dev/")+str; + inf.portName = str; + + if (str.contains(QLatin1String("ttyS"))) { + inf.friendName = QLatin1String("Serial port ")+str.remove(0, 4); + } + else if (str.contains(QLatin1String("ttyUSB"))) { + inf.friendName = QLatin1String("USB-serial adapter ")+str.remove(0, 6); + } + else if (str.contains(QLatin1String("rfcomm"))) { + inf.friendName = QLatin1String("Bluetooth-serial adapter ")+str.remove(0, 6); + } + inf.enumName = QLatin1String("/dev"); // is there a more helpful name for this? + infoList.append(inf); + } +#endif + + return infoList; +} + +bool QextSerialEnumeratorPrivate::setUpNotifications_sys(bool setup) +{ + Q_UNUSED(setup); +#ifndef QESP_NO_UDEV + Q_Q(QextSerialEnumerator); + if (!udev) { + qCritical() << "Unable to initialize notifications because udev is not initialized."; + return false; + } + + // Emit signals immediately for devices already connected (Windows version seems to behave + // this way) + foreach (QextPortInfo i, getPorts_sys()) + Q_EMIT q->deviceDiscovered(i); + + // Look for tty devices from udev. + monitor = udev_monitor_new_from_netlink(udev, "udev"); + udev_monitor_filter_add_match_subsystem_devtype(monitor, "tty", NULL); + udev_monitor_enable_receiving(monitor); + notifierFd = udev_monitor_get_fd(monitor); + notifier = new QSocketNotifier(notifierFd, QSocketNotifier::Read); + q->connect(notifier, SIGNAL(activated(int)), q, SLOT(_q_deviceEvent())); + notifier->setEnabled(true); + + return true; +#else + return false; +#endif +} + +#ifndef QESP_NO_UDEV +void QextSerialEnumeratorPrivate::_q_deviceEvent() +{ + Q_Q(QextSerialEnumerator); + struct udev_device *dev = udev_monitor_receive_device(monitor); + if (dev) { + QextPortInfo pi = portInfoFromDevice(dev); + QLatin1String action(udev_device_get_action(dev)); + + if (action == QLatin1String("add")) + Q_EMIT q->deviceDiscovered(pi); + else if (action == QLatin1String("remove")) + Q_EMIT q->deviceRemoved(pi); + + udev_device_unref(dev); + } +} +#endif diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_osx.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_osx.cpp new file mode 100644 index 0000000..ad33e9a --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_osx.cpp @@ -0,0 +1,307 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialenumerator.h" +#include "qextserialenumerator_p.h" +#include +#include +#include +#include + +void QextSerialEnumeratorPrivate::init_sys() +{ +} + +void QextSerialEnumeratorPrivate::destroy_sys() +{ + IONotificationPortDestroy(notificationPortRef); +} + +// static +QList QextSerialEnumeratorPrivate::getPorts_sys() +{ + QList infoList; + io_iterator_t serialPortIterator = 0; + kern_return_t kernResult = KERN_FAILURE; + CFMutableDictionaryRef matchingDictionary; + + // first try to get any serialbsd devices, then try any USBCDC devices + if (!(matchingDictionary = IOServiceMatching(kIOSerialBSDServiceValue))) { + QESP_WARNING("IOServiceMatching returned a NULL dictionary."); + return infoList; + } + CFDictionaryAddValue(matchingDictionary, CFSTR(kIOSerialBSDTypeKey), CFSTR(kIOSerialBSDAllTypes)); + + // then create the iterator with all the matching devices + if (IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDictionary, &serialPortIterator) != KERN_SUCCESS) { + qCritical() << "IOServiceGetMatchingServices failed, returned" << kernResult; + return infoList; + } + iterateServicesOSX(serialPortIterator, infoList); + IOObjectRelease(serialPortIterator); + serialPortIterator = 0; + + if (!(matchingDictionary = IOServiceNameMatching("AppleUSBCDC"))) { + QESP_WARNING("IOServiceNameMatching returned a NULL dictionary."); + return infoList; + } + + if (IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDictionary, &serialPortIterator) != KERN_SUCCESS) { + qCritical() << "IOServiceGetMatchingServices failed, returned" << kernResult; + return infoList; + } + iterateServicesOSX(serialPortIterator, infoList); + IOObjectRelease(serialPortIterator); + + return infoList; +} + +void QextSerialEnumeratorPrivate::iterateServicesOSX(io_object_t service, QList &infoList) +{ + // Iterate through all modems found. + io_object_t usbService; + while ((usbService = IOIteratorNext(service))) { + QextPortInfo info; + info.vendorID = 0; + info.productID = 0; + getServiceDetailsOSX(usbService, &info); + infoList.append(info); + } +} + +bool QextSerialEnumeratorPrivate::getServiceDetailsOSX(io_object_t service, QextPortInfo *portInfo) +{ + bool retval = true; + CFTypeRef bsdPathAsCFString = NULL; + CFTypeRef productNameAsCFString = NULL; + CFTypeRef vendorIdAsCFNumber = NULL; + CFTypeRef productIdAsCFNumber = NULL; + // check the name of the modem's callout device + bsdPathAsCFString = IORegistryEntryCreateCFProperty(service, CFSTR(kIOCalloutDeviceKey), + kCFAllocatorDefault, 0); + + // wander up the hierarchy until we find the level that can give us the + // vendor/product IDs and the product name, if available + io_registry_entry_t parent; + kern_return_t kernResult = IORegistryEntryGetParentEntry(service, kIOServicePlane, &parent); + while (kernResult == KERN_SUCCESS && !vendorIdAsCFNumber && !productIdAsCFNumber) { + if (!productNameAsCFString) + productNameAsCFString = IORegistryEntrySearchCFProperty(parent, + kIOServicePlane, + CFSTR("Product Name"), + kCFAllocatorDefault, 0); + vendorIdAsCFNumber = IORegistryEntrySearchCFProperty(parent, + kIOServicePlane, + CFSTR(kUSBVendorID), + kCFAllocatorDefault, 0); + productIdAsCFNumber = IORegistryEntrySearchCFProperty(parent, + kIOServicePlane, + CFSTR(kUSBProductID), + kCFAllocatorDefault, 0); + io_registry_entry_t oldparent = parent; + kernResult = IORegistryEntryGetParentEntry(parent, kIOServicePlane, &parent); + IOObjectRelease(oldparent); + } + + io_string_t ioPathName; + IORegistryEntryGetPath(service, kIOServicePlane, ioPathName); + portInfo->physName = ioPathName; + + if (bsdPathAsCFString) { + char path[MAXPATHLEN]; + if (CFStringGetCString((CFStringRef)bsdPathAsCFString, path, + PATH_MAX, kCFStringEncodingUTF8)) + portInfo->portName = path; + CFRelease(bsdPathAsCFString); + } + + if (productNameAsCFString) { + char productName[MAXPATHLEN]; + if (CFStringGetCString((CFStringRef)productNameAsCFString, productName, + PATH_MAX, kCFStringEncodingUTF8)) + portInfo->friendName = productName; + CFRelease(productNameAsCFString); + } + + if (vendorIdAsCFNumber) { + SInt32 vID; + if (CFNumberGetValue((CFNumberRef)vendorIdAsCFNumber, kCFNumberSInt32Type, &vID)) + portInfo->vendorID = vID; + CFRelease(vendorIdAsCFNumber); + } + + if (productIdAsCFNumber) { + SInt32 pID; + if (CFNumberGetValue((CFNumberRef)productIdAsCFNumber, kCFNumberSInt32Type, &pID)) + portInfo->productID = pID; + CFRelease(productIdAsCFNumber); + } + IOObjectRelease(service); + return retval; +} + +// IOKit callbacks registered via setupNotifications() +void deviceDiscoveredCallbackOSX(void *ctxt, io_iterator_t serialPortIterator) +{ + QextSerialEnumeratorPrivate *d = (QextSerialEnumeratorPrivate *)ctxt; + io_object_t serialService; + while ((serialService = IOIteratorNext(serialPortIterator))) + d->onDeviceDiscoveredOSX(serialService); +} + +void deviceTerminatedCallbackOSX(void *ctxt, io_iterator_t serialPortIterator) +{ + QextSerialEnumeratorPrivate *d = (QextSerialEnumeratorPrivate *)ctxt; + io_object_t serialService; + while ((serialService = IOIteratorNext(serialPortIterator))) + d->onDeviceTerminatedOSX(serialService); +} + +/* + A device has been discovered via IOKit. + Create a QextPortInfo if possible, and emit the signal indicating that we've found it. +*/ +void QextSerialEnumeratorPrivate::onDeviceDiscoveredOSX(io_object_t service) +{ + Q_Q(QextSerialEnumerator); + QextPortInfo info; + info.vendorID = 0; + info.productID = 0; + if (getServiceDetailsOSX(service, &info)) + Q_EMIT q->deviceDiscovered(info); +} + +/* + Notification via IOKit that a device has been removed. + Create a QextPortInfo if possible, and emit the signal indicating that it's gone. +*/ +void QextSerialEnumeratorPrivate::onDeviceTerminatedOSX(io_object_t service) +{ + Q_Q(QextSerialEnumerator); + QextPortInfo info; + info.vendorID = 0; + info.productID = 0; + if (getServiceDetailsOSX(service, &info)) + Q_EMIT q->deviceRemoved(info); +} + +/* + Create matching dictionaries for the devices we want to get notifications for, + and add them to the current run loop. Invoke the callbacks that will be responding + to these notifications once to arm them, and discover any devices that + are currently connected at the time notifications are setup. +*/ +bool QextSerialEnumeratorPrivate::setUpNotifications_sys(bool /*setup*/) +{ + kern_return_t kernResult; + mach_port_t masterPort; + CFRunLoopSourceRef notificationRunLoopSource; + CFMutableDictionaryRef classesToMatch; + CFMutableDictionaryRef cdcClassesToMatch; + io_iterator_t portIterator; + + kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort); + if (KERN_SUCCESS != kernResult) { + qDebug() << "IOMasterPort returned:" << kernResult; + return false; + } + + classesToMatch = IOServiceMatching(kIOSerialBSDServiceValue); + if (classesToMatch == NULL) + qDebug("IOServiceMatching returned a NULL dictionary."); + else + CFDictionarySetValue(classesToMatch, CFSTR(kIOSerialBSDTypeKey), CFSTR(kIOSerialBSDAllTypes)); + + if (!(cdcClassesToMatch = IOServiceNameMatching("AppleUSBCDC"))) { + QESP_WARNING("couldn't create cdc matching dict"); + return false; + } + + // Retain an additional reference since each call to IOServiceAddMatchingNotification consumes one. + classesToMatch = (CFMutableDictionaryRef) CFRetain(classesToMatch); + cdcClassesToMatch = (CFMutableDictionaryRef) CFRetain(cdcClassesToMatch); + + notificationPortRef = IONotificationPortCreate(masterPort); + if (notificationPortRef == NULL) { + qDebug("IONotificationPortCreate return a NULL IONotificationPortRef."); + return false; + } + + notificationRunLoopSource = IONotificationPortGetRunLoopSource(notificationPortRef); + if (notificationRunLoopSource == NULL) { + qDebug("IONotificationPortGetRunLoopSource returned NULL CFRunLoopSourceRef."); + return false; + } + + CFRunLoopAddSource(CFRunLoopGetCurrent(), notificationRunLoopSource, kCFRunLoopDefaultMode); + + kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOMatchedNotification, classesToMatch, + deviceDiscoveredCallbackOSX, this, &portIterator); + if (kernResult != KERN_SUCCESS) { + qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; + return false; + } + + // arm the callback, and grab any devices that are already connected + deviceDiscoveredCallbackOSX(this, portIterator); + + kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOMatchedNotification, cdcClassesToMatch, + deviceDiscoveredCallbackOSX, this, &portIterator); + if (kernResult != KERN_SUCCESS) { + qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; + return false; + } + + // arm the callback, and grab any devices that are already connected + deviceDiscoveredCallbackOSX(this, portIterator); + + kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOTerminatedNotification, classesToMatch, + deviceTerminatedCallbackOSX, this, &portIterator); + if (kernResult != KERN_SUCCESS) { + qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; + return false; + } + + // arm the callback, and clear any devices that are terminated + deviceTerminatedCallbackOSX(this, portIterator); + + kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOTerminatedNotification, cdcClassesToMatch, + deviceTerminatedCallbackOSX, this, &portIterator); + if (kernResult != KERN_SUCCESS) { + qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; + return false; + } + + // arm the callback, and clear any devices that are terminated + deviceTerminatedCallbackOSX(this, portIterator); + return true; +} + diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_p.h b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_p.h new file mode 100644 index 0000000..74bbeb2 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_p.h @@ -0,0 +1,123 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** Copyright (c) 2012 Doug Brown +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ +#ifndef _QEXTSERIALENUMERATOR_P_H_ +#define _QEXTSERIALENUMERATOR_P_H_ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QESP API. It exists for the convenience +// of other QESP classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qextserialenumerator.h" + +#ifdef Q_CC_MINGW +// needed for mingw to pull in appropriate dbt business... +// probably a better way to do this +// http://mingw-users.1079350.n2.nabble.com/DEV-BROADCAST-DEVICEINTERFACE-was-not-declared-in-this-scope-td3552762.html +// http://msdn.microsoft.com/en-us/library/6sehtctf.aspx +# ifndef WINVER +# define WINVER 0x0501 +# endif +# ifndef _WIN32_WINNT +# define _WIN32_WINNT WINVER +# endif +#endif + +#ifdef Q_OS_WIN +# include +#endif /*Q_OS_WIN*/ + +#ifdef Q_OS_MAC +# include +#endif /*Q_OS_MAC*/ + +#if defined(Q_OS_LINUX) && !defined(QESP_NO_UDEV) +# include +extern "C" { +# include +} +#endif + +class QextSerialRegistrationWidget; +class QextSerialEnumeratorPrivate +{ + Q_DECLARE_PUBLIC(QextSerialEnumerator) +public: + QextSerialEnumeratorPrivate(QextSerialEnumerator *enumrator); + ~QextSerialEnumeratorPrivate(); + void init_sys(); + void destroy_sys(); + + static QList getPorts_sys(); + bool setUpNotifications_sys(bool setup); + +#if defined(Q_OS_WIN) && defined(QT_GUI_LIB) + LRESULT onDeviceChanged(WPARAM wParam, LPARAM lParam); + bool matchAndDispatchChangedDevice(const QString &deviceID, const GUID &guid, WPARAM wParam); + QextSerialRegistrationWidget *notificationWidget; +#endif /*Q_OS_WIN*/ + +#ifdef Q_OS_MAC + /*! + * Search for serial ports using IOKit. + * \param infoList list with result. + */ + static void iterateServicesOSX(io_object_t service, QList &infoList); + static bool getServiceDetailsOSX(io_object_t service, QextPortInfo *portInfo); + void onDeviceDiscoveredOSX(io_object_t service); + void onDeviceTerminatedOSX(io_object_t service); + friend void deviceDiscoveredCallbackOSX(void *ctxt, io_iterator_t serialPortIterator); + friend void deviceTerminatedCallbackOSX(void *ctxt, io_iterator_t serialPortIterator); + + IONotificationPortRef notificationPortRef; +#endif // Q_OS_MAC + +#if defined(Q_OS_LINUX) && !defined(QESP_NO_UDEV) + QSocketNotifier *notifier; + int notifierFd; + struct udev *udev; + struct udev_monitor *monitor; + + void _q_deviceEvent(); +#endif + +private: + QextSerialEnumerator *q_ptr; +}; + +#endif //_QEXTSERIALENUMERATOR_P_H_ diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_unix.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_unix.cpp new file mode 100644 index 0000000..dfc12a8 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_unix.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialenumerator.h" +#include "qextserialenumerator_p.h" +#include + +void QextSerialEnumeratorPrivate::init_sys() +{ +} + +void QextSerialEnumeratorPrivate::destroy_sys() +{ +} + +QList QextSerialEnumeratorPrivate::getPorts_sys() +{ + QList infoList; + QESP_WARNING("Enumeration for POSIX systems (except Linux) is not implemented yet."); + return infoList; +} + +bool QextSerialEnumeratorPrivate::setUpNotifications_sys(bool setup) +{ + Q_UNUSED(setup) + QESP_WARNING("Notifications for *Nix/FreeBSD are not implemented yet"); + return false; +} diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_win.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_win.cpp new file mode 100644 index 0000000..d9ed833 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialenumerator_win.cpp @@ -0,0 +1,303 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialenumerator.h" +#include "qextserialenumerator_p.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef QT_GUI_LIB +/*! + \internal + \class QextSerialRegistrationWidget + + Internal window which is used to receive device arrvial and removal message. +*/ + +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#include +class QextSerialRegistrationWidget : public QWidget +#else +#include +class QextSerialRegistrationWidget : public QWindow +#endif +{ +public: + QextSerialRegistrationWidget(QextSerialEnumeratorPrivate *qese) { + this->qese = qese; + } + ~QextSerialRegistrationWidget() {} + +protected: + +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + bool winEvent(MSG *message, long *result) { +#else + bool nativeEvent(const QByteArray & /*eventType*/, void *msg, long *result) { + MSG *message = static_cast(msg); +#endif + if (message->message == WM_DEVICECHANGE) { + qese->onDeviceChanged(message->wParam, message->lParam); + *result = 1; + return true; + } + return false; + } +private: + QextSerialEnumeratorPrivate *qese; +}; +#endif // QT_GUI_LIB + +void QextSerialEnumeratorPrivate::init_sys() +{ +#ifdef QT_GUI_LIB + notificationWidget = 0; +#endif // QT_GUI_LIB +} + +/*! + default +*/ +void QextSerialEnumeratorPrivate::destroy_sys() +{ +#ifdef QT_GUI_LIB + if (notificationWidget) + delete notificationWidget; +#endif +} + +#ifndef GUID_DEVINTERFACE_COMPORT +DEFINE_GUID(GUID_DEVINTERFACE_COMPORT, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x73); +#endif + + +/*! + \internal + Get value of specified property from the registry. + \a key handle to an open key. + \a property property name. + + return property value. +*/ +static QString getRegKeyValue(HKEY key, LPCTSTR property) +{ + DWORD size = 0; + DWORD type; + if (::RegQueryValueEx(key, property, NULL, NULL, NULL, &size) != ERROR_SUCCESS) + return QString(); + BYTE *buff = new BYTE[size]; + QString result; + if (::RegQueryValueEx(key, property, NULL, &type, buff, &size) == ERROR_SUCCESS) + result = QString::fromUtf16(reinterpret_cast(buff)); + delete [] buff; + return result; +} + +/*! + \internal + Get specific property from registry. + \a devInfoSet pointer to the device information set that contains the interface + and its underlying device. Returned by SetupDiGetClassDevs() function. + \a devInfoData pointer to an SP_DEVINFO_DATA structure that defines the device instance. + this is returned by SetupDiGetDeviceInterfaceDetail() function. + \a property registry property. One of defined SPDRP_* constants. + + return property string. + */ +static QString getDeviceRegistryProperty(HDEVINFO devInfoSet, PSP_DEVINFO_DATA devInfoData, DWORD property) +{ + DWORD buffSize = 0; + ::SetupDiGetDeviceRegistryProperty(devInfoSet, devInfoData, property, NULL, NULL, 0, &buffSize); + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) + return QString(); + BYTE *buff = new BYTE[buffSize]; + ::SetupDiGetDeviceRegistryProperty(devInfoSet, devInfoData, property, NULL, buff, buffSize, NULL); + QString result = QString::fromUtf16(reinterpret_cast(buff)); + delete [] buff; + return result; +} + +/*! + \internal +*/ +static bool getDeviceDetailsInformation(QextPortInfo *portInfo, HDEVINFO devInfoSet, PSP_DEVINFO_DATA devInfoData + , WPARAM wParam = DBT_DEVICEARRIVAL) +{ + portInfo->friendName = getDeviceRegistryProperty(devInfoSet, devInfoData, SPDRP_FRIENDLYNAME); + if (wParam == DBT_DEVICEARRIVAL) + portInfo->physName = getDeviceRegistryProperty(devInfoSet, devInfoData, SPDRP_PHYSICAL_DEVICE_OBJECT_NAME); + portInfo->enumName = getDeviceRegistryProperty(devInfoSet, devInfoData, SPDRP_ENUMERATOR_NAME); + + HKEY devKey = ::SetupDiOpenDevRegKey(devInfoSet, devInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_QUERY_VALUE); + portInfo->portName = getRegKeyValue(devKey, TEXT("PortName")); + ::RegCloseKey(devKey); + + QString hardwareIDs = getDeviceRegistryProperty(devInfoSet, devInfoData, SPDRP_HARDWAREID); + QRegExp idRx(QLatin1String("VID_(\\w+)&PID_(\\w+)")); + if (hardwareIDs.toUpper().contains(idRx)) { + bool dummy; + portInfo->vendorID = idRx.cap(1).toInt(&dummy, 16); + portInfo->productID = idRx.cap(2).toInt(&dummy, 16); + //qDebug() << "got vid:" << vid << "pid:" << pid; + } + return true; +} + +/*! + \internal +*/ +static void enumerateDevices(const GUID &guid, QList *infoList) +{ + HDEVINFO devInfoSet = ::SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); + if (devInfoSet != INVALID_HANDLE_VALUE) { + SP_DEVINFO_DATA devInfoData; + devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + for(int i = 0; ::SetupDiEnumDeviceInfo(devInfoSet, i, &devInfoData); i++) { + QextPortInfo info; + info.productID = info.vendorID = 0; + getDeviceDetailsInformation(&info, devInfoSet, &devInfoData); + infoList->append(info); + } + ::SetupDiDestroyDeviceInfoList(devInfoSet); + } +} + + +static bool lessThan(const QextPortInfo &s1, const QextPortInfo &s2) +{ + if (s1.portName.startsWith(QLatin1String("COM")) + && s2.portName.startsWith(QLatin1String("COM"))) { + return s1.portName.mid(3).toInt() QextSerialEnumeratorPrivate::getPorts_sys() +{ + QList ports; + enumerateDevices(GUID_DEVINTERFACE_COMPORT, &ports); + std::sort(ports.begin(), ports.end(), lessThan); + return ports; +} + + +/* + Enable event-driven notifications of board discovery/removal. +*/ +bool QextSerialEnumeratorPrivate::setUpNotifications_sys(bool setup) +{ +#ifndef QT_GUI_LIB + Q_UNUSED(setup) + QESP_WARNING("QextSerialEnumerator: GUI not enabled - can't register for device notifications."); + return false; +#else + Q_Q(QextSerialEnumerator); + if (setup && notificationWidget) //already setup + return true; + notificationWidget = new QextSerialRegistrationWidget(this); + + DEV_BROADCAST_DEVICEINTERFACE dbh; + ::ZeroMemory(&dbh, sizeof(dbh)); + dbh.dbcc_size = sizeof(dbh); + dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + // dbh.dbcc_classguid = GUID_DEVCLASS_PORTS; //Ignored in such case + DWORD flags = DEVICE_NOTIFY_WINDOW_HANDLE|DEVICE_NOTIFY_ALL_INTERFACE_CLASSES; + if (::RegisterDeviceNotification((HWND)notificationWidget->winId(), &dbh, flags) == NULL) { + QESP_WARNING() << "RegisterDeviceNotification failed:" << GetLastError(); + return false; + } + // setting up notifications doesn't tell us about devices already connected + // so get those manually + foreach (QextPortInfo port, getPorts_sys()) + Q_EMIT q->deviceDiscovered(port); + return true; +#endif // QT_GUI_LIB +} + +#ifdef QT_GUI_LIB +LRESULT QextSerialEnumeratorPrivate::onDeviceChanged(WPARAM wParam, LPARAM lParam) +{ + if (DBT_DEVICEARRIVAL == wParam || DBT_DEVICEREMOVECOMPLETE == wParam) { + PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lParam; + if (pHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { + PDEV_BROADCAST_DEVICEINTERFACE pDevInf = (PDEV_BROADCAST_DEVICEINTERFACE)pHdr; + // delimiters are different across APIs...change to backslash. ugh. + QString deviceID = QString::fromUtf16(reinterpret_cast(pDevInf->dbcc_name)); + deviceID = deviceID.toUpper().replace(QLatin1String("#"), QLatin1String("\\")); + + matchAndDispatchChangedDevice(deviceID, GUID_DEVINTERFACE_COMPORT, wParam); + } + } + return 0; +} + +bool QextSerialEnumeratorPrivate::matchAndDispatchChangedDevice(const QString &deviceID, const GUID &guid, WPARAM wParam) +{ + Q_Q(QextSerialEnumerator); + bool rv = false; + DWORD dwFlag = (DBT_DEVICEARRIVAL == wParam) ? DIGCF_PRESENT : DIGCF_PROFILE; + HDEVINFO devInfoSet = SetupDiGetClassDevs(&guid, NULL, NULL, dwFlag | DIGCF_DEVICEINTERFACE); + if (devInfoSet != INVALID_HANDLE_VALUE) { + SP_DEVINFO_DATA spDevInfoData; + spDevInfoData.cbSize = sizeof(SP_DEVINFO_DATA); + for(int i=0; SetupDiEnumDeviceInfo(devInfoSet, i, &spDevInfoData); i++) { + DWORD nSize = 0; + TCHAR buf[MAX_PATH]; + if (SetupDiGetDeviceInstanceId(devInfoSet, &spDevInfoData, buf, MAX_PATH, &nSize) + && deviceID.contains(QString::fromUtf16(reinterpret_cast(buf)))) { // we found a match + rv = true; + QextPortInfo info; + info.productID = info.vendorID = 0; + getDeviceDetailsInformation(&info, devInfoSet, &spDevInfoData, wParam); + if (wParam == DBT_DEVICEARRIVAL) + Q_EMIT q->deviceDiscovered(info); + else if (wParam == DBT_DEVICEREMOVECOMPLETE) + Q_EMIT q->deviceRemoved(info); + break; + } + } + SetupDiDestroyDeviceInfoList(devInfoSet); + } + return rv; +} +#endif //QT_GUI_LIB diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.cpp new file mode 100644 index 0000000..d1089e2 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.cpp @@ -0,0 +1,1005 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialport.h" +#include "qextserialport_p.h" +#include +#include +#include +#include + +/*! + \class PortSettings + + \brief The PortSettings class contain port settings + + Structure to contain port settings. + + \code + BaudRateType BaudRate; + DataBitsType DataBits; + ParityType Parity; + StopBitsType StopBits; + FlowType FlowControl; + long Timeout_Millisec; + \endcode +*/ + +QextSerialPortPrivate::QextSerialPortPrivate(QextSerialPort *q) + :lock(QReadWriteLock::Recursive), q_ptr(q) +{ + lastErr = E_NO_ERROR; + settings.BaudRate = BAUD9600; + settings.Parity = PAR_NONE; + settings.FlowControl = FLOW_OFF; + settings.DataBits = DATA_8; + settings.StopBits = STOP_1; + settings.Timeout_Millisec = 10; + settingsDirtyFlags = DFE_ALL; + + platformSpecificInit(); +} + +QextSerialPortPrivate::~QextSerialPortPrivate() +{ + platformSpecificDestruct(); +} + +void QextSerialPortPrivate::setBaudRate(BaudRateType baudRate, bool update) +{ + switch (baudRate) { +#ifdef Q_OS_WIN + //Windows Special + case BAUD14400: + case BAUD56000: + case BAUD128000: + case BAUD256000: + QESP_PORTABILITY_WARNING()<<"QextSerialPort Portability Warning: POSIX does not support baudRate:"<isOpen()) + updatePortSettings(); + break; +#if !(defined(Q_OS_WIN) || defined(Q_OS_MAC)) + default: + QESP_WARNING()<<"QextSerialPort does not support baudRate:"<isOpen()) + updatePortSettings(); +} + +void QextSerialPortPrivate::setDataBits(DataBitsType dataBits, bool update) +{ + switch(dataBits) { + + case DATA_5: + if (settings.StopBits == STOP_2) { + QESP_WARNING("QextSerialPort: 5 Data bits cannot be used with 2 stop bits."); + } else { + settings.DataBits = dataBits; + settingsDirtyFlags |= DFE_DataBits; + } + break; + + case DATA_6: +#ifdef Q_OS_WIN + if (settings.StopBits == STOP_1_5) { + QESP_WARNING("QextSerialPort: 6 Data bits cannot be used with 1.5 stop bits."); + } + else +#endif + { + settings.DataBits = dataBits; + settingsDirtyFlags |= DFE_DataBits; + } + break; + + case DATA_7: +#ifdef Q_OS_WIN + if (settings.StopBits == STOP_1_5) { + QESP_WARNING("QextSerialPort: 7 Data bits cannot be used with 1.5 stop bits."); + } + else +#endif + { + settings.DataBits = dataBits; + settingsDirtyFlags |= DFE_DataBits; + } + break; + + case DATA_8: +#ifdef Q_OS_WIN + if (settings.StopBits == STOP_1_5) { + QESP_WARNING("QextSerialPort: 8 Data bits cannot be used with 1.5 stop bits."); + } + else +#endif + { + settings.DataBits = dataBits; + settingsDirtyFlags |= DFE_DataBits; + } + break; + default: + QESP_WARNING()<<"QextSerialPort does not support Data bits:"<isOpen()) + updatePortSettings(); +} + +void QextSerialPortPrivate::setStopBits(StopBitsType stopBits, bool update) +{ + switch (stopBits) { + + /*one stop bit*/ + case STOP_1: + settings.StopBits = stopBits; + settingsDirtyFlags |= DFE_StopBits; + break; + +#ifdef Q_OS_WIN + /*1.5 stop bits*/ + case STOP_1_5: + QESP_PORTABILITY_WARNING("QextSerialPort Portability Warning: 1.5 stop bit operation is not supported by POSIX."); + if (settings.DataBits != DATA_5) { + QESP_WARNING("QextSerialPort: 1.5 stop bits can only be used with 5 data bits"); + } else { + settings.StopBits = stopBits; + settingsDirtyFlags |= DFE_StopBits; + } + break; +#endif + + /*two stop bits*/ + case STOP_2: + if (settings.DataBits == DATA_5) { + QESP_WARNING("QextSerialPort: 2 stop bits cannot be used with 5 data bits"); + } else { + settings.StopBits = stopBits; + settingsDirtyFlags |= DFE_StopBits; + } + break; + default: + QESP_WARNING()<<"QextSerialPort does not support stop bits: "<isOpen()) + updatePortSettings(); +} + +void QextSerialPortPrivate::setFlowControl(FlowType flow, bool update) +{ + settings.FlowControl = flow; + settingsDirtyFlags |= DFE_Flow; + if (update && q_func()->isOpen()) + updatePortSettings(); +} + +void QextSerialPortPrivate::setTimeout(long millisec, bool update) +{ + settings.Timeout_Millisec = millisec; + settingsDirtyFlags |= DFE_TimeOut; + if (update && q_func()->isOpen()) + updatePortSettings(); +} + +void QextSerialPortPrivate::setPortSettings(const PortSettings &settings, bool update) +{ + setBaudRate(settings.BaudRate, false); + setDataBits(settings.DataBits, false); + setStopBits(settings.StopBits, false); + setParity(settings.Parity, false); + setFlowControl(settings.FlowControl, false); + setTimeout(settings.Timeout_Millisec, false); + settingsDirtyFlags = DFE_ALL; + if (update && q_func()->isOpen()) + updatePortSettings(); +} + + +void QextSerialPortPrivate::_q_canRead() +{ + qint64 maxSize = bytesAvailable_sys(); + if (maxSize > 0) { + char *writePtr = readBuffer.reserve(size_t(maxSize)); + qint64 bytesRead = readData_sys(writePtr, maxSize); + if (bytesRead < maxSize) + readBuffer.chop(maxSize - bytesRead); + Q_Q(QextSerialPort); + Q_EMIT q->readyRead(); + } +} + +/*! \class QextSerialPort + + \brief The QextSerialPort class encapsulates a serial port on both POSIX and Windows systems. + + \section1 Usage + QextSerialPort offers both a polling and event driven API. Event driven + is typically easier to use, since you never have to worry about checking + for new data. + + \bold Example + \code + QextSerialPort *port = new QextSerialPort("COM1"); + connect(port, SIGNAL(readyRead()), myClass, SLOT(onDataAvailable())); + port->open(); + + void MyClass::onDataAvailable() + { + QByteArray data = port->readAll(); + processNewData(usbdata); + } + \endcode + + \section1 Compatibility + The user will be notified of errors and possible portability conflicts at run-time + by default. + + For example, if a application has used BAUD1800, when it is runing under unix, you + will get following message. + + \code + QextSerialPort Portability Warning: Windows does not support baudRate:1800 + \endcode + + This behavior can be turned off by defining macro QESP_NO_WARN (to turn off all warnings) + or QESP_NO_PORTABILITY_WARN (to turn off portability warnings) in the project. + + + \bold Author: Stefan Sander, Michal Policht, Brandon Fosdick, Liam Staskawicz, Debao Zhang +*/ + +/*! + \enum QextSerialPort::QueryMode + + This enum type specifies query mode used in a serial port: + + \value Polling + asynchronously read and write + \value EventDriven + synchronously read and write +*/ + +/*! + \fn void QextSerialPort::dsrChanged(bool status) + This signal is emitted whenever dsr line has changed its state. You may + use this signal to check if device is connected. + + \a status true when DSR signal is on, false otherwise. + */ + + +/*! + \fn QueryMode QextSerialPort::queryMode() const + Get query mode. + */ + +/*! + Default constructor. Note that the name of the device used by a QextSerialPort is dependent on + your OS. Possible naming conventions and their associated OS are: + + \code + + OS Constant Used By Naming Convention + ------------- ------------- ------------------------ + Q_OS_WIN Windows COM1, COM2 + Q_OS_IRIX SGI/IRIX /dev/ttyf1, /dev/ttyf2 + Q_OS_HPUX HP-UX /dev/tty1p0, /dev/tty2p0 + Q_OS_SOLARIS SunOS/Slaris /dev/ttya, /dev/ttyb + Q_OS_OSF Digital UNIX /dev/tty01, /dev/tty02 + Q_OS_FREEBSD FreeBSD /dev/ttyd0, /dev/ttyd1 + Q_OS_OPENBSD OpenBSD /dev/tty00, /dev/tty01 + Q_OS_LINUX Linux /dev/ttyS0, /dev/ttyS1 + /dev/ttyS0, /dev/ttyS1 + \endcode + + This constructor assigns the device name to the name of the first port on the specified system. + See the other constructors if you need to open a different port. Default \a mode is EventDriven. + As a subclass of QObject, \a parent can be specified. +*/ + +QextSerialPort::QextSerialPort(QextSerialPort::QueryMode mode, QObject *parent) + : QIODevice(parent), d_ptr(new QextSerialPortPrivate(this)) +{ +#ifdef Q_OS_WIN + setPortName(QLatin1String("COM1")); + +#elif defined(Q_OS_IRIX) + setPortName(QLatin1String("/dev/ttyf1")); + +#elif defined(Q_OS_HPUX) + setPortName(QLatin1String("/dev/tty1p0")); + +#elif defined(Q_OS_SOLARIS) + setPortName(QLatin1String("/dev/ttya")); + +#elif defined(Q_OS_OSF) //formally DIGITAL UNIX + setPortName(QLatin1String("/dev/tty01")); + +#elif defined(Q_OS_FREEBSD) + setPortName(QLatin1String("/dev/ttyd1")); + +#elif defined(Q_OS_OPENBSD) + setPortName(QLatin1String("/dev/tty00")); + +#else + setPortName(QLatin1String("/dev/ttyS0")); +#endif + setQueryMode(mode); +} + +/*! + Constructs a serial port attached to the port specified by name. + \a name is the name of the device, which is windowsystem-specific, + e.g."COM1" or "/dev/ttyS0". \a mode +*/ +QextSerialPort::QextSerialPort(const QString &name, QextSerialPort::QueryMode mode, QObject *parent) + : QIODevice(parent), d_ptr(new QextSerialPortPrivate(this)) +{ + setQueryMode(mode); + setPortName(name); +} + +/*! + Constructs a port with default name and specified \a settings. +*/ +QextSerialPort::QextSerialPort(const PortSettings &settings, QextSerialPort::QueryMode mode, QObject *parent) + : QIODevice(parent), d_ptr(new QextSerialPortPrivate(this)) +{ + Q_D(QextSerialPort); + setQueryMode(mode); + d->setPortSettings(settings); +} + +/*! + Constructs a port with specified \a name , \a mode and \a settings. +*/ +QextSerialPort::QextSerialPort(const QString &name, const PortSettings &settings, QextSerialPort::QueryMode mode, QObject *parent) + : QIODevice(parent), d_ptr(new QextSerialPortPrivate(this)) +{ + Q_D(QextSerialPort); + setPortName(name); + setQueryMode(mode); + d->setPortSettings(settings); +} + +/*! + Opens a serial port and sets its OpenMode to \a mode. + Note that this function does not specify which device to open. + Returns true if successful; otherwise returns false.This function has no effect + if the port associated with the class is already open. The port is also + configured to the current settings, as stored in the settings structure. +*/ +bool QextSerialPort::open(OpenMode mode) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (mode != QIODevice::NotOpen && !isOpen()) + d->open_sys(mode); + + return isOpen(); +} + + +/*! \reimp + Closes a serial port. This function has no effect if the serial port associated with the class + is not currently open. +*/ +void QextSerialPort::close() +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (isOpen()) { + // Be a good QIODevice and call QIODevice::close() before really close() + // so the aboutToClose() signal is emitted at the proper time + QIODevice::close(); // mark ourselves as closed + d->close_sys(); + d->readBuffer.clear(); + } +} + +/*! + Flushes all pending I/O to the serial port. This function has no effect if the serial port + associated with the class is not currently open. +*/ +void QextSerialPort::flush() +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (isOpen()) + d->flush_sys(); +} + +/*! \reimp + Returns the number of bytes waiting in the port's receive queue. This function will return 0 if + the port is not currently open, or -1 on error. +*/ +qint64 QextSerialPort::bytesAvailable() const +{ + QWriteLocker locker(&d_func()->lock); + if (isOpen()) { + qint64 bytes = d_func()->bytesAvailable_sys(); + if (bytes != -1) { + return bytes + d_func()->readBuffer.size() + + QIODevice::bytesAvailable(); + } + return -1; + } + return 0; +} + +/*! \reimp + +*/ +bool QextSerialPort::canReadLine() const +{ + QReadLocker locker(&d_func()->lock); + return QIODevice::canReadLine() || d_func()->readBuffer.canReadLine(); +} + +/*! + * Set desired serial communication handling style. You may choose from polling + * or event driven approach. This function does nothing when port is open; to + * apply changes port must be reopened. + * + * In event driven approach read() and write() functions are acting + * asynchronously. They return immediately and the operation is performed in + * the background, so they doesn't freeze the calling thread. + * To determine when operation is finished, QextSerialPort runs separate thread + * and monitors serial port events. Whenever the event occurs, adequate signal + * is emitted. + * + * When polling is set, read() and write() are acting synchronously. Signals are + * not working in this mode and some functions may not be available. The advantage + * of polling is that it generates less overhead due to lack of signals emissions + * and it doesn't start separate thread to monitor events. + * + * Generally event driven approach is more capable and friendly, although some + * applications may need as low overhead as possible and then polling comes. + * + * \a mode query mode. + */ +void QextSerialPort::setQueryMode(QueryMode mode) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (mode != d->queryMode) + d->queryMode = mode; +} + +/*! + Sets the \a name of the device associated with the object, e.g. "COM1", or "/dev/ttyS0". +*/ +void QextSerialPort::setPortName(const QString &name) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + d->port = name; +} + +/*! + Returns the name set by setPortName(). +*/ +QString QextSerialPort::portName() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->port; +} + +QextSerialPort::QueryMode QextSerialPort::queryMode() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->queryMode; +} + +/*! + Reads all available data from the device, and returns it as a QByteArray. + This function has no way of reporting errors; returning an empty QByteArray() + can mean either that no data was currently available for reading, or that an error occurred. +*/ +QByteArray QextSerialPort::readAll() +{ + int avail = this->bytesAvailable(); + return (avail > 0) ? this->read(avail) : QByteArray(); +} + +/*! + Returns the baud rate of the serial port. For a list of possible return values see + the definition of the enum BaudRateType. +*/ +BaudRateType QextSerialPort::baudRate() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->settings.BaudRate; +} + +/*! + Returns the number of data bits used by the port. For a list of possible values returned by + this function, see the definition of the enum DataBitsType. +*/ +DataBitsType QextSerialPort::dataBits() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->settings.DataBits; +} + +/*! + Returns the type of parity used by the port. For a list of possible values returned by + this function, see the definition of the enum ParityType. +*/ +ParityType QextSerialPort::parity() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->settings.Parity; +} + +/*! + Returns the number of stop bits used by the port. For a list of possible return values, see + the definition of the enum StopBitsType. +*/ +StopBitsType QextSerialPort::stopBits() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->settings.StopBits; +} + +/*! + Returns the type of flow control used by the port. For a list of possible values returned + by this function, see the definition of the enum FlowType. +*/ +FlowType QextSerialPort::flowControl() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->settings.FlowControl; +} + +/*! + \reimp + Returns true if device is sequential, otherwise returns false. Serial port is sequential device + so this function always returns true. Check QIODevice::isSequential() documentation for more + information. +*/ +bool QextSerialPort::isSequential() const +{ + return true; +} + +/*! + Return the error number, or 0 if no error occurred. +*/ +ulong QextSerialPort::lastError() const +{ + QReadLocker locker(&d_func()->lock); + return d_func()->lastErr; +} + +/*! + Returns the line status as stored by the port function. This function will retrieve the states + of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines + can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned + long with specific bits indicating which lines are high. The following constants should be used + to examine the states of individual lines: + + \code + Mask Line + ------ ---- + LS_CTS CTS + LS_DSR DSR + LS_DCD DCD + LS_RI RI + LS_RTS RTS (POSIX only) + LS_DTR DTR (POSIX only) + LS_ST Secondary TXD (POSIX only) + LS_SR Secondary RXD (POSIX only) + \endcode + + This function will return 0 if the port associated with the class is not currently open. +*/ +unsigned long QextSerialPort::lineStatus() +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (isOpen()) + return d->lineStatus_sys(); + return 0; +} + +/*! + Returns a human-readable description of the last device error that occurred. +*/ +QString QextSerialPort::errorString() +{ + Q_D(QextSerialPort); + QReadLocker locker(&d->lock); + switch(d->lastErr) { + case E_NO_ERROR: + return tr("No Error has occurred"); + case E_INVALID_FD: + return tr("Invalid file descriptor (port was not opened correctly)"); + case E_NO_MEMORY: + return tr("Unable to allocate memory tables (POSIX)"); + case E_CAUGHT_NON_BLOCKED_SIGNAL: + return tr("Caught a non-blocked signal (POSIX)"); + case E_PORT_TIMEOUT: + return tr("Operation timed out (POSIX)"); + case E_INVALID_DEVICE: + return tr("The file opened by the port is not a valid device"); + case E_BREAK_CONDITION: + return tr("The port detected a break condition"); + case E_FRAMING_ERROR: + return tr("The port detected a framing error (usually caused by incorrect baud rate settings)"); + case E_IO_ERROR: + return tr("There was an I/O error while communicating with the port"); + case E_BUFFER_OVERRUN: + return tr("Character buffer overrun"); + case E_RECEIVE_OVERFLOW: + return tr("Receive buffer overflow"); + case E_RECEIVE_PARITY_ERROR: + return tr("The port detected a parity error in the received data"); + case E_TRANSMIT_OVERFLOW: + return tr("Transmit buffer overflow"); + case E_READ_FAILED: + return tr("General read operation failure"); + case E_WRITE_FAILED: + return tr("General write operation failure"); + case E_FILE_NOT_FOUND: + return tr("The %1 file doesn't exists").arg(this->portName()); + case E_PERMISSION_DENIED: + return tr("Permission denied"); + case E_AGAIN: + return tr("Device is already locked"); + default: + return tr("Unknown error: %1").arg(d->lastErr); + } +} + +/*! + Destructs the QextSerialPort object. +*/ +QextSerialPort::~QextSerialPort() +{ + if (isOpen()) + close(); + + delete d_ptr; +} + +/*! + Sets the flow control used by the port to \a flow. Possible values of flow are: + \code + FLOW_OFF No flow control + FLOW_HARDWARE Hardware (RTS/CTS) flow control + FLOW_XONXOFF Software (XON/XOFF) flow control + \endcode +*/ +void QextSerialPort::setFlowControl(FlowType flow) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (d->settings.FlowControl != flow) + d->setFlowControl(flow, true); +} + +/*! + Sets the parity associated with the serial port to \a parity. The possible values of parity are: + \code + PAR_SPACE Space Parity + PAR_MARK Mark Parity + PAR_NONE No Parity + PAR_EVEN Even Parity + PAR_ODD Odd Parity + \endcode +*/ +void QextSerialPort::setParity(ParityType parity) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (d->settings.Parity != parity) + d->setParity(parity, true); +} + +/*! + Sets the number of data bits used by the serial port to \a dataBits. Possible values of dataBits are: + \code + DATA_5 5 data bits + DATA_6 6 data bits + DATA_7 7 data bits + DATA_8 8 data bits + \endcode + + \bold note: + This function is subject to the following restrictions: + \list + \o 5 data bits cannot be used with 2 stop bits. + \o 1.5 stop bits can only be used with 5 data bits. + \o 8 data bits cannot be used with space parity on POSIX systems. + \endlist + */ +void QextSerialPort::setDataBits(DataBitsType dataBits) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (d->settings.DataBits != dataBits) + d->setDataBits(dataBits, true); +} + +/*! + Sets the number of stop bits used by the serial port to \a stopBits. Possible values of stopBits are: + \code + STOP_1 1 stop bit + STOP_1_5 1.5 stop bits + STOP_2 2 stop bits + \endcode + + \bold note: + This function is subject to the following restrictions: + \list + \o 2 stop bits cannot be used with 5 data bits. + \o 1.5 stop bits cannot be used with 6 or more data bits. + \o POSIX does not support 1.5 stop bits. + \endlist +*/ +void QextSerialPort::setStopBits(StopBitsType stopBits) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (d->settings.StopBits != stopBits) + d->setStopBits(stopBits, true); +} + +/*! + Sets the baud rate of the serial port to \a baudRate. Note that not all rates are applicable on + all platforms. The following table shows translations of the various baud rate + constants on Windows(including NT/2000) and POSIX platforms. Speeds marked with an * + are speeds that are usable on both Windows and POSIX. + \code + + RATE Windows Speed POSIX Speed + ----------- ------------- ----------- + BAUD50 X 50 + BAUD75 X 75 + *BAUD110 110 110 + BAUD134 X 134.5 + BAUD150 X 150 + BAUD200 X 200 + *BAUD300 300 300 + *BAUD600 600 600 + *BAUD1200 1200 1200 + BAUD1800 X 1800 + *BAUD2400 2400 2400 + *BAUD4800 4800 4800 + *BAUD9600 9600 9600 + BAUD14400 14400 X + *BAUD19200 19200 19200 + *BAUD38400 38400 38400 + BAUD56000 56000 X + *BAUD57600 57600 57600 + BAUD76800 X 76800 + *BAUD115200 115200 115200 + BAUD128000 128000 X + BAUD230400 X 230400 + BAUD256000 256000 X + BAUD460800 X 460800 + BAUD500000 X 500000 + BAUD576000 X 576000 + BAUD921600 X 921600 + BAUD1000000 X 1000000 + BAUD1152000 X 1152000 + BAUD1500000 X 1500000 + BAUD2000000 X 2000000 + BAUD2500000 X 2500000 + BAUD3000000 X 3000000 + BAUD3500000 X 3500000 + BAUD4000000 X 4000000 + \endcode +*/ + +void QextSerialPort::setBaudRate(BaudRateType baudRate) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (d->settings.BaudRate != baudRate) + d->setBaudRate(baudRate, true); +} + +/*! + For Unix: + + Sets the read and write timeouts for the port to \a millisec milliseconds. + Note that this is a per-character timeout, i.e. the port will wait this long for each + individual character, not for the whole read operation. This timeout also applies to the + bytesWaiting() function. + + \bold note: + POSIX does not support millisecond-level control for I/O timeout values. Any + timeout set using this function will be set to the next lowest tenth of a second for + the purposes of detecting read or write timeouts. For example a timeout of 550 milliseconds + will be seen by the class as a timeout of 500 milliseconds for the purposes of reading and + writing the port. However millisecond-level control is allowed by the select() system call, + so for example a 550-millisecond timeout will be seen as 550 milliseconds on POSIX systems for + the purpose of detecting available bytes in the read buffer. + + For Windows: + + Sets the read and write timeouts for the port to \a millisec milliseconds. + Setting 0 indicates that timeouts are not used for read nor write operations; + however read() and write() functions will still block. Set -1 to provide + non-blocking behaviour (read() and write() will return immediately). + + \bold note: this function does nothing in event driven mode. +*/ +void QextSerialPort::setTimeout(long millisec) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (d->settings.Timeout_Millisec != millisec) + d->setTimeout(millisec, true); +} + +/*! + Sets DTR line to the requested state (\a set default to high). This function will have no effect if + the port associated with the class is not currently open. +*/ +void QextSerialPort::setDtr(bool set) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (isOpen()) + d->setDtr_sys(set); +} + +/*! + Sets RTS line to the requested state \a set (high by default). + This function will have no effect if + the port associated with the class is not currently open. +*/ +void QextSerialPort::setRts(bool set) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + if (isOpen()) + d->setRts_sys(set); +} + +/*! \reimp + Reads a block of data from the serial port. This function will read at most maxlen bytes from + the serial port and place them in the buffer pointed to by data. Return value is the number of + bytes actually read, or -1 on error. + + \warning before calling this function ensure that serial port associated with this class + is currently open (use isOpen() function to check if port is open). +*/ +qint64 QextSerialPort::readData(char *data, qint64 maxSize) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + qint64 bytesFromBuffer = 0; + if (!d->readBuffer.isEmpty()) { + bytesFromBuffer = d->readBuffer.read(data, maxSize); + if (bytesFromBuffer == maxSize) + return bytesFromBuffer; + } + qint64 bytesFromDevice = d->readData_sys(data+bytesFromBuffer, maxSize-bytesFromBuffer); + if (bytesFromDevice < 0) + return -1; + return bytesFromBuffer + bytesFromDevice; +} + +/*! \reimp + Writes a block of data to the serial port. This function will write len bytes + from the buffer pointed to by data to the serial port. Return value is the number + of bytes actually written, or -1 on error. + + \warning before calling this function ensure that serial port associated with this class + is currently open (use isOpen() function to check if port is open). +*/ +qint64 QextSerialPort::writeData(const char *data, qint64 maxSize) +{ + Q_D(QextSerialPort); + QWriteLocker locker(&d->lock); + return d->writeData_sys(data, maxSize); +} + +#include "moc_qextserialport.cpp" diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.h b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.h new file mode 100644 index 0000000..a0bc822 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.h @@ -0,0 +1,240 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#ifndef _QEXTSERIALPORT_H_ +#define _QEXTSERIALPORT_H_ + +#include +#include "qextserialport_global.h" +#ifdef Q_OS_UNIX +#include +#endif +/*line status constants*/ +// ### QESP2.0 move to enum +#define LS_CTS 0x01 +#define LS_DSR 0x02 +#define LS_DCD 0x04 +#define LS_RI 0x08 +#define LS_RTS 0x10 +#define LS_DTR 0x20 +#define LS_ST 0x40 +#define LS_SR 0x80 + +/*error constants*/ +// ### QESP2.0 move to enum +#define E_NO_ERROR 0 +#define E_INVALID_FD 1 +#define E_NO_MEMORY 2 +#define E_CAUGHT_NON_BLOCKED_SIGNAL 3 +#define E_PORT_TIMEOUT 4 +#define E_INVALID_DEVICE 5 +#define E_BREAK_CONDITION 6 +#define E_FRAMING_ERROR 7 +#define E_IO_ERROR 8 +#define E_BUFFER_OVERRUN 9 +#define E_RECEIVE_OVERFLOW 10 +#define E_RECEIVE_PARITY_ERROR 11 +#define E_TRANSMIT_OVERFLOW 12 +#define E_READ_FAILED 13 +#define E_WRITE_FAILED 14 +#define E_FILE_NOT_FOUND 15 +#define E_PERMISSION_DENIED 16 +#define E_AGAIN 17 + +enum BaudRateType +{ +#if defined(Q_OS_UNIX) || defined(qdoc) + BAUD50 = 50, //POSIX ONLY + BAUD75 = 75, //POSIX ONLY + BAUD134 = 134, //POSIX ONLY + BAUD150 = 150, //POSIX ONLY + BAUD200 = 200, //POSIX ONLY + BAUD1800 = 1800, //POSIX ONLY +# if defined(B76800) || defined(qdoc) + BAUD76800 = 76800, //POSIX ONLY +# endif +# if (defined(B230400) && defined(B4000000)) || defined(qdoc) + BAUD230400 = 230400, //POSIX ONLY + BAUD460800 = 460800, //POSIX ONLY + BAUD500000 = 500000, //POSIX ONLY + BAUD576000 = 576000, //POSIX ONLY + BAUD921600 = 921600, //POSIX ONLY + BAUD1000000 = 1000000, //POSIX ONLY + BAUD1152000 = 1152000, //POSIX ONLY + BAUD1500000 = 1500000, //POSIX ONLY + BAUD2000000 = 2000000, //POSIX ONLY + BAUD2500000 = 2500000, //POSIX ONLY + BAUD3000000 = 3000000, //POSIX ONLY + BAUD3500000 = 3500000, //POSIX ONLY + BAUD4000000 = 4000000, //POSIX ONLY +# endif +#endif //Q_OS_UNIX +#if defined(Q_OS_WIN) || defined(qdoc) + BAUD14400 = 14400, //WINDOWS ONLY + BAUD56000 = 56000, //WINDOWS ONLY + BAUD128000 = 128000, //WINDOWS ONLY + BAUD256000 = 256000, //WINDOWS ONLY +#endif //Q_OS_WIN + BAUD110 = 110, + BAUD300 = 300, + BAUD600 = 600, + BAUD1200 = 1200, + BAUD2400 = 2400, + BAUD4800 = 4800, + BAUD9600 = 9600, + BAUD19200 = 19200, + BAUD38400 = 38400, + BAUD57600 = 57600, + BAUD115200 = 115200 +}; + +enum DataBitsType +{ + DATA_5 = 5, + DATA_6 = 6, + DATA_7 = 7, + DATA_8 = 8 +}; + +enum ParityType +{ + PAR_NONE, + PAR_ODD, + PAR_EVEN, +#if defined(Q_OS_WIN) || defined(qdoc) + PAR_MARK, //WINDOWS ONLY +#endif + PAR_SPACE +}; + +enum StopBitsType +{ + STOP_1, +#if defined(Q_OS_WIN) || defined(qdoc) + STOP_1_5, //WINDOWS ONLY +#endif + STOP_2 +}; + +enum FlowType +{ + FLOW_OFF, + FLOW_HARDWARE, + FLOW_XONXOFF +}; + +/** + * structure to contain port settings + */ +struct PortSettings +{ + BaudRateType BaudRate; + DataBitsType DataBits; + ParityType Parity; + StopBitsType StopBits; + FlowType FlowControl; + long Timeout_Millisec; +}; + +class QextSerialPortPrivate; +class QEXTSERIALPORT_EXPORT QextSerialPort: public QIODevice +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QextSerialPort) + Q_ENUMS(QueryMode) + Q_PROPERTY(QString portName READ portName WRITE setPortName) + Q_PROPERTY(QueryMode queryMode READ queryMode WRITE setQueryMode) +public: + enum QueryMode { + Polling, + EventDriven + }; + + explicit QextSerialPort(QueryMode mode = EventDriven, QObject *parent = 0); + explicit QextSerialPort(const QString &name, QueryMode mode = EventDriven, QObject *parent = 0); + explicit QextSerialPort(const PortSettings &s, QueryMode mode = EventDriven, QObject *parent = 0); + QextSerialPort(const QString &name, const PortSettings &s, QueryMode mode = EventDriven, QObject *parent=0); + + ~QextSerialPort(); + + QString portName() const; + QueryMode queryMode() const; + BaudRateType baudRate() const; + DataBitsType dataBits() const; + ParityType parity() const; + StopBitsType stopBits() const; + FlowType flowControl() const; + + bool open(OpenMode mode); + bool isSequential() const; + void close(); + void flush(); + qint64 bytesAvailable() const; + bool canReadLine() const; + QByteArray readAll(); + + ulong lastError() const; + + ulong lineStatus(); + QString errorString(); + +public Q_SLOTS: + void setPortName(const QString &name); + void setQueryMode(QueryMode mode); + void setBaudRate(BaudRateType); + void setDataBits(DataBitsType); + void setParity(ParityType); + void setStopBits(StopBitsType); + void setFlowControl(FlowType); + void setTimeout(long); + + void setDtr(bool set=true); + void setRts(bool set=true); + +Q_SIGNALS: + void dsrChanged(bool status); + +protected: + qint64 readData(char *data, qint64 maxSize); + qint64 writeData(const char *data, qint64 maxSize); + +private: + Q_DISABLE_COPY(QextSerialPort) + +#ifdef Q_OS_WIN + Q_PRIVATE_SLOT(d_func(), void _q_onWinEvent(HANDLE)) +#endif + Q_PRIVATE_SLOT(d_func(), void _q_canRead()) + + QextSerialPortPrivate * const d_ptr; +}; + +#endif diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.pri b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.pri new file mode 100644 index 0000000..27b05ef --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport.pri @@ -0,0 +1,36 @@ +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD + +PUBLIC_HEADERS += $$PWD/qextserialport.h \ + $$PWD/qextserialenumerator.h \ + $$PWD/qextserialport_global.h + +HEADERS += $$PUBLIC_HEADERS \ + $$PWD/qextserialport_p.h \ + $$PWD/qextserialenumerator_p.h \ + +SOURCES += $$PWD/qextserialport.cpp \ + $$PWD/qextserialenumerator.cpp +unix { + SOURCES += $$PWD/qextserialport_unix.cpp + linux* { + SOURCES += $$PWD/qextserialenumerator_linux.cpp + } else:macx { + SOURCES += $$PWD/qextserialenumerator_osx.cpp + } else { + SOURCES += $$PWD/qextserialenumerator_unix.cpp + } +} +win32:SOURCES += $$PWD/qextserialport_win.cpp \ + $$PWD/qextserialenumerator_win.cpp + +linux*{ + !qesp_linux_udev:DEFINES += QESP_NO_UDEV + qesp_linux_udev: LIBS += -ludev +} + +macx:LIBS += -framework IOKit -framework CoreFoundation +win32:LIBS += -lsetupapi -ladvapi32 -luser32 + +# moc doesn't detect Q_OS_LINUX correctly, so add this to make it work +linux*:DEFINES += __linux__ diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_global.h b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_global.h new file mode 100644 index 0000000..507d2cf --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_global.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#ifndef QEXTSERIALPORT_GLOBAL_H +#define QEXTSERIALPORT_GLOBAL_H + +#include + +#ifdef QEXTSERIALPORT_BUILD_SHARED +# define QEXTSERIALPORT_EXPORT Q_DECL_EXPORT +#elif defined(QEXTSERIALPORT_USING_SHARED) +# define QEXTSERIALPORT_EXPORT Q_DECL_IMPORT +#else +# define QEXTSERIALPORT_EXPORT +#endif + +// ### for compatible with old version. should be removed in QESP 2.0 +#ifdef _TTY_NOWARN_ +# define QESP_NO_WARN +#endif +#ifdef _TTY_NOWARN_PORT_ +# define QESP_NO_PORTABILITY_WARN +#endif + +/*if all warning messages are turned off, flag portability warnings to be turned off as well*/ +#ifdef QESP_NO_WARN +# define QESP_NO_PORTABILITY_WARN +#endif + +/*macros for warning and debug messages*/ +#ifdef QESP_NO_PORTABILITY_WARN +# define QESP_PORTABILITY_WARNING while (false)qWarning +#else +# define QESP_PORTABILITY_WARNING qWarning +#endif /*QESP_NOWARN_PORT*/ + +#ifdef QESP_NO_WARN +# define QESP_WARNING while (false)qWarning +#else +# define QESP_WARNING qWarning +#endif /*QESP_NOWARN*/ + +#endif // QEXTSERIALPORT_GLOBAL_H + diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_p.h b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_p.h new file mode 100644 index 0000000..31cea71 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_p.h @@ -0,0 +1,250 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#ifndef _QEXTSERIALPORT_P_H_ +#define _QEXTSERIALPORT_P_H_ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the QESP API. It exists for the convenience +// of other QESP classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qextserialport.h" +#include +#ifdef Q_OS_UNIX +# include +#elif (defined Q_OS_WIN) +# include +#endif +#include + +// This is QextSerialPort's read buffer, needed by posix system. +// ref: QRingBuffer & QIODevicePrivateLinearBuffer +class QextReadBuffer +{ +public: + inline QextReadBuffer(size_t growth=4096) + : len(0), first(0), buf(0), capacity(0), basicBlockSize(growth) { + } + + ~QextReadBuffer() { + delete [] buf; + } + + inline void clear() { + first = buf; + len = 0; + } + + inline int size() const { + return len; + } + + inline bool isEmpty() const { + return len == 0; + } + + inline int read(char *target, int size) { + int r = qMin(size, len); + if (r == 1) { + *target = *first; + --len; + ++first; + } else { + memcpy(target, first, r); + len -= r; + first += r; + } + return r; + } + + inline char *reserve(size_t size) { + if ((first - buf) + len + size > capacity) { + size_t newCapacity = qMax(capacity, basicBlockSize); + while (newCapacity < len + size) + newCapacity *= 2; + if (newCapacity > capacity) { + // allocate more space + char *newBuf = new char[newCapacity]; + memmove(newBuf, first, len); + delete [] buf; + buf = newBuf; + capacity = newCapacity; + } else { + // shift any existing data to make space + memmove(buf, first, len); + } + first = buf; + } + char *writePtr = first + len; + len += (int)size; + return writePtr; + } + + inline void chop(int size) { + if (size >= len) + clear(); + else + len -= size; + } + + inline void squeeze() { + if (first != buf) { + memmove(buf, first, len); + first = buf; + } + size_t newCapacity = basicBlockSize; + while (newCapacity < size_t(len)) + newCapacity *= 2; + if (newCapacity < capacity) { + char *tmp = static_cast(realloc(buf, newCapacity)); + if (tmp) { + buf = tmp; + capacity = newCapacity; + } + } + } + + inline QByteArray readAll() { + char *f = first; + int l = len; + clear(); + return QByteArray(f, l); + } + + inline int readLine(char *target, int size) { + int r = qMin(size, len); + char *eol = static_cast(memchr(first, '\n', r)); + if (eol) + r = 1+(eol-first); + memcpy(target, first, r); + len -= r; + first += r; + return int(r); + } + + inline bool canReadLine() const { + return memchr(first, '\n', len); + } + +private: + int len; + char *first; + char *buf; + size_t capacity; + size_t basicBlockSize; +}; + +class QWinEventNotifier; +class QReadWriteLock; +class QSocketNotifier; + +class QextSerialPortPrivate +{ + Q_DECLARE_PUBLIC(QextSerialPort) +public: + QextSerialPortPrivate(QextSerialPort *q); + ~QextSerialPortPrivate(); + enum DirtyFlagEnum + { + DFE_BaudRate = 0x0001, + DFE_Parity = 0x0002, + DFE_StopBits = 0x0004, + DFE_DataBits = 0x0008, + DFE_Flow = 0x0010, + DFE_TimeOut = 0x0100, + DFE_ALL = 0x0fff, + DFE_Settings_Mask = 0x00ff //without TimeOut + }; + mutable QReadWriteLock lock; + QString port; + PortSettings settings; + QextReadBuffer readBuffer; + int settingsDirtyFlags; + ulong lastErr; + QextSerialPort::QueryMode queryMode; + + // platform specific members +#ifdef Q_OS_UNIX + int fd; + QSocketNotifier *readNotifier; + struct termios currentTermios; + struct termios oldTermios; +#elif (defined Q_OS_WIN) + HANDLE handle; + OVERLAPPED overlap; + COMMCONFIG commConfig; + COMMTIMEOUTS commTimeouts; + QWinEventNotifier *winEventNotifier; + DWORD eventMask; + QList pendingWrites; + QReadWriteLock *bytesToWriteLock; +#endif + + /*fill PortSettings*/ + void setBaudRate(BaudRateType baudRate, bool update=true); + void setDataBits(DataBitsType dataBits, bool update=true); + void setParity(ParityType parity, bool update=true); + void setStopBits(StopBitsType stopbits, bool update=true); + void setFlowControl(FlowType flow, bool update=true); + void setTimeout(long millisec, bool update=true); + void setPortSettings(const PortSettings &settings, bool update=true); + + void platformSpecificDestruct(); + void platformSpecificInit(); + void translateError(ulong error); + void updatePortSettings(); + + qint64 readData_sys(char *data, qint64 maxSize); + qint64 writeData_sys(const char *data, qint64 maxSize); + void setDtr_sys(bool set=true); + void setRts_sys(bool set=true); + bool open_sys(QIODevice::OpenMode mode); + bool close_sys(); + bool flush_sys(); + ulong lineStatus_sys(); + qint64 bytesAvailable_sys() const; + +#ifdef Q_OS_WIN + void _q_onWinEvent(HANDLE h); +#endif + void _q_canRead(); + + QextSerialPort *q_ptr; +}; + +#endif //_QEXTSERIALPORT_P_H_ diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_unix.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_unix.cpp new file mode 100644 index 0000000..09c6568 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_unix.cpp @@ -0,0 +1,458 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialport.h" +#include "qextserialport_p.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void QextSerialPortPrivate::platformSpecificInit() +{ + fd = 0; + readNotifier = 0; +} + +/*! + Standard destructor. +*/ +void QextSerialPortPrivate::platformSpecificDestruct() +{ +} + +static QString fullPortName(const QString &name) +{ + if (name.startsWith(QLatin1Char('/'))) + return name; + return QLatin1String("/dev/")+name; +} + +bool QextSerialPortPrivate::open_sys(QIODevice::OpenMode mode) +{ + Q_Q(QextSerialPort); + //note: linux 2.6.21 seems to ignore O_NDELAY flag + if ((fd = ::open(fullPortName(port).toLatin1() ,O_RDWR | O_NOCTTY | O_NDELAY)) != -1) { + + /*In the Private class, We can not call QIODevice::open()*/ + q->setOpenMode(mode); // Flag the port as opened + ::tcgetattr(fd, &oldTermios); // Save the old termios + currentTermios = oldTermios; // Make a working copy + ::cfmakeraw(¤tTermios); // Enable raw access + + /*set up other port settings*/ + currentTermios.c_cflag |= CREAD|CLOCAL; + currentTermios.c_lflag &= (~(ICANON|ECHO|ECHOE|ECHOK|ECHONL|ISIG)); + currentTermios.c_iflag &= (~(INPCK|IGNPAR|PARMRK|ISTRIP|ICRNL|IXANY)); + currentTermios.c_oflag &= (~OPOST); + currentTermios.c_cc[VMIN] = 0; +#ifdef _POSIX_VDISABLE // Is a disable character available on this system? + // Some systems allow for per-device disable-characters, so get the + // proper value for the configured device + const long vdisable = ::fpathconf(fd, _PC_VDISABLE); + currentTermios.c_cc[VINTR] = vdisable; + currentTermios.c_cc[VQUIT] = vdisable; + currentTermios.c_cc[VSTART] = vdisable; + currentTermios.c_cc[VSTOP] = vdisable; + currentTermios.c_cc[VSUSP] = vdisable; +#endif //_POSIX_VDISABLE + settingsDirtyFlags = DFE_ALL; + updatePortSettings(); + + if (queryMode == QextSerialPort::EventDriven) { + readNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, q); + q->connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_canRead())); + } + return true; + } else { + translateError(errno); + return false; + } +} + +bool QextSerialPortPrivate::close_sys() +{ + // Force a flush and then restore the original termios + flush_sys(); + // Using both TCSAFLUSH and TCSANOW here discards any pending input + ::tcsetattr(fd, TCSAFLUSH | TCSANOW, &oldTermios); // Restore termios + ::close(fd); + if (readNotifier) { + delete readNotifier; + readNotifier = 0; + } + return true; +} + +bool QextSerialPortPrivate::flush_sys() +{ + ::tcdrain(fd); + return true; +} + +qint64 QextSerialPortPrivate::bytesAvailable_sys() const +{ + int bytesQueued; + if (::ioctl(fd, FIONREAD, &bytesQueued) == -1) + return (qint64)-1; + return bytesQueued; +} + +/*! + Translates a system-specific error code to a QextSerialPort error code. Used internally. +*/ +void QextSerialPortPrivate::translateError(ulong error) +{ + switch (error) { + case EBADF: + case ENOTTY: + lastErr = E_INVALID_FD; + break; + case EINTR: + lastErr = E_CAUGHT_NON_BLOCKED_SIGNAL; + break; + case ENOMEM: + lastErr = E_NO_MEMORY; + break; + case EACCES: + lastErr = E_PERMISSION_DENIED; + break; + case EAGAIN: + lastErr = E_AGAIN; + break; + } +} + +void QextSerialPortPrivate::setDtr_sys(bool set) +{ + int status; + ::ioctl(fd, TIOCMGET, &status); + if (set) + status |= TIOCM_DTR; + else + status &= ~TIOCM_DTR; + ::ioctl(fd, TIOCMSET, &status); +} + +void QextSerialPortPrivate::setRts_sys(bool set) +{ + int status; + ::ioctl(fd, TIOCMGET, &status); + if (set) + status |= TIOCM_RTS; + else + status &= ~TIOCM_RTS; + ::ioctl(fd, TIOCMSET, &status); +} + +unsigned long QextSerialPortPrivate::lineStatus_sys() +{ + unsigned long Status=0, Temp=0; + ::ioctl(fd, TIOCMGET, &Temp); + if (Temp & TIOCM_CTS) Status |= LS_CTS; + if (Temp & TIOCM_DSR) Status |= LS_DSR; + if (Temp & TIOCM_RI) Status |= LS_RI; + if (Temp & TIOCM_CD) Status |= LS_DCD; + if (Temp & TIOCM_DTR) Status |= LS_DTR; + if (Temp & TIOCM_RTS) Status |= LS_RTS; + if (Temp & TIOCM_ST) Status |= LS_ST; + if (Temp & TIOCM_SR) Status |= LS_SR; + return Status; +} + +/*! + Reads a block of data from the serial port. This function will read at most maxSize bytes from + the serial port and place them in the buffer pointed to by data. Return value is the number of + bytes actually read, or -1 on error. + + \warning before calling this function ensure that serial port associated with this class + is currently open (use isOpen() function to check if port is open). +*/ +qint64 QextSerialPortPrivate::readData_sys(char *data, qint64 maxSize) +{ + int retVal = ::read(fd, data, maxSize); + if (retVal == -1) + lastErr = E_READ_FAILED; + + return retVal; +} + +/*! + Writes a block of data to the serial port. This function will write maxSize bytes + from the buffer pointed to by data to the serial port. Return value is the number + of bytes actually written, or -1 on error. + + \warning before calling this function ensure that serial port associated with this class + is currently open (use isOpen() function to check if port is open). +*/ +qint64 QextSerialPortPrivate::writeData_sys(const char *data, qint64 maxSize) +{ + int retVal = ::write(fd, data, maxSize); + if (retVal == -1) + lastErr = E_WRITE_FAILED; + + return (qint64)retVal; +} + +static void setBaudRate2Termios(termios *config, int baudRate) +{ +#ifdef CBAUD + config->c_cflag &= (~CBAUD); + config->c_cflag |= baudRate; +#else + ::cfsetispeed(config, baudRate); + ::cfsetospeed(config, baudRate); +#endif +} + +/* + All the platform settings was performed in this function. +*/ +void QextSerialPortPrivate::updatePortSettings() +{ + if (!q_func()->isOpen() || !settingsDirtyFlags) + return; + + if (settingsDirtyFlags & DFE_BaudRate) { + switch (settings.BaudRate) { + case BAUD50: + setBaudRate2Termios(¤tTermios, B50); + break; + case BAUD75: + setBaudRate2Termios(¤tTermios, B75); + break; + case BAUD110: + setBaudRate2Termios(¤tTermios, B110); + break; + case BAUD134: + setBaudRate2Termios(¤tTermios, B134); + break; + case BAUD150: + setBaudRate2Termios(¤tTermios, B150); + break; + case BAUD200: + setBaudRate2Termios(¤tTermios, B200); + break; + case BAUD300: + setBaudRate2Termios(¤tTermios, B300); + break; + case BAUD600: + setBaudRate2Termios(¤tTermios, B600); + break; + case BAUD1200: + setBaudRate2Termios(¤tTermios, B1200); + break; + case BAUD1800: + setBaudRate2Termios(¤tTermios, B1800); + break; + case BAUD2400: + setBaudRate2Termios(¤tTermios, B2400); + break; + case BAUD4800: + setBaudRate2Termios(¤tTermios, B4800); + break; + case BAUD9600: + setBaudRate2Termios(¤tTermios, B9600); + break; + case BAUD19200: + setBaudRate2Termios(¤tTermios, B19200); + break; + case BAUD38400: + setBaudRate2Termios(¤tTermios, B38400); + break; + case BAUD57600: + setBaudRate2Termios(¤tTermios, B57600); + break; +#ifdef B76800 + case BAUD76800: + setBaudRate2Termios(¤tTermios, B76800); + break; +#endif + case BAUD115200: + setBaudRate2Termios(¤tTermios, B115200); + break; +#if defined(B230400) && defined(B4000000) + case BAUD230400: + setBaudRate2Termios(¤tTermios, B230400); + break; + case BAUD460800: + setBaudRate2Termios(¤tTermios, B460800); + break; + case BAUD500000: + setBaudRate2Termios(¤tTermios, B500000); + break; + case BAUD576000: + setBaudRate2Termios(¤tTermios, B576000); + break; + case BAUD921600: + setBaudRate2Termios(¤tTermios, B921600); + break; + case BAUD1000000: + setBaudRate2Termios(¤tTermios, B1000000); + break; + case BAUD1152000: + setBaudRate2Termios(¤tTermios, B1152000); + break; + case BAUD1500000: + setBaudRate2Termios(¤tTermios, B1500000); + break; + case BAUD2000000: + setBaudRate2Termios(¤tTermios, B2000000); + break; + case BAUD2500000: + setBaudRate2Termios(¤tTermios, B2500000); + break; + case BAUD3000000: + setBaudRate2Termios(¤tTermios, B3000000); + break; + case BAUD3500000: + setBaudRate2Termios(¤tTermios, B3500000); + break; + case BAUD4000000: + setBaudRate2Termios(¤tTermios, B4000000); + break; +#endif +#ifdef Q_OS_MAC + default: + setBaudRate2Termios(¤tTermios, settings.BaudRate); + break; +#endif + } + } + if (settingsDirtyFlags & DFE_Parity) { + switch (settings.Parity) { + case PAR_SPACE: + /*space parity not directly supported - add an extra data bit to simulate it*/ + settingsDirtyFlags |= DFE_DataBits; + break; + case PAR_NONE: + currentTermios.c_cflag &= (~PARENB); + break; + case PAR_EVEN: + currentTermios.c_cflag &= (~PARODD); + currentTermios.c_cflag |= PARENB; + break; + case PAR_ODD: + currentTermios.c_cflag |= (PARENB|PARODD); + break; + } + } + /*must after Parity settings*/ + if (settingsDirtyFlags & DFE_DataBits) { + if (settings.Parity != PAR_SPACE) { + currentTermios.c_cflag &= (~CSIZE); + switch(settings.DataBits) { + case DATA_5: + currentTermios.c_cflag |= CS5; + break; + case DATA_6: + currentTermios.c_cflag |= CS6; + break; + case DATA_7: + currentTermios.c_cflag |= CS7; + break; + case DATA_8: + currentTermios.c_cflag |= CS8; + break; + } + } else { + /*space parity not directly supported - add an extra data bit to simulate it*/ + currentTermios.c_cflag &= ~(PARENB|CSIZE); + switch(settings.DataBits) { + case DATA_5: + currentTermios.c_cflag |= CS6; + break; + case DATA_6: + currentTermios.c_cflag |= CS7; + break; + case DATA_7: + currentTermios.c_cflag |= CS8; + break; + case DATA_8: + /*this will never happen, put here to Suppress an warning*/ + break; + } + } + } + if (settingsDirtyFlags & DFE_StopBits) { + switch (settings.StopBits) { + case STOP_1: + currentTermios.c_cflag &= (~CSTOPB); + break; + case STOP_2: + currentTermios.c_cflag |= CSTOPB; + break; + } + } + if (settingsDirtyFlags & DFE_Flow) { + switch(settings.FlowControl) { + case FLOW_OFF: + currentTermios.c_cflag &= (~CRTSCTS); + currentTermios.c_iflag &= (~(IXON|IXOFF|IXANY)); + break; + case FLOW_XONXOFF: + /*software (XON/XOFF) flow control*/ + currentTermios.c_cflag &= (~CRTSCTS); + currentTermios.c_iflag |= (IXON|IXOFF|IXANY); + break; + case FLOW_HARDWARE: + currentTermios.c_cflag |= CRTSCTS; + currentTermios.c_iflag &= (~(IXON|IXOFF|IXANY)); + break; + } + } + + /*if any thing in currentTermios changed, flush*/ + if (settingsDirtyFlags & DFE_Settings_Mask) + ::tcsetattr(fd, TCSAFLUSH, ¤tTermios); + + if (settingsDirtyFlags & DFE_TimeOut) { + int millisec = settings.Timeout_Millisec; + if (millisec == -1) { + ::fcntl(fd, F_SETFL, O_NDELAY); + } else { + //O_SYNC should enable blocking ::write() + //however this seems not working on Linux 2.6.21 (works on OpenBSD 4.2) + ::fcntl(fd, F_SETFL, O_SYNC); + } + ::tcgetattr(fd, ¤tTermios); + currentTermios.c_cc[VTIME] = millisec/100; + ::tcsetattr(fd, TCSAFLUSH, ¤tTermios); + } + + settingsDirtyFlags = 0; +} diff --git a/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_win.cpp b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_win.cpp new file mode 100644 index 0000000..1d25e0e --- /dev/null +++ b/oroca_bldc_gui/qt_gui/qextserialport/qextserialport_win.cpp @@ -0,0 +1,405 @@ +/**************************************************************************** +** Copyright (c) 2000-2003 Wayne Roth +** Copyright (c) 2004-2007 Stefan Sander +** Copyright (c) 2007 Michal Policht +** Copyright (c) 2008 Brandon Fosdick +** Copyright (c) 2009-2010 Liam Staskawicz +** Copyright (c) 2011 Debao Zhang +** All right reserved. +** Web: http://code.google.com/p/qextserialport/ +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ + +#include "qextserialport.h" +#include "qextserialport_p.h" +#include +#include +#include +#include +#include +#include +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +# include +#else +# include +#endif +void QextSerialPortPrivate::platformSpecificInit() +{ + handle = INVALID_HANDLE_VALUE; + ZeroMemory(&overlap, sizeof(OVERLAPPED)); + overlap.hEvent = CreateEvent(NULL, true, false, NULL); + winEventNotifier = 0; + bytesToWriteLock = new QReadWriteLock; +} + +void QextSerialPortPrivate::platformSpecificDestruct() { + CloseHandle(overlap.hEvent); + delete bytesToWriteLock; +} + + +/*! + \internal + COM ports greater than 9 need \\.\ prepended + + This is only need when open the port. +*/ +static QString fullPortNameWin(const QString &name) +{ + QRegExp rx(QLatin1String("^COM(\\d+)")); + QString fullName(name); + if (fullName.contains(rx)) + fullName.prepend(QLatin1String("\\\\.\\")); + return fullName; +} + +bool QextSerialPortPrivate::open_sys(QIODevice::OpenMode mode) +{ + Q_Q(QextSerialPort); + DWORD confSize = sizeof(COMMCONFIG); + commConfig.dwSize = confSize; + DWORD dwFlagsAndAttributes = 0; + if (queryMode == QextSerialPort::EventDriven) + dwFlagsAndAttributes += FILE_FLAG_OVERLAPPED; + + /*open the port*/ + handle = CreateFileW((wchar_t *)fullPortNameWin(port).utf16(), GENERIC_READ|GENERIC_WRITE, + 0, NULL, OPEN_EXISTING, dwFlagsAndAttributes, NULL); + if (handle != INVALID_HANDLE_VALUE) { + q->setOpenMode(mode); + /*configure port settings*/ + GetCommConfig(handle, &commConfig, &confSize); + GetCommState(handle, &(commConfig.dcb)); + + /*set up parameters*/ + commConfig.dcb.fBinary = TRUE; + commConfig.dcb.fInX = FALSE; + commConfig.dcb.fOutX = FALSE; + commConfig.dcb.fAbortOnError = FALSE; + commConfig.dcb.fNull = FALSE; + /* Dtr default to true. See Issue 122*/ + commConfig.dcb.fDtrControl = TRUE; + /*flush all settings*/ + settingsDirtyFlags = DFE_ALL; + updatePortSettings(); + + //init event driven approach + if (queryMode == QextSerialPort::EventDriven) { + if (!SetCommMask(handle, EV_TXEMPTY | EV_RXCHAR | EV_DSR)) { + QESP_WARNING()<<"failed to set Comm Mask. Error code:"<("HANDLE"); + q->connect(winEventNotifier, SIGNAL(activated(HANDLE)), q, SLOT(_q_onWinEvent(HANDLE)), Qt::DirectConnection); + WaitCommEvent(handle, &eventMask, &overlap); + } + return true; + } + return false; +} + +bool QextSerialPortPrivate::close_sys() +{ + flush_sys(); + CancelIo(handle); + if (CloseHandle(handle)) + handle = INVALID_HANDLE_VALUE; + if (winEventNotifier) { + winEventNotifier->setEnabled(false); + winEventNotifier->deleteLater(); + winEventNotifier = 0; + } + + foreach (OVERLAPPED *o, pendingWrites) { + CloseHandle(o->hEvent); + delete o; + } + pendingWrites.clear(); + return true; +} + +bool QextSerialPortPrivate::flush_sys() +{ + FlushFileBuffers(handle); + return true; +} + +qint64 QextSerialPortPrivate::bytesAvailable_sys() const +{ + DWORD Errors; + COMSTAT Status; + if (ClearCommError(handle, &Errors, &Status)) + return Status.cbInQue; + + return (qint64)-1; +} + +/* + Translates a system-specific error code to a QextSerialPort error code. Used internally. +*/ +void QextSerialPortPrivate::translateError(ulong error) +{ + if (error & CE_BREAK) { + lastErr = E_BREAK_CONDITION; + } else if (error & CE_FRAME) { + lastErr = E_FRAMING_ERROR; + } else if (error & CE_IOE) { + lastErr = E_IO_ERROR; + } else if (error & CE_MODE) { + lastErr = E_INVALID_FD; + } else if (error & CE_OVERRUN) { + lastErr = E_BUFFER_OVERRUN; + } else if (error & CE_RXPARITY) { + lastErr = E_RECEIVE_PARITY_ERROR; + } else if (error & CE_RXOVER) { + lastErr = E_RECEIVE_OVERFLOW; + } else if (error & CE_TXFULL) { + lastErr = E_TRANSMIT_OVERFLOW; + } +} + +/* + Reads a block of data from the serial port. This function will read at most maxlen bytes from + the serial port and place them in the buffer pointed to by data. Return value is the number of + bytes actually read, or -1 on error. + + \warning before calling this function ensure that serial port associated with this class + is currently open (use isOpen() function to check if port is open). +*/ +qint64 QextSerialPortPrivate::readData_sys(char *data, qint64 maxSize) +{ + DWORD bytesRead = 0; + bool failed = false; + if (queryMode == QextSerialPort::EventDriven) { + OVERLAPPED overlapRead; + ZeroMemory(&overlapRead, sizeof(OVERLAPPED)); + if (!ReadFile(handle, (void *)data, (DWORD)maxSize, &bytesRead, &overlapRead)) { + if (GetLastError() == ERROR_IO_PENDING) + GetOverlappedResult(handle, &overlapRead, &bytesRead, true); + else + failed = true; + } + } else if (!ReadFile(handle, (void *)data, (DWORD)maxSize, &bytesRead, NULL)) { + failed = true; + } + if (!failed) + return (qint64)bytesRead; + + lastErr = E_READ_FAILED; + return -1; +} + +/* + Writes a block of data to the serial port. This function will write len bytes + from the buffer pointed to by data to the serial port. Return value is the number + of bytes actually written, or -1 on error. + + \warning before calling this function ensure that serial port associated with this class + is currently open (use isOpen() function to check if port is open). +*/ +qint64 QextSerialPortPrivate::writeData_sys(const char *data, qint64 maxSize) +{ + DWORD bytesWritten = 0; + bool failed = false; + if (queryMode == QextSerialPort::EventDriven) { + OVERLAPPED *newOverlapWrite = new OVERLAPPED; + ZeroMemory(newOverlapWrite, sizeof(OVERLAPPED)); + newOverlapWrite->hEvent = CreateEvent(NULL, true, false, NULL); + if (WriteFile(handle, (void *)data, (DWORD)maxSize, &bytesWritten, newOverlapWrite)) { + CloseHandle(newOverlapWrite->hEvent); + delete newOverlapWrite; + } else if (GetLastError() == ERROR_IO_PENDING) { + // writing asynchronously...not an error + QWriteLocker writelocker(bytesToWriteLock); + pendingWrites.append(newOverlapWrite); + } else { + QESP_WARNING()<<"QextSerialPort write error:"<hEvent)) + QESP_WARNING("QextSerialPort: couldn't cancel IO"); + if (!CloseHandle(newOverlapWrite->hEvent)) + QESP_WARNING("QextSerialPort: couldn't close OVERLAPPED handle"); + delete newOverlapWrite; + } + } else if (!WriteFile(handle, (void *)data, (DWORD)maxSize, &bytesWritten, NULL)) { + failed = true; + } + + if (!failed) + return (qint64)bytesWritten; + + lastErr = E_WRITE_FAILED; + return -1; +} + +void QextSerialPortPrivate::setDtr_sys(bool set) { + EscapeCommFunction(handle, set ? SETDTR : CLRDTR); +} + +void QextSerialPortPrivate::setRts_sys(bool set) { + EscapeCommFunction(handle, set ? SETRTS : CLRRTS); +} + +ulong QextSerialPortPrivate::lineStatus_sys(void) { + unsigned long Status = 0, Temp = 0; + GetCommModemStatus(handle, &Temp); + if (Temp & MS_CTS_ON) Status |= LS_CTS; + if (Temp & MS_DSR_ON) Status |= LS_DSR; + if (Temp & MS_RING_ON) Status |= LS_RI; + if (Temp & MS_RLSD_ON) Status |= LS_DCD; + return Status; +} + +/* + Triggered when there's activity on our HANDLE. +*/ +void QextSerialPortPrivate::_q_onWinEvent(HANDLE h) +{ + Q_Q(QextSerialPort); + if (h == overlap.hEvent) { + if (eventMask & EV_RXCHAR) { + if (q->sender() != q && bytesAvailable_sys() > 0) + _q_canRead(); + } + if (eventMask & EV_TXEMPTY) { + /* + A write completed. Run through the list of OVERLAPPED writes, and if + they completed successfully, take them off the list and delete them. + Otherwise, leave them on there so they can finish. + */ + qint64 totalBytesWritten = 0; + QList overlapsToDelete; + QWriteLocker writelocker(bytesToWriteLock); + foreach (OVERLAPPED *o, pendingWrites) { + DWORD numBytes = 0; + if (GetOverlappedResult(handle, o, &numBytes, false)) { + overlapsToDelete.append(o); + totalBytesWritten += numBytes; + } else if (GetLastError() != ERROR_IO_INCOMPLETE) { + overlapsToDelete.append(o); + QESP_WARNING()<<"CommEvent overlapped write error:" << GetLastError(); + } + } + + if (q->sender() != q && totalBytesWritten > 0) + Q_EMIT q->bytesWritten(totalBytesWritten); + + foreach (OVERLAPPED *o, overlapsToDelete) { + OVERLAPPED *toDelete = pendingWrites.takeAt(pendingWrites.indexOf(o)); + CloseHandle(toDelete->hEvent); + delete toDelete; + } + } + if (eventMask & EV_DSR) { + if (lineStatus_sys() & LS_DSR) + Q_EMIT q->dsrChanged(true); + else + Q_EMIT q->dsrChanged(false); + } + } + WaitCommEvent(handle, &eventMask, &overlap); +} + +void QextSerialPortPrivate::updatePortSettings() +{ + if (!q_ptr->isOpen() || !settingsDirtyFlags) + return; + + //fill struct : COMMCONFIG + if (settingsDirtyFlags & DFE_BaudRate) + commConfig.dcb.BaudRate = settings.BaudRate; + if (settingsDirtyFlags & DFE_Parity) { + commConfig.dcb.Parity = (BYTE)settings.Parity; + commConfig.dcb.fParity = (settings.Parity == PAR_NONE) ? FALSE : TRUE; + } + if (settingsDirtyFlags & DFE_DataBits) + commConfig.dcb.ByteSize = (BYTE)settings.DataBits; + if (settingsDirtyFlags & DFE_StopBits) { + switch (settings.StopBits) { + case STOP_1: + commConfig.dcb.StopBits = ONESTOPBIT; + break; + case STOP_1_5: + commConfig.dcb.StopBits = ONE5STOPBITS; + break; + case STOP_2: + commConfig.dcb.StopBits = TWOSTOPBITS; + break; + } + } + if (settingsDirtyFlags & DFE_Flow) { + switch(settings.FlowControl) { + /*no flow control*/ + case FLOW_OFF: + commConfig.dcb.fOutxCtsFlow = FALSE; + commConfig.dcb.fRtsControl = RTS_CONTROL_DISABLE; + commConfig.dcb.fInX = FALSE; + commConfig.dcb.fOutX = FALSE; + break; + /*software (XON/XOFF) flow control*/ + case FLOW_XONXOFF: + commConfig.dcb.fOutxCtsFlow = FALSE; + commConfig.dcb.fRtsControl = RTS_CONTROL_DISABLE; + commConfig.dcb.fInX = TRUE; + commConfig.dcb.fOutX = TRUE; + break; + /*hardware flow control*/ + case FLOW_HARDWARE: + commConfig.dcb.fOutxCtsFlow = TRUE; + commConfig.dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; + commConfig.dcb.fInX = FALSE; + commConfig.dcb.fOutX = FALSE; + break; + } + } + + //fill struct : COMMTIMEOUTS + if (settingsDirtyFlags & DFE_TimeOut) { + if (queryMode != QextSerialPort::EventDriven) { + int millisec = settings.Timeout_Millisec; + if (millisec == -1) { + commTimeouts.ReadIntervalTimeout = MAXDWORD; + commTimeouts.ReadTotalTimeoutConstant = 0; + } else { + commTimeouts.ReadIntervalTimeout = millisec; + commTimeouts.ReadTotalTimeoutConstant = millisec; + } + commTimeouts.ReadTotalTimeoutMultiplier = 0; + commTimeouts.WriteTotalTimeoutMultiplier = millisec; + commTimeouts.WriteTotalTimeoutConstant = 0; + } else { + commTimeouts.ReadIntervalTimeout = MAXDWORD; + commTimeouts.ReadTotalTimeoutMultiplier = 0; + commTimeouts.ReadTotalTimeoutConstant = 0; + commTimeouts.WriteTotalTimeoutMultiplier = 0; + commTimeouts.WriteTotalTimeoutConstant = 0; + } + } + + + if (settingsDirtyFlags & DFE_Settings_Mask) + SetCommConfig(handle, &commConfig, sizeof(COMMCONFIG)); + if ((settingsDirtyFlags & DFE_TimeOut)) + SetCommTimeouts(handle, &commTimeouts); + settingsDirtyFlags = 0; +} diff --git a/oroca_bldc_gui/qt_gui/readme.md b/oroca_bldc_gui/qt_gui/readme.md new file mode 100644 index 0000000..2b3f186 --- /dev/null +++ b/oroca_bldc_gui/qt_gui/readme.md @@ -0,0 +1 @@ +openCR PC firmware Downloader \ No newline at end of file diff --git a/oroca_bldc_gui/qt_gui/type.h b/oroca_bldc_gui/qt_gui/type.h new file mode 100644 index 0000000..e5ecd3f --- /dev/null +++ b/oroca_bldc_gui/qt_gui/type.h @@ -0,0 +1,51 @@ +// Portable types + +#ifndef __TYPE_H_ +#define __TYPE_H_ + +#ifdef WIN32_BUILD +typedef char s8; +typedef unsigned char u8; + +typedef short s16; +typedef unsigned short u16; + +typedef int s32; +typedef unsigned int u32; + +typedef long s64; +typedef unsigned long u64; +#else +typedef char s8; +typedef unsigned char u8; + +typedef short s16; +typedef unsigned short u16; + +typedef long s32; +typedef unsigned long u32; + +typedef long long s64; +typedef unsigned long long u64; +#endif + +// Define serial port "handle" type for each platform +// [TODO] for now, only UNIX is supported +#ifdef WIN32_BUILD +#include +typedef HANDLE ser_handler; +#else // assume POSIX here +typedef int ser_handler; +#endif + + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#endif + diff --git "a/oroca_bldc_\341\204\200\341\205\265\341\204\200\341\205\256/README.md" "b/oroca_bldc_\341\204\200\341\205\265\341\204\200\341\205\256/README.md" deleted file mode 100755 index 63f6d4c..0000000 --- "a/oroca_bldc_\341\204\200\341\205\265\341\204\200\341\205\256/README.md" +++ /dev/null @@ -1,2 +0,0 @@ -# oroca_bldc_dev -BLDC Driver Development Version for OROCA BLDC diff --git a/oroca_bldc_HW/README.md "b/oroca_bldc_\352\270\260\352\265\254/README.md" old mode 100755 new mode 100644 similarity index 96% rename from oroca_bldc_HW/README.md rename to "oroca_bldc_\352\270\260\352\265\254/README.md" index 63f6d4c..a795147 --- a/oroca_bldc_HW/README.md +++ "b/oroca_bldc_\352\270\260\352\265\254/README.md" @@ -1,2 +1,2 @@ -# oroca_bldc_dev -BLDC Driver Development Version for OROCA BLDC +# oroca_bldc_dev +BLDC Driver Development Version for OROCA BLDC