"encourage" people to check the status return value
This commit is contained in:
		
							parent
							
								
									67983c1c98
								
							
						
					
					
						commit
						79ec05479d
					
				| @ -252,14 +252,14 @@ static uint8_t crc8; | ||||
| //
 | ||||
| static bool OWReset() { | ||||
|     bool presence; | ||||
|     ds2482_1w_reset(&presence); | ||||
|     (void)ds2482_1w_reset(&presence); | ||||
|     return presence; | ||||
| } | ||||
| 
 | ||||
| //--------------------------------------------------------------------------
 | ||||
| // Send 8 bits of data to the 1-Wire bus
 | ||||
| //
 | ||||
| static inline void OWWriteByte(uint8_t byte_value) { ds2482_1w_write_byte(byte_value); } | ||||
| static inline void OWWriteByte(uint8_t byte_value) { (void)ds2482_1w_write_byte(byte_value); } | ||||
| 
 | ||||
| //--------------------------------------------------------------------------
 | ||||
| // Send 1 bit of data to teh 1-Wire bus
 | ||||
|  | ||||
							
								
								
									
										24
									
								
								DS2482_HAL.h
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								DS2482_HAL.h
									
									
									
									
									
								
							| @ -17,16 +17,20 @@ | ||||
| #define DS2482_TIMEOUT_1W 100 | ||||
| #define DS2482_TIMEOUT_I2C 100 | ||||
| 
 | ||||
| HAL_StatusTypeDef ds2482_init(I2C_HandleTypeDef* handle); | ||||
| HAL_StatusTypeDef ds2482_reset(); | ||||
| HAL_StatusTypeDef ds2482_write_config(uint8_t config); | ||||
| HAL_StatusTypeDef ds2482_set_read_ptr(uint8_t read_ptr); | ||||
| HAL_StatusTypeDef ds2482_1w_reset(bool* presence); | ||||
| HAL_StatusTypeDef ds2482_1w_write_byte(uint8_t byte); | ||||
| HAL_StatusTypeDef ds2482_1w_read_byte(uint8_t* byte); | ||||
| HAL_StatusTypeDef ds2482_1w_triplet(uint8_t dir); | ||||
| 
 | ||||
| HAL_StatusTypeDef ds2482_1w_search(uint16_t max_devices, uint64_t devices[static max_devices]); | ||||
| HAL_StatusTypeDef ds2482_1w_verify_device(uint64_t device, bool* present); | ||||
| 
 | ||||
| #define nag_attr [[nodiscard("Check status for errors!")]] | ||||
| 
 | ||||
| nag_attr HAL_StatusTypeDef ds2482_init(I2C_HandleTypeDef* handle); | ||||
| nag_attr HAL_StatusTypeDef ds2482_reset(); | ||||
| nag_attr HAL_StatusTypeDef ds2482_write_config(uint8_t config); | ||||
| nag_attr HAL_StatusTypeDef ds2482_set_read_ptr(uint8_t read_ptr); | ||||
| nag_attr HAL_StatusTypeDef ds2482_1w_reset(bool* presence); | ||||
| nag_attr HAL_StatusTypeDef ds2482_1w_write_byte(uint8_t byte); | ||||
| nag_attr HAL_StatusTypeDef ds2482_1w_read_byte(uint8_t* byte); | ||||
| nag_attr HAL_StatusTypeDef ds2482_1w_triplet(uint8_t dir); | ||||
| 
 | ||||
| nag_attr HAL_StatusTypeDef ds2482_1w_search(uint16_t max_devices, uint64_t devices[static max_devices]); | ||||
| nag_attr HAL_StatusTypeDef ds2482_1w_verify_device(uint64_t device, bool* present); | ||||
| 
 | ||||
| #endif // DS2482_HAL_H
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user