Quellcode durchsuchen

Fixe misstakes. It work.

Vladimir N. Shilov vor 2 Jahren
Ursprung
Commit
14eca89827
3 geänderte Dateien mit 31 neuen und 4 gelöschten Zeilen
  1. 1 1
      Inc/utils.h
  2. 28 1
      MDK-ARM/MNC-IN12x5.uvoptx
  3. 2 2
      Src/utils.c

+ 1 - 1
Inc/utils.h

@@ -21,7 +21,7 @@ typedef enum {
 
 /* Defines */
 #define FLASH_PAGE_START  0x0800F800
-#define FLASH_PAGE_END    0x0800FFFF
+#define FLASH_PAGE_END    0x0800FFF8
 #define FLASH_PAGE_NMB    31
 #define FLASH_PAGE_NUM    1
 

+ 28 - 1
MDK-ARM/MNC-IN12x5.uvoptx

@@ -140,7 +140,7 @@
         <SetRegEntry>
           <Number>0</Number>
           <Key>DLGUARM</Key>
-          <Name></Name>
+          <Name>ИЪ+w</Name>
         </SetRegEntry>
         <SetRegEntry>
           <Number>0</Number>
@@ -159,6 +159,29 @@
         </SetRegEntry>
       </TargetDriverDllRegistry>
       <Breakpoint/>
+      <WatchWindow1>
+        <Ww>
+          <count>0</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>\\MNC_IN12x5\../Src/clock.c\Clock_Init\flash_res</ItemText>
+        </Ww>
+      </WatchWindow1>
+      <MemoryWindow1>
+        <Mm>
+          <WinNumber>1</WinNumber>
+          <SubType>0</SubType>
+          <ItemText>0x0800F800</ItemText>
+          <AccSizeX>0</AccSizeX>
+        </Mm>
+      </MemoryWindow1>
+      <MemoryWindow2>
+        <Mm>
+          <WinNumber>2</WinNumber>
+          <SubType>0</SubType>
+          <ItemText>\\MNC_IN12x5\../Src/utils.c\Flash_Read\val</ItemText>
+          <AccSizeX>0</AccSizeX>
+        </Mm>
+      </MemoryWindow2>
       <Tracepoint>
         <THDelay>0</THDelay>
       </Tracepoint>
@@ -214,6 +237,10 @@
           <Name>System Viewer\EXTI</Name>
           <WinId>35903</WinId>
         </Entry>
+        <Entry>
+          <Name>System Viewer\FLASH</Name>
+          <WinId>35893</WinId>
+        </Entry>
         <Entry>
           <Name>System Viewer\GPIOA</Name>
           <WinId>35895</WinId>

+ 2 - 2
Src/utils.c

@@ -13,7 +13,7 @@ flash_result_t Flash_Write(uint64_t * data) {
   val.u64 = *data;
 
   // search first free cell
-  while ((address < FLASH_PAGE_END) || ((*(__IO uint32_t*)address) != 0xffffffff)) {
+  while ((address < FLASH_PAGE_END) && ((*(__IO uint32_t*)address) != 0xffffffff)) {
     address += 8;
   }
 
@@ -74,7 +74,7 @@ flash_result_t Flash_Read(uint64_t * data) {
   flash_result_t res = Flash_Ok;
   uint32_t address = FLASH_PAGE_START;
 
-  while ((address < FLASH_PAGE_END) || ((*(__IO uint32_t*)address) != 0xffffffff)) {
+  while ((address < FLASH_PAGE_END) && ((*(__IO uint32_t*)address) != 0xffffffff)) {
     val.u32[0] = (*(__IO uint32_t*)address);
     address += 4;
     val.u32[1] = (*(__IO uint32_t*)address);