Gas Pressure Display Updated Power control for Pressure sensor added

Dependencies:   UniGraphic mbed vt100

Committer:
Rhyme
Date:
Fri Feb 16 08:27:50 2018 +0000
Revision:
0:37c8ecde13c2
control PSE530 power via PTC5 (pse530_en)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:37c8ecde13c2 1 #include "mbed.h"
Rhyme 0:37c8ecde13c2 2 #include "edge_time.h"
Rhyme 0:37c8ecde13c2 3 #include "pending.h"
Rhyme 0:37c8ecde13c2 4
Rhyme 0:37c8ecde13c2 5 /*
Rhyme 0:37c8ecde13c2 6 class pending_class {
Rhyme 0:37c8ecde13c2 7 public:
Rhyme 0:37c8ecde13c2 8 pending_class() ;
Rhyme 0:37c8ecde13c2 9 ~pending_class() ;
Rhyme 0:37c8ecde13c2 10
Rhyme 0:37c8ecde13c2 11 request_t *request ;
Rhyme 0:37c8ecde13c2 12 uint32_t submit_time ;
Rhyme 0:37c8ecde13c2 13 uint32_t replied_time ;
Rhyme 0:37c8ecde13c2 14 } ;
Rhyme 0:37c8ecde13c2 15 */
Rhyme 0:37c8ecde13c2 16
Rhyme 0:37c8ecde13c2 17 pending_class::pending_class()
Rhyme 0:37c8ecde13c2 18 {
Rhyme 0:37c8ecde13c2 19 submit_time = edge_time ; /* save current time */
Rhyme 0:37c8ecde13c2 20 replied_time = 0 ;
Rhyme 0:37c8ecde13c2 21 request = new request_t ;
Rhyme 0:37c8ecde13c2 22 request->messageType = 0 ;
Rhyme 0:37c8ecde13c2 23 request->attrId = 0 ;
Rhyme 0:37c8ecde13c2 24 request->requestId = 0 ;
Rhyme 0:37c8ecde13c2 25 request->valueLen = 0 ;
Rhyme 0:37c8ecde13c2 26 request->p_value = new uint8_t[256] ;
Rhyme 0:37c8ecde13c2 27 }
Rhyme 0:37c8ecde13c2 28
Rhyme 0:37c8ecde13c2 29 pending_class::pending_class(
Rhyme 0:37c8ecde13c2 30 uint8_t messageType,
Rhyme 0:37c8ecde13c2 31 uint16_t attrId,
Rhyme 0:37c8ecde13c2 32 uint8_t requestId,
Rhyme 0:37c8ecde13c2 33 uint16_t valueLen,
Rhyme 0:37c8ecde13c2 34 uint8_t *value
Rhyme 0:37c8ecde13c2 35 )
Rhyme 0:37c8ecde13c2 36 {
Rhyme 0:37c8ecde13c2 37 submit_time = edge_time ; /* save current time */
Rhyme 0:37c8ecde13c2 38 replied_time = 0 ;
Rhyme 0:37c8ecde13c2 39 request = new request_t ;
Rhyme 0:37c8ecde13c2 40 request->p_value = new uint8_t[256] ;
Rhyme 0:37c8ecde13c2 41 request->messageType = messageType ;
Rhyme 0:37c8ecde13c2 42 request->attrId = attrId ;
Rhyme 0:37c8ecde13c2 43 request->requestId = requestId ;
Rhyme 0:37c8ecde13c2 44 request->valueLen = valueLen ;
Rhyme 0:37c8ecde13c2 45 memcpy(request->p_value, value, valueLen) ;
Rhyme 0:37c8ecde13c2 46 }
Rhyme 0:37c8ecde13c2 47
Rhyme 0:37c8ecde13c2 48 pending_class::~pending_class()
Rhyme 0:37c8ecde13c2 49 {
Rhyme 0:37c8ecde13c2 50 submit_time = 0 ;
Rhyme 0:37c8ecde13c2 51 replied_time = 0 ;
Rhyme 0:37c8ecde13c2 52 delete [] request->p_value ;
Rhyme 0:37c8ecde13c2 53 request->p_value = 0 ;
Rhyme 0:37c8ecde13c2 54 delete request ;
Rhyme 0:37c8ecde13c2 55 }