Обновление после командировки 29.06.2026

This commit is contained in:
cfif 2026-06-29 13:13:46 +03:00
parent 6a77807279
commit f8783ce920
7 changed files with 13730 additions and 13249 deletions

21295
HVAC_model.c Executable file → Normal file

File diff suppressed because it is too large Load Diff

4785
HVAC_model.h Executable file → Normal file

File diff suppressed because it is too large Load Diff

177
HVAC_model_data.c Executable file → Normal file
View File

@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'HVAC_model'.
*
* Model version : 1.1140
* Model version : 1.1202
* Simulink Coder version : 24.1 (R2024a) 19-Nov-2023
* C/C++ source code generated on : Wed Jun 24 09:01:39 2026
* C/C++ source code generated on : Fri Jun 26 14:54:36 2026
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex-M
@ -19,27 +19,27 @@
/* Invariant block signals (default storage) */
const ConstB rtConstB = {
/* Start of '<S1686>/If Action Subsystem1' */
/* Start of '<S1628>/If Action Subsystem1' */
{
{ 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U }/* '<S1702>/Data Type Conversion' */
{ 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U }/* '<S1644>/Data Type Conversion' */
}
,
/* End of '<S1686>/If Action Subsystem1' */
/* End of '<S1628>/If Action Subsystem1' */
/* Start of '<S1615>/If Action Subsystem1' */
/* Start of '<S1557>/If Action Subsystem1' */
{
{ 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U }/* '<S1631>/Data Type Conversion' */
{ 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U }/* '<S1573>/Data Type Conversion' */
}
,
/* End of '<S1615>/If Action Subsystem1' */
/* End of '<S1557>/If Action Subsystem1' */
/* Start of '<S1545>/If Action Subsystem1' */
/* Start of '<S1487>/If Action Subsystem1' */
{
{ 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U }/* '<S1561>/Data Type Conversion' */
{ 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U }/* '<S1503>/Data Type Conversion' */
}
/* End of '<S1545>/If Action Subsystem1' */
/* End of '<S1487>/If Action Subsystem1' */
};
/* Constant parameters (default storage) */
@ -92,8 +92,8 @@ const ConstP rtConstP = {
/* Pooled Parameter (Expression: [850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 836 818 800 784 769 754 740 727 714 702 691 680 670 659 650 640 631 622 614 606 598 590 583 575 568 561 555 548 542 536 530 524 518 512 507 501 496 491 486 481 476 471 466 462 457 453 448 444 440 436 431 427 423 420 416 412 408 405 401 397 394 390 387 384 380 377 374 370 367 364 361 358 355 352 349 346 343 340 338 335 332 329 327 324 321 319 316 314 311 309 306 304 301 299 297 294 292 289 287 285 283 280 278 276 274 272 269 267 265 263 261 259 257 255 253 251 249 247 245 243 241 239 237 235 234 232 230 228 226 224 223 221 219 217 216 214 212 210 209 207 205 204 202 200 199 197 195 194 192 191 189 187 186 184 183 181 180 178 177 175 174 172 171 169 168 166 165 163 162 161 159 158 156 155 153 152 151 149 148 147 145 144 143 141 140 139 137 136 135 133 132 131 129 128 127 126 124 123 122 121 119 118 117 116 115 113 112 111 110 109 107 106 105 104 103 101 100 99 98 97 96 95 93 92 91 90 89 88 87 86 84 83 82 81 80 79 78 77 76 75 74 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 29 28 27 26 25 24 23 22 21 20 19 18 17 17 16 15 14 13 12 11 10 9 8 8 7 6 5 4 3 2 1 0 0 0 -1 -2 -3 -4 -5 -5 -6 -7 -8 -9 -10 -11 -11 -12 -13 -14 -15 -16 -17 -17 -18 -19 -20 -21 -22 -22 -23 -24 -25 -26 -27 -27 -28 -29 -30 -31 -31 -32 -33 -34 -35 -36 -36 -37 -38 -39 -40 -40 -41 -42 -43 -44 -44 -45 -46 -47 -47 -48 -49 -50 -51 -51 -52 -53 -54 -55 -55 -56 -57 -58 -58 -59 -60 -61 -62 -62 -63 -64 -65 -65 -66 -67 -68 -68 -69 -70 -71 -71 -72 -73 -74 -74 -75 -76 -77 -77 -78 -79 -80 -80 -81 -82 -83 -83 -84 -85 -86 -86 -87 -88 -89 -89 -90 -91 -92 -92 -93 -94 -95 -95 -96 -97 -97 -98 -99 -100 -100 -101 -102 -103 -103 -104 -105 -105 -106 -107 -108 -108 -109 -110 -111 -111 -112 -113 -113 -114 -115 -116 -116 -117 -118 -118 -119 -120 -121 -121 -122 -123 -123 -124 -125 -126 -126 -127 -128 -128 -129 -130 -131 -131 -132 -133 -133 -134 -135 -136 -136 -137 -138 -138 -139 -140 -140 -141 -142 -143 -143 -144 -145 -145 -146 -147 -148 -148 -149 -150 -150 -151 -152 -152 -153 -154 -155 -155 -156 -157 -157 -158 -159 -159 -160 -161 -162 -162 -163 -164 -164 -165 -166 -166 -167 -168 -169 -169 -170 -171 -171 -172 -173 -173 -174 -175 -176 -176 -177 -178 -178 -179 -180 -180 -181 -182 -183 -183 -184 -185 -185 -186 -187 -187 -188 -189 -189 -190 -191 -192 -192 -193 -194 -194 -195 -196 -196 -197 -198 -199 -199 -200 -201 -201 -202 -203 -204 -204 -205 -206 -206 -207 -208 -208 -209 -210 -211 -211 -212 -213 -213 -214 -215 -216 -216 -217 -218 -218 -219 -220 -221 -221 -222 -223 -223 -224 -225 -226 -226 -227 -228 -228 -229 -230 -231 -231 -232 -233 -233 -234 -235 -236 -236 -237 -238 -238 -239 -240 -241 -241 -242 -243 -244 -244 -245 -246 -246 -247 -248 -249 -249 -250 -251 -252 -252 -253 -254 -255 -255 -256 -257 -257 -258 -259 -260 -260 -261 -262 -263 -263 -264 -265 -266 -266 -267 -268 -269 -269 -270 -271 -272 -272 -273 -274 -275 -275 -276 -277 -278 -279 -279 -280 -281 -282 -282 -283 -284 -285 -285 -286 -287 -288 -289 -289 -290 -291 -292 -292 -293 -294 -295 -296 -296 -297 -298 -299 -300 -300 -301 -302 -303 -304 -304 -305 -306 -307 -308 -308 -309 -310 -311 -312 -313 -313 -314 -315 -316 -317 -318 -318 -319 -320 -321 -322 -323 -323 -324 -325 -326 -327 -328 -329 -329 -330 -331 -332 -333 -334 -335 -335 -336 -337 -338 -339 -340 -341 -342 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -398 -399 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400
])
* Referenced by:
* '<S914>/1-D Lookup Table'
* '<S915>/1-D Lookup Table'
* '<S861>/1-D Lookup Table'
* '<S862>/1-D Lookup Table'
*/
{ 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0,
850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 836.0, 818.0, 800.0, 784.0, 769.0,
@ -200,7 +200,7 @@ const ConstP rtConstP = {
-400.0, -400.0, -400.0, -400.0, -400.0, -400.0, -400.0 },
/* Expression: [zeros(1, 85), linspace(0.268534, 390.3364, 1024-85)]
* Referenced by: '<S931>/1-D Lookup Table'
* Referenced by: '<S878>/1-D Lookup Table'
*/
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
@ -507,10 +507,10 @@ const ConstP rtConstP = {
/* Pooled Parameter (Expression: Incar_Temp_Table)
* Referenced by:
* '<S940>/1-D Lookup Table1'
* '<S940>/1-D Lookup Table2'
* '<S941>/1-D Lookup Table1'
* '<S941>/1-D Lookup Table2'
* '<S887>/1-D Lookup Table1'
* '<S887>/1-D Lookup Table2'
* '<S888>/1-D Lookup Table1'
* '<S888>/1-D Lookup Table2'
*/
{ 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0, 850.0,
850.0, 850.0, 850.0, 850.0, 837.0, 816.0, 797.0, 780.0, 763.0, 748.0, 733.0,
@ -623,15 +623,68 @@ const ConstP rtConstP = {
*/
{ 5U, 12U },
/* Pooled Parameter (Expression: [170:10:290])
* Referenced by:
* '<S791>/1-D Lookup Table'
* '<S791>/1-D Lookup Table1'
* '<S791>/1-D Lookup Table2'
* '<S791>/1-D Lookup Table3'
* '<S791>/1-D Lookup Table4'
* '<S791>/1-D Lookup Table5'
* '<S793>/1-D Lookup Table'
* '<S793>/1-D Lookup Table1'
* '<S793>/1-D Lookup Table2'
* '<S793>/1-D Lookup Table3'
* '<S793>/1-D Lookup Table4'
* '<S793>/1-D Lookup Table5'
* '<S797>/1-D Lookup Table'
* '<S797>/1-D Lookup Table1'
* '<S797>/1-D Lookup Table2'
* '<S797>/1-D Lookup Table3'
* '<S797>/1-D Lookup Table4'
* '<S797>/1-D Lookup Table5'
* '<S809>/1-D Lookup Table'
* '<S809>/1-D Lookup Table1'
* '<S809>/1-D Lookup Table2'
* '<S809>/1-D Lookup Table3'
* '<S809>/1-D Lookup Table4'
* '<S809>/1-D Lookup Table5'
* '<S821>/1-D Lookup Table'
* '<S821>/1-D Lookup Table1'
* '<S821>/1-D Lookup Table2'
* '<S821>/1-D Lookup Table3'
* '<S821>/1-D Lookup Table4'
* '<S821>/1-D Lookup Table5'
* '<S833>/1-D Lookup Table'
* '<S833>/1-D Lookup Table1'
* '<S833>/1-D Lookup Table2'
* '<S833>/1-D Lookup Table3'
* '<S833>/1-D Lookup Table4'
* '<S833>/1-D Lookup Table5'
* '<S1206>/1-D Lookup Table'
* '<S1206>/1-D Lookup Table1'
* '<S1206>/1-D Lookup Table2'
* '<S1206>/1-D Lookup Table3'
* '<S1206>/1-D Lookup Table4'
* '<S1206>/1-D Lookup Table5'
* '<S1218>/1-D Lookup Table'
* '<S1218>/1-D Lookup Table1'
* '<S1218>/1-D Lookup Table2'
* '<S1218>/1-D Lookup Table3'
* '<S1218>/1-D Lookup Table4'
* '<S1218>/1-D Lookup Table5'
*/
{ 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290 },
/* Pooled Parameter (Expression: [5, 4, 3, 2, 1, 0])
* Referenced by:
* '<S28>/1-D Lookup Table'
* '<S1410>/Get LVL for temp'
* '<S1352>/Get LVL for temp'
*/
{ 5, 4, 3, 2, 1, 0 },
/* Computed Parameter: GetLVLfortemp_bp01Data
* Referenced by: '<S1410>/Get LVL for temp'
* Referenced by: '<S1352>/Get LVL for temp'
*/
{ -1000, -50, -10, 5, 20, 65 },
@ -644,8 +697,8 @@ const ConstP rtConstP = {
/* Pooled Parameter (Expression: [850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 850 848 845 841 838 834 831 827 824 821 818 814 811 808 805 802 799 796 793 790 787 784 781 778 775 772 769 767 764 761 758 756 753 750 748 745 742 740 737 735 732 730 727 725 722 720 717 715 713 710 708 706 703 701 699 696 694 692 690 688 685 683 681 679 677 675 673 670 668 666 664 662 660 658 656 654 652 650 648 646 644 642 640 638 637 635 633 631 629 627 625 624 622 620 618 616 614 613 611 609 607 606 604 602 600 599 597 595 594 592 590 589 587 585 584 582 580 579 577 576 574 572 571 569 568 566 564 563 561 560 558 557 555 554 552 551 549 548 546 545 543 542 540 539 537 536 534 533 532 530 529 527 526 524 523 522 520 519 517 516 515 513 512 511 509 508 507 505 504 503 501 500 499 497 496 495 493 492 491 489 488 487 485 484 483 482 480 479 478 477 475 474 473 472 470 469 468 467 465 464 463 462 460 459 458 457 456 454 453 452 451 450 448 447 446 445 444 442 441 440 439 438 437 435 434 433 432 431 430 429 427 426 425 424 423 422 421 420 418 417 416 415 414 413 412 411 410 408 407 406 405 404 403 402 401 400 399 398 396 395 394 393 392 391 390 389 388 387 386 385 384 383 382 381 380 378 377 376 375 374 373 372 371 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 305 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 291 290 289 288 287 286 285 284 283 282 281 280 279 279 278 277 276 275 274 273 272 271 270 269 268 268 267 266 265 264 263 262 261 260 259 259 258 257 256 255 254 253 252 251 250 250 249 248 247 246 245 244 243 242 241 241 240 239 238 237 236 235 234 233 233 232 231 230 229 228 227 226 225 224 224 223 222 221 220 219 218 217 217 216 215 214 213 212 211 210 209 209 208 207 206 205 204 203 202 201 201 200 199 198 197 196 195 194 194 193 192 191 190 189 188 187 186 186 185 184 183 182 181 180 179 179 178 177 176 175 174 173 172 171 171 170 169 168 167 166 165 164 163 163 162 161 160 159 158 157 156 155 155 154 153 152 151 150 149 148 147 147 146 145 144 143 142 141 140 139 139 138 137 136 135 134 133 132 131 130 130 129 128 127 126 125 124 123 122 121 121 120 119 118 117 116 115 114 113 112 112 111 110 109 108 107 106 105 104 103 102 101 101 100 99 98 97 96 95 94 93 92 91 90 89 88 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 3 2 1 0 0 -1 -2 -3 -4 -5 -6 -7 -9 -10 -11 -12 -13 -14 -15 -16 -17 -19 -20 -21 -22 -23 -24 -25 -26 -28 -29 -30 -31 -32 -33 -34 -36 -37 -38 -39 -40 -42 -43 -44 -45 -46 -47 -49 -50 -51 -52 -54 -55 -56 -57 -58 -60 -61 -62 -63 -65 -66 -67 -68 -70 -71 -72 -74 -75 -76 -77 -79 -80 -81 -83 -84 -85 -87 -88 -89 -91 -92 -93 -95 -96 -98 -99 -100 -102 -103 -105 -106 -108 -109 -110 -112 -113 -115 -116 -118 -119 -121 -122 -124 -125 -127 -128 -130 -131 -133 -134 -136 -138 -139 -141 -142 -144 -146 -147 -149 -151 -152 -154 -156 -157 -159 -161 -162 -164 -166 -168 -169 -171 -173 -175 -177 -179 -180 -182 -184 -186 -188 -190 -192 -194 -196 -198 -200 -202 -204 -206 -208 -210 -212 -214 -216 -218 -221 -223 -225 -227 -229 -232 -234 -236 -239 -241 -243 -246 -248 -251 -253 -256 -258 -261 -264 -266 -269 -272 -275 -277 -280 -283 -286 -289 -292 -295 -298 -301 -304 -308 -311 -314 -318 -321 -325 -328 -332 -336 -339 -343 -347 -351 -355 -359 -364 -368 -373 -377 -382 -387 -392 -397 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400 -400])
* Referenced by:
* '<S932>/1-D Lookup Table7'
* '<S939>/1-D Lookup Table4'
* '<S879>/1-D Lookup Table7'
* '<S886>/1-D Lookup Table4'
*/
{ 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850,
850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850,
@ -719,8 +772,8 @@ const ConstP rtConstP = {
/* Pooled Parameter (Expression: [0:4:4095])
* Referenced by:
* '<S932>/1-D Lookup Table7'
* '<S939>/1-D Lookup Table4'
* '<S879>/1-D Lookup Table7'
* '<S886>/1-D Lookup Table4'
*/
{ 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76,
80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
@ -800,29 +853,59 @@ const ConstP rtConstP = {
4052, 4056, 4060, 4064, 4068, 4072, 4076, 4080, 4084, 4088, 4092 },
/* Computed Parameter: DataStoreMemory13_InitialValue
* Referenced by: '<S1519>/Data Store Memory13'
* Referenced by: '<S1461>/Data Store Memory13'
*/
{ 1050, 1250, 1175, 1195, 1315, 1300, 1485, 1440, 1195 },
/* Computed Parameter: DataStoreMemory13_InitialValue_i
* Referenced by: '<S1520>/Data Store Memory13'
* Referenced by: '<S1462>/Data Store Memory13'
*/
{ 1225, 1320, 1270, 1540, 1480, 1175, 0, 0, 0 },
/* Computed Parameter: DataStoreMemory13_InitialValue_l
* Referenced by: '<S1521>/Data Store Memory13'
* Referenced by: '<S1463>/Data Store Memory13'
*/
{ 3075, 3075, 1605, 1840, 1650, 1635, 1820, 1650, 0 },
/* Pooled Parameter (Expression: [170:10:290])
* Referenced by:
* '<S792>/1-D Lookup Table'
* '<S792>/1-D Lookup Table1'
* '<S792>/1-D Lookup Table2'
* '<S792>/1-D Lookup Table3'
* '<S792>/1-D Lookup Table4'
* '<S792>/1-D Lookup Table5'
* '<S794>/1-D Lookup Table'
* '<S794>/1-D Lookup Table1'
* '<S794>/1-D Lookup Table2'
* '<S794>/1-D Lookup Table3'
* '<S794>/1-D Lookup Table4'
* '<S794>/1-D Lookup Table5'
* '<S1202>/1-D Lookup Table10'
* '<S1202>/1-D Lookup Table11'
* '<S1202>/1-D Lookup Table6'
* '<S1202>/1-D Lookup Table7'
* '<S1202>/1-D Lookup Table8'
* '<S1202>/1-D Lookup Table9'
* '<S1203>/1-D Lookup Table10'
* '<S1203>/1-D Lookup Table11'
* '<S1203>/1-D Lookup Table6'
* '<S1203>/1-D Lookup Table7'
* '<S1203>/1-D Lookup Table8'
* '<S1203>/1-D Lookup Table9'
*/
{ 170U, 180U, 190U, 200U, 210U, 220U, 230U, 240U, 250U, 260U, 270U, 280U, 290U
},
/* Pooled Parameter (Expression: [0:4:4092])
* Referenced by:
* '<S914>/1-D Lookup Table'
* '<S915>/1-D Lookup Table'
* '<S931>/1-D Lookup Table'
* '<S940>/1-D Lookup Table1'
* '<S940>/1-D Lookup Table2'
* '<S941>/1-D Lookup Table1'
* '<S941>/1-D Lookup Table2'
* '<S861>/1-D Lookup Table'
* '<S862>/1-D Lookup Table'
* '<S878>/1-D Lookup Table'
* '<S887>/1-D Lookup Table1'
* '<S887>/1-D Lookup Table2'
* '<S888>/1-D Lookup Table1'
* '<S888>/1-D Lookup Table2'
*/
{ 0U, 4U, 8U, 12U, 16U, 20U, 24U, 28U, 32U, 36U, 40U, 44U, 48U, 52U, 56U, 60U,
64U, 68U, 72U, 76U, 80U, 84U, 88U, 92U, 96U, 100U, 104U, 108U, 112U, 116U,
@ -916,44 +999,44 @@ const ConstP rtConstP = {
4080U, 4084U, 4088U, 4092U },
/* Computed Parameter: uDLookupTable1_bp01Data
* Referenced by: '<S1477>/1-D Lookup Table1'
* Referenced by: '<S1419>/1-D Lookup Table1'
*/
{ 10U, 50U },
/* Computed Parameter: ACT1_Value
* Referenced by: '<S1541>/ACT1'
* Referenced by: '<S1483>/ACT1'
*/
{ 1050U, 1250U, 1175U, 1195U, 1315U, 1300U, 1485U, 1440U, 1195U },
/* Computed Parameter: ACT1_Value_c
* Referenced by: '<S1611>/ACT1'
* Referenced by: '<S1553>/ACT1'
*/
{ 1225U, 1320U, 1270U, 1540U, 1480U, 1175U },
/* Computed Parameter: ACT1_Value_m
* Referenced by: '<S1682>/ACT1'
* Referenced by: '<S1624>/ACT1'
*/
{ 3075U, 3075U, 1605U, 1840U, 1650U, 1635U, 1820U, 1650U },
/* Pooled Parameter (Expression: [1 2 3 4 5 6 7 8 9])
* Referenced by:
* '<S1523>/Constant3'
* '<S1572>/Constant5'
* '<S1643>/Constant5'
* '<S1714>/Constant5'
* '<S1567>/Constant5'
* '<S1637>/Constant5'
* '<S1708>/Constant5'
* '<S1465>/Constant3'
* '<S1514>/Constant5'
* '<S1585>/Constant5'
* '<S1656>/Constant5'
* '<S1509>/Constant5'
* '<S1579>/Constant5'
* '<S1650>/Constant5'
*/
{ 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U },
/* Computed Parameter: Constant3_Value
* Referenced by: '<S1593>/Constant3'
* Referenced by: '<S1535>/Constant3'
*/
{ 1U, 2U, 3U, 4U, 5U, 6U },
/* Computed Parameter: Constant3_Value_d
* Referenced by: '<S1664>/Constant3'
* Referenced by: '<S1606>/Constant3'
*/
{ 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U },

68
HVAC_model_private.h Executable file → Normal file
View File

@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'HVAC_model'.
*
* Model version : 1.1140
* Model version : 1.1202
* Simulink Coder version : 24.1 (R2024a) 19-Nov-2023
* C/C++ source code generated on : Wed Jun 24 09:01:39 2026
* C/C++ source code generated on : Fri Jun 26 14:54:36 2026
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex-M
@ -76,7 +76,7 @@ preprocessor word size checks.
extern double rt_roundd(double u_0);
extern int16_t look1_is16lu64n32tu16Ds32Is16_binlcs(int16_t u0, const int16_t
bp0[], const uint16_t table[], uint32_t maxIndex);
extern uint32_t binsearch_u32s16(int16_t u_6, const int16_t bp[], uint32_t
extern uint32_t binsearch_u32s16(int16_t u_2, const int16_t bp[], uint32_t
startIndex, uint32_t maxIndex);
extern int16_t look1_is16lu64n32Ds32_binlcs(int16_t u0, const int16_t bp0[],
const int16_t table[], uint32_t maxIndex);
@ -84,22 +84,24 @@ extern int16_t look1_is16lu64n32tu8Ds16Is16_binlcs(int16_t u0, const int16_t
bp0[], const uint8_t table[], uint32_t maxIndex);
extern int16_t look1_is16lu64n32Ds32_binlcn(int16_t u0, const int16_t bp0[],
const int16_t table[], uint32_t maxIndex);
extern double look1_bs16ts16DdId_binlc(double u0, const int16_t bp0[], const
extern int16_t look1_bs16ts16Dd_binlc(double u0, const int16_t bp0[], const
int16_t table[], uint32_t maxIndex);
extern int16_t look1_is16bdlu64n48Ds32_binlcn(int16_t u0, const double bp0[],
const int16_t table[], uint32_t maxIndex);
extern uint8_t look2_iu8bu8s16lu64n32_binlcse(uint8_t u0, uint8_t u1, const
uint8_t bp0[], const int16_t bp1[], const uint8_t table[], const uint32_t
maxIndex[], uint32_t stride);
extern uint8_t look1_iu16lu64n48tu8_binlcse(uint16_t u0, const uint16_t bp0[],
const uint8_t table[], uint32_t maxIndex);
extern int16_t look1_iu16lu64n48ts16Ds32_binlcs(uint16_t u0, const uint16_t bp0[],
const int16_t table[], uint32_t maxIndex);
extern int16_t look1_iu16bs16lu64n32ts16Ds32_binlcs(uint16_t u0, const int16_t
bp0[], const int16_t table[], uint32_t maxIndex);
extern double look1_bs16ts16DdId_binlc(double u0, const int16_t bp0[], const
int16_t table[], uint32_t maxIndex);
extern int16_t look1_iu16tdIs16_binlcs(uint16_t u0, const uint16_t bp0[], const
double table[], uint32_t maxIndex);
extern double look1_iu16td_binlc(uint16_t u0, const uint16_t bp0[], const double
table[], uint32_t maxIndex);
extern int16_t look1_iu16bs16lu64n32ts16Ds32_binlcs(uint16_t u0, const int16_t
bp0[], const int16_t table[], uint32_t maxIndex);
extern uint32_t plook_u32s16_bincka(int16_t u_8, const int16_t bp[], uint32_t
extern uint32_t plook_u32s16_bincka(int16_t u_3, const int16_t bp[], uint32_t
maxIndex);
extern void get_tg_FLL_for_LVL(uint8_t rtu_ambient_Lvl, uint8_t rtu_set_tmp,
int16_t *rty_vals);
@ -233,42 +235,10 @@ extern void Level3_j(int8_t *rty_step, uint16_t *rtd_Blower_RL, uint16_t
*rtd_Valve_2_way, const int8_t
*rtd_step_start_controle_rear, const uint32_t *rtd_t_now,
DW_Level3_j *localDW);
extern void u1Incartarget(int16_t rtu_SET, uint8_t rtu_LVL, bool
rtu_set_has_half, int16_t *rty_y);
extern void Y1Y4FLL_tg_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void u(const int16_t rtu_y_in[5], double rty_y_fixed[5]);
extern void Amb_Tg(uint8_t rtu_LVL, int16_t *rty_y);
extern void X1X4FLL_tg_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y4FLL_tg_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void X1X4FLU_tg_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y4FLL_tg_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void FLL_tg_max(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void FLL_tg_min(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void is_ending_with_5(uint16_t rtu_SET, bool *rty_is_ending_with_5);
extern void X1X4FLU_tg_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void Y1Y4FLU_tg_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void X1X4FLU_tg_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y4FLU_tg_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void X1X4FLU_tg_sun_h(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y4FLU_tg_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void FXU_tg_min(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void u1Incartarget_e(int16_t rtu_SET, uint8_t rtu_LVL, bool
rtu_set_has_half, int16_t *rty_y);
extern void X1X4R_tg_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void Y1Y4R_tg_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void X1X4R_tg_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y4R_tg_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void X1X4R_tg_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y4R_tg_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void R_tg_max(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void R_tg_min(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void u1Incartarget_p(int16_t rtu_SET, uint8_t rtu_LVL, bool
rtu_set_has_half, int16_t *rty_y);
extern void u1Incartarget_l(int16_t rtu_SET, uint8_t rtu_LVL, bool
rtu_set_has_half, int16_t *rty_y);
extern void correctionrate(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void is_ending_with_5(uint16_t rtu_SET, bool *rty_is_ending_with_5);
extern void AMBRATE_RISING_DIFF8(uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_F);
extern void u_j(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_FALLING_F);
extern void u(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_FALLING_F);
extern void u_m(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_F);
extern void u_h(uint8_t rtu_lvl, uint16_t *rty_out);
extern void AMBRATE_FALLING_DIFF7(uint16_t *rty_f_g_ausINCARRATE_FALLING_DIFF_F);
@ -288,7 +258,7 @@ extern void u_g(uint8_t rtu_lvl, uint16_t *rty_out);
extern void AMBRATE_FALLING_DIFF7_a(uint16_t
*rty_f_g_ausINCARRATE_FALLING_DIFF_R);
extern void u_b(uint8_t rtu_lvl, uint16_t *rty_out);
extern void u_jy(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_RISING_R);
extern void u_j(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_RISING_R);
extern void u_d(uint8_t rtu_lvl, uint16_t *rty_f_g_ausINCARRATE_RISING_DIFF_R);
extern void u_jk(uint8_t rtu_lvl, uint16_t *rty_out);
extern void g_ausINCARRATE_RISING_DIFF_R8(uint16_t
@ -322,15 +292,9 @@ extern void RearLeftAFmanualdirections(bool rtu_Enable, uint8_t rtu_blowerspeed,
extern void funcg_ascAUTO_STEP_AF_F(int8_t rtu_AF_STEP, int8_t *rty_y);
extern void X1X4Vtg_FX_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void Y1Y4Vtg_FX_incar(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void Y1Y2Vtg_FL_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void X1X2Vtg_FX_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y2Vtg_FX_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Vtg_FX_plus_max(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void Vtg_FX_plus_min(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void X1X4Vtg_FX_incar_o(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void Y1Y4Vtg_FX_incar_o(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[5]);
extern void Amb_Tg(uint8_t rtu_LVL, int16_t *rty_y);
extern void Y1Y2Vtg_RL_amb(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void X1X2Vtg_FX_sun_p(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void X1X2Vtg_FX_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Y1Y2Vtg_RX_sun(int16_t rtu_SET, uint8_t rtu_LVL, int16_t rty_y[3]);
extern void Vtg_RX_plus_max(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);
extern void Vtg_RX_plus_min(int16_t rtu_SET, uint8_t rtu_LVL, int16_t *rty_y);

101
HVAC_model_types.h Executable file → Normal file
View File

@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'HVAC_model'.
*
* Model version : 1.1140
* Model version : 1.1202
* Simulink Coder version : 24.1 (R2024a) 19-Nov-2023
* C/C++ source code generated on : Wed Jun 24 09:01:39 2026
* C/C++ source code generated on : Fri Jun 26 14:54:36 2026
*
* Target selection: ert.tlc
* Embedded hardware selection: ARM Compatible->ARM Cortex-M
@ -186,6 +186,29 @@ typedef struct {
#endif
#ifndef DEFINED_TYPEDEF_FOR_CCU_Msg1_Bus_
#define DEFINED_TYPEDEF_FOR_CCU_Msg1_Bus_
typedef struct {
uint8_t CCU_MirrorHeating_Req;
uint8_t CCU_RecirculationLed_Cmd;
uint8_t CCU_DefrostLed_Req;
uint8_t CCU_SideWindowHeating_Req;
uint8_t CCU_RearWindowHeating_Req;
uint8_t CCU_FrontWindowHeating_Req;
uint8_t CCU_EmergAirCleaning_Stat;
uint8_t CCU_FireExtinguishSys_Stat;
uint8_t CCU_FLAutoPsngrLed_Cmd;
uint8_t CCU_FRAutoPsngrLed_Cmd;
uint8_t CCU_RLAutoPsngrLed_Cmd;
uint8_t CCU_RRAutoPsngrLed_Cmd;
uint8_t CCU_AC_MaxLed_Cmd;
uint8_t CCU_MSG1_RC;
uint8_t CCU_MSG1_CS;
} CCU_Msg1_Bus;
#endif
#ifndef DEFINED_TYPEDEF_FOR_ActuatorCmdBus_
#define DEFINED_TYPEDEF_FOR_ActuatorCmdBus_
@ -427,6 +450,80 @@ typedef struct {
#endif
#ifndef DEFINED_TYPEDEF_FOR_dbg_Auto_AF_Bus_
#define DEFINED_TYPEDEF_FOR_dbg_Auto_AF_Bus_
typedef struct {
uint8_t dbg_Auto_AF_MultMsg_Idx;
int16_t dbg_Auto_AF_Correct_FL;
int16_t dbg_Auto_AF_Correct_FR;
int16_t dbg_Auto_AF_Correct_RL;
int16_t dbg_Auto_AF_Correct_RR;
int16_t dbg_Auto_AF_Vtg_RL;
int16_t dbg_Auto_AF_Vtg_FL;
int16_t dbg_Auto_AF_Vtg_FR;
int16_t dbg_Auto_AF_Vtg_RR;
int16_t dbg_Auto_AF_Incar_RL;
int16_t dbg_Auto_AF_Incar_FR;
int16_t dbg_Auto_AF_Incar_RR;
int16_t dbg_Auto_AF_Incar_FL;
int16_t dbg_Auto_AF_Amb_RL;
int16_t dbg_Auto_AF_Amb_FR;
int16_t dbg_Auto_AF_Sun_RR;
int16_t dbg_Auto_AF_Amb_FL;
int16_t dbg_Auto_AF_Sun_FR;
int16_t dbg_Auto_AF_Sun_RL;
int16_t dbg_Auto_AF_Amb_RR;
int16_t dbg_Auto_AF_Sun_FL;
} dbg_Auto_AF_Bus;
#endif
#ifndef DEFINED_TYPEDEF_FOR_dbg_Auto_Duct_Bus_
#define DEFINED_TYPEDEF_FOR_dbg_Auto_Duct_Bus_
typedef struct {
uint8_t dbg_Auto_Duct_MultMsg_Idx;
int16_t dbg_Auto_Duct_Tgt_FL_Upper_ro;
int16_t dbg_Auto_Duct_Tg_Incar_FL_Upper_ro;
int16_t dbg_Auto_Duct_Tgt_RR_ro;
int16_t dbg_Auto_Duct_Tgt_RL_ro;
int16_t dbg_Auto_Duct_Tgt_FR_Upper_ro;
int16_t dbg_Auto_Duct_Tgt_FR_Lower_ro;
int16_t dbg_Auto_Duct_Tgt_FL_Lower_ro;
int16_t dbg_Auto_Duct_Tg_Incar_FR_Upper_ro;
int16_t dbg_Auto_Duct_Tg_FL_Upper_ro;
int16_t dbg_Auto_Duct_Tg_FL_Lower_ro;
int16_t dbg_Auto_Duct_Tg_FR_Lower_ro;
int16_t dbg_Auto_Duct_Tg_FR_Upper_ro;
int16_t dbg_Auto_Duct_Tg_RL_ro;
int16_t dbg_Auto_Duct_Tg_RR_ro;
int16_t dbg_Auto_Duct_Tg_Incar_FL_Lower_ro;
int16_t dbg_Auto_Duct_Incar_FL_Lower_ro;
int16_t dbg_Auto_Duct_Incar_RR_ro;
int16_t dbg_Auto_Duct_Incar_RL_ro;
int16_t dbg_Auto_Duct_Incar_FR_Upper_ro;
int16_t dbg_Auto_Duct_Incar_FR_Lower_ro;
int16_t dbg_Auto_Duct_Incar_FL_Upper_ro;
int16_t dbg_Auto_Duct_Tg_Incar_FR_Lower_ro;
int16_t dbg_Auto_Duct_Amb_RL_ro;
int16_t dbg_Auto_Duct_Amb_FR_Upper_ro;
int16_t dbg_Auto_Duct_Amb_FR_Lower_ro;
int16_t dbg_Auto_Duct_Amb_RR_ro;
int16_t dbg_Auto_Duct_Amb_FL_Lower_ro;
int16_t dbg_Auto_Duct_Amb_FL_Upper_ro;
int16_t dbg_Auto_Duct_Tg_Incar_RL_ro;
int16_t dbg_Auto_Duct_Sun_FL_Lower_ro;
int16_t dbg_Auto_Duct_Sun_FR_Lower_ro;
int16_t dbg_Auto_Duct_Sun_FR_Upper_ro;
int16_t dbg_Auto_Duct_Sun_RL_ro;
int16_t dbg_Auto_Duct_Sun_FL_Upper_ro;
int16_t dbg_Auto_Duct_Sun_RR_ro;
int16_t dbg_Auto_Duct_Tg_Incar_RR_ro;
} dbg_Auto_Duct_Bus;
#endif
#ifndef DEFINED_TYPEDEF_FOR_dbgCAN_dbg_Logic_Blower_Bus_
#define DEFINED_TYPEDEF_FOR_dbgCAN_dbg_Logic_Blower_Bus_

View File

@ -16,6 +16,19 @@ void ModelTask_Init(
tLinTaskActuator *linTaskActuator1,
tLinTaskActuator *linTaskActuator2,
tLinTaskActuator *linTaskActuator3,
tPwms *pwms,
tGpios *gpios,
tAdc0Task *adc0Task,
tAdc1Task *adc1Task,
tCanSpamReceiver *canSpamReceiver,
tCanSpamTransmitter *canSpamTransmitter,
tCanSpamDebugTransmitter *canSpamDebugTransmitter,
tDiagnostic *diagnostic,
tLoggerInterface *logger
) {
HVAC_model_initialize();
@ -24,6 +37,18 @@ void ModelTask_Init(
env->linTaskActuator2 = linTaskActuator2;
env->linTaskActuator3 = linTaskActuator3;
env->pwms = pwms;
env->gpios = gpios;
env->adc0Task = adc0Task;
env->adc1Task = adc1Task;
env->canSpamReceiver = canSpamReceiver;
env->canSpamTransmitter = canSpamTransmitter;
env->canSpamDebugTransmitter = canSpamDebugTransmitter;
env->diagnostic = diagnostic;
env->access = osMutexNew(NULL);
env->logger = logger;
InitThreadAtrStatic(&env->thread.attr, "ModelTask", env->thread.controlBlock, env->thread.stack, osPriorityNormal);
@ -218,20 +243,119 @@ static bool setActuatorBusy(tModelTask *env) {
static _Noreturn void ModelTask_Thread(tModelTask *env) {
for (;;) {
if (osMutexAcquire(env->access, 1000) == osOK) {
rtDW.t_now = SystemGetMs();
// LoggerFormatError(LOGGER, LOG_SIGN, "Step 1 = %d", SystemGetMs())
getCmdBusADCData(env->adc0Task, &rtDW.ADC_Data_Model);
// LoggerFormatError(LOGGER, LOG_SIGN, "Step 2 = %d", SystemGetMs())
getCmdBusADC2Data(env->adc1Task, (CmdBusADC2Data *)&rtDW.ADC_Data_Model.VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB);
// LoggerFormatError(LOGGER, LOG_SIGN, "Step 3 = %d", SystemGetMs())
// PWM_Get.pwmPercentFront = env->pwms->pwmFrontCaptureIO.getPwm(env->pwms->pwmFrontCaptureIO.env);
// PWM_Get.pwmPercentRear = env->pwms->pwmRearCaptureIO.getPwm(env->pwms->pwmRearCaptureIO.env);
// PWM_Get.pwmPercentFrontReserved = env->pwms->pwmFrontCaptureIO.getPwm(env->pwms->pwmFrontReservedCaptureIO.env);
// PWM_Get.pwmPercentRearReserved = env->pwms->pwmRearCaptureIO.getPwm(env->pwms->pwmRearReservedCaptureIO.env);
// LoggerFormatError(LOGGER, LOG_SIGN, "Step 4 = %d", SystemGetMs())
get_CanSpamReceiver(env->canSpamReceiver);
// LoggerFormatError(LOGGER, LOG_SIGN, "Step 5 = %d", SystemGetMs())
HVAC_model_step();
setActuatorBusy(env);
env->isRunning = true;
// Включение 5V (0 - ВКЛ)
GpioPinSet(&env->gpios->power.SW5V_EN, rtY.PowerEnable_Model.SW5V_EN);
// GpioPinSet(&env->gpios->power.SW5V_EN, true);
// Контроль напряжения борт-сети (1 - ВКЛ)
GpioPinSet(&env->gpios->power.PBATT_CK_EN, rtY.PowerEnable_Model.PBATT_CK_EN);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_Motor_Front_EN, rtY.PowerEnable_Model.Incar_Motor_Front_EN);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_EN_Diag, true);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_Motor_Rear_EN, rtY.PowerEnable_Model.Incar_Motor_Rear_EN);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.TwoWayValve_EN, rtY.PowerEnable_Model.TwoWayValve_EN);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.TwoWayValve_EN_Diag, true);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.ReservePower_EN, rtY.PowerEnable_Model.ReservePower_EN);
GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_ReservePowerOutput.EN_ReservePower, rtY.PowerEnable_Model.EN_ReservePower);
GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_PowerReserve.EN_PowerReserve, rtY.PowerEnable_Model.EN_PowerReserve);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver1_EN, rtY.PowerEnable_Model.PtcRelayDriver1_EN);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver_EN_Diag, true);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver2_EN, rtY.PowerEnable_Model.PtcRelayDriver2_EN);
GpioPinSet(&env->gpios->power.VN7008AJ_FrontLINActuatorPowerDriverAB.LIN_ActPower_AB, rtY.PowerEnable_Model.LIN_ActPower_AB);
GpioPinSet(&env->gpios->power.VN7008AJ_FrontLINActuatorPowerDriverAB.EN_CurrentSensing_AB, true);
GpioPinSet(&env->gpios->power.VN7008AJ_RearLINActuatorPowerDriverC.LIN_ActPower_C, rtY.PowerEnable_Model.LIN_ActPower_C);
GpioPinSet(&env->gpios->power.VN7008AJ_RearLINActuatorPowerDriverC.EN_CurrentSensing_C, true);
GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_ShutOFFValveBatteryChiller.EN_BATTChiller, rtY.PowerEnable_Model.EN_BATTChiller);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOffFront_EN, rtY.PowerEnable_Model.ShutOffFront_EN);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOff_EN_Diag, true);
GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOffRear_EN, rtY.PowerEnable_Model.ShutOffRear_EN);
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV1_EN, rtY.PowerEnable_Model.ShutOffTXV1_EN);
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV_EN_Diag, true);
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV2_EN, rtY.PowerEnable_Model.ShutOffTXV2_EN);
env->pwms->pwmFrontIo.setActivePercent(env->pwms->pwmFrontIo.env, rtY.PWM_Get_f.pwmPercentFront);
env->pwms->pwmRearIo.setActivePercent(env->pwms->pwmRearIo.env, rtY.PWM_Get_f.pwmPercentRear);
env->pwms->pwmFrontReservedIo.setActivePercent(env->pwms->pwmFrontReservedIo.env, rtY.PWM_Get_f.pwmPercentFrontReserved);
env->pwms->pwmRearReservedIo.setActivePercent(env->pwms->pwmRearReservedIo.env, rtY.PWM_Get_f.pwmPercentRearReserved);
memcpy(&env->ccu_candb_tx.CCU_Errors, &rtY.CCU_Errors_model, sizeof(env->ccu_candb_tx.CCU_Errors));
memcpy(&env->ccu_candb_tx.CCU_Stat1, &rtY.CCU_Stat1_model, sizeof(env->ccu_candb_tx.CCU_Stat1));
memcpy(&env->ccu_candb_tx.CCU_Stat2, &rtY.CCU_Stat2_model, sizeof(env->ccu_candb_tx.CCU_Stat2));
memcpy(&env->ccu_candb_tx.CCU_HVC_Req_Msg, &rtY.CCUCAN_HVC_REQ_MSG_MODEL, sizeof(env->ccu_candb_tx.CCU_HVC_Req_Msg));
memcpy(&env->ccu_candb_tx.CCU_Msg3, &rtY.CCU_Msg3_model, sizeof(env->ccu_candb_tx.CCU_Msg3));
memcpy(&env->ccu_candb_tx.CCU_Msg1, &rtY.CCU_Msg1_model, sizeof(env->ccu_candb_tx.CCU_Msg1));
set_CanSpamTransmitter(env->canSpamTransmitter, &env->ccu_candb_tx);
memcpy(&env->ccu_candb_dbg_tx.dbg_Act0, &rtY.dbgCAN_dbg_Act0_model, sizeof(env->ccu_candb_dbg_tx.dbg_Act0));
memcpy(&env->ccu_candb_dbg_tx.dbg_Act1, &rtY.dbgCAN_dbg_Act1_model, sizeof(env->ccu_candb_dbg_tx.dbg_Act1));
memcpy(&env->ccu_candb_dbg_tx.dbg_Act2, &rtY.dbgCAN_dbg_Act2_model, sizeof(env->ccu_candb_dbg_tx.dbg_Act2));
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Duct, &rtY.dbgCAN_dbg_Sen_Duct_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Duct));
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Eva, &rtY.dbgCAN_dbg_Sen_Eva_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Eva));
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Blower, &rtY.dbgCAN_dbg_Logic_Blower_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Blower));
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Amb, &rtY.dbgCAN_dbg_Sen_Amb_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Amb));
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Incar, &rtY.dbgCAN_dbg_Sen_Incar_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Incar));
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_0, &rtY.dbgCAN_dbg_Sen_0_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_0));
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Ac, &rtY.dbg_Logic_Ac_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Ac));
memcpy(&env->ccu_candb_dbg_tx.dbg_CCU_IO, &rtY.dbgCAN_CCU_IO_model, sizeof(env->ccu_candb_dbg_tx.dbg_CCU_IO));
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Rec, &rtY.dbgCAN_Logic_Rec_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Rec));
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_State, &rtY.dbgCAN_Logic_State_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_State));
memcpy(&env->ccu_candb_dbg_tx.dbg_Auto_AF, &rtY.dbgCAN_Auto_AF_model, sizeof(env->ccu_candb_dbg_tx.dbg_Auto_AF));
memcpy(&env->ccu_candb_dbg_tx.dbg_Auto_Duct, &rtY.dbgCAN_Auto_Duct_model, sizeof(env->ccu_candb_dbg_tx.dbg_Auto_Duct));
set_CanDebugSpamTransmitter(env->canSpamDebugTransmitter, &env->ccu_candb_dbg_tx);
set_Dtc_state(env->diagnostic);
// LoggerFormatError(LOGGER, LOG_SIGN, "Step END = %d", SystemGetMs())
env->isRunning = true;
osMutexRelease(env->access);
} else {
LoggerErrorStatic(LOGGER, LOG_SIGN, "Access error ModelTask_Thread");
}
SystemDelayMs(100);
SystemDelayMs(10);
}
}

