did some work on main.c but that is all fucked up
This commit is contained in:
parent
9232763962
commit
ba31b296eb
63
main.c
63
main.c
|
@ -1,18 +1,73 @@
|
|||
#include "time.h"
|
||||
#include "usart.h"
|
||||
#include "analogin.h"
|
||||
#include "configuration.h"
|
||||
#include <util/delay.h>
|
||||
#include <stdlib.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
void
|
||||
on_channel_measured(unsigned char channel
|
||||
, unsigned int value)
|
||||
{
|
||||
// struct eigentime_s eigentime;
|
||||
// get_eigentime(&eigentime);
|
||||
// char buffer[32];
|
||||
// int i;
|
||||
//utoa(eigentime.high, buffer, 16);
|
||||
//i = 0;
|
||||
//while(buffer[i])
|
||||
//{
|
||||
// usart_putc(buffer[i++]);
|
||||
//}
|
||||
//usart_putc(',');
|
||||
//utoa(eigentime.low, buffer, 16);
|
||||
//i = 0;
|
||||
//while(buffer[i])
|
||||
//{
|
||||
// usart_putc(buffer[i++]);
|
||||
//}
|
||||
//usart_putc(',');
|
||||
//usart_putc('0' + channel);
|
||||
//usart_putc(',');
|
||||
|
||||
//utoa(value, buffer, 16);
|
||||
//i = 0;
|
||||
//while(buffer[i])
|
||||
//{
|
||||
// usart_putc(buffer[i++]);
|
||||
//}
|
||||
//usart_putc('r');
|
||||
//usart_putc('0' + channel);
|
||||
//usart_putc('\n');
|
||||
PORTB ^= _BV(PB1);
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
configuration_init();
|
||||
time_init();
|
||||
usart_init();
|
||||
analogin_init();
|
||||
|
||||
DDRB |= _BV(PB1);
|
||||
DDRB |= _BV(PB2);
|
||||
//usart_putc('s');
|
||||
//usart_putc('t');
|
||||
//usart_putc('a');
|
||||
//usart_putc('r');
|
||||
//usart_putc('t');
|
||||
//usart_putc(' ');
|
||||
//usart_putc('o');
|
||||
//usart_putc('k');
|
||||
//usart_putc('\n');
|
||||
|
||||
while(1)
|
||||
{
|
||||
_delay_ms(1000);
|
||||
unsigned int eigentime = get_eigentime();
|
||||
usart_putc((char) eigentime);
|
||||
usart_putc((char)(eigentime >> 8));
|
||||
_delay_ms(100);
|
||||
|
||||
PORTB ^= _BV(PB2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user