Skip to content

Commit

Permalink
Merge pull request #348 from Luos-io/rc_2.7.0
Browse files Browse the repository at this point in the history
Luos Engine release 2.7.0
  • Loading branch information
JeromeGalan authored Nov 3, 2022
2 parents 52c827c + 827a101 commit f01089e
Show file tree
Hide file tree
Showing 228 changed files with 2,546 additions and 258 deletions.
3 changes: 2 additions & 1 deletion .clang-format-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@

# Third party libs
./tool_services/gate/TinyJSON/tiny-json.h
./tool_services/gate/TinyJSON/tiny-json.c
./tool_services/gate/TinyJSON/tiny-json.c
./tool_services/pipe/WS/native/mongoose
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ jobs:
examples/projects/NUCLEO-F072RB,
examples/projects/NUCLEO-L073RZ,
examples/projects/STM32L4S5_discovery,
examples/projects/ESP32
examples/projects/ESP32,
examples/projects/native
]
os: [macos-latest, windows-latest, ubuntu-latest]

Expand Down Expand Up @@ -130,4 +131,4 @@ jobs:
needs: examples-build
runs-on: ubuntu-latest
steps:
- run: echo "Build succeed!"
- run: echo "Build succeed!"
31 changes: 16 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
**/.gitignore
*.out
*.log
/Examples/Projects/NUCLEO-G431KB/Button/.mxproject
/Examples/Projects/NUCLEO-G431KB/Button/Button.gpdsc
/Examples/Projects/NUCLEO-L432KC/Button/Button.gpdsc
/Examples/Projects/NUCLEO-L432KC/Button/.mxproject
/Examples/Projects/NUCLEO-L432KC/Gate/.mxproject
/Examples/Projects/NUCLEO-L432KC/Gate/Gate.gpdsc
/Examples/Projects/NUCLEO-L432KC/Led/Led.gpdsc
/Examples/Projects/NUCLEO-L432KC/Led/.mxproject
/Examples/Projects/STM32F4-discovery/Button/.mxproject
/Examples/Projects/STM32F4-discovery/Button/Button.gpdsc
/Examples/Projects/STM32F4-discovery/Gate/.mxproject
/Examples/Projects/STM32F4-discovery/Gate/Gate.gpdsc
/Examples/Projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/
/Examples/Projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/.generated_files/
/Examples/Projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/
/examples/projects/NUCLEO-G431KB/button/.mxproject
/examples/projects/NUCLEO-G431KB/button/Button.gpdsc
/examples/projects/NUCLEO-L432KC/button/Button.gpdsc
/examples/projects/NUCLEO-L432KC/button/.mxproject
/examples/projects/NUCLEO-L432KC/gate/.mxproject
/examples/projects/NUCLEO-L432KC/gate/Gate.gpdsc
/examples/projects/NUCLEO-L432KC/led/Led.gpdsc
/examples/projects/NUCLEO-L432KC/led/.mxproject
/examples/projects/STM32F4-discovery/Button/.mxproject
/examples/projects/STM32F4-discovery/Button/Button.gpdsc
/examples/projects/STM32F4-discovery/gate/.mxproject
/examples/projects/STM32F4-discovery/gate/Gate.gpdsc
/examples/projects/SAMD21XPLAINED/bootloader/firmware/luos_bootloader_samd21j18a.X/build/
/examples/projects/SAMD21XPLAINED/bootloader/firmware/luos_bootloader_samd21j18a.X/.generated_files/
/examples/projects/SAMD21XPLAINED/bootloader/firmware/luos_bootloader_samd21j18a.X/dist/
/tool_services/pipe/WS/native/mongoose
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![](https://img.shields.io/discord/902486791658041364?label=Discord&logo=discord&style=social)](http://bit.ly/JoinLuosDiscord)
[![](https://img.shields.io/reddit/subreddit-subscribers/Luos?style=social)](https://www.reddit.com/r/Luos)

Version: 2.6.4
Version: 2.7.0

# Luos Technology
## The most for the developer​
Expand Down
227 changes: 227 additions & 0 deletions engine/HAL/NATIVE/luos_hal.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
/******************************************************************************
* @file luosHAL
* @brief Luos Hardware Abstration Layer. Describe Low layer fonction
* @Family x86/Linux/Mac
* @author Luos
* @version 0.0.0
******************************************************************************/
#include "luos_hal.h"

#include <stdio.h>
#include <time.h>
#include <stdbool.h>
#include <string.h>

/*******************************************************************************
* Function
******************************************************************************/
static void LuosHAL_SystickInit(void);
static void LuosHAL_FlashInit(void);
static void LuosHAL_FlashEraseLuosMemoryInfo(void);

/////////////////////////Luos Library Needed function///////////////////////////

/******************************************************************************
* @brief Luos HAL general initialisation
* @param None
* @return None
******************************************************************************/
void LuosHAL_Init(void)
{
{
// Systick Initialization
LuosHAL_SystickInit();

// Flash Initialization
LuosHAL_FlashInit();

// start timestamp
LuosHAL_StartTimestamp();
}
}

/******************************************************************************
* @brief Luos HAL general disable IRQ
* @param None
* @return None
******************************************************************************/
void LuosHAL_SetIrqState(uint8_t Enable)
{
}

/******************************************************************************
* @brief Luos HAL general systick tick at 1ms initialize
* @param None
* @return tick Counter
******************************************************************************/
static void LuosHAL_SystickInit(void)
{
}

/******************************************************************************
* @brief Luos HAL general systick tick at 1ms
* @param None
* @return tick Counter
******************************************************************************/
uint32_t LuosHAL_GetSystick(void)
{
clock_t tick = clock();
return tick; // return tick
}

/******************************************************************************
* @brief Luos GetTimestamp
* @param None
* @return uint64_t
******************************************************************************/
uint64_t LuosHAL_GetTimestamp(void)
{
return (LuosHAL_GetSystick() * 1000);
}

/******************************************************************************
* @brief Luos start Timestamp
* @param None
* @return None
******************************************************************************/
void LuosHAL_StartTimestamp(void)
{
}

/******************************************************************************
* @brief Luos stop Timestamp
* @param None
* @return None
******************************************************************************/
void LuosHAL_StopTimestamp(void)
{
}

/******************************************************************************
* @brief Flash Initialisation
* @param None
* @return None
******************************************************************************/
static void LuosHAL_FlashInit(void)
{
for (uint16_t i = 0; i < FLASH_PAGE_NUMBER; i++)
{
for (uint16_t j = 0; j < FLASH_PAGE_SIZE; j++)
{
stub_flash_x86[i][j] = 0;
}
}
}

/******************************************************************************
* @brief Erase flash page where Luos keep permanente information
* @param None
* @return None
******************************************************************************/
static void LuosHAL_FlashEraseLuosMemoryInfo(void)
{
}

/******************************************************************************
* @brief Write flash page where Luos keep permanente information
* @param Address page / size to write / pointer to data to write
* @return
******************************************************************************/
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data)
{
}

/******************************************************************************
* @brief read information from page where Luos keep permanente information
* @param Address info / size to read / pointer callback data to read
* @return
******************************************************************************/
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data)
{
memset(data, 0xFF, size);
}

/******************************************************************************
* @brief Set boot mode in shared flash memory
* @param
* @return
******************************************************************************/
void LuosHAL_SetMode(uint8_t mode)
{
}

/******************************************************************************
* @brief Save node ID in shared flash memory
* @param Address, node_id
* @return
******************************************************************************/
void LuosHAL_SaveNodeID(uint16_t node_id)
{
}

/******************************************************************************
* @brief software reboot the microprocessor
* @param
* @return
******************************************************************************/
void LuosHAL_Reboot(void)
{
}

#ifdef BOOTLOADER_CONFIG
/******************************************************************************
* @brief DeInit Bootloader peripherals
* @param
* @return
******************************************************************************/
void LuosHAL_DeInit(void)
{
}

/******************************************************************************
* @brief DeInit Bootloader peripherals
* @param
* @return
******************************************************************************/
typedef void (*pFunction)(void); /*!< Function pointer definition */

void LuosHAL_JumpToApp(uint32_t app_addr)
{
}

/******************************************************************************
* @brief Return bootloader mode saved in flash
* @param
* @return
******************************************************************************/
uint8_t LuosHAL_GetMode(void)
{
}

/******************************************************************************
* @brief Get node id saved in flash memory
* @param Address
* @return node_id
******************************************************************************/
uint16_t LuosHAL_GetNodeID(void)
{
}

/******************************************************************************
* @brief erase sectors in flash memory
* @param Address, size
* @return
******************************************************************************/
void LuosHAL_EraseMemory(uint32_t address, uint16_t size)
{
}

/******************************************************************************
* @brief Save binary data in shared flash memory
* @param Address, size, data[]
* @return
******************************************************************************/
void LuosHAL_ProgramFlash(uint32_t address, uint16_t size, uint8_t *data)
{
}
#endif
58 changes: 58 additions & 0 deletions engine/HAL/NATIVE/luos_hal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/******************************************************************************
* @file luosHAL
* @brief Luos Hardware Abstration Layer. Describe Low layer fonction
* @Family x86/Linux/Mac
* @author Luos
* @version 0.0.0
******************************************************************************/
#ifndef _LUOSHAL_H_
#define _LUOSHAL_H_

#include <stdint.h>
#include <luos_hal_config.h>

/*******************************************************************************
* Definitions
******************************************************************************/
#ifndef _CRITICAL
#define _CRITICAL
#endif

#define LUOS_UUID ((uint32_t *)0x00000001)

#define ADDRESS_ALIASES_FLASH ADDRESS_LAST_PAGE_FLASH
#define ADDRESS_BOOT_FLAG_FLASH (ADDRESS_LAST_PAGE_FLASH + PAGE_SIZE) - 4

/*******************************************************************************
* Variables
******************************************************************************/

/*******************************************************************************
* Function
******************************************************************************/
void LuosHAL_Init(void);
void LuosHAL_SetIrqState(uint8_t Enable);
uint32_t LuosHAL_GetSystick(void);
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data);
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data);

// bootloader functions
void LuosHAL_SetMode(uint8_t mode);
void LuosHAL_Reboot(void);
void LuosHAL_SaveNodeID(uint16_t);

#ifdef BOOTLOADER_CONFIG
void LuosHAL_DeInit(void);
void LuosHAL_JumpToApp(uint32_t);
uint8_t LuosHAL_GetMode(void);
uint16_t LuosHAL_GetNodeID(void);
void LuosHAL_EraseMemory(uint32_t, uint16_t);
void LuosHAL_ProgramFlash(uint32_t, uint16_t, uint8_t *);
#endif

// timestamp functions
uint64_t LuosHAL_GetTimestamp(void);
void LuosHAL_StartTimestamp(void);
void LuosHAL_StopTimestamp(void);

#endif /* _LUOSHAL_H_ */
Loading

0 comments on commit f01089e

Please sign in to comment.