Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ all:
zip:
$(call builder, -z)

atari-lwm:
$(call builder, -p ATARI -g)

coco-lwm:
$(call builder, -p COCO -g)

Expand Down
14 changes: 6 additions & 8 deletions lib/bus/adamnet/adamnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ void virtualDevice::reset()

void virtualDevice::adamnet_response_ack(bool doNotWaitForIdle)
{
int64_t t = esp_timer_get_time() - AdamNet.start_time;
int64_t t = esp_timer_get_time() - SYSTEM_BUS.start_time;

if (!doNotWaitForIdle)
{
AdamNet.wait_for_idle();
SYSTEM_BUS.wait_for_idle();
}

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

void virtualDevice::adamnet_response_nack(bool doNotWaitForIdle)
{
int64_t t = esp_timer_get_time() - AdamNet.start_time;
int64_t t = esp_timer_get_time() - SYSTEM_BUS.start_time;

if (!doNotWaitForIdle)
{
AdamNet.wait_for_idle();
SYSTEM_BUS.wait_for_idle();
}

if (t < 300)
Expand Down Expand Up @@ -226,7 +226,7 @@ void virtualDevice::adamnet_process(uint8_t b)

void virtualDevice::adamnet_control_status()
{
AdamNet.start_time=esp_timer_get_time();
SYSTEM_BUS.start_time=esp_timer_get_time();
adamnet_response_status();
}

Expand Down Expand Up @@ -434,6 +434,4 @@ void systemBus::disableDevice(uint8_t device_id)
if (_daisyChain.find(device_id) != _daisyChain.end())
_daisyChain[device_id]->device_active = false;
}

systemBus AdamNet;
#endif /* BUILD_ADAM */
#endif /* BUILD_ADAM */
4 changes: 2 additions & 2 deletions lib/bus/adamnet/adamnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,6 @@ class systemBus
bool getShuttingDown() { return shuttingDown; };
};

extern systemBus AdamNet;
extern systemBus SYSTEM_BUS;

#endif /* ADAMNET_H */
#endif /* ADAMNET_H */
13 changes: 0 additions & 13 deletions lib/bus/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#ifdef BUILD_ATARI
#include "sio/sio.h"
#define SYSTEM_BUS SIO
#ifdef ESP_PLATFORM
#define FN_BUS_PORT fnUartBUS
#else
Expand All @@ -13,73 +12,61 @@

#ifdef BUILD_IEC
#include "iec/iec.h"
#define SYSTEM_BUS IEC
#define FN_BUS_PORT fnUartBUS // TBD
#endif

#ifdef BUILD_ADAM
#include "adamnet/adamnet.h"
#define SYSTEM_BUS AdamNet
#define FN_BUS_PORT fnUartBUS
#endif

#ifdef BUILD_LYNX
#include "comlynx/comlynx.h"
#define SYSTEM_BUS ComLynx
#define FN_BUS_PORT fnUartBUS
#endif

#ifdef NEW_TARGET
#include "new/adamnet.h"
#define SYSTEM_BUS AdamNet
#define FN_BUS_PORT fnUartBUS
#endif

#ifdef BUILD_APPLE
#include "iwm/iwm.h"
#define SYSTEM_BUS IWM
#define FN_BUS_PORT fnUartBUS // TBD
#endif

#ifdef BUILD_MAC
#include "mac/mac.h"
#define SYSTEM_BUS MAC
#define FN_BUS_PORT fnUartBUS
#endif

#ifdef BUILD_S100
#include "s100spi/s100spi.h"
#define SYSTEM_BUS s100Bus
#define FN_BUS_PORT fnUartBUS // TBD
#endif

#ifdef BUILD_RS232
#include "rs232/rs232.h"
#define SYSTEM_BUS RS232
#define FN_BUS_PORT fnUartBUS
#endif

#ifdef BUILD_CX16
#include "cx16_i2c/cx16_i2c.h"
#define SYSTEM_BUS CX16
#define FN_BUS_PORT fnUartBUS // TBD
#endif

#ifdef BUILD_RC2014
#include "rc2014bus/rc2014bus.h"
#define SYSTEM_BUS rc2014Bus
#define FN_BUS_PORT fnUartBUS
#endif

#ifdef BUILD_H89
#include "h89/h89.h"
#define SYSTEM_BUS H89Bus
#define FN_BUS_PORT fnUartBUS // TBD
#endif

