system_ARMCM0plus.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**************************************************************************//**
  2. * @file system_ARMCM0plus.c
  3. * @brief CMSIS Device System Source File for
  4. * ARMCM0plus Device
  5. * @version V1.0.0
  6. * @date 09. July 2018
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
  10. *
  11. * SPDX-License-Identifier: Apache-2.0
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the License); you may
  14. * not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  21. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. */
  25. #include "ARMCM0plus.h"
  26. /*----------------------------------------------------------------------------
  27. Define clocks
  28. *----------------------------------------------------------------------------*/
  29. #define XTAL (50000000UL) /* Oscillator frequency */
  30. #define SYSTEM_CLOCK (XTAL / 2U)
  31. /*----------------------------------------------------------------------------
  32. System Core Clock Variable
  33. *----------------------------------------------------------------------------*/
  34. uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Core Clock Frequency */
  35. /*----------------------------------------------------------------------------
  36. System Core Clock update function
  37. *----------------------------------------------------------------------------*/
  38. void SystemCoreClockUpdate (void)
  39. {
  40. SystemCoreClock = SYSTEM_CLOCK;
  41. }
  42. /*----------------------------------------------------------------------------
  43. System initialization function
  44. *----------------------------------------------------------------------------*/
  45. void SystemInit (void)
  46. {
  47. #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
  48. SCB->VTOR = (uint32_t) &(__VECTOR_TABLE);
  49. #endif
  50. SystemCoreClock = SYSTEM_CLOCK;
  51. }