led blinking project not work

Comments

1 comment

  • Avatar
    Melih

    Hi!

    i solved problem using STARTUP_FROM_RESET define using preprocessor options > preprocessor definitons

    it ok.

     

    now i want to ask one more question

    this is my sample code But it doesnt go to in delayx() function or nCount variable is not working.

    if i use no optimization it works else it doesnt work or  if i use volatile unsigned long nCount it also work so

    how will i use local wariable ?

        while(1)
        {
            GPIO_WriteBit( GPIOA, GPIO_Pin_9, Bit_SET );
            //DelayxMs(1);
            Delayx(1000);
            GPIO_WriteBit( GPIOA, GPIO_Pin_9, Bit_RESET );
            //DelayxMs(10);
            Delayx(5000);
        }

    //////////

    void Delayx( unsigned long nCount )
    {
        for ( ; nCount != 0; nCount-- );
    }

    //////

     

    0
    Comment actions Permalink

Please sign in to leave a comment.