FireBirdLib - Topfield TMS PVR TAP Programming Library
VFD_SetCDValue.c
Go to the documentation of this file.
1
#include <string.h>
2
#include "
FBLib_tmsvfd.h
"
3
4
bool
VFD_SetCDValue
(
int
Percent)
5
{
6
TRACEENTER
();
7
8
byte
*
grid
= (
byte
*)
FIS_vGrid
();
9
10
if
(!
VFDUsedByTAP
|| !
grid
|| !
CDEnabled
)
11
{
12
TRACEEXIT
();
13
return
FALSE;
14
}
15
16
grid
[25] &= 0xfe;
17
grid
[26] = 0x00;
18
grid
[27] &= 0x1f;
19
20
if
(Percent > 7)
grid
[25] |= 0x01;
21
if
(Percent > 15)
grid
[26] |= 0x80;
22
if
(Percent > 23)
grid
[26] |= 0x40;
23
if
(Percent > 30)
grid
[26] |= 0x20;
24
if
(Percent > 38)
grid
[26] |= 0x10;
25
if
(Percent > 46)
grid
[26] |= 0x08;
26
if
(Percent > 53)
grid
[26] |= 0x04;
27
if
(Percent > 61)
grid
[26] |= 0x02;
28
if
(Percent > 69)
grid
[26] |= 0x01;
29
if
(Percent > 76)
grid
[27] |= 0x80;
30
if
(Percent > 84)
grid
[27] |= 0x40;
31
if
(Percent > 92)
grid
[27] |= 0x20;
32
33
TRACEEXIT
();
34
return
TRUE;
35
}
FBLib_tmsvfd.h
grid
byte * grid
Definition:
VFD_GetControl.c:4
CDEnabled
bool CDEnabled
Definition:
VFD_EnableCD.c:4
VFDUsedByTAP
bool VFDUsedByTAP
Definition:
VFD_GetControl.c:3
FIS_vGrid
dword FIS_vGrid(void)
Definition:
FIS_vgrid.c:3
VFD_SetCDValue
bool VFD_SetCDValue(int Percent)
Definition:
VFD_SetCDValue.c:4
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tmsvfd
VFD_SetCDValue.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3