Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rc-switch
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
c3pb
rc-switch
Commits
0d023f72
Commit
0d023f72
authored
9 years ago
by
Max Horn
Browse files
Options
Downloads
Patches
Plain Diff
Get rid of dec2binWzerofill
parent
e3960a0a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
RCSwitch.cpp
+2
-6
2 additions, 6 deletions
RCSwitch.cpp
RCSwitch.h
+0
-1
0 additions, 1 deletion
RCSwitch.h
with
2 additions
and
7 deletions
RCSwitch.cpp
+
2
−
6
View file @
0d023f72
...
...
@@ -326,7 +326,7 @@ char* RCSwitch::getCodeWordC(char sFamily, int nGroup, int nDevice, boolean bSta
return
'\0'
;
}
const
char
*
sDeviceGroupCode
=
dec2binW
zero
fill
(
(
nDevice
-
1
)
+
(
nGroup
-
1
)
*
4
,
4
);
const
char
*
sDeviceGroupCode
=
dec2binW
char
fill
(
(
nDevice
-
1
)
+
(
nGroup
-
1
)
*
4
,
4
,
'0'
);
const
char
familycode
[
16
][
5
]
=
{
"0000"
,
"F000"
,
"0F00"
,
"FF00"
,
"00F0"
,
"F0F0"
,
"0FF0"
,
"FFF0"
,
...
...
@@ -459,7 +459,7 @@ void RCSwitch::sendTriState(const char* sCodeWord) {
}
void
RCSwitch
::
send
(
unsigned
long
code
,
unsigned
int
length
)
{
this
->
send
(
this
->
dec2binW
zero
fill
(
code
,
length
)
);
this
->
send
(
this
->
dec2binW
char
fill
(
code
,
length
,
'0'
)
);
}
void
RCSwitch
::
send
(
const
char
*
sCodeWord
)
{
...
...
@@ -709,10 +709,6 @@ void RCSwitch::handleInterrupt() {
/**
* Turns a decimal value to its binary representation
*/
char
*
RCSwitch
::
dec2binWzerofill
(
unsigned
long
Dec
,
unsigned
int
bitLength
){
return
dec2binWcharfill
(
Dec
,
bitLength
,
'0'
);
}
char
*
RCSwitch
::
dec2binWcharfill
(
unsigned
long
Dec
,
unsigned
int
bitLength
,
char
fill
){
static
char
bin
[
64
];
unsigned
int
i
=
0
;
...
...
This diff is collapsed.
Click to expand it.
RCSwitch.h
+
0
−
1
View file @
0d023f72
...
...
@@ -120,7 +120,6 @@ class RCSwitch {
void
transmit
(
int
nHighPulses
,
int
nLowPulses
);
void
transmit
(
HighLow
pulses
);
static
char
*
dec2binWzerofill
(
unsigned
long
dec
,
unsigned
int
length
);
static
char
*
dec2binWcharfill
(
unsigned
long
dec
,
unsigned
int
length
,
char
fill
);
#if not defined( RCSwitchDisableReceiving )
...
...
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