From c9cee812816efb8dfb1c4fac810d75e382bd6175 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 15 Mar 2024 17:27:17 +0100 Subject: [PATCH] Add a typemap to represent the AVRPART signature as Python bytes. --- src/libavrdude.i | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libavrdude.i b/src/libavrdude.i index 266fe838..96ae3355 100644 --- a/src/libavrdude.i +++ b/src/libavrdude.i @@ -168,6 +168,10 @@ typedef struct avrmem AVRMEM; // libavrdude itself, so only map things to the Python level that are // needed there. +%typemap(out) unsigned char signature[3] { + $result = PyBytes_FromStringAndSize($1, 3); + } + typedef struct avrpart { const char * desc; /* long part name */ const char * id; /* short part name */