Mostly intenting.
Signed-off-by: Michel Pollet <buserror@gmail.com>
colors[color][2], /* text */
colors[color][3] /* shadow */ );
glPopMatrix();
- glutSwapBuffers();
+ glutSwapBuffers();
}
// gl timer. if the lcd is dirty, refresh display
avr_load_firmware(avr, &f);
ac_input_init(avr, &ac_input);
avr_connect_irq(ac_input.irq + IRQ_AC_OUT, avr_io_getirq(avr,
- AVR_IOCTL_IOPORT_GETIRQ('D'), 2));
+ AVR_IOCTL_IOPORT_GETIRQ('D'), 2));
hd44780_init(avr, &hd44780, 20, 4);
// write them in fifo
uint8_t * dst = buffer;
while (!uart_pty_fifo_isempty(&p->port[ti].in) &&
- dst < (buffer + sizeof(buffer)))
- *dst++ = uart_pty_fifo_read(&p->port[ti].in);
+ (dst - buffer) < sizeof(buffer)) {
+ *dst = uart_pty_fifo_read(&p->port[ti].in);
+ dst++;
+ }
size_t len = dst - buffer;
TRACE(size_t r =) write(p->port[ti].s, buffer, len);
TRACE(if (!p->port[ti].tap) hdump("pty send", buffer, r);)
DECLARE_FIFO(uint8_t,uart_pty_fifo, 512);
typedef struct uart_pty_port_t {
- int tap : 1, crlf : 1;
+ unsigned int tap : 1, crlf : 1;
int s; // socket we chat on
char slavename[64];
uart_pty_fifo_t in;
int compi)
{
return p->io.avr->data[p->comp[compi].r_ocr] |
- (p->comp[compi].r_ocrh ?
- (p->io.avr->data[p->comp[compi].r_ocrh] << 8) : 0);
+ (p->comp[compi].r_ocrh ?
+ (p->io.avr->data[p->comp[compi].r_ocrh] << 8) : 0);
}
static uint16_t
cp[compi] = avr_regbit_get(avr, p->comp[compi].interrupt.raised);
// write the value
- // avr_core_watch_write(avr, addr, v); // This raises flags instead of clearing it.
+ // avr_core_watch_write(avr, addr, v); // This raises flags instead of clearing it.
// clear any interrupts & flags
avr_clear_interrupt_if(avr, &p->overflow, ov);
uint8_t cleared = avr_regbit_get(avr, p->twi.raised);
- /*int cleared = */avr_clear_interrupt_if(avr, &p->twi, twint);
+ /*int cleared = */
+ avr_clear_interrupt_if(avr, &p->twi, twint);
// AVR_TRACE(avr, "cleared %d\n", cleared);
if (!twsto && avr_regbit_get(avr, p->twsto)) {
if (len > ep_fifo_size(epstate)) {
printf("EP OVERFI\n");
len = sizeof epstate->bank[epstate->current_bank].bytes;
- }memcpy(epstate->bank[epstate->current_bank].bytes, buf, len);
+ }
+ memcpy(epstate->bank[epstate->current_bank].bytes, buf, len);
epstate->bank[epstate->current_bank].tail = len;
return 0;
if (data_fuse) {
if (elf_copy_section(".fuse", data_fuse, &firmware->fuse))
return -1;
- firmware->fusesize = data_fuse->d_size;
+ firmware->fusesize = data_fuse->d_size;
}
if (data_lockbits) {
- if (elf_copy_section(".lock", data_fuse, &firmware->lockbits))
+ if (elf_copy_section(".lock", data_lockbits, &firmware->lockbits))
return -1;
}
// hdump("flash", avr->flash, offset);
gdb_send_reply(g, rep);
break;
- }
+ }
gdb_send_reply(g, "");
break;
case '?':
sleep(5);
return 1;
}
- int i = 1;
- setsockopt (g->s, IPPROTO_TCP, TCP_NODELAY, &i, sizeof (i));
+ int i = 1;
+ setsockopt (g->s, IPPROTO_TCP, TCP_NODELAY, &i, sizeof (i));
g->avr->state = cpu_Stopped;
printf("%s connection opened\n", __FUNCTION__);
}
vector->pending = 0;
avr->interrupt_state = avr_has_pending_interrupts(avr);
} else {
- if (vector && vector->trace)
+ if (vector->trace)
printf("IRQ%d calling\n", vector->vector);
_avr_push_addr(avr, avr->pc);
avr_sreg_set(avr, S_I, 0);
(ssize_t)recv( (sockfd), (char *)(buf), (len), (flags))
#define sleep(x) Sleep((x)*1000)
-static inline int network_init()
+static inline int network_init(void)
{
// Windows requires WinSock to be init before use
WSADATA wsaData;
return 0;
}
-static inline void network_release()
+static inline void network_release(void)
{
// close WinSock
WSACleanup();
#include <sys/time.h>
#include <poll.h>
-static inline int network_init()
+static inline int network_init(void)
{
// nothing to do
return 0;
}
-static inline void network_release()
+static inline void network_release(void)
{
// nothing to do
}
if (!strcmp(keyword, "$timescale")) {
double cnt = 0;
- vcd->vcd_to_us = 1;
char *si = v->argv[1];
+
+ vcd->vcd_to_us = 1;
while (si && *si && isdigit(*si))
cnt = (cnt * 10) + (*si++ - '0');
- while (*si == ' ')
+ while (si && *si == ' ')
si++;
- if (!*si)
+ if (si && !*si)
si = v->argv[2];
// if (!strcmp(si, "ns")) // TODO: Check that,
// vcd->vcd_to_us = cnt;