ARM GAS  /tmp/ccAH3LoS.s 			page 1


   1              		.cpu cortex-m4
   2              		.arch armv7e-m
   3              		.fpu fpv4-sp-d16
   4              		.eabi_attribute 27, 1
   5              		.eabi_attribute 28, 1
   6              		.eabi_attribute 20, 1
   7              		.eabi_attribute 21, 1
   8              		.eabi_attribute 23, 3
   9              		.eabi_attribute 24, 1
  10              		.eabi_attribute 25, 1
  11              		.eabi_attribute 26, 1
  12              		.eabi_attribute 30, 1
  13              		.eabi_attribute 34, 1
  14              		.eabi_attribute 18, 4
  15              		.file	"TMP1075.c"
  16              		.text
  17              	.Ltext0:
  18              		.cfi_sections	.debug_frame
  19              		.file 1 "Core/Src/TMP1075.c"
  20              		.section	.text.tmp1075_sensor_init,"ax",%progbits
  21              		.align	1
  22              		.global	tmp1075_sensor_init
  23              		.syntax unified
  24              		.thumb
  25              		.thumb_func
  27              	tmp1075_sensor_init:
  28              	.LVL0:
  29              	.LFB125:
   1:Core/Src/TMP1075.c **** #include "TMP1075.h"
   2:Core/Src/TMP1075.c **** 
   3:Core/Src/TMP1075.c **** #include <stdint.h>
   4:Core/Src/TMP1075.c **** #include <string.h>
   5:Core/Src/TMP1075.c **** 
   6:Core/Src/TMP1075.c **** #define MAX_TEMP        ((int16_t)(59 / 0.0625f))
   7:Core/Src/TMP1075.c **** #define MIN_TEMP        0
   8:Core/Src/TMP1075.c **** #define MAX_FAILED_TEMP 12 //TODO: change value for compliance with the actual number of sensors
   9:Core/Src/TMP1075.c **** #warning "change value for compliance with the actual number of sensors"
  10:Core/Src/TMP1075.c **** 
  11:Core/Src/TMP1075.c **** int16_t tmp1075_temps[N_TEMP_SENSORS] = {0};
  12:Core/Src/TMP1075.c **** 
  13:Core/Src/TMP1075.c **** 
  14:Core/Src/TMP1075.c **** I2C_HandleTypeDef* hi2c;
  15:Core/Src/TMP1075.c **** 
  16:Core/Src/TMP1075.c **** HAL_StatusTypeDef tmp1075_init(I2C_HandleTypeDef* handle) {
  17:Core/Src/TMP1075.c ****   hi2c = handle;
  18:Core/Src/TMP1075.c ****   for (int i = 0; i < N_TEMP_SENSORS; i++) {
  19:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
  20:Core/Src/TMP1075.c ****     if (status != HAL_OK) {
  21:Core/Src/TMP1075.c ****       return status;
  22:Core/Src/TMP1075.c ****     }
  23:Core/Src/TMP1075.c ****   }
  24:Core/Src/TMP1075.c ****   return HAL_OK;
  25:Core/Src/TMP1075.c **** }
  26:Core/Src/TMP1075.c **** 
  27:Core/Src/TMP1075.c **** 
  28:Core/Src/TMP1075.c **** HAL_StatusTypeDef tmp1075_measure() {
  29:Core/Src/TMP1075.c ****   for (int i = 0; i < N_TEMP_SENSORS; i++) {
ARM GAS  /tmp/ccAH3LoS.s 			page 2


  30:Core/Src/TMP1075.c ****     if (tmp1075_sensor_read(i, &tmp1075_temps[i]) != HAL_OK ||
  31:Core/Src/TMP1075.c ****         (tmp1075_temps[i] & 0x000F) != 0) {
  32:Core/Src/TMP1075.c ****           return HAL_ERROR;
  33:Core/Src/TMP1075.c ****         }
  34:Core/Src/TMP1075.c ****   
  35:Core/Src/TMP1075.c ****   return HAL_OK;
  36:Core/Src/TMP1075.c ****   }
  37:Core/Src/TMP1075.c **** }
  38:Core/Src/TMP1075.c **** 
  39:Core/Src/TMP1075.c **** HAL_StatusTypeDef tmp1075_sensor_init(int n) {
  30              		.loc 1 39 46 view -0
  31              		.cfi_startproc
  32              		@ args = 0, pretend = 0, frame = 8
  33              		@ frame_needed = 0, uses_anonymous_args = 0
  34              		.loc 1 39 46 is_stmt 0 view .LVU1
  35 0000 00B5     		push	{lr}
  36              		.cfi_def_cfa_offset 4
  37              		.cfi_offset 14, -4
  38 0002 85B0     		sub	sp, sp, #20
  39              		.cfi_def_cfa_offset 24
  40:Core/Src/TMP1075.c ****   uint16_t addr = (0b1000000 | n) << 1;
  40              		.loc 1 40 3 is_stmt 1 view .LVU2
  41              		.loc 1 40 35 is_stmt 0 view .LVU3
  42 0004 4100     		lsls	r1, r0, #1
  43 0006 41F08001 		orr	r1, r1, #128
  44 000a 09B2     		sxth	r1, r1
  45              		.loc 1 40 12 view .LVU4
  46 000c 89B2     		uxth	r1, r1
  47              	.LVL1:
  41:Core/Src/TMP1075.c ****   uint8_t data[] = {0};
  48              		.loc 1 41 3 is_stmt 1 view .LVU5
  49              		.loc 1 41 11 is_stmt 0 view .LVU6
  50 000e 0023     		movs	r3, #0
  51 0010 8DF80C30 		strb	r3, [sp, #12]
  42:Core/Src/TMP1075.c ****   return HAL_I2C_Master_Transmit(hi2c, addr, data, sizeof(data), 100);
  52              		.loc 1 42 3 is_stmt 1 view .LVU7
  53              		.loc 1 42 10 is_stmt 0 view .LVU8
  54 0014 6423     		movs	r3, #100
  55 0016 0093     		str	r3, [sp]
  56 0018 0123     		movs	r3, #1
  57 001a 03AA     		add	r2, sp, #12
  58 001c 0348     		ldr	r0, .L3
  59              	.LVL2:
  60              		.loc 1 42 10 view .LVU9
  61 001e 0068     		ldr	r0, [r0]
  62 0020 FFF7FEFF 		bl	HAL_I2C_Master_Transmit
  63              	.LVL3:
  43:Core/Src/TMP1075.c **** }
  64              		.loc 1 43 1 view .LVU10
  65 0024 05B0     		add	sp, sp, #20
  66              		.cfi_def_cfa_offset 4
  67              		@ sp needed
  68 0026 5DF804FB 		ldr	pc, [sp], #4
  69              	.L4:
  70 002a 00BF     		.align	2
  71              	.L3:
  72 002c 00000000 		.word	hi2c
ARM GAS  /tmp/ccAH3LoS.s 			page 3


  73              		.cfi_endproc
  74              	.LFE125:
  76              		.section	.text.tmp1075_init,"ax",%progbits
  77              		.align	1
  78              		.global	tmp1075_init
  79              		.syntax unified
  80              		.thumb
  81              		.thumb_func
  83              	tmp1075_init:
  84              	.LVL4:
  85              	.LFB123:
  16:Core/Src/TMP1075.c ****   hi2c = handle;
  86              		.loc 1 16 59 is_stmt 1 view -0
  87              		.cfi_startproc
  88              		@ args = 0, pretend = 0, frame = 0
  89              		@ frame_needed = 0, uses_anonymous_args = 0
  16:Core/Src/TMP1075.c ****   hi2c = handle;
  90              		.loc 1 16 59 is_stmt 0 view .LVU12
  91 0000 10B5     		push	{r4, lr}
  92              		.cfi_def_cfa_offset 8
  93              		.cfi_offset 4, -8
  94              		.cfi_offset 14, -4
  17:Core/Src/TMP1075.c ****   for (int i = 0; i < N_TEMP_SENSORS; i++) {
  95              		.loc 1 17 3 is_stmt 1 view .LVU13
  17:Core/Src/TMP1075.c ****   for (int i = 0; i < N_TEMP_SENSORS; i++) {
  96              		.loc 1 17 8 is_stmt 0 view .LVU14
  97 0002 074B     		ldr	r3, .L11
  98 0004 1860     		str	r0, [r3]
  18:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
  99              		.loc 1 18 3 is_stmt 1 view .LVU15
 100              	.LBB2:
  18:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
 101              		.loc 1 18 8 view .LVU16
 102              	.LVL5:
  18:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
 103              		.loc 1 18 12 is_stmt 0 view .LVU17
 104 0006 0024     		movs	r4, #0
 105              	.LVL6:
 106              	.L6:
  18:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
 107              		.loc 1 18 21 is_stmt 1 discriminator 1 view .LVU18
 108 0008 072C     		cmp	r4, #7
 109 000a 06DC     		bgt	.L10
 110              	.LBB3:
  19:Core/Src/TMP1075.c ****     if (status != HAL_OK) {
 111              		.loc 1 19 5 view .LVU19
  19:Core/Src/TMP1075.c ****     if (status != HAL_OK) {
 112              		.loc 1 19 32 is_stmt 0 view .LVU20
 113 000c 2046     		mov	r0, r4
 114 000e FFF7FEFF 		bl	tmp1075_sensor_init
 115              	.LVL7:
  20:Core/Src/TMP1075.c ****       return status;
 116              		.loc 1 20 5 is_stmt 1 view .LVU21
  20:Core/Src/TMP1075.c ****       return status;
 117              		.loc 1 20 8 is_stmt 0 view .LVU22
 118 0012 0346     		mov	r3, r0
 119 0014 10B9     		cbnz	r0, .L7
ARM GAS  /tmp/ccAH3LoS.s 			page 4


 120              	.LBE3:
  18:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
 121              		.loc 1 18 40 is_stmt 1 discriminator 2 view .LVU23
 122 0016 0134     		adds	r4, r4, #1
 123              	.LVL8:
  18:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
 124              		.loc 1 18 40 is_stmt 0 discriminator 2 view .LVU24
 125 0018 F6E7     		b	.L6
 126              	.LVL9:
 127              	.L10:
  18:Core/Src/TMP1075.c ****     HAL_StatusTypeDef status = tmp1075_sensor_init(i);
 128              		.loc 1 18 40 discriminator 2 view .LVU25
 129              	.LBE2:
  24:Core/Src/TMP1075.c **** }
 130              		.loc 1 24 10 view .LVU26
 131 001a 0023     		movs	r3, #0
 132              	.L7:
  25:Core/Src/TMP1075.c **** 
 133              		.loc 1 25 1 view .LVU27
 134 001c 1846     		mov	r0, r3
 135 001e 10BD     		pop	{r4, pc}
 136              	.LVL10:
 137              	.L12:
  25:Core/Src/TMP1075.c **** 
 138              		.loc 1 25 1 view .LVU28
 139              		.align	2
 140              	.L11:
 141 0020 00000000 		.word	hi2c
 142              		.cfi_endproc
 143              	.LFE123:
 145              		.section	.text.tmp1075_sensor_read,"ax",%progbits
 146              		.align	1
 147              		.global	tmp1075_sensor_read
 148              		.syntax unified
 149              		.thumb
 150              		.thumb_func
 152              	tmp1075_sensor_read:
 153              	.LVL11:
 154              	.LFB126:
  44:Core/Src/TMP1075.c **** 
  45:Core/Src/TMP1075.c **** HAL_StatusTypeDef tmp1075_sensor_read(int n, int16_t* res) {
 155              		.loc 1 45 60 is_stmt 1 view -0
 156              		.cfi_startproc
 157              		@ args = 0, pretend = 0, frame = 8
 158              		@ frame_needed = 0, uses_anonymous_args = 0
 159              		.loc 1 45 60 is_stmt 0 view .LVU30
 160 0000 10B5     		push	{r4, lr}
 161              		.cfi_def_cfa_offset 8
 162              		.cfi_offset 4, -8
 163              		.cfi_offset 14, -4
 164 0002 84B0     		sub	sp, sp, #16
 165              		.cfi_def_cfa_offset 24
 166 0004 0C46     		mov	r4, r1
  46:Core/Src/TMP1075.c ****   uint16_t addr = (0b1000000 | n) << 1;
 167              		.loc 1 46 3 is_stmt 1 view .LVU31
 168              		.loc 1 46 35 is_stmt 0 view .LVU32
 169 0006 4000     		lsls	r0, r0, #1
ARM GAS  /tmp/ccAH3LoS.s 			page 5


 170              	.LVL12:
 171              		.loc 1 46 35 view .LVU33
 172 0008 00B2     		sxth	r0, r0
 173              	.LVL13:
  47:Core/Src/TMP1075.c ****   addr |= 1; // Read
 174              		.loc 1 47 3 is_stmt 1 view .LVU34
 175              		.loc 1 47 8 is_stmt 0 view .LVU35
 176 000a 40F08100 		orr	r0, r0, #129
 177              	.LVL14:
  48:Core/Src/TMP1075.c ****   uint8_t result[2];
 178              		.loc 1 48 3 is_stmt 1 view .LVU36
  49:Core/Src/TMP1075.c ****   HAL_StatusTypeDef status =
 179              		.loc 1 49 3 view .LVU37
  50:Core/Src/TMP1075.c ****       HAL_I2C_Master_Receive(hi2c, addr, result, sizeof(result), 5); //5ms timeout for failure (cas
 180              		.loc 1 50 7 is_stmt 0 view .LVU38
 181 000e 0523     		movs	r3, #5
 182 0010 0093     		str	r3, [sp]
 183 0012 0223     		movs	r3, #2
 184 0014 03AA     		add	r2, sp, #12
 185 0016 81B2     		uxth	r1, r0
 186              	.LVL15:
 187              		.loc 1 50 7 view .LVU39
 188 0018 0648     		ldr	r0, .L16
 189              	.LVL16:
 190              		.loc 1 50 7 view .LVU40
 191 001a 0068     		ldr	r0, [r0]
 192 001c FFF7FEFF 		bl	HAL_I2C_Master_Receive
 193              	.LVL17:
  51:Core/Src/TMP1075.c ****   if (status == HAL_OK) {
 194              		.loc 1 51 3 is_stmt 1 view .LVU41
 195              		.loc 1 51 6 is_stmt 0 view .LVU42
 196 0020 30B9     		cbnz	r0, .L14
  52:Core/Src/TMP1075.c ****     *res = (result[0] << 8) | result[1];
 197              		.loc 1 52 5 is_stmt 1 view .LVU43
 198              		.loc 1 52 19 is_stmt 0 view .LVU44
 199 0022 9DF80C20 		ldrb	r2, [sp, #12]	@ zero_extendqisi2
 200              		.loc 1 52 37 view .LVU45
 201 0026 9DF80D30 		ldrb	r3, [sp, #13]	@ zero_extendqisi2
 202              		.loc 1 52 29 view .LVU46
 203 002a 43EA0223 		orr	r3, r3, r2, lsl #8
 204              		.loc 1 52 10 view .LVU47
 205 002e 2380     		strh	r3, [r4]	@ movhi
 206              	.L14:
  53:Core/Src/TMP1075.c ****   }
  54:Core/Src/TMP1075.c ****   return status;
 207              		.loc 1 54 3 is_stmt 1 view .LVU48
  55:Core/Src/TMP1075.c **** }
 208              		.loc 1 55 1 is_stmt 0 view .LVU49
 209 0030 04B0     		add	sp, sp, #16
 210              		.cfi_def_cfa_offset 8
 211              		@ sp needed
 212 0032 10BD     		pop	{r4, pc}
 213              	.LVL18:
 214              	.L17:
 215              		.loc 1 55 1 view .LVU50
 216              		.align	2
 217              	.L16:
ARM GAS  /tmp/ccAH3LoS.s 			page 6


 218 0034 00000000 		.word	hi2c
 219              		.cfi_endproc
 220              	.LFE126:
 222              		.section	.text.tmp1075_measure,"ax",%progbits
 223              		.align	1
 224              		.global	tmp1075_measure
 225              		.syntax unified
 226              		.thumb
 227              		.thumb_func
 229              	tmp1075_measure:
 230              	.LFB124:
  28:Core/Src/TMP1075.c ****   for (int i = 0; i < N_TEMP_SENSORS; i++) {
 231              		.loc 1 28 37 is_stmt 1 view -0
 232              		.cfi_startproc
 233              		@ args = 0, pretend = 0, frame = 0
 234              		@ frame_needed = 0, uses_anonymous_args = 0
 235 0000 08B5     		push	{r3, lr}
 236              		.cfi_def_cfa_offset 8
 237              		.cfi_offset 3, -8
 238              		.cfi_offset 14, -4
  29:Core/Src/TMP1075.c ****     if (tmp1075_sensor_read(i, &tmp1075_temps[i]) != HAL_OK ||
 239              		.loc 1 29 3 view .LVU52
 240              	.LBB4:
  29:Core/Src/TMP1075.c ****     if (tmp1075_sensor_read(i, &tmp1075_temps[i]) != HAL_OK ||
 241              		.loc 1 29 8 view .LVU53
 242              	.LVL19:
  29:Core/Src/TMP1075.c ****     if (tmp1075_sensor_read(i, &tmp1075_temps[i]) != HAL_OK ||
 243              		.loc 1 29 21 discriminator 1 view .LVU54
  30:Core/Src/TMP1075.c ****         (tmp1075_temps[i] & 0x000F) != 0) {
 244              		.loc 1 30 5 view .LVU55
  30:Core/Src/TMP1075.c ****         (tmp1075_temps[i] & 0x000F) != 0) {
 245              		.loc 1 30 9 is_stmt 0 view .LVU56
 246 0002 0849     		ldr	r1, .L24
 247 0004 0020     		movs	r0, #0
 248 0006 FFF7FEFF 		bl	tmp1075_sensor_read
 249              	.LVL20:
  30:Core/Src/TMP1075.c ****         (tmp1075_temps[i] & 0x000F) != 0) {
 250              		.loc 1 30 8 discriminator 1 view .LVU57
 251 000a 30B9     		cbnz	r0, .L20
  31:Core/Src/TMP1075.c ****           return HAL_ERROR;
 252              		.loc 1 31 23 view .LVU58
 253 000c 054B     		ldr	r3, .L24
 254 000e B3F90030 		ldrsh	r3, [r3]
  30:Core/Src/TMP1075.c ****         (tmp1075_temps[i] & 0x000F) != 0) {
 255              		.loc 1 30 61 discriminator 1 view .LVU59
 256 0012 13F00F0F 		tst	r3, #15
 257 0016 02D1     		bne	.L23
 258              	.L19:
 259              	.LBE4:
  37:Core/Src/TMP1075.c **** 
 260              		.loc 1 37 1 view .LVU60
 261 0018 08BD     		pop	{r3, pc}
 262              	.L20:
 263              	.LBB5:
  32:Core/Src/TMP1075.c ****         }
 264              		.loc 1 32 18 view .LVU61
 265 001a 0120     		movs	r0, #1
ARM GAS  /tmp/ccAH3LoS.s 			page 7


 266 001c FCE7     		b	.L19
 267              	.L23:
 268 001e 0120     		movs	r0, #1
 269 0020 FAE7     		b	.L19
 270              	.L25:
 271 0022 00BF     		.align	2
 272              	.L24:
 273 0024 00000000 		.word	tmp1075_temps
 274              	.LBE5:
 275              		.cfi_endproc
 276              	.LFE124:
 278              		.global	hi2c
 279              		.section	.bss.hi2c,"aw",%nobits
 280              		.align	2
 283              	hi2c:
 284 0000 00000000 		.space	4
 285              		.global	tmp1075_temps
 286              		.section	.bss.tmp1075_temps,"aw",%nobits
 287              		.align	2
 290              	tmp1075_temps:
 291 0000 00000000 		.space	16
 291      00000000 
 291      00000000 
 291      00000000 
 292              		.text
 293              	.Letext0:
 294              		.file 2 "/home/chiangni/.config/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-
 295              		.file 3 "/home/chiangni/.config/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-
 296              		.file 4 "Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f302x8.h"
 297              		.file 5 "Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h"
 298              		.file 6 "Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h"
 299              		.file 7 "Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h"
 300              		.file 8 "Core/Inc/TMP1075.h"
ARM GAS  /tmp/ccAH3LoS.s 			page 8


DEFINED SYMBOLS
                            *ABS*:00000000 TMP1075.c
     /tmp/ccAH3LoS.s:21     .text.tmp1075_sensor_init:00000000 $t
     /tmp/ccAH3LoS.s:27     .text.tmp1075_sensor_init:00000000 tmp1075_sensor_init
     /tmp/ccAH3LoS.s:72     .text.tmp1075_sensor_init:0000002c $d
     /tmp/ccAH3LoS.s:283    .bss.hi2c:00000000 hi2c
     /tmp/ccAH3LoS.s:77     .text.tmp1075_init:00000000 $t
     /tmp/ccAH3LoS.s:83     .text.tmp1075_init:00000000 tmp1075_init
     /tmp/ccAH3LoS.s:141    .text.tmp1075_init:00000020 $d
     /tmp/ccAH3LoS.s:146    .text.tmp1075_sensor_read:00000000 $t
     /tmp/ccAH3LoS.s:152    .text.tmp1075_sensor_read:00000000 tmp1075_sensor_read
     /tmp/ccAH3LoS.s:218    .text.tmp1075_sensor_read:00000034 $d
     /tmp/ccAH3LoS.s:223    .text.tmp1075_measure:00000000 $t
     /tmp/ccAH3LoS.s:229    .text.tmp1075_measure:00000000 tmp1075_measure
     /tmp/ccAH3LoS.s:273    .text.tmp1075_measure:00000024 $d
     /tmp/ccAH3LoS.s:290    .bss.tmp1075_temps:00000000 tmp1075_temps
     /tmp/ccAH3LoS.s:280    .bss.hi2c:00000000 $d
     /tmp/ccAH3LoS.s:287    .bss.tmp1075_temps:00000000 $d

UNDEFINED SYMBOLS
HAL_I2C_Master_Transmit
HAL_I2C_Master_Receive
