test

Committer:
elijahsj
Date:
Mon Nov 09 00:33:19 2020 -0500
Revision:
2:4364577b5ad8
Parent:
1:8a094db1347f
copied mbed library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elijahsj 1:8a094db1347f 1 /* mbed Microcontroller Library
elijahsj 1:8a094db1347f 2 * Copyright (c) 2015-2016 Nuvoton
elijahsj 1:8a094db1347f 3 *
elijahsj 1:8a094db1347f 4 * Licensed under the Apache License, Version 2.0 (the "License");
elijahsj 1:8a094db1347f 5 * you may not use this file except in compliance with the License.
elijahsj 1:8a094db1347f 6 * You may obtain a copy of the License at
elijahsj 1:8a094db1347f 7 *
elijahsj 1:8a094db1347f 8 * http://www.apache.org/licenses/LICENSE-2.0
elijahsj 1:8a094db1347f 9 *
elijahsj 1:8a094db1347f 10 * Unless required by applicable law or agreed to in writing, software
elijahsj 1:8a094db1347f 11 * distributed under the License is distributed on an "AS IS" BASIS,
elijahsj 1:8a094db1347f 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
elijahsj 1:8a094db1347f 13 * See the License for the specific language governing permissions and
elijahsj 1:8a094db1347f 14 * limitations under the License.
elijahsj 1:8a094db1347f 15 */
elijahsj 1:8a094db1347f 16
elijahsj 1:8a094db1347f 17 #include "mbed_assert.h"
elijahsj 1:8a094db1347f 18 #include "PinNames.h"
elijahsj 1:8a094db1347f 19 #include "nu_miscutil.h"
elijahsj 1:8a094db1347f 20
elijahsj 1:8a094db1347f 21 void nu_nop(uint32_t n)
elijahsj 1:8a094db1347f 22 {
elijahsj 1:8a094db1347f 23 uint32_t times = n / 10;
elijahsj 1:8a094db1347f 24 uint32_t rmn = n % 10;
elijahsj 1:8a094db1347f 25
elijahsj 1:8a094db1347f 26 while (times --) {
elijahsj 1:8a094db1347f 27 __NOP();
elijahsj 1:8a094db1347f 28 __NOP();
elijahsj 1:8a094db1347f 29 __NOP();
elijahsj 1:8a094db1347f 30 __NOP();
elijahsj 1:8a094db1347f 31 __NOP();
elijahsj 1:8a094db1347f 32 __NOP();
elijahsj 1:8a094db1347f 33 __NOP();
elijahsj 1:8a094db1347f 34 __NOP();
elijahsj 1:8a094db1347f 35 __NOP();
elijahsj 1:8a094db1347f 36 __NOP();
elijahsj 1:8a094db1347f 37 }
elijahsj 1:8a094db1347f 38
elijahsj 1:8a094db1347f 39 switch (rmn) {
elijahsj 1:8a094db1347f 40 case 9:
elijahsj 1:8a094db1347f 41 __NOP();
elijahsj 1:8a094db1347f 42 case 8:
elijahsj 1:8a094db1347f 43 __NOP();
elijahsj 1:8a094db1347f 44 case 7:
elijahsj 1:8a094db1347f 45 __NOP();
elijahsj 1:8a094db1347f 46 case 6:
elijahsj 1:8a094db1347f 47 __NOP();
elijahsj 1:8a094db1347f 48 case 5:
elijahsj 1:8a094db1347f 49 __NOP();
elijahsj 1:8a094db1347f 50 case 4:
elijahsj 1:8a094db1347f 51 __NOP();
elijahsj 1:8a094db1347f 52 case 3:
elijahsj 1:8a094db1347f 53 __NOP();
elijahsj 1:8a094db1347f 54 case 2:
elijahsj 1:8a094db1347f 55 __NOP();
elijahsj 1:8a094db1347f 56 case 1:
elijahsj 1:8a094db1347f 57 __NOP();
elijahsj 1:8a094db1347f 58 default:
elijahsj 1:8a094db1347f 59 break;
elijahsj 1:8a094db1347f 60 }
elijahsj 1:8a094db1347f 61 }