Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated types in libavrdude.i #1896

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/libavrdude.i
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ PyObject *get_config_table(const char *name) {
if (idx == -1)
return Py_None;

const uPcore_t *up = uP_table + idx;
const Avrintel *up = uP_table + idx;
int nitems = up->nconfigs;

// found: construct a list object
Expand All @@ -184,7 +184,7 @@ PyObject *get_config_table(const char *name) {
}

// now, add list elements
const Configitem_t *cfg = up->cfgtable;
const Configitem *cfg = up->cfgtable;

for (int i = 0; i < nitems; i++) {
PyObject* dict = PyDict_New();
Expand Down Expand Up @@ -319,11 +319,11 @@ typedef struct avrpart {
} AVRPART;
%mutable;

typedef unsigned int memtype_t;
typedef unsigned int Memtype;
typedef struct avrmem {
%immutable;
const char *desc; /* memory description ("flash", "eeprom", etc) */
memtype_t type; /* internally used type, cannot be set in conf files */
Memtype type; /* internally used type, cannot be set in conf files */
bool paged; /* 16-bit page addressed, e.g., ATmega flash but not EEPROM */
int size; /* total memory size in bytes */
int page_size; /* size of memory page (if page addressed) */
Expand Down Expand Up @@ -402,7 +402,7 @@ typedef enum {
CONNTYPE_USB,
CONNTYPE_SPI,
CONNTYPE_LINUXGPIO
} conntype_t;
} Conntype;

// https://stackoverflow.com/questions/11023940/how-do-i-get-swig-to-automatically-wrap-an-emulated-this-pointer-to-a-c-struct/11029809#11029809
// Make sure the wrapped function doesn't expect an input for this:
Expand Down Expand Up @@ -535,7 +535,7 @@ typedef struct programmer {
LISTID id;
const char *desc;
int prog_modes; // Programming interfaces, see #define PM_...
conntype_t conntype;
Conntype conntype;
int baudrate;
int usbvid;
LISTID usbpid;
Expand Down Expand Up @@ -631,7 +631,7 @@ AVRPART * locate_part(const LISTID parts, const char *partdesc);
AVRMEM_ALIAS * avr_locate_memalias(const AVRPART *p, const char *desc);
AVRMEM_ALIAS * avr_find_memalias(const AVRPART *p, const AVRMEM *m_orig);

// Programming modes for parts and programmers: reflect changes in lexer.l, developer_opts.c and config.c
// Programming modes for parts and programmers: ensure it's copied from libavrdude.h
#define PM_SPM 1 // Bootloaders, self-programming with SPM opcodes or NVM Controllers
#define PM_TPI 2 // Tiny Programming Interface (t4, t5, t9, t10, t20, t40, t102, t104)
#define PM_ISP 4 // SPI programming for In-System Programming (almost all classic parts)
Expand All @@ -645,6 +645,7 @@ AVRMEM_ALIAS * avr_find_memalias(const AVRPART *p, const AVRMEM *m_orig);
#define PM_XMEGAJTAG 1024 // JTAG, some XMEGA parts
#define PM_AVR32JTAG 2048 // JTAG for 32-bit AVRs
#define PM_aWire 4096 // For 32-bit AVRs
#define PM_Classic (PM_TPI | PM_ISP | PM_HVSP | PM_HVPP | PM_debugWIRE | PM_JTAG | PM_JTAGmkI)
#define PM_ALL 0x1fff // All programming interfaces

// map Python bytes() to sig+sigsize
Expand Down
Loading