فهرست منبع

Архив на 8 каналов.

TelenkovDmitry 8 ماه پیش
والد
کامیت
1511b0775c

+ 198 - 34
fw/modules/log/log.c

@@ -5,6 +5,7 @@
 #include "FreeRTOS.h"
 #include "task.h"
 #include "semphr.h"
+#include "event_groups.h"
 #include "rtc.h"
 #include "settings_api.h"
 #include <string.h>
@@ -21,14 +22,19 @@ static bool log_init_f = false;
 static bool archive_init_f = false;
 
 struct ringfs fs_log;
-struct ringfs fs_archive;
+//struct ringfs fs_archive;
+struct ringfs fs_ch_arch[ARCH_CH_NUMBER];
+
 
 SemaphoreHandle_t log_mutex;
 xQueueHandle log_queue;
+EventGroupHandle_t archive_event;
 
 uint16_t log_entries_capacity;
 uint16_t archive_entries_capacity;
 
+uint32_t archive_cnt[ARCH_CH_NUMBER] = {0};
+
 void archive_task(void *params);
 void log_task(void *params);
 
@@ -76,6 +82,58 @@ static struct ringfs_flash_partition ringfs_flash_archive =
 	.read = op_read,
 };
 
+//
+static struct ringfs_flash_partition fingfs_flash_ch_arch[ARCH_CH_NUMBER] = 
+{
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET + ARCHIVE_CHANNEL_OFFSET*1,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET + ARCHIVE_CHANNEL_OFFSET*2,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET + ARCHIVE_CHANNEL_OFFSET*3,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET + ARCHIVE_CHANNEL_OFFSET*4,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET + ARCHIVE_CHANNEL_OFFSET*5,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET + ARCHIVE_CHANNEL_OFFSET*6,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+    {
+        .sector_offset = ARCHIVE_FLASH_SECTOR_OFFSET + ARCHIVE_CHANNEL_OFFSET*7,
+        .sector_erase = op_sector_erase,
+        .program = op_program,
+        .read = op_read,
+    },
+};
 
 
 //
@@ -101,24 +159,33 @@ void log_init(bool format)
 	DBG printf("FAT1 true\r\n");
     
     // ---------------------------------------------------------------------- //
-    // Архив
-    
-	ringfs_flash_archive.sector_size = spi_flash_desc.sector_size;
-	ringfs_flash_archive.sector_count = ARCHIVE_FLASH_SECTOR_COUNT;
-
-	ringfs_init(&fs_archive, &ringfs_flash_archive, ARCHIV_ENTRY_VERSION, sizeof(archive_entry_t));
-    
-	if (format || ringfs_scan(&fs_archive) != 0) {
-		DBG printf("FAT2 false\r\n");
-		ringfs_format(&fs_archive);
-	}
-	DBG printf("FAT2 true\r\n");
+    // Архив. 8 буфером на каждый канал.
+   
+    for (uint8_t i = 0; i < ARCH_CH_NUMBER; i ++) 
+    {
+        fingfs_flash_ch_arch[i].sector_size = spi_flash_desc.sector_size,
+        
+        fingfs_flash_ch_arch[i].sector_count = ARCHIVE_FLASH_SECTOR_COUNT,
+        
+        ringfs_init(&fs_ch_arch[i], &fingfs_flash_ch_arch[i], 
+                    ARCHIV_ENTRY_VERSION + i, sizeof(archive_entry_t));
+        
+        if (ringfs_scan(&fs_ch_arch[i]) != 0) {
+            DBG printf("FAT for channel %u is false\r\n", i + 1);
+            ringfs_format(&fs_ch_arch[i]);
+        }
+        DBG printf("FAT for channel %u is true\r\n", i + 1);
+    }
 
+    // ---------------------------------------------------------------------- //
 	log_mutex = xSemaphoreCreateMutex();
 
     log_entries_capacity = ringfs_capacity(&fs_log);
     
-    archive_entries_capacity = ringfs_capacity(&fs_archive);
+    archive_entries_capacity = ringfs_capacity(&fs_ch_arch[0]);
+    
+    // Event
+    archive_event = xEventGroupCreate();
     
 	xTaskCreate(archive_task, "archive_task", 2*configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);
         
@@ -129,10 +196,51 @@ void log_init(bool format)
     log_init_f = true;
     
     archive_init_f = true;
+    
+    // Таймер для ведения архива с разным периодом по разным каналам
+    log_init_archive_tim();  
+}
+
+// Настройка таймера на частоту 10 Гц
+void log_init_archive_tim(void)
+{
+    printf("Init log timer...\r\n");
+    
+    crm_clocks_freq_type crm_clocks_freq_struct = {0};
+    
+    crm_periph_clock_enable(CRM_TMR14_PERIPH_CLOCK, TRUE);
+
+    crm_clocks_freq_get(&crm_clocks_freq_struct);
+    tmr_base_init(TMR14, 999, (crm_clocks_freq_struct.ahb_freq / 10000) - 1);
+    tmr_cnt_dir_set(TMR14, TMR_COUNT_UP);
+        
+    tmr_flag_clear(TMR14, TMR_OVF_FLAG);
+
+    nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
+    nvic_irq_enable(TMR8_TRG_HALL_TMR14_IRQn, 5, 0);
+       
+    tmr_counter_enable(TMR14, TRUE);
+    
+    tmr_interrupt_enable(TMR14, TMR_OVF_INT, TRUE);
 }
 
 //
-int log_fetch(void *entry, entry_type_t entry_type, uint32_t timeout) 
+void TMR8_TRG_HALL_TMR14_IRQHandler(void)
+{
+    if (tmr_flag_get(TMR14, TMR_OVF_FLAG) != RESET)
+    {
+        tmr_flag_clear(TMR14, TMR_OVF_FLAG);
+        
+        if (archive_state) 
+        {
+            log_check_archive_cnt();
+            printf("TMR_14 irq\r\n");
+        }
+    }
+}
+
+//
+int log_fetch(void *entry, entry_type_t entry_type, uint8_t ch, uint32_t timeout) 
 {
     int ret;
     
@@ -143,7 +251,7 @@ int log_fetch(void *entry, entry_type_t entry_type, uint32_t timeout)
     if (entry_type == LOG_ENTRY)
         ret = ringfs_fetch(&fs_log, entry);
     else if (entry_type == ARCHIVE_ENTRY)
-        ret = ringfs_fetch(&fs_archive, entry);
+        ret = ringfs_fetch(&fs_ch_arch[ch], entry);
     else ret = -1;
 
     xSemaphoreGive(log_mutex);
@@ -151,7 +259,7 @@ int log_fetch(void *entry, entry_type_t entry_type, uint32_t timeout)
 }
 
 //
-int log_discard(void *entry, entry_type_t entry_type, uint32_t timeout)
+int log_discard(void *entry, entry_type_t entry_type, uint8_t ch, uint32_t timeout)
 {
     int ret;
       
@@ -162,7 +270,7 @@ int log_discard(void *entry, entry_type_t entry_type, uint32_t timeout)
     if (entry_type == LOG_ENTRY)
         ret = ringfs_discard(&fs_log);
     else if (entry_type == ARCHIVE_ENTRY)
-        ret = ringfs_discard(&fs_archive);
+        ret = ringfs_discard(&fs_ch_arch[ch]);
     else ret = -1;
     
     xSemaphoreGive(log_mutex);
@@ -170,7 +278,7 @@ int log_discard(void *entry, entry_type_t entry_type, uint32_t timeout)
 }
 
 //
-int log_append(void *entry, entry_type_t entry_type)
+int log_append(void *entry, entry_type_t entry_type, uint8_t ch)
 {
     int ret;
     TM_RTC_t time;
@@ -196,7 +304,7 @@ int log_append(void *entry, entry_type_t entry_type)
     {
         archive_etnry_ptr = (archive_entry_t*)entry;
         archive_etnry_ptr->crc = crc_8(entry, sizeof(archive_entry_t) - 1);
-        ret = ringfs_append(&fs_archive, entry);
+        ret = ringfs_append(&fs_ch_arch[ch], entry);
     }
     else ret = -1;
     
@@ -208,15 +316,13 @@ int log_append(void *entry, entry_type_t entry_type)
 //
 uint16_t log_capacity(void)
 {
-    //return ringfs_count_estimate(&fs_log);
     return ringfs_count_exact(&fs_log);
 }
 
 //
-uint16_t log_arch_capacity(void)
+uint16_t log_arch_capacity(uint8_t ch)
 {
-    //return ringfs_count_estimate(&fs_archive);
-    return ringfs_count_exact(&fs_archive);
+    return ringfs_count_exact(&fs_ch_arch[ch]);
 }
 
 // -------------------------------------------------------------------------- //
@@ -247,12 +353,13 @@ uint8_t crc_8(uint8_t *data, int length)
 
 // val - 0 - журнал
 // val - 1 - архив
-void log_info(uint8_t val)
+// ch - номер канала архива
+void log_info(uint8_t val, uint8_t ch)
 {
     if (val > 1)
         return;
   
-    struct ringfs *fs = val == 0 ? &fs_log : &fs_archive;
+    struct ringfs *fs = val == 0 ? &fs_log : &fs_ch_arch[ch];
     
     int capacity_flash = 0;
     int count_flash = 0;
@@ -278,7 +385,8 @@ void log_info(uint8_t val)
 
 // val - 0 - журнал
 // val - 1 - архив
-void log_format(uint8_t val)
+// ch - номер канала архива
+void log_format(uint8_t val, uint8_t ch)
 {
     if (val == 0) {
         DBG printf("Formating log partition...\r\n");
@@ -286,12 +394,12 @@ void log_format(uint8_t val)
     } 
     else if (val == 1) {
         DBG printf("Formating archive partition...\r\n");
-        ringfs_format(&fs_archive);
+        ringfs_format(&fs_ch_arch[ch]);
     }
 }
 
 // Добавить n записей журнала
-int log_add_random_entry(uint8_t val, uint32_t cnt_entry)
+int log_add_random_entry(uint8_t val, uint32_t cnt_entry, uint8_t ch)
 {
     int ret;
     log_entry_t log_entry = {0};
@@ -311,7 +419,7 @@ int log_add_random_entry(uint8_t val, uint32_t cnt_entry)
             log_entry.channel_number = log_index;
             log_entry.value = (float)log_index++;
             
-            ret = log_append((void*)&log_entry, LOG_ENTRY);
+            ret = log_append((void*)&log_entry, LOG_ENTRY, 0);
         }
         DBG printf("Result: %u\r\n", ret);
     }
@@ -324,7 +432,7 @@ int log_add_random_entry(uint8_t val, uint32_t cnt_entry)
         {
             archive_entry.input_value = archive_index++;
 
-            ret = log_append((void*)&archive_entry, ARCHIVE_ENTRY);
+            ret = log_append((void*)&archive_entry, ARCHIVE_ENTRY, ch);
         }
         DBG printf("Result: %u\r\n", ret);
     }
@@ -356,7 +464,7 @@ int log_add_entry(log_event_type_t type, log_event_state_t state,
 void test_fetch(void)
 {
     archive_entry_t entry = {0};
-    log_fetch(&entry, ARCHIVE_ENTRY, portMAX_DELAY);
+    log_fetch(&entry, ARCHIVE_ENTRY, 0, portMAX_DELAY);
     //printf("\r\n%" PRId64 " [ms]\r\n", rtc_get_ms());
     printf("[entry] timestamp = % " PRId64 ", value = %u, crc = %u\r\n", entry.timestamp, entry.input_value, entry.crc);
 }
@@ -377,10 +485,44 @@ void log_log_state(bool state)
 void archive_task(void *params)
 {
     int ret = 0;
+    uint32_t event = 0;
     archive_entry_t entry = {0};
+    EventBits_t bits;
     
     for (;;)
     {
+        bits = xEventGroupWaitBits(archive_event, ARCH_CH_1 | ARCH_CH_2 | 
+                                   ARCH_CH_3 | ARCH_CH_4 | ARCH_CH_5 | 
+                                   ARCH_CH_6 | ARCH_CH_7 | ARCH_CH_8,
+                                   pdTRUE, pdFALSE, portMAX_DELAY);
+      
+        for (uint32_t i = 0; i < ARCH_CH_NUMBER; i++)
+        {
+            if (bits & (1 << i))
+            {
+                DBG printf("Archive event: %u\r\n", (1 << i));
+                
+                entry.timestamp = 0;
+                entry.input_value = (uint8_t)input_state_bit;
+        
+                DBG printf("Append archive entry...");
+                ret = log_append((void*)&entry, ARCHIVE_ENTRY, i - 1);
+                
+                if (ret != 0) {
+                    DBG printf("FAIL\r\n");
+                }
+                else {  
+                    DBG printf("OK\r\n");
+                }
+            }
+        }
+        
+        
+        
+        
+        
+        
+#if 0      
         if ((!archive_state) || (!archive_init_f)) {
             vTaskDelay(1000);
             continue;
@@ -391,7 +533,7 @@ void archive_task(void *params)
         
         DBG printf("Append archive entry...");
         
-        ret = log_append((void*)&entry, ARCHIVE_ENTRY);
+        ret = log_append((void*)&entry, ARCHIVE_ENTRY, 0);
               
         if (ret != 0) {
             DBG printf("FAIL\r\n");
@@ -401,6 +543,7 @@ void archive_task(void *params)
         }
         
         vTaskDelay(settings.period_archive*1000);
+#endif        
     }
 }
 
@@ -415,8 +558,29 @@ void log_task(void *params)
         if (xQueueReceive(log_queue, &entry, portMAX_DELAY) == pdTRUE)
         {
             DBG printf("Try append LOG entry... ");
-            ret = log_append((void*)&entry, LOG_ENTRY);
+            ret = log_append((void*)&entry, LOG_ENTRY, 0);
             DBG printf("Result: %i\r\n", ret);
         }
     }
 }
+
+// Вызывается в прерывании таймера с частотой 10 Гц 
+void log_check_archive_cnt(void)
+{
+    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
+      
+    for (uint8_t i = 0; i < ARCH_CH_NUMBER; i++)
+    {
+        if (archive_cnt[i]++ == 10*settings.period_archive[i])
+        {
+            archive_cnt[i] = 0;
+            
+            // Номер канала с 0..7
+
+            
+            printf("Send event: %u\r\n", 1 << i);
+            xEventGroupSetBitsFromISR(archive_event, 1 << i, &xHigherPriorityTaskWoken);
+        }
+    }
+}
+

+ 43 - 10
fw/modules/log/log.h

@@ -7,7 +7,8 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-  
+    
+
 #define LOG_ENTRY_VERSION               1
 
 #define ARCHIV_ENTRY_VERSION            1
