Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
serie.h
- Committer:
- dujardin
- Date:
- 2018-10-12
- Revision:
- 6:edb27e228558
- Child:
- 8:cfcf73c16fab
File content as of revision 6:edb27e228558:
// variables globales liées à la reception serie
int arr ; int arr0 ; int arr1 ; //arrivée liaison serie
char RA; char RB ; char RC ; char RD ; char Rc ; char Rd ; //
int tr1; int tr2 ; int SR ; int SV ; int SB ;
int SX ; int SY ;// pour rec serial
char Scar;
// Interupt Routine to read in data from serial port
//void interrupt (); // pour rx serie
void transfert() // pix avec rvb en X Y
{
SX = RA;
SY = RB;
SV = RC & 7 ;
SR = (RC&56)>>3 ;
SB = (RD&7) ;
pix(SX,SY,SR,SV,SB);
}
void ascii() // place ascii en xy
{
SX = RA;
SY = RB;
Rc = RC&63; Rd = RD & 1 ;
Scar = Rc*4 + Rd ;
charr(SX,SY,Scar);
}
void color() // ligne plus 1
{
bv = RC & 7 ;
br = (RC&56)>>3 ;
bb = (RD&7) ;
}
void interrupt() // trame
{ // mettre dans le tableau a l' adresse voulue par a b c
arr0 = serie.getc();
arr1 = arr0;
arr = arr1 & 192;
if (arr == 0) // c'est A
{ RA = arr1 & 63;
}
if (arr == 64)// c'est B
{ RB = arr1 & 63;
}
if (arr == 128)// c'est C
{ RC = arr1 & 63;
}
if (arr == 192)// c'est D
{ RD = arr1 & 63;
arr = arr0;
if ( ( arr & 248) == 192 ) // c = 0 00
{ transfert (); // vers un pix
}
if ( ( arr & 248) == 200 ) // c = 0 01
{
Tr2 (); // efface tableau
}
if ( ( arr & 248) == 208 )
{color(); // memo color br bv bb
}
if ( ( arr & 248) == 216 )
{ ascii();
}
}
return;
}