Hello. Yesterday as long as I finished working my project worked correctly without building problems. I really dont know why, but today it doesnt. The CWIDE claims the following errors (all related to void fuctions):
| Description | Resource | Path | Location | Type |
| multiple definition of `Cpu_OnNMIINT' | Events.c | /prueba/Sources | line 173 | C/C++ Problem |
| first defined here | Events.c | /prueba | line 68 | C/C++ Problem |
| multiple definition of `ISR_PIT_display' | Events.c | /prueba/Sources | line 131 | C/C++ Problem |
| first defined here | Events.c | /prueba | line 110 | C/C++ Problem |
| multiple definition of `mandar_dato_a_display' | Events.c | /prueba/Sources | line 110 | C/C++ Problem |
| first defined here | Events.c | /prueba | line 131 | C/C++ Problem |
| multiple definition of `seleccionar_display' | Events.c | /prueba/Sources | line 68 | C/C++ Problem |
| mingw32-make: *** [prueba.elf] Error 1 | prueba | | | C/C++ Problem |
| first defined here | Events.c | /prueba | line 173 | C/C++ Problem |
What may be happening?
Events.c :
** Filename : Events.c
** Project : prueba
** Processor : MKE02Z64VLH2
** Component : Events
** Version : Driver 01.00
** Compiler : GNU C Compiler
** Date/Time : 2015-02-23, 10:33, # CodeGen: 0
** Abstract :
** This is user's event module.
** Put your event handler code here.
** Settings :
** Contents :
** Cpu_OnNMIINT - void Cpu_OnNMIINT(void);
**
** ###################################################################*/
/*!
** @file Events.c
** @version 01.00
** @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"
#ifdef __cplusplus
extern "C" {
#endif
/* User includes (#include below this line is not maintained by Processor Expert) */
#include "Cpu.h"
#include "Events.h"
#include "PTD0.h"
#include "BitIoLdd1.h"
#include "PTH0.h"
#include "BitIoLdd2.h"
#include "PTB0.h"
#include "BitIoLdd3.h"
/* Including shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
unsigned int DISPC=0; //variable global para ser utlizada en el ISR del display
unsigned int DISPB[5]= {0x8E,0x3A,0x0A,0x0A,0x3A};
unsigned int numero_display = 0;
int i;
int k;
void seleccionar_display(int numero_display){
| |
| switch (numero_display){ |
| |
| case 0: |
| | PTA0_ClrVal (); |
| | | PTB0_ClrVal (); |
| | | PTB2_ClrVal (); //queremos que se prenda el primer display |
| | break; |
| case 1: |
| | PTA0_SetVal (); |
| | | PTB0_ClrVal (); |
| | | PTB2_ClrVal (); //queremos que se prenda el segundo display |
| | break; |
| case 2: |
| | PTA0_ClrVal (); |
| | | PTB0_SetVal (); |
| | | PTB2_ClrVal (); //queremos que se prenda el tercer display |
| | | break; |
| |
| case 3: |
| | PTA0_SetVal (); |
| | | PTB0_SetVal (); |
| | | PTB2_ClrVal (); //queremos que se prenda el cuarto display | |
| | | break; |
| case 4: |
| | PTA0_ClrVal (); |
| | | PTB0_ClrVal (); |
| | | PTB2_SetVal (); //queremos que se prenda el quinto | | | |
| | |
| | break; |
| default: |
| | PTA0_SetVal (); |
| | | PTB0_SetVal (); |
| | | PTB2_SetVal (); //queremos que se prenda ningun display | | | |
| | | break; | | |
| | | | |
| } |
| |
}
void mandar_dato_a_display(unsigned int dato){
| |
| for(i=0;i<8;i++){ |
| | |
| unsigned char bit_salida = dato & 1; |
dato = dato >> 1;
//mandamos el bit
| |
| if (bit_salida == 0) PTD0_ClrVal (); |
| else | | | | PTD0_SetVal (); |
for(k=0;k<10;k++) //software delay para clock del CD4015
PTH0_SetVal (); //subimos ponemos el clock en alto por un tiempo
PTH0_ClrVal (); //bajamos el clock por un tiempo
for(k=0;k<100;k++) {}
}
void ISR_PIT_display (void){
| |
| Red_SetVal (); |
| Blue_ClrVal(); |
| |
| PTB3_SetVal (); //inicialmente el enable esta en alto |
| unsigned int dato = DISPB [DISPC]; |
| mandar_dato_a_display(dato); |
| seleccionar_display(numero_display); |
| PTB3_ClrVal (); | | | | | | //seteamos el enable en alto para mandar los datos |
| for(k=0;k<1000;k++){} | |
| PTB3_SetVal (); |
| if(numero_display == 5 ) numero_display = 0; |
| else numero_display ++; |
| |
| if(DISPC == 5 ) DISPC = 0; |
| else DISPC ++; |
| | |
}
/*
** ===================================================================
** Event : Cpu_OnNMIINT (module Events)
**
** Component : Cpu [MKE02Z64QH2]
*/
/*!
** @brief
** This event is called when the Non maskable interrupt had
** occurred. This event is automatically enabled when the [NMI
** interrupt] property is set to 'Enabled'.
*/
/* ===================================================================*/
/*
* */
void Cpu_OnNMIINT(void)
{
/* Write your code here ... */
}
/* END Events */
#ifdef __cplusplus
} /* extern "C" */
#endif
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.3 [05.09]
** for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/