我已经把前两个写出来了,后面的不知道怎么写,版主能否给个大致处理流程和方向。我据此在编写程序。
/** ###################################################################
** Filename : Events.C
** Project : MotorCan
** Processor : MC9S12DP256BCPV
** Beantype : Events
** Version : Driver 01.01
** Compiler : Metrowerks HC12 C Compiler
** Date/Time : 2007-4-17, 18:51
** Abstract :
** This is user's event module.
** Put your event handler code here.
** Settings :
** Contents :
** CAN1_OnFullRxBuffer - void CAN1_OnFullRxBuffer(void);
**
** (c) Copyright UNIS, spol. s r.o. 1997-2002
** UNIS, spol. s r.o.
** Jundrovska 33
** 624 00 Brno
** Czech Republic
** http : www.processorexpert.com
** mail : info@processorexpert.com
** ###################################################################*/
/* MODULE Events */
/*Including used modules for compilling procedure*/
#include "Cpu.h"
#include "Events.h"
#include "CAN1.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"
/*
** ===================================================================
** Event : CAN1_OnFullRxBuffer (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called when receive buffer is full after
** successful reception of a message.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnFullRxBuffer(void)
{
/* Write your code here ... */
}
/*
** ===================================================================
** Event : CAN1_OnFreeTxBuffer (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called after successful transmision of a
** message.
** Parameters :
** NAME - DESCRIPTION
** BufferNum - transmitted buffer
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnFreeTxBuffer(byte BufferNum)
{
/* Write your code here ... */
}
/*
** ===================================================================
** Event : CAN1_OnTransmitterErrorPassive (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called when the CAN controller goes into
** error passive status due to the transmit error counter
** exceeding 127 and BusOff status is not present
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnTransmitterErrorPassive(void)
{
/* Write your code here ... */
}
/*
** ===================================================================
** Event : CAN1_OnReceiverErrorPassive (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called when the CAN controller goes into
** error passive status due to the receive error counter
** exceeding 127 and BusOff status is not present
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnReceiverErrorPassive(void)
{
/* Write your code here ... */
}
/*
** ===================================================================
** Event : CAN1_OnOverrun (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called when receive buffer has overrun.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnOverrun(void)
{
/* Write your code here ... */
}
/*
** ===================================================================
** Event : CAN1_OnTransmitterWarning (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called when the CAN controller goes into
** warning status due to the transmit error counter
** exceeding 96 and neither one error status or BusOff
** status is not present
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnTransmitterWarning(void)
{
/* Write your code here ... */
}
/*
** ===================================================================
** Event : CAN1_OnReceiverWarning (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called when the CAN controller goes into
** warning status due to the receive error counter exceeding
** 96 and neither one error status or BusOff status is not
** present
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnReceiverWarning(void)
{
/* Write your code here ... */
}
/*
** ===================================================================
** Event : CAN1_OnError (module Events)
**
** From bean : CAN1 [MotorolaCAN]
** Description :
** This event is called when a channel error (not the error
** returned by a given method) occurs. The errors can be
** read using method.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void CAN1_OnError(void)
{
/* Write your code here ... */
}
/* END Events */
/*
** ###################################################################
**
** This file was created by UNIS Processor Expert 03.33 for
** the Motorola HCS12 series of microcontrollers.
**
** ###################################################################
*/ |