Skip to content

Commit cd122f2

Browse files
committed
remove other printf debgu message
1 parent 092297a commit cd122f2

File tree

1 file changed

+8
-10
lines changed
  • targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device

1 file changed

+8
-10
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/flash_api.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int32_t flash_init(flash_t *obj)
5454
}
5555
int32_t flash_free(flash_t *obj)
5656
{
57-
/* Disable the Flash option control register access (recommended to protect
57+
/* Disable the Flash option control register access (recommended to protect
5858
the option Bytes against possible unwanted operations) */
5959
if (HAL_FLASH_Lock()) {
6060
return -1;
@@ -68,12 +68,12 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
6868
static FLASH_EraseInitTypeDef EraseInitStruct;
6969
uint32_t FirstSector;
7070
uint32_t SectorError = 0;
71-
71+
7272
if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
7373

7474
return -1;
7575
}
76-
76+
7777
/* Get the 1st sector to erase */
7878
FirstSector = GetSector(address);
7979

@@ -123,7 +123,7 @@ int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data,
123123

124124
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
125125
{
126-
126+
127127
if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
128128
return MBED_FLASH_INVALID_SIZE;
129129
}
@@ -142,7 +142,7 @@ uint32_t flash_get_start_address(const flash_t *obj)
142142
}
143143
uint32_t flash_get_size(const flash_t *obj)
144144
{
145-
return FLASH_SIZE;
145+
return FLASH_SIZE;
146146
}
147147

148148
/**
@@ -152,21 +152,19 @@ uint32_t flash_get_size(const flash_t *obj)
152152
*/
153153
static uint32_t GetSector(uint32_t address)
154154
{
155-
uint32_t sector = 0;
155+
uint32_t sector = 0;
156156
uint32_t tmp = address - ADDR_FLASH_SECTOR_0;
157157
if (address & 0x100000) { // handle 2nd bank
158158
sector = FLASH_SECTOR_12;
159159
tmp = address - ADDR_FLASH_SECTOR_12;
160160
}
161161
if (address < ADDR_FLASH_SECTOR_4) { // 16k sectorsize
162-
//printf("tmp for sectors less than 4: 0X%4x")
163162
sector += tmp >>14;
164163
} else if (address < ADDR_FLASH_SECTOR_5) { //64k sector size
165-
sector += FLASH_SECTOR_4;
164+
sector += FLASH_SECTOR_4;
166165
} else {
167166
sector += 4 + (tmp >>17);
168167
}
169-
printf("address:0X%04x%04x, secteur: %d\n", (address>>16)&0XFFFF, (address&0XFFFF), sector);
170168
return sector;
171169
}
172170

@@ -186,7 +184,7 @@ static uint32_t GetSectorSize(uint32_t Sector)
186184
sectorsize = 64 * 1024;
187185
} else {
188186
sectorsize = 128 * 1024;
189-
}
187+
}
190188
return sectorsize;
191189
}
192190

0 commit comments

Comments
 (0)