cancel
Showing results for 
Search instead for 
Did you mean: 

time management stm32l discovery

simval986
Associate II
Posted on July 29, 2014 at 18:45

Hi 

I am working for

a project with

the

stm32ldiscovery

but

I have a problem

:

the Delay function

that

I implemented

in my program

is not working

void Delay(uint32_t nTime) {

TimingDelay = nTime;

while (TimingDelay != 0);

}

void TimingDelay_Decrement(void) {

if (TimingDelay !=0x00) {

TimingDelay--;

    }

}

Certainly

omit

some

initialization operation

necessary

for

its proper functioning

Can anyone

help me?

Thank you

.

2 REPLIES 2
Posted on July 29, 2014 at 18:59

Certainly

omit

some

initialization operation

necessary

for

its proper functioning

Can anyone

help me?

Thank you

.

 

So did you implement a SysTick interrupt calling the function, and configure the SysTick?

The variable would need to be volatile, and the delay wouldn't be interrupt safe.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
simval986
Associate II
Posted on July 30, 2014 at 14:27

Hi clive1

, thanks for

your

interest

.

I solved the

problem.

I do not know

why in

 

the file

stm32l1xx_it.h

was

commented

the line of code

that did not allow

the operation of the

Delay function

.

practically

:

void SysTick_Handler(void)

 

{

 

    //TimingDelay_Decrement();

 

}