@@ -16,16 +17,42 @@ extern "C" {
 
 #define LOG_FLASH_SECTOR_COUNT          51
 
-#define ARCHIVE_FLASH_SECTOR_OFFSET     260
+#define ARCHIVE_FLASH_SECTOR_OFFSET     60
 
 #define ARCHIVE_FLASH_SECTOR_COUNT      38
 
-#define SECTOR_COUNT (spi_flash_desc.sector_count/2 - LOG_FLASH_SECTOR_OFFSET)
+#define ARCHIVE_CHANNEL_OFFSET          (ARCHIVE_FLASH_SECTOR_COUNT + 4)
+  
+#define SECTOR_COUNT (spi_flash_desc.sector_count/2 - LOG_FLASH_SECTOR_OFFSET)  
+
 
+  
+  
 #define MB_ARCHIVE_ENTRY                0x06
   
 #define MB_LOG_ENTRY                    0x07
 
+  
+// -------------------------------------------------------------------------- //
+// Настройки архивов
+
+#define ARCH_CH_NUMBER                  8  
+  
+// События архивов
+typedef enum
+{
+    ARCH_CH_1 = 1 << 0,
+    ARCH_CH_2 = 1 << 1,
+    ARCH_CH_3 = 1 << 2,
+    ARCH_CH_4 = 1 << 3,
+    ARCH_CH_5 = 1 << 4,
+    ARCH_CH_6 = 1 << 5,
+    ARCH_CH_7 = 1 << 6,
+    ARCH_CH_8 = 1 << 7,
+    
+} arch_event_t;
+
+  
 //
 typedef enum 
 {
@@ -95,19 +122,22 @@ typedef __packed struct
 void log_init(bool format);
 
 //
-int log_fetch(void *entry, entry_type_t entry_type, uint32_t timeout);
+void log_init_archive_tim(void);
+
+//
+int log_fetch(void *entry, entry_type_t entry_type, uint8_t ch, uint32_t timeout);
 
 //
-int log_discard(void *entry, entry_type_t entry_type, uint32_t timeout);
+int log_discard(void *entry, entry_type_t entry_type, uint8_t ch, uint32_t timeout);
 
 // 
-int log_append(void *entry, entry_type_t entry_type);
+int log_append(void *entry, entry_type_t entry_type, uint8_t ch);
 
 //
 uint16_t log_capacity(void);
 
 //
-uint16_t log_arch_capacity(void);
+uint16_t log_arch_capacity(uint8_t ch);
 
 // -------------------------------------------------------------------------- //
 // misc
@@ -118,13 +148,13 @@ uint8_t crc_8(uint8_t *data, int length);
 // Tests
 
 //
-void log_info(uint8_t val);
+void log_info(uint8_t val, uint8_t ch);
 
 //
-void log_format(uint8_t val);
+void log_format(uint8_t val, uint8_t ch);
 
 //
-int log_add_random_entry(uint8_t val, uint32_t cnt_entry);
+int log_add_random_entry(uint8_t val, uint32_t cnt_entry, uint8_t ch);
 
 //
 int log_add_entry(log_event_type_t type, log_event_state_t state, 
@@ -142,6 +172,9 @@ void log_log_state(bool state);
 //
 void test_archive_format(void);
 
+//
+void log_check_archive_cnt(void);
+
 // -------------------------------------------------------------------------- //
 
 extern uint16_t log_entries_capacity;

+ 2 - 2
fw/modules/log/log_api.c

@@ -49,7 +49,7 @@ int log_get_archive_entry(uint32_t index, struct ringfs *fs, void *entry)
 		fs->cursor.slot = fs->cursor_position%fs->slots_per_sector;
 	}
     
-    log_fetch(entry, ARCHIVE_ENTRY, portMAX_DELAY);
+    log_fetch(entry, ARCHIVE_ENTRY, 0, portMAX_DELAY);
 #if 1
     printf("[archive entry] timestamp = % " PRId64 ", value = %u, crc = %u\r\n", 
            ent->timestamp, ent->input_value, ent->crc);
@@ -74,7 +74,7 @@ int log_get_log_entry(uint32_t index, struct ringfs *fs, void *entry)
 		fs->cursor.slot = fs->cursor_position%fs->slots_per_sector;
 	}
     
-    log_fetch(entry, LOG_ENTRY, portMAX_DELAY);
+    log_fetch(entry, LOG_ENTRY, 0, portMAX_DELAY);
    
 #if 0
 /*

+ 26 - 1
fw/modules/modbus/modbus.c

@@ -30,6 +30,7 @@
 static USHORT	usRegHoldingStart = REG_HOLDING_START;
 extern UCHAR    rcvAddress;
 extern bool psw_ok;
+extern uint8_t arch_channel;
 
 //osThreadId modbus_task_handle;
 static void modbus_task(void *params);
@@ -160,9 +161,13 @@ void modbus_params(void *params)
                   
                 case MB_SAVE_SETTINGS :
                     
+                    // Изменились ли настройки
+                    bool change = settings_is_changed(&settings);
+                    
+                    // Сохранение настроек
                     ret = settings_save(&settings);
                   
-                    if (settings_is_changed(&settings)) {
+                    if (change) {
                         log_add_entry(LOG_CHANGE_CONFIG, (log_event_state_t)ret, 0, 0);
                     }
                     
@@ -179,6 +184,26 @@ void modbus_params(void *params)
 
                 break;
                 
+                case MB_LOG_CLEAR :
+                    
+                    log_format(0, 0);
+                    
+                    // -------------------------------------------------------------------------- //
+                    // EVENT. Очиста журнала.    
+                    log_add_entry(LOG_CLEAR, (log_event_state_t)LOG_EVENT_STATE_OK, 0, 0.0);
+
+                break;
+                
+                case MB_ARCHIVE_CLEAR :
+                  
+                    log_format(1, arch_channel);
+                    
+                    // -------------------------------------------------------------------------- //
+                    // EVENT. Очиста архива.    
+                    log_add_entry(LOG_CLEAR, (log_event_state_t)LOG_EVENT_STATE_OK, 0, 1.0);
+                    
+                break;
+                  
                 case MB_RESET :
                   
                     vTaskDelay(100);

+ 63 - 45
fw/modules/modbus/modbus.h

@@ -1,46 +1,64 @@
-#ifndef __MODBUS_H
-#define __MODBUS_H
-
-
-//#define MB__DEBUG
-
-#ifdef MB__DEBUG
-#define MBDBG
-#else
-#define MBDBG if (0)
-#endif
-
-
-//
-typedef enum 
-{
-    MB_NO_ACTION = 0,
-    MB_CHANGE_ADDR,
-    MB_CHANGE_PORT_SETTINGS,
-    MB_DEF_SETTINGS,
-    MB_PART_DEF_SETTINGS,
-    MB_SAVE_SETTINGS,
-    MB_SAVE_SYS_SETTINGS,
-    MB_CHANGE_PWM_FREQ_1,
-    MB_CHANGE_PWM_FREQ_2,
-    MB_CHANGE_PWM_FREQ_3,
-    MB_RESET,
-    MB_PAS_OK,
-    MB_PAS_ERR
-  
-} mb_delay_action_t ;
-
-
-//
-void mb_init(void);
-
-//
-void modbus_reset(void const * params);
-
-//
-void settings_timer(void const * params);
-
-//
-void modbus_port_timer(void const * params);
-
+#ifndef __MODBUS_H
+#define __MODBUS_H
+
+
+//#define MB__DEBUG
+
+#ifdef MB__DEBUG
+#define MBDBG
+#else
+#define MBDBG if (0)
+#endif
+
+
+// Коды команд управлления контроллером
+typedef enum
+{
+    MB_COM_SETTINGS_SAVE = 1,
+    MB_COM_LOG_CLEAR = 2,
+    MB_COM_ARCH_CLEAR_1 = 3,
+    MB_COM_ARCH_CLEAR_2 = 4,
+    MB_COM_ARCH_CLEAR_3 = 5,
+    MB_COM_ARCH_CLEAR_4 = 6,
+    MB_COM_ARCH_CLEAR_5 = 7,
+    MB_COM_ARCH_CLEAR_6 = 8,
+    MB_COM_ARCH_CLEAR_7 = 9,
+    MB_COM_ARCH_CLEAR_8 = 10,
+      
+} mb_command_t;
+
+//
+typedef enum 
+{
+    MB_NO_ACTION = 0,
+    MB_CHANGE_ADDR,
+    MB_CHANGE_PORT_SETTINGS,
+    MB_DEF_SETTINGS,
+    MB_PART_DEF_SETTINGS,
+    MB_SAVE_SETTINGS,
+    MB_SAVE_SYS_SETTINGS,
+    MB_CHANGE_PWM_FREQ_1,
+    MB_CHANGE_PWM_FREQ_2,
+    MB_CHANGE_PWM_FREQ_3,
+    MB_RESET,
+    MB_PAS_OK,
+    MB_PAS_ERR,
+    MB_LOG_CLEAR,
+    MB_ARCHIVE_CLEAR,
+        
+} mb_delay_action_t ;
+
+
+//
+void mb_init(void);
+
+//
+void modbus_reset(void const * params);
+
+//
+void settings_timer(void const * params);
+
+//
+void modbus_port_timer(void const * params);
+
 #endif // __MODBUS_H

+ 124 - 26
fw/modules/modbus/modbus_params.c

@@ -23,12 +23,29 @@ uint8_t fw_version[8];
 uint16_t save_sys_cmd = 0;  // Команда сохранения системных настроек
 uint16_t system_cmd = 0;	// Команда управления контроллером
 uint64_t value_64 = 0;
+uint8_t value_8 = 0;
+uint8_t arch_channel = 0;
 
 void get_time(uint8_t* buf, uint8_t size);
 void get_din_mode(uint8_t* buf, uint8_t size);
 
 void get_log_entries_number(uint8_t* buf, uint8_t size);
-void get_archive_entries_number(uint8_t* buf, uint8_t size);
+
+void get_arch_ch_1(uint8_t* buf, uint8_t size);
+void get_arch_ch_2(uint8_t* buf, uint8_t size);
+void get_arch_ch_3(uint8_t* buf, uint8_t size);
+void get_arch_ch_4(uint8_t* buf, uint8_t size);
+void get_arch_ch_5(uint8_t* buf, uint8_t size);
+void get_arch_ch_6(uint8_t* buf, uint8_t size);
+void get_arch_ch_7(uint8_t* buf, uint8_t size);
+void get_arch_ch_8(uint8_t* buf, uint8_t size);
+
+void (*get_ch_entries_number[8])(uint8_t* buf, uint8_t size) = {
+    get_arch_ch_1, get_arch_ch_2, get_arch_ch_3, get_arch_ch_4,
+    get_arch_ch_5, get_arch_ch_6, get_arch_ch_7, get_arch_ch_8,
+};
+
+
 void get_rtc(uint8_t* buf, uint8_t size);
 
 
@@ -256,25 +273,35 @@ void mb_init_params(void)
     
     index++;
     
-    // Текущее количество записей в архиве
-    mb_param[index].reg = 0x0903;
-	mb_param[index].size = 1;
-	mb_param[index].param = NULL; // 
-	mb_param[index].set = NULL;
-    mb_param[index].get = get_archive_entries_number;
-    mb_param[index].check_handler = mb_check_dummy;
-    
-    index++;
-    
-    // Период архива
-    mb_param[index].reg = 0x0904;
-	mb_param[index].size = 1;
-	mb_param[index].param = (uint8_t*)&settings.period_archive;
-	mb_param[index].set = NULL;
-    mb_param[index].get = NULL;
-    mb_param[index].check_handler = mb_check_archiv_per;
+    // Текущее количество записей в архиве по каждому каналу
+    addr = 0x0903;
+    for (int i = 0; i < ARCH_CH_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 1;
+        mb_param[index].param = NULL;
+        mb_param[index].set = NULL;
+        mb_param[index].get = get_ch_entries_number[i];
+        mb_param[index].check_handler = mb_check_dummy;
+        
+        addr++;
+        index++;      
+    }  
     
-    index++;
+    // Период архива. Регистры 0x0904 - 0x090B
+    addr = 0x090B;
+    for (int i = 0; i < ARCH_CH_NUMBER; i++)
+    {
+        mb_param[index].reg = addr;
+        mb_param[index].size = 1;
+        mb_param[index].param = (uint8_t*)&settings.period_archive[i];  // Счетчик ипульсов
+        mb_param[index].set = NULL;
+        mb_param[index].get = NULL;
+        mb_param[index].check_handler = mb_check_archiv_per;
+        
+        addr++;
+        index++;
+    }
     
 	// ---------------------------------------------------------------------- //
 	//	Системные настройки
@@ -467,13 +494,75 @@ void get_log_entries_number(uint8_t* buf, uint8_t size)
 }
 
 //
-void get_archive_entries_number(uint8_t* buf, uint8_t size)
+void get_arch_ch_1(uint8_t* buf, uint8_t size)
 {
     static uint16_t capacity;
       
-    capacity = swap_uint16(log_arch_capacity());
+    capacity = swap_uint16(log_arch_capacity(0));
+    memcpy(buf, &capacity, 2);
+}
+
+//
+void get_arch_ch_2(uint8_t* buf, uint8_t size)
+{
+    static uint16_t capacity;
+      
+    capacity = swap_uint16(log_arch_capacity(1));
+    memcpy(buf, &capacity, 2);
+}
+
+//
+void get_arch_ch_3(uint8_t* buf, uint8_t size)
+{
+    static uint16_t capacity;
+      
+    capacity = swap_uint16(log_arch_capacity(2));
+    memcpy(buf, &capacity, 2);
+}
+
+//
+void get_arch_ch_4(uint8_t* buf, uint8_t size)
+{
+    static uint16_t capacity;
+      
+    capacity = swap_uint16(log_arch_capacity(3));
+    memcpy(buf, &capacity, 2);
+}
+
+//
+void get_arch_ch_5(uint8_t* buf, uint8_t size)
+{
+    static uint16_t capacity;
+      
+    capacity = swap_uint16(log_arch_capacity(4));
+    memcpy(buf, &capacity, 2);
+}
+
+//
+void get_arch_ch_6(uint8_t* buf, uint8_t size)
+{
+    static uint16_t capacity;
+      
+    capacity = swap_uint16(log_arch_capacity(5));
+    memcpy(buf, &capacity, 2);
+}
+
+//
+void get_arch_ch_7(uint8_t* buf, uint8_t size)
+{
+    static uint16_t capacity;
+      
+    capacity = swap_uint16(log_arch_capacity(6));
+    memcpy(buf, &capacity, 2);
+}
+
+//
+void get_arch_ch_8(uint8_t* buf, uint8_t size)
+{
+    static uint16_t capacity;
+      
+    capacity = swap_uint16(log_arch_capacity(7));
     memcpy(buf, &capacity, 2);
-    //buf = (uint8_t*)&capacity;
 }
 
 //
@@ -484,6 +573,7 @@ void get_rtc(uint8_t* buf, uint8_t size)
     memcpy(buf, &rtc, 8);
 }
 
+
 // -------------------------------------------------------------------------- //
 //                          Установка параметров
 // -------------------------------------------------------------------------- //
@@ -545,9 +635,14 @@ mb_delay_action_t mb_sys_settings_save(void)
 //
 mb_delay_action_t mb_control(void)
 {
-    if (system_cmd == 1)
+    if (system_cmd == MB_COM_SETTINGS_SAVE)
         return MB_SAVE_SETTINGS;
-  
+    else if (system_cmd == MB_COM_LOG_CLEAR)
+        return MB_LOG_CLEAR;
+    else if ((system_cmd >= (uint8_t)MB_COM_ARCH_CLEAR_1) && (system_cmd <= (uint8_t)MB_COM_ARCH_CLEAR_8)) {
+        arch_channel = system_cmd;
+        return MB_ARCHIVE_CLEAR;
+    }
     return MB_NO_ACTION;
     
 #if 0
@@ -598,8 +693,11 @@ void mb_check_dummy(void)
 //
 void mb_check_archiv_per(void)
 {
-    if (settings.period_archive > (uint16_t)MAX_ARCHIVE_PERIOD)
-        settings.period_archive = (uint16_t)MAX_ARCHIVE_PERIOD;
+    for (uint8_t i = 0; i < ARCH_CH_NUMBER; i++)
+    {
+        if (settings.period_archive[i] > (uint16_t)MAX_ARCHIVE_PERIOD)
+            settings.period_archive[i] = (uint16_t)MAX_ARCHIVE_PERIOD;
+    }
 }
 
 

+ 1 - 1
fw/modules/modbus/modbus_params.h

@@ -12,7 +12,7 @@ extern "C" {
 #endif
 
   
-#define MB_PARAM_MAX			71 //54
+#define MB_PARAM_MAX			85 //54
 
 
 //

+ 6 - 4
fw/modules/settings/settings_api.c

@@ -132,8 +132,10 @@ void settings_set_all_default(void)
     // Время ожидания опроса (сек.)
     settings.save_delay = 60;
     
-    // Время ведения архива (сек.)
-    settings.period_archive = 3600;
+    // Время ведения архива по каждому каналу (сек.)
+    for (uint8_t i = 0; i < ARCH_CH_NUMBER; i++) {
+        settings.period_archive[i] = 3600;
+    }
     
 #if 0  
     SETTINGS_SetWebParamsDef();
@@ -490,10 +492,10 @@ bool settings_is_changed(settings_t *new_settings)
         old_data = (*(uint32_t*)baseAddress++);
         new_data = *ptr++;
         if (old_data != new_data)
-            return false;
+            return true;
     }
     
-    return true;
+    return false;
 }
 
 

+ 2 - 1
fw/modules/settings/settings_api.h

@@ -8,6 +8,7 @@
 #include "io.h"
 #include "mb.h"
 #include "mbport.h"
+#include "log.h"
 #include <stdbool.h>
 
 
@@ -116,7 +117,7 @@ typedef struct
     bool        save_mode;          // безопасный режим, 0 - выкл, 1 - вкл
     uint16_t    save_delay;         // время ожидания опроса (сек.)
     
-    uint16_t    period_archive;     // период архивирования
+    uint16_t    period_archive[ARCH_CH_NUMBER]; // период архивирования
     
     
 } settings_t;

+ 27 - 21
fw/modules/terminal/terminal_sbs.cpp

@@ -59,7 +59,7 @@ int SbsTerminal::execute(int argc, const char * const *argv)
     // Добавить N новых записей в журнал
     if (strcmp(argv[0], "add_lentry") == 0) {
         if (argc > 1)
-            log_add_random_entry(0, atoi(argv[1]));
+            log_add_random_entry(0, atoi(argv[1]), 0);
         else
             printf("No record counter\r\n");
         
@@ -67,8 +67,8 @@ int SbsTerminal::execute(int argc, const char * const *argv)
     }
     // Добавить N новых записей в архив
     if (strcmp(argv[0], "add_aentry") == 0) {
-        if (argc > 1)
-            log_add_random_entry(1, atoi(argv[1]));
+        if (argc > 2)
+            log_add_random_entry(1, atoi(argv[1]), atoi(argv[2]));
         else
             printf("No record counter\r\n");
         
@@ -76,12 +76,14 @@ int SbsTerminal::execute(int argc, const char * const *argv)
     }
     // Информация о журнале
     if (strcmp(argv[0], "linfo") == 0) {
-        log_info(0);
+        log_info(0, 0);
         return 0;
     }
     // Информация об архиве
     if (strcmp(argv[0], "ainfo") == 0) {
-        log_info(1);
+        if (argc > 1) {
+            log_info(1, atoi(argv[1]));
+        }
         return 0;
     }
     // Fetch archive entry
@@ -91,12 +93,16 @@ int SbsTerminal::execute(int argc, const char * const *argv)
     }
     // Format log FS
     if (strcmp(argv[0], "lformat") == 0) {
-        log_format(0);  
+        if (argc > 1) {
+            log_format(0, 0);  
+        }
         return 0;
     }
     // Format archive FS
     if (strcmp(argv[0], "aformat") == 0) {
-        log_format(1);  
+        if (argc > 1) {
+            log_format(1, atoi(argv[1]));  
+        }
         return 0;
     }
     // 
@@ -162,20 +168,20 @@ int SbsTerminal::help(int argc, const char * const *argv)
     printeol();
     printeol();
     printl ("You can use the following commands:");
-    printl ("  version        Print software version");
-    printl ("  reset          Reset");
-    printl ("  add_lentry     Add N log entries");
-    printl ("  add_aentry     Add N archive entries");
-    printl ("  linfo          Print log info");
-    printl ("  ainfo          Print archive info");
-    printl ("  afetch         Fetch archive entry");
-    printl ("  aentry         Get archive entry [position] [sector] [slot]");
-    printl ("  lformat        Format log partition");
-    printl ("  aformat        Format archive partition");
-    printl ("  lstate         log enable/disable");
-    printl ("  astate         archive enable/disable");
-    printl ("  mstime         gurrnet rtc in ms");
-    printl ("  settings       Print settings structure");
+    printl ("  version                          Print software version");
+    printl ("  reset                            Reset");
+    printl ("  add_lentry                       Add N log entries");
+    printl ("  add_aentry [entries] [channel]   Add N archive entries to channel");
+    printl ("  linfo                            Print log info");
+    printl ("  ainfo                            Print archive info");
+    printl ("  afetch                           Fetch archive entry");
+    printl ("  aentry                           Get archive entry [position] [sector] [slot]");
+    printl ("  lformat                          Format log partition");
+    printl ("  aformat                          Format archive partition");
+    printl ("  lstate                           log enable/disable");
+    printl ("  astate                           archive enable/disable");
+    printl ("  mstime                           gurrnet rtc in ms");
+    printl ("  settings                         Print settings structure");
     
     printeol();
 

+ 175 - 174
fw/user/FreeRTOSConfig.h

@@ -1,174 +1,175 @@
-/*
-    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.
-    All rights reserved
-
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
-
-    This file is part of the FreeRTOS distribution.
-
-    FreeRTOS is free software; you can redistribute it and/or modify it under
-    the terms of the GNU General Public License (version 2) as published by the
-    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
-
-	***************************************************************************
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<
-    >>!   obliged to provide the source code for proprietary components     !<<
-    >>!   outside of the FreeRTOS kernel.                                   !<<
-	***************************************************************************
-
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following
-    link: http://www.freertos.org/a00114.html
-
-    ***************************************************************************
-     *                                                                       *
-     *    FreeRTOS provides completely free yet professionally developed,    *
-     *    robust, strictly quality controlled, supported, and cross          *
-     *    platform software that is more than just the market leader, it     *
-     *    is the industry's de facto standard.                               *
-     *                                                                       *
-     *    Help yourself get started quickly while simultaneously helping     *
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *
-     *    tutorial book, reference manual, or both:                          *
-     *    http://www.FreeRTOS.org/Documentation                              *
-     *                                                                       *
-    ***************************************************************************
-
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
-	the FAQ page "My application does not run, what could be wrong?".  Have you
-	defined configASSERT()?
-
-	http://www.FreeRTOS.org/support - In return for receiving this top quality
-	embedded software for free we request you assist our global community by
-	participating in the support forum.
-
-	http://www.FreeRTOS.org/training - Investing in training allows your team to
-	be as productive as possible as early as possible.  Now you can receive
-	FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
-	Ltd, and the world's leading authority on the world's leading RTOS.
-
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.
-
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
-
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
-    licenses offer ticketed support, indemnification and commercial middleware.
-
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety
-    engineered and independently SIL3 certified version for use in safety and
-    mission critical applications that require provable dependability.
-
-    1 tab == 4 spaces!
-*/
-
-
-#ifndef FREERTOS_CONFIG_H
-#define FREERTOS_CONFIG_H
-
-/*-----------------------------------------------------------
- * Application specific definitions.
- *
- * These definitions should be adjusted for your particular hardware and
- * application requirements.
- *
- * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
- *
- * See http://www.freertos.org/a00110.html.
- *----------------------------------------------------------*/
-
-/* Use a guard to ensure the following few definitions are'nt included in
-assembly files that include this header file. */
-#ifndef __IASMARM__
-	#include <stdint.h>
-	extern unsigned int system_core_clock;
-//    extern volatile unsigned long ulHighFrequencyTimerTicks;
-#endif
-
-#define configENABLE_BACKWARD_COMPATIBILITY 1
-
-#define configUSE_PREEMPTION			1
-#define configUSE_IDLE_HOOK				0
-#define configUSE_TICK_HOOK				0
-#define configCPU_CLOCK_HZ				( system_core_clock )
-#define configTICK_RATE_HZ				( ( TickType_t ) 1000 )
-#define configMAX_PRIORITIES			( 5 )
-#define configMINIMAL_STACK_SIZE		( ( unsigned short ) 128 )
-#define configTOTAL_HEAP_SIZE			( ( size_t ) ( 64 * 1024 ) )
-#define configMAX_TASK_NAME_LEN			( 16 )
-#define configUSE_TRACE_FACILITY		1
-#define configUSE_16_BIT_TICKS			0
-#define configIDLE_SHOULD_YIELD			1
-#define configUSE_MUTEXES				1
-#define configQUEUE_REGISTRY_SIZE		8
-#define configGENERATE_RUN_TIME_STATS	0
-#define configCHECK_FOR_STACK_OVERFLOW	2
-#define configUSE_RECURSIVE_MUTEXES		1
-#define configUSE_MALLOC_FAILED_HOOK	1
-#define configUSE_APPLICATION_TASK_TAG	0
-#define configUSE_COUNTING_SEMAPHORES	1
-#define configUSE_STATS_FORMATTING_FUNCTIONS	1
-#define configAPPLICATION_ALLOCATED_HEAP        0
-    
-//#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() ( ulHighFrequencyTimerTicks = 0UL )
-//#define portGET_RUN_TIME_COUNTER_VALUE()         ulHighFrequencyTimerTicks    
-
-/* Co-routine definitions. */
-#define configUSE_CO_ROUTINES 		0
-#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
-
-/* Software timer definitions. */
-#define configUSE_TIMERS				1
-#define configTIMER_TASK_PRIORITY		( 2 )
-#define configTIMER_QUEUE_LENGTH		10
-#define configTIMER_TASK_STACK_DEPTH	( configMINIMAL_STACK_SIZE * 2 )
-
-/* Set the following definitions to 1 to include the API function, or zero
-to exclude the API function. */
-#define INCLUDE_vTaskPrioritySet		1
-#define INCLUDE_uxTaskPriorityGet		1
-#define INCLUDE_vTaskDelete				1
-#define INCLUDE_vTaskCleanUpResources	1
-#define INCLUDE_vTaskSuspend			1
-#define INCLUDE_vTaskDelayUntil			1
-#define INCLUDE_vTaskDelay				1
-
-/* Use the system definition, if there is one */
-#ifdef __NVIC_PRIO_BITS
-	#define configPRIO_BITS       		__NVIC_PRIO_BITS
-#else
-	#define configPRIO_BITS       		4        /* 15 priority levels */
-#endif
-
-#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY			0xf
-#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY	5
-
-/* The lowest priority. */
-#define configKERNEL_INTERRUPT_PRIORITY 	( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
-/* Priority 5, or 160 as only the top three bits are implemented. */
-/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
-See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
-#define configMAX_SYSCALL_INTERRUPT_PRIORITY 	( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
-	
-#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }	
-	
-#define vPortSVCHandler SVC_Handler
-#define xPortPendSVHandler PendSV_Handler
-#define vPortSVCHandler SVC_Handler
-#define xPortSysTickHandler SysTick_Handler
-
-/* Dimensions a buffer that can be used by the FreeRTOS+CLI command
-interpreter.  Set this value to 1 to save RAM if FreeRTOS+CLI does not supply
-the output butter.  See the FreeRTOS+CLI documentation for more information:
-http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */
-#define configCOMMAND_INT_MAX_OUTPUT_SIZE			3*1024
-
-#endif /* FREERTOS_CONFIG_H */
-
-  
+/*
+    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.
+    All rights reserved
+
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
+
+    This file is part of the FreeRTOS distribution.
+
+    FreeRTOS is free software; you can redistribute it and/or modify it under
+    the terms of the GNU General Public License (version 2) as published by the
+    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
+
+	***************************************************************************
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<
+    >>!   obliged to provide the source code for proprietary components     !<<
+    >>!   outside of the FreeRTOS kernel.                                   !<<
+	***************************************************************************
+
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following
+    link: http://www.freertos.org/a00114.html
+
+    ***************************************************************************
+     *                                                                       *
+     *    FreeRTOS provides completely free yet professionally developed,    *
+     *    robust, strictly quality controlled, supported, and cross          *
+     *    platform software that is more than just the market leader, it     *
+     *    is the industry's de facto standard.                               *
+     *                                                                       *
+     *    Help yourself get started quickly while simultaneously helping     *
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *
+     *    tutorial book, reference manual, or both:                          *
+     *    http://www.FreeRTOS.org/Documentation                              *
+     *                                                                       *
+    ***************************************************************************
+
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
+	the FAQ page "My application does not run, what could be wrong?".  Have you
+	defined configASSERT()?
+
+	http://www.FreeRTOS.org/support - In return for receiving this top quality
+	embedded software for free we request you assist our global community by
+	participating in the support forum.
+
+	http://www.FreeRTOS.org/training - Investing in training allows your team to
+	be as productive as possible as early as possible.  Now you can receive
+	FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
+	Ltd, and the world's leading authority on the world's leading RTOS.
+
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.
+
+    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
+
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
+    licenses offer ticketed support, indemnification and commercial middleware.
+
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety
+    engineered and independently SIL3 certified version for use in safety and
+    mission critical applications that require provable dependability.
+
+    1 tab == 4 spaces!
+*/
+
+
+#ifndef FREERTOS_CONFIG_H
+#define FREERTOS_CONFIG_H
+
+/*-----------------------------------------------------------
+ * Application specific definitions.
+ *
+ * These definitions should be adjusted for your particular hardware and
+ * application requirements.
+ *
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
+ *
+ * See http://www.freertos.org/a00110.html.
+ *----------------------------------------------------------*/
+
+/* Use a guard to ensure the following few definitions are'nt included in
+assembly files that include this header file. */
+#ifndef __IASMARM__
+	#include <stdint.h>
+	extern unsigned int system_core_clock;
+//    extern volatile unsigned long ulHighFrequencyTimerTicks;
+#endif
+
+#define configENABLE_BACKWARD_COMPATIBILITY 1
+
+#define configUSE_PREEMPTION			1
+#define configUSE_IDLE_HOOK				0
+#define configUSE_TICK_HOOK				0
+#define configCPU_CLOCK_HZ				( system_core_clock )
+#define configTICK_RATE_HZ				( ( TickType_t ) 1000 )
+#define configMAX_PRIORITIES			( 5 )
+#define configMINIMAL_STACK_SIZE		( ( unsigned short ) 128 )
+#define configTOTAL_HEAP_SIZE			( ( size_t ) ( 64 * 1024 ) )
+#define configMAX_TASK_NAME_LEN			( 16 )
+#define configUSE_TRACE_FACILITY		1
+#define configUSE_16_BIT_TICKS			0
+#define configIDLE_SHOULD_YIELD			1
+#define configUSE_MUTEXES				1
+#define configQUEUE_REGISTRY_SIZE		8
+#define configGENERATE_RUN_TIME_STATS	0
+#define configCHECK_FOR_STACK_OVERFLOW	2
+#define configUSE_RECURSIVE_MUTEXES		1
+#define configUSE_MALLOC_FAILED_HOOK	1
+#define configUSE_APPLICATION_TASK_TAG	0
+#define configUSE_COUNTING_SEMAPHORES	1
+#define configUSE_STATS_FORMATTING_FUNCTIONS	1
+#define configAPPLICATION_ALLOCATED_HEAP        0
+    
+//#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() ( ulHighFrequencyTimerTicks = 0UL )
+//#define portGET_RUN_TIME_COUNTER_VALUE()         ulHighFrequencyTimerTicks    
+
+/* Co-routine definitions. */
+#define configUSE_CO_ROUTINES 		0
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
+
+/* Software timer definitions. */
+#define configUSE_TIMERS				1
+#define configTIMER_TASK_PRIORITY		( 2 )
+#define configTIMER_QUEUE_LENGTH		10
+#define configTIMER_TASK_STACK_DEPTH	( configMINIMAL_STACK_SIZE * 2 )
+
+/* Set the following definitions to 1 to include the API function, or zero
+to exclude the API function. */
+#define INCLUDE_vTaskPrioritySet		1
+#define INCLUDE_uxTaskPriorityGet		1
+#define INCLUDE_vTaskDelete				1
+#define INCLUDE_vTaskCleanUpResources	1
+#define INCLUDE_vTaskSuspend			1
+#define INCLUDE_vTaskDelayUntil			1
+#define INCLUDE_vTaskDelay				1
+#define INCLUDE_xTimerPendFunctionCall  1
+
+/* Use the system definition, if there is one */
+#ifdef __NVIC_PRIO_BITS
+	#define configPRIO_BITS       		__NVIC_PRIO_BITS
+#else
+	#define configPRIO_BITS       		4        /* 15 priority levels */
+#endif
+
+#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY			0xf
+#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY	5
+
+/* The lowest priority. */
+#define configKERNEL_INTERRUPT_PRIORITY 	( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
+/* Priority 5, or 160 as only the top three bits are implemented. */
+/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
+See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
+#define configMAX_SYSCALL_INTERRUPT_PRIORITY 	( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
+	
+#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }	
+	
+#define vPortSVCHandler SVC_Handler
+#define xPortPendSVHandler PendSV_Handler
+#define vPortSVCHandler SVC_Handler
+#define xPortSysTickHandler SysTick_Handler
+
+/* Dimensions a buffer that can be used by the FreeRTOS+CLI command
+interpreter.  Set this value to 1 to save RAM if FreeRTOS+CLI does not supply
+the output butter.  See the FreeRTOS+CLI documentation for more information:
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */
+#define configCOMMAND_INT_MAX_OUTPUT_SIZE			3*1024
+
+#endif /* FREERTOS_CONFIG_H */
+
+  

+ 1 - 1
fw/user/main.cpp

@@ -137,7 +137,7 @@ void init_task(void *argument)
     // Настройки параметров порта Modbus
     settings_set_modbus_params(settings.com_settings.mb_port);
     
-#if 1    
+#if 0    
     settings_set_all_default();
     settings_save(&settings);
 #endif      

+ 730 - 730
libs/thirdparty/freertos/include/event_groups.h

@@ -1,730 +1,730 @@
-/*
-    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.
-    All rights reserved
-
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
-
-    This file is part of the FreeRTOS distribution.
-
-    FreeRTOS is free software; you can redistribute it and/or modify it under
-    the terms of the GNU General Public License (version 2) as published by the
-    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
-
-	***************************************************************************
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<
-    >>!   obliged to provide the source code for proprietary components     !<<
-    >>!   outside of the FreeRTOS kernel.                                   !<<
-	***************************************************************************
-
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following
-    link: http://www.freertos.org/a00114.html
-
-    ***************************************************************************
-     *                                                                       *
-     *    FreeRTOS provides completely free yet professionally developed,    *
-     *    robust, strictly quality controlled, supported, and cross          *
-     *    platform software that is more than just the market leader, it     *
-     *    is the industry's de facto standard.                               *
-     *                                                                       *
-     *    Help yourself get started quickly while simultaneously helping     *
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *
-     *    tutorial book, reference manual, or both:                          *
-     *    http://www.FreeRTOS.org/Documentation                              *
-     *                                                                       *
-    ***************************************************************************
-
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
-	the FAQ page "My application does not run, what could be wrong?".  Have you
-	defined configASSERT()?
-
-	http://www.FreeRTOS.org/support - In return for receiving this top quality
-	embedded software for free we request you assist our global community by
-	participating in the support forum.
-
-	http://www.FreeRTOS.org/training - Investing in training allows your team to
-	be as productive as possible as early as possible.  Now you can receive
-	FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
-	Ltd, and the world's leading authority on the world's leading RTOS.
-
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.
-
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
-
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
-    licenses offer ticketed support, indemnification and commercial middleware.
-
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety
-    engineered and independently SIL3 certified version for use in safety and
-    mission critical applications that require provable dependability.
-
-    1 tab == 4 spaces!
-*/
-
-#ifndef EVENT_GROUPS_H
-#define EVENT_GROUPS_H
-
-#ifndef INC_FREERTOS_H
-	#error "include FreeRTOS.h" must appear in source files before "include event_groups.h"
-#endif
-
-#include "fr_timers.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * An event group is a collection of bits to which an application can assign a
- * meaning.  For example, an application may create an event group to convey
- * the status of various CAN bus related events in which bit 0 might mean "A CAN
- * message has been received and is ready for processing", bit 1 might mean "The
- * application has queued a message that is ready for sending onto the CAN
- * network", and bit 2 might mean "It is time to send a SYNC message onto the
- * CAN network" etc.  A task can then test the bit values to see which events
- * are active, and optionally enter the Blocked state to wait for a specified
- * bit or a group of specified bits to be active.  To continue the CAN bus
- * example, a CAN controlling task can enter the Blocked state (and therefore
- * not consume any processing time) until either bit 0, bit 1 or bit 2 are
- * active, at which time the bit that was actually active would inform the task
- * which action it had to take (process a received message, send a message, or
- * send a SYNC).
- *
- * The event groups implementation contains intelligence to avoid race
- * conditions that would otherwise occur were an application to use a simple
- * variable for the same purpose.  This is particularly important with respect
- * to when a bit within an event group is to be cleared, and when bits have to
- * be set and then tested atomically - as is the case where event groups are
- * used to create a synchronisation point between multiple tasks (a
- * 'rendezvous').
- *
- * \defgroup EventGroup
- */
-
-
-
-/**
- * event_groups.h
- *
- * Type by which event groups are referenced.  For example, a call to
- * xEventGroupCreate() returns an EventGroupHandle_t variable that can then
- * be used as a parameter to other event group functions.
- *
- * \defgroup EventGroupHandle_t EventGroupHandle_t
- * \ingroup EventGroup
- */
-typedef void * EventGroupHandle_t;
-
-/* 
- * The type that holds event bits always matches TickType_t - therefore the
- * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
- * 32 bits if set to 0. 
- *
- * \defgroup EventBits_t EventBits_t
- * \ingroup EventGroup
- */
-typedef TickType_t EventBits_t;
-
-/**
- * event_groups.h
- *<pre>
- EventGroupHandle_t xEventGroupCreate( void );
- </pre>
- *
- * Create a new event group.  This function cannot be called from an interrupt.
- *
- * Although event groups are not related to ticks, for internal implementation
- * reasons the number of bits available for use in an event group is dependent
- * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h.  If
- * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
- * 0 to bit 7).  If configUSE_16_BIT_TICKS is set to 0 then each event group has
- * 24 usable bits (bit 0 to bit 23).  The EventBits_t type is used to store
- * event bits within an event group.
- *
- * @return If the event group was created then a handle to the event group is
- * returned.  If there was insufficient FreeRTOS heap available to create the
- * event group then NULL is returned.  See http://www.freertos.org/a00111.html
- *
- * Example usage:
-   <pre>
-	// Declare a variable to hold the created event group.
-	EventGroupHandle_t xCreatedEventGroup;
-
-	// Attempt to create the event group.
-	xCreatedEventGroup = xEventGroupCreate();
-
-	// Was the event group created successfully?
-	if( xCreatedEventGroup == NULL )
-	{
-		// The event group was not created because there was insufficient
-		// FreeRTOS heap available.
-	}
-	else
-	{
-		// The event group was created.
-	}
-   </pre>
- * \defgroup xEventGroupCreate xEventGroupCreate
- * \ingroup EventGroup
- */
-EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
-
-/**
- * event_groups.h
- *<pre>
-	EventBits_t xEventGroupWaitBits( 	EventGroupHandle_t xEventGroup,
-										const EventBits_t uxBitsToWaitFor,
-										const BaseType_t xClearOnExit,
-										const BaseType_t xWaitForAllBits,
-										const TickType_t xTicksToWait );
- </pre>
- *
- * [Potentially] block to wait for one or more bits to be set within a
- * previously created event group.
- *
- * This function cannot be called from an interrupt.
- *
- * @param xEventGroup The event group in which the bits are being tested.  The
- * event group must have previously been created using a call to
- * xEventGroupCreate().
- *
- * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test
- * inside the event group.  For example, to wait for bit 0 and/or bit 2 set
- * uxBitsToWaitFor to 0x05.  To wait for bits 0 and/or bit 1 and/or bit 2 set
- * uxBitsToWaitFor to 0x07.  Etc.
- *
- * @param xClearOnExit If xClearOnExit is set to pdTRUE then any bits within
- * uxBitsToWaitFor that are set within the event group will be cleared before
- * xEventGroupWaitBits() returns if the wait condition was met (if the function
- * returns for a reason other than a timeout).  If xClearOnExit is set to
- * pdFALSE then the bits set in the event group are not altered when the call to
- * xEventGroupWaitBits() returns.
- *
- * @param xWaitForAllBits If xWaitForAllBits is set to pdTRUE then
- * xEventGroupWaitBits() will return when either all the bits in uxBitsToWaitFor
- * are set or the specified block time expires.  If xWaitForAllBits is set to
- * pdFALSE then xEventGroupWaitBits() will return when any one of the bits set
- * in uxBitsToWaitFor is set or the specified block time expires.  The block
- * time is specified by the xTicksToWait parameter.
- *
- * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
- * for one/all (depending on the xWaitForAllBits value) of the bits specified by
- * uxBitsToWaitFor to become set.
- *
- * @return The value of the event group at the time either the bits being waited
- * for became set, or the block time expired.  Test the return value to know
- * which bits were set.  If xEventGroupWaitBits() returned because its timeout
- * expired then not all the bits being waited for will be set.  If
- * xEventGroupWaitBits() returned because the bits it was waiting for were set
- * then the returned value is the event group value before any bits were
- * automatically cleared in the case that xClearOnExit parameter was set to
- * pdTRUE.
- *
- * Example usage:
-   <pre>
-   #define BIT_0	( 1 << 0 )
-   #define BIT_4	( 1 << 4 )
-
-   void aFunction( EventGroupHandle_t xEventGroup )
-   {
-   EventBits_t uxBits;
-   const TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;
-
-		// Wait a maximum of 100ms for either bit 0 or bit 4 to be set within
-		// the event group.  Clear the bits before exiting.
-		uxBits = xEventGroupWaitBits(
-					xEventGroup,	// The event group being tested.
-					BIT_0 | BIT_4,	// The bits within the event group to wait for.
-					pdTRUE,			// BIT_0 and BIT_4 should be cleared before returning.
-					pdFALSE,		// Don't wait for both bits, either bit will do.
-					xTicksToWait );	// Wait a maximum of 100ms for either bit to be set.
-
-		if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
-		{
-			// xEventGroupWaitBits() returned because both bits were set.
-		}
-		else if( ( uxBits & BIT_0 ) != 0 )
-		{
-			// xEventGroupWaitBits() returned because just BIT_0 was set.
-		}
-		else if( ( uxBits & BIT_4 ) != 0 )
-		{
-			// xEventGroupWaitBits() returned because just BIT_4 was set.
-		}
-		else
-		{
-			// xEventGroupWaitBits() returned because xTicksToWait ticks passed
-			// without either BIT_0 or BIT_4 becoming set.
-		}
-   }
-   </pre>
- * \defgroup xEventGroupWaitBits xEventGroupWaitBits
- * \ingroup EventGroup
- */
-EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
-
-/**
- * event_groups.h
- *<pre>
-	EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );
- </pre>
- *
- * Clear bits within an event group.  This function cannot be called from an
- * interrupt.
- *
- * @param xEventGroup The event group in which the bits are to be cleared.
- *
- * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear
- * in the event group.  For example, to clear bit 3 only, set uxBitsToClear to
- * 0x08.  To clear bit 3 and bit 0 set uxBitsToClear to 0x09.
- *
- * @return The value of the event group before the specified bits were cleared.
- *
- * Example usage:
-   <pre>
-   #define BIT_0	( 1 << 0 )
-   #define BIT_4	( 1 << 4 )
-
-   void aFunction( EventGroupHandle_t xEventGroup )
-   {
-   EventBits_t uxBits;
-
-		// Clear bit 0 and bit 4 in xEventGroup.
-		uxBits = xEventGroupClearBits(
-								xEventGroup,	// The event group being updated.
-								BIT_0 | BIT_4 );// The bits being cleared.
-
-		if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
-		{
-			// Both bit 0 and bit 4 were set before xEventGroupClearBits() was
-			// called.  Both will now be clear (not set).
-		}
-		else if( ( uxBits & BIT_0 ) != 0 )
-		{
-			// Bit 0 was set before xEventGroupClearBits() was called.  It will
-			// now be clear.
-		}
-		else if( ( uxBits & BIT_4 ) != 0 )
-		{
-			// Bit 4 was set before xEventGroupClearBits() was called.  It will
-			// now be clear.
-		}
-		else
-		{
-			// Neither bit 0 nor bit 4 were set in the first place.
-		}
-   }
-   </pre>
- * \defgroup xEventGroupClearBits xEventGroupClearBits
- * \ingroup EventGroup
- */
-EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
-
-/**
- * event_groups.h
- *<pre>
-	BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
- </pre>
- *
- * A version of xEventGroupClearBits() that can be called from an interrupt.
- *
- * Setting bits in an event group is not a deterministic operation because there
- * are an unknown number of tasks that may be waiting for the bit or bits being
- * set.  FreeRTOS does not allow nondeterministic operations to be performed
- * while interrupts are disabled, so protects event groups that are accessed
- * from tasks by suspending the scheduler rather than disabling interrupts.  As
- * a result event groups cannot be accessed directly from an interrupt service
- * routine.  Therefore xEventGroupClearBitsFromISR() sends a message to the 
- * timer task to have the clear operation performed in the context of the timer 
- * task.
- *
- * @param xEventGroup The event group in which the bits are to be cleared.
- *
- * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear.
- * For example, to clear bit 3 only, set uxBitsToClear to 0x08.  To clear bit 3
- * and bit 0 set uxBitsToClear to 0x09.
- *
- * @return If the request to execute the function was posted successfully then 
- * pdPASS is returned, otherwise pdFALSE is returned.  pdFALSE will be returned 
- * if the timer service queue was full.
- *
- * Example usage:
-   <pre>
-   #define BIT_0	( 1 << 0 )
-   #define BIT_4	( 1 << 4 )
-
-   // An event group which it is assumed has already been created by a call to
-   // xEventGroupCreate().
-   EventGroupHandle_t xEventGroup;
-
-   void anInterruptHandler( void )
-   {
-		// Clear bit 0 and bit 4 in xEventGroup.
-		xResult = xEventGroupClearBitsFromISR(
-							xEventGroup,	 // The event group being updated.
-							BIT_0 | BIT_4 ); // The bits being set.
-
-		if( xResult == pdPASS )
-		{
-			// The message was posted successfully.
-		}
-  }
-   </pre>
- * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
- * \ingroup EventGroup
- */
-#if( configUSE_TRACE_FACILITY == 1 )
-	BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
-#else
-	#define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
-#endif
-
-/**
- * event_groups.h
- *<pre>
-	EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
- </pre>
- *
- * Set bits within an event group.
- * This function cannot be called from an interrupt.  xEventGroupSetBitsFromISR()
- * is a version that can be called from an interrupt.
- *
- * Setting bits in an event group will automatically unblock tasks that are
- * blocked waiting for the bits.
- *
- * @param xEventGroup The event group in which the bits are to be set.
- *
- * @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
- * For example, to set bit 3 only, set uxBitsToSet to 0x08.  To set bit 3
- * and bit 0 set uxBitsToSet to 0x09.
- *
- * @return The value of the event group at the time the call to
- * xEventGroupSetBits() returns.  There are two reasons why the returned value
- * might have the bits specified by the uxBitsToSet parameter cleared.  First,
- * if setting a bit results in a task that was waiting for the bit leaving the
- * blocked state then it is possible the bit will be cleared automatically
- * (see the xClearBitOnExit parameter of xEventGroupWaitBits()).  Second, any
- * unblocked (or otherwise Ready state) task that has a priority above that of
- * the task that called xEventGroupSetBits() will execute and may change the
- * event group value before the call to xEventGroupSetBits() returns.
- *
- * Example usage:
-   <pre>
-   #define BIT_0	( 1 << 0 )
-   #define BIT_4	( 1 << 4 )
-
-   void aFunction( EventGroupHandle_t xEventGroup )
-   {
-   EventBits_t uxBits;
-
-		// Set bit 0 and bit 4 in xEventGroup.
-		uxBits = xEventGroupSetBits(
-							xEventGroup,	// The event group being updated.
-							BIT_0 | BIT_4 );// The bits being set.
-
-		if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
-		{
-			// Both bit 0 and bit 4 remained set when the function returned.
-		}
-		else if( ( uxBits & BIT_0 ) != 0 )
-		{
-			// Bit 0 remained set when the function returned, but bit 4 was
-			// cleared.  It might be that bit 4 was cleared automatically as a
-			// task that was waiting for bit 4 was removed from the Blocked
-			// state.
-		}
-		else if( ( uxBits & BIT_4 ) != 0 )
-		{
-			// Bit 4 remained set when the function returned, but bit 0 was
-			// cleared.  It might be that bit 0 was cleared automatically as a
-			// task that was waiting for bit 0 was removed from the Blocked
-			// state.
-		}
-		else
-		{
-			// Neither bit 0 nor bit 4 remained set.  It might be that a task
-			// was waiting for both of the bits to be set, and the bits were
-			// cleared as the task left the Blocked state.
-		}
-   }
-   </pre>
- * \defgroup xEventGroupSetBits xEventGroupSetBits
- * \ingroup EventGroup
- */
-EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
-
-/**
- * event_groups.h
- *<pre>
-	BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
- </pre>
- *
- * A version of xEventGroupSetBits() that can be called from an interrupt.
- *
- * Setting bits in an event group is not a deterministic operation because there
- * are an unknown number of tasks that may be waiting for the bit or bits being
- * set.  FreeRTOS does not allow nondeterministic operations to be performed in
- * interrupts or from critical sections.  Therefore xEventGroupSetBitFromISR()
- * sends a message to the timer task to have the set operation performed in the
- * context of the timer task - where a scheduler lock is used in place of a
- * critical section.
- *
- * @param xEventGroup The event group in which the bits are to be set.
- *
- * @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
- * For example, to set bit 3 only, set uxBitsToSet to 0x08.  To set bit 3
- * and bit 0 set uxBitsToSet to 0x09.
- *
- * @param pxHigherPriorityTaskWoken As mentioned above, calling this function
- * will result in a message being sent to the timer daemon task.  If the
- * priority of the timer daemon task is higher than the priority of the
- * currently running task (the task the interrupt interrupted) then
- * *pxHigherPriorityTaskWoken will be set to pdTRUE by
- * xEventGroupSetBitsFromISR(), indicating that a context switch should be
- * requested before the interrupt exits.  For that reason
- * *pxHigherPriorityTaskWoken must be initialised to pdFALSE.  See the
- * example code below.
- *
- * @return If the request to execute the function was posted successfully then 
- * pdPASS is returned, otherwise pdFALSE is returned.  pdFALSE will be returned 
- * if the timer service queue was full.
- *
- * Example usage:
-   <pre>
-   #define BIT_0	( 1 << 0 )
-   #define BIT_4	( 1 << 4 )
-
-   // An event group which it is assumed has already been created by a call to
-   // xEventGroupCreate().
-   EventGroupHandle_t xEventGroup;
-
-   void anInterruptHandler( void )
-   {
-   BaseType_t xHigherPriorityTaskWoken, xResult;
-
-		// xHigherPriorityTaskWoken must be initialised to pdFALSE.
-		xHigherPriorityTaskWoken = pdFALSE;
-
-		// Set bit 0 and bit 4 in xEventGroup.
-		xResult = xEventGroupSetBitsFromISR(
-							xEventGroup,	// The event group being updated.
-							BIT_0 | BIT_4   // The bits being set.
-							&xHigherPriorityTaskWoken );
-
-		// Was the message posted successfully?
-		if( xResult == pdPASS )
-		{
-			// If xHigherPriorityTaskWoken is now set to pdTRUE then a context
-			// switch should be requested.  The macro used is port specific and 
-			// will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - 
-			// refer to the documentation page for the port being used.
-			portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
-		}
-  }
-   </pre>
- * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
- * \ingroup EventGroup
- */
-#if( configUSE_TRACE_FACILITY == 1 )
-	BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
-#else
-	#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
-#endif
-
-/**
- * event_groups.h
- *<pre>
-	EventBits_t xEventGroupSync(	EventGroupHandle_t xEventGroup,
-									const EventBits_t uxBitsToSet,
-									const EventBits_t uxBitsToWaitFor,
-									TickType_t xTicksToWait );
- </pre>
- *
- * Atomically set bits within an event group, then wait for a combination of
- * bits to be set within the same event group.  This functionality is typically
- * used to synchronise multiple tasks, where each task has to wait for the other
- * tasks to reach a synchronisation point before proceeding.
- *
- * This function cannot be used from an interrupt.
- *
- * The function will return before its block time expires if the bits specified
- * by the uxBitsToWait parameter are set, or become set within that time.  In
- * this case all the bits specified by uxBitsToWait will be automatically
- * cleared before the function returns.
- *
- * @param xEventGroup The event group in which the bits are being tested.  The
- * event group must have previously been created using a call to
- * xEventGroupCreate().
- *
- * @param uxBitsToSet The bits to set in the event group before determining
- * if, and possibly waiting for, all the bits specified by the uxBitsToWait
- * parameter are set.
- *
- * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test
- * inside the event group.  For example, to wait for bit 0 and bit 2 set
- * uxBitsToWaitFor to 0x05.  To wait for bits 0 and bit 1 and bit 2 set
- * uxBitsToWaitFor to 0x07.  Etc.
- *
- * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
- * for all of the bits specified by uxBitsToWaitFor to become set.
- *
- * @return The value of the event group at the time either the bits being waited
- * for became set, or the block time expired.  Test the return value to know
- * which bits were set.  If xEventGroupSync() returned because its timeout
- * expired then not all the bits being waited for will be set.  If
- * xEventGroupSync() returned because all the bits it was waiting for were
- * set then the returned value is the event group value before any bits were
- * automatically cleared.
- *
- * Example usage:
- <pre>
- // Bits used by the three tasks.
- #define TASK_0_BIT		( 1 << 0 )
- #define TASK_1_BIT		( 1 << 1 )
- #define TASK_2_BIT		( 1 << 2 )
-
- #define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT )
-
- // Use an event group to synchronise three tasks.  It is assumed this event
- // group has already been created elsewhere.
- EventGroupHandle_t xEventBits;
-
- void vTask0( void *pvParameters )
- {
- EventBits_t uxReturn;
- TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;
-
-	 for( ;; )
-	 {
-		// Perform task functionality here.
-
-		// Set bit 0 in the event flag to note this task has reached the
-		// sync point.  The other two tasks will set the other two bits defined
-		// by ALL_SYNC_BITS.  All three tasks have reached the synchronisation
-		// point when all the ALL_SYNC_BITS are set.  Wait a maximum of 100ms
-		// for this to happen.
-		uxReturn = xEventGroupSync( xEventBits, TASK_0_BIT, ALL_SYNC_BITS, xTicksToWait );
-
-		if( ( uxReturn & ALL_SYNC_BITS ) == ALL_SYNC_BITS )
-		{
-			// All three tasks reached the synchronisation point before the call
-			// to xEventGroupSync() timed out.
-		}
-	}
- }
-
- void vTask1( void *pvParameters )
- {
-	 for( ;; )
-	 {
-		// Perform task functionality here.
-
-		// Set bit 1 in the event flag to note this task has reached the
-		// synchronisation point.  The other two tasks will set the other two
-		// bits defined by ALL_SYNC_BITS.  All three tasks have reached the
-		// synchronisation point when all the ALL_SYNC_BITS are set.  Wait
-		// indefinitely for this to happen.
-		xEventGroupSync( xEventBits, TASK_1_BIT, ALL_SYNC_BITS, portMAX_DELAY );
-
-		// xEventGroupSync() was called with an indefinite block time, so
-		// this task will only reach here if the syncrhonisation was made by all
-		// three tasks, so there is no need to test the return value.
-	 }
- }
-
- void vTask2( void *pvParameters )
- {
-	 for( ;; )
-	 {
-		// Perform task functionality here.
-
-		// Set bit 2 in the event flag to note this task has reached the
-		// synchronisation point.  The other two tasks will set the other two
-		// bits defined by ALL_SYNC_BITS.  All three tasks have reached the
-		// synchronisation point when all the ALL_SYNC_BITS are set.  Wait
-		// indefinitely for this to happen.
-		xEventGroupSync( xEventBits, TASK_2_BIT, ALL_SYNC_BITS, portMAX_DELAY );
-
-		// xEventGroupSync() was called with an indefinite block time, so
-		// this task will only reach here if the syncrhonisation was made by all
-		// three tasks, so there is no need to test the return value.
-	}
- }
-
- </pre>
- * \defgroup xEventGroupSync xEventGroupSync
- * \ingroup EventGroup
- */
-EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
-
-
-/**
- * event_groups.h
- *<pre>
-	EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup );
- </pre>
- *
- * Returns the current value of the bits in an event group.  This function
- * cannot be used from an interrupt.
- *
- * @param xEventGroup The event group being queried.
- *
- * @return The event group bits at the time xEventGroupGetBits() was called.
- *
- * \defgroup xEventGroupGetBits xEventGroupGetBits
- * \ingroup EventGroup
- */
-#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
-
-/**
- * event_groups.h
- *<pre>
-	EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
- </pre>
- *
- * A version of xEventGroupGetBits() that can be called from an ISR.
- *
- * @param xEventGroup The event group being queried.
- *
- * @return The event group bits at the time xEventGroupGetBitsFromISR() was called.
- *
- * \defgroup xEventGroupGetBitsFromISR xEventGroupGetBitsFromISR
- * \ingroup EventGroup
- */
-EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
-
-/**
- * event_groups.h
- *<pre>
-	void xEventGroupDelete( EventGroupHandle_t xEventGroup );
- </pre>
- *
- * Delete an event group that was previously created by a call to
- * xEventGroupCreate().  Tasks that are blocked on the event group will be
- * unblocked and obtain 0 as the event group's value.
- *
- * @param xEventGroup The event group being deleted.
- */
-void vEventGroupDelete( EventGroupHandle_t xEventGroup );
-
-/* For internal use only. */
-void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet );
-void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear );
-
-#if (configUSE_TRACE_FACILITY == 1)
-	UBaseType_t uxEventGroupGetNumber( void* xEventGroup );
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* EVENT_GROUPS_H */
-
-
+/*
+    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.
+    All rights reserved
+
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
+
+    This file is part of the FreeRTOS distribution.
+
+    FreeRTOS is free software; you can redistribute it and/or modify it under
+    the terms of the GNU General Public License (version 2) as published by the
+    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
+
+	***************************************************************************
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<
+    >>!   obliged to provide the source code for proprietary components     !<<
+    >>!   outside of the FreeRTOS kernel.                                   !<<
+	***************************************************************************
+
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following
+    link: http://www.freertos.org/a00114.html
+
+    ***************************************************************************
+     *                                                                       *
+     *    FreeRTOS provides completely free yet professionally developed,    *
+     *    robust, strictly quality controlled, supported, and cross          *
+     *    platform software that is more than just the market leader, it     *
+     *    is the industry's de facto standard.                               *
+     *                                                                       *
+     *    Help yourself get started quickly while simultaneously helping     *
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *
+     *    tutorial book, reference manual, or both:                          *
+     *    http://www.FreeRTOS.org/Documentation                              *
+     *                                                                       *
+    ***************************************************************************
+
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
+	the FAQ page "My application does not run, what could be wrong?".  Have you
+	defined configASSERT()?
+
+	http://www.FreeRTOS.org/support - In return for receiving this top quality
+	embedded software for free we request you assist our global community by
+	participating in the support forum.
+
+	http://www.FreeRTOS.org/training - Investing in training allows your team to
+	be as productive as possible as early as possible.  Now you can receive
+	FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
+	Ltd, and the world's leading authority on the world's leading RTOS.
+
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.
+
+    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
+
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
+    licenses offer ticketed support, indemnification and commercial middleware.
+
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety
+    engineered and independently SIL3 certified version for use in safety and
+    mission critical applications that require provable dependability.
+
+    1 tab == 4 spaces!
+*/
+
+#ifndef EVENT_GROUPS_H
+#define EVENT_GROUPS_H
+
+#ifndef INC_FREERTOS_H
+	#error "include FreeRTOS.h" must appear in source files before "include event_groups.h"
+#endif
+
+#include "fr_timers.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * An event group is a collection of bits to which an application can assign a
+ * meaning.  For example, an application may create an event group to convey
+ * the status of various CAN bus related events in which bit 0 might mean "A CAN
+ * message has been received and is ready for processing", bit 1 might mean "The
+ * application has queued a message that is ready for sending onto the CAN
+ * network", and bit 2 might mean "It is time to send a SYNC message onto the
+ * CAN network" etc.  A task can then test the bit values to see which events
+ * are active, and optionally enter the Blocked state to wait for a specified
+ * bit or a group of specified bits to be active.  To continue the CAN bus
+ * example, a CAN controlling task can enter the Blocked state (and therefore
+ * not consume any processing time) until either bit 0, bit 1 or bit 2 are
+ * active, at which time the bit that was actually active would inform the task
+ * which action it had to take (process a received message, send a message, or
+ * send a SYNC).
+ *
+ * The event groups implementation contains intelligence to avoid race
+ * conditions that would otherwise occur were an application to use a simple
+ * variable for the same purpose.  This is particularly important with respect
+ * to when a bit within an event group is to be cleared, and when bits have to
+ * be set and then tested atomically - as is the case where event groups are
+ * used to create a synchronisation point between multiple tasks (a
+ * 'rendezvous').
+ *
+ * \defgroup EventGroup
+ */
+
+
+
+/**
+ * event_groups.h
+ *
+ * Type by which event groups are referenced.  For example, a call to
+ * xEventGroupCreate() returns an EventGroupHandle_t variable that can then
+ * be used as a parameter to other event group functions.
+ *
+ * \defgroup EventGroupHandle_t EventGroupHandle_t
+ * \ingroup EventGroup
+ */
+typedef void * EventGroupHandle_t;
+
+/* 
+ * The type that holds event bits always matches TickType_t - therefore the
+ * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
+ * 32 bits if set to 0. 
+ *
+ * \defgroup EventBits_t EventBits_t
+ * \ingroup EventGroup
+ */
+typedef TickType_t EventBits_t;
+
+/**
+ * event_groups.h
+ *<pre>
+ EventGroupHandle_t xEventGroupCreate( void );
+ </pre>
+ *
+ * Create a new event group.  This function cannot be called from an interrupt.
+ *
+ * Although event groups are not related to ticks, for internal implementation
+ * reasons the number of bits available for use in an event group is dependent
+ * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h.  If
+ * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
+ * 0 to bit 7).  If configUSE_16_BIT_TICKS is set to 0 then each event group has
+ * 24 usable bits (bit 0 to bit 23).  The EventBits_t type is used to store
+ * event bits within an event group.
+ *
+ * @return If the event group was created then a handle to the event group is
+ * returned.  If there was insufficient FreeRTOS heap available to create the
+ * event group then NULL is returned.  See http://www.freertos.org/a00111.html
+ *
+ * Example usage:
+   <pre>
+	// Declare a variable to hold the created event group.
+	EventGroupHandle_t xCreatedEventGroup;
+
+	// Attempt to create the event group.
+	xCreatedEventGroup = xEventGroupCreate();
+
+	// Was the event group created successfully?
+	if( xCreatedEventGroup == NULL )
+	{
+		// The event group was not created because there was insufficient
+		// FreeRTOS heap available.
+	}
+	else
+	{
+		// The event group was created.
+	}
+   </pre>
+ * \defgroup xEventGroupCreate xEventGroupCreate
+ * \ingroup EventGroup
+ */
+EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupWaitBits( 	EventGroupHandle_t xEventGroup,
+										const EventBits_t uxBitsToWaitFor,
+										const BaseType_t xClearOnExit,
+										const BaseType_t xWaitForAllBits,
+										const TickType_t xTicksToWait );
+ </pre>
+ *
+ * [Potentially] block to wait for one or more bits to be set within a
+ * previously created event group.
+ *
+ * This function cannot be called from an interrupt.
+ *
+ * @param xEventGroup The event group in which the bits are being tested.  The
+ * event group must have previously been created using a call to
+ * xEventGroupCreate().
+ *
+ * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test
+ * inside the event group.  For example, to wait for bit 0 and/or bit 2 set
+ * uxBitsToWaitFor to 0x05.  To wait for bits 0 and/or bit 1 and/or bit 2 set
+ * uxBitsToWaitFor to 0x07.  Etc.
+ *
+ * @param xClearOnExit If xClearOnExit is set to pdTRUE then any bits within
+ * uxBitsToWaitFor that are set within the event group will be cleared before
+ * xEventGroupWaitBits() returns if the wait condition was met (if the function
+ * returns for a reason other than a timeout).  If xClearOnExit is set to
+ * pdFALSE then the bits set in the event group are not altered when the call to
+ * xEventGroupWaitBits() returns.
+ *
+ * @param xWaitForAllBits If xWaitForAllBits is set to pdTRUE then
+ * xEventGroupWaitBits() will return when either all the bits in uxBitsToWaitFor
+ * are set or the specified block time expires.  If xWaitForAllBits is set to
+ * pdFALSE then xEventGroupWaitBits() will return when any one of the bits set
+ * in uxBitsToWaitFor is set or the specified block time expires.  The block
+ * time is specified by the xTicksToWait parameter.
+ *
+ * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
+ * for one/all (depending on the xWaitForAllBits value) of the bits specified by
+ * uxBitsToWaitFor to become set.
+ *
+ * @return The value of the event group at the time either the bits being waited
+ * for became set, or the block time expired.  Test the return value to know
+ * which bits were set.  If xEventGroupWaitBits() returned because its timeout
+ * expired then not all the bits being waited for will be set.  If
+ * xEventGroupWaitBits() returned because the bits it was waiting for were set
+ * then the returned value is the event group value before any bits were
+ * automatically cleared in the case that xClearOnExit parameter was set to
+ * pdTRUE.
+ *
+ * Example usage:
+   <pre>
+   #define BIT_0	( 1 << 0 )
+   #define BIT_4	( 1 << 4 )
+
+   void aFunction( EventGroupHandle_t xEventGroup )
+   {
+   EventBits_t uxBits;
+   const TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;
+
+		// Wait a maximum of 100ms for either bit 0 or bit 4 to be set within
+		// the event group.  Clear the bits before exiting.
+		uxBits = xEventGroupWaitBits(
+					xEventGroup,	// The event group being tested.
+					BIT_0 | BIT_4,	// The bits within the event group to wait for.
+					pdTRUE,			// BIT_0 and BIT_4 should be cleared before returning.
+					pdFALSE,		// Don't wait for both bits, either bit will do.
+					xTicksToWait );	// Wait a maximum of 100ms for either bit to be set.
+
+		if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
+		{
+			// xEventGroupWaitBits() returned because both bits were set.
+		}
+		else if( ( uxBits & BIT_0 ) != 0 )
+		{
+			// xEventGroupWaitBits() returned because just BIT_0 was set.
+		}
+		else if( ( uxBits & BIT_4 ) != 0 )
+		{
+			// xEventGroupWaitBits() returned because just BIT_4 was set.
+		}
+		else
+		{
+			// xEventGroupWaitBits() returned because xTicksToWait ticks passed
+			// without either BIT_0 or BIT_4 becoming set.
+		}
+   }
+   </pre>
+ * \defgroup xEventGroupWaitBits xEventGroupWaitBits
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );
+ </pre>
+ *
+ * Clear bits within an event group.  This function cannot be called from an
+ * interrupt.
+ *
+ * @param xEventGroup The event group in which the bits are to be cleared.
+ *
+ * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear
+ * in the event group.  For example, to clear bit 3 only, set uxBitsToClear to
+ * 0x08.  To clear bit 3 and bit 0 set uxBitsToClear to 0x09.
+ *
+ * @return The value of the event group before the specified bits were cleared.
+ *
+ * Example usage:
+   <pre>
+   #define BIT_0	( 1 << 0 )
+   #define BIT_4	( 1 << 4 )
+
+   void aFunction( EventGroupHandle_t xEventGroup )
+   {
+   EventBits_t uxBits;
+
+		// Clear bit 0 and bit 4 in xEventGroup.
+		uxBits = xEventGroupClearBits(
+								xEventGroup,	// The event group being updated.
+								BIT_0 | BIT_4 );// The bits being cleared.
+
+		if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
+		{
+			// Both bit 0 and bit 4 were set before xEventGroupClearBits() was
+			// called.  Both will now be clear (not set).
+		}
+		else if( ( uxBits & BIT_0 ) != 0 )
+		{
+			// Bit 0 was set before xEventGroupClearBits() was called.  It will
+			// now be clear.
+		}
+		else if( ( uxBits & BIT_4 ) != 0 )
+		{
+			// Bit 4 was set before xEventGroupClearBits() was called.  It will
+			// now be clear.
+		}
+		else
+		{
+			// Neither bit 0 nor bit 4 were set in the first place.
+		}
+   }
+   </pre>
+ * \defgroup xEventGroupClearBits xEventGroupClearBits
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ *<pre>
+	BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
+ </pre>
+ *
+ * A version of xEventGroupClearBits() that can be called from an interrupt.
+ *
+ * Setting bits in an event group is not a deterministic operation because there
+ * are an unknown number of tasks that may be waiting for the bit or bits being
+ * set.  FreeRTOS does not allow nondeterministic operations to be performed
+ * while interrupts are disabled, so protects event groups that are accessed
+ * from tasks by suspending the scheduler rather than disabling interrupts.  As
+ * a result event groups cannot be accessed directly from an interrupt service
+ * routine.  Therefore xEventGroupClearBitsFromISR() sends a message to the 
+ * timer task to have the clear operation performed in the context of the timer 
+ * task.
+ *
+ * @param xEventGroup The event group in which the bits are to be cleared.
+ *
+ * @param uxBitsToClear A bitwise value that indicates the bit or bits to clear.
+ * For example, to clear bit 3 only, set uxBitsToClear to 0x08.  To clear bit 3
+ * and bit 0 set uxBitsToClear to 0x09.
+ *
+ * @return If the request to execute the function was posted successfully then 
+ * pdPASS is returned, otherwise pdFALSE is returned.  pdFALSE will be returned 
+ * if the timer service queue was full.
+ *
+ * Example usage:
+   <pre>
+   #define BIT_0	( 1 << 0 )
+   #define BIT_4	( 1 << 4 )
+
+   // An event group which it is assumed has already been created by a call to
+   // xEventGroupCreate().
+   EventGroupHandle_t xEventGroup;
+
+   void anInterruptHandler( void )
+   {
+		// Clear bit 0 and bit 4 in xEventGroup.
+		xResult = xEventGroupClearBitsFromISR(
+							xEventGroup,	 // The event group being updated.
+							BIT_0 | BIT_4 ); // The bits being set.
+
+		if( xResult == pdPASS )
+		{
+			// The message was posted successfully.
+		}
+  }
+   </pre>
+ * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
+ * \ingroup EventGroup
+ */
+#if( configUSE_TRACE_FACILITY == 1 )
+	BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
+#else
+	#define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
+#endif
+
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
+ </pre>
+ *
+ * Set bits within an event group.
+ * This function cannot be called from an interrupt.  xEventGroupSetBitsFromISR()
+ * is a version that can be called from an interrupt.
+ *
+ * Setting bits in an event group will automatically unblock tasks that are
+ * blocked waiting for the bits.
+ *
+ * @param xEventGroup The event group in which the bits are to be set.
+ *
+ * @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
+ * For example, to set bit 3 only, set uxBitsToSet to 0x08.  To set bit 3
+ * and bit 0 set uxBitsToSet to 0x09.
+ *
+ * @return The value of the event group at the time the call to
+ * xEventGroupSetBits() returns.  There are two reasons why the returned value
+ * might have the bits specified by the uxBitsToSet parameter cleared.  First,
+ * if setting a bit results in a task that was waiting for the bit leaving the
+ * blocked state then it is possible the bit will be cleared automatically
+ * (see the xClearBitOnExit parameter of xEventGroupWaitBits()).  Second, any
+ * unblocked (or otherwise Ready state) task that has a priority above that of
+ * the task that called xEventGroupSetBits() will execute and may change the
+ * event group value before the call to xEventGroupSetBits() returns.
+ *
+ * Example usage:
+   <pre>
+   #define BIT_0	( 1 << 0 )
+   #define BIT_4	( 1 << 4 )
+
+   void aFunction( EventGroupHandle_t xEventGroup )
+   {
+   EventBits_t uxBits;
+
+		// Set bit 0 and bit 4 in xEventGroup.
+		uxBits = xEventGroupSetBits(
+							xEventGroup,	// The event group being updated.
+							BIT_0 | BIT_4 );// The bits being set.
+
+		if( ( uxBits & ( BIT_0 | BIT_4 ) ) == ( BIT_0 | BIT_4 ) )
+		{
+			// Both bit 0 and bit 4 remained set when the function returned.
+		}
+		else if( ( uxBits & BIT_0 ) != 0 )
+		{
+			// Bit 0 remained set when the function returned, but bit 4 was
+			// cleared.  It might be that bit 4 was cleared automatically as a
+			// task that was waiting for bit 4 was removed from the Blocked
+			// state.
+		}
+		else if( ( uxBits & BIT_4 ) != 0 )
+		{
+			// Bit 4 remained set when the function returned, but bit 0 was
+			// cleared.  It might be that bit 0 was cleared automatically as a
+			// task that was waiting for bit 0 was removed from the Blocked
+			// state.
+		}
+		else
+		{
+			// Neither bit 0 nor bit 4 remained set.  It might be that a task
+			// was waiting for both of the bits to be set, and the bits were
+			// cleared as the task left the Blocked state.
+		}
+   }
+   </pre>
+ * \defgroup xEventGroupSetBits xEventGroupSetBits
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
+
+/**
+ * event_groups.h
+ *<pre>
+	BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
+ </pre>
+ *
+ * A version of xEventGroupSetBits() that can be called from an interrupt.
+ *
+ * Setting bits in an event group is not a deterministic operation because there
+ * are an unknown number of tasks that may be waiting for the bit or bits being
+ * set.  FreeRTOS does not allow nondeterministic operations to be performed in
+ * interrupts or from critical sections.  Therefore xEventGroupSetBitFromISR()
+ * sends a message to the timer task to have the set operation performed in the
+ * context of the timer task - where a scheduler lock is used in place of a
+ * critical section.
+ *
+ * @param xEventGroup The event group in which the bits are to be set.
+ *
+ * @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
+ * For example, to set bit 3 only, set uxBitsToSet to 0x08.  To set bit 3
+ * and bit 0 set uxBitsToSet to 0x09.
+ *
+ * @param pxHigherPriorityTaskWoken As mentioned above, calling this function
+ * will result in a message being sent to the timer daemon task.  If the
+ * priority of the timer daemon task is higher than the priority of the
+ * currently running task (the task the interrupt interrupted) then
+ * *pxHigherPriorityTaskWoken will be set to pdTRUE by
+ * xEventGroupSetBitsFromISR(), indicating that a context switch should be
+ * requested before the interrupt exits.  For that reason
+ * *pxHigherPriorityTaskWoken must be initialised to pdFALSE.  See the
+ * example code below.
+ *
+ * @return If the request to execute the function was posted successfully then 
+ * pdPASS is returned, otherwise pdFALSE is returned.  pdFALSE will be returned 
+ * if the timer service queue was full.
+ *
+ * Example usage:
+   <pre>
+   #define BIT_0	( 1 << 0 )
+   #define BIT_4	( 1 << 4 )
+
+   // An event group which it is assumed has already been created by a call to
+   // xEventGroupCreate().
+   EventGroupHandle_t xEventGroup;
+
+   void anInterruptHandler( void )
+   {
+   BaseType_t xHigherPriorityTaskWoken, xResult;
+
+		// xHigherPriorityTaskWoken must be initialised to pdFALSE.
+		xHigherPriorityTaskWoken = pdFALSE;
+
+		// Set bit 0 and bit 4 in xEventGroup.
+		xResult = xEventGroupSetBitsFromISR(
+							xEventGroup,	// The event group being updated.
+							BIT_0 | BIT_4   // The bits being set.
+							&xHigherPriorityTaskWoken );
+
+		// Was the message posted successfully?
+		if( xResult == pdPASS )
+		{
+			// If xHigherPriorityTaskWoken is now set to pdTRUE then a context
+			// switch should be requested.  The macro used is port specific and 
+			// will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - 
+			// refer to the documentation page for the port being used.
+			portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
+		}
+  }
+   </pre>
+ * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
+ * \ingroup EventGroup
+ */
+#if( configUSE_TRACE_FACILITY == 1 )
+	BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
+#else
+	#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
+#endif
+
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupSync(	EventGroupHandle_t xEventGroup,
+									const EventBits_t uxBitsToSet,
+									const EventBits_t uxBitsToWaitFor,
+									TickType_t xTicksToWait );
+ </pre>
+ *
+ * Atomically set bits within an event group, then wait for a combination of
+ * bits to be set within the same event group.  This functionality is typically
+ * used to synchronise multiple tasks, where each task has to wait for the other
+ * tasks to reach a synchronisation point before proceeding.
+ *
+ * This function cannot be used from an interrupt.
+ *
+ * The function will return before its block time expires if the bits specified
+ * by the uxBitsToWait parameter are set, or become set within that time.  In
+ * this case all the bits specified by uxBitsToWait will be automatically
+ * cleared before the function returns.
+ *
+ * @param xEventGroup The event group in which the bits are being tested.  The
+ * event group must have previously been created using a call to
+ * xEventGroupCreate().
+ *
+ * @param uxBitsToSet The bits to set in the event group before determining
+ * if, and possibly waiting for, all the bits specified by the uxBitsToWait
+ * parameter are set.
+ *
+ * @param uxBitsToWaitFor A bitwise value that indicates the bit or bits to test
+ * inside the event group.  For example, to wait for bit 0 and bit 2 set
+ * uxBitsToWaitFor to 0x05.  To wait for bits 0 and bit 1 and bit 2 set
+ * uxBitsToWaitFor to 0x07.  Etc.
+ *
+ * @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
+ * for all of the bits specified by uxBitsToWaitFor to become set.
+ *
+ * @return The value of the event group at the time either the bits being waited
+ * for became set, or the block time expired.  Test the return value to know
+ * which bits were set.  If xEventGroupSync() returned because its timeout
+ * expired then not all the bits being waited for will be set.  If
+ * xEventGroupSync() returned because all the bits it was waiting for were
+ * set then the returned value is the event group value before any bits were
+ * automatically cleared.
+ *
+ * Example usage:
+ <pre>
+ // Bits used by the three tasks.
+ #define TASK_0_BIT		( 1 << 0 )
+ #define TASK_1_BIT		( 1 << 1 )
+ #define TASK_2_BIT		( 1 << 2 )
+
+ #define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT )
+
+ // Use an event group to synchronise three tasks.  It is assumed this event
+ // group has already been created elsewhere.
+ EventGroupHandle_t xEventBits;
+
+ void vTask0( void *pvParameters )
+ {
+ EventBits_t uxReturn;
+ TickType_t xTicksToWait = 100 / portTICK_PERIOD_MS;
+
+	 for( ;; )
+	 {
+		// Perform task functionality here.
+
+		// Set bit 0 in the event flag to note this task has reached the
+		// sync point.  The other two tasks will set the other two bits defined
+		// by ALL_SYNC_BITS.  All three tasks have reached the synchronisation
+		// point when all the ALL_SYNC_BITS are set.  Wait a maximum of 100ms
+		// for this to happen.
+		uxReturn = xEventGroupSync( xEventBits, TASK_0_BIT, ALL_SYNC_BITS, xTicksToWait );
+
+		if( ( uxReturn & ALL_SYNC_BITS ) == ALL_SYNC_BITS )
+		{
+			// All three tasks reached the synchronisation point before the call
+			// to xEventGroupSync() timed out.
+		}
+	}
+ }
+
+ void vTask1( void *pvParameters )
+ {
+	 for( ;; )
+	 {
+		// Perform task functionality here.
+
+		// Set bit 1 in the event flag to note this task has reached the
+		// synchronisation point.  The other two tasks will set the other two
+		// bits defined by ALL_SYNC_BITS.  All three tasks have reached the
+		// synchronisation point when all the ALL_SYNC_BITS are set.  Wait
+		// indefinitely for this to happen.
+		xEventGroupSync( xEventBits, TASK_1_BIT, ALL_SYNC_BITS, portMAX_DELAY );
+
+		// xEventGroupSync() was called with an indefinite block time, so
+		// this task will only reach here if the syncrhonisation was made by all
+		// three tasks, so there is no need to test the return value.
+	 }
+ }
+
+ void vTask2( void *pvParameters )
+ {
+	 for( ;; )
+	 {
+		// Perform task functionality here.
+
+		// Set bit 2 in the event flag to note this task has reached the
+		// synchronisation point.  The other two tasks will set the other two
+		// bits defined by ALL_SYNC_BITS.  All three tasks have reached the
+		// synchronisation point when all the ALL_SYNC_BITS are set.  Wait
+		// indefinitely for this to happen.
+		xEventGroupSync( xEventBits, TASK_2_BIT, ALL_SYNC_BITS, portMAX_DELAY );
+
+		// xEventGroupSync() was called with an indefinite block time, so
+		// this task will only reach here if the syncrhonisation was made by all
+		// three tasks, so there is no need to test the return value.
+	}
+ }
+
+ </pre>
+ * \defgroup xEventGroupSync xEventGroupSync
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
+
+
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup );
+ </pre>
+ *
+ * Returns the current value of the bits in an event group.  This function
+ * cannot be used from an interrupt.
+ *
+ * @param xEventGroup The event group being queried.
+ *
+ * @return The event group bits at the time xEventGroupGetBits() was called.
+ *
+ * \defgroup xEventGroupGetBits xEventGroupGetBits
+ * \ingroup EventGroup
+ */
+#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
+
+/**
+ * event_groups.h
+ *<pre>
+	EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
+ </pre>
+ *
+ * A version of xEventGroupGetBits() that can be called from an ISR.
+ *
+ * @param xEventGroup The event group being queried.
+ *
+ * @return The event group bits at the time xEventGroupGetBitsFromISR() was called.
+ *
+ * \defgroup xEventGroupGetBitsFromISR xEventGroupGetBitsFromISR
+ * \ingroup EventGroup
+ */
+EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
+
+/**
+ * event_groups.h
+ *<pre>
+	void xEventGroupDelete( EventGroupHandle_t xEventGroup );
+ </pre>
+ *
+ * Delete an event group that was previously created by a call to
+ * xEventGroupCreate().  Tasks that are blocked on the event group will be
+ * unblocked and obtain 0 as the event group's value.
+ *
+ * @param xEventGroup The event group being deleted.
+ */
+void vEventGroupDelete( EventGroupHandle_t xEventGroup );
+
+/* For internal use only. */
+void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet );
+void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear );
+
+#if (configUSE_TRACE_FACILITY == 1)
+	UBaseType_t uxEventGroupGetNumber( void* xEventGroup );
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT_GROUPS_H */
+
+

