Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ae22762

Browse filesBrowse files
committed
Combine full version information into one const string in source code to optimize bootloader size, to make the bootloader for MKR VIDOR 4000 less than 8 KByte in size.
1 parent 277a965 commit ae22762
Copy full SHA for ae22762

File tree

1 file changed

+3
-8
lines changed
Filter options

1 file changed

+3
-8
lines changed

‎bootloaders/zero/sam_ba_monitor.c

Copy file name to clipboardExpand all lines: bootloaders/zero/sam_ba_monitor.c
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
#include "board_driver_led.h"
3030
#include <stdlib.h>
3131

32-
const char RomBOOT_Version[] = SAM_BA_VERSION;
3332
// X = Chip Erase, Y = Write Buffer, Z = Checksum Buffer, P = Secure Bit Aware
34-
const char RomBOOT_ExtendedCapabilities[] = "[Arduino:XYZP]";
33+
#define ROMBOOT_EXTENDEDCAPABILITIES "[Arduino:XYZP]"
34+
const char ROMBoot_VersionInformation[] = "v" SAM_BA_VERSION " " ROMBOOT_EXTENDEDCAPABILITIES " " __DATE__ " " __TIME__ "\n\r";
3535

3636
/* Provides one common interface to handle both USART and USB-CDC */
3737
typedef struct
@@ -485,12 +485,7 @@ static void sam_ba_monitor_loop(void)
485485
}
486486
else if (command == 'V') // Read version information
487487
{
488-
sam_ba_putdata( ptr_monitor_if, "v", 1);
489-
sam_ba_putdata( ptr_monitor_if, (uint8_t *) RomBOOT_Version, strlen(RomBOOT_Version));
490-
sam_ba_putdata( ptr_monitor_if, " ", 1);
491-
sam_ba_putdata( ptr_monitor_if, (uint8_t *) RomBOOT_ExtendedCapabilities, strlen(RomBOOT_ExtendedCapabilities));
492-
ptr = (uint8_t*) &(" " __DATE__ " " __TIME__ "\n\r");
493-
sam_ba_putdata( ptr_monitor_if, ptr, strlen(ptr));
488+
sam_ba_putdata( ptr_monitor_if, ROMBoot_VersionInformation, sizeof(ROMBoot_VersionInformation) - 1);
494489
}
495490
else if (command == 'X') // Erase flash
496491
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.