Skip to main content
simval986
Associate II
July 29, 2014
Question

time management stm32l discovery

  • July 29, 2014
  • 2 replies
  • 620 views
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

.

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    July 29, 2014
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    simval986
    simval986Author
    Associate II
    July 30, 2014
    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();

     

    }