Skip to content

Commit 6a8f947

Browse files
committed
MPAE-6033 Added fuses and lockbits
1 parent 793b2bf commit 6a8f947

File tree

7 files changed

+105
-0
lines changed

7 files changed

+105
-0
lines changed

CFD-on-XOSCHF.X/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@
2828
#include <avr/cpufunc.h>
2929
#include <avr/interrupt.h>
3030

31+
// To compile the fuse configuration, the FUSES macro is used. The fuse settings are set to the device production values.
32+
FUSES = {
33+
.WDTCFG = FUSE_WDTCFG_DEFAULT,
34+
.BODCFG = FUSE_BODCFG_DEFAULT,
35+
.OSCCFG = FUSE_OSCCFG_DEFAULT,
36+
.SYSCFG0 = FUSE_SYSCFG0_DEFAULT,
37+
.SYSCFG1 = FUSE_SYSCFG1_DEFAULT,
38+
.CODESIZE = FUSE_CODESIZE_DEFAULT,
39+
.BOOTSIZE = FUSE_BOOTSIZE_DEFAULT,
40+
};
41+
// To compile the lockbits configuration, the LOCKBITS macro is used. The lockbits are set to unlocked.
42+
LOCKBITS = {
43+
LOCKBITS_DEFAULT,
44+
};
45+
3146
void CLOCK_XOSCHF_crystal_init(void);
3247
void CLOCK_CFD_XOSCHF_init(void);
3348

CFD-on-main-clock-with-NMI.X/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@
2929
#include <avr/interrupt.h>
3030
#include <util/delay.h>
3131

32+
// To compile the fuse configuration, the FUSES macro is used. The fuse settings are set to the device production values.
33+
FUSES = {
34+
.WDTCFG = FUSE_WDTCFG_DEFAULT,
35+
.BODCFG = FUSE_BODCFG_DEFAULT,
36+
.OSCCFG = FUSE_OSCCFG_DEFAULT,
37+
.SYSCFG0 = FUSE_SYSCFG0_DEFAULT,
38+
.SYSCFG1 = FUSE_SYSCFG1_DEFAULT,
39+
.CODESIZE = FUSE_CODESIZE_DEFAULT,
40+
.BOOTSIZE = FUSE_BOOTSIZE_DEFAULT,
41+
};
42+
// To compile the lockbits configuration, the LOCKBITS macro is used. The lockbits are set to unlocked.
43+
LOCKBITS = {
44+
LOCKBITS_DEFAULT,
45+
};
46+
3247
void CLOCK_XOSCHF_crystal_init(void);
3348
void CLOCK_CFD_CLKMAIN_init(void);
3449

RTC-with-XOSCHF.X/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@
2626
#include <avr/cpufunc.h>
2727
#include <avr/interrupt.h>
2828

29+
// To compile the fuse configuration, the FUSES macro is used. The fuse settings are set to the device production values.
30+
FUSES = {
31+
.WDTCFG = FUSE_WDTCFG_DEFAULT,
32+
.BODCFG = FUSE_BODCFG_DEFAULT,
33+
.OSCCFG = FUSE_OSCCFG_DEFAULT,
34+
.SYSCFG0 = FUSE_SYSCFG0_DEFAULT,
35+
.SYSCFG1 = FUSE_SYSCFG1_DEFAULT,
36+
.CODESIZE = FUSE_CODESIZE_DEFAULT,
37+
.BOOTSIZE = FUSE_BOOTSIZE_DEFAULT,
38+
};
39+
// To compile the lockbits configuration, the LOCKBITS macro is used. The lockbits are set to unlocked.
40+
LOCKBITS = {
41+
LOCKBITS_DEFAULT,
42+
};
43+
2944
void CLOCK_XOSCHF_crystal_init(void);
3045
void TIMER_RTC_init(void);
3146

TCD-with-XOSCHF-and-PLL.X/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@
2828
void CLOCK_XOSCHF_crystal_PLL_init(void);
2929
void TIMER_TCD0_init(void);
3030

