Skip to content

Commit d58aa14

Browse files
author
Per Mårtensson
committed
Added an extra device for shugart bus handle with pin 6
1 parent 7251d36 commit d58aa14

4 files changed

Lines changed: 56 additions & 15 deletions

File tree

src/floppy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static struct unit {
4343
bool_t initialised;
4444
bool_t is_flippy;
4545
bool_t motor;
46-
} unit[3];
46+
} unit[4];
4747

4848
static struct gw_delay delay_params;
4949
static const struct gw_delay factory_delay_params = {
@@ -197,6 +197,7 @@ static void drive_deselect(void)
197197
case 0: pin = 10; break;
198198
case 1: pin = 12; break;
199199
case 2: pin = 14; break;
200+
case 3: pin = 6; break;
200201
}
201202
break;
202203
}
@@ -230,6 +231,7 @@ static uint8_t drive_select(uint8_t nr)
230231
case 0: pin = 10; break;
231232
case 1: pin = 12; break;
232233
case 2: pin = 14; break;
234+
case 3: pin = 6; break;
233235
default: return ACK_BAD_UNIT;
234236
}
235237
break;
@@ -264,7 +266,7 @@ static uint8_t drive_motor(uint8_t nr, bool_t on)
264266
}
265267
break;
266268
case BUS_SHUGART:
267-
if (nr >= 3)
269+
if (nr >= 4)
268270
return ACK_BAD_UNIT;
269271
/* All shugart units share one motor line. Alias them all to unit 0. */
270272
nr = 0;
@@ -305,7 +307,7 @@ static uint8_t drive_get_info(int nr, struct gw_drive_info *d)
305307
return ACK_BAD_UNIT;
306308
break;
307309
case BUS_SHUGART:
308-
if (nr >= 3)
310+
if (nr >= 4)
309311
return ACK_BAD_UNIT;
310312
break;
311313
default:

src/mcu/at32f4/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const static struct core_floppy_pins _core_floppy_pins_v4 = {
2424
};
2525

