CFLAGS += -mfpmath=sse -msse2
endif
-CFLAGS += -g --std=gnu99
-CFLAGS += ${patsubst %,-I%,${subst :, ,${IPATH}}}
-LDFLAGS += -lelf
+CFLAGS += -g --std=gnu99 -Wall
+CFLAGS += ${patsubst %,-I%,${subst :, ,${IPATH}}}
+LDFLAGS += -lelf
ifeq (${shell uname}, Darwin)
AVR_ROOT := "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/"
while (1) {
avr_run(avr);
}
+ return NULL;
}
void keyCB(
// gl timer. if the lcd is dirty, refresh display
void timerCB(int i)
{
- static int oldstate = -1;
+ //static int oldstate = -1;
// restart timer
glutTimerFunc(1000/64, timerCB, 0);
glutPostRedisplay();
{
if (key == 'q')
exit(0);
- static uint8_t buf[64];
+ //static uint8_t buf[64];
switch (key) {
case 'q':
case 0x1f: // escape
button_press(&button, 1000000);
}
}
+ return NULL;
}
{
elf_firmware_t f;
const char * fname = "atmega48_ledramp.axf";
- char path[256];
+ //char path[256];
// sprintf(path, "%s/%s", dirname(argv[0]), fname);
// printf("Firmware pathname is %s\n", path);
glMatrixMode(GL_MODELVIEW); // Select modelview matrix
glLoadIdentity(); // Start with an identity matrix
- float grid = pixsize;
- float size = grid * 0.8;
+ //float grid = pixsize;
+ //float size = grid * 0.8;
glBegin(GL_QUADS);
glColor3f(1,0,0);
{
if (key == 'q')
exit(0);
- static uint8_t buf[64];
+ //static uint8_t buf[64];
switch (key) {
case 'q':
case 0x1f: // escape
// gl timer. if the pin have changed states, refresh display
void timerCB(int i)
{
- static uint8_t oldstate = 0xff;
+ //static uint8_t oldstate = 0xff;
// restart timer
glutTimerFunc(1000/64, timerCB, 0);
#if 0
static void * avr_run_thread(void * oaram)
{
- int b_press = do_button_press;
+// int b_press = do_button_press;
while (1) {
avr_run(avr);
}
#endif
}
+ return NULL;
}
int main(int argc, char *argv[])
{
- elf_firmware_t f;
- const char * pwd = dirname(argv[0]);
+ //elf_firmware_t f;
+ //const char * pwd = dirname(argv[0]);
avr = avr_make_mcu_by_name("atmega328p");
if (!avr) {
{
if (key == 'q')
exit(0);
- static uint8_t buf[64];
+ //static uint8_t buf[64];
switch (key) {
case 'q':
case 0x1f: // escape
}
}
}
+ return NULL;
}
{
elf_firmware_t f;
const char * fname = "atmega168_timer_64led.axf";
- char path[256];
+ //char path[256];
// sprintf(path, "%s/%s", dirname(argv[0]), fname);
//printf("Firmware pathname is %s\n", path);
b->value = 0;
avr_cycle_timer_register_usec(avr, 100000 / 50, switch_auto, b);
printf("ac_input_init period %duS or %d cycles\n",
- 100000 / 50, avr_usec_to_cycles(avr, 100000 / 50));
+ 100000 / 50, (int)avr_usec_to_cycles(avr, 100000 / 50));
}
if (comp)
b->datapins = (b->datapins & 0xf0) | ((b->pinstate >> IRQ_HD44780_D4) & 0xf);
else
- b->datapins = (b->datapins & 0xf) | ((b->pinstate >> IRQ_HD44780_D4-4) & 0xf0);
+ b->datapins = (b->datapins & 0xf) | ((b->pinstate >> (IRQ_HD44780_D4-4)) & 0xf0);
write = comp;
b->flags ^= (1 << HD44780_FLAG_LOWNIBBLE);
} else { // 8 bits
while (!uart_udp_fifo_isempty(&p->in) && dst < (buffer+sizeof(buffer)))
*dst++ = uart_udp_fifo_read(&p->in);
socklen_t len = dst - buffer;
- size_t r = sendto(p->s, buffer, len, 0, (struct sockaddr*)&p->peer, sizeof(p->peer));
+ /*size_t r = */sendto(p->s, buffer, len, 0, (struct sockaddr*)&p->peer, sizeof(p->peer));
// hdump("udp send", buffer, r);
}
}
+ return NULL;
}
static const char * irq_names[IRQ_UART_UDP_COUNT] = {