Skip to content

Instantly share code, notes, and snippets.

View fenske's full-sized avatar
🏗️

Anton Fenske fenske

🏗️
View GitHub Profile
@fenske
fenske / uart_transmit.cpp
Created December 9, 2022 21:53
This routine first waits until the TDR register is ready to accept new data, and then sends a chunk of data from the buffer to the TDR register. The chunk size is determined by the remaining length of the data buffer and the size of the TDR register. The routine continues sending chunks of data until all of the data in the buffer has been transm…
void uart_transmit(const uint8_t* data, size_t length) {
size_t i = 0;
while (i < length) {
// Wait until TDR is ready to accept new data
while ((*(volatile uint32_t*)(0xFC000000 + 0x8) & (1 << 23)) == 0);
// Send a chunk of data from the buffer
size_t chunk_size = MIN(length - i, 4);
*(volatile uint32_t*)(0xFC000000 + 0x14) = *(const uint32_t*)(data + i);
i += chunk_size;
from NIR3_func import * # Импорт модуля NIR3_func
# **********************
# Ввод рабочего каталога
# **********************
while True:
path = input("Введите путь рабочего каталога: ")
# os.chdir('C:\\Users\\Alexandr\\Desktop\\НИР')
if os.path.isdir(path):
#include <iostream>
#define N 5
using namespace std;
void calc(int* arr, int* sum, int* cnt)
{
int i, k = 0, s = 0;
for (i = 0; i < N; i++)
#include <iostream>
using namespace std;
#define N 5
int main()
{
string str1 = "hello chocolate crane plane long";
string str2 = "hi mushroom hello crocodile long";
#include <iostream>
using namespace std;
#define N 3
tuple<int, int> getMaxRow(int arr[][N]);
tuple<int, int> getMaxCol(int arr[][N]);
int main() {
#include <iostream>
using namespace std;
#define N 3
int main() {
int arr[N][N] =
{
{1, 2, 3},
#include <iostream>
using namespace std;
#define N 4
void f(int A[N][N], int B[N]);
int main() {
int A[N][N] = {
#include <iostream>
using namespace std;
#define N 3
tuple<int, int> findMaxIdx(float b[][N]);
int main() {
float b[N][N] = {
#include <iostream>
#include <cmath>
using namespace std;
#define N 3
// Количество строк матрицы А, сумма элементов каждой из которых меньше нуля.
#include <iostream>
#include <cmath>
using namespace std;
#define N 3
// Количество строк матрицы А, сумма элементов каждой из которых меньше нуля.