|
|
|
|
@ -7,6 +7,8 @@
|
|
|
|
|
uint8_t foo;
|
|
|
|
|
uint16_t bar;
|
|
|
|
|
uint16_t timertmp;
|
|
|
|
|
uint16_t temperatures[4];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void baz() {
|
|
|
|
|
foo++;
|
|
|
|
|
@ -42,6 +44,15 @@ void hardinit() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void softinit() {
|
|
|
|
|
// TODO: to prevent evil random access and stuff?
|
|
|
|
|
temperatures[0] = 0;
|
|
|
|
|
temperatures[1] = 0;
|
|
|
|
|
temperatures[2] = 0;
|
|
|
|
|
temperatures[3] = 0;
|
|
|
|
|
|
|
|
|
|
//test values
|
|
|
|
|
foo = 0x87;
|
|
|
|
|
bar= 0xfafa;
|
|
|
|
|
|
|
|
|
|
mcpadc_init(ADC_GAIN_2|ADC_CONV_SINGLE|ADC_BITS_16);
|
|
|
|
|
|
|
|
|
|
@ -51,15 +62,18 @@ void softinit() {
|
|
|
|
|
int __attribute__((noreturn)) main(void) {
|
|
|
|
|
hardinit();
|
|
|
|
|
softinit();
|
|
|
|
|
foo = 0x87;
|
|
|
|
|
bar= 0xfafa;
|
|
|
|
|
|
|
|
|
|
muxer_set(2);
|
|
|
|
|
|
|
|
|
|
for(;;){
|
|
|
|
|
|
|
|
|
|
SOFTTIMER(1,500) {
|
|
|
|
|
// do_stuff();
|
|
|
|
|
// for(int i=0; i < 4; i++) {
|
|
|
|
|
// muxer_set(i);
|
|
|
|
|
// if(mcpadc_has_new_data()) {
|
|
|
|
|
// temperatures[i] = mpcadc_get_data();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|