@@ -162,7 +162,9 @@ static const char * const TIMER_TYPE_VAL[TIMER_LAST] = {
162162 };
163163static const char TIMER_TIME [] = "time" ;
164164static const char TIMER_RESETSRC [] = "resetsrc" ;
165+ #if HAS_PERMANENT_TIMER
165166static const char PERMANENT_TIMER [] = "permanent_timer" ;
167+ #endif
166168static const char TIMER_VAL [] = "val" ;
167169
168170/* Section: Safety */
@@ -526,10 +528,12 @@ struct struct_map {const char *str; u16 offset; u16 defval;};
526528#define OFFSETS (s ,v ) (((long)(&s.v) - (long)(&s)) | ((sizeof(s.v)+3) << 13))
527529#define OFFSET_SRC (s ,v ) (((long)(&s.v) - (long)(&s)) | (2 << 13))
528530#define OFFSET_BUT (s ,v ) (((long)(&s.v) - (long)(&s)) | (6 << 13))
531+ #if HAS_PERMANENT_TIMER
529532static const struct struct_map _secnone [] =
530533{
531534 {PERMANENT_TIMER , OFFSET (Model , permanent_timer ), 0 },
532535};
536+ #endif
533537static const struct struct_map _secradio [] = {
534538 {RADIO_NUM_CHANNELS , OFFSET (Model , num_channels ), 0 },
535539 {RADIO_FIXED_ID , OFFSET (Model , fixed_id ), 0 },
@@ -628,8 +632,10 @@ int assign_int(void* ptr, const struct struct_map *map, int map_size)
628632 CONFIG_ParseIconName (m -> icon , value );
629633 return 1 ;
630634 }
635+ #if HAS_PERMANENT_TIMER
631636 if (assign_int (& Model , _secnone , MAPSIZE (_secnone )))
632637 return 1 ;
638+ #endif
633639 if (MATCH_KEY (MODEL_TYPE )) {
634640 for (i = 0 ; i < NUM_STR_ELEMS (MODEL_TYPE_VAL ); i ++ ) {
635641 if (MATCH_VALUE (MODEL_TYPE_VAL [i ])) {
@@ -1193,7 +1199,9 @@ u8 CONFIG_WriteModel(u8 model_num) {
11931199 }
11941200 CONFIG_EnableLanguage (0 );
11951201 fprintf (fh , "%s=%s\n" , MODEL_NAME , m -> name );
1202+ #if HAS_PERMANENT_TIMER
11961203 write_int (fh , m , _secnone , MAPSIZE (_secnone ));
1204+ #endif
11971205 fprintf (fh , "%s=%s\n" , MODEL_MIXERMODE , STDMIXER_ModeName (m -> mixer_mode ));
11981206 if (m -> icon [0 ] != 0 )
11991207 fprintf (fh , "%s=%s\n" , MODEL_ICON , m -> icon + 9 );
0 commit comments