This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC1768

hello
i have found following code to make a delay in my micro
but i can not understand some of the sentences
i am not professional
does any one friend help me?
what is the meaning of {unit32_t},{__INLINE static void Delay (uint32_t dlyTicks)}

#include "LPC17xx.h"
volatile uint32_t msTicks; /* counts 1ms timeTicks */
void SysTick_Handler(void) { msTicks++; /* increment counter necessary in Delay() */
} __INLINE static void Delay (uint32_t dlyTicks) { uint32_t curTicks;

curTicks = msTicks ; while ((msTicks - curTicks) < dlyTicks) ;
} tnx

Parents
  • unit32_t doesn't mean anything. You need to be careful with the spelling of computer symbols.

    uint32_t is a data type for an unsigned integer with a size suitable to store a 32-bit value. Google would have found this answer if you had tried. It would also have told you which header file you need to include.

    Google also help with the concept of inline functions.

    The delay function itself assumes an interrupt handler will update a global variable every one ms. So a delay of x milliseconds can then be created by waiting for the global variable to be incremented x times. This of course ignores the fact that the delay may be up to one sample off, since the increment isn's synchronized with the start of the delay loop.

Reply
  • unit32_t doesn't mean anything. You need to be careful with the spelling of computer symbols.

    uint32_t is a data type for an unsigned integer with a size suitable to store a 32-bit value. Google would have found this answer if you had tried. It would also have told you which header file you need to include.

    Google also help with the concept of inline functions.

    The delay function itself assumes an interrupt handler will update a global variable every one ms. So a delay of x milliseconds can then be created by waiting for the global variable to be incremented x times. This of course ignores the fact that the delay may be up to one sample off, since the increment isn's synchronized with the start of the delay loop.

Children