Skip to content

Commit cef55ff

Browse files
Merge remote-tracking branch 'upstream/master'
merged with upstream implemented SYSTEM_BUS changes in Lynx
2 parents e8f67c8 + 01a7597 commit cef55ff

Some content is hidden

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

89 files changed

+5949
-2218
lines changed

.github/workflows/autobuild.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ jobs:
2020
runs-on: "ubuntu-latest"
2121
strategy:
2222
matrix:
23-
target-platform: [ATARI, ATARI-esp32-s3-wroom-1-n16r8, ADAM, APPLE, IEC-LOLIN-D32, IEC-NUGGET, COCO]
23+
target-platform:
24+
- ADAM
25+
- APPLE
26+
- ATARI
27+
- ATARI-esp32-s3-wroom-1-n16r8
28+
- COCO
29+
- IEC-LOLIN-D32
30+
- IEC-NUGGET
31+
- RS232
2432

2533
steps:
2634
- name: Checkout Source

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ jobs:
1717
runs-on: "ubuntu-latest"
1818
strategy:
1919
matrix:
20-
target-platform: [ATARI, ATARI-8mb, ADAM, APPLE, COCO, IEC-LOLIN-D32, MASTERIES-REVAB, MASTERIES-REVA-SPIFIX, RS232]
20+
target-platform:
21+
- ADAM
22+
- APPLE
23+
- ATARI
24+
- ATARI-8mb
25+
- COCO
26+
- IEC-LOLIN-D32
27+
- MASTERIES-REVA-SPIFIX
28+
- MASTERIES-REVAB
29+
- RS232
2130
env:
2231
TAG_NAME: ${{ github.event.inputs.tag || github.ref_name }}
2332

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: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#define IDLE_TIME 500 // Idle tolerance in microseconds (roughly three characters at 62500 baud)
1717

18+
//systemBus SYSTEM_BUS.;
19+
1820
static QueueHandle_t reset_evt_queue = NULL;
1921

2022
static void IRAM_ATTR comlynx_reset_isr_handler(void *arg)
@@ -81,8 +83,8 @@ void virtualDevice::comlynx_send(uint8_t b)
8183
Debug_printf("comlynx_send_buffer: %X\n", b);
8284

8385
// Wait for idle only when in UDPStream mode
84-
if (ComLynx._udpDev->udpstreamActive)
85-
ComLynx.wait_for_idle();
86+
if (SYSTEM_BUS._udpDev->udpstreamActive)
87+
SYSTEM_BUS.wait_for_idle();
8688

8789
// Write the byte
8890
fnUartBUS.write(b);
@@ -97,8 +99,8 @@ void virtualDevice::comlynx_send_buffer(uint8_t *buf, unsigned short len)
9799
//Debug_printf("comlynx_send_buffer: len:%d %0X %0X %0X %0X %0X %0X\n", len, buf[0], buf[1], buf[2], buf[3], buf[4], buf[len-1]);
98100

99101
// Wait for idle only when in UDPStream mode
100-
if (ComLynx._udpDev->udpstreamActive)
101-
ComLynx.wait_for_idle();
102+
if (SYSTEM_BUS._udpDev->udpstreamActive)
103+
SYSTEM_BUS.wait_for_idle();
102104

103105
fnUartBUS.write(buf, len);
104106
fnUartBUS.readBytes(buf, len);
@@ -270,7 +272,7 @@ void virtualDevice::comlynx_process(uint8_t b)
270272

271273
void virtualDevice::comlynx_control_status()
272274
{
273-
//ComLynx.start_time = esp_timer_get_time();
275+
//SYSTEM_BUS.start_time = esp_timer_get_time();
274276
comlynx_response_status();
275277
}
276278

@@ -561,9 +563,7 @@ void systemBus::setRedeyeGameRemap(uint32_t remap)
561563
{
562564
Debug_printf("setComlynxIdleTime, %d\n", idle_time);
563565
564-
ComLynx.comlynx_idle_time = idle_time;
566+
SYSTEM_BUS.comlynx_idle_time = idle_time;
565567
}*/
566568

567-
568-
systemBus ComLynx;
569-
#endif /* BUILD_LYNX */
569+
#endif /* BUILD_LYNX */

lib/bus/comlynx/comlynx.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,12 @@ class systemBus
286286

287287
void setRedeyeMode(bool enable);
288288
void setRedeyeGameRemap(uint32_t remap);
289-
//void setComlynxIdleTime(uint64_t idle_time);
290289

291290
bool shuttingDown = false; // TRUE if we are in shutdown process
292291
bool getShuttingDown() { return shuttingDown; };
293292
};
294293

295-
extern systemBus ComLynx;
294+
extern systemBus SYSTEM_BUS;
295+
//extern systemBus ComLynx;
296296

297-
#endif /* COMLYNX_H */
297+
#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 */

0 commit comments

Comments
 (0)