main.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2013-2016 ARM Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * ----------------------------------------------------------------------
  19. *
  20. * $Date: 20. May 2015
  21. * $Revision: V1.10
  22. *
  23. * Project: CMSIS-DAP Examples LPC-Link-II
  24. * Title: main.c CMSIS-DAP Main module for LPC-Link-II
  25. *
  26. *---------------------------------------------------------------------------*/
  27. #include "cmsis_os.h"
  28. #include "osObjects.h"
  29. #include "rl_usb.h"
  30. #include "DAP_config.h"
  31. #include "DAP.h"
  32. // Main program
  33. int main (void) {
  34. DAP_Setup(); // DAP Setup
  35. USBD_Initialize(0U); // USB Device Initialization
  36. USBD_Connect(0U); // USB Device Connect
  37. while (!USBD_Configured(0U)); // Wait for USB Device to configure
  38. LED_CONNECTED_OUT(1U); // Turn on Debugger Connected LED
  39. LED_RUNNING_OUT(1U); // Turn on Target Running LED
  40. Delayms(500U); // Wait for 500ms
  41. LED_RUNNING_OUT(0U); // Turn off Target Running LED
  42. LED_CONNECTED_OUT(0U); // Turn off Debugger Connected LED
  43. // Create HID Thread
  44. HID0_ThreadId = osThreadCreate(osThread(HID0_Thread), NULL);
  45. osThreadSetPriority(osThreadGetId(), osPriorityIdle);
  46. for (;;); // Endless Loop
  47. }