self.oldsda = None
def start(self, metadata):
- self.output_protocol = self.output_new(1, 'i2c')
- self.output_annotation = self.output_new(0, 'i2c')
+ self.output_protocol = self.output_new(sigrokdecode.SRD_OUTPUT_PROTOCOL, 'i2c')
+ self.output_annotation = self.output_new(sigrokdecode.SRD_OUTPUT_ANNOTATION, 'i2c')
def report(self):
pass
if (PyModule_AddObject(mod, "srd_logic", (PyObject *)&srd_logic_type) == -1)
return NULL;
+ /* expose output types as symbols in the sigrokdecode module */
+ if(PyModule_AddObject(mod, "SRD_OUTPUT_ANNOTATION",
+ PyLong_FromLong(SRD_OUTPUT_ANNOTATION)) == -1)
+ return NULL;
+ if(PyModule_AddObject(mod, "SRD_OUTPUT_PROTOCOL",
+ PyLong_FromLong(SRD_OUTPUT_PROTOCOL)) == -1)
+ return NULL;
+ if(PyModule_AddObject(mod, "SRD_OUTPUT_BINARY",
+ PyLong_FromLong(SRD_OUTPUT_BINARY)) == -1)
+ return NULL;
+
return mod;
}
SRD_OUTPUT_ANNOTATION,
SRD_OUTPUT_PROTOCOL,
SRD_OUTPUT_BINARY,
+ /* When adding an output type, don't forget to expose it to PDs
+ * in controller.c:PyInit_sigrokdecode()
+ */
};
#define SRD_MAX_NUM_PROBES 64