2626
const static struct pin_mapping _msel_pins_v4[] = {
27+
{ 6, _A, 7 },
2728
{ 10, _A, 3 },
2829
{ 12, _B, 9 },
2930
{ 14, _A, 4 },
@@ -34,7 +35,6 @@ const static struct pin_mapping _msel_pins_v4[] = {
3435
const static struct pin_mapping _user_pins_v4[] = {
3536
{ 2, _A, 6 },
3637
{ 4, _A, 5 },
37-
{ 6, _A, 7 },
3838
{ 0, 0, 0 }
3939
};
4040

src/mcu/stm32f1/board.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const static struct pin_mapping _msel_pins_std[] = {
1919
};
2020

2121
const static struct pin_mapping _msel_pins_f1_plus[] = {
22+
{ 6, _A, 1 },
2223
{ 10, _B, 11 },
2324
{ 12, _B, 0 },
2425
{ 14, _B, 10 },
@@ -32,12 +33,10 @@ const static struct pin_mapping _user_pins_std[] = {
3233
const static struct pin_mapping _user_pins_f1_plus[] = {
3334
{ 2, _B, 9, _PP },
3435
{ 4, _A, 3, _PP },
35-
{ 6, _A, 1, _PP },
3636
{ 0, 0, 0, _PP } };
3737
const static struct pin_mapping _user_pins_f1_plus_unbuffered[] = {
3838
{ 2, _B, 9, _OD },
3939
{ 4, _A, 3, _OD },
40-
{ 6, _A, 1, _OD },
4140
{ 0, 0, 0, _OD } };
4241

4342
const static struct board_config _board_config[] = {

src/mcu/stm32f7/board.c

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,51 @@ const static struct pin_mapping _msel_pins_std[] = {
2020
{ 0, 0, 0 }
2121
};
2222

23+
const static struct pin_mapping _msel_pins_F7SM_lightning_plus[] = {
24+
{ 6, _E, 14 },
25+
{ 10, _B, 1 },
26+
{ 12, _B, 0 },
27+
{ 14, _B, 11 },
28+
{ 16, _B, 10 },
29+
{ 0, 0, 0 }
30+
};
31+
32+
const static struct pin_mapping _msel_pins_F7SM_v2[] = {
33+
{ 6, _C, 7 },
34+
{ 10, _B, 1 },
35+
{ 12, _B, 0 },
36+
{ 14, _B, 11 },
37+
{ 16, _B, 10 },
38+
{ 0, 0, 0 }
39+
};
40+
41+
const static struct pin_mapping _msel_pins_F7SM_v3[] = {
42+
{ 6, _C, 7 },
43+
{ 10, _B, 1 },
44+
{ 12, _B, 0 },
45+
{ 14, _B, 11 },
46+
{ 16, _B, 10 },
47+
{ 0, 0, 0 }
48+
};
49+
50+
const static struct pin_mapping _msel_pins_F7SM_ant_goffart_f7_plus_v2[] = {
51+
{ 6, _C, 7 },
52+
{ 10, _B, 1 },
53+
{ 12, _B, 0 },
54+
{ 14, _B, 11 },
55+
{ 16, _B, 10 },
56+
{ 0, 0, 0 }
57+
};
58+
59+
const static struct pin_mapping _msel_pins_F7SM_lightning[] = {
60+
{ 6, _E, 14 },
61+
{ 10, _B, 1 },
62+
{ 12, _B, 0 },
63+
{ 14, _B, 11 },
64+
{ 16, _B, 10 },
65+
{ 0, 0, 0 }
66+
};
67+
2368
const static struct pin_mapping _msel_pins_f7_slim[] = {
2469
{ 10, _B, 1 },
2570
{ 14, _B, 11 },
@@ -36,29 +81,24 @@ const static struct pin_mapping _user_pins_F7SM_ant_goffart_f7_plus_v1[] = {
3681
const static struct pin_mapping _user_pins_F7SM_lightning[] = {
3782
{ 2, _B, 12, _PP },
3883
{ 4, _E, 15, _PP },
39-
{ 6, _E, 14, _PP },
4084
{ 0, 0, 0, _PP } };
4185
const static struct pin_mapping _user_pins_F7SM_v2[] = {
4286
{ 2, _B, 12, _OD },
4387
{ 4, _C, 8, _OD },
44-
{ 6, _C, 7, _OD },
4588
{ 0, 0, 0, _OD } };
4689
const static struct pin_mapping _user_pins_F7SM_ant_goffart_f7_plus_v2[] = {
4790
{ 2, _B, 12, _PP },
4891
{ 4, _C, 8, _PP },
49-
{ 6, _C, 7, _PP },
5092
{ 0, 0, 0, _PP } };
5193
const static struct pin_mapping _user_pins_F7SM_lightning_plus[] = {
5294
{ 2, _B, 12, _PP },
5395
{ 4, _E, 15, _PP },
54-
{ 6, _E, 14, _PP },
5596
{ 0, 0, 0, _PP } };
5697
const static struct pin_mapping _user_pins_F7SM_slim[] = {
5798
{ 0, 0, 0, _PP } };
5899
const static struct pin_mapping _user_pins_F7SM_v3[] = {
59100
{ 2, _B, 12, _PP },
60101
{ 4, _C, 8, _PP },
61-
{ 6, _C, 7, _PP },
62102
{ 0, 0, 0, _PP } };
63103
const static struct board_config _board_config[] = {
64104
[F7SM_v1] = {
@@ -73,11 +113,11 @@ const static struct board_config _board_config[] = {
73113
.hse_mhz = 16,
74114
.hs_usb = TRUE,
75115
.user_pins = _user_pins_F7SM_lightning,
76-
.msel_pins = _msel_pins_std },
116+
.msel_pins = _msel_pins_F7SM_lightning },
77117
[F7SM_v2] = {
78118
.hse_mhz = 8,
79119
.user_pins = _user_pins_F7SM_v2,
80-
.msel_pins = _msel_pins_std },
120+
.msel_pins = _msel_pins_F7SM_v2 },
81121
[F7SM_ant_goffart_f7_plus_v2] = {
82122
.hse_mhz = 8,
83123
.user_pins = _user_pins_F7SM_ant_goffart_f7_plus_v2,
@@ -88,7 +128,7 @@ const static struct board_config _board_config[] = {
88128
.hs_usb = TRUE,
89129
.flippy = TRUE,
90130
.user_pins = _user_pins_F7SM_lightning_plus,
91-
.msel_pins = _msel_pins_std },
131+
.msel_pins = _msel_pins_F7SM_lightning_plus },
92132
[F7SM_slim] = {
93133
.hse_mhz = 16,
94134
.hse_byp = TRUE,
@@ -98,7 +138,7 @@ const static struct board_config _board_config[] = {
98138
.hse_mhz = 8,
99139
.flippy = TRUE,
100140
.user_pins = _user_pins_F7SM_v3,
101-
.msel_pins = _msel_pins_std },
141+
.msel_pins = _msel_pins_F7SM_v3 },
102142
};
103143

104144
/* Blink the activity LED to indicate fatal error. */

0 commit comments

Comments
 (0)