Beispiel #1
0
void _logdiskf(const char* file, const char level, const char *fmt, ...)
{

    va_list ap;

    va_start(ap, fmt);
    int len =strlen(file);
    if(logdiskfindex +len + 4 > MAX_LOGDISKF_SIZE-1)
    {
        strcpy(&logdiskfbuffer[logdiskfindex-8], "LOGFULL");
        logdiskfindex=MAX_LOGDISKF_SIZE;
        va_end(ap);
        return;
    }

    logdiskf_push(NULL, level);
    logdiskf_push(NULL, ' ');
    logdiskf_push(NULL, '[');
    strcpy(&logdiskfbuffer[logdiskfindex], file);
    logdiskfindex += len;
    logdiskf_push(NULL, ']');

    vuprintf(logdiskf_push, NULL, fmt, ap);
    va_end(ap);
    register_storage_idle_func(flush_buffer);
}
Beispiel #2
0
int settings_save(void)
{
    update_runtime();
#ifdef HAVE_RTC_RAM
    /* this will be done in the storage_callback if
       target doesnt have rtc ram */
    write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
#endif
    register_storage_idle_func(flush_config_block_callback);
    return 0;
}
Beispiel #3
0
void status_save(void)
{
    update_runtime();
#ifdef HAVE_RTC_RAM
    /* this will be done in the storage_callback if
       target doesnt have rtc ram */
    write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE);
#else
    register_storage_idle_func(flush_global_status_callback);
#endif
}
void shortcuts_add(enum shortcut_type type, const char* value)
{
    struct shortcut* sc = get_shortcut(shortcut_count++);
    if (!sc)
        return;
    init_shortcut(sc);
    sc->type = type;
    if (type == SHORTCUT_SETTING)
        sc->u.setting = (void*)value;
    else
        strlcpy(sc->u.path, value, MAX_PATH);
    if (first_idx_to_writeback < 0)
        first_idx_to_writeback = shortcut_count - 1;
    register_storage_idle_func(shortcuts_ata_idle_callback);
}