Keil

From ElectroDragon
Jump to navigation Jump to search

C51

V960 - http://www.keil.com/fid/vo5mrmwdb3mj1w1x0yw1my5sewliqqd11ijw11/files/eval/c51v960.exe

Configuration

  • preprocessor symbols
  • Optimization
  • One ELF Section per Function: Optimize for redunant libraries
  • C99 Mode

To support chinese

  • edit - configuration
  • encoding change to GB2312

Auto format by Astyle

  • download asytle
  • install: keil - tools - customize tools menu - create new "Astyle Current File"
  • argument add
-pnUk1s4 --style=ansi !E 

or simply !E

Common Error

Error Code Header text Header text
104 MULTIPLE PUBLIC DEFINITIONS
  • 重复定义, 直接include了C文件导致
  • CH559 project, remove compile of DEBUG.C


Example Example Example
Example Example Example
  • GPIO\DEBUG.H(24): error C141: syntax error near 'n', expected ')'

problem find when compile CH559, turn on both

#include "DEBUG.H"
#include "DEBUG.C"
  • GPIO\DEBUG.C(141): error C237: '_mDelaymS': function already has a body

problem find when compile CH559, because turned on #include "GPIO.C"

  • GPIO\main.c(26): warning C206: 'CH559GPIOInterruptInit': missing function-prototype

problem find when compile CH559, function is not declare: void CH559GPIOInterruptInit();