#ifdef BUILD_COCO
#include "drivewire/drivewire.h"
#define SYSTEM_BUS DRIVEWIRE
#define FN_BUS_PORT fnDwCom
#endif

Expand Down
4 changes: 1 addition & 3 deletions lib/bus/comlynx/comlynx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,4 @@ void systemBus::setUDPHost(const char *hostname, int port)
if (_udpDev->udpstream_host_ip != IPADDR_NONE)
_udpDev->comlynx_enable_udpstream();
}

systemBus ComLynx;
#endif /* BUILD_LYNX */
#endif /* BUILD_LYNX */
4 changes: 2 additions & 2 deletions lib/bus/comlynx/comlynx.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,6 @@ class systemBus
bool getShuttingDown() { return shuttingDown; };
};

extern systemBus ComLynx;
extern systemBus SYSTEM_BUS;

#endif /* COMLYNX_H */
#endif /* COMLYNX_H */
5 changes: 1 addition & 4 deletions lib/bus/cx16_i2c/cx16_i2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,4 @@ void systemBus::shutdown()
}
Debug_printf("All devices shut down.\n");
}

systemBus CX16;

#endif /* BUILD_CX16 */
#endif /* BUILD_CX16 */
9 changes: 2 additions & 7 deletions lib/bus/cx16_i2c/cx16_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ class virtualDevice
* @brief is device active (turned on?)
*/
bool device_active = true;

/**
* @brief Get the systemBus object that this virtualDevice is attached to.
*/
systemBus get_bus();
};

/**
Expand Down Expand Up @@ -374,6 +369,6 @@ class systemBus
/**
* @brief Return
*/
extern systemBus CX16;
extern systemBus SYSTEM_BUS;

#endif /* CX16_I2C_H */
#endif /* CX16_I2C_H */
4 changes: 0 additions & 4 deletions lib/bus/drivewire/drivewire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ static void drivewire_intr_task(void *arg)

// Helper functions outside the class defintions

systemBus virtualDevice::get_bus() { return DRIVEWIRE; }

void systemBus::op_jeff()
{
fnDwCom.print("FUJINET");
Expand Down Expand Up @@ -829,6 +827,4 @@ void systemBus::setBaudrate(int baud)
_drivewireBaud = baud;
//_modemDev->get_uart()->set_baudrate(baud); // TODO COME BACK HERE.
}

systemBus DRIVEWIRE; // Global DRIVEWIRE object
#endif /* BUILD_COCO */
7 changes: 1 addition & 6 deletions lib/bus/drivewire/drivewire.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ class virtualDevice
* @brief is device active (turned on?)
*/
bool device_active = true;

/**
* @brief Get the systemBus object that this virtualDevice is attached to.
*/
systemBus get_bus();
};

enum drivewire_message : uint16_t
Expand Down Expand Up @@ -328,6 +323,6 @@ class systemBus
#endif
};

extern systemBus DRIVEWIRE;
extern systemBus SYSTEM_BUS;

#endif // guard
2 changes: 0 additions & 2 deletions lib/bus/h89/h89.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,4 @@ bool systemBus::enabledDeviceStatus(uint8_t device_id)

return false;
}

systemBus H89Bus;
#endif /* H89 */
2 changes: 1 addition & 1 deletion lib/bus/h89/h89.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ class systemBus
bool getShuttingDown() { return shuttingDown; };
};

extern systemBus H89Bus;
extern systemBus SYSTEM_BUS;

#endif /* H89_H */
2 changes: 0 additions & 2 deletions lib/bus/iec/iec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#define MAIN_PRIORITY 17
#define MAIN_CPUAFFINITY 1

systemBus IEC;

systemBus::systemBus() : IECBusHandler(PIN_IEC_ATN, PIN_IEC_CLK_OUT, PIN_IEC_DATA_OUT,
PIN_IEC_RESET==GPIO_NUM_NC ? 0xFF : PIN_IEC_RESET,
0xFF,
Expand Down
2 changes: 1 addition & 1 deletion lib/bus/iec/iec.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ class systemBus : public IECBusHandler
/**
* @brief Return
*/
extern systemBus IEC;
extern systemBus SYSTEM_BUS;

#endif /* IEC_H */
Loading
Loading