Skip to content

Commit 1a8ee5b

Browse files
committed
Enable status led?
1 parent 3f8c3a3 commit 1a8ee5b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
#define SFR_P3 0xB0
99

1010
// Pin map:
11-
SBIT(ACTIVE_N, SFR_P3, 2); // ACTIVE_N P3.2 Status LED output (active low)
11+
SBIT(OE_N, SFR_P1, 0); // OE_N P1.0 Enable USB switch output (active low)
1212
SBIT(REBOOT_N, SFR_P1, 5); // REBOOT_N P1.5 Reboot button input (low when pressed)
1313
SBIT(POWER_EN, SFR_P1, 6); // POWER_EN P1.6 Enable power to DUT (active high)
14-
SBIT(OE_N, SFR_P1, 0); // OE_N P1.0 Enable USB switch output (active low)
15-
SBIT(BOOT_EN_N, SFR_P3, 1); // BOOT_EN_N P3.1 Enable DUT boot resistor (active low)
1614
SBIT(SEL, SFR_P3, 0); // SEL P3.0 Select USB switch output (keep low)
15+
SBIT(BOOT_EN_N, SFR_P3, 1); // BOOT_EN_N P3.1 Enable DUT boot resistor (active low)
16+
SBIT(ACTIVE_N, SFR_P3, 2); // ACTIVE_N P3.2 Status LED output (active low)
1717

1818
void hw_init() {
1919
// REBOOT is an input
@@ -31,8 +31,10 @@ void hw_init() {
3131
// Output mode: Pn_MOD_OC = 0, Pn_DIR_PU = 1
3232
P1_MOD_OC = P1_MOD_OC & ~((1<<0) | (1<<6));
3333
P1_DIR_PU = P1_DIR_PU | ((1<<0) | (1<<6));
34-
P3_MOD_OC = P3_MOD_OC & ~((1<<0) | (1<<1));
35-
P3_DIR_PU = P3_DIR_PU | ((1<<0) | (1<<1));
34+
P3_MOD_OC = P3_MOD_OC & ~((1<<2) | (1<<0) | (1<<1));
35+
P3_DIR_PU = P3_DIR_PU | ((1<<2) | (1<<0) | (1<<1));
36+
37+
ACTIVE_N = 0; // Turn on status LED
3638
}
3739

3840
void reboot_sequence() {

0 commit comments

Comments
 (0)