X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/b29b333865c98b5e48073731980fa6c3cc58f1eb..55e9aedc2093997a10b00cd31842137c29b4793d:/rtems/gw/cangw/helpers.c diff --git a/rtems/gw/cangw/helpers.c b/rtems/gw/cangw/helpers.c index 117c469..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 @@ -13,40 +11,38 @@ #include #include - #include "helpers.h" #include "gw.h" +#include "load.h" #include #include "networkconfig.h" -extern unsigned long int total_1, total_2, succ_1, succ_2, err_1, err_2; - 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. * @@ -96,8 +92,6 @@ int show_net(int argc, char** argv){ rtems_bsdnet_show_if_stats(); rtems_bsdnet_show_ip_stats(); rtems_bsdnet_show_icmp_stats(); - rtems_bsdnet_show_tcp_stats(); - rtems_bsdnet_show_udp_stats(); rtems_bsdnet_show_mbuf_stats(); rtems_bsdnet_show_inet_routes(); return 0; @@ -112,7 +106,15 @@ int start_net(int argc, char** argv){ return 1; } printf("Success\n"); - printf("About to show routes.\n"); + printf("Found routes.\n"); rtems_bsdnet_show_inet_routes (); return 0; -} \ No newline at end of file +} + +int start_load(int argc, char** argv){ + return start_thread_load(); +} + +int stop_load(int argc, char** argv){ + return end_thread_load(); +}