Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
JC Staudt
reform
Commits
503f1359
Commit
503f1359
authored
2 years ago
by
Nano
Browse files
Options
Downloads
Patches
Plain Diff
fix encoding errors for lpc commands
parent
ac3444dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reform2-lpc-fw/src/boards/reform2/board_reform2.c
+6
-9
6 additions, 9 deletions
reform2-lpc-fw/src/boards/reform2/board_reform2.c
with
6 additions
and
9 deletions
reform2-lpc-fw/src/boards/reform2/board_reform2.c
+
6
−
9
View file @
503f1359
...
@@ -41,8 +41,8 @@
...
@@ -41,8 +41,8 @@
//#define REF2_DEBUG 1
//#define REF2_DEBUG 1
#define FW_STRING1 "MREF2LPC"
#define FW_STRING1 "MREF2LPC"
#define FW_STRING2 "R3"
#define FW_STRING2 "R3"
#define FW_STRING3 "202
10925
"
#define FW_STRING3 "202
20621
"
#define FW_REV
"MREF2LPC R3 20210925"
#define FW_REV
FW_STRING1 FW_STRING2 FW_STRING3
#define POWERSAVE_SLEEP_SECONDS 1
#define POWERSAVE_SLEEP_SECONDS 1
#define POWERSAVE_HOLDOFF_CYCLES (60*15)
#define POWERSAVE_HOLDOFF_CYCLES (60*15)
...
@@ -884,11 +884,10 @@ void handle_spi_commands() {
...
@@ -884,11 +884,10 @@ void handle_spi_commands() {
// return firmware version and api info
// return firmware version and api info
else
if
(
spi_command
==
'f'
)
else
if
(
spi_command
==
'f'
)
{
{
if
(
spi_arg1
==
0
)
if
(
spi_arg1
==
0
)
{
{
memcpy
(
spiBuf
,
FW_STRING1
,
8
);
memcpy
(
spiBuf
,
FW_STRING1
,
8
);
}
}
if
(
spi_arg1
==
1
)
{
else
if
(
spi_arg1
==
1
)
{
memcpy
(
spiBuf
,
FW_STRING2
,
8
);
memcpy
(
spiBuf
,
FW_STRING2
,
8
);
}
}
else
{
else
{
...
@@ -923,17 +922,15 @@ void handle_spi_commands() {
...
@@ -923,17 +922,15 @@ void handle_spi_commands() {
else
if
(
spi_command
==
'v'
)
{
else
if
(
spi_command
==
'v'
)
{
uint16_t
volts
=
0
;
uint16_t
volts
=
0
;
uint8_t
cell1
=
0
;
uint8_t
cell1
=
0
;
uint8_t
cell4
=
4
;
if
(
spi_arg1
==
1
)
if
(
spi_arg1
==
1
)
{
{
cell1
=
4
;
cell1
=
4
;
cell4
=
8
;
}
}
for
(
uint8_t
c
=
cell1
;
c
<
cell
4
;
c
++
)
for
(
uint8_t
c
=
0
;
c
<
4
;
c
++
)
{
{
volts
=
cells_v
[
c
]
*
1000
.
0
;
volts
=
cells_v
[
c
+
cell1
]
*
1000
.
0
;
spiBuf
[
c
*
2
]
=
(
uint8_t
)
volts
;
spiBuf
[
c
*
2
]
=
(
uint8_t
)
volts
;
spiBuf
[(
c
*
2
)
+
1
]
=
(
uint8_t
)(
volts
>>
8
);
spiBuf
[(
c
*
2
)
+
1
]
=
(
uint8_t
)(
volts
>>
8
);
}
}
...
...
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