/* Stops the firmware update. This is where the bootloader starts the user program on the target if a valid one is present. After this the connection with the target is severed.  */
static void XcpLoaderStop(void)
/* Stops the firmware update. This is where the bootloader starts the user program on the target if a valid one is present. After this the connection with the target is severed.  */
static void XcpLoaderStop(void)
{
  assert(xcpSettings.transport != NULL);
  if ( (xcpSettings.transport != NULL) && (xcpConnected) )
  {
    if (XcpLoaderSendCmdProgram(0, NULL))
    {
      (void)XcpLoaderSendCmdProgramReset();
    }
    xcpSettings.transport->Disconnect();
    xcpConnected = false;
  }
}