Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
ed6ae436
Commit
ed6ae436
authored
5 years ago
by
ucart
Browse files
Options
Downloads
Patches
Plain Diff
Beginning formatting data to text file for read
parent
9e8db90b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
groundStation/src/backend/backend.c
+8
-4
8 additions, 4 deletions
groundStation/src/backend/backend.c
quad/src/quad_app/quad_app.c
+6
-8
6 additions, 8 deletions
quad/src/quad_app/quad_app.c
with
14 additions
and
12 deletions
groundStation/src/backend/backend.c
+
8
−
4
View file @
ed6ae436
...
@@ -919,7 +919,7 @@ static void client_recv(int fd) {
...
@@ -919,7 +919,7 @@ static void client_recv(int fd) {
static
void
quad_recv
(
int
index
)
{
static
void
quad_recv
(
int
index
)
{
static
unsigned
char
respBuf
[
CMD_MAX_LENGTH
];
static
unsigned
char
respBuf
[
CMD_MAX_LENGTH
];
static
size_t
respBufLen
;
static
size_t
respBufLen
;
static
int
receiving_logs
;
static
int
receiving_logs
;
struct
metadata
m
;
struct
metadata
m
;
uint8_t
data
[
CMD_MAX_LENGTH
];
uint8_t
data
[
CMD_MAX_LENGTH
];
...
@@ -1005,11 +1005,15 @@ static void quad_recv(int index) {
...
@@ -1005,11 +1005,15 @@ static void quad_recv(int index) {
}
}
fwrite
((
char
*
)
data
,
sizeof
(
char
),
m
.
data_len
,
quadlog_file
);
fwrite
((
char
*
)
data
,
sizeof
(
char
),
m
.
data_len
,
quadlog_file
);
break
;
break
;
/*
case SEND_RT_ID:
case
SEND_RT_ID
:
quadlog_file
=
fopen
(
"quad_log_data.txt"
,
"w"
);
quadlog_file
=
fopen
(
"quad_log_data.txt"
,
"w"
);
fwrite((char *) data, sizeof(char), m.data_len, quadlog_file);
//TODO Add formatting here to populate .txt file in a way QT will be able to read
char
*
formatted_data
=
malloc
(
sizeof
(
data
)
+
1
);
fwrite
((
char
*
)
formatted_data
,
sizeof
(
char
),
m
.
data_len
,
quadlog_file
);
fclose
(
quadlog_file
);
fclose
(
quadlog_file
);
break;*/
free
(
formatted_data
);
break
;
case
RESPPARAM_ID
:
case
RESPPARAM_ID
:
case
RESPSOURCE_ID
:
case
RESPSOURCE_ID
:
case
RESPOUTPUT_ID
:
case
RESPOUTPUT_ID
:
...
...
This diff is collapsed.
Click to expand it.
quad/src/quad_app/quad_app.c
+
6
−
8
View file @
ed6ae436
...
@@ -23,10 +23,10 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
...
@@ -23,10 +23,10 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
// Structures to be used throughout
// Structures to be used throughout
modular_structs_t
structs
=
{
};
modular_structs_t
structs
=
{
};
//flags that indicate which rt data to send
//flags that indicate which rt data to send
SensorRTFlags_t
flags
;
SensorRTFlags_t
flags
;
// initialize internal flag data
;
// initialize internal flag data
for RT data transfer
initializeFlags
(
&
flags
);
initializeFlags
(
&
flags
);
// Wire up hardware
// Wire up hardware
...
@@ -37,7 +37,6 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
...
@@ -37,7 +37,6 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
// Xilinx Platform, Loop Timer, Control Algorithm
// Xilinx Platform, Loop Timer, Control Algorithm
int
init_error
=
init_structs
(
&
(
structs
));
int
init_error
=
init_structs
(
&
(
structs
));
int
rt_configured_size
=
0
;
if
(
init_error
!=
0
)
{
if
(
init_error
!=
0
)
{
return
-
1
;
return
-
1
;
...
@@ -67,10 +66,9 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
...
@@ -67,10 +66,9 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
// Get data from the sensors and put it into raw_sensor_struct
// Get data from the sensors and put it into raw_sensor_struct
get_sensors
(
&
(
structs
.
hardware_struct
),
&
(
structs
.
log_struct
),
&
(
structs
.
user_input_struct
),
&
(
structs
.
raw_sensor_struct
));
get_sensors
(
&
(
structs
.
hardware_struct
),
&
(
structs
.
log_struct
),
&
(
structs
.
user_input_struct
),
&
(
structs
.
raw_sensor_struct
));
//Send the sensor data in RT (TODO WILL NEED TO BE EDITED FROM CURRENT CONDITION DUE TO TINA)
//Send the sensor data in RT (TODO WILL NEED TO BE EDITED FROM CURRENT CONDITION DUE TO TINA)
//send_sensor_data(&flags, &(structs.hardware_struct.comm), &(structs.raw_sensor_struct));
if
(
flags
.
flag_count
!=
0
)
if
(
rt_configured_size
!=
0
)
send_RT_data
(
&
(
structs
.
hardware_struct
.
comm
),
&
(
structs
.
raw_sensor_struct
),
&
flags
);
send_RT_data
(
&
(
structs
.
hardware_struct
.
comm
),
&
(
structs
.
raw_sensor_struct
),
&
flags
,
rt_configured_size
);
// Process the sensor data and put it into sensor_struct
// Process the sensor data and put it into sensor_struct
sensor_processing
(
&
(
structs
.
log_struct
),
&
(
structs
.
user_input_struct
),
&
(
structs
.
raw_sensor_struct
),
&
(
structs
.
sensor_struct
));
sensor_processing
(
&
(
structs
.
log_struct
),
&
(
structs
.
user_input_struct
),
&
(
structs
.
raw_sensor_struct
),
&
(
structs
.
sensor_struct
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment