소스 검색

fixed issue. add/edit manually live

zinongli 1 년 전
부모
커밋
c0cc9861f9
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      t5577_writer.c

+ 8 - 2
t5577_writer.c

@@ -371,10 +371,16 @@ void uint32_to_byte_buffer(uint32_t block_data, uint8_t byte_buffer[4]) {
     byte_buffer[3] = block_data & 0xFF;
 }
 
-uint32_t byte_buffer_to_uint32(const uint8_t byte_buffer[4]) {
-    return ((uint32_t)(byte_buffer[0] << 24)) ;
+uint32_t byte_buffer_to_uint32(uint8_t byte_buffer[4]) {
+    uint32_t block_data = 0;
+    block_data |= ((uint32_t)byte_buffer[0] << 24);
+    block_data |= ((uint32_t)byte_buffer[1] << 16);
+    block_data |= ((uint32_t)byte_buffer[2] << 8);
+    block_data |= ((uint32_t)byte_buffer[3]);
+    return block_data;
 }
 
+
 static void t5577_writer_content_byte_input_confirmed(void* context) {
     T5577WriterApp* app = (T5577WriterApp*)context;
     T5577WriterModel* my_model = view_get_model(app->view_write);