PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Simple Libraries
Social
libbadgetools
peb_contacts_clear.c
1
#include "simpletools.h"
2
#include "
badgetools.h
"
3
4
/* BROKEN */
5
6
/*
7
8
int i2cLock;
9
volatile int eei2cLock;
10
volatile int eei2cLockFlag;
11
volatile int eeRecCount, eeNextAddr, eeBadgeOk,
12
eeNext, eeRecsAddr, eeRecs,
13
eeRecHome, eeRecOffice;
14
volatile int eeHome;
15
16
void contacts_clear(void)
17
{
18
if(!eeBadgeOk) ee_badgeCheck();
19
eeRecOffice +=4;
20
eeRecs--;
21
while(lockset(eei2cLock));
22
while(eeRecs >= 0)
23
{
24
print("eeRecs = %d\n", eeRecs);
25
print("eeRecOffice = %d\n", eeRecOffice);
26
int a = ee_getInt(eeRecOffice);
27
ee_putInt(0xFFFFFFFF, eeRecOffice);
28
int ss = a >> 16;
29
a &= 0x0000FFFF;
30
print("ss = %d\n", ss);
31
print("a = %d\n", a);
32
char s[ss];
33
ee_getStr((unsigned char *) s, ss, a);
34
print("s = %s\n\n", s);
35
memset(s, 0xFF, ss); // ? ss +/- 1 ?
36
ee_putStr((unsigned char *) s, ss, a);
37
eeRecs--;
38
eeRecOffice += 4;
39
}
40
ee_putInt(0, eeRecsAddr);
41
ee_putInt(eeHome, eeRecsAddr + 4);
42
lockclr(eei2cLock);
43
// ee_putStr("erased", 7, eeHome);
44
eeBadgeOk = 0;
45
ee_badgeCheck();
46
}
47
48
*/
49
50
51
/*
52
TERMS OF USE: MIT License
53
54
Permission is hereby granted, free of charge, to any person obtaining a
55
copy of this software and associated documentation files (the "Software"),
56
to deal in the Software without restriction, including without limitation
57
the rights to use, copy, modify, merge, publish, distribute, sublicense,
58
and/or sell copies of the Software, and to permit persons to whom the
59
Software is furnished to do so, subject to the following conditions:
60
61
The above copyright notice and this permission notice shall be included in
62
all copies or substantial portions of the Software.
63
64
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
67
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
69
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
70
DEALINGS IN THE SOFTWARE.
71
*/
72
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
Generated on Sat Aug 27 2016 00:58:09 for PropWare by
1.8.12