some more minor fixes for sys_time: send time in TAKEOFF message as uint16_t

This commit is contained in:
Felix Ruess
2012-03-11 13:19:39 +01:00
parent f6a29a9e72
commit fd6d6b9b0f
8 changed files with 15 additions and 11 deletions
+2 -1
View File
@@ -565,7 +565,8 @@ void monitor_task( void ) {
estimator_hspeed_mod > MIN_SPEED_FOR_TAKEOFF) {
estimator_flight_time = 1;
launch = TRUE; /* Not set in non auto launch */
DOWNLINK_SEND_TAKEOFF(DefaultChannel, DefaultDevice, &sys_time.nb_sec);
uint16_t time_sec = sys_time.nb_sec;
DOWNLINK_SEND_TAKEOFF(DefaultChannel, DefaultDevice, &time_sec);
}
#ifdef USE_GPIO
@@ -82,7 +82,8 @@ static inline void main_periodic_task( void ) {
DOWNLINK_SEND_ALIVE(DefaultChannel, DefaultDevice, 16, MD5SUM);
PeriodicSendDlValue(DefaultChannel);
});
DOWNLINK_SEND_MOTOR_BENCH_STATUS(DefaultChannel, DefaultDevice, &cpu_time_ticks, &throttle, &rpm, &amps , &thrust, &torque, &cpu_time_sec, &mb_modes_mode);
uint16_t time_secs = sys_time.nb_sec;
DOWNLINK_SEND_MOTOR_BENCH_STATUS(DefaultChannel, DefaultDevice, &sys_time.nb_sec_rem, &throttle, &rpm, &amps , &thrust, &torque, &time_secs, &mb_modes_mode);
+1 -1
View File
@@ -28,6 +28,6 @@ static inline void main_init( void ) {
static inline void main_periodic_task( void ) {
LED_TOGGLE(1);
Uart0PrintString("demo3 running since ");
Uart0PrintHex16(cpu_time_sec);
Uart0PrintHex32(cpu_time_sec);
Uart0PrintString(" seconds\n");
}
+2 -1
View File
@@ -28,5 +28,6 @@ static inline void main_init( void ) {
static inline void main_periodic_task( void ) {
LED_TOGGLE(1);
DOWNLINK_SEND_TAKEOFF(&cpu_time_sec);
uint16_t time_sec = sys_time.nb_sec;
DOWNLINK_SEND_TAKEOFF(&time_sec);
}
+2 -1
View File
@@ -32,7 +32,8 @@ static inline void main_init( void ) {
static inline void main_periodic_task( void ) {
// LED_TOGGLE(1);
DOWNLINK_SEND_TAKEOFF(&cpu_time_sec);
uint16_t time_sec = sys_time.nb_sec;
DOWNLINK_SEND_TAKEOFF(&time_sec);
}
static inline void main_event_task( void ) {
+2 -1
View File
@@ -29,7 +29,8 @@ static inline void main_init( void ) {
static inline void main_periodic_task( void ) {
LED_TOGGLE(1);
// DOWNLINK_SEND_TAKEOFF(&cpu_time_sec);
//uint16_t time_sec = sys_time.nb_sec;
// DOWNLINK_SEND_TAKEOFF(&time_sec);
usb_serial_transmit( 'A' );
usb_serial_transmit( '\n' );
+3 -3
View File
@@ -385,7 +385,7 @@ void parse_ins_msg( void ) {
gps.nb_channels = XSENS_GPSStatus_nch(xsens_msg_buf);
gps.num_sv = 0;
gps.last_fix_time = cpu_time_sec;
gps.last_fix_time = sys_time.nb_sec;
uint8_t i;
// Do not write outside buffer
@@ -417,7 +417,7 @@ void parse_ins_msg( void ) {
#ifdef GPS_LED
LED_TOGGLE(GPS_LED);
#endif
gps.last_fix_time = cpu_time_sec;
gps.last_fix_time = sys_time.nb_sec;
gps.week = 0; // FIXME
gps.tow = XSENS_DATA_RAWGPS_itow(xsens_msg_buf,offset) * 10;
gps.lla_pos.lat = RadOfDeg(XSENS_DATA_RAWGPS_lat(xsens_msg_buf,offset));
@@ -525,7 +525,7 @@ void parse_ins_msg( void ) {
}
if (XSENS_MASK_Position(xsens_output_mode)) {
#if (! USE_GPS_XSENS_RAW_DATA) && USE_GPS_XSENS
gps.last_fix_time = cpu_time_sec;
gps.last_fix_time = sys_time.nb_sec;
lla_f.lat = RadOfDeg(XSENS_DATA_Position_lat(xsens_msg_buf,offset));
lla_f.lon = RadOfDeg(XSENS_DATA_Position_lon(xsens_msg_buf,offset));
@@ -61,8 +61,7 @@ static inline void main_periodic_task( void ) {
RunOnceEvery(51, {
/*LED_TOGGLE(2);*/
uint32_t blaaa= cpu_time_sec;
DOWNLINK_SEND_TIME(DefaultChannel, DefaultDevice, &blaaa);
DOWNLINK_SEND_TIME(DefaultChannel, DefaultDevice, &sys_time.nb_sec);
});
RunOnceEvery(10, {radio_control_periodic_task();});