Commit 4d52e67a authored by akatran's avatar akatran

Update compatibility.c

parent a8f100b2
......@@ -10,7 +10,6 @@
#include <util/delay.h>
volatile uint32_t _millis;
//volatile uint32_t _secsCounter;
void __msleep(int milisec)
{
......@@ -35,17 +34,17 @@ void __start_timer()
// Timer details : Clock is 32MHz, Timer resolution is 8bit, Prescaler is 256, Period is 124, Real Time is 0.001s
/* Set the timer to run at the fastest rate. */
TCC0.CTRLA = TC_CLKSEL_DIV256_gc;
TCE0.CTRLA = TC_CLKSEL_DIV256_gc;
/* Configure the timer for normal counting. */
TCC0.CTRLB = TC_WGMODE_NORMAL_gc;
TCE0.CTRLB = TC_WGMODE_NORMAL_gc;
/* At 2 MHz, one tick is 0.5 us. Set period to 8 us. */
TCC0.PER = 124;
TCE0.PER = 124;
//TCC0.PER = 2;
/* Configure timer to generate an interrupt on overflow. */
TCC0.INTCTRLA = TC_OVFINTLVL_HI_gc;
TCE0.INTCTRLA = TC_OVFINTLVL_HI_gc;
/* Enable this interrupt level. */
PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
......@@ -61,12 +60,6 @@ long __millis()
void update_milisec()
{
_millis++;
//_secsCounter++;
//if (_secsCounter>=1000)
//{
//_secsCounter =0;
//PORTF.OUTTGL = 128;
//}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment