This commit is contained in:
Sergey Yarkov 2023-08-05 02:56:57 +03:00
parent 38205f2533
commit 76c415f67f
No known key found for this signature in database
GPG Key ID: E91CE1FABC619B6F
12 changed files with 1077 additions and 648 deletions

Binary file not shown.

View File

@ -1,65 +1,89 @@
:1000000013C01AC019C018C017C016C015C014C03C :1000000013C01AC019C018C017C016C015C014C03C
:1000100013C012C011C010C00FC00EC00DC03F06EB :1000100013C012C011C010C00FC00EC00DC03F06EB
:100020005B4F666D7D077F6F11241FBECFE5D1E06A :100020005B4F666D7D077F6F11241FBECFE5D1E06A
:10003000DEBFCDBFB8D0DEC1E3CFC09AC29A8DE09B :10003000DEBFCDBF30D19CC2E3CFF894C09AC29A44
:100040008A95F1F70000C0988DE08A95F1F70000DD :100040008DE08A95F1F70000C0988DE08A95F1F770
:10005000C2980895C298C0988DE08A95F1F7000083 :100050000000C29878940895F894C298C0988DE0F2
:10006000C29A8DE08A95F1F70000C09A08952DE0BC :100060008A95F1F70000C29A8DE08A95F1F70000B9
:100070002A95F1F7000098E00DC0C09886952DE014 :10007000C09A78940895F8942DE02A95F1F700003D
:100080002A95F1F70000C29A2DE02A95F1F70000B9 :1000800098E00DC0C09886952DE02A95F1F7000004
:10009000915049F0C2982DE02A95F1F7000080FFB9 :10009000C29A2DE02A95F1F70000915049F0C298DC
:1000A000ECCFC09AEBCFB898C298C09A8DE08A95F1 :1000A0002DE02A95F1F7000080FFECCFC09AEBCF4E
:1000B000F1F7000086B3C29A9DE09A95F1F700002F :1000B000B898C298C09A8DE08A95F1F7000086B38F
:1000C000C2982DE02A95F1F70000B89A80958170CA :1000C000C29A9DE09A95F1F70000C2982DE02A951A
:1000D0000895CF93C82FB1DF8C2FC9DFBBDFCF913D :1000D000F1F70000B89A7894809581700895CF93D5
:1000E000089597B3A1E0B0E0FD0102C0EE0FFF1F3D :1000E000C82FABDF8C2FC7DFB7DFCF91089597B351
:1000F0008A95E2F702C0AA0FBB1F6A95E2F7EA2BC6 :1000F000A1E0B0E0FD0102C0EE0FFF1F8A95E2F71C
:100100009E2B97BB88B3E095E823E8BB842F8068DB :1001000002C0AA0FBB1F6A95E2F7EA2B9E2B97BB92
:10011000822BDFDF0895CF93DF93C82FD62F80E4A3 :1001100088B3E095E823E8BB842F8068822BDFDF7B
:10012000D8DF8BDF8D2F806CA2DF8C2FA0DF92DFDA :100120000895CF93DF93C82FD62F80E4D8DF85DFE3
:10013000DF91CF9108950F931F93CF93DF93EC013D :100130008D2F806CA0DF8C2F9EDF8EDFDF91CF9123
:10014000C83E83E0D80710F0C7EED3E0CE0164E6E6 :10014000089562E080E4EDDF61E080E4EADF60E0F2
:1001500070E03CD1CB010AE010E0B80137D1825EFB :1001500080E4E7DF089521E08A30910550F021E046
:100160009F4FFC01849160E0D6DFCE01B8012ED113 :10016000EAE0F0E0BF01DDD1CB012F5F6A3071051D
:10017000EC01CB01B8012AD1825E9F4FFC01849132 :10017000C8F7822F0895AF92BF92CF92DF92EF928D
:1001800061E0C9DFFE01E25EFF4F849162E0C3DF00 :10018000FF920F931F93CF93DF9300D01F92CDB7B1
:10019000DF91CF911F910F91089528E041E062E037 :10019000DEB7B62EF42E009749F461113BC08C01F6
:1001A00080E09FDF0895CF93DF93CDB7DEB76397ED :1001A000883E93407CF007EE13E00CC08C01883E43
:1001B0000FB6F894DEBF0FBECDBFEFDFCE010996BC :1001B00023E0920714F007EE13E099231CF4119545
:1001C0005FD0CE010196B9D089899A89B4DFF9CF81 :1001C00001951109C801C7DFA82E2AE030E0C80157
:1001D000F894BC9A8FEB93E00197F1F700C0000010 :1001D000B901BBD18B83CB01B901B7D18A83C801E7
:1001E000BC989AEB9A95F1F700C086B3E3E3F3E08D :1001E00064E670E0B2D1CB01B901AFD1898331E0CF
:1001F0003197F1F700C0000078948295817091E00A :1001F000A31691F083E0D82EDA1882E08D15A8F1CD
:100200008927089598E00DC0BC9A20EA2A95F1F755 :1002000010E000E0C12C82E090E09C012F19310940
:10021000BC982AE12A95F1F700C078948695915010 :10021000790118C08C01D3CFDA2CF2CFE1E0F0E005
:1002200069F0F89480FFF0CFBC9A20E12A95F1F7AD :10022000EC0FFD1FED0DF11DE081F0E0E25EFF4FF0
:10023000BC982AEA2A95F1F700C0EFCF089598E01C :1002300084916C2D76DFD394C3940F5F1F4F82E0BF
:1002400080E007C022E92A95F1F700C07894915028 :100240008D15A0F0E016F10649F733E0A31631F35F
:1002500071F0F8948695BC9A20E12A95F1F7BC9844 :10025000E1E0F0E0EC0FFD1FED0DF11DE081F0E0BD
:1002600028E12A95F1F7B49BEDCF8068EBCF089594 :10026000E25EFF4F84918068E4CFC12CEB2DF0E07B
:10027000AFDF811101C008958CECC4DF81E0FBCFBA :10027000E25EFF4F84916C2D54DF0F900F900F9032
:100280000F931F93CF93DF938C01A2DF811105C0E1 :10028000DF91CF911F910F91FF90EF90DF90CF9072
:10029000DF91CF911F910F91089583E3B3DFE801C0 :10029000BF90AF900895CF93DF93CDB7DEB764974B
:1002A000085F1F4FCCDF8993C017D107D9F781E0D2 :1002A0000FB6F894DEBF0FBECDBF28E042E062E09B
:1002B000EFCFFC01680F791F80E02CE80BC086951A :1002B00080E01DDF46DF04E610E001C042DFCE0132
:1002C000915029F080FFFBCF86958227F9CFE61762 :1002C0000196C3D08111FACFCE010196D1D08B898E
:1002D000F70721F09191892798E0F4CF0895EF92E4 :1002D0009C89B80126D141E089899A894CDFEFCF0A
:1002E000FF920F931F93CF93DF937C01C1DF8EEBBF :1002E000F894BC9A8FEB93E00197F1F700C00000FF
:1002F00089DFE7018701085F1F4FA1DF8993C017DE :1002F000BC989AEB9A95F1F700C086B3E3E3F3E07C
:10030000D107D9F768E070E0C701D3DFC82F97DFC6 :100300003197F1F700C0000078948295817091E0F8
:1003100091E0C81390E0892FDF91CF911F910F9149 :100310008927089598E00DC0BC9A20EA2A95F1F744
:10032000FF90EF90089554DF811101C008958CEC87 :10032000BC982AE12A95F1F700C0789486959150FF
:1003300069DF84E467DF81E0F9CFCF93DF93EC01DD :1003300069F0F89480FFF0CFBC9A20E12A95F1F79C
:10034000F2DF811103C0DF91CF9108952FE78FE491 :10034000BC982AEA2A95F1F700C0EFCF089598E00B
:1003500092E1215080409040E1F700C00000CE01C2 :1003500080E007C022E92A95F1F700C07894915017
:10036000BEDF882381F388814981542F482F9A0169 :1003600071F0F8948695BC9A20E12A95F1F7BC9833
:1003700033234CF135952795359527953595279558 :1003700028E12A95F1F7B49BEDCF8068EBCF089583
:1003800035952795398B288B8F70282F30E0C90140 :10038000AFDF811101C008958CECC4DF81E0FBCFA9
:10039000880F991F820F931FAC01440F551F429580 :100390000F931F93CF93DF938C01A2DF811105C0D0
:1003A0005295507F5427407F5427840F951F820F0A :1003A000DF91CF911F910F91089583E3B3DFE801AF
:1003B000931F95958795959587959595879595958F :1003B000085F1F4FCCDF8993C017D107D9F781E0C1
:1003C00087958A8BC0CF215F3F4FD4CFAA1BBB1B21 :1003C000EFCFFC01680F791F80E02CE80BC0869509
:1003D00051E107C0AA1FBB1FA617B70710F0A61B45 :1003D000915029F080FFFBCF86958227F9CFE61751
:1003E000B70B881F991F5A95A9F780959095BC0166 :1003E000F70721F09191892798E0F4CF0895EF92D3
:0803F000CD010895F894FFCF40 :1003F000FF920F931F93CF93DF937C01C1DF8EEBAE
:1004000089DFE7018701085F1F4FA1DF8993C017CC
:10041000D107D9F768E070E0C701D3DFC82F97DFB5
:1004200091E0C81390E0892FDF91CF911F910F9138
:10043000FF90EF90089554DF811101C008958CEC76
:1004400069DF84E467DF81E0F9CFCF93DF93EC01CC
:1004500047DF811104C081E0DF91CF910895CE0183
:10046000089696DF81E098859832B1F780E0F4CF66
:10047000CF93DF93EC01DFDF811103C0DF91CF91D8
:1004800008952FE78FE492E1215080409040E1F7FA
:1004900000C00000CE01ABDF882381F329813881C1
:1004A000522F432FCA019923BCF1959587959595B5
:1004B00087959595879595958795998B888B287FB6
:1004C00011F03195388388818F70282F30E0C90171
:1004D000880F991F82959295907F9827807F982703
:1004E000821B930B880F991F880F991F820F931FF0
:1004F000880F991F880F991F880F991F9C019923B6
:100500006CF0359527953595279535952795359533
:1005100027953B8B2A8BB2CF0F96C7CF215F3F4FDA
:10052000F0CFAA1BBB1B51E107C0AA1FBB1FA61718
:10053000B70710F0A61BB70B881F991F5A95A9F78C
:1005400080959095BC01CD01089597FB072E16F478
:10055000009406D077FD08D0E4DF07FC05D03EF418
:10056000909581959F4F0895709561957F4F08955F
:04057000F894FFCF2D
:00000001FF :00000001FF

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,8 @@ Archive member included to satisfy reference by file (symbol)
/opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o) /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o)
build/default/production/main.o (__udivmodhi4) build/default/production/main.o (__udivmodhi4)
/opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
build/default/production/main.o (__divmodhi4)
/opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o) /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o)
/home/sergeyyarkov/.mchp_packs/Microchip/ATtiny_DFP/3.0.151/gcc/dev/attiny45/avr25/crtattiny45.o (exit) /home/sergeyyarkov/.mchp_packs/Microchip/ATtiny_DFP/3.0.151/gcc/dev/attiny45/avr25/crtattiny45.o (exit)
@ -12,12 +14,16 @@ Discarded input sections
.text 0x0000000000000000 0x0 build/default/production/main.o .text 0x0000000000000000 0x0 build/default/production/main.o
.data 0x0000000000000000 0x0 build/default/production/main.o .data 0x0000000000000000 0x0 build/default/production/main.o
.bss 0x0000000000000000 0x0 build/default/production/main.o .bss 0x0000000000000000 0x0 build/default/production/main.o
.text.TM1637_DisplayInt
0x0000000000000000 0x86 build/default/production/main.o
.text 0x0000000000000000 0x0 build/default/production/onewire.o .text 0x0000000000000000 0x0 build/default/production/onewire.o
.data 0x0000000000000000 0x0 build/default/production/onewire.o .data 0x0000000000000000 0x0 build/default/production/onewire.o
.bss 0x0000000000000000 0x0 build/default/production/onewire.o .bss 0x0000000000000000 0x0 build/default/production/onewire.o
.text 0x0000000000000000 0x0 build/default/production/dstemperature.o .text 0x0000000000000000 0x0 build/default/production/dstemperature.o
.data 0x0000000000000000 0x0 build/default/production/dstemperature.o .data 0x0000000000000000 0x0 build/default/production/dstemperature.o
.bss 0x0000000000000000 0x0 build/default/production/dstemperature.o .bss 0x0000000000000000 0x0 build/default/production/dstemperature.o
.text.DallasTemp_WriteScratchpad
0x0000000000000000 0x32 build/default/production/dstemperature.o
.text 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o) .text 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o)
.data 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o) .data 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o)
.bss 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o) .bss 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o)
@ -32,6 +38,20 @@ Discarded input sections
0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o) 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o)
.text.libgcc.fixed .text.libgcc.fixed
0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o) 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o)
.text 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.data 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.bss 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.text.libgcc.mul
0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.text.libgcc 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.text.libgcc.prologue
0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.text.libgcc.builtins
0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.text.libgcc.fmul
0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.text.libgcc.fixed
0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
.text 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o) .text 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o)
.data 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o) .data 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o)
.bss 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o) .bss 0x0000000000000000 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o)
@ -177,7 +197,7 @@ END GROUP
.rela.plt .rela.plt
*(.rela.plt) *(.rela.plt)
.text 0x0000000000000000 0x3f8 .text 0x0000000000000000 0x574
*(.vectors) *(.vectors)
.vectors 0x0000000000000000 0x1e /home/sergeyyarkov/.mchp_packs/Microchip/ATtiny_DFP/3.0.151/gcc/dev/attiny45/avr25/crtattiny45.o .vectors 0x0000000000000000 0x1e /home/sergeyyarkov/.mchp_packs/Microchip/ATtiny_DFP/3.0.151/gcc/dev/attiny45/avr25/crtattiny45.o
0x0000000000000000 __vectors 0x0000000000000000 __vectors
@ -252,66 +272,76 @@ END GROUP
0x000000000000003a . = ALIGN (0x2) 0x000000000000003a . = ALIGN (0x2)
*(.text.*) *(.text.*)
.text.TWI_Start .text.TWI_Start
0x000000000000003a 0x1a build/default/production/main.o 0x000000000000003a 0x1e build/default/production/main.o
0x000000000000003a TWI_Start 0x000000000000003a TWI_Start
.text.TWI_Stop .text.TWI_Stop
0x0000000000000054 0x1a build/default/production/main.o 0x0000000000000058 0x1e build/default/production/main.o
0x0000000000000054 TWI_Stop 0x0000000000000058 TWI_Stop
.text.TWI_WriteByte .text.TWI_WriteByte
0x000000000000006e 0x64 build/default/production/main.o 0x0000000000000076 0x68 build/default/production/main.o
0x000000000000006e TWI_WriteByte 0x0000000000000076 TWI_WriteByte
.text.TM1637_WriteByte .text.TM1637_WriteByte
0x00000000000000d2 0x10 build/default/production/main.o 0x00000000000000de 0x10 build/default/production/main.o
0x00000000000000d2 TM1637_WriteByte 0x00000000000000de TM1637_WriteByte
.text.TM1637_Init .text.TM1637_Init
0x00000000000000e2 0x34 build/default/production/main.o 0x00000000000000ee 0x34 build/default/production/main.o
0x00000000000000e2 TM1637_Init 0x00000000000000ee TM1637_Init
.text.TM1637_DisplaySymbol .text.TM1637_DisplaySymbol
0x0000000000000116 0x20 build/default/production/main.o 0x0000000000000122 0x20 build/default/production/main.o
0x0000000000000116 TM1637_DisplaySymbol 0x0000000000000122 TM1637_DisplaySymbol
.text.TM1637_DisplayUInt .text.TM1637_DisplayLine
0x0000000000000136 0x64 build/default/production/main.o 0x0000000000000142 0x14 build/default/production/main.o
0x0000000000000136 TM1637_DisplayUInt 0x0000000000000142 TM1637_DisplayLine
.text.MCU_Init .text.get_int_length
0x000000000000019a 0xc build/default/production/main.o 0x0000000000000156 0x20 build/default/production/main.o
0x000000000000019a MCU_Init 0x0000000000000156 get_int_length
.text.main 0x00000000000001a6 0x2a build/default/production/main.o .text.TM1637_DisplayFixedNum
0x00000000000001a6 main 0x0000000000000176 0x120 build/default/production/main.o
0x0000000000000176 TM1637_DisplayFixedNum
.text.main 0x0000000000000296 0x4a build/default/production/main.o
0x0000000000000296 main
.text.OneWire_Presence .text.OneWire_Presence
0x00000000000001d0 0x34 build/default/production/onewire.o 0x00000000000002e0 0x34 build/default/production/onewire.o
0x00000000000001d0 OneWire_Presence 0x00000000000002e0 OneWire_Presence
.text.OneWire_WriteByte .text.OneWire_WriteByte
0x0000000000000204 0x3a build/default/production/onewire.o 0x0000000000000314 0x3a build/default/production/onewire.o
0x0000000000000204 OneWire_WriteByte 0x0000000000000314 OneWire_WriteByte
.text.OneWire_ReadByte .text.OneWire_ReadByte
0x000000000000023e 0x32 build/default/production/onewire.o 0x000000000000034e 0x32 build/default/production/onewire.o
0x000000000000023e OneWire_ReadByte 0x000000000000034e OneWire_ReadByte
.text.OneWire_SkipROM .text.OneWire_SkipROM
0x0000000000000270 0x10 build/default/production/onewire.o 0x0000000000000380 0x10 build/default/production/onewire.o
0x0000000000000270 OneWire_SkipROM 0x0000000000000380 OneWire_SkipROM
.text.OneWire_ReadROM .text.OneWire_ReadROM
0x0000000000000280 0x32 build/default/production/onewire.o 0x0000000000000390 0x32 build/default/production/onewire.o
0x0000000000000280 OneWire_ReadROM 0x0000000000000390 OneWire_ReadROM
.text.OneWire_CRC8_Update .text.OneWire_CRC8_Update
0x00000000000002b2 0x2c build/default/production/onewire.o 0x00000000000003c2 0x2c build/default/production/onewire.o
0x00000000000002b2 OneWire_CRC8_Update 0x00000000000003c2 OneWire_CRC8_Update
.text.DallasTemp_ReadScratchpad .text.DallasTemp_ReadScratchpad
0x00000000000002de 0x48 build/default/production/dstemperature.o 0x00000000000003ee 0x48 build/default/production/dstemperature.o
0x00000000000002de DallasTemp_ReadScratchpad 0x00000000000003ee DallasTemp_ReadScratchpad
.text.DallasTemp_Convert .text.DallasTemp_Convert
0x0000000000000326 0x14 build/default/production/dstemperature.o 0x0000000000000436 0x14 build/default/production/dstemperature.o
0x0000000000000326 DallasTemp_Convert 0x0000000000000436 DallasTemp_Convert
.text.DallasTemp_CheckError
0x000000000000044a 0x26 build/default/production/dstemperature.o
0x000000000000044a DallasTemp_CheckError
.text.DallasTemp_GetTemperature .text.DallasTemp_GetTemperature
0x000000000000033a 0x92 build/default/production/dstemperature.o 0x0000000000000470 0xb2 build/default/production/dstemperature.o
0x000000000000033a DallasTemp_GetTemperature 0x0000000000000470 DallasTemp_GetTemperature
.text.libgcc.div .text.libgcc.div
0x00000000000003cc 0x28 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o) 0x0000000000000522 0x28 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_udivmodhi4.o)
0x00000000000003cc __udivmodhi4 0x0000000000000522 __udivmodhi4
0x00000000000003f4 . = ALIGN (0x2) .text.libgcc.div
0x000000000000054a 0x26 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_divmodhi4.o)
0x000000000000054a __divmodhi4
0x000000000000054a _div
0x0000000000000570 . = ALIGN (0x2)
*(.fini9) *(.fini9)
.fini9 0x00000000000003f4 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o) .fini9 0x0000000000000570 0x0 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o)
0x00000000000003f4 exit 0x0000000000000570 exit
0x00000000000003f4 _exit 0x0000000000000570 _exit
*(.fini9) *(.fini9)
*(.fini8) *(.fini8)
*(.fini8) *(.fini8)
@ -330,11 +360,11 @@ END GROUP
*(.fini1) *(.fini1)
*(.fini1) *(.fini1)
*(.fini0) *(.fini0)
.fini0 0x00000000000003f4 0x4 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o) .fini0 0x0000000000000570 0x4 /opt/avr8-gnu-toolchain-linux_x86_64/bin/../lib/gcc/avr/7.3.0/avr25/libgcc.a(_exit.o)
*(.fini0) *(.fini0)
0x00000000000003f8 _etext = . 0x0000000000000574 _etext = .
.data 0x0000000000800060 0x0 load address 0x00000000000003f8 .data 0x0000000000800060 0x0 load address 0x0000000000000574
[!provide] PROVIDE (__data_start, .) [!provide] PROVIDE (__data_start, .)
*(.data) *(.data)
*(.data*) *(.data*)
@ -352,8 +382,8 @@ END GROUP
*(.bss*) *(.bss*)
*(COMMON) *(COMMON)
[!provide] PROVIDE (__bss_end, .) [!provide] PROVIDE (__bss_end, .)
0x00000000000003f8 __data_load_start = LOADADDR (.data) 0x0000000000000574 __data_load_start = LOADADDR (.data)
0x00000000000003f8 __data_load_end = (__data_load_start + SIZEOF (.data)) 0x0000000000000574 __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x0000000000800060 0x0 .noinit 0x0000000000800060 0x0
[!provide] PROVIDE (__noinit_start, .) [!provide] PROVIDE (__noinit_start, .)

