Changeset bf89cfb in buchla-68k for vlib/glcinit.c


Ignore:
Timestamp:
07/15/2017 11:15:58 AM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
c80943f
Parents:
09d1345
Message:

No more warnings in vlib.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlib/glcinit.c

    r09d1345 rbf89cfb  
    99                Initializes the GLC.
    1010
    11         unsigned
    1211        GLCcrc(row, col)
    13         unsigned row, col;
    1412
    1513                Positions the GLC cursor at ('row', 'col') preparatory
    1614                to writing text.  Returns the calculated cursor address.
    1715
    18         unsigned
    1916        GLCcxy(x, y)
    20         unsigned x, y;
    2117
    2218                Positions the GLC cursor at ('x', 'y') preparatory to
     
    2622
    2723        GLCwrts(s)
    28         char *s;
    2924
    3025                Writes the character string pointed to by 's' at the
     
    3429
    3530        GLCtext(row, col, s)
    36         unsigned row, col;
    37         char *s;
    3831
    3932                Sets the GLC cursor to ('row', 'col'), then writes the
     
    4336
    4437        GLCdisp(dsp, crs, blk1, blk2, blk3)
    45         short dsp, crs, blk1, blk2, blk3;
    4638
    4739                Sets the overall display, cursor and block status values.
    4840
    4941        GLCcurs(crs)
    50         short crs;
    5142
    5243                Turns the cursor on or off.
     
    5647#include "ram.h"
    5748
    58 uint16_t        lcdbase;        /* LCD graphics base address */
    59 uint16_t        lcdbit;         /* LCD graphics pixel bit mask */
    60 uint16_t        lcdcol;         /* LCD text column */
    61 uint16_t        lcdctl1;        /* LCD display control -- command */
    62 uint16_t        lcdctl2;        /* LCD display control -- data */
    63 uint16_t        lcdcurs;        /* LCD graphics pixel byte address */
    64 uint16_t        lcdrow;         /* LCD text row */
    65 uint16_t        lcdx;           /* LCD graphics x */
    66 uint16_t        lcdy;           /* LCD graphics y */
     49int32_t         lcdbase;        /* LCD graphics base address */
     50int16_t         lcdbit;         /* LCD graphics pixel bit mask */
     51int16_t         lcdcol;         /* LCD text column */
     52int16_t         lcdctl1;        /* LCD display control -- command */
     53int16_t         lcdctl2;        /* LCD display control -- data */
     54int32_t         lcdcurs;        /* LCD graphics pixel byte address */
     55int16_t         lcdrow;         /* LCD text row */
     56int16_t         lcdx;           /* LCD graphics x */
     57int16_t         lcdy;           /* LCD graphics y */
    6758
    6859/* GLC initialization values */
    6960
    70 int8_t glc_is1[] = { 0x12, 0x05, 0x07, 0x54, 0x58, 0x3F, 0x55, 0x00 };
    71 int8_t glc_is2[] = { 0x00, 0x00, 0x3F, 0x00, 0x20, 0x3F, 0x00, 0x00 };
     61uint8_t glc_is1[] = { 0x12, 0x05, 0x07, 0x54, 0x58, 0x3F, 0x55, 0x00 };
     62uint8_t glc_is2[] = { 0x00, 0x00, 0x3F, 0x00, 0x20, 0x3F, 0x00, 0x00 };
    7263
    7364/*
     
    8879        lcdctl2 = val;
    8980
    90         LCD_WC = lcdctl1;
    91         LCD_WD = lcdctl2;
     81        LCD_WC = (uint8_t)lcdctl1;
     82        LCD_WD = (uint8_t)lcdctl2;
    9283
    9384}
     
    10394        lcdctl2 = (crs & 3) | (lcdctl2 & ~3);
    10495
    105         LCD_WC = lcdctl1;
    106         LCD_WD = lcdctl2;
     96        LCD_WC = (uint8_t)lcdctl1;
     97        LCD_WD = (uint8_t)lcdctl2;
    10798}
    10899
     
    118109        register int16_t        i;
    119110        register int32_t ic;
    120         register int8_t *gp;
     111        register uint8_t *gp;
    121112
    122113        lcdbase = G_PLANE2;     /* set defaults for graphics variables */
     
    135126
    136127        for (i = 0; i < 8; i++)
    137                 LCD_WD= *gp++;
     128                LCD_WD = *gp++;
    138129
    139130        LCD_WC = G_SETSAD;      /* setup scroll registers */
     
    184175*/
    185176
    186 uint16_t GLCcrc(uint16_t row, uint16_t col)
    187 {
    188         uint16_t curad;
     177int16_t GLCcrc(int16_t row, int16_t col)
     178{
     179        int16_t curad;
    189180
    190181        curad = col + (row * 85);       /* calculate cursor location */
    191182
    192183        LCD_WC = G_CRSWR;               /* send cursor address to GLC */
    193         LCD_WD = curad & 0xFF;
    194         LCD_WD = (curad >> 8) & 0xFF;
     184        LCD_WD = (uint8_t)(curad & 0xFF);
     185        LCD_WD = (uint8_t)((curad >> 8) & 0xFF);
    195186
    196187        lcdrow = row;                   /* set text cursor variables */
     
    210201*/
    211202
    212 uint16_t GLCcxy(uint16_t x, uint16_t y)
    213 {
    214         register uint16_t curad, xby6;
     203int16_t GLCcxy(int16_t x, int16_t y)
     204{
     205        register int32_t curad, xby6;
    215206
    216207        /* calculate cursor address */
     
    223214
    224215        LCD_WC = G_CRSWR;
    225         LCD_WD = curad & 0xFF;
    226         LCD_WD = (curad >> 8) & 0xFF;
     216        LCD_WD = (uint8_t)(curad & 0xFF);
     217        LCD_WD = (uint8_t)((curad >> 8) & 0xFF);
    227218
    228219        /* set graphics variables */
     
    256247        while (*s) {            /* write string to GLC */
    257248
    258                 LCD_WD = *s++;
     249                LCD_WD = (uint8_t)*s++;
    259250                lcdcol++;       /* keep column variable up to date */
    260251        }
     
    271262*/
    272263
    273 void GLCtext(uint16_t row, uint16_t col, int8_t *s)
    274 {
    275         register uint16_t curad;
     264void GLCtext(int16_t row, int16_t col, int8_t *s)
     265{
     266        register int16_t curad;
    276267
    277268        curad = col + (row * 85);       /* calculate cursor address */
    278269
    279270        LCD_WC = G_CRSWR;               /* send cursor address to GLC */
    280         LCD_WD = curad & 0xFF;
    281         LCD_WD = (curad >> 8) & 0xFF;
     271        LCD_WD = (uint8_t)(curad & 0xFF);
     272        LCD_WD = (uint8_t)((curad >> 8) & 0xFF);
    282273
    283274        lcdrow = row;                   /* set GLC text cursor variables */
     
    290281        while (*s) {                    /* write string to GLC */
    291282
    292                 LCD_WD = *s++;
     283                LCD_WD = (uint8_t)*s++;
    293284                lcdcol++;               /* keep cursor column up to date */
    294285        }
Note: See TracChangeset for help on using the changeset viewer.