Go报错:non-declaration statement outside function body

博客解释了在Go语言中遇到的'syntaxerror:non-declaration statement outside function body'错误,指出该错误意味着在函数外部的语句必须以关键字开头。解决方案是将语句放入函数体内。内容主要针对Go编程初学者。
go: downloading go.uber.org/zap v1.27.0 go: go.uber.org/zap upgrade => v1.27.0 go: downloading go.uber.org/multierr v1.10.0 # go.uber.org/zap/internal/pool D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:34:13: syntax error: unexpected any, expecting ] D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:40:6: missing function body D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:40:9: syntax error: unexpected [, expecting ( D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:40:28: method has no receiver D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:43:19: method has no receiver D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:43:20: syntax error: unexpected {, expecting ( D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:44:5: syntax error: unexpected return, expecting ) D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:45:4: syntax error: non-declaration statement outside function body D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:51:14: syntax error: unexpected [, expecting comma or ) D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:56:14: syntax error: unexpected [, expecting comma or ) D:\Work\Tools\Go\pkg\mod\go.uber.org\zap@v1.27.0\internal\pool\pool.go:40:6: too many errors note: module requires Go 1.19 # go.uber.org/multierr D:\Work\Tools\Go\pkg\mod\go.uber.org\multierr@v1.10.0\error.go:224:13: undefined: atomic.Bool note: module requires Go 1.19
09-20
Build started: Project: fish *** Using Compiler 'V6.24', folder: 'C:\Users\LJY\AppData\Local\Keil_v5\ARM\ARMCLANG\Bin' Build target 'Target 1' F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c(65): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c(65): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(478): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1204): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1204 | static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1205): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1205 | static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1207): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1207 | static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1208): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1208 | static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1210): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1210 | static __INLINE void __NOP() { __ASM volatile ("nop"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1211): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1211 | static __INLINE void __WFI() { __ASM volatile ("wfi"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1212): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1212 | static __INLINE void __WFE() { __ASM volatile ("wfe"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1213): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1213 | static __INLINE void __SEV() { __ASM volatile ("sev"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1214): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1214 | static __INLINE void __ISB() { __ASM volatile ("isb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1215): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1215 | static __INLINE void __DSB() { __ASM volatile ("dsb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1216): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1216 | static __INLINE void __DMB() { __ASM volatile ("dmb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1217): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1217 | static __INLINE void __CLREX() { __ASM volatile ("clrex"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1720): warning: function 'NVIC_SystemReset' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 1720 | { | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c(65): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(8297): error: 'stm32f10x_conf.h' file not found 8297 | #include "stm32f10x_conf.h" | ^~~~~~~~~~~~~~~~~~ 16 warnings and 1 error generated. compiling system_stm32f10x.c... main.c(1): warning: In file included from... .\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ .\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ .\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(478): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1204): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1204 | static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1205): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1205 | static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1207): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1207 | static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1208): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1208 | static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1210): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1210 | static __INLINE void __NOP() { __ASM volatile ("nop"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1211): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1211 | static __INLINE void __WFI() { __ASM volatile ("wfi"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1212): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1212 | static __INLINE void __WFE() { __ASM volatile ("wfe"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1213): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1213 | static __INLINE void __SEV() { __ASM volatile ("sev"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1214): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1214 | static __INLINE void __ISB() { __ASM volatile ("isb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1215): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1215 | static __INLINE void __DSB() { __ASM volatile ("dsb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1216): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1216 | static __INLINE void __DMB() { __ASM volatile ("dmb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1217): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1217 | static __INLINE void __CLREX() { __ASM volatile ("clrex"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1720): warning: function 'NVIC_SystemReset' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 1720 | { | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(4): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_adc.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(5): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_dma.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(6): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_exti.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(7): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_gpio.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(8): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_i2c.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(9): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_rcc.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(10): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_spi.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(11): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_tim.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(12): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_usart.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(13): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_wwdg.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ main.c(27): warning: no previous extern declaration for non-static variable 'sys_time_s' [-Wmissing-variable-declarations] 27 | volatile uint32_t sys_time_s = 0; | ^ main.c(27): note: declare 'static' if the variable is not intended to be used outside of this translation unit 27 | volatile uint32_t sys_time_s = 0; | ^ main.c(28): warning: no previous extern declaration for non-static variable 'current_temp' [-Wmissing-variable-declarations] 28 | float current_temp = 0.0f; | ^ main.c(28): note: declare 'static' if the variable is not intended to be used outside of this translation unit 28 | float current_temp = 0.0f; | ^ main.c(29): warning: no previous extern declaration for non-static variable 'current_tds' [-Wmissing-variable-declarations] 29 | float current_tds = 0.0f; | ^ main.c(29): note: declare 'static' if the variable is not intended to be used outside of this translation unit 29 | float current_tds = 0.0f; | ^ main.c(31): warning: no previous extern declaration for non-static variable 'rx_buffer' [-Wmissing-variable-declarations] 31 | char rx_buffer[64] = {0}; | ^ main.c(31): note: declare 'static' if the variable is not intended to be used outside of this translation unit 31 | char rx_buffer[64] = {0}; | ^ main.c(32): warning: no previous extern declaration for non-static variable 'rx_index' [-Wmissing-variable-declarations] 32 | uint8_t rx_index = 0; | ^ main.c(32): note: declare 'static' if the variable is not intended to be used outside of this translation unit 32 | uint8_t rx_index = 0; | ^ main.c(33): warning: no previous extern declaration for non-static variable 'rx_ready' [-Wmissing-variable-declarations] 33 | uint8_t rx_ready = 0; | ^ main.c(33): note: declare 'static' if the variable is not intended to be used outside of this translation unit 33 | uint8_t rx_ready = 0; | ^ main.c(36): warning: no previous extern declaration for non-static variable 'need_upload' [-Wmissing-variable-declarations] 36 | uint8_t need_upload = 0; | ^ main.c(36): note: declare 'static' if the variable is not intended to be used outside of this translation unit 36 | uint8_t need_upload = 0; | ^ main.c(37): warning: no previous extern declaration for non-static variable 'need_read_temp' [-Wmissing-variable-declarations] 37 | uint8_t need_read_temp = 0; | ^ main.c(37): note: declare 'static' if the variable is not intended to be used outside of this translation unit 37 | uint8_t need_read_temp = 0; | ^ main.c(38): warning: no previous extern declaration for non-static variable 'need_read_tds' [-Wmissing-variable-declarations] 38 | uint8_t need_read_tds = 0; | ^ main.c(38): note: declare 'static' if the variable is not intended to be used outside of this translation unit 38 | uint8_t need_read_tds = 0; | ^ main.c(74): warning: implicit conversion loses integer precision: 'uint16_t' (aka 'unsigned short') to 'char' [-Wimplicit-int-conversion] 74 | char c = USART_ReceiveData(USART2); | ~ ^~~~~~~~~~~~~~~~~~~~~~~~~ main.c(93): error: call to undeclared function 'OLED_Init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 93 | OLED_Init(); | ^ main.c(1): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(12): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_usart.h(50): warning: padding size of 'USART_InitTypeDef' with 2 bytes to alignment boundary [-Wpadded] 50 | typedef struct | ^ main.c(187): error: call to undeclared function 'NVIC_PriorityGroupConfig'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 187 | NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); | ^ main.c(187): error: use of undeclared identifier 'NVIC_PriorityGroup_2' 187 | NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); | ^ main.c(142): warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement] 142 | GPIO_InitTypeDef gpio; | ^ main.c(200): warning: implicit conversion loses integer precision: 'int' to 'int16_t' (aka 'short') [-Wimplicit-int-conversion] 200 | int16_t t = DS18B20_ReadByte() | (DS18B20_ReadByte() << 8); | ~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c(200): warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement] 200 | int16_t t = DS18B20_ReadByte() | (DS18B20_ReadByte() << 8); | ^ main.c(276): warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion] 276 | sprintf(str, "Temp:%.2fC", current_temp); | ~~~~~~~ ^~~~~~~~~~~~ main.c(279): warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion] 279 | sprintf(str, "TDS :%.2fNTU", current_tds); | ~~~~~~~ ^~~~~~~~~~~ main.c(282): warning: format specifies type 'int' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat] 282 | sprintf(str, "Time:%02dh%02d", (sys_time_s / 3600) % 24, (sys_time_s % 3600) / 60); | ~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~ | %02u main.c(282): warning: format specifies type 'int' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat] 282 | sprintf(str, "Time:%02dh%02d", (sys_time_s / 3600) % 24, (sys_time_s % 3600) / 60); | ~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~ | %02u main.c(274): warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement] 274 | char str[32]; | ^ main.c(295): warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion] 295 | int body_len = sprintf(json_body, "{\"temp\":%.2f,\"tds\":%.2f}", current_temp, current_tds); | ~~~~~~~ ^~~~~~~~~~~ main.c(295): warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion] 295 | int body_len = sprintf(json_body, "{\"temp\":%.2f,\"tds\":%.2f}", current_temp, current_tds); | ~~~~~~~ ^~~~~~~~~~~~ main.c(319): warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion] 319 | sprintf(buf, "New low threshold: %.1fC\r\n", temp_low_threshold); | ~~~~~~~ ^~~~~~~~~~~~~~~~~~ main.c(318): warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement] 318 | char buf[64]; | ^ main.c(328): warning: implicit conversion increases floating-point precision: 'float' to 'double' [-Wdouble-promotion] 328 | sprintf(buf, "New high threshold: %.1fC\r\n", temp_high_threshold); | ~~~~~~~ ^~~~~~~~~~~~~~~~~~~ main.c(327): warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement] 327 | char buf[64]; | ^ 71 warnings and 3 errors generated. compiling main.c... i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ .\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ .\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(478): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1204): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1204 | static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1205): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1205 | static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1207): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1207 | static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1208): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1208 | static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1210): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1210 | static __INLINE void __NOP() { __ASM volatile ("nop"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1211): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1211 | static __INLINE void __WFI() { __ASM volatile ("wfi"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1212): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1212 | static __INLINE void __WFE() { __ASM volatile ("wfe"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1213): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1213 | static __INLINE void __SEV() { __ASM volatile ("sev"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1214): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1214 | static __INLINE void __ISB() { __ASM volatile ("isb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1215): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1215 | static __INLINE void __DSB() { __ASM volatile ("dsb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1216): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1216 | static __INLINE void __DMB() { __ASM volatile ("dmb"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1217): warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 1217 | static __INLINE void __CLREX() { __ASM volatile ("clrex"); } | ^ | void F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/CoreSupport\core_cm3.h(1720): warning: function 'NVIC_SystemReset' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 1720 | { | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(4): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_adc.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(5): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_dma.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(6): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_exti.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(7): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_gpio.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(8): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_i2c.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(9): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_rcc.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(10): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_spi.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(11): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_tim.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(12): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_usart.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(1): warning: In file included from... .\i2c_oled.h(4): warning: In file included from... .\stm32f10x.h(8297): warning: In file included from... .\stm32f10x_conf.h(13): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc\stm32f10x_wwdg.h(32): warning: In file included from... F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(18): warning: invalid UTF-8 in comment [-Winvalid-utf8] 18 | * - To use or not the peripheral<92>s drivers in application code(i.e. | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(19): warning: invalid UTF-8 in comment [-Winvalid-utf8] 19 | * code will be based on direct access to peripheral<92>s registers | ^ F:/KEIL/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x\stm32f10x.h(26): warning: invalid UTF-8 in comment [-Winvalid-utf8] 26 | * - Macros to access peripheral<92>s registers hardware | ^ i2c_oled.c(15): error: use of undeclared identifier 'OLED_I2C_SCL_PIN' 15 | gpio.GPIO_Pin = OLED_I2C_SCL_PIN; | ^ i2c_oled.c(16): error: use of undeclared identifier 'OLED_I2C_SCL_PORT' 16 | GPIO_Init(OLED_I2C_SCL_PORT, &gpio); | ^ i2c_oled.c(17): error: use of undeclared identifier 'OLED_I2C_SDA_PIN' 17 | gpio.GPIO_Pin = OLED_I2C_SDA_PIN; | ^ i2c_oled.c(18): error: use of undeclared identifier 'OLED_I2C_SDA_PORT' 18 | GPIO_Init(OLED_I2C_SDA_PORT, &gpio); | ^ i2c_oled.c(21): error: use of undeclared identifier 'OLED_I2C_SCL_PORT' 21 | GPIO_SetBits(OLED_I2C_SCL_PORT, OLED_I2C_SCL_PIN); | ^ i2c_oled.c(21): error: use of undeclared identifier 'OLED_I2C_SCL_PIN' 21 | GPIO_SetBits(OLED_I2C_SCL_PORT, OLED_I2C_SCL_PIN); | ^ i2c_oled.c(22): error: use of undeclared identifier 'OLED_I2C_SDA_PORT' 22 | GPIO_SetBits(OLED_I2C_SDA_PORT, OLED_I2C_SDA_PIN); | ^ i2c_oled.c(22): error: use of undeclared identifier 'OLED_I2C_SDA_PIN' 22 | GPIO_SetBits(OLED_I2C_SDA_PORT, OLED_I2C_SDA_PIN); | ^ i2c_oled.c(23): error: use of undeclared identifier 'OLED_I2C_DELAY' 23 | OLED_I2C_DELAY; | ^ i2c_oled.c(26): error: use of undeclared identifier 'OLED_I2C_SDA_PORT' 26 | GPIO_ResetBits(OLED_I2C_SDA_PORT, OLED_I2C_SDA_PIN); | ^ i2c_oled.c(26): error: use of undeclared identifier 'OLED_I2C_SDA_PIN' 26 | GPIO_ResetBits(OLED_I2C_SDA_PORT, OLED_I2C_SDA_PIN); | ^ i2c_oled.c(27): error: use of undeclared identifier 'OLED_I2C_DELAY' 27 | OLED_I2C_DELAY; | ^ i2c_oled.c(28): error: use of undeclared identifier 'OLED_I2C_SCL_PORT' 28 | GPIO_ResetBits(OLED_I2C_SCL_PORT, OLED_I2C_SCL_PIN); // ??SCL???? | ^ i2c_oled.c(28): error: use of undeclared identifier 'OLED_I2C_SCL_PIN' 28 | GPIO_ResetBits(OLED_I2C_SCL_PORT, OLED_I2C_SCL_PIN); // ??SCL???? | ^ i2c_oled.c(33): error: use of undeclared identifier 'OLED_I2C_SCL_PORT' 33 | GPIO_ResetBits(OLED_I2C_SCL_PORT, OLED_I2C_SCL_PIN); | ^ i2c_oled.c(33): error: use of undeclared identifier 'OLED_I2C_SCL_PIN' 33 | GPIO_ResetBits(OLED_I2C_SCL_PORT, OLED_I2C_SCL_PIN); | ^ i2c_oled.c(34): error: use of undeclared identifier 'OLED_I2C_DELAY' 34 | OLED_I2C_DELAY; | ^ i2c_oled.c(35): error: use of undeclared identifier 'OLED_I2C_SDA_PORT' 35 | GPIO_ResetBits(OLED_I2C_SDA_PORT, OLED_I2C_SDA_PIN); | ^ i2c_oled.c(35): error: use of undeclared identifier 'OLED_I2C_SDA_PIN' 35 | GPIO_ResetBits(OLED_I2C_SDA_PORT, OLED_I2C_SDA_PIN); | ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 46 warnings and 20 errors generated. compiling i2c_oled.c... ".\Objects\fish.axf" - 23 Error(s), 133 Warning(s). Target not created. Build Time Elapsed: 00:00:02
最新发布
11-26
根据提供的引用内容,你在安装Erlang时遇到了一个错误:error: implicit declaration of function ‘FIPS_mode’ [-Werror=implicit-function-declaration]。这个错误通常是由于缺少OpenSSL库或版本不兼容引起的。为了解决这个问题,你可以尝试以下几个步骤: 1. 确保你的系统上已经安装了OpenSSL库。你可以使用以下命令来检查是否已安装: ```shell openssl version ``` 如果没有安装,你可以使用以下命令来安装: ```shell sudo apt-get install openssl ``` 2. 如果已经安装了OpenSSL库,但仍然遇到问题,可能是因为Erlang版本与OpenSSL版本不兼容。你可以尝试升级Erlang或降级OpenSSL来解决兼容性问题。 3. 如果你使用的是Ubuntu系统,你可以尝试使用Erlang Solutions仓库来安装Erlang。这个仓库提供了最新的Erlang版本,并且与系统的OpenSSL库兼容。你可以按照以下步骤添加仓库并安装Erlang: ```shell wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb sudo dpkg -i erlang-solutions_2.0_all.deb sudo apt-get update sudo apt-get install erlang ``` 4. 如果以上步骤都没有解决问题,你可以尝试在编译Erlang之前手动设置OpenSSL的路径。你可以使用以下命令来设置环境变量: ```shell export ERLANG_CRYPTO_INCLUDE_PATH=/path/to/openssl/include export ERLANG_CRYPTO_LIB_PATH=/path/to/openssl/lib ``` 将`/path/to/openssl`替换为你系统上实际的OpenSSL路径。 希望以上步骤能够帮助你解决安装Erlang时遇到的错误。如果你有任何其他问题,请随时提问。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值