Changeset d3109ff in mainline for uspace/srv/hid/output/ctl/serial.c


Ignore:
Timestamp:
2024-09-24T17:59:36Z (4 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
6a753a9c
Parents:
3fcea34
Message:

Cursor and color control in remote console + RGB

Move vt100 module from output server into separate vt library
Add cursor and color control to remcons using libvt
Add RGB color control to serial console and remote console

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/output/ctl/serial.c

    r3fcea34 rd3109ff  
    11/*
     2 * Copyright (c) 2024 Jiri Svoboda
    23 * Copyright (c) 2006 Ondrej Palkovsky
    34 * Copyright (c) 2008 Martin Decky
     
    3738#include <errno.h>
    3839#include <io/chargrid.h>
     40#include <vt/vt100.h>
    3941#include "../output.h"
    40 #include "../proto/vt100.h"
    4142#include "serial.h"
    4243
     
    8485static console_caps_t serial_get_caps(outdev_t *dev)
    8586{
    86         return (CONSOLE_CAP_STYLE | CONSOLE_CAP_INDEXED);
     87        return (CONSOLE_CAP_STYLE | CONSOLE_CAP_INDEXED | CONSOLE_CAP_RGB);
    8788}
    8889
     
    125126    vt100_control_puts_t control_puts_fn, vt100_flush_t flush_fn)
    126127{
     128        char_attrs_t attrs;
    127129        vt100_state_t *state =
    128             vt100_state_create(SERIAL_COLS, SERIAL_ROWS, putuchar_fn,
     130            vt100_state_create(NULL, SERIAL_COLS, SERIAL_ROWS, putuchar_fn,
    129131            control_puts_fn, flush_fn);
    130132        if (state == NULL)
    131133                return ENOMEM;
     134        state->enable_rgb = true;
     135
     136        vt100_cursor_visibility(state, false);
     137        attrs.type = CHAR_ATTR_STYLE;
     138        attrs.val.style = STYLE_NORMAL;
     139        vt100_set_attr(state, attrs);
     140        vt100_cls(state);
    132141
    133142        outdev_t *dev = outdev_register(&serial_ops, state);
Note: See TracChangeset for help on using the changeset viewer.