Skip to content

Commit

Permalink
Enable WireProtocol in nanoBooter (#177)
Browse files Browse the repository at this point in the history
- this was disabled when working on the HAL
- update CMake's
- cleanup code
- comment HAL time function because the declaration wasn't working in C

Signed-off-by: José Simões <[email protected]>
  • Loading branch information
josesimoes authored Mar 14, 2017
1 parent 2dca0eb commit df70969
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CMake/Modules/FindNF_Debugger.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# set include directories for nanoFramework Debugger
list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Debugger)
list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Messaging)
list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/WireProtocol)
list(APPEND NF_Debugger_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src/CLR/Include)

# source files for nanoFramework Debugger
Expand All @@ -13,13 +15,20 @@ set(NF_Debugger_SRCS
Debugger.cpp
Debugger_full.cpp

Messaging.cpp
WireProtocol.cpp

nanoSupport_CRC32.c
)

foreach(SRC_FILE ${NF_Debugger_SRCS})
set(NF_Debugger_SRC_FILE SRC_FILE-NOTFOUND)
find_file(NF_Debugger_SRC_FILE ${SRC_FILE}
PATHS
${PROJECT_SOURCE_DIR}/src/CLR/Debugger
${PROJECT_SOURCE_DIR}/src/CLR/Messaging
${PROJECT_SOURCE_DIR}/src/CLR/WireProtocol
${PROJECT_SOURCE_DIR}/src/CLR/Core

CMAKE_FIND_ROOT_PATH_BOTH
)
Expand Down
2 changes: 2 additions & 0 deletions CMake/Modules/FindWireProtocol.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ set(WireProtocol_SRCS
WireProtocol_HAL_Interface.c
WireProtocol_App_Interface.c

nanoSupport_CRC32.c
)

foreach(SRC_FILE ${WireProtocol_SRCS})
set(WireProtocol_SRC_FILE SRC_FILE-NOTFOUND)
find_file(WireProtocol_SRC_FILE ${SRC_FILE}
PATHS
${PROJECT_SOURCE_DIR}/src/CLR/WireProtocol
${PROJECT_SOURCE_DIR}/src/CLR/Core

CMAKE_FIND_ROOT_PATH_BOTH
)
Expand Down
2 changes: 1 addition & 1 deletion src/CLR/CorLib/CorLib_Native_System_TimeSpan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ HRESULT Library_corlib_native_System_TimeSpan::ToString___STRING( CLR_RT_StackFr
size_t iBuffer = ARRAYSIZE(rgBuffer);
CLR_INT64* val = GetValuePtr( stack ); FAULT_ON_NULL(val);

HAL_Time_TimeSpanToStringEx( *val, szBuffer, iBuffer );
// FIXME UNDONE HAL_Time_TimeSpanToStringEx( *val, szBuffer, iBuffer );

NANOCLR_SET_AND_LEAVE(stack.SetResult_String( rgBuffer ));

Expand Down
2 changes: 2 additions & 0 deletions src/CLR/WireProtocol/WireProtocol_Message.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// See LICENSE file in the project root for full license information.
//

#include <nanoHAL_Time.h>
#include <nanoSupport.h>
#include "WireProtocol_Message.h"

uint8_t receptionBuffer[2048];
Expand Down
3 changes: 0 additions & 3 deletions src/CLR/WireProtocol/WireProtocol_Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,4 @@ bool WP_Message_Process(WP_Message* message);
// helper functions
void ReplyToCommand(WP_Message* message, bool fSuccess, bool fCritical, void* ptr, int size);

//uint32_t SUPPORT_ComputeCRC(const void* rgBlock, int nLength, uint32_t crc);

#endif // _WIREPROTOCOL_MESSAGE_H_

2 changes: 1 addition & 1 deletion src/HAL/Include/nanoHAL_Time.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ HRESULT HAL_Time_AccDaysInMonth(INT32 year, INT32 month, INT32* days);
INT64 HAL_Time_FromSystemTime(const SYSTEMTIME* systemTime);

/// APIs to convert between types
BOOL HAL_Time_TimeSpanToStringEx( const INT64& ticks, LPSTR& buf, size_t& len );
// FIXME BOOL HAL_Time_TimeSpanToStringEx( const INT64& ticks, LPSTR& buf, size_t& len );
LPCSTR HAL_Time_CurrentDateTimeToString();

#endif //_NANOHAL_TIME_H_
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void ReceiverThread(void const * argument)
// loop until thread receives a request to terminate
while (!chThdShouldTerminateX()) {

// WP_CheckAvailableIncomingData();
WP_CheckAvailableIncomingData();

osDelay(500);
}
Expand Down

0 comments on commit df70969

Please sign in to comment.