X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/b83118bb4a39f5a8540c1f776e0af0420737afd0..55e9aedc2093997a10b00cd31842137c29b4793d:/rtems/gw/cangw/helpers.c diff --git a/rtems/gw/cangw/helpers.c b/rtems/gw/cangw/helpers.c index c5f9022..d994a55 100644 --- a/rtems/gw/cangw/helpers.c +++ b/rtems/gw/cangw/helpers.c @@ -1,6 +1,4 @@ #include -#include "system.h" -#include "app_def.h" #include #include #include @@ -21,31 +19,30 @@ #include "networkconfig.h" - static rtems_device_major_number mscan_major; static rtems_driver_address_table mscan_driver_table=MSCAN_DRIVER_TABLE_ENTRY; - +/* +* Prints can stats. (Used in debugging) +*/ int print_can_totals(int argc, char** argv){ - printf("Total 1: %lu, Total 2: %lu\n", total_1, total_2); - printf("Success 1: %lu, Success 2: %lu\n", succ_1, succ_2); - printf("Errors 1: %lu, Errors 2: %lu\n", err_1, err_2); + printf("Total 1: %"PRIu32", Total 2: %"PRIu32"\n", total_1, total_2); + printf("Success 1: %"PRIu32", Success 2: %"PRIu32"\n", succ_1, succ_2); + printf("Errors 1: %"PRIu32", Errors 2: %"PRIu32"\n", err_1, err_2); return 0; } -int print_regs(int argc, char** argv){ +/* +* Prints clocks as given by the uboot. (Used in debugging) +*/ +int print_clocks(int argc, char** argv){ printf("IPB_CLOCK: %lu\n", bsp_uboot_board_info.bi_ipbfreq); printf("XLB_CLOCK: %lu\n", bsp_uboot_board_info.bi_busfreq); printf("G2_CLOCK: %lu\n", bsp_uboot_board_info.bi_intfreq); printf("BAUD: %lu\n", bsp_uboot_board_info.bi_baudrate); - printf("BIT 27 set to 1: 0x%08lx\n", MPC5200_BIT32(27)); - printf("GPIO_PCR_CHIP_ALTS_CAN: 0x%08x\n", GPIO_PCR_CHIP_ALTS_CAN); - printf("GPIO_PCR_CHIP_SELECT_1: 0x%08x\n", GPIO_PCR_CHIP_SELECT_1); return 0; } - - /* * Single function to prepare CAN devices for read/write operation. *