Skip to content

Commit d00361a

Browse files
authored
Unification, part 1: Rename fuji device source code to match class name. (FujiNetWIFI#1050)
Rename fuji device source code to match class name.
1 parent ed96d7e commit d00361a

File tree

130 files changed

+1871
-8065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+1871
-8065
lines changed

coding-standard.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def build_argparser():
7070
group = parser.add_mutually_exclusive_group()
7171
group.add_argument("--fix", action="store_true", help="rewrite improperly formatted files")
7272
group.add_argument("--show", action="store_true", help="print reformatted file on stdout")
73+
group.add_argument("-l", "--list", action="store_true",
74+
help="only print filenames of improperly formatted files")
7375
return parser
7476

7577
class ClangFormatter:
@@ -312,7 +314,8 @@ def displayErrors(self, errs, formatted):
312314

313315
@property
314316
def isClang(self):
315-
return self.path.suffix in ClangFormatter.TYPES
317+
#return self.path.suffix in ClangFormatter.TYPES
318+
return False
316319

317320
@property
318321
def isMakefile(self):
@@ -454,6 +457,7 @@ def main():
454457

455458
doFix = False
456459
doShow = False
460+
doList = False
457461

458462
script_mode = os.path.basename(sys.argv[0])
459463
if script_mode == "pre-commit":
@@ -465,6 +469,7 @@ def main():
465469
else:
466470
doFix = args.fix
467471
doShow = args.show
472+
doList = args.list
468473
to_check = args.file
469474

470475
if doShow and len(to_check) > 1:
@@ -480,7 +485,9 @@ def main():
480485

481486
if TextFile.pathIsText(path):
482487
tfile = TextFile(path, repo.getContents(path))
483-
if doShow:
488+
if doList:
489+
print(tfile.path)
490+
elif doShow:
484491
tfile.show()
485492
elif doFix:
486493
tfile.update()

fujinet_pc.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ if(FUJINET_TARGET STREQUAL "ATARI")
276276
lib/device/sio/printer.h lib/device/sio/printer.cpp
277277
lib/device/sio/printerlist.h lib/device/sio/printerlist.cpp
278278
lib/device/sio/cassette.h lib/device/sio/cassette.cpp
279-
lib/device/sio/fuji.h lib/device/sio/fuji.cpp
279+
lib/device/sio/sioFuji.h lib/device/sio/sioFuji.cpp
280280
lib/device/sio/network.h lib/device/sio/network.cpp
281281
lib/device/sio/udpstream.h lib/device/sio/udpstream.cpp
282282
lib/device/sio/voice.h lib/device/sio/voice.cpp
@@ -336,7 +336,7 @@ if(FUJINET_TARGET STREQUAL "APPLE")
336336
lib/device/iwm/printer.h lib/device/iwm/printer.cpp
337337
lib/device/iwm/printerlist.h lib/device/iwm/printerlist.cpp
338338
lib/device/iwm/modem.h lib/device/iwm/modem.cpp
339-
lib/device/iwm/fuji.h lib/device/iwm/fuji.cpp
339+
lib/device/iwm/iwmFuji.h lib/device/iwm/iwmFuji.cpp
340340
lib/device/iwm/network.h lib/device/iwm/network.cpp
341341
lib/device/iwm/clock.h lib/device/iwm/clock.cpp
342342
lib/device/iwm/cpm.h lib/device/iwm/cpm.cpp
@@ -368,7 +368,7 @@ if(FUJINET_TARGET STREQUAL "COCO")
368368
lib/media/drivewire/mediaTypeMRM.h lib/media/drivewire/mediaTypeMRM.cpp
369369
lib/media/drivewire/mediaTypeVDK.h lib/media/drivewire/mediaTypeVDK.cpp
370370

371-
lib/device/drivewire/fuji.h lib/device/drivewire/fuji.cpp
371+
lib/device/drivewire/drivewireFuji.h lib/device/drivewire/drivewireFuji.cpp
372372
lib/device/drivewire/network.h lib/device/drivewire/network.cpp
373373
lib/device/drivewire/dload.h lib/device/drivewire/dload.cpp
374374
lib/device/drivewire/disk.h lib/device/drivewire/disk.cpp

lib/bus/iec/iec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifdef BUILD_IEC
22

33
#include "iec.h"
4-
#include "../../device/iec/fuji.h"
4+
#include "../../device/iec/iecFuji.h"
55

66
#include <cstring>
77
#include <memory>
@@ -14,8 +14,8 @@
1414
#include "../../include/pinmap.h"
1515
#include "../../hardware/led.h"
1616

17-
#define MAIN_STACKSIZE 32768
18-
#define MAIN_PRIORITY 17
17+
#define MAIN_STACKSIZE 32768
18+
#define MAIN_PRIORITY 17
1919
#define MAIN_CPUAFFINITY 1
2020

2121
systemBus::systemBus() : IECBusHandler(PIN_IEC_ATN, PIN_IEC_CLK_OUT, PIN_IEC_DATA_OUT,
@@ -96,7 +96,7 @@ void systemBus::setup()
9696
void systemBus::service()
9797
{
9898
task();
99-
99+
100100
bool error = false, active = false;
101101
for(int i = 0; i < MAX_DISK_DEVICES; i++)
102102
{

lib/bus/iwm/iwm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "../device/iwm/disk.h"
2222
#include "../device/iwm/disk2.h"
23-
#include "../device/iwm/fuji.h"
23+
#include "../device/iwm/iwmFuji.h"
2424
#include "../device/iwm/cpm.h"
2525
#include "../device/iwm/clock.h"
2626

@@ -630,7 +630,7 @@ bool IRAM_ATTR systemBus::serviceDiskIIWrite()
630630
return false;
631631

632632
Debug_printf("\r\nDisk II iwm queue receive %u %u %u %u",
633-
item.length, item.track_begin, item.track_end, item.track_numbits);
633+
item.length, item.track_begin, item.track_end, item.track_numbits);
634634
// gap 1 = 16 * 10
635635
// sector header = 10 * 8 [D5 AA 96] + 4 + [DE AA EB]
636636
// gap 2 = 7 * 10
@@ -644,7 +644,7 @@ bool IRAM_ATTR systemBus::serviceDiskIIWrite()
644644

645645
bitlen = (item.track_end + item.track_numbits - item.track_begin) % item.track_numbits;
646646
Debug_printf("\r\nDisk II write Qtrack/sector: %i/%i bit_len: %i",
647-
item.quarter_track, sector_num, bitlen);
647+
item.quarter_track, sector_num, bitlen);
648648
if (bitlen) {
649649
decoded = (uint8_t *) malloc(item.length);
650650
decode_len = diskii_xface.iwm_decode_buffer(item.buffer, item.length,

lib/bus/iwm/iwm_ll.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "iwm_ll.h"
1313
#include "iwm.h"
1414
#include "../device/iwm/disk2.h"
15-
#include "../device/iwm/fuji.h"
15+
#include "../device/iwm/iwmFuji.h"
1616
#include "fnSystem.h"
1717
#include "fnHardwareTimer.h"
1818
#include "../../include/debug.h"
@@ -1043,17 +1043,17 @@ void iwm_ll::disable_output()
10431043
}
10441044

10451045
size_t IRAM_ATTR encode_rmt_bitstream_forwarder(const void *src, size_t src_size,
1046-
size_t symbols_written, size_t symbols_free,
1047-
rmt_symbol_word_t *dest, bool *done, void *arg)
1046+
size_t symbols_written, size_t symbols_free,
1047+
rmt_symbol_word_t *dest, bool *done, void *arg)
10481048
{
10491049
iwm_diskii_ll *d2i = (iwm_diskii_ll *) arg;
10501050
return d2i->encode_rmt_bitstream(src, src_size, symbols_written, symbols_free, dest, done);
10511051
}
10521052

10531053
//Convert track data to rmt format data.
10541054
size_t IRAM_ATTR iwm_diskii_ll::encode_rmt_bitstream(const void *src, size_t src_size,
1055-
size_t symbols_written, size_t symbols_free,
1056-
rmt_symbol_word_t *dest, bool *done)
1055+
size_t symbols_written, size_t symbols_free,
1056+
rmt_symbol_word_t *dest, bool *done)
10571057
{
10581058
// *src is equal to *track_buffer
10591059
// src_size is equal to track_numbits
@@ -1097,20 +1097,20 @@ size_t IRAM_ATTR iwm_diskii_ll::encode_rmt_bitstream(const void *src, size_t src
10971097
window |= outbit;
10981098
window &= 0x0f;
10991099
if (window != 0)
1100-
outbit = window & 0x02;
1100+
outbit = window & 0x02;
11011101
else
1102-
{
1103-
const uint8_t MC3470[] = {0b01010000, 0b10110011, 0b01000010, 0b00000000, 0b10101101, 0b00000010, 0b01101000, 0b01000110, 0b00000001, 0b10010000, 0b00001000, 0b00111000, 0b00001000, 0b00100101, 0b10000100, 0b00001000, 0b10001000, 0b01100010, 0b10101000, 0b01101000, 0b10010000, 0b00100100, 0b00001011, 0b00110010, 0b11100000, 0b01000001, 0b10001010, 0b00000000, 0b11000001, 0b10001000, 0b10001000, 0b00000000};
1102+
{
1103+
const uint8_t MC3470[] = {0b01010000, 0b10110011, 0b01000010, 0b00000000, 0b10101101, 0b00000010, 0b01101000, 0b01000110, 0b00000001, 0b10010000, 0b00001000, 0b00111000, 0b00001000, 0b00100101, 0b10000100, 0b00001000, 0b10001000, 0b01100010, 0b10101000, 0b01101000, 0b10010000, 0b00100100, 0b00001011, 0b00110010, 0b11100000, 0b01000001, 0b10001010, 0b00000000, 0b11000001, 0b10001000, 0b10001000, 0b00000000};
11041104

1105-
static int MC3470_byte_ctr;
1106-
static int MC3470_bit_ctr;
1105+
static int MC3470_byte_ctr;
1106+
static int MC3470_bit_ctr;
11071107

1108-
++MC3470_bit_ctr %= 8;
1109-
if (MC3470_bit_ctr == 0)
1110-
++MC3470_byte_ctr %= sizeof(MC3470);
1108+
++MC3470_bit_ctr %= 8;
1109+
if (MC3470_bit_ctr == 0)
1110+
++MC3470_byte_ctr %= sizeof(MC3470);
11111111

1112-
outbit = (MC3470[MC3470_byte_ctr] & (0x01 << MC3470_bit_ctr)) != 0;
1113-
}
1112+
outbit = (MC3470[MC3470_byte_ctr] & (0x01 << MC3470_bit_ctr)) != 0;
1113+
}
11141114

11151115
dest->val = bits[!!outbit].val;
11161116
}
@@ -1144,7 +1144,7 @@ void iwm_diskii_ll::setup_rmt()
11441144
};
11451145

11461146
ESP_ERROR_CHECK(rmt_new_simple_encoder(&tx_encoder_config, &tx_encoder));
1147-
1147+
11481148
}
11491149

