00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00040 #ifndef _PIC24_UTIL_H_
00041 #define _PIC24_UTIL_H_
00042
00043 #define DEV_ID_LOCATION 0xFF0000
00044 #define REVISION_LOCATION 0xFF0002
00045
00046
00047
00048
00049
00050
00051
00052
00053 #ifdef __PIC24HJ12GP201__
00054 #define DEV_ID 0x00080a
00055 #define DEV_ID_STR "PIC24HJ12GP201"
00056 #define EXPECTED_REVISION1 0x003001
00057 #define EXPECTED_REVISION1_STR "A2"
00058
00059
00060 #endif
00061
00062 #ifdef __PIC24HJ12GP202__
00063 #define DEV_ID 0x00080B
00064 #define DEV_ID_STR "PIC24HJ12GP202"
00065 #define EXPECTED_REVISION1 0x003001
00066 #define EXPECTED_REVISION1_STR "A2"
00067
00068
00069 #endif
00070
00071 #ifdef __PIC24HJ16GP304__
00072 #define DEV_ID 0x000F17
00073 #define DEV_ID_STR "PIC24HJ16GP304"
00074 #define EXPECTED_REVISION1 0x003001
00075 #define EXPECTED_REVISION1_STR "A2"
00076
00077
00078 #endif
00079
00080 #ifdef __PIC24HJ32GP202__
00081 #define DEV_ID 0x000F1D
00082 #define DEV_ID_STR "PIC24HJ32GP202"
00083 #define EXPECTED_REVISION1 0x003001
00084 #define EXPECTED_REVISION1_STR "A2"
00085 #define EXPECTED_REVISION2 0x003002
00086 #define EXPECTED_REVISION2_STR "A3"
00087 #endif
00088
00089 #ifdef __PIC24HJ32GP204__
00090 #define DEV_ID 0x000F1F
00091 #define DEV_ID_STR "PIC24HJ32GP204"
00092 #define EXPECTED_REVISION1 0x003001
00093 #define EXPECTED_REVISION1_STR "A2"
00094
00095
00096 #endif
00097
00098 #ifdef __PIC24HJ32GP302__
00099 #define DEV_ID 0x000645
00100 #define DEV_ID_STR "PIC24HJ32GP302"
00101 #define EXPECTED_REVISION1 0x003001
00102 #define EXPECTED_REVISION1_STR "A1"
00103 #endif
00104
00105 #ifdef __PIC24HJ32GP304__
00106 #define DEV_ID 0x000647
00107 #define DEV_ID_STR "PIC24HJ32GP304"
00108 #define EXPECTED_REVISION1 0x003001
00109 #define EXPECTED_REVISION1_STR "A1"
00110 #endif
00111
00112
00113 #ifdef __PIC24HJ64GP206__
00114 #define DEV_ID 0x000041
00115 #define DEV_ID_STR "PIC24HJ64GP206"
00116
00118 #define EXPECTED_REVISION1 0x003004
00119 #define EXPECTED_REVISION1_STR "A3"
00120 #endif
00121
00122 #ifdef __PIC24HJ64GP210__
00123 #define DEV_ID 0x000047
00124 #define DEV_ID_STR "PIC24HJ64GP210"
00125
00127 #define EXPECTED_REVISION1 0x003004
00128 #define EXPECTED_REVISION1_STR "A3"
00129 #endif
00130
00131 #ifdef __PIC24HJ64GP202__
00132 #define DEV_ID 0x000655
00133 #define DEV_ID_STR "PIC24HJ64GP202"
00134 #define EXPECTED_REVISION1 0x003001
00135 #define EXPECTED_REVISION1_STR "A1"
00136 #endif
00137
00138 #ifdef __PIC24HJ64GP204__
00139 #define DEV_ID 0x000657
00140 #define DEV_ID_STR "PIC24HJ64GP204"
00141 #define EXPECTED_REVISION1 0x003001
00142 #define EXPECTED_REVISION1_STR "A1"
00143 #endif
00144
00145 #ifdef __PIC24HJ64GP502__
00146 #define DEV_ID 0x000675
00147 #define DEV_ID_STR "PIC24HJ64GP502"
00148 #define EXPECTED_REVISION1 0x003001
00149 #define EXPECTED_REVISION1_STR "A1"
00150 #endif
00151
00152 #ifdef __PIC24HJ64GP504__
00153 #define DEV_ID 0x000677
00154 #define DEV_ID_STR "PIC24HJ64GP504"
00155 #define EXPECTED_REVISION1 0x003001
00156 #define EXPECTED_REVISION1_STR "A1"
00157 #endif
00158
00159 #ifdef __PIC24HJ64GP510__
00160 #define DEV_ID 0x00004B
00161 #define DEV_ID_STR "PIC24HJ64GP510"
00162
00164 #define EXPECTED_REVISION1 0x003004
00165 #define EXPECTED_REVISION1_STR "A3"
00166 #endif
00167
00168 #ifdef __PIC24HJ128GP202__
00169 #define DEV_ID 0x000665
00170 #define DEV_ID_STR "PIC24HJ128GP202"
00171 #define EXPECTED_REVISION1 0x003001
00172 #define EXPECTED_REVISION1_STR "A1"
00173 #endif
00174
00175 #ifdef __PIC24HJ128GP204__
00176 #define DEV_ID 0x000667
00177 #define DEV_ID_STR "PIC24HJ128GP204"
00178 #define EXPECTED_REVISION1 0x003001
00179 #define EXPECTED_REVISION1_STR "A1"
00180 #endif
00181
00182 #ifdef __PIC24HJ128GP206__
00183 #define DEV_ID 0x00005D
00184 #define DEV_ID_STR "PIC24HJ128GP206"
00185
00187 #define EXPECTED_REVISION1 0x003004
00188 #define EXPECTED_REVISION1_STR "A3"
00189 #endif
00190
00191 #ifdef __PIC24HJ128GP210__
00192 #define DEV_ID 0x00005F
00193 #define DEV_ID_STR "PIC24HJ128GP210"
00194
00196 #define EXPECTED_REVISION1 0x003004
00197 #define EXPECTED_REVISION1_STR "A3"
00198 #endif
00199
00200 #ifdef __PIC24HJ128GP502__
00201 #define DEV_ID 0x00067d
00202 #define DEV_ID_STR "PIC24HJ128GP502"
00203 #define EXPECTED_REVISION1 0x003001
00204 #define EXPECTED_REVISION1_STR "A1"
00205 #endif
00206
00207 #ifdef __PIC24HJ128GP504__
00208 #define DEV_ID 0x00067f
00209 #define DEV_ID_STR "PIC24HJ128GP504"
00210 #define EXPECTED_REVISION1 0x003001
00211 #define EXPECTED_REVISION1_STR "A1"
00212 #endif
00213
00214 #ifdef __PIC24HJ256GP206__
00215 #define DEV_ID 0x000071
00216 #define DEV_ID_STR "PIC24HJ256GP206"
00217
00219 #define EXPECTED_REVISION1 0x003004
00220 #define EXPECTED_REVISION1_STR "A3"
00221 #endif
00222
00223 #ifdef __PIC24HJ256GP210__
00224 #define DEV_ID 0x000073
00225 #define DEV_ID_STR "PIC24HJ256GP210"
00226 #define EXPECTED_REVISION1 0x003002
00227 #define EXPECTED_REVISION1_STR "A2"
00228 #define EXPECTED_REVISION2 0x003004
00229 #define EXPECTED_REVISION2_STR "A3"
00230 #endif
00231
00232 #ifdef __PIC24HJ256GP610__
00233 #define DEV_ID 0x00007B
00234 #define DEV_ID_STR "PIC24HJ256GP610"
00235 #define EXPECTED_REVISION1 0x003002
00236 #define EXPECTED_REVISION1_STR "A2"
00237 #define EXPECTED_REVISION2 0x003004
00238 #define EXPECTED_REVISION2_STR "A3"
00239 #endif
00240
00241 #ifdef __PIC24HJ128GP306__
00242 #define DEV_ID 0x000065
00243 #define DEV_ID_STR "PIC24HJ128GP306"
00244
00246 #define EXPECTED_REVISION1 0x003004
00247 #define EXPECTED_REVISION1_STR "A3"
00248 #endif
00249
00250 #ifdef __PIC24HJ128GP310__
00251 #define DEV_ID 0x000067
00252 #define DEV_ID_STR "PIC24HJ128GP310"
00253
00255 #define EXPECTED_REVISION1 0x003004
00256 #define EXPECTED_REVISION1_STR "A3"
00257 #endif
00258
00259 #ifdef __PIC24HJ64GP506__
00260 #define DEV_ID 0x000049
00261 #define DEV_ID_STR "PIC24HJ64GP506"
00262
00264 #define EXPECTED_REVISION1 0x003004
00265 #define EXPECTED_REVISION1_STR "A3"
00266 #endif
00267
00268
00269
00270 #ifdef __PIC24HJ128GP506__
00271 #define DEV_ID 0x000061
00272 #define DEV_ID_STR "PIC24HJ128GP506"
00273
00275 #define EXPECTED_REVISION1 0x003004
00276 #define EXPECTED_REVISION1_STR "A3"
00277 #endif
00278
00279 #ifdef __PIC24HJ128GP510__
00280 #define DEV_ID 0x000063
00281 #define DEV_ID_STR "PIC24HJ128GP510"
00282
00284 #define EXPECTED_REVISION1 0x003004
00285 #define EXPECTED_REVISION1_STR "A3"
00286 #endif
00287
00288
00289
00290 #ifdef __PIC24FJ16GA002__
00291 #define DEV_ID 0x000444
00292 #define DEV_ID_STR "PIC24FJ16GA002"
00293 #define EXPECTED_REVISION1 0x003003
00294 #define EXPECTED_REVISION1_STR "A3"
00295 #endif
00296
00297 #ifdef __PIC24FJ32GA002__
00298 #define DEV_ID 0x000445
00299 #define DEV_ID_STR "PIC24FJ32GA002"
00300 #define EXPECTED_REVISION1 0x003003
00301 #define EXPECTED_REVISION1_STR "A3"
00302 #endif
00303
00304 #ifdef __PIC24FJ48GA002__
00305 #define DEV_ID 0x000446
00306 #define DEV_ID_STR "PIC24FJ48GA002"
00307 #define EXPECTED_REVISION1 0x003003
00308 #define EXPECTED_REVISION1_STR "A3"
00309 #endif
00310
00311 #ifdef __PIC24FJ64GA002__
00312 #define DEV_ID 0x000447
00313 #define DEV_ID_STR "PIC24FJ64GA002"
00314 #define EXPECTED_REVISION1 0x003003
00315 #define EXPECTED_REVISION1_STR "A3"
00316 #endif
00317
00318 #ifdef __PIC24FJ16GA004__
00319 #define DEV_ID 0x00044C
00320 #define DEV_ID_STR "PIC24FJ16GA004"
00321 #define EXPECTED_REVISION1 0x003003
00322 #define EXPECTED_REVISION1_STR "A3"
00323 #endif
00324
00325 #ifdef __PIC24FJ32GA004__
00326 #define DEV_ID 0x00044D
00327 #define DEV_ID_STR "PIC24FJ32GA004"
00328 #define EXPECTED_REVISION1 0x003003
00329 #define EXPECTED_REVISION1_STR "A3"
00330 #endif
00331
00332 #ifdef __PIC24FJ48GA004__
00333 #define DEV_ID 0x00044E
00334 #define DEV_ID_STR "PIC24FJ48GA004"
00335 #define EXPECTED_REVISION1 0x003003
00336 #define EXPECTED_REVISION1_STR "A3"
00337 #endif
00338
00339 #ifdef __PIC24FJ64GA004__
00340 #define DEV_ID 0x00044F
00341 #define DEV_ID_STR "PIC24FJ64GA004"
00342 #define EXPECTED_REVISION1 0x003003
00343 #define EXPECTED_REVISION1_STR "A3"
00344 #endif
00345
00346 #ifdef __PIC24FJ128GA010__
00347 #define DEV_ID 0x00040D
00348 #define DEV_ID_STR "PIC24FJ128GA010"
00349 #define EXPECTED_REVISION1 0x003003
00350 #define EXPECTED_REVISION1_STR "A3"
00351 #define EXPECTED_REVISION2 0x003004
00352 #define EXPECTED_REVISION2_STR "A4"
00353 #define EXPECTED_REVISION3 0x003007 //RBR: I can't find docs on this revision code.
00354 #define EXPECTED_REVISION3_STR "A?"
00355 #endif
00356
00357 #ifdef __PIC24FJ96GA010__
00358 #define DEV_ID 0x00040C
00359 #define DEV_ID_STR "PIC24FJ96GA010"
00360
00361
00362 #define EXPECTED_REVISION1 0x000004
00363 #define EXPECTED_REVISION1_STR "A4"
00364 #endif
00365
00366 #ifdef __PIC24FJ64GA010__
00367 #define DEV_ID 0x00040B
00368 #define DEV_ID_STR "PIC24FJ64GA010"
00369
00370
00371 #define EXPECTED_REVISION1 0x000004
00372 #define EXPECTED_REVISION1_STR "A4"
00373 #endif
00374
00375 #ifdef __PIC24FJ128GA008__
00376 #define DEV_ID 0x00040A
00377 #define DEV_ID_STR "PIC24FJ128GA008"
00378
00379
00380 #define EXPECTED_REVISION1 0x000004
00381 #define EXPECTED_REVISION1_STR "A4"
00382 #endif
00383
00384 #ifdef __PIC24FJ96GA008__
00385 #define DEV_ID 0x000409
00386 #define DEV_ID_STR "PIC24FJ96GA008"
00387
00388
00389 #define EXPECTED_REVISION1 0x000004
00390 #define EXPECTED_REVISION1_STR "A4"
00391 #endif
00392
00393 #ifdef __PIC24FJ64GA008__
00394 #define DEV_ID 0x000408
00395 #define DEV_ID_STR "PIC24FJ64GA008"
00396
00397
00398 #define EXPECTED_REVISION1 0x000004
00399 #define EXPECTED_REVISION1_STR "A4"
00400 #endif
00401
00402 #ifdef __PIC24FJ128GA006__
00403 #define DEV_ID 0x00040A
00404 #define DEV_ID_STR "PIC24FJ128GA006"
00405
00406
00407 #define EXPECTED_REVISION1 0x000004
00408 #define EXPECTED_REVISION1_STR "A4"
00409 #endif
00410
00411 #ifdef __PIC24FJ96GA006__
00412 #define DEV_ID 0x000409
00413 #define DEV_ID_STR "PIC24FJ96GA006"
00414
00415
00416 #define EXPECTED_REVISION1 0x000004
00417 #define EXPECTED_REVISION1_STR "A4"
00418 #endif
00419
00420 #ifdef __PIC24FJ64GA006__
00421 #define DEV_ID 0x000408
00422 #define DEV_ID_STR "PIC24FJ64GA006"
00423
00424
00425 #define EXPECTED_REVISION1 0x000004
00426 #define EXPECTED_REVISION1_STR "A4"
00427 #endif
00428
00429 #ifdef __PIC24FJ256GA110__
00430 #define DEV_ID 0x00101E
00431 #define DEV_ID_STR "PIC24FJ256GA110"
00432 #define EXPECTED_REVISION1 0x000001
00433 #define EXPECTED_REVISION1_STR "A3"
00434 #endif
00435
00436 #ifdef __PIC24FJ192GA110__
00437 #define DEV_ID 0x001016
00438 #define DEV_ID_STR "PIC24FJ192GA110"
00439 #define EXPECTED_REVISION1 0x000001
00440 #define EXPECTED_REVISION1_STR "A3"
00441 #endif
00442
00443 #ifdef __PIC24FJ128GA110__
00444 #define DEV_ID 0x00100E
00445 #define DEV_ID_STR "PIC24FJ128GA110"
00446 #define EXPECTED_REVISION1 0x000001
00447 #define EXPECTED_REVISION1_STR "A3"
00448 #endif
00449
00450 #ifdef __PIC24FJ256GA108__
00451 #define DEV_ID 0x00101A
00452 #define DEV_ID_STR "PIC24FJ256GA108"
00453 #define EXPECTED_REVISION1 0x000001
00454 #define EXPECTED_REVISION1_STR "A3"
00455 #endif
00456
00457 #ifdef __PIC24FJ192GA108__
00458 #define DEV_ID 0x001012
00459 #define DEV_ID_STR "PIC24FJ192GA108"
00460 #define EXPECTED_REVISION1 0x000001
00461 #define EXPECTED_REVISION1_STR "A3"
00462 #endif
00463
00464 #ifdef __PIC24FJ128GA108__
00465 #define DEV_ID 0x00100A
00466 #define DEV_ID_STR "PIC24FJ128GA108"
00467 #define EXPECTED_REVISION1 0x000001
00468 #define EXPECTED_REVISION1_STR "A3"
00469 #endif
00470
00471 #ifdef __PIC24FJ256GA106__
00472 #define DEV_ID 0x001018
00473 #define DEV_ID_STR "PIC24FJ256GA106"
00474 #define EXPECTED_REVISION1 0x000001
00475 #define EXPECTED_REVISION1_STR "A3"
00476 #endif
00477
00478 #ifdef __PIC24FJ192GA106__
00479 #define DEV_ID 0x001010
00480 #define DEV_ID_STR "PIC24FJ192GA106"
00481 #define EXPECTED_REVISION1 0x000001
00482 #define EXPECTED_REVISION1_STR "A3"
00483 #endif
00484
00485 #ifdef __PIC24FJ128GA106__
00486 #define DEV_ID 0x001008
00487 #define DEV_ID_STR "PIC24FJ128GA106"
00488 #define EXPECTED_REVISION1 0x000001
00489 #define EXPECTED_REVISION1_STR "A3"
00490 #endif
00491
00492
00493
00494 #ifdef __PIC24FJ256GB110__
00495 #define DEV_ID 0x00101F
00496 #define DEV_ID_STR "PIC24FJ256GB110"
00497 #define EXPECTED_REVISION1 0x000001
00498 #define EXPECTED_REVISION1_STR "A3"
00499 #endif
00500
00501 #ifdef __PIC24FJ192GB110__
00502 #define DEV_ID 0x001017
00503 #define DEV_ID_STR "PIC24FJ192GB110"
00504 #define EXPECTED_REVISION1 0x000001
00505 #define EXPECTED_REVISION1_STR "A3"
00506 #endif
00507
00508 #ifdef __PIC24FJ128GB110__
00509 #define DEV_ID 0x00100F
00510 #define DEV_ID_STR "PIC24FJ128GB110"
00511 #define EXPECTED_REVISION1 0x000001
00512 #define EXPECTED_REVISION1_STR "A3"
00513 #endif
00514
00515 #ifdef __PIC24FJ64GB110__
00516 #define DEV_ID 0x001007
00517 #define DEV_ID_STR "PIC24FJ64GB110"
00518 #define EXPECTED_REVISION1 0x000001
00519 #define EXPECTED_REVISION1_STR "A3"
00520 #endif
00521
00522 #ifdef __PIC24FJ256GB108__
00523 #define DEV_ID 0x00101B
00524 #define DEV_ID_STR "PIC24FJ256GB108"
00525 #define EXPECTED_REVISION1 0x000001
00526 #define EXPECTED_REVISION1_STR "A3"
00527 #endif
00528
00529 #ifdef __PIC24FJ192GB108__
00530 #define DEV_ID 0x001013
00531 #define DEV_ID_STR "PIC24FJ192GB108"
00532 #define EXPECTED_REVISION1 0x000001
00533 #define EXPECTED_REVISION1_STR "A3"
00534 #endif
00535
00536 #ifdef __PIC24FJ128GB108__
00537 #define DEV_ID 0x00100B
00538 #define DEV_ID_STR "PIC24FJ128GB108"
00539 #define EXPECTED_REVISION1 0x000001
00540 #define EXPECTED_REVISION1_STR "A3"
00541 #endif
00542
00543 #ifdef __PIC24FJ64GB108__
00544 #define DEV_ID 0x001003
00545 #define DEV_ID_STR "PIC24FJ64GB108"
00546 #define EXPECTED_REVISION1 0x000001
00547 #define EXPECTED_REVISION1_STR "A3"
00548 #endif
00549
00550 #ifdef __PIC24FJ256GB106__
00551 #define DEV_ID 0x001018
00552 #define DEV_ID_STR "PIC24FJ256GB106"
00553 #define EXPECTED_REVISION1 0x000001
00554 #define EXPECTED_REVISION1_STR "A3"
00555 #endif
00556
00557 #ifdef __PIC24FJ192GB106__
00558 #define DEV_ID 0x001010
00559 #define DEV_ID_STR "PIC24FJ192GB106"
00560 #define EXPECTED_REVISION1 0x000001
00561 #define EXPECTED_REVISION1_STR "A3"
00562 #endif
00563
00564 #ifdef __PIC24FJ128GB106__
00565 #define DEV_ID 0x001008
00566 #define DEV_ID_STR "PIC24FJ128GB106"
00567 #define EXPECTED_REVISION1 0x000001
00568 #define EXPECTED_REVISION1_STR "A3"
00569 #endif
00570
00571 #ifdef __PIC24FJ64GB106__
00572 #define DEV_ID 0x001001
00573 #define DEV_ID_STR "PIC24FJ64GB106"
00574 #define EXPECTED_REVISION1 0x000001
00575 #define EXPECTED_REVISION1_STR "A3"
00576 #endif
00577
00578
00579
00580
00581
00582
00583
00584 #ifndef DEV_ID
00585 #define DEV_ID 0
00586 #define DEV_ID_STR "unknown"
00587 #define EXPECTED_REVISION1 0
00588 #define EXPECTED_REVISION1_STR "unknown"
00589 #warning *********************************************
00590 #warning * Unknown chip type! Define a device ID and *
00591 #warning * revision ID in the lines above for this *
00592 #warning * chip to remove this warning message. *
00593 #warning * These values can be found by *
00594 #warning * executing the checkDeviceAndRevision() *
00595 #warning * function, which is typically called after *
00596 #warning * reset via calling printResetCause(). *
00597 #warning * This check allows you to ensure that the *
00598 #warning * programmed hex file is running on the *
00599 #warning * same device type it was compiled for. *
00600 #warning * This is only a warning. *
00601 #warning *********************************************
00602 #endif
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612 #ifdef _ISR
00613 #undef _ISR
00614
00615 #define _ISR __attribute__((interrupt)) __attribute__ ((auto_psv))
00616 #endif
00617
00618 #ifdef _ISRFAST
00619 #undef _ISRFAST
00620
00621 #define _ISRFAST __attribute__((interrupt)) __attribute__ ((no_auto_psv))
00622 #endif
00623
00624
00625 #define SLEEP() Sleep()
00626 #define IDLE() Idle()
00627 #define CLRWDT() ClrWdt()
00628 #define NOP() Nop()
00629 #define ENABLEWDT() _SWDTEN = 1
00630 #define DISABLEWDT() _SWDTEN = 0
00631
00639 #if defined(_U4RXIF)
00640 #define NUM_UART_MODS 4
00641 #elif defined(_U3RXIF)
00642 #define NUM_UART_MODS 3
00643 #elif defined(_U2RXIF)
00644 #define NUM_UART_MODS 2
00645 #elif defined(_U1RXIF) || defined(__DOXYGEN__)
00646 #define NUM_UART_MODS 1
00647 #else
00648 #error UxRXIF flag not defined!
00649 #endif
00650
00651 #if defined(_SI2C2IF)
00652 #define NUM_I2C_MODS 2
00653 #elif defined(_SI2C1IF) || defined(__DOXYGEN__)
00654 #define NUM_I2C_MODS 1
00655 #else
00656 #error SI2CxIF flag not defined!
00657 #endif
00658
00659 #if defined(_SPI2IF)
00660 #define NUM_SPI_MODS 2
00661 #elif defined(_SPI1IF) || defined(__DOXYGEN__)
00662 #define NUM_SPI_MODS 1
00663 #else
00664 #error SPIxIF flag not defined!
00665 #endif
00666
00667 #if defined(_C2IF)
00668 #define NUM_ECAN_MODS 2
00669 #elif defined(_C1IF) || defined(__DOXYGEN__)
00670 #define NUM_ECAN_MODS 1
00671 #endif
00672
00673
00674 extern uint32 u32_heartbeatCount;
00675
00676 extern _PERSISTENT char* sz_lastTimeoutError;
00677
00686 #define BITS2WORD(sfrBitfield) ( *((uint16*) &sfrBitfield) )
00687 #define BITS2BYTEL(sfrBitfield) ( ((uint8*) &sfrBitfield)[0] )
00688 #define BITS2BYTEH(sfrBitfield) ( ((uint8*) &sfrBitfield)[1] )
00690
00691
00697 #define REPORT_ERROR(msg) reportError(ERROR_FILE_LINE(msg))
00698
00699 #ifdef SIM
00700 #define HELLO_MSG "****************************************************\n" \
00701 "* SIMULATION MODE - DO NOT RUN ON A REAL PIC! *\n" \
00702 "****************************************************\n" \
00703 "\n" __FILE__ ", built on " __DATE__ " at " __TIME__ "\n"
00704
00705 #warning ***********************************************
00706 #warning * SIMULATION MODE - DO NOT RUN ON A REAL PIC! *
00707 #warning ***********************************************
00708 #else
00709 #define HELLO_MSG "\n" __FILE__ ", built on " __DATE__ " at " __TIME__ "\n"
00710 #endif
00711
00712
00713
00714 void configHeartbeat(void);
00715 void doHeartbeat(void);
00716 void toggleHeartbeat(void);
00717 void reportError(const char* szErrorMessage);
00718 void printResetCause(void);
00719 void configPinsForLowPower(void);
00720 void configBasic(const char* psz_helloMsg);
00721
00722 #ifndef USE_HEARTBEAT
00723
00726 #define USE_HEARTBEAT 1
00727 #endif
00728
00732 #ifndef HB_LED
00733 #define HB_LED _LATB15
00734
00735 #define CONFIG_HB_LED() CONFIG_RB15_AS_DIG_OD_OUTPUT()
00736 #endif
00737
00738
00739 #endif