Skip to content

Commit a32b81f

Browse files
committed
Rename FLASH_SECTOR_SIZE macro to avoid conflicts
1 parent 2255408 commit a32b81f

File tree

1 file changed

+17
-17
lines changed
  • features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/source

1 file changed

+17
-17
lines changed

features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/source/MbedTester.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626

2727
#define mbed_tester_printf(...)
2828

29-
#define PHYSICAL_PINS 128
30-
#define LOGICAL_PINS 8
31-
#define FIRMWARE_SIZE 2192012
32-
#define FIRMWARE_REGION_SIZE 0x220000
33-
#define FIRMWARE_HEADER_SIZE 0x10000
34-
#define FLASH_SECTOR_SIZE 0x1000
35-
#define LENGTH_SIZE 0x4
36-
#define CRC_SIZE 0x4
37-
#define FLASH_SPI_FREQ_HZ 2000000
38-
#define ANALOG_COUNT 4
29+
#define PHYSICAL_PINS 128
30+
#define LOGICAL_PINS 8
31+
#define FIRMWARE_SIZE 2192012
32+
#define FIRMWARE_REGION_SIZE 0x220000
33+
#define FIRMWARE_HEADER_SIZE 0x10000
34+
#define MBED_TESTER_FLASH_SECTOR_SIZE 0x1000
35+
#define LENGTH_SIZE 0x4
36+
#define CRC_SIZE 0x4
37+
#define FLASH_SPI_FREQ_HZ 2000000
38+
#define ANALOG_COUNT 4
3939

4040
#define PHYSICAL_NC ((MbedTester::PhysicalIndex)0xFF)
4141

@@ -227,7 +227,7 @@ class MbedTesterBlockDevice : public BlockDevice {
227227
return BD_ERROR_DEVICE_ERROR;
228228
}
229229

230-
if ((addr == 0) && (size == FLASH_SECTOR_SIZE)) {
230+
if ((addr == 0) && (size == MBED_TESTER_FLASH_SECTOR_SIZE)) {
231231
// Allow 4K erase only on the first sector. The flash on the basys3 does
232232
// not allow sector erases at the higher addresses.
233233
_write_enable();
@@ -482,8 +482,8 @@ static bool _firmware_header_valid(BlockDevice &flash, bool &valid)
482482
valid = false;
483483

484484
// Check that first portion is erased
485-
while (pos < FLASH_SECTOR_SIZE - sizeof(SYNC_WORD)) {
486-
read_size = FLASH_SECTOR_SIZE - pos;
485+
while (pos < MBED_TESTER_FLASH_SECTOR_SIZE - sizeof(SYNC_WORD)) {
486+
read_size = MBED_TESTER_FLASH_SECTOR_SIZE - pos;
487487
if (read_size > sizeof(buf)) {
488488
read_size = sizeof(buf);
489489
}
@@ -539,7 +539,7 @@ static bool _firmware_get_active_bank(BlockDevice &flash, bool &second_bank_acti
539539
{
540540
uint8_t buf[sizeof(SYNC_WORD)];
541541

542-
if (flash.read(buf, FLASH_SECTOR_SIZE - sizeof(SYNC_WORD), sizeof(SYNC_WORD)) != BD_ERROR_OK) {
542+
if (flash.read(buf, MBED_TESTER_FLASH_SECTOR_SIZE - sizeof(SYNC_WORD), sizeof(SYNC_WORD)) != BD_ERROR_OK) {
543543
return false;
544544
}
545545

@@ -557,19 +557,19 @@ static bool _firmware_set_active_bank(BlockDevice &flash, bool second_bank)
557557
if (flash.erase(0, FIRMWARE_HEADER_SIZE) != BD_ERROR_OK) {
558558
return false;
559559
}
560-
if (flash.program(BANK_B_SELECT, FLASH_SECTOR_SIZE, sizeof(BANK_B_SELECT)) != BD_ERROR_OK) {
560+
if (flash.program(BANK_B_SELECT, MBED_TESTER_FLASH_SECTOR_SIZE, sizeof(BANK_B_SELECT)) != BD_ERROR_OK) {
561561
return false;
562562
}
563563
}
564-
if (!flash.erase(0, FLASH_SECTOR_SIZE)) {
564+
if (!flash.erase(0, MBED_TESTER_FLASH_SECTOR_SIZE)) {
565565
return false;
566566
}
567567

568568

569569
if (second_bank) {
570570
// Write the sync word. Before the sync word is written the FPGA will boot from the first bank.
571571
// After the sync word is written the FPGA will boot from the second bank.
572-
if (flash.program(SYNC_WORD, FLASH_SECTOR_SIZE - sizeof(SYNC_WORD), sizeof(SYNC_WORD)) != BD_ERROR_OK) {
572+
if (flash.program(SYNC_WORD, MBED_TESTER_FLASH_SECTOR_SIZE - sizeof(SYNC_WORD), sizeof(SYNC_WORD)) != BD_ERROR_OK) {
573573
return false;
574574
}
575575
}

0 commit comments

Comments
 (0)