Skip to content

Commit c9949f7

Browse files
committed
Standardize naming of different bus classes to be systemBus.
1 parent 01b88af commit c9949f7

Some content is hidden

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

79 files changed

+5865
-2148
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ all:
2121
zip:
2222
$(call builder, -z)
2323

24+
atari-lwm:
25+
$(call builder, -p ATARI -g)
26+
2427
coco-lwm:
2528
$(call builder, -p COCO -g)
2629

lib/bus/adamnet/adamnet.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ void virtualDevice::reset()
162162

163163
void virtualDevice::adamnet_response_ack(bool doNotWaitForIdle)
164164
{
165-
int64_t t = esp_timer_get_time() - AdamNet.start_time;
165+
int64_t t = esp_timer_get_time() - SYSTEM_BUS.start_time;
166166

167167
if (!doNotWaitForIdle)
168168
{
169-
AdamNet.wait_for_idle();
169+
SYSTEM_BUS.wait_for_idle();
170170
}
171171

172172
if (t < 300)
@@ -177,11 +177,11 @@ void virtualDevice::adamnet_response_ack(bool doNotWaitForIdle)
177177

178178
void virtualDevice::adamnet_response_nack(bool doNotWaitForIdle)
179179
{
180-
int64_t t = esp_timer_get_time() - AdamNet.start_time;
180+
int64_t t = esp_timer_get_time() - SYSTEM_BUS.start_time;
181181

182182
if (!doNotWaitForIdle)
183183
{
184-
AdamNet.wait_for_idle();
184+
SYSTEM_BUS.wait_for_idle();
185185
}
186186

187187
if (t < 300)
@@ -226,7 +226,7 @@ void virtualDevice::adamnet_process(uint8_t b)
226226

227227
void virtualDevice::adamnet_control_status()
228228
{
229-
AdamNet.start_time=esp_timer_get_time();
229+
SYSTEM_BUS.start_time=esp_timer_get_time();
230230
adamnet_response_status();
231231
}
232232

@@ -434,6 +434,4 @@ void systemBus::disableDevice(uint8_t device_id)
434434
if (_daisyChain.find(device_id) != _daisyChain.end())
435435
_daisyChain[device_id]->device_active = false;
436436
}
437-
438-
systemBus AdamNet;
439-
#endif /* BUILD_ADAM */
437+
#endif /* BUILD_ADAM */

lib/bus/adamnet/adamnet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,6 @@ class systemBus
281281
bool getShuttingDown() { return shuttingDown; };
282282
};
283283

284-
extern systemBus AdamNet;
284+
extern systemBus SYSTEM_BUS;
285285

286-
#endif /* ADAMNET_H */
286+
#endif /* ADAMNET_H */

lib/bus/bus.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#ifdef BUILD_ATARI
55
#include "sio/sio.h"
6-
#define SYSTEM_BUS SIO
76
#ifdef ESP_PLATFORM
87
#define FN_BUS_PORT fnUartBUS
98
#else
@@ -13,73 +12,61 @@
1312

1413
#ifdef BUILD_IEC
1514
#include "iec/iec.h"
16-
#define SYSTEM_BUS IEC
1715
#define FN_BUS_PORT fnUartBUS // TBD
1816
#endif
1917

2018
#ifdef BUILD_ADAM
2119
#include "adamnet/adamnet.h"
22-
#define SYSTEM_BUS AdamNet
2320
#define FN_BUS_PORT fnUartBUS
2421
#endif
2522

2623
#ifdef BUILD_LYNX
2724
#include "comlynx/comlynx.h"
28-
#define SYSTEM_BUS ComLynx
2925
#define FN_BUS_PORT fnUartBUS
3026
#endif
3127

3228
#ifdef NEW_TARGET
3329
#include "new/adamnet.h"
34-
#define SYSTEM_BUS AdamNet
3530
#define FN_BUS_PORT fnUartBUS
3631
#endif
3732

3833
#ifdef BUILD_APPLE
3934
#include "iwm/iwm.h"
40-
#define SYSTEM_BUS IWM
4135
#define FN_BUS_PORT fnUartBUS // TBD
4236
#endif
4337

4438
#ifdef BUILD_MAC
4539
#include "mac/mac.h"
46-
#define SYSTEM_BUS MAC
4740
#define FN_BUS_PORT fnUartBUS
4841
#endif
4942

