int ICACHE_RAM_ATTR puts(const char * str) {
    char c;
    while((c = *str) != 0) {
        ets_putc(c);
        ++str;
    }
    ets_putc('\n');
    return true;
}
int ICACHE_RAM_ATTR _putc_r(struct _reent* r, int c, FILE* file) {
    (void) r;
    if (file->_file == STDOUT_FILENO) {
        return ets_putc(c);
    }
    return EOF;
}
int ICACHE_RAM_ATTR _write_r(struct _reent* r, int file, char *ptr, int len) {
    (void) r;
    if (file == STDOUT_FILENO) {
        while(len--) {
            ets_putc(*ptr);
            ++ptr;
        }
    }
    return len;
}
Beispiel #4
0
int ICACHE_RAM_ATTR putchar(int c) {
    return ets_putc(c);
}
Beispiel #5
0
void main()
{
    int res = 9;
    struct eboot_command cmd;

    if (eboot_command_read(&cmd)) {
        cmd.action = ACTION_LOAD_APP;
        cmd.args[0] = 0;
        ets_putc('~');
    } else {
        ets_putc('@');
    }
    eboot_command_clear();

    if (cmd.action == ACTION_COPY_RAW) {
        ets_putc('c'); ets_putc('p'); ets_putc(':');
        ets_wdt_disable();
        res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2]);
        ets_wdt_enable();
        ets_putc('0'+res); ets_putc('\n');
        if (res == 0) {
            cmd.action = ACTION_LOAD_APP;
            cmd.args[0] = cmd.args[1];
        }
    }

    if (cmd.action == ACTION_LOAD_APP) {
        ets_putc('l'); ets_putc('d'); ets_putc('\n');
        res = load_app_from_flash_raw(cmd.args[0]);
        //we will get to this only on load fail
        ets_putc('e'); ets_putc(':'); ets_putc('0'+res); ets_putc('\n');
    }

    if (res) {
        SWRST;
    }

    while(true){}
}
int ICACHE_RAM_ATTR putchar(int c) {
    ets_putc(c);
    return c;
}