C18 code of GSR device