ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Среда
3 июля
95356
dvf (26.07.2007 16:22, просмотров: 3541)
Братцы, помогите разобраться с структурой в IAR AVR. Имеются два файла: main.c и mode_operation.c. Также, есть два файла: tgt_def.h и tgt_init.h. В tgt_init.h определена структура: #include "tgt_def.h" #include "pgmspace.h" typedef struct main_flags_s { U8 ButtGrp1: 1; U8 ButtGrp2: 1; U8 Start: 1; U8 Stohas: 1; U8 MStohChnl: 1; } main_flags_t; main_flags_t flag = {0, 0, 0, 0, 0}; в tgt_def.h её шаблон: struct main_flags_s; Оба *.c используют структуру. С main.c всё нормально, а вот mode_operation.c ругается ИАРом при первом же упоминании flag.Start : Building configuration: sample - Debug Updating build tree... mode_operation.c Error[Pe070]: incomplete type is not allowed D:\My_Projects\ProjectsAltium\Programms\Intramag_prog\Sample1\mode_operation.c 18 Total number of errors: 1 Total number of warnings: 0 Файл mode_operation.c: #include <iom32.h> #include <iomacro.h> #include <pgmspace.h> #include <string.h> #include <sysmac.h> #include "tgt_def.h" extern U8 Mode; extern U8 LedInd; extern U8 TCnt; extern U8 FCnt; extern struct main_flags_t flag = {0, 0, 0, 0, 0}; void mode_operation(void) { switch(Mode) { case 0: Mode = 1; LedInd = Mode_P_Ind; opto_pan_info(MTime[TCnt], MFreq[FCnt], LedInd, 2); if (flag.Start) Mode_P; break; case 1: Mode = 2; LedInd = Mode_N_Ind; opto_pan_info(MTime[TCnt], MFreq[FCnt], LedInd, 2); if (flag.Start) Mode_N; break; case 2: Mode = 0; LedInd = Mode_B_Ind; opto_pan_info(MTime[TCnt], MFreq[FCnt], LedInd, 2); if (flag.Start) Mode_B; break; } }