thank you, ChatGPT
[env:program_via_ArduinoISP] platform = lgt8f framework = arduino board = lgt8f328p-LQFP48 upload_protocol = custom upload_port = /dev/ttyACM* upload_speed = 19200 upload_flags = -v -V -C $PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf -p $BOARD_MCU -P $UPLOAD_PORT -c stk500v1 upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
update platforms, toolchains, etc.
for the new environment to be recognized/loaded by CLion
If using ISP and you run out of memory you can overwrite the bootloader if you wish (and I wish because I did). In boards.txt
change 328.upload.maximum_size=29696
to 328.upload.maximum_size=30720
VDTCR = 0x80; // make register writeable for a short time VDTCR = 0x00; // clear bit 6