File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 4646#define PORTD_OUTCLR (*(volatile uint32_t *)(PORTD_BASE + 0x14))
4747#define PORTD_OUTCLR_OUT (X ) (1 << (X))
4848
49+ #define LED0_PIN (20)
50+ #define LED1_PIN (25)
51+
4952static void led0_on (void )
5053{
51- PORTD_DIRSET = PORTD_DIRSET_OUT (20 );
52- PORTD_OUTCLR = PORTD_OUTCLR_OUT (20 );
54+ PORTD_DIRSET = PORTD_DIRSET_OUT (LED0_PIN );
55+ PORTD_OUTCLR = PORTD_OUTCLR_OUT (LED0_PIN );
5356}
5457
5558static void led1_on (void )
5659{
57- PORTB_DIRSET = PORTB_DIRSET_OUT (25 );
58- PORTB_OUTCLR = PORTB_OUTCLR_OUT (25 );
60+ PORTB_DIRSET = PORTB_DIRSET_OUT (LED1_PIN );
61+ PORTB_OUTCLR = PORTB_OUTCLR_OUT (LED1_PIN );
5962}
6063
6164void main (void )
Original file line number Diff line number Diff line change 3838#define PORTB_OUTCLR (*(volatile uint32_t *)(PORTB_BASE + 0x14))
3939#define PORTB_OUTCLR_OUT (X ) (1 << (X))
4040
41+ #define LED0_PIN 21
42+ #define LED1_PIN 22
43+
4144static void led0_on (void )
4245{
43- PORTB_DIRSET = PORTB_DIRSET_OUT (21 );
44- PORTB_OUTCLR = PORTB_OUTCLR_OUT (21 );
46+ PORTB_DIRSET = PORTB_DIRSET_OUT (LED0_PIN );
47+ PORTB_OUTCLR = PORTB_OUTCLR_OUT (LED0_PIN );
4548}
4649
4750static void led1_on (void )
4851{
49- PORTB_DIRSET = PORTB_DIRSET_OUT (22 );
50- PORTB_OUTCLR = PORTB_OUTCLR_OUT (22 );
52+ PORTB_DIRSET = PORTB_DIRSET_OUT (LED1_PIN );
53+ PORTB_OUTCLR = PORTB_OUTCLR_OUT (LED1_PIN );
5154}
5255
5356void main (void )
You can’t perform that action at this time.
0 commit comments