Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/actions/setup/action.yaml

This file was deleted.

16 changes: 13 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- nucleo_f446re
- native_sim
- robin_nano
steps:
- name: 'Checkout'
uses: actions/checkout@v4

- name: 'Setup'
uses: ./.github/actions/setup
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: application
toolchains: all

- name: 'Build Firmware'
run: |
west build -b nucleo_f446re firmware -- -DBOARD_ROOT=.
west build -b ${{ matrix.board }} firmware -p -- -DBOARD_ROOT='${{ github.workspace }}'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Ignore the virtual environment
.venv

# Ignore the .west directory. It is created by the 'west init' command
.west

# Ignore external resources initialized by west
external

Expand Down
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@
"ctime": "cpp",
"regex": "cpp",
"istream": "cpp",
"sstream": "cpp"
"sstream": "cpp",
"iomanip": "cpp",
"cstring": "cpp",
"map": "cpp",
"fstream": "cpp",
"iostream": "cpp",
"cfenv": "cpp",
"version": "cpp",
"list": "cpp",
"set": "cpp"
},
"favorites.resources": [
{
Expand All @@ -84,4 +93,5 @@
"group": "Default"
}
],
"C_Cpp.clang_format_fallbackStyle": "Visual Studio",
}
7 changes: 0 additions & 7 deletions .west/config

This file was deleted.

8 changes: 7 additions & 1 deletion boards/mks/robin_nano/robin_nano.dts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
};
};

&clk_lsi {
status = "okay";
};

&clk_hse {
clock-frequency = <DT_FREQ_M(8)>;
status = "okay";
Expand Down Expand Up @@ -81,5 +85,7 @@ zephyr_udc0: &usbotg_fs {
};

&rtc {
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
status = "okay";
};
};
1 change: 1 addition & 0 deletions firmware/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source "subsys/logging/Kconfig.template.log_config"

rsource "lib/Kconfig"

rsource "src/mount/Kconfig"
rsource "src/processor/lx200/Kconfig"

menu "Zephyr"
Expand Down
1 change: 1 addition & 0 deletions firmware/boards/nucleo_f446re.overlay
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/ {
chosen {
zephyr,console = &usart2;
zephyr,uart-pipe = &usart2;
oaf,uart-control = &usart2;
};

Expand Down
10 changes: 2 additions & 8 deletions firmware/boards/robin_nano.overlay
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/ {
chosen {
zephyr,console = &usart3; // we can't use cdc acm as console because it lacks required amount of cdc acm endpoints
// we can't use cdc acm as console because it lacks required amount of cdc acm endpoints
zephyr,console = &usart3;
oaf,uart-control = &cdc_acm_uart0;
};
};
Expand All @@ -11,10 +12,3 @@
compatible = "zephyr,cdc-acm-uart";
};
};

&timers1 {
status = "okay";
pwm {
status = "okay";
};
};
41 changes: 0 additions & 41 deletions firmware/include/Mount.hpp

This file was deleted.

34 changes: 0 additions & 34 deletions firmware/include/MountCommand.hpp

This file was deleted.

34 changes: 34 additions & 0 deletions firmware/include/mount/IMount.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

class IMount
{
public:
virtual ~IMount() = default;

/**
* @brief Initialize the mount
*/
virtual void initialize() = 0;

/**
* @brief Set the Target Dec
*
* @param d degrees (-90 to +90)
* @param m arcminutes (0-59)
* @param s arcseconds (0-59)
*
* @return true if successful, false otherwise
*/
virtual bool setTargetDec(int d, unsigned int m, unsigned int s) = 0;

/**
* @brief Set the Target Ra
*
* @param h hours (0-23)
* @param m minutes (0-59)
* @param s seconds (0-59)
*
* @return true if successful, false otherwise
*/
virtual bool setTargetRa(unsigned int h, unsigned int m, unsigned int s) = 0;
};
39 changes: 39 additions & 0 deletions firmware/include/mount/Mount.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

#include <zephyr/kernel.h>

#include "IMount.hpp"

class Mount : public IMount
{
public:
Mount();
~Mount();

/**
* @brief Initialize the mount
*/
void initialize() override;

/**
* @brief Set the Target Dec
*
* @param d degrees (-90 to +90)
* @param m arcminutes (0-59)
* @param s arcseconds (0-59)
*
* @return true if successful, false otherwise
*/
bool setTargetDec(int d, unsigned int m, unsigned int s) override;

/**
* @brief Set the Target Ra
*
* @param h hours (0-23)
* @param m minutes (0-59)
* @param s seconds (0-59)
*
* @return true if successful, false otherwise
*/
bool setTargetRa(unsigned int h, unsigned int m, unsigned int s) override;
};
35 changes: 35 additions & 0 deletions firmware/include/mount/MountWorker.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#pragma once

#include <zephyr/kernel.h>

#include "Mount.hpp"
#include "IMount.hpp"

class MountWorker : public IMount
{
Mount &mount;

// k_work_q &mount_work_q;
// k_thread_stack_t *mount_work_stack;

K_KERNEL_STACK_MEMBER(thread_stack, 1024 * 16);

struct k_work_q work_q;
struct k_work_queue_config mount_work_q_config = {.name = "mount"};

public:
MountWorker(Mount &mount);

~MountWorker();

// IMount interface

void initialize() override;
bool setTargetDec(int d, unsigned int m, unsigned int s) override;
bool setTargetRa(unsigned int h, unsigned int m, unsigned int s) override;

// template <typename B>
// static void handler(struct k_work *work);
private:
auto submit(auto &&fn, auto... args) -> decltype(auto);
};
Loading