1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

delete tests/xtimer_shift_on_compare

This commit is contained in:
Joakim Nohlgård 2016-07-05 22:11:44 +02:00
parent 7c70d3bc4f
commit a0fb3b7d91
2 changed files with 0 additions and 92 deletions

View File

@ -1,11 +0,0 @@
APPLICATION = xtimer_shift_on_compare
include ../Makefile.tests_common
BOARD_WHITELIST += msb-430h arduino-mega2560 waspmote-pro
BOARD ?= native
RIOTBASE ?= $(CURDIR)/../..
USEMODULE += xtimer
include $(RIOTBASE)/Makefile.include

View File

@ -1,81 +0,0 @@
/*
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief timer test application
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*
* @}
*/
#include <stdio.h>
#include "xtimer.h"
#include "periph_conf.h"
#define ITERATIONS 128
#define MAXSHIFT 8
static unsigned min[MAXSHIFT];
static unsigned max[MAXSHIFT];
static unsigned avg[MAXSHIFT];
static unsigned total[MAXSHIFT];
int main(void)
{
puts("xtimer_shift_on_compare test application.\n");
printf("trying %u iterations\n", ITERATIONS);
uint32_t a, b;
unsigned i = 0;
for (int shift = 0; shift < MAXSHIFT; shift++) {
min[shift] = (unsigned)0xffffffff;
max[shift] = 0;
total[shift] = 0;
avg[shift] = 0;
for (int j=0; j < ITERATIONS; j++) {
i = 0;
do {
i++;
if (i >= 0xF) {
break;
}
else {
}
a = _lltimer_now() | _high_cnt;
b = _lltimer_now() | _high_cnt;
} while ((a>>shift) != (b>>shift));
min[shift] = i < min[shift] ? i : min[shift];
max[shift] = i > max[shift] ? i : max[shift];
if (i != 0xF) {
total[shift]++;
avg[shift] += i;
}
}
}
for (int i=0; i < MAXSHIFT; i++) {
if (min[i] >= 0xF) {
printf("shift %i is too little.\n", i);
} else {
printf("shift %i min=%u max=%u n_success=%u avg=%u\n", i, min[i], max[i], total[i], avg[i]/total[i]);
}
}
printf("\nTest complete.\n");
return 0;
}