1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include <stdio.h>
#include "systick.h"
#include "i2c.h"
#include "oled_i2c.h"
#include "can_test.h"
int main(){
systick_config();
i2c_init();
oled_init();
oled_clear_all();
oled_show_string(24, 0, (uint8_t *)"CAN Test", 16);
// can_nvic_config();
while(1){
can_loopback_test(); //canշݵIJ
/* ʾԵĽ */
if(can_test_flag == SUCCESS){// ɹ
oled_show_string(2, 2, (uint8_t *)"can test success.", 8); // ʾɹ
}else{ //
oled_show_string(2, 2, (uint8_t *)"can test error. ", 8); // ʾʧ
}
delay_1ms(3000); //ȴ1s
// can_loopback_interr_test();
//
// /* ʾжʽcanյIJԽ */
// if(can_test_flag_interrupt == SUCCESS){// ɹ
// oled_show_string(2, 3, (uint8_t *)"can interrupt test success.", 8); // ʾɹ
// }else{ //
// oled_show_string(2, 3, (uint8_t *)"can interrupt test error.", 8); // ʾʧ
// }
//
// delay_1ms(3000);
}
}
|