detect.h
Go to the documentation of this file.
00001
00036 #ifndef CPU_DETECT_H
00037 #define CPU_DETECT_H
00038 
00039 #if defined(__ARM_ARCH_4T__) /* GCC */ \
00040     || (defined(__ICCARM__) && (__CORE__== __ARM4TM__)) /* IAR: defined for all cores == 4tm */
00041     #define CPU_ARM 1
00042     #define CPU_ID  arm
00043     #define CPU_CORE_NAME        "ARM7TDMI"
00044 
00045     // AT91SAM7S products serie
00046     #if defined(__ARM_AT91SAM7S32__)
00047         #define CPU_ARM_AT91         1
00048         #define CPU_ARM_AT91SAM7S32  1
00049         #define CPU_NAME             "AT91SAM7S32"
00050     #else
00051         #define CPU_ARM_AT91SAM7S32  0
00052     #endif
00053 
00054     #if defined(__ARM_AT91SAM7S64__)
00055         #define CPU_ARM_AT91         1
00056         #define CPU_ARM_SAM7S_LARGE  1
00057         #define CPU_ARM_AT91SAM7S64  1
00058         #define CPU_NAME             "AT91SAM7S64"
00059     #else
00060         #define CPU_ARM_AT91SAM7S64  0
00061     #endif
00062 
00063     #if defined(__ARM_AT91SAM7S128__)
00064         #define CPU_ARM_AT91         1
00065         #define CPU_ARM_SAM7S_LARGE  1
00066         #define CPU_ARM_AT91SAM7S128 1
00067         #define CPU_NAME             "AT91SAM7S128"
00068     #else
00069         #define CPU_ARM_AT91SAM7S128 0
00070     #endif
00071 
00072     #if defined(__ARM_AT91SAM7S256__)
00073         #define CPU_ARM_AT91         1
00074         #define CPU_ARM_SAM7S_LARGE  1
00075         #define CPU_ARM_AT91SAM7S256 1
00076         #define CPU_NAME             "AT91SAM7S256"
00077     #else
00078         #define CPU_ARM_AT91SAM7S256 0
00079     #endif
00080 
00081     #if defined(__ARM_AT91SAM7S512__)
00082         #define CPU_ARM_AT91         1
00083         #define CPU_ARM_SAM7S_LARGE  1
00084         #define CPU_ARM_AT91SAM7S512 1
00085         #define CPU_NAME             "AT91SAM7S512"
00086     #else
00087         #define CPU_ARM_AT91SAM7S512 0
00088     #endif
00089 
00090     // AT91SAM7X products serie
00091     #if defined(__ARM_AT91SAM7X128__)
00092         #define CPU_ARM_AT91         1
00093         #define CPU_ARM_SAM7X        1
00094         #define CPU_ARM_AT91SAM7X128 1
00095         #define CPU_NAME             "AT91SAM7X128"
00096     #else
00097         #define CPU_ARM_AT91SAM7X128 0
00098     #endif
00099 
00100     #if defined(__ARM_AT91SAM7X256__)
00101         #define CPU_ARM_AT91         1
00102         #define CPU_ARM_SAM7X        1
00103         #define CPU_ARM_AT91SAM7X256 1
00104         #define CPU_NAME             "AT91SAM7X256"
00105     #else
00106         #define CPU_ARM_AT91SAM7X256 0
00107     #endif
00108 
00109
00110     #if defined(__ARM_AT91SAM7X512__)
00111         #define CPU_ARM_AT91         1
00112         #define CPU_ARM_SAM7X        1
00113         #define CPU_ARM_AT91SAM7X512 1
00114         #define CPU_NAME             "AT91SAM7X512"
00115     #else
00116         #define CPU_ARM_AT91SAM7X512 0
00117     #endif
00118 
00119     #if defined(__ARM_LPC2378__)
00120         #define CPU_ARM_LPC2        1
00121         #define CPU_ARM_LPC2378     1
00122         #define CPU_NAME             "LPC2378"
00123     #else
00124         #define CPU_ARM_LPC2378     0
00125     #endif
00126 
00127     #if !defined(CPU_ARM_SAM7S_LARGE)
00128         #define CPU_ARM_SAM7S_LARGE 0
00129     #endif
00130 
00131     #if !defined(CPU_ARM_SAM7X)
00132         #define CPU_ARM_SAM7X 0
00133     #endif
00134 
00135
00136     #if defined(CPU_ARM_AT91)
00137         #if CPU_ARM_AT91SAM7S32 + CPU_ARM_AT91SAM7S64 \
00138         + CPU_ARM_AT91SAM7S128 + CPU_ARM_AT91SAM7S256 \
00139         + CPU_ARM_AT91SAM7S512 \
00140         + CPU_ARM_AT91SAM7X128 + CPU_ARM_AT91SAM7X256 \
00141         + CPU_ARM_AT91SAM7X512 != 1
00142             #error ARM CPU configuration error
00143         #endif
00144         #define CPU_ARM_LPC2        0
00145 
00146     #elif defined (CPU_ARM_LPC2)
00147 
00148         #if CPU_ARM_LPC2378 + 0 != 1
00149             #error NXP LPC2xxx ARM CPU configuration error
00150         #endif
00151         #define CPU_ARM_AT91        0
00152     /* #elif Add other ARM families here */
00153     #else
00154         #define CPU_ARM_AT91        0
00155         #define CPU_ARM_LPC2        0
00156     #endif
00157 
00158
00159     #if CPU_ARM_AT91 + CPU_ARM_LPC2 + 0 /* Add other ARM families here */ != 1
00160         #error ARM CPU configuration error
00161     #endif
00162 #else
00163     #define CPU_ARM                 0
00164 
00165     /* ARM Families */
00166     #define CPU_ARM_AT91            0
00167     #define CPU_ARM_LPC2            0
00168 
00169     /* SAM7 sub-families */
00170     #define CPU_ARM_SAM7S_LARGE     0
00171     #define CPU_ARM_SAM7X           0
00172 
00173     /* ARM CPUs */
00174     #define CPU_ARM_AT91SAM7S32     0
00175     #define CPU_ARM_AT91SAM7S64     0
00176     #define CPU_ARM_AT91SAM7S128    0
00177     #define CPU_ARM_AT91SAM7S256    0
00178     #define CPU_ARM_AT91SAM7S512    0
00179     #define CPU_ARM_AT91SAM7X128    0
00180     #define CPU_ARM_AT91SAM7X256    0
00181     #define CPU_ARM_AT91SAM7X512    0
00182 
00183     #define CPU_ARM_LPC2378         0
00184 #endif
00185 
00186 #if defined(__ARM_ARCH_7M__) /* GCC */ \
00187     || (defined(__ICCARM__) && (__CORE__== __ARM7M__)) /* IAR: defined for all cores v7M */
00188     /* Cortex-M3 */
00189     #define CPU_CM3 1
00190     #define CPU_ID  cm3
00191     #define CPU_CORE_NAME "Cortex-M3"
00192 
00193     #if defined (__ARM_LM3S1968__)
00194         #define CPU_CM3_LM3S        1
00195         #define CPU_CM3_LM3S1968    1
00196         #define CPU_NAME            "LM3S1968"
00197     #else
00198         #define CPU_CM3_LM3S1968    0
00199     #endif
00200 
00201     #if defined (__ARM_LM3S8962__)
00202         #define CPU_CM3_LM3S        1
00203         #define CPU_CM3_LM3S8962    1
00204         #define CPU_NAME            "LM3S8962"
00205     #else
00206         #define CPU_CM3_LM3S8962    0
00207     #endif
00208 
00209     #if defined (__ARM_STM32F100RB__)
00210         #define CPU_CM3_STM32       1
00211         #define CPU_CM3_STM32F100RB 1
00212         #define CPU_NAME            "STM32F100RB"
00213     #else
00214         #define CPU_CM3_STM32F100RB 0
00215     #endif
00216 
00217     #if defined (__ARM_STM32F100C4__)
00218         #define CPU_CM3_STM32       1
00219         #define CPU_CM3_STM32F100C4 1
00220         #define CPU_NAME            "STM32F100C4"
00221     #else
00222         #define CPU_CM3_STM32F100C4 0
00223     #endif
00224 
00225     #if defined (__ARM_STM32F101C4__)
00226         #define CPU_CM3_STM32       1
00227         #define CPU_CM3_STM32F101C4 1
00228         #define CPU_NAME            "STM32F101C4"
00229     #else
00230         #define CPU_CM3_STM32F101C4 0
00231     #endif
00232 
00233     #if defined (__ARM_STM32F102C4__)
00234         #define CPU_CM3_STM32       1
00235         #define CPU_CM3_STM32F102C4 1
00236         #define CPU_NAME            "STM32F102C4"
00237     #else
00238         #define CPU_CM3_STM32F102C4 0
00239     #endif
00240 
00241     #if defined (__ARM_STM32F103RB__)
00242         #define CPU_CM3_STM32       1
00243         #define CPU_CM3_STM32F103RB 1
00244         #define CPU_NAME            "STM32F103RB"
00245     #else
00246         #define CPU_CM3_STM32F103RB 0
00247     #endif
00248 
00249     #if defined (__ARM_STM32F103RE__)
00250         #define CPU_CM3_STM32       1
00251         #define CPU_CM3_STM32F103RE 1
00252         #define CPU_NAME            "STM32F103RE"
00253     #else
00254         #define CPU_CM3_STM32F103RE 0
00255     #endif
00256 
00257
00258     // AT91SAM3N products serie
00259     #if defined (__ARM_SAM3N4__)
00260         #define CPU_CM3_SAM3    1
00261         #define CPU_CM3_SAM3N   1
00262         #define CPU_CM3_SAM3N4  1
00263         #define CPU_NAME        "SAM3N4"
00264 
00265         #define CPU_CM3_SAM3S   0
00266         #define CPU_CM3_SAM3U   0
00267         #define CPU_CM3_SAM3N2  0
00268         #define CPU_CM3_SAM3N1  0
00269         #define CPU_CM3_SAM3X   0
00270     #else
00271         #define CPU_CM3_SAM3N4  0
00272     #endif
00273 
00274     // AT91SAM3S products serie
00275     #if defined (__ARM_SAM3S4__)
00276         #define CPU_CM3_SAM3    1
00277         #define CPU_CM3_SAM3S   1
00278         #define CPU_CM3_SAM3S4  1
00279         #define CPU_NAME        "SAM3S4"
00280 
00281         #define CPU_CM3_SAM3N   0
00282         #define CPU_CM3_SAM3U   0
00283         #define CPU_CM3_SAM3X   0
00284     #else
00285         #define CPU_CM3_SAM3S4  0
00286     #endif
00287 
00288     // AT91SAM3U products serie
00289     #if defined (__ARM_SAM3U4__)
00290         #define CPU_CM3_SAM3    1
00291         #define CPU_CM3_SAM3U   1
00292         #define CPU_CM3_SAM3U4  1
00293         #define CPU_NAME        "SAM3U4"
00294 
00295         #define CPU_CM3_SAM3N   0
00296         #define CPU_CM3_SAM3S   0
00297         #define CPU_CM3_SAM3X   0
00298     #else
00299         #define CPU_CM3_SAM3U4  0
00300     #endif
00301 
00302     // AT91SAM3X products serie
00303     #if defined (__ARM_SAM3X8__)
00304         #define CPU_CM3_SAM3    1
00305         #define CPU_CM3_SAM3X   1
00306         #define CPU_CM3_SAM3X8  1
00307         #define CPU_NAME        "SAM3X8"
00308 
00309         #define CPU_CM3_SAM3N   0
00310         #define CPU_CM3_SAM3S   0
00311         #define CPU_CM3_SAM3U   0
00312     #else
00313         #define CPU_CM3_SAM3X8  0
00314     #endif
00315 
00316     #if defined (CPU_CM3_LM3S)
00317         #if CPU_CM3_LM3S1968 + CPU_CM3_LM3S8962 + 0 != 1
00318             #error Luminary Cortex-M3 CPU configuration error
00319         #endif
00320         #define CPU_CM3_STM32       0
00321         #define CPU_CM3_SAM3        0
00322     #elif defined (CPU_CM3_STM32)
00323         #if CPU_CM3_STM32F100RB + CPU_CM3_STM32F100C4 + CPU_CM3_STM32F101C4 + CPU_CM3_STM32F103RB + CPU_CM3_STM32F103RE + \
00324             CPU_CM3_STM32F102C4 + 0 != 1
00325             #error STM32 Cortex-M3 CPU configuration error
00326         #endif
00327         #define CPU_CM3_LM3S        0
00328         #define CPU_CM3_SAM3        0
00329     #elif defined (CPU_CM3_SAM3)
00330         #if CPU_CM3_SAM3N + CPU_CM3_SAM3U + CPU_CM3_SAM3S + CPU_CM3_SAM3X + 0 != 1
00331             #error SAM3 Cortex-M3 CPU configuration error
00332         #endif
00333         #if CPU_CM3_SAM3N4 + CPU_CM3_SAM3S4 + CPU_CM3_SAM3U4 + CPU_CM3_SAM3X8 + 0 != 1
00334             #error SAM3 Cortex-M3 CPU configuration error
00335         #endif
00336         #define CPU_CM3_LM3S        0
00337         #define CPU_CM3_STM32       0
00338     /* #elif Add other Cortex-M3 families here */
00339     #else
00340         #define CPU_CM3_LM3S        0
00341         #define CPU_CM3_STM32       0
00342         #define CPU_CM3_SAM3        0
00343     #endif
00344 
00345
00346     #if CPU_CM3_LM3S + CPU_CM3_STM32 + CPU_CM3_SAM3 + 0 /* Add other Cortex-M3 families here */ != 1
00347         #error Cortex-M3 CPU configuration error
00348     #endif
00349 
00350 #else
00351     #define CPU_CM3 0
00352     #define CPU_CM3_LM3S 0
00353     #define CPU_CM3_LM3S1968 0
00354     #define CPU_CM3_LM3S8962 0
00355 
00356     #define CPU_CM3_STM32 0
00357     #define CPU_CM3_STM32F100RB 0
00358     #define CPU_CM3_STM32F100C4 0
00359     #define CPU_CM3_STM32F103RB 0
00360     #define CPU_CM3_STM32F101C4 0
00361     #define CPU_CM3_STM32F103RE 0
00362 
00363     #define CPU_CM3_SAM3 0
00364     #define CPU_CM3_SAM3N 0
00365     #define CPU_CM3_SAM3N4 0
00366     #define CPU_CM3_SAM3X 0
00367     #define CPU_CM3_SAM3X8 0
00368 #endif
00369 
00370 #if (defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)) \
00371     && !defined(__ICCARM__) /* IAR: if not ARM assume I196 */
00372     #warning Assuming CPU is I196
00373     #define CPU_I196        1
00374     #define CPU_ID                  i196
00375 #else
00376     #define CPU_I196                0
00377 #endif
00378 
00379 #if defined(__i386__) /* GCC */ \
00380     || (defined(_M_IX86) && !defined(_WIN64)) /* MSVC */
00381     #define CPU_X86                 1
00382     #define CPU_X86_32              1
00383     #define CPU_X86_64              0
00384     #define CPU_ID                  x86
00385     #define CPU_CORE_NAME           "x86"
00386     #define CPU_NAME                "generic"
00387 #elif defined(__x86_64__) /* GCC */ \
00388     || (defined(_M_IX86) && defined(_WIN64)) /* MSVC */
00389     #define CPU_X86                 1
00390     #define CPU_X86_32              0
00391     #define CPU_X86_64              1
00392     #define CPU_ID                  x86
00393     #define CPU_CORE_NAME           "x86_64"
00394     #define CPU_NAME                "generic"
00395 #else
00396     #define CPU_X86                 0
00397     #define CPU_I386                0
00398     #define CPU_X86_64              0
00399 #endif
00400 
00401 #if defined (_ARCH_PPC) || defined(_ARCH_PPC64)
00402     #define CPU_PPC                 1
00403     #define CPU_ID                  ppc
00404     #if defined(_ARCH_PPC)
00405         #define CPU_PPC32       1
00406     #else
00407             #define CPU_PPC32       0
00408     #endif
00409     #if defined(_ARCH_PPC64)
00410         #define CPU_PPC64       1
00411     #else
00412             #define CPU_PPC64       0
00413     #endif
00414 #else
00415     #define CPU_PPC                 0
00416     #define CPU_PPC32               0
00417     #define CPU_PPC64               0
00418 #endif
00419 
00420 #if defined(__m56800E__) || defined(__m56800__)
00421     #define CPU_DSP56K              1
00422     #define CPU_ID                  dsp56k
00423 #else
00424     #define CPU_DSP56K              0
00425 #endif
00426 
00427 #if defined (__AVR__)
00428     #define CPU_AVR                 1
00429     #define CPU_ID                  avr
00430     #define CPU_CORE_NAME           "AVR"
00431 
00432     #if defined(__AVR_ATmega32__)
00433         #define CPU_AVR_MEGA        1
00434         #define CPU_AVR_ATMEGA32    1
00435         #define CPU_NAME            "ATmega32"
00436     #else
00437         #define CPU_AVR_ATMEGA32    0
00438     #endif
00439 
00440     #if defined(__AVR_ATmega64__)
00441         #define CPU_AVR_MEGA        1
00442         #define CPU_AVR_ATMEGA64    1
00443         #define CPU_NAME            "ATmega64"
00444     #else
00445         #define CPU_AVR_ATMEGA64    0
00446     #endif
00447 
00448     #if defined(__AVR_ATmega103__)
00449         #define CPU_AVR_MEGA        1
00450         #define CPU_AVR_ATMEGA103   1
00451         #define CPU_NAME            "ATmega103"
00452     #else
00453         #define CPU_AVR_ATMEGA103   0
00454     #endif
00455 
00456     #if defined(__AVR_ATmega128__)
00457         #define CPU_AVR_MEGA        1
00458         #define CPU_AVR_ATMEGA128   1
00459         #define CPU_NAME            "ATmega128"
00460     #else
00461         #define CPU_AVR_ATMEGA128   0
00462     #endif
00463 
00464     #if defined(__AVR_ATmega8__)
00465         #define CPU_AVR_MEGA        1
00466         #define CPU_AVR_ATMEGA8     1
00467         #define CPU_NAME            "ATmega8"
00468     #else
00469         #define CPU_AVR_ATMEGA8     0
00470     #endif
00471 
00472     #if defined(__AVR_ATmega88P__)
00473         #define CPU_AVR_MEGA        1
00474         #define CPU_AVR_ATMEGA88P   1
00475         #define CPU_NAME            "ATmega88P"
00476     #else
00477         #define CPU_AVR_ATMEGA88P   0
00478     #endif
00479 
00480     #if defined(__AVR_ATmega168__)
00481         #define CPU_AVR_MEGA        1
00482         #define CPU_AVR_ATMEGA168   1
00483         #define CPU_NAME            "ATmega168"
00484     #else
00485         #define CPU_AVR_ATMEGA168   0
00486     #endif
00487 
00488     #if defined(__AVR_ATmega324P__)
00489         #define CPU_AVR_MEGA        1
00490         #define CPU_AVR_ATMEGA324P  1
00491         #define CPU_NAME            "ATmega324P"
00492     #else
00493         #define CPU_AVR_ATMEGA324P  0
00494     #endif
00495     #if defined(__AVR_ATmega644P__)
00496         #define CPU_AVR_MEGA        1
00497         #define CPU_AVR_ATMEGA644P  1
00498         #define CPU_NAME            "ATmega644P"
00499     #else
00500         #define CPU_AVR_ATMEGA644P  0
00501     #endif
00502     #if defined(__AVR_ATmega328P__)
00503         #define CPU_AVR_MEGA        1
00504         #define CPU_AVR_ATMEGA328P  1
00505         #define CPU_NAME            "ATmega328P"
00506     #else
00507         #define CPU_AVR_ATMEGA328P  0
00508     #endif
00509 
00510     #if defined(__AVR_ATmega1281__)
00511         #define CPU_AVR_MEGA        1
00512         #define CPU_AVR_ATMEGA1281  1
00513         #define CPU_NAME            "ATmega1281"
00514     #else
00515         #define CPU_AVR_ATMEGA1281  0
00516     #endif
00517 
00518     #if defined(__AVR_ATmega1280__)
00519         #define CPU_AVR_MEGA        1
00520         #define CPU_AVR_ATMEGA1280  1
00521         #define CPU_NAME            "ATmega1280"
00522     #else
00523         #define CPU_AVR_ATMEGA1280  0
00524     #endif
00525 
00526     #if defined(__AVR_ATmega2560__)
00527         #define CPU_AVR_MEGA        1
00528         #define CPU_AVR_ATMEGA2560  1
00529         #define CPU_NAME            "ATmega2560"
00530     #else
00531         #define CPU_AVR_ATMEGA2560  0
00532     #endif
00533 
00534     #if defined(__AVR_ATxmega128A1__)
00535         #define CPU_AVR_XMEGA       1
00536         #define CPU_AVR_XMEGA_D4    0
00537         #define CPU_AVR_XMEGA_D3    0
00538         #define CPU_AVR_XMEGA_A4    0
00539         #define CPU_AVR_XMEGA_A3    0
00540         #define CPU_AVR_XMEGA_A1    1
00541         #define CPU_AVR_ATXMEGA128A1    1
00542         #define CPU_NAME            "ATxmega128a1"
00543     #else
00544         #define CPU_AVR_ATXMEGA128A1    0
00545     #endif
00546 
00547     #if defined(__AVR_ATxmega64A3__)
00548         #define CPU_AVR_XMEGA       1
00549         #define CPU_AVR_XMEGA_D4    0
00550         #define CPU_AVR_XMEGA_D3    0
00551         #define CPU_AVR_XMEGA_A4    0
00552         #define CPU_AVR_XMEGA_A3    1
00553         #define CPU_AVR_XMEGA_A1    0
00554         #define CPU_AVR_ATXMEGA64A3 1
00555         #define CPU_NAME            "ATxmega64a3"
00556     #else
00557         #define CPU_AVR_ATXMEGA64A3 0
00558     #endif
00559 
00560     #if defined(__AVR_ATxmega32A4__)
00561         #define CPU_AVR_XMEGA       1
00562         #define CPU_AVR_XMEGA_D4    0
00563         #define CPU_AVR_XMEGA_D3    0
00564         #define CPU_AVR_XMEGA_A4    1
00565         #define CPU_AVR_XMEGA_A3    0
00566         #define CPU_AVR_XMEGA_A1    0
00567         #define CPU_AVR_ATXMEGA32A4 1
00568         #define CPU_NAME            "ATxmega32a4"
00569     #else
00570         #define CPU_AVR_ATXMEGA32A4 0
00571     #endif
00572 
00573     #if defined(__AVR_ATxmega32D4__)
00574         #define CPU_AVR_XMEGA       1
00575         #define CPU_AVR_XMEGA_D4    1
00576         #define CPU_AVR_XMEGA_D3    0
00577         #define CPU_AVR_XMEGA_A4    0
00578         #define CPU_AVR_XMEGA_A3    0
00579         #define CPU_AVR_XMEGA_A1    0
00580         #define CPU_AVR_ATXMEGA32D4 1
00581         #define CPU_NAME            "ATxmega32d4"
00582     #else
00583         #define CPU_AVR_ATXMEGA32D4 0
00584     #endif
00585 
00586     #if CPU_AVR_ATMEGA32 + CPU_AVR_ATMEGA64 + CPU_AVR_ATMEGA103 + CPU_AVR_ATMEGA128 \
00587       + CPU_AVR_ATMEGA8 + CPU_AVR_ATMEGA88P + CPU_AVR_ATMEGA168 + CPU_AVR_ATMEGA328P \
00588       + CPU_AVR_ATMEGA324P + CPU_AVR_ATMEGA644P + CPU_AVR_ATMEGA1281 + CPU_AVR_ATMEGA1280 \
00589       + CPU_AVR_ATMEGA2560 + CPU_AVR_ATXMEGA32D4 != 1
00590         #error AVR CPU configuration error
00591     #endif
00592 
00593     #if defined(CPU_AVR_XMEGA) && defined(CPU_AVR_MEGA)
00594         #error CPU cannot be MEGA and XMEGA
00595     #elif defined(CPU_AVR_MEGA)
00596         #define CPU_AVR_XMEGA       0
00597         #define CPU_AVR_XMEGA_D4    0
00598         #define CPU_AVR_XMEGA_D3    0
00599         #define CPU_AVR_XMEGA_A4    0
00600         #define CPU_AVR_XMEGA_A3    0
00601         #define CPU_AVR_XMEGA_A1    0
00602     #elif defined(CPU_AVR_XMEGA)
00603         #define CPU_AVR_MEGA        0
00604         #if CPU_AVR_XMEGA_D4 + CPU_AVR_XMEGA_D3 + CPU_AVR_XMEGA_A4 \
00605           + CPU_AVR_XMEGA_A3 + CPU_AVR_XMEGA_A1 != 1
00606             #error AVR XMEGA CPU Configuration error
00607         #endif
00608     #endif
00609 
00610     #if CPU_AVR_MEGA + CPU_AVR_XMEGA != 1
00611         #error AVR CPU configuration error
00612     #endif
00613 
00614 #else
00615     #define CPU_AVR                 0
00616     #define CPU_AVR_MEGA            0
00617     #define CPU_AVR_ATMEGA8         0
00618     #define CPU_AVR_ATMEGA88P       0
00619     #define CPU_AVR_ATMEGA168       0
00620     #define CPU_AVR_ATMEGA328P      0
00621     #define CPU_AVR_ATMEGA32        0
00622     #define CPU_AVR_ATMEGA64        0
00623     #define CPU_AVR_ATMEGA324P      0
00624     #define CPU_AVR_ATMEGA644P      0
00625     #define CPU_AVR_ATMEGA103       0
00626     #define CPU_AVR_ATMEGA128       0
00627     #define CPU_AVR_ATMEGA1281      0
00628     #define CPU_AVR_ATMEGA1280      0
00629     #define CPU_AVR_ATMEGA2560      0
00630     #define CPU_AVR_XMEGA           0
00631     #define CPU_AVR_XMEGA_D4        0
00632     #define CPU_AVR_XMEGA_D3        0
00633     #define CPU_AVR_XMEGA_A4        0
00634     #define CPU_AVR_XMEGA_A3        0
00635     #define CPU_AVR_XMEGA_A1        0
00636     #define CPU_AVR_ATXMEGA128A1    0
00637     #define CPU_AVR_ATXMEGA64A3     0
00638     #define CPU_AVR_XTMEGA32A4      0
00639     #define CPU_AVR_ATXMEGA32D4     0
00640 #endif
00641 
00642 #if defined (__MSP430__)
00643     #define CPU_MSP430              1
00644     #define CPU_ID                  msp430
00645     #define CPU_CORE_NAME           "MSP430"
00646 
00647     #if defined(__MSP430F2274__)
00648         #define CPU_MSP430F2274     1
00649         #define CPU_NAME            "MSP430F2274"
00650     #else
00651         #define CPU_MSP430F2274     0
00652     #endif
00653 
00654     #if defined(__MSP430G2231__)
00655         #define CPU_MSP430G2231     1
00656         #define CPU_NAME            "MSP430G2231"
00657     #else
00658         #define CPU_MSP430G2231     0
00659     #endif
00660 
00661     #if CPU_MSP430F2274 + CPU_MSP430G2231 != 1
00662         #error MSP430 CPU configuration error
00663     #endif
00664 #else
00665     #define CPU_MSP430                  0
00666     #define CPU_MSP430F2274             0
00667     #define CPU_MSP430G2231             0
00668 #endif
00669 
00670
00671 /* Self-check for the detection: only one CPU must be detected */
00672 #if CPU_ARM + CPU_CM3 + CPU_I196 + CPU_X86 + CPU_PPC + CPU_DSP56K + CPU_AVR + CPU_MSP430 == 0
00673     #error Unknown CPU
00674 #elif !defined(CPU_ID)
00675     #error CPU_ID not defined
00676 #elif CPU_ARM + CPU_CM3 + CPU_I196 + CPU_X86 + CPU_PPC + CPU_DSP56K + CPU_AVR + CPU_MSP430 != 1
00677     #error Internal CPU configuration error
00678 #endif
00679 
00680
00681 #endif /* CPU_DETECT_H */