BIN
output/fw.bin


+ 580 - 579
project/ewarm/iap/iap.dep

@@ -5,1653 +5,1654 @@
     <configuration>
         <name>Debug</name>
         <outputs>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\settings\settings_api.c</file>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus.c</file>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\iap\iap.c</file>
             <file>$PROJ_DIR$\..\..\..\iap\modules\io\mux.c</file>
             <file>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus_params.c</file>
-            <file>$PROJ_DIR$\..\..\..\iap\user\at32f403a_407_int.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\device_support\startup\iar\startup_at32f403a_407.s</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_debug.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_exint.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_adc.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_can.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_sdio.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_gpio.c</file>
-            <file>$PROJ_DIR$\..\..\..\iap\user\main.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_spi.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_tmr.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_xmc.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\device_support\at32f403a_407.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_flash.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_rtc.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crm.c</file>
-            <file>$PROJ_DIR$\..\..\..\iap\user\FreeRTOSConfig.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dma.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_misc.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_emac.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_pwc.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usb.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usart.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_clock.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_i2c.c</file>
-            <file>$PROJ_DIR$\..\..\..\iap\user\system_at32f403a_407.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wdt.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crc.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dac.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_acc.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wwdt.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_bpr.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_dma.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_crc.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\rtc.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbrtu.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\FreeRTOS.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_xmc.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_gpio.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_board.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\sys_hal.xcl</file>
-            <file>$TOOLKIT_DIR$\inc\c\DLib_Config_Full.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\iap.o</file>
-            <file>$TOOLKIT_DIR$\inc\c\iar_intrinsics_common.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncholding.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\portother.o</file>
-            <file>$TOOLKIT_DIR$\inc\c\string.h</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus.c</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\settings\settings_api.c</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\iap\iap.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_hal.h</file>
+            <file>$PROJ_DIR$\..\..\..\iap\user\main.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\queue.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dma.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_can.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\settings_api.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncdisc.o</file>
             <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_acc.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_misc.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_exint.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_int.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncfile.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_int.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\modbus_params.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_gpio.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_wdt.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\list.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_debug.h</file>
             <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_wwdt.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_wdt.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\tasks.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dac.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_adc.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_crm.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\portable.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\sys_hal.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_xmc.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_emac.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\fr_timers.o</file>
             <file>$PROJ_DIR$\Debug\Obj\mbfunccoils.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\list.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_crc.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_adc.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\tim_delay.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\event_groups.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_emac.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_can.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_can.h</file>
