File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
libraries/tests/mbed/vtor_reloc Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ static uint32_t int_table[NUM_VECTORS];
18
18
19
19
void flipper () {
20
20
for (int i = 0 ; i < 5 ; i++) {
21
- out = 1 ; wait (0.2 );
22
- out = 0 ; wait (0.2 );
21
+ out = 1 ;
22
+ wait (0.2 );
23
+ out = 0 ;
24
+ wait (0.2 );
23
25
}
24
26
}
25
27
@@ -30,31 +32,30 @@ void in_handler() {
30
32
31
33
static bool test_once () {
32
34
InterruptIn in (PIN_IN);
33
-
34
35
checks = 0 ;
35
- printf (" Interrupt table location: 0x%08X\r\n " , SCB->VTOR );
36
+ printf (" Interrupt table location: 0x%08X\r\n " , SCB->VTOR );
36
37
in.rise (NULL );
37
38
in.fall (in_handler);
38
39
flipper ();
39
40
in.fall (NULL );
40
- if (checks != 5 ) {
41
- printf (" Test failed.\r\n " );
42
- return false ;
43
- }
44
- printf (" Test passed.\r\n " );
45
- return true ;
41
+ bool result = (checks == 5 );
42
+ printf (result ? " Test passed.\r\n " : " Test failed.\r\n " );
43
+ return result;
46
44
}
47
45
48
46
int main () {
49
47
printf (" Starting first test (interrupts not relocated).\r\n " );
50
- if (!test_once ())
48
+ if (!test_once ()) {
51
49
notify_completion (false );
50
+ return 1 ;
51
+ }
52
52
53
53
// Relocate interrupt table and test again
54
54
memcpy (int_table, (void *)SCB->VTOR , sizeof (int_table));
55
55
SCB->VTOR = (uint32_t )int_table;
56
56
printf (" Starting second test (interrupts relocated).\r\n " );
57
57
58
- notify_completion (test_once ());
58
+ notify_completion (test_once ());
59
+ return 0 ;
59
60
}
60
61
Original file line number Diff line number Diff line change 183
183
"id" : "MBED_A18" , "description" : "Interrupt vector relocation" ,
184
184
"source_dir" : join (TEST_DIR , "mbed" , "vtor_reloc" ),
185
185
"dependencies" : [MBED_LIBRARIES , TEST_MBED_LIB ,],
186
- "mcu" : ["LPC1768" ]
186
+ "mcu" : ["LPC1768" ],
187
+ "automated" : True ,
187
188
},
188
189
{
189
190
"id" : "MBED_A19" , "description" : "I2C EEPROM read/write test" ,
You can’t perform that action at this time.
0 commit comments