11501150
bool IRAM_ATTR iwm_diskii_ll::nextbit()

lib/bus/mac/mac.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifdef BUILD_MAC
22
#include "mac.h"
33
#include "../../include/debug.h"
4-
#include "../device/mac/fuji.h"
4+
#include "../device/mac/macFuji.h"
55

66
#include "mac_ll.h"
77

@@ -14,27 +14,27 @@ void systemBus::setup(void)
1414
// GPIO needs to read Head Select (SEL)
1515
floppy_ll.setup_gpio();
1616
Debug_printf("\r\nGPIO configured");
17-
17+
1818
floppy_ll.setup_rmt();
1919
Debug_printf("\r\nRMT configured for Floppy Output");
2020
}
2121

2222
/**
2323
* 699-0452-A Double Sided floppy requirement document
24-
*
24+
*
2525
* The host system can send four commands: /DIRTN,/STEP,
2626
* /MOTORON and EJECT. To send one of the control commands to the
2727
* drive, set CA2 to the value (a zero or a one) to which the host
2828
* system wishes the command to be set, and then set CAO, CA 1, and
2929
* SEL to the value which selects the desired command. Finally, bring
3030
* LSTRB first high and then low.
31-
*
31+
*
3232
* SEL CA2 CA1 CA0 value
3333
* /DIRTN 0 0 0 0 0 increase track number
3434
* /DIRTN 0 1 0 0 4 decrease track number
3535
* /STEP 0 0 0 1 1 step the head in the direction
3636
* /STEP 0 1 0 1 5 probably not used
37-
* /MOTORON 0 0 1 0 2 turn motor on
37+
* /MOTORON 0 0 1 0 2 turn motor on
3838
* /MOTORON 0 1 1 0 6 turn motor off
3939
* EJECT 0 0 1 1 3 probably not used
4040
* EJECT 0 1 1 1 7 eject the disk
@@ -44,9 +44,9 @@ void systemBus::setup(void)
4444
* for DCD (HD20) the protocol is different.
4545
* need to read and write blocks
4646
* would be nice to fetch the image name so it can be displayed on the mac
47-
*
47+
*
4848
* block numbers are 3 bytes, 512 bytes/block - 8GB addressable, but MAC OS limites to 2 GB
49-
*
49+
*
5050
*/
5151

5252
uint8_t sector_buffer[512];
@@ -123,9 +123,9 @@ void systemBus::service(void)
123123
}
124124
}
125125
else // DCD
126-
{
126+
{
127127
switch (c)
128-
{
128+
{
129129
case 'A':
130130
case 'B':
131131
case 'C':

0 commit comments

Comments
 (0)