X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fperformance_test.c;h=ad745fc4c96a0b6480bb25fb563500f911040689;hb=52ec168ece9d61bd9cb652235dfe8faee6232a11;hp=04a26bd0f34154404fe0efb42d900ca9880d2322;hpb=2159c273c9d3361571a6ff1ab63d9bc76582fbab;p=avr-crypto-lib.git diff --git a/test_src/performance_test.c b/test_src/performance_test.c index 04a26bd..ad745fc 100644 --- a/test_src/performance_test.c +++ b/test_src/performance_test.c @@ -1,6 +1,6 @@ /* performance_test.c */ /* - This file is part of the Crypto-avr-lib/microcrypt-lib. + This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -31,7 +31,7 @@ #include #include #include -#include "uart.h" +#include "cli.h" #include "performance_test.h" @@ -51,13 +51,13 @@ ISR(TIMER1_OVF_vect){ } void calibrateTimer(void){ + volatile uint8_t i; startTimer(1); stopTimer(); const_overhead = TCNT1; startTimer(1); TCNT1=0xFFFE; - ; ; ; ; -// asm volatile("NOP\n"::); asm volatile("NOP\n"::); + i++; stopTimer(); int_overhead = TCNT1; } @@ -89,24 +89,24 @@ void getOverhead(uint16_t* constoh, uint16_t* intoh){ void print_time_P(PGM_P s, uint64_t t){ char sv[16]; uint8_t c; - uart_putstr_P(PSTR("\r\n")); - uart_putstr_P(s); + cli_putstr_P(PSTR("\r\n")); + cli_putstr_P(s); ultoa((unsigned long)t, sv, 10); for(c=strlen(sv); c<11; ++c){ - uart_putc(' '); + cli_putc(' '); } - uart_putstr(sv); + cli_putstr(sv); } void print_overhead(void){ char str[16]; - uart_putstr_P(PSTR("\r\n\r\n=== benchmark ===")); + cli_putstr_P(PSTR("\r\n\r\n=== benchmark ===")); utoa(const_overhead, str, 10); - uart_putstr_P(PSTR("\r\n\tconst overhead: ")); - uart_putstr(str); + cli_putstr_P(PSTR("\r\n\tconst overhead: ")); + cli_putstr(str); utoa(int_overhead, str, 10); - uart_putstr_P(PSTR("\r\n\tinterrupt overhead: ")); - uart_putstr(str); + cli_putstr_P(PSTR("\r\n\tinterrupt overhead: ")); + cli_putstr(str); }