-            <file>$TOOLKIT_DIR$\inc\c\intrinsics.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\extended_sram.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_i2c.o</file>
-            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_api.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\wdt.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\wdt.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_tmr.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\cmsis_version.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_usb.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\modbus_params.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\queue.h</file>
-            <file>$TOOLKIT_DIR$\inc\c\ysizet.h</file>
-            <file>$TOOLKIT_DIR$\inc\c\DLib_Product_string.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\croutine.o</file>
-            <file>$PROJ_DIR$\Debug\List\iap.map</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_spi.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbrtu.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\sys_api.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbcrc.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_bpr.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_tmr.xcl</file>
-            <file>$TOOLKIT_DIR$\inc\c\DLib_Product.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_acc.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\shared\utils\at32f403a_407_board.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dac.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\utility.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncfile.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_debug.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usb.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\tim_delay.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\deprecated_definitions.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dma.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\event_groups.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\StackMacros.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\heap_4.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\portserial.o</file>
-            <file>$TOOLKIT_DIR$\lib\shb_l.a</file>
+            <file>$PROJ_DIR$\Debug\Obj\list.xcl</file>
             <file>$PROJ_DIR$\Debug\Obj\mbascii.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_spi.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_crc.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\croutine.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\utility.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\queue.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\porttimer.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\semphr.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\utils\extended_sram.h</file>
             <file>$PROJ_DIR$\Debug\Obj\fr_timers.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncdisc.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_pwc.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbutils.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\io\mux.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_misc.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_rtc.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_gpio.o</file>
             <file>$PROJ_DIR$\Debug\Obj\iap.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\portserial.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\main.xcl</file>
