Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Open-Cube FW
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
Open Cube
Open-Cube FW
Commits
1e803f17
Commit
1e803f17
authored
1 year ago
by
Václav Jelínek
Browse files
Options
Downloads
Patches
Plain Diff
Remove optional metadata sending of the OC RGB sensor for faster handshake
parent
12c7c933
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#77140
passed
1 year ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
oc_sensors/opto_G030K8/Core/Src/main.c
+7
-1
7 additions, 1 deletion
oc_sensors/opto_G030K8/Core/Src/main.c
oc_sensors/opto_G030K8/Core/Src/oc_st_sensor.c
+6
-6
6 additions, 6 deletions
oc_sensors/opto_G030K8/Core/Src/oc_st_sensor.c
with
13 additions
and
7 deletions
oc_sensors/opto_G030K8/Core/Src/main.c
+
7
−
1
View file @
1e803f17
...
...
@@ -31,6 +31,7 @@
/* USER CODE BEGIN PTD */
#define SENSOR_ID 193
#define DATA_BAUD_RATE 256000
#define METADATA_DELAY_MS 80
#define PCT_MIN 0
#define PCT_MAX 100
#define ADC_MAX 65535
...
...
@@ -523,11 +524,16 @@ int main(void)
if
(
sensor_state
==
S_MODE_INIT
)
{
sensor_state
=
S_MODE_WAIT_ACK
;
}
HAL_Delay
(
80
);
int
delay_counter
=
0
;
while
(
sensor_state
==
S_MODE_WAIT_ACK
&&
delay_counter
<
METADATA_DELAY_MS
)
{
delay_counter
++
;
HAL_Delay
(
1
);
}
}
blue_off
();
LL_USART_Disable
(
USART1
);
MX_USART1_UART_Init
();
choose_send_data
(
sensor_state
);
nack_time
=
HAL_GetTick
();
while
(
sensor_state
>
S_MODE_INIT
)
{
measure_data
(
sensor_state
);
...
...
This diff is collapsed.
Click to expand it.
oc_sensors/opto_G030K8/Core/Src/oc_st_sensor.c
+
6
−
6
View file @
1e803f17
...
...
@@ -32,14 +32,14 @@ void send_metadata(const sensor_info* s_info) {
make_info_string_message
(
i
,
INFO_TYPE_NAME
,
s_info
->
modes
[
i
].
mode_name
,
s_info
->
modes
[
i
].
mode_name_len
,
&
total_size
,
msg_name
);
uart1_send_length
(
msg_name
,
total_size
);
ev3_info_limits
msg_raw
=
make_info_limits_message
(
i
,
INFO_TYPE_RAW
,
s_info
->
modes
[
i
].
raw_lim_low
,
s_info
->
modes
[
i
].
raw_lim_high
);
uart1_send_length
(
&
msg_raw
,
sizeof
(
msg_raw
));
//
ev3_info_limits msg_raw = make_info_limits_message(i, INFO_TYPE_RAW, s_info->modes[i].raw_lim_low, s_info->modes[i].raw_lim_high);
//
uart1_send_length(&msg_raw, sizeof(msg_raw));
ev3_info_limits
msg_ptc
=
make_info_limits_message
(
i
,
INFO_TYPE_PCT
,
s_info
->
modes
[
i
].
pct_lim_low
,
s_info
->
modes
[
i
].
pct_lim_high
);
uart1_send_length
(
&
msg_ptc
,
sizeof
(
msg_ptc
));
//
ev3_info_limits msg_ptc = make_info_limits_message(i, INFO_TYPE_PCT, s_info->modes[i].pct_lim_low, s_info->modes[i].pct_lim_high);
//
uart1_send_length(&msg_ptc, sizeof(msg_ptc));
ev3_info_limits
msg_si
=
make_info_limits_message
(
i
,
INFO_TYPE_SI
,
s_info
->
modes
[
i
].
si_lim_low
,
s_info
->
modes
[
i
].
si_lim_high
);
uart1_send_length
(
&
msg_si
,
sizeof
(
msg_si
));
//
ev3_info_limits msg_si = make_info_limits_message(i, INFO_TYPE_SI, s_info->modes[i].si_lim_low, s_info->modes[i].si_lim_high);
//
uart1_send_length(&msg_si, sizeof(msg_si));
uint8_t
msg_symbol
[
EV3_MSG_BUFFER_SIZE
]
=
{
0
};
make_info_string_message
(
i
,
INFO_TYPE_SYMBOL
,
s_info
->
modes
[
i
].
symbol
,
s_info
->
modes
[
i
].
symbol_len
,
&
total_size
,
msg_symbol
);
...
...
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