MSPM0_ValvanoWare
1.0
ECE445L starter code
inc
FIFO2.h
1
// FIFO2.h
2
// Runs on any microcontroller
3
// Student names: put your names here
4
// Last modification date: change this to the last modification date or look very silly
5
// Last Modified: 4/11/2018
6
7
8
#ifndef __FIFO2_H__
9
#define __FIFO2_H__
10
#include <stdint.h>
11
12
#define FIFOSIZE 32
// maximum storage is FIFO_SIZE-1 elements
13
class
Queue
{
14
private
:
15
char
Buf[FIFOSIZE];
16
int
PutI;
// index to an empty place, next place to put
17
int
GetI;
// index to oldest data, next to get
18
19
public
:
20
Queue
();
// initialize queue
21
bool
IsEmpty(
void
);
// true if empty
22
bool
IsFull(
void
);
// true if full
23
bool
Put(
char
x);
// enter data into queue
24
bool
Get(
char
*pt);
// remove data from queue
25
void
Print(
void
);
// display element of queue on LCD
26
};
27
28
29
#endif
// __FIFO2_H__
Queue
Definition:
FIFO2.h:13
Generated by
1.9.1