Cuda: increase size of the input buffer.

This commit is contained in:
Maxim Poliakovski 2022-02-19 23:22:21 +01:00
parent 123f820775
commit edd3979647
2 changed files with 4 additions and 2 deletions

View File

@ -356,7 +356,7 @@ void ViaCuda::write(uint8_t new_state) {
schedule_sr_int(USECS_TO_NSECS(61));
} else {
if (this->via_regs[VIA_ACR] & 0x10) { /* data transfer: Host --> Cuda */
if (this->in_count < 16) {
if (this->in_count < sizeof(this->in_buf)) {
this->in_buf[this->in_count++] = this->via_regs[VIA_SR];
// tell the system we've read the byte after 71 usecs
schedule_sr_int(USECS_TO_NSECS(71));

View File

@ -140,6 +140,8 @@ enum {
CUDA_ERR_I2C = 5 /* invalid I2C data or no acknowledge */
};
#define CUDA_IN_BUF_SIZE 256
/** PRAM addresses within Cuda's internal memory */
#define CUDA_PRAM_START 0x100 // starting address of PRAM
#define CUDA_PRAM_END 0x1FF // last byte of PRAM
@ -195,7 +197,7 @@ private:
uint8_t old_tip;
uint8_t old_byteack;
uint8_t treq;
uint8_t in_buf[16];
uint8_t in_buf[CUDA_IN_BUF_SIZE];
int32_t in_count;
uint8_t out_buf[16];
int32_t out_count;