I2C, SoftwareSerial и PCINT на Attiny85 DigiSpark

ты бы попробовал, прежде чем говорить!

Поправил в папке скетча копии библиотеки и, вуаля, скомпилировалось без ошибок, то-есть можно не рушить систему залезая в библиотеки ядра кривыми ручонками )))

Ты меня день ото дня поражаешь. И с каждым днём всё страшнее ))))
Не было у меня таких проблем как ты описываешь (да и быть не могло).

я даже знаю почему, ты коллективный предпочитаешь, там сачковать можно

"E:\\arduino-1.8.19-YA\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=attiny85 -o "C:\\Temp\\arduino_build_544700/sketch_jan04a.ino.elf" "C:\\Temp\\arduino_build_544700\\sketch\\SoftwareSerial.cpp.o" "C:\\Temp\\arduino_build_544700\\sketch\\sketch_jan04a.ino.cpp.o" "C:\\Temp\\arduino_build_544700\\libraries\\Wire\\twi.c.o" "C:\\Temp\\arduino_build_544700\\libraries\\Wire\\USIWire.cpp.o" "C:\\Temp\\arduino_build_544700\\libraries\\Wire\\Wire.cpp.o" "C:\\Temp\\arduino_build_544700\\libraries\\Wire\\WireS.cpp.o" "C:\\Temp\\arduino_build_544700\\libraries\\Wire\\USI_TWI_Master\\USI_TWI_Master.c.o" "C:\\Temp\\arduino_build_544700\\libraries\\Wire\\USI_TWI_Slave\\USI_TWI_Slave.c.o" "C:\\Temp\\arduino_build_544700\\libraries\\INA226_WE-master\\INA226_WE.cpp.o" "C:\\Temp\\arduino_build_544700\\libraries\\SoftwareSerial\\SoftwareSerial.cpp.o" "C:\\Temp\\arduino_build_544700/core\\core.a" "-LC:\\Temp\\arduino_build_544700" -lm
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::read()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::active_object'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::_receive_buffer_head'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::_receive_buffer_tail'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::_receive_buffer'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::write(unsigned char)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::peek()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::available()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::flush()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::stopListening()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::listen()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::recv()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::rx_pin_read()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_2'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::~SoftwareSerial()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::~SoftwareSerial()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::setTX(unsigned char)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::setRX(unsigned char)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::SoftwareSerial(unsigned char, unsigned char, bool)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::SoftwareSerial(unsigned char, unsigned char, bool)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::subtract_cap(unsigned int, unsigned int)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::begin(long)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::setRxIntMsk(bool)'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Temp\arduino_build_544700\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `SoftwareSerial::end()'
C:\Temp\arduino_build_544700\sketch\SoftwareSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status

Кого коллективный? Водопад? Фонтан?
У меня всё работает, если у тебя что-то не работает - ищи причину.

ЗЫ: Про «коллективный» заинтриговал, обязательно напиши.

ты оказывается ещё и сказочник

У меня складывается впечатление, что ты не пьёшь по одной простой причине - твои вещества нельзя смешивать с алкоголем.
Соберись, хватит несвязные вещи писать.

под каким ядром у тебя скомпилировалось?

У меня без проблем компилится на 1.3.3. В любых вариантах - и с <> и с “”(когда библиотеки в папке со скетчем).
1.4 не ставится вообще. Arduino IDE 2.2.1

P.S. Как и писал ранее, забил на прерывания. Глючит Serial с ними.
Может, конечно, я не корректно со всем этим обращаюсь, но уже достало долбить лбом стену…
Схему тоже немного изменил - добавил аппаратную инверсию ALERT.
Иначе, при включении, срабатывала защита.

1 лайк

IDE portable 1.8.19 версия ядра attinyCore 1.4.0, компилируется с варнингами но без ошибок только сменив имя библиотечных файлов (в папке скетча) на MySoftwareSerial, естественно в самих файлах все функции и определения тоже поправлены
Видимо логика работы инсталлируемой программы с portable версией разная

Чтобы не срабатывала - нужно явную подтяжку резистором делать.

А вы на схему не пробовали взглянуть перед тем, как комментировать? :wink:
Защита срабатывала в момент инициализации INA226. И срабатывала именно из-за наличия “подтяжки”.
После инициализации всё было штатно. Но в моей схеме это неприемлимо.
В таком варианте БП будет просто невозможно включить.
Сейчас всё путём. Правда, потребовалось изменить “активный” ALERT с “1” на “0”.
Библиотека это позволяет сделать.
Новая схема