8.2.3 boot_lock_bits_set_safe Macro

Set the bootloader lock bits.

Include

<avr/boot.h>

Prototype

int boot_lock_bits_set_safe(unsigned char mask);

Remarks

This macro sets those bits specified by the bit mask in the SPM control register after ensuring that EEPROM and PSM operations are complete. The bootloader lock bits, once set, can only be cleared by a chip erase, which in turn will also erase the boot loader itself.

Example

#include <avr/boot.h>
int main(void)
{
  boot_lock_bits_set_safe(_BV(BLB11)|_BV(BLB12));
}