31+
// To compile the fuse configuration, the FUSES macro is used. The fuse settings are set to the device production values.
32+
FUSES = {
33+
.WDTCFG = FUSE_WDTCFG_DEFAULT,
34+
.BODCFG = FUSE_BODCFG_DEFAULT,
35+
.OSCCFG = FUSE_OSCCFG_DEFAULT,
36+
.SYSCFG0 = FUSE_SYSCFG0_DEFAULT,
37+
.SYSCFG1 = FUSE_SYSCFG1_DEFAULT,
38+
.CODESIZE = FUSE_CODESIZE_DEFAULT,
39+
.BOOTSIZE = FUSE_BOOTSIZE_DEFAULT,
40+
};
41+
// To compile the lockbits configuration, the LOCKBITS macro is used. The lockbits are set to unlocked.
42+
LOCKBITS = {
43+
LOCKBITS_DEFAULT,
44+
};
45+
3146
int main(void)
3247
{
3348
CLOCK_XOSCHF_crystal_PLL_init();

TCD-with-XOSCHF.X/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@
2828
void CLOCK_XOSCHF_crystal_init(void);
2929
void TIMER_TCD0_init(void);
3030

31+
// To compile the fuse configuration, the FUSES macro is used. The fuse settings are set to the device production values.
32+
FUSES = {
33+
.WDTCFG = FUSE_WDTCFG_DEFAULT,
34+
.BODCFG = FUSE_BODCFG_DEFAULT,
35+
.OSCCFG = FUSE_OSCCFG_DEFAULT,
36+
.SYSCFG0 = FUSE_SYSCFG0_DEFAULT,
37+
.SYSCFG1 = FUSE_SYSCFG1_DEFAULT,
38+
.CODESIZE = FUSE_CODESIZE_DEFAULT,
39+
.BOOTSIZE = FUSE_BOOTSIZE_DEFAULT,
40+
};
41+
// To compile the lockbits configuration, the LOCKBITS macro is used. The lockbits are set to unlocked.
42+
LOCKBITS = {
43+
LOCKBITS_DEFAULT,
44+
};
45+
3146
int main(void)
3247
{
3348
CLOCK_XOSCHF_crystal_init();

XOSCHF-with-external-clock.X/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@
2727
#include <avr/io.h>
2828
#include <avr/cpufunc.h>
2929

30+
// To compile the fuse configuration, the FUSES macro is used. The fuse settings are set to the device production values.
31+
FUSES = {
32+
.WDTCFG = FUSE_WDTCFG_DEFAULT,
33+
.BODCFG = FUSE_BODCFG_DEFAULT,
34+
.OSCCFG = FUSE_OSCCFG_DEFAULT,
35+
.SYSCFG0 = FUSE_SYSCFG0_DEFAULT,
36+
.SYSCFG1 = FUSE_SYSCFG1_DEFAULT,
37+
.CODESIZE = FUSE_CODESIZE_DEFAULT,
38+
.BOOTSIZE = FUSE_BOOTSIZE_DEFAULT,
39+
};
40+
// To compile the lockbits configuration, the LOCKBITS macro is used. The lockbits are set to unlocked.
41+
LOCKBITS = {
42+
LOCKBITS_DEFAULT,
43+
};
44+
3045
void CLOCK_XOSCHF_clock_init(void);
3146

3247
static inline void LED0_init(void)

XOSCHF-with-external-crystal.X/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@
2727
#include <avr/io.h>
2828
#include <avr/cpufunc.h>
2929

30+
// To compile the fuse configuration, the FUSES macro is used. The fuse settings are set to the device production values.
31+
FUSES = {
32+
.WDTCFG = FUSE_WDTCFG_DEFAULT,
33+
.BODCFG = FUSE_BODCFG_DEFAULT,
34+
.OSCCFG = FUSE_OSCCFG_DEFAULT,
35+
.SYSCFG0 = FUSE_SYSCFG0_DEFAULT,
36+
.SYSCFG1 = FUSE_SYSCFG1_DEFAULT,
37+
.CODESIZE = FUSE_CODESIZE_DEFAULT,
38+
.BOOTSIZE = FUSE_BOOTSIZE_DEFAULT,
39+
};
40+
// To compile the lockbits configuration, the LOCKBITS macro is used. The lockbits are set to unlocked.
41+
LOCKBITS = {
42+
LOCKBITS_DEFAULT,
43+
};
44+
3045
void CLOCK_XOSCHF_crystal_init(void);
3146

3247
static inline void LED0_init(void)

0 commit comments

Comments
 (0)