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
8 changes: 5 additions & 3 deletions lib/bus/iec/iec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ static void onTimer(void *info)
//portEXIT_CRITICAL_ISR(&parent->timerMux);
}

#if 0
static void ml_iec_intr_task(void* arg)
{
while ( true )
Expand All @@ -79,6 +80,7 @@ static void ml_iec_intr_task(void* arg)
taskYIELD();
}
}
#endif

void systemBus::init_gpio(gpio_num_t _pin)
{
Expand Down Expand Up @@ -328,14 +330,14 @@ void IRAM_ATTR systemBus::service()
auto d = deviceById(data.device);
if (d != nullptr)
{
device_state_t device_state = d->queue_command(data);
d->queue_command(data);

//fnLedManager.set(eLed::LED_BUS, true);

//Debug_printv("bus[%d] device[%d]", state, device_state);
// for (auto devicep : _daisyChain)
// {
device_state = d->process();
d->process();
if ( data.primary == IEC_TALK )
data.init();
// }
Expand Down Expand Up @@ -909,7 +911,7 @@ void systemBus::reset_all_our_devices()
void systemBus::setBitTiming(std::string set, int p1, int p2, int p3, int p4)
{
uint8_t i = 0; // Send
if (mstr::equals(set, "r")) i = 1;
if (mstr::equals(set, (char *) "r")) i = 1;
if (p1) protocol->bit_pair_timing[i][0] = p1;
if (p2) protocol->bit_pair_timing[i][1] = p2;
if (p3) protocol->bit_pair_timing[i][2] = p3;
Expand Down
7 changes: 4 additions & 3 deletions lib/bus/iec/protocol/_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ IECProtocol::IECProtocol() {
esp_timer_create_args_t args = {
.callback = onTimer,
.arg = this,
.dispatch_method = ESP_TIMER_ISR,
.name = "onTimer"
.dispatch_method = ESP_TIMER_TASK,
.name = "onTimer",
.skip_unhandled_events = 0,
};
esp_timer_create(&args, &timer_handle);
};
Expand Down Expand Up @@ -193,4 +194,4 @@ bool IRAM_ATTR IECProtocol::wait(size_t wait_us, uint64_t start, bool watch_atn)
return true;
}

#endif /* BUILD_IEC */
#endif /* BUILD_IEC */
5 changes: 3 additions & 2 deletions lib/bus/iec/protocol/cpbstandardserial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ CPBStandardSerial::CPBStandardSerial()
.callback = onSendBits,
.arg = this,
.dispatch_method = ESP_TIMER_ISR,
.name = "onSendBits"
.name = "onSendBits",
.skip_unhandled_events = 0,
};
esp_timer_create(&args, &timer_send_h);
//Debug_printv("send_timer_create");
Expand Down Expand Up @@ -614,4 +615,4 @@ bool CPBStandardSerial::sendBits ( uint8_t data )
return true;
} // sendBits

#endif // BUILD_IEC
#endif // BUILD_IEC
6 changes: 4 additions & 2 deletions lib/bus/iec/protocol/jiffydos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ JiffyDOS::JiffyDOS() {
esp_timer_create_args_t args = {
.callback = onTimer,
.arg = this,
.name = nullptr
.dispatch_method = ESP_TIMER_TASK,
.name = nullptr,
.skip_unhandled_events = 0,
};
esp_timer_create(&args, &timer_handle);
};
Expand Down Expand Up @@ -198,4 +200,4 @@ bool JiffyDOS::sendByte ( uint8_t data, bool signalEOI )
return true;
} // sendByte

#endif /* BUILD_IEC*/
#endif /* BUILD_IEC*/
8 changes: 7 additions & 1 deletion lib/device/iec/drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,9 @@ bool iecDrive::registerStream ( uint8_t channel )
// Debug_printv("_file[%s]", _file.c_str());

// TODO: Determine mode and create the proper stream
#if 0
std::ios_base::openmode mode = std::ios_base::in;
#endif

Debug_printv("_base[%s]", _base->url.c_str());
_base.reset( MFSOwner::File( _base->url ) );
Expand Down Expand Up @@ -1085,7 +1087,9 @@ bool iecDrive::sendFile()

uint8_t b; // byte
// uint8_t nb; // next byte
#if 0
uint8_t bi = 0;
#endif
uint16_t load_address = 0;
uint16_t sys_address = 0;

