blob: 89adae257364cacab446794e2a0b785db9a22e95 [file] [log] [blame]
// Copyright 2023 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
#include <cstdint>
#include <Arduino.h>
#include <SPI.h>
#include "pw_log/log.h"
#include "gonk/pin_config.h"
using gonk::pin_config::PinConfig;
using gonk::pin_config::StatusLed;
namespace {
PinConfig pin_config = PinConfig();
} // namespace
int main() {
pin_config.Init();
pin_config.InitFpgaPins();
pin_config.FpgaHalt();
pin_config.FpgaEnable();
delay(10);
uint16_t update_count = 0;
while (true) {
PW_LOG_INFO("update: %u", update_count);
delay(1000);
update_count = (update_count + 1) % UINT16_MAX;
// Toggle status LED each loop.
if (update_count % 2 == 0) {
digitalWrite(StatusLed, HIGH);
} else {
digitalWrite(StatusLed, LOW);
}
}
return 0;
}