AnsweredAssumed Answered

Blinking LED on KL25Z - KDS

Question asked by wojciech22a on Jul 28, 2015
Latest reply on Jul 28, 2015 by Earl Orlando Ramirez Sanchez

I wrote a program for blinking LED. The program does not work:

#include "Cpu.h"

#include "Events.h"

//#include "Bit.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"

void opz(int ile)

{

  int p;

  for(p=0;p<ile;p++)

  {

 

  }

}

void ledkonf(void)

{

  PORTB_PCR18=PORTB_PCR18 &~(1<<10) &~(1<<9) | (1<<8);

  GPIOB_PDDR=GPIOB_PDDR | (1<<18);

}

void swiec(void)

{

   opz(100000);

   GPIOB_PDOR=GPIOB_PDOR|(1<<18);

   opz(100000);

   GPIOB_PTOR=GPIOB_PTOR|(1<<18);

   opz(100000);

}

int main(void)

{

#ifdef PEX_RTOS_START

    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */

#endif

   ledkonf();

  for(;;){

   swiec();

  }

}

But when I added element BitIO_LDD in the Processor Expert, the program works, and the only new element of the program is generated file Bit.h. When I create a project without Processor Expert, the program does not work either. Why is it like that? Please help!

Outcomes