I am trying to define global variable as shown in the printscreen and code bellow,but KEIL says
there is a problem with it ,something about static,what is the meaning? Where did i go wrong defining global variable? Thanks.
^
main.c(6): note: declare 'static' if the function is not intended to be used outside of this translation unit
void sysclockconfig(void)
^
static
main.c(3): warning: no previous extern declaration for non-static variable 'counter' [-Wmissing-variable-declarations]
uint16_t counter;
^
main.c(3): note: declare 'static' if the variable is not intended to be used outside of this translation unit
uint16_t counter;
^
main.c(4): warning: no previous extern declaration for non-static variable 'k' [-Wmissing-variable-declarations]
uint16_t k;
^
main.c(4): note: declare 'static' if the variable is not intended to be used outside of this translation unit
uint16_t k;
^
#include "stm32f407xx.h"
uint16_t counter;
uint16_t k;
void sysclockconfig(void)
{
//ENABLE HSE and wit for it till it becomes ready
RCC->CR|=RCC_CR_HSEON;
while(!(RCC->CR&RCC_CR_HSERDY));
//Power enable
RCC->APB1ENR|=RCC_APB1ENR_PWREN;
//voltage regulator setting
PWR->CR|=PWR_CR_VOS;
//8:14
//Flash control register
FLASH->ACR=FLASH_ACR_ICEN|FLASH_ACR_DCEN|FLASH_ACR_PRFTEN|FLASH_ACR_LATENCY_5WS;
}
int main(void)
{
while(1)
{
}
}