Преглед изворни кода

Fix generation of the salt

Bernd Gottschlag пре 5 година
родитељ
комит
b10df03e01
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3
    3
      weather-sensor/firmware/main.c

+ 3
- 3
weather-sensor/firmware/main.c Прегледај датотеку

96
 	Set_Up_Power_Save_Mode();
96
 	Set_Up_Power_Save_Mode();
97
 
97
 
98
 	/* Initialize the salt */
98
 	/* Initialize the salt */
99
-	salt = 0xFFFFFFFFFFFFFFFFull;
100
-	salt &= ~ownId;
99
+	salt = 0xFFFFFFFFFFFFFF00ull;
100
+	salt |= ownId;
101
 
101
 
102
 	/* Delay the change of the operating frequency by the function Enter_Power_Save_Mode for the
102
 	/* Delay the change of the operating frequency by the function Enter_Power_Save_Mode for the
103
 	 * first function pass. If it is changed before the ISP can flash the MCU the clocks of the ISP
103
 	 * first function pass. If it is changed before the ISP can flash the MCU the clocks of the ISP
122
 
122
 
123
 			memset((uint8_t*)&reportPacket, 0, sizeof(reportPacket)); //Reinitialize the buffer with zeros
123
 			memset((uint8_t*)&reportPacket, 0, sizeof(reportPacket)); //Reinitialize the buffer with zeros
124
 
124
 
125
-			salt &= ~(1ull<<55);
125
+			salt &= ~(1ull<<63);
126
 			reportPacket.salt = salt;
126
 			reportPacket.salt = salt;
127
 			reportPacket.payload.values.packetIdentifier.elementCount = 3;
127
 			reportPacket.payload.values.packetIdentifier.elementCount = 3;
128
 			reportPacket.payload.values.packetIdentifier.packetType = PACKET_TYPE_REPORT;
128
 			reportPacket.payload.values.packetIdentifier.packetType = PACKET_TYPE_REPORT;

Loading…
Откажи
Сачувај