Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DIOT Monitoring Module
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
DIOT Monitoring Module
Commits
e2c88814
Commit
e2c88814
authored
3 years ago
by
Christos Gentsos
Browse files
Options
Downloads
Patches
Plain Diff
Main: add an extended command to get the uptime in seconds
parent
75273770
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main_fw/src/i2c_impl.c
+9
-5
9 additions, 5 deletions
main_fw/src/i2c_impl.c
main_fw/src/main.c
+3
-0
3 additions, 0 deletions
main_fw/src/main.c
with
12 additions
and
5 deletions
main_fw/src/i2c_impl.c
+
9
−
5
View file @
e2c88814
...
...
@@ -61,6 +61,8 @@ extern uint16_t powrs_lin[MAX_PAGE+1];
extern
uint16_t
temps_lin
[
3
];
extern
uint16_t
frpms_lin
[
3
];
extern
uint32_t
seconds_up
;
uint32_t
TMR_ERROR_CNT
;
static
uint8_t
dummy_byte
;
...
...
@@ -123,6 +125,7 @@ static int8_t cmd_data_length_query = -1;
static
const
int8_t
ext_cmd_data_lengths
[]
=
{
1
,
// 0x05
1
,
// 0x06
4
,
// 0x10
4
,
// 0xA0
1
,
// 0xB0
13
,
// 0xC0
...
...
@@ -156,11 +159,12 @@ static const cmd_t cmds_cmds[] = (cmd_t[]){
{
0x003E
,
(
int8_t
*
)
&
cmd_data_lengths
[
23
],
(
uint8_t
*
)
&
setfrpms_lin
[
2
],
(
fp_t
)
NULL
,
&
set_frpms
,
(
fp_t
)
NULL
,
QUERY_WR
|
QUERY_FMT_LIN
,
0
},
{
0xFF05
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
0
],
(
uint8_t
*
)
&
dummy_byte
,
(
fp_t
)
NULL
,
&
boot_new_fw
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFF06
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
1
],
(
uint8_t
*
)
&
dummy_byte
,
(
fp_t
)
NULL
,
&
uc_reset
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFA0
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
2
],
(
uint8_t
*
)
&
TMR_ERROR_CNT
,
(
fp_t
)
NULL
,
(
fp_t
)
NULL
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFB0
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
3
],
(
uint8_t
*
)
&
use_pec_tmp
,
(
fp_t
)
NULL
,
&
set_pec
,
(
fp_t
)
NULL
,
0
,
1
},
{
0xFFC0
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
4
],
(
uint8_t
*
)
&
temp_curve_points_data
,
(
fp_t
)
NULL
,
&
set_tc_curve
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFC1
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
5
],
(
uint8_t
*
)
&
temp_matrix_row
,
(
fp_t
)
NULL
,
&
set_tc_matrix
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFC4
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
6
],
(
uint8_t
*
)
&
tc_on
,
(
fp_t
)
NULL
,
&
set_tc_onoff
,
(
fp_t
)
NULL
,
0
,
0
}};
{
0xFF10
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
2
],
(
uint8_t
*
)
&
seconds_up
,
(
fp_t
)
NULL
,
(
fp_t
)
NULL
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFA0
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
3
],
(
uint8_t
*
)
&
TMR_ERROR_CNT
,
(
fp_t
)
NULL
,
(
fp_t
)
NULL
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFB0
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
4
],
(
uint8_t
*
)
&
use_pec_tmp
,
(
fp_t
)
NULL
,
&
set_pec
,
(
fp_t
)
NULL
,
0
,
1
},
{
0xFFC0
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
5
],
(
uint8_t
*
)
&
temp_curve_points_data
,
(
fp_t
)
NULL
,
&
set_tc_curve
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFC1
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
6
],
(
uint8_t
*
)
&
temp_matrix_row
,
(
fp_t
)
NULL
,
&
set_tc_matrix
,
(
fp_t
)
NULL
,
0
,
0
},
{
0xFFC4
,
(
int8_t
*
)
&
ext_cmd_data_lengths
[
7
],
(
uint8_t
*
)
&
tc_on
,
(
fp_t
)
NULL
,
&
set_tc_onoff
,
(
fp_t
)
NULL
,
0
,
0
}};
cmd_space_t
cmds
=
{
sizeof
(
cmds_cmds
)
/
sizeof
(
cmd_t
),
...
...
This diff is collapsed.
Click to expand it.
main_fw/src/main.c
+
3
−
0
View file @
e2c88814
...
...
@@ -29,6 +29,8 @@ uint16_t powrs_lin[MAX_PAGE+1];
uint16_t
temps_lin
[
3
];
uint16_t
frpms_lin
[
3
];
volatile
uint32_t
seconds_up
__xMR
;
#define TOTAL_PWM_CLOCKS 255
int16_t
curr_pwm_duty1000_1
=
10
;
...
...
@@ -365,6 +367,7 @@ static void __xMR mytimercallback(const struct timer_task *const timer_task)
update_pwm
();
#endif
if
(
iter
==
99
)
{
++
seconds_up
;
iter
=
0
;
#if defined(MMFANT) || defined(MMPROT)
update_rpm
();
...
...
This diff is collapsed.
Click to expand it.
Christos Gentsos
@cgentsos
mentioned in commit
5956c354
·
3 years ago
mentioned in commit
5956c354
mentioned in commit 5956c354328a77dc63b2fbda8472246f3383b838
Toggle commit list
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