-            <file>$TOOLKIT_DIR$\inc\c\ycheck.h</file>
-            <file>$TOOLKIT_DIR$\inc\c\stdint.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncother.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\list.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\modbus_params.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\event_groups.o</file>
             <file>$PROJ_DIR$\Debug\Obj\common_gpio.o</file>
             <file>$PROJ_DIR$\Debug\Obj\mb.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\portasm.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_flash.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\fr_timers.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\system_at32f403a_407.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\port.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_adc.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_i2c.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_board.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_spi.o</file>
+            <file>$TOOLKIT_DIR$\inc\c\stdint.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\sys_hal.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\deprecated_definitions.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_flash.h</file>
+            <file>$TOOLKIT_DIR$\lib\shb_l.a</file>
             <file>$PROJ_DIR$\Debug\Obj\event_groups.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\mb.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_exint.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\port.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\settings_api.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\sys_api.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncdiag.xcl</file>
             <file>$PROJ_DIR$\..\..\..\shared\peripherals\inc\common_gpio.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mux.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dma.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\queue.o</file>
-            <file>$TOOLKIT_DIR$\inc\c\DLib_Defaults.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_hal.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\queue.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncother.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_adc.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\port.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfunccoils.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_rtc.h</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\io\mux.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncdiag.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\FreeRTOS-openocd.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_usart.h</file>
             <file>$PROJ_DIR$\Debug\Obj\portevent.o</file>
