cancel
Showing results for 
Search instead for 
Did you mean: 

USB JoystickMouse Example Question!

tuyenvquang
Associate II
Posted on April 20, 2015 at 04:38

/*******************************************************************************

* Function Name  : PowerOn

* Description    :

* Input          : None.

* Output         : None.

* Return         : USB_SUCCESS.

*******************************************************************************/

RESULT PowerOn(void)

{

#ifndef STM32F10X_CL

  uint16_t wRegVal;

  /*** cable plugged-in ? ***/

  USB_Cable_Config(ENABLE);

  /*** CNTR_PWDN = 0 ***/

  wRegVal = CNTR_FRES;

  _SetCNTR(wRegVal);

  /*** CNTR_FRES = 0 ***/

  wInterrupt_Mask = 0;

  _SetCNTR(wInterrupt_Mask);

  /*** Clear pending interrupts ***/

  _SetISTR(0);

  /*** Set interrupt mask ***/

  wInterrupt_Mask = CNTR_RESETM | CNTR_SUSPM | CNTR_WKUPM;

  _SetCNTR(wInterrupt_Mask);

#endif /* STM32F10X_CL */

  return USB_SUCCESS;

}

Why do we define #if

n

def STM32F10X_CL. It means that when i define STM32F10X_CL, the program will ignore the body of this function, so i wonder how can the program configure USB Power ON for STM32F10X_CL?

0 REPLIES 0