我相信我做得对。这是我拥有的源代码。
主.c:
/* ###################################################################
** Filename : main.c
** Project : test
** Processor : MCF51EM256CLL
** Version : Driver 01.00
** Compiler : CodeWarrior ColdFireV1 C Compiler
** Date/Time : 2014-11-19, 17:54, # CodeGen: 0
** Abstract :
** Main module.
** This module contains user's application code.
** Settings :
** Contents :
** No public methods
**
** ###################################################################*/
/*!
** @file main.c
** @version 01.00
** @brief
** Main module.
** This module contains user's application code.
*/
/*!
** @addtogroup main_module main module documentation
** @{
*/
/* MODULE main */
/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h"
#include "Bit1.h"
#include "TI1.h"
/* Include shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
/* User includes (#include below this line is not maintained by Processor Expert) */
void main(void)
{
bool tFlag = FALSE;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
for(;;)
{
if(tFlag == TRUE)
{
Bit1_NegVal();
tFlag = FALSE;
}
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.3 [05.09]
** for the Freescale ColdFireV1 series of microcontrollers.
**
** ###################################################################
*/
和 events.c:
/* ###################################################################
** Filename : Events.c
** Project : test
** Processor : MCF51EM256CLL
** Component : Events
** Version : Driver 01.02
** Compiler : CodeWarrior ColdFireV1 C Compiler
** Date/Time : 2014-11-19, 17:54, # CodeGen: 0
** Abstract :
** This is user's event module.
** Put your event handler code here.
** Settings :
** Contents :
** No public methods
**
** ###################################################################*/
/*!
** @file Events.c
** @version 01.02
** @brief
** This is user's event module.
** Put your event handler code here.
*/
/*!
** @addtogroup Events_module Events module documentation
** @{
*/
/* MODULE Events */
#include "Cpu.h"
#include "Events.h"
/* User includes (#include below this line is not maintained by Processor Expert) */
/*
** ===================================================================
** Event : TI1_OnInterrupt (module Events)
**
** Component : TI1 [TimerInt]
** Description :
** When a timer interrupt occurs this event is called (only
** when the component is enabled - <Enable> and the events are
** enabled - <EnableEvent>). This event is enabled only if a
** <interrupt service/event> is enabled.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void TI1_OnInterrupt(void)
{
extern bool tFlag;
tFlag = TRUE;
}
/* END Events */
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.3 [05.09]
** for the Freescale ColdFireV1 series of microcontrollers.
**
** ###################################################################
*/
我觉得我错过了一些简单的东西。感谢你的回复!