-            <file>$PROJ_DIR$\..\..\..\shared\peripherals\inc\usart.h</file>
             <file>$TOOLKIT_DIR$\inc\c\stdbool.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_emac.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_flash.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\startup_at32f403a_407.o</file>
             <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_crm.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_xmc.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\settings_api.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_can.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\cmsis_compiler.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_usart.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbcrc.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\utility.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\port.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_misc.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_exint.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_clock.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncinput.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_clock.o</file>
-            <file>$PROJ_DIR$\..\..\..\iap\user\system_at32f403a_407.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_crm.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_wwdt.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\mux.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\sys_api.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbrtu.o</file>
             <file>$PROJ_DIR$\Debug\Obj\rtc.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_emac.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\portasm.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_crc.o</file>
+            <file>$PROJ_DIR$\..\..\..\shared\wdt\wdt.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_i2c.h</file>
+            <file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncinput.o</file>
+            <file>$TOOLKIT_DIR$\inc\c\DLib_Defaults.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_exint.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\task.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\mux.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\cmsis_compiler.h</file>
             <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_def.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncdisc.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_sdio.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\iap\user\at32f403a_407_int.h</file>
-            <file>$TOOLKIT_DIR$\inc\c\stdlib.h</file>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\io\io.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\rtc\rtc.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\cmsis_iccarm.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\portevent.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\main.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\mpu_wrappers.h</file>
+            <file>$TOOLKIT_DIR$\inc\c\stddef.h</file>
             <file>$PROJ_DIR$\..\..\..\iap\modules\settings\settings_api.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbcrc.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\wdt\wdt.h</file>
             <file>$TOOLKIT_DIR$\inc\c\iccarm_builtin.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_rtc.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_acc.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\cmsis_iccarm.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_emac.h</file>
+            <file>$PROJ_DIR$\..\..\..\iap\user\system_at32f403a_407.h</file>
             <file>$PROJ_DIR$\Debug\Obj\mbfuncother.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\mb.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\FreeRTOS-openocd.o</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\ascii\mbascii.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbutils.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\tasks.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_bpr.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncdiag.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\shared\utils\utility.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\FreeRTOS-openocd.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_clock.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\core_cm4.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usart.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbrtu.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\iap.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_sdio.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\extended_sram.o</file>
             <file>$PROJ_DIR$\Debug\Obj\heap_4.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_flash.xcl</file>
-            <file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\projdefs.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncinput.xcl</file>
+            <file>$TOOLKIT_DIR$\inc\c\DLib_Config_Full.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbcrc.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\portother.xcl</file>
+            <file>$TOOLKIT_DIR$\inc\c\DLib_Product_stdlib.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\main.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\porttimer.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\iap\user\at32f403a_407_int.h</file>
             <file>$PROJ_DIR$\Debug\Obj\mbfuncholding.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_tmr.h</file>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\iap\iap.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_i2c.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_acc.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_wwdt.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\croutine.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_sdio.h</file>
             <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_dac.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncdiag.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_exint.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_bpr.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus_params.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_gpio.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\porttimer.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\core_cm4.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\projdefs.h</file>
-            <file>$PROJ_DIR$\Debug\Exe\iap.out</file>
-            <file>$TOOLKIT_DIR$\inc\c\stddef.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_wwdt.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\settings_api.xcl</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbascii.o</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\semphr.h</file>
-            <file>$PROJ_DIR$\..\..\..\iap\user\main.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\mpu_armv7.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\porttimer.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usart.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\modbus.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\fr_timers.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncdisc.xcl</file>
             <file>$PROJ_DIR$\Debug\Obj\common_gpio.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\croutine.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_i2c.xcl</file>
-            <file>$PROJ_DIR$\AT32F403AxG.icf</file>
-            <file>$PROJ_DIR$\Debug\Obj\portother.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\portevent.xcl</file>
+            <file>$TOOLKIT_DIR$\lib\rt7M_tl.a</file>
+            <file>$PROJ_DIR$\Debug\Obj\startup_at32f403a_407.o</file>
+            <file>$PROJ_DIR$\..\..\..\shared\utils\utility.h</file>
             <file>$TOOLKIT_DIR$\lib\dl7M_tlf.a</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usb.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_sdio.h</file>
-            <file>$TOOLKIT_DIR$\inc\c\stdio.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\task.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_pwc.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portserial.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_api.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\porttimer.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_hal.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\wdt\wdt.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\utils\utility.c</file>
-            <file>$TOOLKIT_DIR$\inc\c\DLib_Product_stdlib.h</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usart.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\shared\rtc\rtc.c</file>
-            <file>$PROJ_DIR$\Debug\Obj\system_at32f403a_407.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_rtc.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_crm.h</file>
             <file>$TOOLKIT_DIR$\inc\c\yvals.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_rtc.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_sdio.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\shared\rtc\rtc.h</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\iap\iap.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_clock.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbrtu.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mux.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_tmr.h</file>
+            <file>$TOOLKIT_DIR$\inc\c\stdlib.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\fr_timers.h</file>
+            <file>$PROJ_DIR$\AT32F403AxG.icf</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_misc.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_wwdt.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbcrc.xcl</file>
             <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_debug.xcl</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_wdt.h</file>
-            <file>$TOOLKIT_DIR$\lib\rt7M_tl.a</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\tim_delay.c</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfunccoils.o</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\mb.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\utils\extended_sram.c</file>
-            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_sdio.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\modbus.o</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portother.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\utils\at32f403a_407_board.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbascii.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\mpu_wrappers.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\mpu_armv7.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_spi.o</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\io\io.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\ascii\mbascii.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\FreeRTOS-openocd.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usart.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_board.o</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus_params.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\croutine.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\wdt.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_pwc.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_tmr.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_crc.h</file>
+            <file>$PROJ_DIR$\Debug\Exe\iap.out</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_can.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_bpr.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_wdt.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_usb.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_emac.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\system_at32f403a_407.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_clock.o</file>
             <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_pwc.o</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portevent.c</file>
