Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
card-access-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bc. Petr Elexa
card-access-system
Commits
27b2e9a1
Commit
27b2e9a1
authored
Jan 24, 2020
by
Bc. Petr Elexa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panel: configurable door update period
parent
738b3ee9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
terminal.c
cardreader/app/terminal.c
+8
-4
No files found.
cardreader/app/terminal.c
View file @
27b2e9a1
...
...
@@ -29,8 +29,10 @@
// How long to wait for user request.
static
const
uint16_t
USER_REQUEST_WAIT_MS
=
400
;
// This is minimal period between each request.
// Also controls intensity of door status messages (sent each
2
*period).
// Also controls intensity of door status messages (sent each
SEND_DOOR_STATUS_RATE
*period).
static
const
uint16_t
USER_REQUEST_MIN_PERIOD_MS
=
1000
;
// Door status update rate (period multiplier)
static
const
uint16_t
SEND_DOOR_STATUS_RATE
=
5
;
// Cache entry type mapping to our type.
typedef
cache_item_t
term_cache_item_t
;
// 4 bytes
...
...
@@ -369,7 +371,7 @@ static void terminal_task(void *pvParameters)
// start timer for detecting master timeout
configASSERT
(
xTimerStart
(
_act_timer
,
0
));
bool
send_door_status
=
true
;
uint8_t
send_door_status
=
SEND_DOOR_STATUS_RATE
;
WDT_Feed
();
// Feed HW watchdog
...
...
@@ -412,8 +414,10 @@ static void terminal_task(void *pvParameters)
WDT_Feed
();
// Feed HW watchdog
if
(
send_door_status
)
if
(
send_door_status
==
SEND_DOOR_STATUS_RATE
)
{
send_door_status
=
0
;
// Check if door open/close state changed
for
(
size_t
idx
=
0
;
idx
<
ACS_READER_MAXCOUNT
;
++
idx
)
{
...
...
@@ -425,7 +429,7 @@ static void terminal_task(void *pvParameters)
}
}
}
send_door_status
=
!
send_door_status
;
send_door_status
++
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment