struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
priv->xcur_frac -= VID_TO_POS(priv->x_charsize);
- if (priv->xcur_frac < 0) {
+ if (priv->xcur_frac < priv->xstart_frac) {
priv->xcur_frac = (priv->cols - 1) *
VID_TO_POS(priv->x_charsize);
priv->ycur -= priv->y_charsize;
const int rows = CONFIG_CONSOLE_SCROLL_LINES;
int i;
- priv->xcur_frac = 0;
+ priv->xcur_frac = priv->xstart_frac;
priv->ycur += priv->y_charsize;
/* Check if we need to scroll the terminal */
/* beep */
break;
case '\r':
- priv->xcur_frac = 0;
+ priv->xcur_frac = priv->xstart_frac;
break;
case '\n':
vidconsole_newline(dev);
* @y_charsize: Character height in pixels
* @tab_width_frac: Tab width in fractional units
* @xsize_frac: Width of the display in fractional units
+ * @xstart_frac: Left margin for the text console in fractional units
*/
struct vidconsole_priv {
struct stdio_dev sdev;
int y_charsize;
int tab_width_frac;
int xsize_frac;
+ int xstart_frac;
};
/**