-            <file>$PROJ_DIR$\Debug\Obj\extended_sram.o</file>
-            <file>$PROJ_DIR$\Debug\Obj\mbfuncinput.o</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbcrc.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\model\model_cfg.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbrtu.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\tim_delay.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\peripherals\src\common_gpio.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\sys_hal.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_flash.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\FreeRTOS.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_bpr.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\list.o</file>
+            <file>$TOOLKIT_DIR$\inc\c\DLib_Product_string.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_spi.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_i2c.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\event_groups.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\extended_sram.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\core_support\cmsis_version.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_clock.h</file>
+            <file>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\tasks.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbutils.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\modbus.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\utility.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\modbus.xcl</file>
+            <file>$PROJ_DIR$\Debug\List\iap.map</file>
+            <file>$PROJ_DIR$\Debug\Obj\rtc.o</file>
+            <file>$TOOLKIT_DIR$\inc\c\intrinsics.h</file>
+            <file>$TOOLKIT_DIR$\inc\c\iar_intrinsics_common.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\sys_api.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_dma.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\utils\at32f403a_407_board.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_gpio.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usb.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_can.h</file>
+            <file>$TOOLKIT_DIR$\inc\c\stdio.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_bpr.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\iap.pbd</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbrtu.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\modbus_params.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_gpio.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dac.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_xmc.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\tim_delay.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_usb.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncfile.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_tmr.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\tasks.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_debug.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dma.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usb.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wwdt.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_gpio.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crc.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_rtc.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_tmr.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dac.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_emac.c</file>
+            <file>$PROJ_DIR$\..\..\..\iap\user\at32f403a_407_int.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_exint.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_adc.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_misc.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_xmc.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_acc.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\device_support\at32f403a_407.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\device_support\startup\iar\startup_at32f403a_407.s</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_can.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crm.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_flash.c</file>
+            <file>$PROJ_DIR$\..\..\..\iap\user\system_at32f403a_407.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_i2c.c</file>
+            <file>$PROJ_DIR$\..\..\..\iap\user\FreeRTOSConfig.h</file>
+            <file>$PROJ_DIR$\..\..\..\iap\user\main.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_debug.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_pwc.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_bpr.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_spi.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usart.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wdt.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_clock.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_sdio.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_conf.h</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\port.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\event_groups.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\list.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdiag.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\memmang\heap_4.c</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\fr_timers.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\board\common_config.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdisc.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfunccoils.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdiag.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncfile.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncother.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\portasm.s</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncinput.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbutils.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mb.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdisc.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\board\common.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbframe.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbfunc.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbport.h</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbproto.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\queue.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\board\common.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncinput.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbutils.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\croutine.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbfunc.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\tasks.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncother.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\include\mbconfig.h</file>
-            <file>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_conf.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncholding.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\queue.c</file>
             <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\port.h</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\ascii\mbascii.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncholding.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\list.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\memmang\heap_4.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\event_groups.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\croutine.c</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\portmacro.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\tasks.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\board\common_config.h</file>
             <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\FreeRTOS-openocd.c</file>
-            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfunccoils.c</file>
-            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\portasm.s</file>
-            <file>$PROJ_DIR$\Debug\Obj\iap.pbd</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\ascii\mbascii.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_api.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_int.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\system_at32f403a_407.o</file>
+            <file>$TOOLKIT_DIR$\inc\c\DLib_Product.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_crm.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\queue.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_rtc.o</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_spi.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\portother.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_misc.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_wdt.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbutils.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_debug.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_adc.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_wdt.xcl</file>
+            <file>$TOOLKIT_DIR$\inc\c\string.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_flash.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\portserial.o</file>
+            <file>$PROJ_DIR$\..\..\..\shared\peripherals\inc\usart.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_adc.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_pwc.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\portserial.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dma.o</file>
+            <file>$TOOLKIT_DIR$\inc\c\ysizet.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\list.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_board.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\croutine.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\main.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_xmc.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\portable.h</file>
+            <file>$PROJ_DIR$\..\..\..\libs\artery\drivers\inc\at32f403a_407_xmc.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\tim_delay.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\shared\model\model_cfg.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\utils\at32f403a_407_board.c</file>
+            <file>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\include\StackMacros.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_exint.o</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\mb.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\heap_4.o</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\tim_delay.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portserial.c</file>
+            <file>$TOOLKIT_DIR$\inc\c\ycheck.h</file>
+            <file>$PROJ_DIR$\..\..\..\shared\wdt\wdt.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\rtc\rtc.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbrtu.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbcrc.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\wdt.o</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portother.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\utils\extended_sram.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\peripherals\src\common_gpio.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_misc.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\tim_delay.h</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_int.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncholding.o</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\porttimer.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_hal.c</file>
+            <file>$PROJ_DIR$\..\..\..\shared\utils\utility.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbfuncfile.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\shared\sys\sys_api.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_crc.xcl</file>
+            <file>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portevent.c</file>
+            <file>$PROJ_DIR$\Debug\Obj\mbcrc.o</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_acc.xcl</file>
+            <file>$PROJ_DIR$\Debug\Obj\at32f403a_407_dac.o</file>
+            <file>$PROJ_DIR$\..\..\..\fw\user\main.cpp</file>
         </outputs>
         <file>
             <name>[ROOT_NODE]</name>
             <outputs>
                 <tool>
                     <name>ILINK</name>
-                    <file> 228 96</file>
+                    <file> 138 165</file>
                 </tool>
             </outputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\modules\settings\settings_api.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\modules\io\mux.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 165</file>
+                    <file> 66</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 231</file>
+                    <file> 114</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 196 159 158 41 229 93 21 227 70 112 310 82 48 195 233 92 85 294 308 249 74 296 297 289 299 51 94 189 257 248</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 49 54 149 69 275 211 83 281 33 247 167 168 124 65 276</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus_params.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 271</file>
+                    <file> 179</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 238</file>
+                    <file> 27</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 289 58 223 294 308 41 229 93 21 227 70 112 310 82 48 195 249 74 296 297 159 98 281 196 158 233 92 85 218 150 239 248 51 94</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 132 230 241 149 69 275 211 83 281 33 247 167 168 124 65 276 235 236 159 54 267 152</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\modules\iap\iap.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 47</file>
+                    <file> 162</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 131</file>
+                    <file> 164</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 218 196 159 158 41 229 93 21 227 70 112 310 82 48 195 233 92 85 294 308 249 74 296 297 289 239 78 98 279 248 51 94</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 249 159 132 230 241 149 69 275 211 83 281 33 247 167 168 124 65 276 235 236 54 178 302 70 270 22 257 252 111 43 117 175 267 152</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\modules\io\mux.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\modules\settings\settings_api.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 151</file>
+                    <file> 10</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 180</file>
+                    <file> 40</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 128 159 41 229 93 21 227 70 112 310 82 48 195 249 74</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 70 54 270 149 69 275 211 83 281 33 247 167 168 124 22 257 252 230 241 65 276 235 236 249 232 267 152 116 88 175</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\modules\modbus\modbus_params.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\modules\iap\iap.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 91</file>
+                    <file> 79</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 59</file>
+                    <file> 26</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 223 294 308 41 229 93 21 227 70 112 310 82 48 195 249 74 296 297 58 159 51 94</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 111 70 54 270 149 69 275 211 83 281 33 247 167 168 124 22 257 252 230 241 65 276 235 236 249 117 155 178 284 175 267 152</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\user\at32f403a_407_int.c</name>
+            <name>$PROJ_DIR$\Debug\Exe\iap.out</name>
             <outputs>
                 <tool>
-                    <name>ICCARM</name>
-                    <file> 55</file>
-                </tool>
-                <tool>
-                    <name>BICOMP</name>
-                    <file> 57</file>
+                    <name>ILINK</name>
+                    <file> 165</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
-                    <name>ICCARM</name>
-                    <file> 188 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <name>ILINK</name>
+                    <file> 118 12 45 131 140 9 145 58 256 314 188 274 143 287 268 25 154 303 261 146 258 80 126 136 77 173 262 95 182 29 133 28 81 15 129 289 79 151 89 30 123 312 47 50 11 185 304 62 44 113 161 162 179 66 46 57 53 260 269 21 20 166 10 103 41 32 254 160 183 163 297 35 102 61 105</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\device_support\startup\iar\startup_at32f403a_407.s</name>
-            <outputs>
-                <tool>
-                    <name>AARM</name>
-                    <file> 162</file>
-                </tool>
-            </outputs>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_debug.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dma.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 109</file>
+                    <file> 274</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 263</file>
+                    <file> 8</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_exint.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usb.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 54</file>
+                    <file> 173</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 173</file>
+                    <file> 184</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_adc.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wwdt.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 145</file>
+                    <file> 95</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 68</file>
+                    <file> 13</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_can.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_gpio.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 166</file>
+                    <file> 25</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 80</file>
+                    <file> 180</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_sdio.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 270</file>
+                    <file> 58</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 187</file>
+                    <file> 310</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_gpio.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_rtc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 224</file>
+                    <file> 258</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 43</file>
+                    <file> 106</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\user\main.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_tmr.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 194</file>
+                    <file> 136</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 133</file>
+                    <file> 186</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 234 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 105 248 93 212 289 41 229 21 227 70 112 310 82 48 195 249 74 92 233 58 150 196 159 158 85 294 308 296 297 128 51 94</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_spi.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dac.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 148</file>
+                    <file> 314</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 97</file>
+                    <file> 181</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_tmr.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_emac.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 88</file>
+                    <file> 143</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 102</file>
+                    <file> 14</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_xmc.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\user\at32f403a_407_int.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 42</file>
+                    <file> 303</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 72</file>
+                    <file> 253</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 91 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_flash.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_exint.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 141</file>
+                    <file> 287</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 214</file>
+                    <file> 38</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_rtc.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_adc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 130</file>
+                    <file> 45</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 200</file>
+                    <file> 271</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crm.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_misc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 69</file>
+                    <file> 261</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 163</file>
+                    <file> 301</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dma.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_xmc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 113</file>
+                    <file> 182</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 152</file>
+                    <file> 280</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_misc.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_acc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 129</file>
+                    <file> 12</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 53</file>
+                    <file> 313</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_emac.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\cmsis\cm4\device_support\startup\iar\startup_at32f403a_407.s</name>
+            <outputs>
+                <tool>
+                    <name>AARM</name>
+                    <file> 103</file>
+                </tool>
+            </outputs>
+        </file>
+        <file>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_can.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 79</file>
+                    <file> 9</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 160</file>
+                    <file> 139</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_pwc.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crm.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 274</file>
+                    <file> 256</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 250</file>
+                    <file> 55</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usb.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_flash.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 110</file>
+                    <file> 268</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 246</file>
+                    <file> 148</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usart.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\user\system_at32f403a_407.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 237</file>
+                    <file> 254</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 258</file>
+                    <file> 144</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_clock.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_i2c.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 176</file>
+                    <file> 154</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 174</file>
+                    <file> 93</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 212 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_i2c.c</name>
+            <name>$PROJ_DIR$\..\..\..\iap\user\main.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 84</file>
+                    <file> 89</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 242</file>
+                    <file> 279</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 6 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 171 175 275 158 249 149 69 211 83 281 33 247 167 168 124 65 276 257 22 159 43 70 54 270 252 230 241 235 236 49 267 152</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\iap\user\system_at32f403a_407.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_debug.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 143</file>
+                    <file> 188</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 260</file>
+                    <file> 122</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wdt.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_pwc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 65</file>
+                    <file> 146</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 61</file>
+                    <file> 135</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_crc.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_bpr.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 121</file>
+                    <file> 140</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 75</file>
+                    <file> 150</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_dac.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_spi.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 67</file>
+                    <file> 126</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 106</file>
+                    <file> 153</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_acc.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_usart.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 52</file>
+                    <file> 77</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 104</file>
+                    <file> 130</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wwdt.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_wdt.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 179</file>
+                    <file> 262</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 64</file>
+                    <file> 266</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_bpr.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\system\at32f403a_407_clock.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 208</file>
+                    <file> 145</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 222</file>
+                    <file> 112</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 306 178 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 158 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\Debug\Exe\iap.out</name>
+            <name>$PROJ_DIR$\..\..\..\libs\artery\drivers\src\at32f403a_407_sdio.c</name>
             <outputs>
                 <tool>
-                    <name>ILINK</name>
-                    <file> 96</file>
+                    <name>ICCARM</name>
+                    <file> 80</file>
+                </tool>
+                <tool>
+                    <name>BICOMP</name>
+                    <file> 109</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
-                    <name>ILINK</name>
-                    <file> 243 52 145 44 208 166 176 121 69 67 109 113 79 54 141 224 84 55 129 274 130 270 148 88 237 110 65 179 42 138 95 114 276 142 204 116 47 62 194 139 232 100 267 220 125 108 49 277 136 182 206 271 91 151 144 140 157 50 117 236 153 39 165 162 181 71 143 207 111 107 86 118 265 215 245</file>
+                    <name>ICCARM</name>
+                    <file> 221 107 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portserial.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\port.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 117</file>
+                    <file> 46</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 132</file>
+                    <file> 39</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 105 248 93 41 229 21 227 70 112 310 82 48 195 249 74 294 308 296 297 281 159 128 189 257</file>
+                    <file> 167 71 108 63 85 255 168 149 69 292 275 31 211 83 281 33 247 124 65 276</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\sys\sys_api.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\fr_timers.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 181</file>
+                    <file> 15</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 99</file>
+                    <file> 24</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 135 134 261 154 46 103 85 159 155 196 17 226 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 158 41 229 93 21 227 70 112 310 82 48 195 233 92 294 308 249 74 296 297 289 299 191 51 94 248</file>
+                    <file> 116 292 108 63 85 255 275 88 149 69 31 211 83 281 33 247 167 71 168 124 65 276 257 117</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\porttimer.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfunccoils.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 236</file>
+                    <file> 47</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 225</file>
+                    <file> 16</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 93 21 227 70 112 310 82 48 195 249 74 308 294 296 297 128 159</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 233 239</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\sys\sys_hal.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdiag.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 71</file>
+                    <file> 50</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 45</file>
+                    <file> 42</file>
                 </tool>
             </outputs>
-            <inputs>
-                <tool>
-                    <name>ICCARM</name>
-                    <file> 135 134 261 154 46 103 155 85 159 289 17 226 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 299 248 93</file>
-                </tool>
-            </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\wdt\wdt.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncfile.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 86</file>
+                    <file> 185</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 87</file>
+                    <file> 308</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 198</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 233 239 175</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\utils\utility.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\portasm.s</name>
             <outputs>
                 <tool>
-                    <name>ICCARM</name>
-                    <file> 107</file>
-                </tool>
-                <tool>
-                    <name>BICOMP</name>
-                    <file> 170</file>
+                    <name>AARM</name>
+                    <file> 57</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
-                    <name>ICCARM</name>
-                    <file> 41 229 134 261 154 46 103 93 135 21 227 70 112 310 82 199 48 195 249 74 92 233 210 188 17 226 89 167 192 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 248</file>
+                    <name>AARM</name>
+                    <file> 211</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\rtc\rtc.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncinput.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 39</file>
+                    <file> 62</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 183</file>
+                    <file> 84</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 191 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 196 159 158 41 229 93 21 227 70 112 310 82 48 195 233 92 85 294 308 249 74 296 297 289 51 94 248</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 233 239</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\tim_delay.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbutils.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 111</file>
+                    <file> 161</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 77</file>
+                    <file> 263</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 281 159 128</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\mb.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdisc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 139</file>
+                    <file> 11</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 203</file>
+                    <file> 99</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 305 295 303 98</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 233 239</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\utils\extended_sram.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncother.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 276</file>
+                    <file> 44</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 83</file>
+                    <file> 75</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 123 279 159</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 233 239</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portother.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\queue.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 50</file>
+                    <file> 20</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 244</file>
+                    <file> 7</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 41 229 135 21 227 70 112 310 82 199 48 195 249 74 233 92 294 308 17 226 89 167 192 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 296 297</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 149 69 31 211 83 281 33 247 167 71 168 124 65 276 257</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\utils\at32f403a_407_board.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncholding.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 44</file>
+                    <file> 304</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 147</file>
+                    <file> 92</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 105 248 134 261 154 46 103 93 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 233 239</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portevent.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\list.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 157</file>
+                    <file> 151</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 193</file>
+                    <file> 17</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 41 229 134 261 154 46 103 93 135 21 227 70 112 310 82 199 48 195 249 74 92 294 308 17 226 89 167 192 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 296 297</file>
+                    <file> 116 292 108 63 85 255 275 88 149 69 31 211 83 281 33 247 167 71 168 124 276</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbcrc.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\memmang\heap_4.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 100</file>
+                    <file> 289</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 169</file>
+                    <file> 82</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 308 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 93 21 227 70 112 310 82 48 195 249 74</file>
+                    <file> 116 292 108 63 85 255 275 88 149 69 31 211 83 281 33 247 167 71 168 124 65 276</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbrtu.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\event_groups.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 182</file>
+                    <file> 28</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 40</file>
+                    <file> 36</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 98 295 197</file>
+                    <file> 116 292 108 63 85 255 275 88 149 69 31 211 83 281 33 247 167 71 168 124 65 276 117 155</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\peripherals\src\common_gpio.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\croutine.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 138</file>
+                    <file> 133</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 240</file>
+                    <file> 278</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 17 226 135 134 261 154 46 103 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 150 41 229 93 21 227 70 112 310 82 48 195 249 74 190 159</file>
+                    <file> 149 69 292 108 63 85 255 275 31 211 83 281 33 247 167 71 168 124 65 276 96</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\port.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\tasks.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 144</file>
+                    <file> 160</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 171</file>
+                    <file> 187</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 82 199 261 154 46 103 48 41 229 134 93 135 21 227 70 112 310 195 249 74</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 149 69 31 211 83 281 33 247 167 71 168 124 65 276 117 286 175</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\event_groups.c</name>
+            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\FreeRTOS-openocd.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 114</file>
+                    <file> 129</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 149</file>
+                    <file> 51</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 41 229 135 21 227 70 112 310 82 199 48 195 249 74 239 78</file>
+                    <file> 149 69 292 108 63 85 255 275 31 211 83 281 33 247 167 71 168 124</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\list.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\ascii\mbascii.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 62</file>
+                    <file> 123</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 137</file>
+                    <file> 18</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 41 229 135 21 227 70 112 310 82 199 48 195 74</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 239 128 233 86</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdiag.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\utils\at32f403a_407_board.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 220</file>
+                    <file> 131</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 209</file>
+                    <file> 277</file>
                 </tool>
             </outputs>
