WDT about 8s
This commit is contained in:
6
inc/osc_configuration.h
Normal file
6
inc/osc_configuration.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef _OSC_CONFIGURATION_
|
||||
#define _OSC_CONFIGURATION_
|
||||
|
||||
void osc_init();
|
||||
|
||||
#endif
|
||||
23
src/osc_configuration.c
Normal file
23
src/osc_configuration.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "BA45F5250.h"
|
||||
#include "stdint.h"
|
||||
#include "build-in.h"
|
||||
#include "osc_configuration.h"
|
||||
#include "macro_define.h"
|
||||
|
||||
void osc_init()
|
||||
{
|
||||
// Control system clock
|
||||
_scc = 0b00000000;
|
||||
|
||||
// Control HIRC clock
|
||||
#if _HIRCC_8M
|
||||
_hircc = 0b00001001;
|
||||
#elif _HIRCC_4M
|
||||
_hircc = 0b00000101;
|
||||
#else
|
||||
_hircc = 0b00000001;
|
||||
#endif
|
||||
|
||||
// Control watchdog timer
|
||||
_wdtc = 0b01010111;
|
||||
}
|
||||
Reference in New Issue
Block a user