Unsigned arguments for print_dec()

Patch by Larry Doolittle
This commit is contained in:
Clifford Wolf 2015-07-02 10:46:21 +02:00
parent a7f9b7fbf3
commit 084056f729
4 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ uint32_t *irq(uint32_t *regs, uint32_t irqs);
// print.c
void print_chr(char ch);
void print_str(const char *p);
void print_dec(int val);
void print_dec(unsigned int val);
void print_hex(unsigned int val);
// sieve.c

View File

@ -9,9 +9,9 @@
uint32_t *irq(uint32_t *regs, uint32_t irqs)
{
static int ext_irq_4_count = 0;
static int ext_irq_5_count = 0;
static int timer_irq_count = 0;
static unsigned int ext_irq_4_count = 0;
static unsigned int ext_irq_5_count = 0;
static unsigned int timer_irq_count = 0;
if ((irqs & (1<<4)) != 0) {
ext_irq_4_count++;

View File

@ -20,7 +20,7 @@ void print_str(const char *p)
*((volatile uint32_t*)OUTPORT) = *(p++);
}
void print_dec(int val)
void print_dec(unsigned int val)
{
char buffer[10];
char *p = buffer;

View File

@ -7,7 +7,7 @@
#include "firmware.h"
static void stats_print_dec(int val, int digits, bool zero_pad)
static void stats_print_dec(unsigned int val, int digits, bool zero_pad)
{
char buffer[32];
char *p = buffer;
@ -27,7 +27,7 @@ static void stats_print_dec(int val, int digits, bool zero_pad)
void stats()
{
int num_cycles, num_instr;
unsigned int num_cycles, num_instr;
asm("rdcycle %0; rdinstret %1;" : "=r"(num_cycles), "=r"(num_instr));
print_str("Cycle counter ........");
stats_print_dec(num_cycles, 8, false);