PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Social
libbadgetools
ir_hex.c
1
#include <stdlib.h>
2
#include <propeller.h>
3
#include "
badgetools.h
"
4
5
jm_ir_hdserial
*irself;
6
7
int32_t ircom_hex(int32_t value, int32_t digits)
8
{
9
static
int32_t look__0050[] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, };
10
11
// Transmit a value in hexadecimal format
12
value = value << ((8 - digits) << 2);
13
{
14
int32_t _idx__0051;
15
int32_t _limit__0052 = digits;
16
for
(_idx__0051 = 0; _idx__0051 < _limit__0052; _idx__0051++) {
17
ircom_tx(Lookup__(((value = Rotl__(value, 4)) & 0xf), 0, look__0050, 16));
18
}
19
}
20
return
0;
21
}
22
23
/*
24
TERMS OF USE: MIT License
25
26
Permission is hereby granted, free of charge, to any person obtaining a
27
copy of this software and associated documentation files (the "Software"),
28
to deal in the Software without restriction, including without limitation
29
the rights to use, copy, modify, merge, publish, distribute, sublicense,
30
and/or sell copies of the Software, and to permit persons to whom the
31
Software is furnished to do so, subject to the following conditions:
32
33
The above copyright notice and this permission notice shall be included in
34
all copies or substantial portions of the Software.
35
36
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
39
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42
DEALINGS IN THE SOFTWARE.
43
*/
44
jm_ir_hdserial
Definition:
badgetools.h:1526
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17