View File

@ -10,11 +10,34 @@
#include "LoggerInterface.h"
#include "HVAC_model.h"
#include "LinActuatorTasks.h"
#include "AdcTasks.h"
#include "ccu_candb-binutil.h"
#include "ccu_candb_dbg-binutil.h"
#include "CanSpamTransmitter.h"
#include "CanSpamDebugTransmitter.h"
#include "Pwms.h"
#include "CanSpamReceiver.h"
#include "DiagnosticTask.h"
typedef struct {
tAdc0Task *adc0Task;
tAdc1Task *adc1Task;
tCanSpamReceiver *canSpamReceiver;
tCanSpamTransmitter *canSpamTransmitter;
tCanSpamDebugTransmitter *canSpamDebugTransmitter;
tGpios *gpios;
tPwms *pwms;
tDiagnostic *diagnostic;
ccu_candb_tx_t ccu_candb_tx;
ccu_candb_dbg_tx_t ccu_candb_dbg_tx;
osMutexId_t access;
tLoggerInterface *logger;
tLinTaskActuator *linTaskActuator1;
@ -44,6 +67,14 @@ void ModelTask_Init(
tLinTaskActuator *linTaskActuator1,
tLinTaskActuator *linTaskActuator2,
tLinTaskActuator *linTaskActuator3,
tPwms *pwms,
tGpios *gpios,
tAdc0Task *adc0Task,
tAdc1Task *adc1Task,
tCanSpamReceiver *canSpamReceiver,
tCanSpamTransmitter *canSpamTransmitter,
tCanSpamDebugTransmitter *canSpamDebugTransmitter,
tDiagnostic *diagnostic,
tLoggerInterface *logger
);