forked from litl/lufa-lib
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename FunctionAttributes.h to Attributes.h, as some attributes are a…
…pplicable to variables also. Add new ATTR_NOINIT attribute for global variables. Add the beginnings of a SDP implentation to the incomplete BluetoothHost demo. Add const attribute to the Mass Storage Host driver functions where it was applicable, but missing. git-svn-id: http://lufa-lib.googlecode.com/svn@1209 d5102386-fcda-11dd-9fdb-3debd5008f28
- Loading branch information
Dean
authored and
Dean
committed
Apr 15, 2010
1 parent
d0ea04b
commit bbb96af
Showing
12 changed files
with
190 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** \file | ||
* | ||
* This file contains special DoxyGen information for the generation of the main page and other special | ||
* documentation pages. It is not a project source file. | ||
*/ | ||
|
||
/** | ||
* \page Page_SoftwareBootloaderStart Entering the Bootloader via Software | ||
* | ||
* A common requirement of many applications is the ability to jump to the programmed bootloader of a chip | ||
* on demand, via the code's firmware (i.e. not as a result of any physical user interaction with the | ||
* hardware). This might be required because the device does not have any physical user input, or simply | ||
* just to streamline the device upgrade process on the host PC. | ||
* | ||
* The following C code snippet may be used to enter the bootloader upon request by the user application. | ||
* By using the watchdog to physically reset the controller, it is ensured that all system hardware is | ||
* completely reset to their defaults before the bootloader is run. This is important; since bootloaders | ||
* are written to occupy a very limited space, they usually make assumptions about the register states based | ||
* on the default values after a hard-reset of the chip. | ||
* | ||
* \code | ||
* #include <avr/wdt.h> | ||
* #include <avr/io.h> | ||
* #include <util/delay.h> | ||
* | ||
* #include <LUFA/Common/Common.h> | ||
* #include <LUFA/Drivers/USB/USB.h> | ||
* | ||
* uint32_t Boot_Key ATTR_NO_INIT; | ||
* | ||
* #define MAGIC_BOOT_KEY 0xDC42ACCA | ||
* #define BOOTLOADER_START_ADDRESS ({FLASH_SIZE_BYTES} - {BOOTLOADER_SEC_SIZE_BYTES}) | ||
* | ||
* int Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3); | ||
* int Bootloader_Jump_Check(void) | ||
* { | ||
* // If the bootloader key is correct, clear it and jump to the bootloader | ||
* if (Boot_Key == MAGIC_BOOT_KEY) | ||
* { | ||
* Boot_Key = 0; | ||
* ((void (*)(void))BOOTLOADER_START_ADDRESS)(); | ||
* } | ||
* } | ||
* | ||
* void Jump_To_Bootloader(void) | ||
* { | ||
* // If USB is used, detatch from the bus and wait 2 seconds for the host to register it | ||
* USB_ShutDown(); | ||
* for (uint8_t i = 0; i < 128; i++) | ||
* _delay_ms(16); | ||
* | ||
* // Set the bootloader key to the magic value and force a reset | ||
* Boot_Key = MAGIC_BOOT_KEY; | ||
* wdt_enable(WDTO_250MS); | ||
* for (;;); | ||
* } | ||
* \endcode | ||
* | ||
* Note that the bootloader magic key can be any arbitrary value. The {FLASH_SIZE_BYTES} and | ||
* {BOOTLOADER_SEC_SIZE_BYTES} tokens should be replaced with the total flash size of the AVR | ||
* in bytes, and the allocated size of the bootloader section for the target AVR. | ||
* | ||
*/ |