/vhost/mculabs/snippet_db/intxfr/intxfr.h
1 /*
2 This is not mine, but I wrapped it up in a macro
3
4 learned from here:
5 http://www.ccsinfo.com/forum/viewtopic.php?t=46703
6
7
8
9
10 */
11
12
13 #define mINTSAFEXFR(y,x) do { x=y;} while (x!=y);
14
15 int16 keeper;
16 int16 thevar;
17
18 // txfr the var to keeper
19 mINTSAFEXFR(thevar,keeper);
20 ..
21 ..
22 // now write keeper to EEPROM
23 ..
24 ..
25
|