+            <inputs>
+                <tool>
+                    <name>ICCARM</name>
+                    <file> 171 175 292 108 63 85 255 275 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73</file>
+                </tool>
+            </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\memmang\heap_4.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\mb.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 116</file>
+                    <file> 30</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 213</file>
+                    <file> 37</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 41 229 135 21 227 70 112 310 82 199 48 195 249 74</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 239 233 234 178</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\fr_timers.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\tim_delay.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 142</file>
+                    <file> 183</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 124</file>
+                    <file> 283</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 41 229 135 21 227 70 112 310 82 199 48 195 249 74 92 239</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 302 54 49</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncdisc.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portserial.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 125</file>
+                    <file> 269</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 186</file>
+                    <file> 273</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 295 305</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 171 175 275 149 69 211 83 281 33 247 167 168 124 65 276 230 241 235 236 302 54 49 116 88</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncfile.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\wdt\wdt.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 108</file>
+                    <file> 297</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 56</file>
+                    <file> 134</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 295 305 248</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 59</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncother.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\rtc\rtc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 136</file>
+                    <file> 166</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 202</file>
+                    <file> 56</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 295 305</file>
+                    <file> 110 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 70 54 270 149 69 275 211 83 281 33 247 167 168 124 22 257 252 230 241 65 276 235 236 249 267 152 175</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbutils.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbrtu.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 206</file>
+                    <file> 113</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 127</file>
+                    <file> 78</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297</file>
+                    <file> 116 292 108 63 85 255 275 88 267 152 241 204 76 31 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 211 83 281 33 247 167 168 124 65 276 230 235 236 178 233 86</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\queue.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\rtu\mbcrc.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 153</file>
+                    <file> 312</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 156</file>
+                    <file> 121</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 41 229 135 21 227 70 112 310 82 199 48 195 249 74 92</file>
+                    <file> 241 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 275 211 83 281 33 247 167 168 124 65 276</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncinput.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portother.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 277</file>
+                    <file> 260</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 175</file>
+                    <file> 87</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 295 305</file>
+                    <file> 116 292 108 63 85 255 275 88 149 69 31 211 83 281 33 247 167 71 168 124 65 276 22 257 230 241 204 76 157 67 72 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 235 236</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\croutine.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\utils\extended_sram.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 95</file>
+                    <file> 81</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 122</file>
+                    <file> 156</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 41 229 134 261 154 46 103 93 135 21 227 70 112 310 82 199 48 195 249 74 241</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 23 284 54</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\tasks.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\peripherals\src\common_gpio.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 207</file>
+                    <file> 29</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 66</file>
+                    <file> 100</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 41 229 135 21 227 70 112 310 82 199 48 195 249 74 239 115 248</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 43 149 69 275 211 83 281 33 247 167 168 124 65 276 127 54</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfuncholding.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\porttimer.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 49</file>
+                    <file> 21</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 216</file>
+                    <file> 90</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 295 305</file>
+                    <file> 204 76 31 292 108 63 85 255 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 149 69 275 211 83 281 33 247 167 168 124 65 276 241 230 235 236 49 54</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\ascii\mbascii.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\sys\sys_hal.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 232</file>
+                    <file> 32</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 119</file>
+                    <file> 147</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 305 205 295 197</file>
+                    <file> 31 292 108 63 85 255 5 252 54 249 204 76 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 232 175 275</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\FreeRTOS-openocd.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\utils\utility.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 204</file>
+                    <file> 163</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 211</file>
+                    <file> 19</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 41 229 134 261 154 46 103 93 135 21 227 70 112 310 82 199 48 195</file>
+                    <file> 149 69 292 108 63 85 255 275 31 211 83 281 33 247 167 71 168 124 65 276 257 22 104 91 204 76 157 67 72 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 175</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\functions\mbfunccoils.c</name>
+            <name>$PROJ_DIR$\..\..\..\shared\sys\sys_api.c</name>
             <outputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 267</file>
+                    <file> 41</file>
                 </tool>
                 <tool>
                     <name>BICOMP</name>
-                    <file> 73</file>
+                    <file> 169</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
                     <name>ICCARM</name>
-                    <file> 189 134 261 154 46 103 93 257 51 94 308 17 226 135 89 167 192 199 235 177 185 306 178 217 262 101 60 146 168 126 81 76 219 120 37 63 161 38 230 264 221 247 164 201 172 90 184 41 229 21 227 70 112 310 82 48 195 249 74 294 296 297 295 305</file>
+                    <file> 31 292 108 63 85 255 252 54 5 70 204 76 157 67 72 71 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 270 149 69 275 211 83 281 33 247 167 168 124 22 257 230 241 65 276 235 236 249 232 110 267 152 175</file>
                 </tool>
             </inputs>
         </file>
         <file>
-            <name>$PROJ_DIR$\..\..\..\libs\thirdparty\freertos\portable\IAR\ARM_CM4F\portasm.s</name>
+            <name>$PROJ_DIR$\..\..\..\shared\freemodbus\port\portevent.c</name>
             <outputs>
                 <tool>
-                    <name>AARM</name>
-                    <file> 140</file>
+                    <name>ICCARM</name>
+                    <file> 53</file>
+                </tool>
+                <tool>
+                    <name>BICOMP</name>
+                    <file> 101</file>
                 </tool>
             </outputs>
             <inputs>
                 <tool>
-                    <name>AARM</name>
-                    <file> 21</file>
+                    <name>ICCARM</name>
+                    <file> 149 69 292 108 63 85 255 275 31 211 83 281 33 247 167 71 168 124 65 276 257 230 241 204 76 157 67 72 125 74 68 221 107 115 48 176 172 60 52 272 174 265 98 259 170 264 34 137 120 141 64 97 282 94 119 142 73 235 236</file>
                 </tool>
             </inputs>
         </file>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 644 - 636
project/ewarm/module_universal_io.dep


BIN
tools/__pycache__/io_module.cpython-310.pyc


BIN
tools/__pycache__/log_reader.cpython-310.pyc


BIN
tools/__pycache__/mb_registers.cpython-310.pyc


BIN
tools/__pycache__/sys_params.cpython-310.pyc


+ 93 - 3
tools/digital_io.py

@@ -7,14 +7,85 @@ from colorama import Fore
 from time import sleep
 import time
 from datetime import datetime, timedelta, timezone
+from mb_registers import DIO_REGS
+
+
 
 class IO_Digital(IO_Module):
+
     def __init__(self, tty: str, brate: int, address: int):
         self.modbus = Modbus(tty, brate, address)
         super().__init__(self.modbus)
         self.log = DigitalLogReader(self.modbus)
  
-    
+    '''Запрос параметров'''
+    # 0x0100 - текущее состояние входов
+    def get_inputs_bit(self) -> str:
+        data = self.modbus.read_holding_registers(DIO_REGS['in_bits'], 1)
+        return format(data[0], '08b')
+
+    # 0x0101 - 0x0110 Счетчики импульсов
+    def get_inputs_counters(self):
+        data = []
+        for i in range(DIO_REGS['in_cnt'], DIO_REGS['in_cnt'] + 16, 2):
+            data.append(self.modbus.read_uint32_holding(i))
+        return data
+
+    # 0x0101 - 0x0110 Счетчики импульсов
+    def get_inputs_counters(self):
+        data = []
+        for i in range(DIO_REGS['in_cnt'], DIO_REGS['in_cnt'] + 16, 2):
+            data.append(self.modbus.read_uint32_holding(i))
+        return data                              
+
+    # 0x0120 - режим работы входов
+    def get_inputs_mode(self):
+        data = self.modbus.read_holding_registers(DIO_REGS['in_mode'], 1)
+        return format(data[0], '08b')
+
+    # 0x0122 - нормальное состояние входов
+    def get_inputs_norm_state(self):
+        data = self.modbus.read_holding_registers(DIO_REGS['in_norm'], 1)
+        return format(data[0], '08b')
+
+    # 0x0124 - время антидребезга (ms)
+    def get_debounce_channel(self, input):
+        data = self.modbus.read_holding_registers(DIO_REGS['in_deb_start'] + input - 1, 1)
+        return data[0]
+
+    def get_debounce_channels(self):
+        return self.modbus.read_holding_registers(DIO_REGS['in_deb_start'], 8)
+
+    '''Установка параметров'''
+    def set_inputs_mode(self, val):
+        self.modbus.write_holding_register(DIO_REGS['in_mode'], val)
+
+    #        
+    def set_input_mode(self, input, val):
+        ret = self.modbus.read_holding_registers(DIO_REGS['in_mode'], 1)
+        if val == 1:
+            data = ret[0] | (0b1 << (input - 1))
+        else:
+            data = ret[0] & ~(0b1 << (input - 1))
+        self.set_inputs_mode(data)
+
+    def print_inputs(self):
+        # Значения входов (битовое поле)
+        print('Inputs values [bit field] :', Fore.GREEN + self.get_inputs_bit())
+
+        # Значение счетчиков
+        data = self.get_inputs_counters()
+        print('Inputs counters           :', Fore.GREEN + ' | '.join(str(el) for el in data))
+
+        # Режим работы входов (битовое поле)
+        print('Inputs mode [bit field]   :', Fore.GREEN + self.get_inputs_mode())
+
+        # Нормальное состояние входов (битовое поле)
+        print('Inputs norm [bit field]   :', Fore.GREEN + self.get_inputs_norm_state())
+
+         # Период антидребезга (ms)
+        print('Debounce input (ms)       :', Fore.GREEN + ' | '.join(str(el) for el in self.get_debounce_channels()))
+
 
 
 def main():
@@ -32,13 +103,32 @@ def main():
     '''Лог и архив. Настройки лога.'''
     # dev.log.get_log_info()
     # dev.log.get_random_entries()
-    # dev.log.set_archive_period(10)
+    # for i in range(8):
+    #     dev.log.set_archive_period(5 + i*2, i)
+    
+    # dev.log.get_log_info()
+
     # dev.log.get_all_archive()
-    dev.log.get_all_log()
+    # dev.log.get_all_log()
     
+    # dev.log.log_clear()
+    # dev.log.archive_clear()
+
     '''Сохранение настроек'''
     # dev.sys.save_sattings()
 
+    '''Настройки'''
+
+    '''Регистры модуля'''
+    # dev.print_inputs()
+
+    '''Настройи модуля'''
+    # for i in range(1, 9):
+    #     dev.set_input_mode(i, 1)
+        # print('Inputs mode [bit field]   :', Fore.GREEN + dev.get_inputs_mode())
+    # dev.set_input_mode(4, 1)
+    # dev.print_inputs()
+
     '''Обновление'''
     # dev.updater.update('fw.bin', 'MDIO-88')
     

BIN
tools/fw.bin


+ 1 - 40
tools/io_module.py

@@ -16,50 +16,11 @@ class IO_Module:
         self.sys = IO_SysParams(self.modbus)
 
 '''
-    # 0x0100 - текущее состояние входов
-    def get_inputs_bit(self) -> str:
-        data = self.read_holding_registers(reg_table['in_bits'], 1)
-        return format(data[0], '08b')
-
-    # 0x0101 - 0x0110 Счетчики импульсов
-    def get_inputs_counters(self):
-        data = []
-        for i in range(reg_table['in_cnt'], reg_table['in_cnt'] + 16, 2):
-            data.append(self.read_uint32_holding(i))
-        return data                              
-
-    # 0x0120 - режим работы входов
-    def get_inputs_mode(self):
-        data = self.read_holding_registers(reg_table['in_mode'], 1)
-        return format(data[0], '08b')
-
-    def set_inputs_mode(self, val):
-        self.write_holding_register(reg_table['in_mode'], val)
-
-    #        
-    def set_input_mode(self, input, val):
-        ret = self.read_holding_registers(reg_table['in_mode'], 1)
-        if val == 1:
-            data = ret[0] | (0b1 << (input - 1))
-        else:
-            data = ret[0] & ~(0b1 << (input - 1))
-        self.set_inputs_mode(data)
-
-    # 0x0122 - нормальное состояние входов
-    def get_inputs_norm_state(self):
-        data = self.read_holding_registers(reg_table['in_norm'], 1)
-        return format(data[0], '08b')
-
+    
     def set_inputs_norm_state(self, val):
         self.write_holding_register(reg_table['in_norm'], val)
 
-    # 0x0124 - время антидребезга (ms)
-    def get_debounce_channel(self, input):
-        data = self.read_holding_registers(reg_table['in_deb_start'] + input - 1, 1)
-        return data[0]
 
-    def get_debounce_channels(self):
-        return self.read_holding_registers(reg_table['in_deb_start'], 8)
 
     def set_debounce_channel(self, input, val):
         self.write_holding_register(reg_table['in_deb_start'] + input - 1, val)

+ 29 - 10
tools/log_reader.py

@@ -1,5 +1,5 @@
 from modbus import Modbus
-from mb_registers import reg_table
+from mb_registers import reg_table, LOG_REGS
 from colorama import Fore
 from random import randint
 from time import sleep
@@ -15,9 +15,15 @@ LOG_ENTRY = 0x07
 
 class LogParser:
 
-    events = {1: 'Включение питания/перезагрузка',
-              2: 'Перевод времени',
-              3: 'Обновление ПО'}
+    events = {1: 'Включение питания/перезагрузка  ',
+              2: 'Перевод времени                 ',
+              3: 'Обновление ПО                   ',
+              4: 'Самодиагностика/системная ошибка',
+              5: 'Изменение конфигурации          ',
+              6: 'Диагностика выходов             ',
+              7: 'Срабатывание уставок            ',
+              8: 'Переход в безопасный режим      ',
+              9: 'Очистка журнала/архива          '}
 
     utc_offset = 10800
 
@@ -36,25 +42,30 @@ class LogParser:
 
 
 class LogReader:
+
+    COM_LOG_CLEAR = 0x0002
+    COM_ARCHIVE_CLEAR = 0x0003
+
     def __init__(self, modbus: Modbus):
         self.modbus = modbus
         self.log_capacity = 0
         self.log_entries_number = 0
         self.archive_capacity = 0
         self.archive_entries_number = 0    
-        self.archive_period = 0
+        self.archive_period = []
         colorama.init(autoreset=True)
 
     def get_archive(self):
         print("LogReader")
 
     def get_log_info(self):
-        data = self.modbus.read_holding_registers(reg_table['log_info'], 5)
+        data = self.modbus.read_holding_registers(reg_table['log_info'], 19)
         self.log_capacity = data[0]
         self.log_entries_number = data[1]
         self.archive_capacity = data[2]
-        self.archive_entries_number = data[3]
-        self.archive_period = data[4]
+        self.archive_entries_number = data[3:11]
+
+        self.archive_period = data[12:21]
 
         print(Fore.CYAN + "Log and archive params:\n")
         print('Log capacity           :', Fore.CYAN + str(self.log_capacity))
@@ -63,8 +74,16 @@ class LogReader:
         print('Archive entries number :', Fore.CYAN + str(self.archive_entries_number))
         print('Archive period         :', Fore.CYAN + str(self.archive_period), end='\n')
 
-    def set_archive_period(self, value):
-        self.modbus.write_holding_register(reg_table['archive_per'], value)
+    def set_archive_period(self, value, channel):
+        self.modbus.write_holding_register(LOG_REGS['arch_per'] + channel, value)
+
+    def log_clear(self):
+        self.modbus.write_holding_register(reg_table['param_manager'], self.COM_LOG_CLEAR)
+
+    def archive_clear(self):
+        self.modbus.write_holding_register(reg_table['param_manager'], self.COM_ARCHIVE_CLEAR)
+
+
 
 class DigitalLogReader(LogReader):
     def __init__(self, modbus: Modbus):

+ 6 - 2
tools/mb_registers.py

@@ -1,8 +1,12 @@
-reg_table = {'in_bits': 0x0100, 'in_cnt': 0x0102, 'in_mode': 0x0120, 'in_norm': 0x0122, 'in_deb_start': 0x124,
-             'out_cur': 0x0200, 'out_mode': 0x0202, 'out_mode_save': 0x0203, 'pwm_duty': 0x0210,
+reg_table = {'out_cur': 0x0200, 'out_mode': 0x0202, 'out_mode_save': 0x0203, 'pwm_duty': 0x0210,
              'pwm_duty_save': 0x0220, 'pwm_per': 0x0230, 'pwm_per_save': 0x0240,
              'param_manager': 0x0800, 'rtc_unix': 0x0802, 'rtc_sinhro': 0x0804, 'uptime': 0x0801, 
              'rtc': 0x0803, 'log_info': 0x0900, 
              'log_ent': 0x0901, 'arch_cap': 0x0902, 'arch_ent': 0x0903, 'archive_per': 0x0904,
              'model': 0x0080, 'prod_date': 0x0081, 'serial_number': 0x0083, 'fw_ver': 0x0085, 
              'test_status': 0x0089, 'password': 0x008A, 'save_sys_settings': 0x008B}
+
+
+DIO_REGS = {'in_bits': 0x0100, 'in_cnt': 0x0102,'in_mode': 0x0120, 'in_norm': 0x0122, 'in_deb_start': 0x124}
+
+LOG_REGS = {'log_info': 0x0900, 'log_ent': 0x0901, 'arch_cap': 0x0902, 'arch_ent': 0x0903, 'arch_per': 0x0904}

+ 5 - 4
tools/sys_params.py

@@ -10,6 +10,11 @@ test_state = {0: 'No Test', 1: 'Test OK', 2: 'Test FAIL'}
 
 
 class IO_SysParams:
+    
+    SYS_TEST_OK = 0x0001
+    SAVE_SYS_SETTINGS = 0x0001
+    SAVE_SETTIGNS = 0x0001
+    
     def __init__(self, modbus: Modbus):
         self.modbus = modbus
 
@@ -17,10 +22,6 @@ class IO_SysParams:
         self.MODEL_MAO_8 = 0x0200
         self.MODEL_MAI_12 = 0x0300
 
-        self.SYS_TEST_OK = 0x0001
-        self.SAVE_SYS_SETTINGS = 0x0001
-        self.SAVE_SETTIGNS = 0x0001
-
         t = datetime.now(timezone.utc).astimezone()
         self.utc_offset = t.utcoffset() // timedelta(seconds=1)
         

+ 14 - 0
tools/tester.py

@@ -0,0 +1,14 @@
+
+
+class Tester:
+
+    def __init__():
+        pass
+
+
+
+def main():
+    pass
+
+if __name__ == '__main__':
+    main()

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است