:: Home :: Code Snippets :: Drivers :: Projects :: About ::
 Main Menu
  Home
  Code Snippets
  About

 Open Drivers
 PIC32 mcompat - PIC32 mcompat
 _build - Embedded build information
 qTask - Queued Task Manager
 EA-DOGM - LCD Display Driver

 Open Projects
 oLogic - Oscilloscope Logic Viewer
 oLogic 1.4 - NEW Logic Viewer
 SSX32 - Serial Servo Driver



 Sources
Prototyping
  PicStuff
  Sparkfun

Equipment
  Saelig
  Tequipment

Supply House
  Jameco
  Mouser
  Digikey
  Allied Electronics
  Clearwater Technologies

Miscellaneous
  BCM
  N34D Blog

Int_XFR - Interrupt safe 16bit transfer

A macro to transfer 16bit vars

 Code Snippet
/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 






:: Home :: Resources :: PIC Microcontrollers ::
:: 10F :: 12F :: 16F :: 18F :: 24F :: 24H :: 30F :: 33F ::
(C) Copyright 2009 mculabs.com - contact: info@mculabs.com
0.059744834899902