It’s already declared in main.asm as part of the MIDIbox CV code:
#define DEFAULT_EXT_CLK_PULSEWIDTH 1
that’s not a variable declaration and this is probably your problem.
this is a precompiler directive which tells the compiler to use this as a constant.
(actually replaces the name with the value before compiling)
to declare a variable you need equ and register address.
…
First of all, DEFAULT_EXT_CLK_PULSEWIDTH is a constant value, which will be compiled directly into the firmware.
…
(e.g., 0x60 is free, you could use it)
…
so you need (for example):
SNEAK_THIEF_CW_VAR EQU 0x060
and replace DEFAULT_EXT_CLK_PULSEWIDTH in the code you added with SNEAK_THIEF_CW_VAR
(name the var something better, hehe)
edit: just saw you are using that addy already.
still you are using DEFAULT_EXT_CLK_PULSEWIDTH like a var when it is const,
so writing to it writes to resister address 0x01
reading like a var instead of const also will use reg 0x01…
anywhere you wanted to write to DEFAULT_EXT_CLK_PULSEWIDTH
write instead to CV_CLK_PULSEWIDTH_L and CV_CLK_PULSEWIDTH_H
ok someone familiar with the code that actually sets the clock width will need
to step in to help convert that code to use your
new 16 bit value, CV_CLK_PULSEWIDTH_L, and CV_CLK_PULSEWIDTH_H.
(i’m not that guy)