Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit core collection
Manage
Activity
Members
Labels
Plan
Issues
33
Issue boards
Milestones
Wiki
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
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
Projects
White Rabbit core collection
Commits
191f2f7d
Commit
191f2f7d
authored
3 weeks ago
by
Harvey Leicester
Browse files
Options
Downloads
Patches
Plain Diff
nmea: update checksum generation, ignore $ and * delimiters
parent
ec6cf889
Branches
hl-wrpc-v5.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/wr_nmea/wr_nmea_master.vhd
+6
-5
6 additions, 5 deletions
modules/wr_nmea/wr_nmea_master.vhd
with
6 additions
and
5 deletions
modules/wr_nmea/wr_nmea_master.vhd
+
6
−
5
View file @
191f2f7d
...
...
@@ -71,7 +71,8 @@ end entity wr_nmea_master;
architecture
rtl
of
wr_nmea_master
is
constant
c_FRAME_LEN
:
integer
:
=
38
;
constant
c_CHECKSUM_IDX
:
integer
:
=
35
;
constant
c_CHECKSUM_IDX0
:
integer
:
=
34
;
constant
c_CHECKSUM_IDX1
:
integer
:
=
35
;
constant
c_DOLLAR
:
std_logic_vector
(
7
downto
0
)
:
=
X"24"
;
constant
c_G
:
std_logic_vector
(
7
downto
0
)
:
=
X"47"
;
constant
c_P
:
std_logic_vector
(
7
downto
0
)
:
=
X"50"
;
...
...
@@ -168,7 +169,7 @@ begin
end
if
;
end
process
;
nmea_b
<=
std_logic_vector
(
checksum_ascii
)
when
byte_cnt
=
34
or
byte_cnt
=
35
else
nmea_s
(
to_integer
(
byte_cnt
));
nmea_b
<=
std_logic_vector
(
checksum_ascii
)
when
byte_cnt
=
c_CHECKSUM_IDX0
or
byte_cnt
=
c_CHECKSUM_IDX1
else
nmea_s
(
to_integer
(
byte_cnt
));
p_sm
:
process
(
clk_i
)
is
begin
...
...
@@ -192,7 +193,7 @@ begin
when
S_TX_EN
=>
uart_tx_en
<=
'1'
;
nmea_state
<=
S_WAIT_BUSY
;
if
(
byte_cnt
<
c_CHECKSUM_IDX
)
then
if
(
byte_cnt
<
c_CHECKSUM_IDX
0
-1
and
nmea_b
/=
c_DOLLAR
)
then
checksum
<=
checksum
xor
unsigned
(
nmea_b
);
end
if
;
...
...
@@ -224,13 +225,13 @@ begin
checksum_ascii
<=
(
others
=>
'0'
);
else
checksum_ascii
<=
(
others
=>
'0'
);
if
(
byte_cnt
=
34
)
then
if
(
byte_cnt
=
c_CHECKSUM_IDX0
)
then
if
(
checksum
(
7
downto
4
)
>
9
)
then
checksum_ascii
<=
unsigned
(
c_CHAR_M9
)
+
checksum
(
7
downto
4
);
--character
else
checksum_ascii
<=
unsigned
(
c_ZERO
)
+
checksum
(
7
downto
4
);
--number
end
if
;
elsif
(
byte_cnt
=
35
)
then
elsif
(
byte_cnt
=
c_CHECKSUM_IDX1
)
then
if
(
checksum
(
3
downto
0
)
>
9
)
then
checksum_ascii
<=
unsigned
(
c_CHAR_M9
)
+
checksum
(
3
downto
0
);
--character
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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