71 lines
1.3 KiB
C
71 lines
1.3 KiB
C
/*
|
|
* File: main.c
|
|
* Author: Sebastian H. Gabrielli
|
|
*
|
|
* Created on March 6, 2024, 12:34 PM
|
|
*/
|
|
#include "voltage.h"
|
|
#include "uart.h"
|
|
#define RTC_PERIOD (511)
|
|
#define DELAY_TIME 1000
|
|
#include <avr/io.h>
|
|
#include <avr/interrupt.h>
|
|
#include <util/delay.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
|
|
|
|
//#define F_CPU 4E6
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "uart.h"
|
|
#include <util/delay.h>
|
|
#include <stdint.h>
|
|
#include "themistor-temp.h"
|
|
#include "fan_speeeed.h"
|
|
|
|
|
|
int main() {
|
|
init_uart((uint16_t)9600);
|
|
stdout = &USART_stream;
|
|
//TCA0_init ();
|
|
//PORT_init();
|
|
//test
|
|
|
|
//TCB0_Init();
|
|
//EVSYS_Init();
|
|
//PORT_Init1();
|
|
TCA0_init ();
|
|
PORT_init();
|
|
//TCB0_Init();
|
|
PORT_init1();
|
|
//EVSYS_Init();
|
|
|
|
TCB3.INTCTRL = 0b00000001; // Bit 0 ? CAPT Capture Interrupt Enable
|
|
|
|
sei();
|
|
|
|
while (1) {
|
|
/*
|
|
printf("loop");
|
|
uint16_t yo = TCB3.CNT;
|
|
printf("CNT %u", yo);
|
|
uint16_t stewui = TCB3.CCMP;
|
|
printf("CCMP %u", stewui);
|
|
*/
|
|
;
|
|
}
|
|
}
|
|
|
|
/*ISR (TCB3_INT_vect){
|
|
uint16_t yo = TCB3.CNT;
|
|
printf("CNT %u", yo);
|
|
|
|
uint16_t stewui = TCB3.CCMP;
|
|
printf("CCMP %u", stewui);
|
|
|
|
TCB3.INTFLAGS = 0x03;
|
|
//TCB3.INTFLAGS = PIN0_bm;
|
|
|
|
}*/ |