Esempio n. 1
0
void usbInit(void) {
    pInformation->Current_Configuration = 0;
    usbPowerOn();

    _SetISTR(0);
    wInterrupt_Mask = ISR_MSK;
    _SetCNTR(wInterrupt_Mask);

    usbEnbISR();
    bDeviceState = UNCONNECTED;
}
Esempio n. 2
0
void usbInit(void) {
  dfuInit();

  pInformation->Current_Configuration = 0;
  usbPowerOn();

  _SetISTR(0);
  wInterrupt_Mask = ISR_MSK;
  _SetCNTR(wInterrupt_Mask);

  usbEnbISR(); /* configure the cortex M3 private peripheral NVIC */
  bDeviceState = UNCONNECTED;
}
Esempio n. 3
0
void dfuUpdateByReset(void) {
  u8 startState = dfuAppStatus.bState;
  userFirmwareLen = 0;

  if (startState == appDETACH) {
    dfuAppStatus.bState = dfuIDLE;
    dfuAppStatus.bStatus = OK;

    nvicDisableInterrupts();
    usbEnbISR();

  } else if (startState == appIDLE || startState == dfuIDLE) {
    /* do nothing...might be normal usb bus activity */
  } else {
    /* we reset from the dfu, reset everything and startover,
       which is the correct operation if this is an erroneous
       event or properly following a MANIFEST */
    dfuAppStatus.bState = dfuIDLE;
    dfuAppStatus.bStatus = OK;

    systemHardReset();
  }
}