File tree Expand file tree Collapse file tree 3 files changed +5
-23
lines changed
cmsis/TARGET_NXP/TARGET_LPC11XX
hal/TARGET_NXP/TARGET_LPC11XX Expand file tree Collapse file tree 3 files changed +5
-23
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,6 @@ void wait_ms(int ms) {
25
25
}
26
26
27
27
void wait_us (int us ) {
28
- printf ("Here!\r\n" );
29
28
uint32_t start = us_ticker_read ();
30
- printf ("next\r\n" );
31
29
while ((us_ticker_read () - start ) < us );
32
- printf ("End\r\n" );
33
30
}
Original file line number Diff line number Diff line change 31
31
#define NVIC_RAM_VECTOR_ADDRESS (0x10000000) // Vectors positioned at start of RAM
32
32
33
33
void NVIC_SetVector (IRQn_Type IRQn , uint32_t vector ) {
34
- printf ("X\r\n" );
35
34
int i ;
36
- printf ("0a\r\n" );
37
35
// Space for dynamic vectors, initialised to allocate in R/W
38
36
static volatile uint32_t * vectors = (uint32_t * )NVIC_RAM_VECTOR_ADDRESS ;
39
- printf ( "1a\r\n" );
37
+
40
38
// Copy and switch to dynamic vectors if first time called
41
39
if ((LPC_SYSCON -> SYSMEMREMAP & 0x3 ) != 0x1 ) {
42
- printf ("2a\r\n" );
43
40
uint32_t * old_vectors = (uint32_t * )0 ; // FLASH vectors are at 0x0
44
- printf ("Old_vectors: %i\r\n" , old_vectors );
45
41
for (i = 0 ; i < NVIC_NUM_VECTORS ; i ++ ) {
46
- printf ("3a\r\n" );
47
42
vectors [i ] = old_vectors [i ];
48
43
}
49
- printf ("4a\r\n" );
50
44
LPC_SYSCON -> SYSMEMREMAP = 0x1 ; // Remaps 0x0-0x1FF FLASH block to RAM block
51
45
}
52
- printf ( "5a\r\n" );
46
+
53
47
// Set the vector
54
48
vectors [IRQn + 16 ] = vector ;
55
49
}
Original file line number Diff line number Diff line change 23
23
int us_ticker_inited = 0 ;
24
24
25
25
void us_ticker_init (void ) {
26
- printf ("0\r\n" );
27
-
28
26
if (us_ticker_inited ) return ;
29
27
us_ticker_inited = 1 ;
30
28
31
- printf ("1\r\n" );
32
29
LPC_SYSCON -> SYSAHBCLKCTRL |= (1 <<10 ); // Clock TIMER_1
33
- printf ("2\r\n" );
34
30
uint32_t PCLK = SystemCoreClock ;
35
- printf ( "3\r\n" );
31
+
36
32
US_TICKER_TIMER -> TCR = 0x2 ; // reset
37
- printf ( "4\r\n" );
33
+
38
34
uint32_t prescale = PCLK / 1000000 ; // default to 1MHz (1 us ticks)
39
- printf ("5\r\n" );
40
35
US_TICKER_TIMER -> PR = prescale - 1 ;
41
- printf ("6\r\n" );
42
36
US_TICKER_TIMER -> TCR = 1 ; // enable = 1, reset = 0
43
- printf ( "7\r\n" );
37
+
44
38
NVIC_SetVector (US_TICKER_TIMER_IRQn , (uint32_t )us_ticker_irq_handler );
45
- printf ("8\r\n" );
46
39
NVIC_EnableIRQ (US_TICKER_TIMER_IRQn );
47
40
}
48
41
49
42
uint32_t us_ticker_read () {
50
43
if (!us_ticker_inited )
51
44
us_ticker_init ();
52
45
53
- printf ("Hello!!!\r\n" );
54
-
55
46
return US_TICKER_TIMER -> TC ;
56
47
}
57
48
You can’t perform that action at this time.
0 commit comments