@@ -123,6 +123,7 @@ void eptri_usb_init(void) {
123
123
return ;
124
124
}
125
125
126
+ __attribute__((section (".ramtext" )))
126
127
static void process_tx (void ) {
127
128
128
129
// Don't allow requeueing -- only queue more data if the system is idle.
@@ -186,6 +187,7 @@ static void process_tx(void) {
186
187
return ;
187
188
}
188
189
190
+ __attribute__((section (".ramtext" )))
189
191
static void process_rx (void ) {
190
192
// If we already have data in our buffer, don't do anything.
191
193
if (out_have )
@@ -207,6 +209,7 @@ static void process_rx(void) {
207
209
out_buffer_length -= 2 ;
208
210
}
209
211
212
+ __attribute__((section (".ramtext" )))
210
213
void eptri_usb_send_epno (const void * data , int total_count , uint8_t epno ) {
211
214
while ((current_length || current_data ) && !(usb_in_status_read () & (1 << CSR_USB_IN_STATUS_IDLE_OFFSET )))
212
215
process_tx ();
@@ -231,6 +234,7 @@ void eptri_usb_wait_for_send_done(void) {
231
234
;
232
235
}
233
236
237
+ __attribute__((section (".ramtext" )))
234
238
void eptri_usb_isr (void ) {
235
239
uint8_t setup_packet [10 ];
236
240
uint32_t setup_length ;
@@ -343,14 +347,21 @@ int eptri_usb_can_getc(void) {
343
347
}
344
348
345
349
extern volatile uint8_t terminal_is_connected ;
350
+ __attribute__((section (".ramtext" )))
346
351
int eptri_usb_can_putc (void ) {
347
352
return terminal_is_connected && ! (usb_out_status_read () & (1 << CSR_USB_OUT_STATUS_HAVE_OFFSET ));
348
353
}
349
354
355
+ __attribute__((section (".ramtext" )))
350
356
int eptri_usb_write (const char * buf , int count ) {
357
+ int to_write = 64 ;
358
+ if (to_write > count )
359
+ to_write = count ;
351
360
eptri_usb_send_epno (buf , count , 2 );
361
+ return to_write ;
352
362
}
353
363
364
+ __attribute__((section (".ramtext" )))
354
365
int eptri_usb_getc (void ) {
355
366
uint8_t c = 0 ;
356
367
if ((serial_buffer_ptr >= 0 ) && (serial_buffer_ptr < serial_buffer_len )) {
0 commit comments