#include <system_def.h>\r
-#include "system.h"\r
-#include "app_def.h"\r
#include <unistd.h>\r
#include <fcntl.h>\r
#include <stdio.h>\r
#include "networkconfig.h" \r
\r
\r
-\r
static rtems_device_major_number mscan_major;\r
static rtems_driver_address_table mscan_driver_table=MSCAN_DRIVER_TABLE_ENTRY;\r
\r
-\r
+/*\r
+* Prints can stats. (Used in debugging)\r
+*/\r
int print_can_totals(int argc, char** argv){\r
- printf("Total 1: %lu, Total 2: %lu\n", total_1, total_2);\r
- printf("Success 1: %lu, Success 2: %lu\n", succ_1, succ_2);\r
- printf("Errors 1: %lu, Errors 2: %lu\n", err_1, err_2);\r
+ printf("Total 1: %"PRIu32", Total 2: %"PRIu32"\n", total_1, total_2);\r
+ printf("Success 1: %"PRIu32", Success 2: %"PRIu32"\n", succ_1, succ_2);\r
+ printf("Errors 1: %"PRIu32", Errors 2: %"PRIu32"\n", err_1, err_2);\r
return 0;\r
}\r
\r
-int print_regs(int argc, char** argv){\r
+/*\r
+* Prints clocks as given by the uboot. (Used in debugging)\r
+*/\r
+int print_clocks(int argc, char** argv){\r
printf("IPB_CLOCK: %lu\n", bsp_uboot_board_info.bi_ipbfreq);\r
printf("XLB_CLOCK: %lu\n", bsp_uboot_board_info.bi_busfreq);\r
printf("G2_CLOCK: %lu\n", bsp_uboot_board_info.bi_intfreq);\r
printf("BAUD: %lu\n", bsp_uboot_board_info.bi_baudrate);\r
- printf("BIT 27 set to 1: 0x%08lx\n", MPC5200_BIT32(27));\r
- printf("GPIO_PCR_CHIP_ALTS_CAN: 0x%08x\n", GPIO_PCR_CHIP_ALTS_CAN); \r
- printf("GPIO_PCR_CHIP_SELECT_1: 0x%08x\n", GPIO_PCR_CHIP_SELECT_1);\r
return 0;\r
}\r
\r
-\r
-\r
/*\r
* Single function to prepare CAN devices for read/write operation.\r
*\r