Skip to content

Commit

Permalink
MBR dooxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Humblot committed Jun 26, 2018
1 parent 2ac9a17 commit a87b76e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MasterBootRecord.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
///file MasterBootRecord.hpp
/// \brief Data structure containing the Master Boot record.
/// \details This contains the 4 partition tables that can be found on an SD card formatted with FAT32.

#ifndef PHAT_MASTER_BOOT_RECORD_HPP
#define PHAT_MASTER_BOOT_RECORD_HPP
#include "hwlib.hpp"
Expand All @@ -9,11 +13,21 @@ class MasterBootRecord {
bool usableDrive = false;

public:
/// \brief Default constructor
/// \details sets the usableDrive to false. Since if there are no partitions, the drive is useless
MasterBootRecord() : usableDrive( false ) {};

/// \brief Constructor with the 4 partition tables as argument
/// \details Also checks whether the drive is usable or not and sets the flag.
MasterBootRecord(Partition partition_table, Partition partition_table2, Partition partition_table3, Partition partition_table4);

/// \brief Checks wether this drive is usable;
bool isUsableDrive() {
return usableDrive;
}

/// \brief Returns the FAT address of the chosen partition.
/// \details the partitionNumber is 0-index based.
uint32_t getFatAddress(const uint8_t & PartitionNumber) {
return partition_tables[PartitionNumber].getFatTableLocation();
}
Expand Down

0 comments on commit a87b76e

Please sign in to comment.