View File

@ -16,6 +16,26 @@ uint8_t DallasTemp_ReadScratchpad(uint8_t *scratchpad) {
return 1; return 1;
} }
void DallasTemp_WriteScratchpad(uint8_t *data) {
uint8_t i = 3;
OneWire_SkipROM();
OneWire_WriteByte(DS18B20_CMD_WSCRATCHPAD);
do {
OneWire_WriteByte(*data++);
} while (--i);
OneWire_Presence();
// TODO вынести в отдельную функцию DallasTemp_CopyScratchpad
OneWire_SkipROM();
OneWire_WriteByte(0x48);
_delay_ms(10);
}
uint8_t DallasTemp_Convert(void) { uint8_t DallasTemp_Convert(void) {
if (!OneWire_Presence()) return 0; if (!OneWire_Presence()) return 0;
OneWire_WriteByte(ONE_WIRE_SKIPROM); OneWire_WriteByte(ONE_WIRE_SKIPROM);
@ -23,10 +43,27 @@ uint8_t DallasTemp_Convert(void) {
return 1; return 1;
} }
uint8_t DallasTemp_CheckError(DallasSensor* Sensor) {
if (!OneWire_Presence()) return 1;
OneWire_ReadROM(Sensor->ROM);
if (Sensor->ROM[0] != DS18B20_CONST_FAMILY_CODE) return 1;
return 0;
}
void DallasTemp_GetTemperature(DallasSensor *Sensor) { void DallasTemp_GetTemperature(DallasSensor *Sensor) {
if (!DallasTemp_Convert()) return; if (!DallasTemp_Convert()) return;
_delay_ms(750); _delay_ms(750); // TODO задержку делать в зависимости от разрешения АЦП датчика
if (!DallasTemp_ReadScratchpad(Sensor->SCRATCHPAD)) return; if (!DallasTemp_ReadScratchpad(Sensor->SCRATCHPAD)) return;
Sensor->TEMPERATURE = ((Sensor->SCRATCHPAD[1] << 8) | Sensor->SCRATCHPAD[0]) / 16; Sensor->TEMPERATURE = ((Sensor->SCRATCHPAD[1] << 8) | Sensor->SCRATCHPAD[0]) / 16;
Sensor->TEMPERATURE_FRACTION = ((Sensor->SCRATCHPAD[0] & 0x0f) * 100) / 16;
/*
* Двойное дополнение для дробной части если минусовая температура:
* проверяем что последние пять битов в старшем байте температуры стоят в единице
*/
if (Sensor->SCRATCHPAD[1] & 0xf8) Sensor->SCRATCHPAD[0] = -Sensor->SCRATCHPAD[0];
/**
* Получаем дробную часть через битовую маску 0x0f, умножаем для получения точности.
*/
Sensor->TEMPERATURE_FRACTION = ((Sensor->SCRATCHPAD[0] & 0x0f) * 1000) / 16;
} }

View File

@ -2,17 +2,21 @@
#define DS18B20_CMD_CONVERTTEMP 0x44 #define DS18B20_CMD_CONVERTTEMP 0x44
#define DS18B20_CMD_RSCRATCHPAD 0xbe #define DS18B20_CMD_RSCRATCHPAD 0xbe
#define DS18B20_CMD_WSCRATCHPAD 0x4e
#define DS18B20_CONST_FAMILY_CODE 0x28
#ifndef DSTEMPERATURE_H #ifndef DSTEMPERATURE_H
#define DSTEMPERATURE_H #define DSTEMPERATURE_H
typedef struct DallasSensor { typedef struct DallasSensor {
uint8_t SCRATCHPAD[8]; // ОЗУ uint8_t SCRATCHPAD[8]; // ОЗУ (T_LSB, T_MSB, TH/USER BYTE 1, TH/USER BYTE 2, CONFIG, RESERVED, RESERVED, RESERVED, CRC8)
uint8_t ROM[8]; // ПЗУ uint8_t ROM[8]; // ПЗУ (код семейства, серийный код, CRC8)
int16_t TEMPERATURE; // Температура в градусах цельсия (целая часть) int16_t TEMPERATURE; // Температура в градусах цельсия (целая часть)
uint8_t TEMPERATURE_FRACTION; // Дробная часть uint16_t TEMPERATURE_FRACTION; // Дробная часть
} DallasSensor; } DallasSensor;
// TODO сделать функию установки разрешения АЦП датчика
/** /**
* Читает ОЗУ датчика * Читает ОЗУ датчика
* @param scratchpad - первые 8 байт. * @param scratchpad - первые 8 байт.
@ -20,6 +24,12 @@ typedef struct DallasSensor {
*/ */
uint8_t DallasTemp_ReadScratchpad(uint8_t *scratchpad); uint8_t DallasTemp_ReadScratchpad(uint8_t *scratchpad);
/**
* Записывает данные в ОЗУ датчика
* @param data - 3 байта
*/
void DallasTemp_WriteScratchpad(uint8_t *data);
/** /**
* Отправляет команду для оцифровки температуры. * Отправляет команду для оцифровки температуры.
* @return "1" - если команда отправлена, "0" - если не было ответа от датчика * @return "1" - если команда отправлена, "0" - если не было ответа от датчика
@ -28,9 +38,16 @@ uint8_t DallasTemp_Convert(void);
/** /**
* Получает оцифрованное значение датчика и конвертирует занчение в читаемый вид. * Получает оцифрованное значение датчика и конвертирует занчение в читаемый вид.
* @param Sensor - структура датчика * @param Sensor - датчика
*/ */
void DallasTemp_GetTemperature(DallasSensor *Sensor); void DallasTemp_GetTemperature(DallasSensor *Sensor);
/**
* Читает семейный код датчика и проверяет его правильность
* @param Sensor - датчик
* @return Возвращает "1" если имеются проблемы с датчиком иначе "0"
*/
uint8_t DallasTemp_CheckError(DallasSensor *Sensor);
#endif /* DSTEMPERATURE_H */ #endif /* DSTEMPERATURE_H */

123
main.c
View File

@ -41,6 +41,14 @@
#define TM1637_DISP_OFF 0x00 // Display off #define TM1637_DISP_OFF 0x00 // Display off
#define TM1637_DISP_ON 0x08 // Display on #define TM1637_DISP_ON 0x08 // Display on
#define TM1637_BRIGHTNESS_1 1
#define TM1637_BRIGHTNESS_2 2
#define TM1637_BRIGHTNESS_3 3
#define TM1637_BRIGHTNESS_4 4
#define TM1637_BRIGHTNESS_5 5
#define TM1637_BRIGHTNESS_6 6
#define TM1637_BRIGHTNESS_7 7
#define dio_high() (PORT_TWI |= (_BV(PORT_TWI_DIO))) #define dio_high() (PORT_TWI |= (_BV(PORT_TWI_DIO)))
#define dio_low() (PORT_TWI &= (~_BV(PORT_TWI_DIO))) #define dio_low() (PORT_TWI &= (~_BV(PORT_TWI_DIO)))
#define dio_input() (DDR_TWI &= (~_BV(PORT_TWI_DIO))) #define dio_input() (DDR_TWI &= (~_BV(PORT_TWI_DIO)))
@ -48,6 +56,8 @@
#define clk_high() (PORT_TWI |= (_BV(PORT_TWI_CLK))) #define clk_high() (PORT_TWI |= (_BV(PORT_TWI_CLK)))
#define clk_low() (PORT_TWI &= (~_BV(PORT_TWI_CLK))) #define clk_low() (PORT_TWI &= (~_BV(PORT_TWI_CLK)))
#define get_symbol(index) (pgm_read_byte_near(&display_symbols[index]))
static const uint8_t display_symbols[] PROGMEM = static const uint8_t display_symbols[] PROGMEM =
{ {
0x3F, // 0 0x3F, // 0
@ -59,31 +69,37 @@ static const uint8_t display_symbols[] PROGMEM =
0x7D, // 6 0x7D, // 6
0x07, // 7 0x07, // 7
0x7F, // 8 0x7F, // 8
0x6F // 9 0x6F, // 9
}; };
void TWI_Start(void) { void TWI_Start(void) {
cli();
dio_high(); dio_high();
clk_high(); clk_high();
_delay_us(TWI_DELAY); _delay_us(TWI_DELAY);
dio_low(); dio_low();
_delay_us(TWI_DELAY); _delay_us(TWI_DELAY);
clk_low(); clk_low();
sei();
} }
void TWI_Stop(void) { void TWI_Stop(void) {
cli();
clk_low(); clk_low();
dio_low(); dio_low();
_delay_us(TWI_DELAY); _delay_us(TWI_DELAY);
clk_high(); clk_high();
_delay_us(TWI_DELAY); _delay_us(TWI_DELAY);
dio_high(); dio_high();
sei();
} }
uint8_t TWI_WriteByte(uint8_t byte) { uint8_t TWI_WriteByte(uint8_t byte) {
uint8_t i = 8; uint8_t i = 8;
uint8_t ack = 0; uint8_t ack = 0;
cli();
_delay_us(TWI_DELAY); _delay_us(TWI_DELAY);
do { do {
@ -109,6 +125,8 @@ uint8_t TWI_WriteByte(uint8_t byte) {
_delay_us(TWI_DELAY); _delay_us(TWI_DELAY);
dio_output(); dio_output();
sei();
return ack; return ack;
} }
@ -132,36 +150,105 @@ void TM1637_DisplaySymbol(uint8_t symbol, uint8_t pos) {
TWI_Stop(); TWI_Stop();
} }
void TM1637_DisplayUInt(uint16_t num) { void TM1637_DisplayLine(void) {
uint16_t tmp = num > 999 ? 999 : num;
uint8_t digits[TM1637_DIGITS_COUNT];
uint8_t i = TM1637_DIGITS_COUNT; uint8_t i = TM1637_DIGITS_COUNT;
do { do {
digits[i - 1] = tmp % 10; TM1637_DisplaySymbol(0x40, i - 1);
tmp /= 10;
} while (--i); } while (--i);
TM1637_DisplaySymbol(pgm_read_byte_near(&display_symbols[digits[0]]), 0);
TM1637_DisplaySymbol(pgm_read_byte_near(&display_symbols[digits[1]]), 1);
TM1637_DisplaySymbol(pgm_read_byte_near(&display_symbols[digits[2]]), 2);
} }
void MCU_Init(void) { void TM1637_DisplayInt(int16_t num) {
TM1637_Init(PORT_TWI_DIO, PORT_TWI_CLK, 1, TM1637_DISP_ON); uint8_t is_signed = num < 0;
int16_t tmp = num > 999 ? 999 : num;
uint8_t i = TM1637_DIGITS_COUNT;
if (is_signed) {
tmp = -tmp;
TM1637_DisplaySymbol(0x40, 0); // sign symbol
}
do {
if (is_signed && i == 1) break;
TM1637_DisplaySymbol(pgm_read_byte_near(&display_symbols[tmp % 10]), i - 1);
tmp /= 10;
} while (--i);
}
uint8_t get_int_length(uint16_t num) {
uint8_t l = 1;
while (num > 9) {
num /= 10;
l++;
}
return l;
}
// TODO сделать отображение минусовой температуры для этой функции
void TM1637_DisplayFixedNum(int16_t num, uint8_t frac, uint8_t presicion) {
uint8_t is_signed = (num < 0) | (num == 0 && frac > 0);
num = num > 999 ? 999 : num;
if (is_signed) {
num = -num;
}
uint8_t length = get_int_length(num);
uint8_t i = TM1637_DIGITS_COUNT, j = 0;
uint8_t buffer[TM1637_DIGITS_COUNT];
do {
buffer[i - 1] = num % 10;
num /= 10;
} while (--i);
if (length != 1) {
i = TM1637_DIGITS_COUNT - length;
} else {
i = 1;
}
while (i < TM1637_DIGITS_COUNT) {
// if (j == 0) {
//// if (is_signed) {
//// TM1637_DisplaySymbol(0x40, 0);
//// }
// i++;
// j++;
// continue;
// }
TM1637_DisplaySymbol(
(j == TM1637_DIGITS_COUNT - 1 - presicion && TM1637_DIGITS_COUNT != length)
? get_symbol(buffer[i]) | 0x80 // точка
: get_symbol(buffer[i]),
j);
i++;
j++;
}
TM1637_DisplaySymbol(get_symbol(frac), j);
} }
int main(void) { int main(void) {
MCU_Init();
DallasSensor Sensor_01; DallasSensor Sensor_01;
OneWire_ReadROM(Sensor_01.ROM); TM1637_Init(PORT_TWI_DIO, PORT_TWI_CLK, TM1637_BRIGHTNESS_2, TM1637_DISP_ON);
TM1637_DisplayLine();
while (1) { while (1) {
/**
* Проверка датчика
*/
if (DallasTemp_CheckError(&Sensor_01)) {
TM1637_DisplayLine();
continue;
}
/**
* Получение температуры и вывод на индикатор
*/
DallasTemp_GetTemperature(&Sensor_01); DallasTemp_GetTemperature(&Sensor_01);
TM1637_DisplayUInt(Sensor_01.TEMPERATURE); TM1637_DisplayFixedNum(Sensor_01.TEMPERATURE, Sensor_01.TEMPERATURE_FRACTION / 100, 1);
} }
return 0; return 0;
} }

View File

@ -1,11 +1,11 @@
# #
#Thu Aug 03 22:47:35 MSK 2023 #Fri Aug 04 08:31:18 MSK 2023
default.languagetoolchain.version=7.3.0 default.languagetoolchain.version=7.3.0
default.Pack.dfplocation=/home/sergeyyarkov/.mchp_packs/Microchip/ATtiny_DFP/3.0.151 default.Pack.dfplocation=/home/sergeyyarkov/.mchp_packs/Microchip/ATtiny_DFP/3.0.151
default.com-microchip-mplab-nbide-toolchain-avr-AVRLanguageToolchain.md5=f7c8f2a9c7d7748a6cb97af5c32efadd default.com-microchip-mplab-nbide-toolchain-avr-AVRLanguageToolchain.md5=f7c8f2a9c7d7748a6cb97af5c32efadd
conf.ids=default conf.ids=default
default.languagetoolchain.dir=/opt/avr8-gnu-toolchain-linux_x86_64/bin default.languagetoolchain.dir=/opt/avr8-gnu-toolchain-linux_x86_64/bin
host.id=1f9t-t7j1-aq host.id=256x-epq9-v8
configurations-xml=5516afcd622aad1c1ae6784dba5612d3 configurations-xml=5516afcd622aad1c1ae6784dba5612d3
default.com-microchip-mplab-mdbcore-snap-SnapToolImpl.md5=eaa336cefb7fc46db8b50b7b2b6e54ca default.com-microchip-mplab-mdbcore-snap-SnapToolImpl.md5=eaa336cefb7fc46db8b50b7b2b6e54ca
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6e02ca5e9f5042ffd365b42ab82d3a9b com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6e02ca5e9f5042ffd365b42ab82d3a9b

View File

@ -6,7 +6,6 @@
<file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/onewire.c</file> <file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/onewire.c</file>
<file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/dstemperature.h</file> <file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/dstemperature.h</file>
<file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/main.c</file> <file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/main.c</file>
<file>file:/opt/avr8-gnu-toolchain-linux_x86_64/avr/include/util/delay.h</file>
<file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/dstemperature.c</file> <file>file:/home/sergeyyarkov/Documents/Projects/Firmwares/AVR/attiny45v_thermometer.X/dstemperature.c</file>
</group> </group>
</open-files> </open-files>

View File

@ -19,11 +19,44 @@
#ifndef ONEWIRE_H #ifndef ONEWIRE_H
#define ONEWIRE_H #define ONEWIRE_H
/**
*
* @return
*/
uint8_t OneWire_Presence(void); uint8_t OneWire_Presence(void);
/**
*
* @param byte
*/
void OneWire_WriteByte(uint8_t byte); void OneWire_WriteByte(uint8_t byte);
/**
*
* @return
*/
uint8_t OneWire_ReadByte(); uint8_t OneWire_ReadByte();
/**
*
* @return
*/
uint8_t OneWire_SkipROM(); uint8_t OneWire_SkipROM();
/**
* Читает ПЗУ подчиненного устройства.
* Использовать только если на шине одно подчиненной устройство!
* @param buffer - куда складывать данные
* @return "1" - если успешно прочиталось, "0" - если устройство не ответило
*/
uint8_t OneWire_ReadROM(uint8_t *buffer); uint8_t OneWire_ReadROM(uint8_t *buffer);
/**
*
* @param buffer
* @param len
* @return
*/
uint8_t OneWire_CRC8_Update(uint8_t *buffer, size_t len); uint8_t OneWire_CRC8_Update(uint8_t *buffer, size_t len);
#endif /* ONEWIRE_H */ #endif /* ONEWIRE_H */