Expand Down Expand Up @@ -1255,7 +1259,9 @@ bool iecDrive::saveFile()
bool success = true;
bool done = false;

#if 0
size_t bi = 0;
#endif
size_t load_address = 0;
size_t b_len = 1;
uint8_t b[b_len];
Expand Down Expand Up @@ -1363,4 +1369,4 @@ void iecDrive::sendFileNotFound()
state = DEVICE_ERROR;
} // sendFileNotFound

#endif /* BUILD_IEC */
#endif /* BUILD_IEC */
3 changes: 3 additions & 0 deletions lib/hardware/fnSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@


#ifdef ESP_PLATFORM
#if defined(BUILD_ATARI) || defined(PINMAP_ESP32S3)
static QueueHandle_t card_detect_evt_queue = NULL;

static void IRAM_ATTR card_detect_isr_handler(void *arg)
Expand Down Expand Up @@ -141,6 +142,8 @@ static void setup_card_detect(gpio_num_t pin)
// Add the card detect handler
gpio_isr_handler_add(pin, card_detect_isr_handler, (void *)pin);
}
#endif // PINMAP_ESP32S3

// ESP_PLATFORM
#else
// !ESP_PLATFORM
Expand Down
8 changes: 6 additions & 2 deletions lib/http/fnHttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,10 @@ int fnHttpClient::_perform()
// Debug_printf("%08lx _perform notified\r\n", fnSystem.millis());
// Debug_printf("Notification of headers loaded\r\n");

#if 0
bool chunked = esp_http_client_is_chunked_response(_handle);
int length = esp_http_client_get_content_length(_handle);
#endif
int status;
switch (_client_err)
{
Expand Down Expand Up @@ -564,9 +566,11 @@ int fnHttpClient::_perform_stream(esp_http_client_method_t method, uint8_t *writ
}

// Collect results
#if 0
bool chunked = esp_http_client_is_chunked_response(_handle);
int status = esp_http_client_get_status_code(_handle);
int length = esp_http_client_get_content_length(_handle);
#endif
int status = esp_http_client_get_status_code(_handle);
#ifdef VERBOSE_HTTP
Debug_printf("status = %d, length = %d, chunked = %d\r\n", status, length, chunked ? 1 : 0);
#endif
Expand Down Expand Up @@ -849,4 +853,4 @@ void fnHttpClient::set_header_value(const char *name, const char *value)
it->second = std::string(value);
}

}
}
27 changes: 13 additions & 14 deletions lib/meatloaf/network/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,20 +392,19 @@ int MeatHttpClient::openAndFetchHeaders(esp_http_client_method_t meth, int resum
return 0;

mstr::replaceAll(url, " ", "%20");
esp_http_client_config_t config = {
.url = url.c_str(),
.auth_type = HTTP_AUTH_TYPE_BASIC,
.user_agent = USER_AGENT,
.method = meth,
.timeout_ms = 10000,
.max_redirection_count = 10,
.event_handler = _http_event_handler,
.user_data = this,
.keep_alive_enable = true,
.keep_alive_idle = 10,
.keep_alive_interval = 1
};

esp_http_client_config_t config;
memset(&config, 0, sizeof(config));
config.url = url.c_str();
config.auth_type = HTTP_AUTH_TYPE_BASIC;
config.user_agent = USER_AGENT;
config.method = meth;
config.timeout_ms = 10000;
config.max_redirection_count = 10;
config.event_handler = _http_event_handler;
config.user_data = this;
config.keep_alive_enable = true;
config.keep_alive_idle = 10;
config.keep_alive_interval = 1;
//Debug_printv("HTTP Init url[%s]", url.c_str());
_http = esp_http_client_init(&config);

Expand Down
4 changes: 2 additions & 2 deletions lib/meatloaf/wrappers/iec_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void oiecstream::putUtf8(U8Char* codePoint) {
//Serial.printf("%c",codePoint->toPetscii());
//Debug_printv("oiecstream calling put");
auto c = codePoint->toPetscii();
put(codePoint->toPetscii());
put(c);
}

// void oiecstream::writeLn(std::string line) {
Expand All @@ -153,4 +153,4 @@ void oiecstream::putUtf8(U8Char* codePoint) {

// (*this) << converted;
// }
#endif /* BUILD_IEC */
#endif /* BUILD_IEC */