5043
#ifdef BUILD_S100
5144
#include "s100spi/s100spi.h"
52-
#define SYSTEM_BUS s100Bus
5345
#define FN_BUS_PORT fnUartBUS // TBD
5446
#endif
5547

5648
#ifdef BUILD_RS232
5749
#include "rs232/rs232.h"
58-
#define SYSTEM_BUS RS232
5950
#define FN_BUS_PORT fnUartBUS
6051
#endif
6152

6253
#ifdef BUILD_CX16
6354
#include "cx16_i2c/cx16_i2c.h"
64-
#define SYSTEM_BUS CX16
6555
#define FN_BUS_PORT fnUartBUS // TBD
6656
#endif
6757

6858
#ifdef BUILD_RC2014
6959
#include "rc2014bus/rc2014bus.h"
70-
#define SYSTEM_BUS rc2014Bus
7160
#define FN_BUS_PORT fnUartBUS
7261
#endif
7362

7463
#ifdef BUILD_H89
7564
#include "h89/h89.h"
76-
#define SYSTEM_BUS H89Bus
7765
#define FN_BUS_PORT fnUartBUS // TBD
7866
#endif
7967

8068
#ifdef BUILD_COCO
8169
#include "drivewire/drivewire.h"
82-
#define SYSTEM_BUS DRIVEWIRE
8370
#define FN_BUS_PORT fnDwCom
8471
#endif
8572

lib/bus/comlynx/comlynx.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,4 @@ void systemBus::setUDPHost(const char *hostname, int port)
458458
if (_udpDev->udpstream_host_ip != IPADDR_NONE)
459459
_udpDev->comlynx_enable_udpstream();
460460
}
461-
462-
systemBus ComLynx;
463-
#endif /* BUILD_LYNX */
461+
#endif /* BUILD_LYNX */

lib/bus/comlynx/comlynx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,6 @@ class systemBus
273273
bool getShuttingDown() { return shuttingDown; };
274274
};
275275

276-
extern systemBus ComLynx;
276+
extern systemBus SYSTEM_BUS;
277277

278-
#endif /* COMLYNX_H */
278+
#endif /* COMLYNX_H */

lib/bus/cx16_i2c/cx16_i2c.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,4 @@ void systemBus::shutdown()
248248
}
249249
Debug_printf("All devices shut down.\n");
250250
}
251-
252-
systemBus CX16;
253-
254-
#endif /* BUILD_CX16 */
251+
#endif /* BUILD_CX16 */

lib/bus/cx16_i2c/cx16_i2c.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,6 @@ class virtualDevice
221221
* @brief is device active (turned on?)
222222
*/
223223
bool device_active = true;
224-
225-
/**
226-
* @brief Get the systemBus object that this virtualDevice is attached to.
227-
*/
228-
systemBus get_bus();
229224
};
230225

231226
/**
@@ -374,6 +369,6 @@ class systemBus
374369
/**
375370
* @brief Return
376371
*/
377-
extern systemBus CX16;
372+
extern systemBus SYSTEM_BUS;
378373

379-
#endif /* CX16_I2C_H */
374+
#endif /* CX16_I2C_H */

lib/bus/drivewire/drivewire.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ static void drivewire_intr_task(void *arg)
9292

9393
// Helper functions outside the class defintions
9494

95-
systemBus virtualDevice::get_bus() { return DRIVEWIRE; }
96-
9795
void systemBus::op_jeff()
9896
{
9997
fnDwCom.print("FUJINET");
@@ -829,6 +827,4 @@ void systemBus::setBaudrate(int baud)
829827
_drivewireBaud = baud;
830828
//_modemDev->get_uart()->set_baudrate(baud); // TODO COME BACK HERE.
831829
}
832-
833-
systemBus DRIVEWIRE; // Global DRIVEWIRE object
834830
#endif /* BUILD_COCO */

lib/bus/drivewire/drivewire.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,6 @@ class virtualDevice
166166
* @brief is device active (turned on?)
167167
*/
168168
bool device_active = true;
169-
170-
/**
171-
* @brief Get the systemBus object that this virtualDevice is attached to.
172-
*/
173-
systemBus get_bus();
174169
};
175170

176171
enum drivewire_message : uint16_t
@@ -328,6 +323,6 @@ class systemBus
328323
#endif
329324
};
330325

331-
extern systemBus DRIVEWIRE;
326+
extern systemBus SYSTEM_BUS;
332327

333328
#endif // guard

0 commit comments

Comments
 (0)