Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RadioPizza committed Jan 23, 2025
1 parent e123f57 commit 140239a
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 279 deletions.
2 changes: 1 addition & 1 deletion src/drivers/adxl345/adxl345.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "adxl345.h"
#include "spi.h"
#include "iostm8s103.h"
#include "my_iostm8s103.h"

/* Макросы для управления линией CS (Chip Select) */
#define ADXL345_CS_LOW() (PA_ODR &= ~(1 << 3)) /**< Установить линию CS в низкий уровень */
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/i2c/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

#include "i2c.h"
#include "iostm8s103.h"
#include "my_iostm8s103.h"

uint8_t I2C_Init(I2C_Mode_t mode)
{
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

#include "spi.h"
#include "iostm8s103.h"
#include "my_iostm8s103.h"

uint8_t SPI_Init(void)
{
Expand Down
9 changes: 4 additions & 5 deletions src/drivers/tim4/tim4.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

#include "tim4.h"
#include "iostm8s103.h"
#include "my_iostm8s103.h"

/** @brief Счетчик миллисекунд */
static volatile uint32_t milliseconds = 0;
Expand Down Expand Up @@ -40,9 +40,9 @@ uint32_t TIM4_GetMillis(void)
uint32_t ms;

/* Отключаем прерывания для атомарного чтения */
__asm__("sim");
_asm("sim");
ms = milliseconds;
__asm__("rim");
_asm("rim");

return ms;
}
Expand Down Expand Up @@ -76,8 +76,7 @@ void TIM4_GetTimeString(char* timeStr)
*
* Вызывается каждую миллисекунду, инкрементирует счетчик миллисекунд
*/
void TIM4_UPD_OVF_IRQHandler(void) __interrupt(23)
{
@interrupt void TIM4_UPD_OVF_IRQHandler(void) {
/* Инкремент счетчика миллисекунд */
milliseconds++;

Expand Down
268 changes: 0 additions & 268 deletions src/io_libs/iostm8s103.h

This file was deleted.

Loading

0 comments on commit 140239a

Please sign in to comment.